Repository navigation
program: custom templates in the empty-state placeholder - #563
Merged
Merged
Conversation
Show every non-blank program template (built-ins + custom) as a clickable button in the empty-state placeholder, ordered by name and wrapped across rows, with a "+N more" overflow indicator and a smart-clip syntax + docs reference footer. Make the templates directory configurable and reload it live on every program open. - protocol: add optional `reference` field to ProgramTemplate + a default PROGRAM_DOCS_REFERENCE for built-ins. - daemon/storage: parse `reference:` frontmatter, carry the docs reference on built-ins, and support a program-templates-dir override (legacy canvas/templates migration stays default-location only). - daemon/config: add `[program].templates_dir` + CONSTRUCT_PROGRAM_TEMPLATES_DIR (env > config > default), documented in the config template; wire the resolved dir into Storage at startup. - cli/ui: render all non-blank templates as name-ordered, wrapping, fully clickable buttons within the pane width; overflow indicator; syntax line + reference footer; preserve the narrow/short plain fallback. - cli/app: background, non-blocking template refresh on program open so file edits/new files appear on the next open without a daemon restart. - specs: update 0049, add 0051.
Contributor
Author
|
Screenshot of the new empty-state placeholder — 6 custom templates (via The rendered frame and full clip are local artifacts (gh can't upload binary attachments to a comment — please drag them into the PR if you want them inline):
|
…e/frontmatter A custom program template is now just a .md file: its filename stem (prettified and title-cased) is its name, and the file contents are the program verbatim. Remove the per-template reference/docs-link feature and all custom-template frontmatter parsing. Built-ins keep their descriptions; custom templates carry none.
edwin-zvs
added a commit
that referenced
this pull request
Jun 29, 2026
…053, break pending_block_signatures compat main advanced with #569 (keep run shimmer alive past owning-session idle), which reworked the same shimmer lifecycle and added agent_managed to ProgramRunProgress, plus #563/#568 (specs 0051 custom-templates, 0052 session-removal-cascades). Reconcile: - protocol: keep pending_block_ids rename + the declared-shimmer types alongside #569's agent_managed field; DROP the pending_block_signatures serde alias (clean break, per request) and remove the legacy-compat test. - daemon: fold #569's agent_managed + inactivity-backstop refresh into the declaration-based narrow_program_run and set_program_run_pending so a complete/partial declaration also marks the run agent-managed; #569's AwaitingInput/terminal stop-signal split is preserved. Adapt #569's two lifecycle tests to the id-based API. - specs 0042/0048: combine #569's stop-signal model with the declared per-block-id model; my new spec collides with main's 0051/0052, renumbered to specs/0053-program-shimmer-block-addressing and all references updated. cargo test --workspace green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Custom program templates in the empty-state placeholder
Implements all five requested items. The empty-program onboarding placeholder now surfaces every template (built-ins + user-authored), the templates directory is configurable + live-reloading, and templates can carry a docs reference.
What changed (1–5)
inner.widthis kept (tested).[program].templates_dirconfig option andCONSTRUCT_PROGRAM_TEMPLATES_DIRenv override, resolved env > config > default (<data_dir>/program/templates). Resolved once at daemon start and threaded intoStoragevia a new override field. The legacycanvas/templates→program/templatesmigration still runs, but only for the default location (an explicit override is treated as operator-owned). Documented in the config template.Point 5 was flagged ambiguous. My interpretation:
referencefield toProgramTemplate(protocol) and to the template frontmatter (reference:key, URL value). Built-ins carry a defaultPROGRAM_DOCS_REFERENCE(https://github.com/zarvis-ai/agentd— swap this for the canonical program-docs URL if there's a better one).Docs:footer link, not one-per-button (a per-button link would blow out the compact button layout). It shows the first available reference; since built-ins always carry the docs link and the daemon returns them first, the footer is a stable "Docs:" link, while a user template'sreference:surfaces only when no earlier template has one.Syntax:reference:@{session:id}embeds ·@{harness:name}delegates · select + Run dispatches ·:::clip … :::groups output — consistent with what built-in templates demonstrate.If you'd rather show a per-template reference, or pick the reference from the display (name-sorted) order instead of daemon order, that's a small change — flagging for your call.
Tests
resolve_program_templates_dirprecedence (env > config > default),[program].templates_dirparse,reference:frontmatter parse, override redirects reads (and ignores the default dir).agentdlib (97) +agentd-protocol+ the cli placeholder suite pass. (One unrelated cli perf test —pty_render::…many_small_events_stay_fast— flakes under concurrent build load and passes in isolation; not touched by this PR.)Specs
0049-program-empty-state-onboarding.md(was capped at two buttons).0051-program-custom-templates-source.md(directory source, live reload, reference metadata).Binary
This PR touches
crates/daemon+crates/protocol+crates/cli; the single workspace binary isconstruct:/Users/moon/agentd/.claude/worktrees/program-custom-templates/target/debug/constructScreenshot of the new placeholder (8 templates — 6 custom via
CONSTRUCT_PROGRAM_TEMPLATES_DIR+ built-in Investigation/Tasks — name-ordered, wrapped across 2 rows, syntax line + Docs footer) posted as a comment.