feat(plugin): devagentic-canvas — slash commands + state-aware preamble - #6
Merged
Conversation
…le (#55) New plugin under plugins/devagentic-canvas/ following hermes' existing plugin pattern (kind=standalone, register() entrypoint, plugin.yaml manifest). Three pieces: * /canvas slash commands (list / open <id> / close / show / new <name>) over devagentic's /v1/canvas/* REST surface. * pre_llm_call hook that injects the active canvas's state as ephemeral context (appended to the user message — preserves prompt cache). * Plugin-scoped skill at skills/canvas/SKILL.md documenting when to surface a canvas-shaped layout. Active canvas tracked via ~/.hermes/canvas-active marker file (written by /canvas open, cleared by /canvas close). Survives process restart so long-lived sessions keep the canvas open across reconnects. Auth + base URL reuse the devagentic-local provider's env (DEVAGENTIC_BASE_URL, DEVAGENTIC_API_KEY, DEVAGENTIC_USER_ID / hermes_cli.profiles.get_active_profile_name()). The plugin never raises out of a slash command or hook — devagentic being down surfaces as user-facing error strings, not crashes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Closes devagentic#55. Lane D opener — single-repo PR on hermes-agent (no companion devagentic change; the
/v1/canvas/*REST surface already exists on devagentic from prior work).Summary
New plugin under
plugins/devagentic-canvas/following hermes' existing standalone-plugin pattern (kind=standalone,register()entrypoint,plugin.yamlmanifest — mirrorsplugins/spotify/+plugins/disk-cleanup/).Surface
/canvas list/canvas open <id>/canvas close/canvas show/canvas new <name>pre_llm_callhook{"context": ...}to the host (appended to user message — keeps prompt cache valid)devagentic-canvas:canvasskillActive-canvas marker
Tracked in
$HERMES_HOME/canvas-active(default~/.hermes/canvas-active) — a single-line file containing the canvas id. Written by/canvas open, cleared by/canvas close. Survives process restart so long-running sessions keep the canvas open across reconnects.Configuration
Reuses the devagentic-local provider's env (Phase G #50 + C1 #52):
DEVAGENTIC_BASE_URL— defaulthttp://127.0.0.1:6071/v1DEVAGENTIC_API_KEY— bearer (any value works underDEVAGENTIC_TRUST_HEADER=1)DEVAGENTIC_USER_ID— manual override, elsehermes_cli.profiles.get_active_profile_name()HERMES_HOME— location of thecanvas-activemarkerAcceptance (from devagentic#55)
hermes plugin listshowsdevagentic-canvas— verified by manifest parse test (test_manifest_parses_and_declares_expected_fields)./canvas listworks, preamble injects when canvas open — verified bytest_canvas_list_command+test_preamble_injects_context_when_active.Design calls
pre_llm_callhook, not a system-prompt prepend. The hermes contract forpre_llm_callappends returned context to the user message specifically to preserve prompt-cache validity (system prompt stays identical across turns). The plugin honors that: the canvas state is ephemeral per-turn context, not a permanent system instruction.~/.hermes/canvas-activesurvives process restart and is checkable by any tool (the/canvas showcommand, future debugging scripts, etc.) without needing the plugin loaded. Atomic write via.tmp + replace.None(hooks). A broken devagentic doesn't brick the session — it just yields a "couldn't reach devagentic" message in the slash output and no preamble injection._render_canvas_preamble.agent/conversation_loop.pyalready invokespre_llm_call(existing hermes infrastructure); slash command registration is via the standardregister_commandAPI. Disabling the plugin removes the entire surface with zero residual hermes-side changes.Layout
Deferred
/canvasinvocation when devagentic is down. A v1 could circuit-break after N consecutive failures.hermes plugin enable|disable— that's the existing hermes plugin CLI surface; no per-plugin work needed here.