feat(canvas): persist artifacts and surface UI

This commit is contained in:
William Valentin
2026-02-25 11:18:53 -08:00
parent ac60fa5be3
commit e3e98058b0
11 changed files with 330 additions and 5 deletions
+2
View File
@@ -1229,6 +1229,8 @@ Push tokens are returned as masked previews (`tokenPreview`) and never exposed i
### Canvas Methods
Canvas artifacts are stored per session and persisted to the gateway data directory so they survive daemon restarts.
#### `canvas.put`
Upsert a session-scoped canvas artifact.
+1
View File
@@ -144,6 +144,7 @@ Gateway streaming UX signals:
- WebSocket `agent.send` emits `run_state` lifecycle events (`start`, `cancel_requested`, `cancelled`, `complete`, `error`) for UI/state rendering.
- Routing applies reaction rules with deterministic priority/cooldown (and recursion guard) before intent routing.
- Companion nodes re-register `node.*` capabilities after reconnect; runtime clients can auto-reconnect and surface connection events.
- Canvas artifacts are persisted by the gateway so session UI surfaces can recover after daemon restarts.
Key files:
@@ -17,6 +17,7 @@ If you only want the protocol surface, see `docs/api/PROTOCOL.md`.
- Run lifecycle/cancel intent and reaction decisions are emitted to audit logs, and aggregated into `system.metrics` counters (runStates, cancelLatencyMs, reactions) for dashboards.
- Reaction matching is deterministic (priority + cooldown + recursion guard) before intent/agent routing.
- Companion `node.*` registration is per WebSocket connection; reconnects must re-register capabilities before invoking node RPC methods.
- Canvas artifacts are persisted per session under the gateway data directory for UI recovery across restarts.
## Component Map
+21 -1
View File
@@ -6717,10 +6717,30 @@
"docs/plans/state.json"
],
"test_status": "pnpm test:run src/companion/runtimeClient.test.ts src/cli/companion.test.ts passing"
},
"deeper-surfaces-phase3-canvas-persistence": {
"status": "completed",
"date": "2026-02-25",
"updated": "2026-02-25",
"summary": "Added durable canvas storage backed by the gateway data directory, surfaced a lightweight canvas inspection panel in the web chat UI, and documented persistence behavior with focused tests.",
"files_modified": [
"src/gateway/canvas-store.ts",
"src/gateway/canvas-store.test.ts",
"src/gateway/server.ts",
"src/daemon/services.ts",
"src/daemon/index.ts",
"src/gateway/ui/pages/chat.js",
"src/gateway/ui/pages/chat.test.ts",
"docs/api/PROTOCOL.md",
"docs/architecture/AGENT_DIAGRAM.md",
"docs/architecture/GATEWAY_SESSIONS_AND_QUEUE.md",
"docs/plans/state.json"
],
"test_status": "pnpm test:run src/gateway/canvas-store.test.ts src/gateway/ui/pages/chat.test.ts passing"
}
},
"overall_progress": {
"total_test_count": 2020,
"total_test_count": 2021,
"all_tests_passing": true,
"p0_completion": "3/3 (100%)",
"p1_completion": "4/4 (100%)",