pmx-canvas 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/.github/extensions/pmx-canvas/extension.mjs +3 -1
  2. package/.github/extensions/pmx-canvas/runtime.json +1 -1
  3. package/.github/extensions/pmx-canvas/tools.json +688 -128
  4. package/CHANGELOG.md +69 -0
  5. package/dist/amp-plugin/pmx-canvas/LICENSE +21 -0
  6. package/dist/amp-plugin/pmx-canvas/THIRD_PARTY_LICENSES.txt +331 -0
  7. package/dist/amp-plugin/pmx-canvas/index.js +5445 -0
  8. package/dist/amp-plugin/pmx-canvas/runtime.json +3 -0
  9. package/dist/amp-plugin/pmx-canvas/shared-runtime.mjs +194 -0
  10. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/SKILL.md +251 -0
  11. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/evals.json +1086 -0
  12. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/jwt.ts +17 -0
  13. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/login.ts +12 -0
  14. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/middleware.ts +13 -0
  15. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/routes/auth.ts +13 -0
  16. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/investigation-board/src/handlers/users.ts +27 -0
  17. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/mcp.json +36 -0
  18. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/ax-html-control-surface.md +101 -0
  19. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/codex-app-adapter.md +151 -0
  20. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/excalidraw-diagram-authoring.md +150 -0
  21. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/full-reference.md +1785 -0
  22. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/github-copilot-app-adapter.md +223 -0
  23. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/html-primitives.md +139 -0
  24. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/importing-context.md +132 -0
  25. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/installing-pmx-canvas.md +251 -0
  26. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/tours-and-recording.md +111 -0
  27. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/workbench-workflows.md +900 -0
  28. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas-orchestration/SKILL.md +141 -0
  29. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas-testing/SKILL.md +266 -0
  30. package/dist/amp-plugin/pmx-canvas/start-mcp.mjs +14857 -0
  31. package/dist/amp-plugin/pmx-canvas/tools.json +10963 -0
  32. package/dist/canvas/chunks/abnfDiagram-N423BO3Z-cwtsds5d.js +1 -0
  33. package/dist/canvas/chunks/architecture-TIHT7OUA-x63cwejs.js +1 -0
  34. package/dist/canvas/chunks/architectureDiagram-T3A2C74G-b4xc9tpz.js +36 -0
  35. package/dist/canvas/chunks/blockDiagram-VBNYF7ZC-ahp3yxxs.js +132 -0
  36. package/dist/canvas/chunks/c4Diagram-5PPSVZJV-nappnay7.js +10 -0
  37. package/dist/canvas/chunks/classDiagram-JCYQIIEL-k1j2xc1t.js +1 -0
  38. package/dist/canvas/chunks/classDiagram-v2-OCEON4UE-33x08xf2.js +1 -0
  39. package/dist/canvas/chunks/cose-bilkent-JH36ORCC-a428syda.js +1 -0
  40. package/dist/canvas/chunks/cynefin-VYW2F7L2-8v6jxfz8.js +1 -0
  41. package/dist/canvas/chunks/cynefinDiagram-MW4NZA55-nspsqebj.js +62 -0
  42. package/dist/canvas/chunks/dagre-VZM6K2ZE-8y6177fh.js +4 -0
  43. package/dist/canvas/chunks/diagram-7IWD3JNH-vym028wn.js +30 -0
  44. package/dist/canvas/chunks/diagram-B4RE2ZJO-jddqb8sy.js +3 -0
  45. package/dist/canvas/chunks/diagram-LBJQPF4R-bjwbpkrn.js +24 -0
  46. package/dist/canvas/chunks/diagram-Q27KOJAE-j6ph6hcx.js +24 -0
  47. package/dist/canvas/chunks/diagram-UB23O5K3-p09w8jej.js +41 -0
  48. package/dist/canvas/chunks/ebnfDiagram-BXEA7PRR-j975ycq5.js +1 -0
  49. package/dist/canvas/chunks/erDiagram-JOGREHBK-sxp6hjn8.js +85 -0
  50. package/dist/canvas/chunks/eventmodeling-45OFAUF4-xzfgn6xg.js +1 -0
  51. package/dist/canvas/chunks/flowDiagram-UKHOOZJN-2nsmkskb.js +1 -0
  52. package/dist/canvas/chunks/ganttDiagram-PKOTCBZU-4tv230y2.js +292 -0
  53. package/dist/canvas/chunks/gitGraph-TEB2WS4Q-macbhand.js +1 -0
  54. package/dist/canvas/chunks/gitGraphDiagram-DS77QQ5N-mqgmnw9g.js +106 -0
  55. package/dist/canvas/chunks/index-037z5dz2.js +232 -0
  56. package/dist/canvas/chunks/index-081n3har.js +207 -0
  57. package/dist/canvas/chunks/index-5n03dmb9.js +2 -0
  58. package/dist/canvas/chunks/index-5tv8v1hk.js +1 -0
  59. package/dist/canvas/chunks/index-60pgzdqe.js +157 -0
  60. package/dist/canvas/chunks/index-6ceya556.js +332 -0
  61. package/dist/canvas/chunks/index-8g1vb57n.js +2 -0
  62. package/dist/canvas/chunks/index-8rjes9r6.js +2 -0
  63. package/dist/canvas/chunks/index-9022d1n9.js +16 -0
  64. package/dist/canvas/chunks/index-9b02042t.js +2 -0
  65. package/dist/canvas/chunks/index-ap4q4vez.js +2 -0
  66. package/dist/canvas/chunks/index-dyp2nhd3.js +2 -0
  67. package/dist/canvas/chunks/index-frvta4tm.js +2 -0
  68. package/dist/canvas/chunks/index-gf4e0et4.js +2 -0
  69. package/dist/canvas/chunks/index-h9ycj8n2.js +2 -0
  70. package/dist/canvas/chunks/index-hj99nz1f.js +1 -0
  71. package/dist/canvas/chunks/index-mergmj97.js +2 -0
  72. package/dist/canvas/chunks/index-nwsya6dj.js +301 -0
  73. package/dist/canvas/chunks/index-nz8qbd1p.js +2 -0
  74. package/dist/canvas/chunks/index-qhfrazv3.js +2 -0
  75. package/dist/canvas/chunks/index-v119nznk.js +4 -0
  76. package/dist/canvas/chunks/index-vpt37m3d.js +89 -0
  77. package/dist/canvas/chunks/index-y9ma6azy.js +2 -0
  78. package/dist/canvas/chunks/index-zx0j3a2z.js +179 -0
  79. package/dist/canvas/chunks/info-DKCQHKI2-a0ykzs9z.js +1 -0
  80. package/dist/canvas/chunks/infoDiagram-6WML65LV-qv97qq6a.js +2 -0
  81. package/dist/canvas/chunks/ishikawaDiagram-WSZJBQD7-p9306gh0.js +70 -0
  82. package/dist/canvas/chunks/journeyDiagram-NVQOT4AX-sv67zats.js +139 -0
  83. package/dist/canvas/chunks/kanban-definition-27J2QSJJ-k2pfam6p.js +89 -0
  84. package/dist/canvas/chunks/katex-dmg8k4zm.js +257 -0
  85. package/dist/canvas/chunks/mermaid.core-83r0fdce.js +12 -0
  86. package/dist/canvas/chunks/mindmap-definition-FAOFIHXS-vg2newm1.js +96 -0
  87. package/dist/canvas/chunks/packet-7NZHBO7P-tqnabcdv.js +1 -0
  88. package/dist/canvas/chunks/pegDiagram-VL7TDLO6-k2h7zc5n.js +1 -0
  89. package/dist/canvas/chunks/pie-RZYD4A2V-wke6gyhe.js +1 -0
  90. package/dist/canvas/chunks/pieDiagram-7S7Q4E2Y-hg169p1v.js +39 -0
  91. package/dist/canvas/chunks/quadrantDiagram-CIZ2JOQS-bxtvsq0b.js +7 -0
  92. package/dist/canvas/chunks/radar-I7S5WNFK-w7ka0drw.js +1 -0
  93. package/dist/canvas/chunks/railroad-3IZDKUUU-y3vg318x.js +1 -0
  94. package/dist/canvas/chunks/railroad-abnf-AHOZXSZD-6hqvcz3c.js +1 -0
  95. package/dist/canvas/chunks/railroad-ebnf-EBAXGLYW-vcae260m.js +1 -0
  96. package/dist/canvas/chunks/railroad-peg-LSFZ7HO6-0dbyme23.js +1 -0
  97. package/dist/canvas/chunks/railroadDiagram-AXF67PYL-njyhcp4p.js +1 -0
  98. package/dist/canvas/chunks/requirementDiagram-LRYGKXZP-2z6v09gm.js +84 -0
  99. package/dist/canvas/chunks/sankeyDiagram-W5VNT64P-15mzam0e.js +40 -0
  100. package/dist/canvas/chunks/sequenceDiagram-SI44F4Z6-rbshyd2c.js +162 -0
  101. package/dist/canvas/chunks/sizeCapture-X5ZJPWSS-sg26xwts.js +1 -0
  102. package/dist/canvas/chunks/stateDiagram-OKZ733FA-6eahp98e.js +1 -0
  103. package/dist/canvas/chunks/stateDiagram-v2-UEYNNEHI-tty0ggn5.js +1 -0
  104. package/dist/canvas/chunks/swimlanes-SLNWSIFB-ze5db10t.js +1 -0
  105. package/dist/canvas/chunks/swimlanesDiagram-ULZ7WXOC-thze75gq.js +8 -0
  106. package/dist/canvas/chunks/timeline-definition-Z64GVDOM-vnp7jyy8.js +120 -0
  107. package/dist/canvas/chunks/treeView-QDETBFTQ-6ysffnm6.js +1 -0
  108. package/dist/canvas/chunks/treemap-6X3UGDF4-m3h9p066.js +1 -0
  109. package/dist/canvas/chunks/vennDiagram-T6HMQDX7-0qrnb7mj.js +34 -0
  110. package/dist/canvas/chunks/wardley-OPB4EBWU-dp37drwx.js +1 -0
  111. package/dist/canvas/chunks/wardleyDiagram-T6FBY63Y-8nxg8wqt.js +78 -0
  112. package/dist/canvas/chunks/xychartDiagram-ELKLHX3M-nj921e7s.js +7 -0
  113. package/dist/canvas/global.css +483 -230
  114. package/dist/canvas/index.js +158 -219
  115. package/dist/canvas/mcp-app.html +4301 -548
  116. package/dist/canvas/mermaid-entry.js +338 -338
  117. package/dist/canvas/surface-theme.css +6 -6
  118. package/dist/json-render/index.css +1 -1
  119. package/dist/json-render/index.js +49 -49
  120. package/dist/types/client/canvas/BarHint.d.ts +5 -3
  121. package/dist/types/client/canvas/BoardMoveDialog.d.ts +2 -0
  122. package/dist/types/client/canvas/CanvasNode.d.ts +0 -11
  123. package/dist/types/client/canvas/EdgeEditor.d.ts +19 -0
  124. package/dist/types/client/canvas/EdgeLayer.d.ts +1 -2
  125. package/dist/types/client/canvas/GroupNavigation.d.ts +2 -0
  126. package/dist/types/client/canvas/TextPrompt.d.ts +4 -0
  127. package/dist/types/client/canvas/auto-fit.d.ts +4 -5
  128. package/dist/types/client/mermaid-entry.d.ts +1 -2
  129. package/dist/types/client/mermaid-render.d.ts +1 -0
  130. package/dist/types/client/nodes/BoardNode.d.ts +1 -1
  131. package/dist/types/client/nodes/ExtAppFrame.d.ts +7 -90
  132. package/dist/types/client/nodes/McpAppNode.d.ts +1 -25
  133. package/dist/types/client/nodes/MermaidNode.d.ts +1 -8
  134. package/dist/types/client/nodes/PromptNode.d.ts +1 -0
  135. package/dist/types/client/nodes/ViewerFrame.d.ts +29 -0
  136. package/dist/types/client/nodes/ViewerHost.d.ts +6 -0
  137. package/dist/types/client/nodes/WorkCard.d.ts +7 -0
  138. package/dist/types/client/nodes/iframe-document-url.d.ts +3 -9
  139. package/dist/types/client/nodes/primitive-copy.d.ts +5 -0
  140. package/dist/types/client/nodes/use-ax-surface-bridge.d.ts +1 -0
  141. package/dist/types/client/nodes/use-iframe-content-height.d.ts +1 -1
  142. package/dist/types/client/nodes/use-surface-frame.d.ts +4 -6
  143. package/dist/types/client/nodes/viewer-runtime-state.d.ts +2 -1
  144. package/dist/types/client/state/canvas-store.d.ts +18 -1
  145. package/dist/types/client/state/human-store.d.ts +2 -0
  146. package/dist/types/client/state/intent-bridge.d.ts +5 -2
  147. package/dist/types/client/state/presentation.d.ts +17 -6
  148. package/dist/types/client/state/relation-store.d.ts +11 -0
  149. package/dist/types/client/types.d.ts +1 -1
  150. package/dist/types/json-render/catalog.d.ts +2 -2
  151. package/dist/types/json-render/server.d.ts +2 -1
  152. package/dist/types/server/agent-presence.d.ts +1 -0
  153. package/dist/types/server/ax-interaction.d.ts +1 -0
  154. package/dist/types/server/ax-state-manager.d.ts +10 -2
  155. package/dist/types/server/board-local.d.ts +4 -0
  156. package/dist/types/server/board-move.d.ts +38 -0
  157. package/dist/types/server/canvas-db.d.ts +12 -2
  158. package/dist/types/server/canvas-operations.d.ts +5 -6
  159. package/dist/types/server/canvas-provenance.d.ts +1 -1
  160. package/dist/types/server/canvas-serialization.d.ts +1 -0
  161. package/dist/types/server/canvas-state.d.ts +86 -20
  162. package/dist/types/server/card-relocation.d.ts +6 -0
  163. package/dist/types/server/context-reads.d.ts +3 -1
  164. package/dist/types/server/human-presence.d.ts +1 -1
  165. package/dist/types/server/index.d.ts +26 -10
  166. package/dist/types/server/intent-registry.d.ts +8 -4
  167. package/dist/types/server/knowledge-lifecycle.d.ts +4 -2
  168. package/dist/types/server/mutation-history.d.ts +7 -5
  169. package/dist/types/server/operations/ops/boards.d.ts +0 -1
  170. package/dist/types/server/operations/registry.d.ts +2 -0
  171. package/dist/types/server/tour-control.d.ts +13 -3
  172. package/dist/types/server/trace-manager.d.ts +1 -0
  173. package/dist/types/shared/ax-kinds.d.ts +6 -0
  174. package/dist/types/shared/ax-surface-protocol.d.ts +8 -9
  175. package/dist/types/shared/human-presence.d.ts +1 -0
  176. package/dist/types/shared/lifecycle-status.d.ts +2 -0
  177. package/dist/types/shared/tour.d.ts +8 -0
  178. package/docs/RELEASE.md +21 -14
  179. package/docs/agent-plugin.md +16 -2
  180. package/docs/amp-plugin.md +271 -0
  181. package/docs/cli.md +42 -3
  182. package/docs/design/Chrome.dc.html +32 -6
  183. package/docs/design/GuestName.dc.html +50 -0
  184. package/docs/design/PluginLogo.svg +7 -0
  185. package/docs/design/Types1.dc.html +3 -2
  186. package/docs/design/Types2.dc.html +1 -1
  187. package/docs/design/Types3.dc.html +1 -1
  188. package/docs/design/WorkCards.dc.html +39 -0
  189. package/docs/design/Zoom.dc.html +37 -60
  190. package/docs/design/canvas.json +17 -1
  191. package/docs/design/plugin-logo.png +0 -0
  192. package/docs/design.md +280 -12
  193. package/docs/evals/agents-md-sections.md +38 -0
  194. package/docs/http-api.md +179 -11
  195. package/docs/mcp.md +69 -9
  196. package/docs/node-types.md +109 -4
  197. package/docs/plans/plan-009-tech-debt-backlog.md +3 -3
  198. package/docs/plans/plan-019-post-0.9-roadmap.md +327 -31
  199. package/docs/plans/plan-020-wave-5-work-planning.md +553 -0
  200. package/docs/product-vision-2026-09.md +42 -17
  201. package/docs/sdk.md +18 -0
  202. package/package.json +7 -4
  203. package/plugins/pmx-canvas/assets/preview.png +0 -0
  204. package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/extension.mjs +3 -1
  205. package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/runtime.json +1 -1
  206. package/plugins/pmx-canvas/plugin.json +2 -2
  207. package/plugins/pmx-canvas/runtime.json +1 -1
  208. package/plugins/pmx-canvas/tools.json +688 -128
  209. package/skills/data-analysis/SKILL.md +13 -26
  210. package/skills/frontend-design/LICENSE.txt +177 -0
  211. package/skills/frontend-design/SKILL.md +3 -0
  212. package/skills/pmx-canvas/SKILL.md +232 -849
  213. package/skills/pmx-canvas/evals/evals.json +26 -3
  214. package/skills/pmx-canvas/references/full-reference.md +89 -24
  215. package/skills/pmx-canvas/references/html-primitives.md +7 -0
  216. package/skills/pmx-canvas/references/installing-pmx-canvas.md +6 -6
  217. package/skills/pmx-canvas/references/tours-and-recording.md +29 -2
  218. package/skills/pmx-canvas/references/workbench-workflows.md +900 -0
  219. package/skills/pmx-canvas-testing/SKILL.md +7 -5
  220. package/skills/published-consumer-e2e/SKILL.md +25 -8
  221. package/skills/published-consumer-e2e/scripts/run-published-consumer-e2e.sh +51 -77
  222. package/skills/web-artifacts-builder/LICENSE.txt +202 -0
  223. package/skills/web-artifacts-builder/SKILL.md +6 -0
  224. package/skills/web-artifacts-builder/scripts/init-artifact.sh +2 -2
  225. package/src/cli/commands/apps.ts +1 -0
  226. package/src/cli/commands/boards.ts +30 -0
  227. package/src/client/App.tsx +20 -4
  228. package/src/client/canvas/AttentionHistory.tsx +10 -2
  229. package/src/client/canvas/BarHint.tsx +6 -3
  230. package/src/client/canvas/BoardMoveDialog.tsx +225 -0
  231. package/src/client/canvas/CanvasNode.tsx +79 -49
  232. package/src/client/canvas/CanvasViewport.tsx +42 -14
  233. package/src/client/canvas/ContextMenu.tsx +97 -15
  234. package/src/client/canvas/EdgeEditor.tsx +149 -0
  235. package/src/client/canvas/EdgeLayer.tsx +441 -174
  236. package/src/client/canvas/ExpandedNodeOverlay.tsx +5 -2
  237. package/src/client/canvas/GroupNavigation.tsx +85 -0
  238. package/src/client/canvas/Presentation.tsx +53 -3
  239. package/src/client/canvas/RelationsPanel.tsx +9 -0
  240. package/src/client/canvas/SelectionBar.tsx +21 -0
  241. package/src/client/canvas/SessionPanel.tsx +35 -1
  242. package/src/client/canvas/TextPrompt.tsx +18 -1
  243. package/src/client/canvas/TopBar.tsx +54 -9
  244. package/src/client/canvas/auto-fit.ts +9 -11
  245. package/src/client/canvas/canvas-area.ts +2 -2
  246. package/src/client/canvas/use-focus-trap.ts +6 -1
  247. package/src/client/mermaid-entry.ts +6 -20
  248. package/src/client/mermaid-render.ts +39 -0
  249. package/src/client/nodes/AxStepControls.tsx +45 -69
  250. package/src/client/nodes/BoardNode.tsx +65 -9
  251. package/src/client/nodes/ContextNode.tsx +88 -396
  252. package/src/client/nodes/ExtAppFrame.tsx +302 -1465
  253. package/src/client/nodes/FileNode.tsx +92 -81
  254. package/src/client/nodes/HtmlNode.tsx +8 -36
  255. package/src/client/nodes/LedgerNode.tsx +31 -17
  256. package/src/client/nodes/MarkdownNode.tsx +14 -24
  257. package/src/client/nodes/McpAppNode.tsx +48 -154
  258. package/src/client/nodes/MermaidNode.tsx +80 -69
  259. package/src/client/nodes/PromptNode.tsx +44 -17
  260. package/src/client/nodes/ResponseNode.tsx +8 -6
  261. package/src/client/nodes/StatusNode.tsx +34 -7
  262. package/src/client/nodes/StatusSummary.tsx +16 -3
  263. package/src/client/nodes/TraceNode.tsx +8 -8
  264. package/src/client/nodes/ViewerFrame.tsx +273 -0
  265. package/src/client/nodes/ViewerHost.tsx +41 -0
  266. package/src/client/nodes/WebpageNode.tsx +22 -24
  267. package/src/client/nodes/WorkCard.tsx +175 -0
  268. package/src/client/nodes/iframe-document-url.ts +20 -27
  269. package/src/client/nodes/primitive-copy.ts +97 -0
  270. package/src/client/nodes/use-ax-surface-bridge.ts +18 -14
  271. package/src/client/nodes/use-iframe-content-height.ts +34 -10
  272. package/src/client/nodes/use-surface-frame.ts +22 -11
  273. package/src/client/nodes/viewer-runtime-state.ts +41 -35
  274. package/src/client/state/attention-bridge.ts +5 -0
  275. package/src/client/state/attention-store.ts +1 -0
  276. package/src/client/state/canvas-store.ts +202 -26
  277. package/src/client/state/human-store.ts +22 -2
  278. package/src/client/state/intent-bridge.ts +20 -5
  279. package/src/client/state/presentation.ts +135 -15
  280. package/src/client/state/relation-store.ts +127 -1
  281. package/src/client/state/sse-bridge.ts +18 -19
  282. package/src/client/theme/global.css +483 -230
  283. package/src/client/theme/surface-theme.css +6 -6
  284. package/src/client/types.ts +1 -0
  285. package/src/json-render/charts/tufte-components.tsx +44 -2
  286. package/src/json-render/renderer/index.css +62 -2
  287. package/src/json-render/renderer/index.tsx +31 -7
  288. package/src/json-render/server.ts +3 -2
  289. package/src/mcp/server.ts +13 -3
  290. package/src/server/agent-presence.ts +43 -23
  291. package/src/server/ax-flow-loop.ts +6 -0
  292. package/src/server/ax-gate-ttl.ts +8 -1
  293. package/src/server/ax-interaction.ts +16 -10
  294. package/src/server/ax-state-manager.ts +17 -4
  295. package/src/server/ax-wait.ts +20 -6
  296. package/src/server/board-export.ts +54 -30
  297. package/src/server/board-local.ts +20 -0
  298. package/src/server/board-move.ts +297 -0
  299. package/src/server/canvas-db.ts +249 -158
  300. package/src/server/canvas-geometry.ts +1 -0
  301. package/src/server/canvas-operations.ts +139 -109
  302. package/src/server/canvas-schema.ts +21 -0
  303. package/src/server/canvas-serialization.ts +2 -0
  304. package/src/server/canvas-state.ts +797 -159
  305. package/src/server/card-relocation.ts +53 -0
  306. package/src/server/code-graph.ts +4 -3
  307. package/src/server/context-reads.ts +83 -55
  308. package/src/server/demo-state.json +140 -114
  309. package/src/server/file-watcher.ts +30 -10
  310. package/src/server/html-primitives.ts +3 -9
  311. package/src/server/html-surface.ts +8 -0
  312. package/src/server/human-presence.ts +18 -5
  313. package/src/server/index.ts +54 -24
  314. package/src/server/intent-registry.ts +43 -5
  315. package/src/server/knowledge-lifecycle.ts +32 -9
  316. package/src/server/lifecycle-status.ts +29 -1
  317. package/src/server/mcp-app-runtime.ts +26 -7
  318. package/src/server/mutation-history.ts +37 -8
  319. package/src/server/operations/composites.ts +6 -3
  320. package/src/server/operations/mcp-contracts.ts +32 -2
  321. package/src/server/operations/mcp.ts +36 -9
  322. package/src/server/operations/ops/annotation.ts +22 -1
  323. package/src/server/operations/ops/ax-await.ts +1 -0
  324. package/src/server/operations/ops/ax-timeline.ts +28 -2
  325. package/src/server/operations/ops/batch.ts +25 -11
  326. package/src/server/operations/ops/boards.ts +45 -6
  327. package/src/server/operations/ops/nodes.ts +70 -0
  328. package/src/server/operations/ops/query.ts +32 -3
  329. package/src/server/operations/ops/snapshots.ts +1 -0
  330. package/src/server/operations/ops/viewport.ts +11 -9
  331. package/src/server/operations/registry.ts +49 -4
  332. package/src/server/server.ts +69 -75
  333. package/src/server/tour-control.ts +97 -12
  334. package/src/server/trace-manager.ts +4 -0
  335. package/src/server/web-artifacts/scripts/init-artifact.sh +2 -2
  336. package/src/shared/agent-context.ts +7 -1
  337. package/src/shared/auto-arrange.ts +5 -4
  338. package/src/shared/ax-kinds.ts +13 -0
  339. package/src/shared/ax-surface-protocol.ts +20 -9
  340. package/src/shared/content-height-reporter.ts +4 -3
  341. package/src/shared/human-presence.ts +1 -0
  342. package/src/shared/lifecycle-status.ts +2 -0
  343. package/src/shared/tour.ts +8 -0
@@ -98,6 +98,7 @@ export interface AxInteractionInput {
98
98
  * Injected so this module stays free of a runtime canvas-state import.
99
99
  */
100
100
  export interface AxInteractionManager {
101
+ readonly boardIdentity: object;
101
102
  getNode(id: string): CanvasNodeState | undefined;
102
103
  /** Canvas read for `ax.flow.materialize` (placement obstacles + stale flow sweep). */
103
104
  getLayout(): CanvasLayout;
@@ -41,9 +41,13 @@ export interface AxStateManagerDeps {
41
41
  }
42
42
  export declare class AxStateManager {
43
43
  private readonly deps;
44
+ private readonly host;
44
45
  private _axState;
45
- private _axHostCapability;
46
- constructor(deps: AxStateManagerDeps);
46
+ constructor(deps: AxStateManagerDeps, host?: {
47
+ capability: PmxAxHostCapability | null;
48
+ });
49
+ private get _axHostCapability();
50
+ private set _axHostCapability(value);
47
51
  private normalizeForCurrentNodes;
48
52
  private applyAxState;
49
53
  /** Reset the canvas-bound partition to empty (used by clear() and applyPersistedState()). */
@@ -269,6 +273,8 @@ export declare class AxStateManager {
269
273
  getPendingSteering(options?: {
270
274
  consumer?: string;
271
275
  limit?: number;
276
+ addressedOnly?: boolean;
277
+ offset?: number;
272
278
  }): PmxAxSteeringMessage[];
273
279
  /**
274
280
  * NEWEST undelivered steering first, for the compact AX context lead block (report
@@ -278,6 +284,8 @@ export declare class AxStateManager {
278
284
  getPendingSteeringForContext(options?: {
279
285
  consumer?: string;
280
286
  limit?: number;
287
+ addressedOnly?: boolean;
288
+ offset?: number;
281
289
  }): PmxAxSteeringMessage[];
282
290
  /** Total undelivered steering for a consumer (loop-safe), for the context backlog counts. */
283
291
  getPendingSteeringCount(consumer?: string): number;
@@ -0,0 +1,4 @@
1
+ /** Board-owned runtime state, discarded with its owner rather than on navigation. */
2
+ export declare function createBoardLocal<T>(create: () => T, dispose?: (value: T) => void): {
3
+ readonly current: T;
4
+ };
@@ -0,0 +1,38 @@
1
+ import type { ActorAttribution } from './attribution.js';
2
+ import type { CanvasBoard, PersistedCanvasState } from './canvas-db.js';
3
+ import type { DocumentImport } from './document-import.js';
4
+ export interface BoardMoveInput {
5
+ sourceBoardId: string;
6
+ nodeIds: string[];
7
+ name: string;
8
+ expectedRevision: number;
9
+ requestId: string;
10
+ preview?: boolean;
11
+ }
12
+ export interface BoardMovePreview {
13
+ sourceBoardId: string;
14
+ nodeIds: string[];
15
+ affectedBoardIds: string[];
16
+ readmeNodeId: string | null;
17
+ pinnedNodeIds: string[];
18
+ liveTaskNodeIds: string[];
19
+ attachmentIds: string[];
20
+ blockers: string[];
21
+ notices: string[];
22
+ }
23
+ export interface BoardMoveResult {
24
+ sourceBoardId: string;
25
+ destinationBoardId: string;
26
+ portalId: string;
27
+ nodeIds: string[];
28
+ affectedBoardIds: string[];
29
+ }
30
+ export interface MoveBoard {
31
+ board: CanvasBoard;
32
+ state: PersistedCanvasState;
33
+ }
34
+ /** Pure relocation plan. Preview and commit run the same checks on a consistent library view. */
35
+ export declare function prepareBoardMove(input: BoardMoveInput, library: Map<string, MoveBoard>, destinationId: string, portalId: string, imports: DocumentImport[], runtimeBlockers: ReadonlyMap<string, string>, actor: ActorAttribution, at: string): {
36
+ preview: BoardMovePreview;
37
+ states: Map<string, PersistedCanvasState>;
38
+ };
@@ -14,6 +14,10 @@ import { type PmxAxState, type PmxAxEvent, type PmxAxEvidence, type PmxAxSteerin
14
14
  export type CanvasTheme = CanvasThemeName;
15
15
  export declare function normalizeCanvasTheme(value: unknown, fallback?: CanvasTheme): CanvasTheme;
16
16
  export interface PersistedCanvasState {
17
+ /** Optimistic storage baseline, independent of content/read/review clocks. New boards start at zero. */
18
+ storageVersion?: number;
19
+ /** Snapshot restore boundary, not an authored content version. */
20
+ moveBoundary?: string | null;
17
21
  tour?: Tour;
18
22
  version: number;
19
23
  theme?: CanvasTheme;
@@ -70,8 +74,10 @@ export declare function finalizeCanvasDbForClose(db: Database): void;
70
74
  /** The theme is workspace-wide: it is saved even while no board is open. */
71
75
  export declare function saveThemeToDB(db: Database, theme: CanvasTheme | undefined): void;
72
76
  export declare function readThemeFromDB(db: Database): CanvasTheme | undefined;
73
- /** Saves one board's state; every other board's rows are untouched. */
74
- export declare function saveStateToDB(db: Database, boardId: string, state: PersistedCanvasState): void;
77
+ export declare function boardStorageVersion(db: Database, boardId: string): number;
78
+ export declare function assertBoardStorageVersion(db: Database, boardId: string, expected: number): void;
79
+ /** Save one board, returning its new baseline. Publish the baseline only after the outer transaction commits. */
80
+ export declare function saveStateToDB(db: Database, boardId: string, state: PersistedCanvasState): number;
75
81
  /** Loads one board (the open board when `boardId` is omitted); null when there is no such board. */
76
82
  export declare function loadStateFromDB(db: Database, boardId?: string): PersistedCanvasState | null;
77
83
  export interface CanvasBoard {
@@ -161,6 +167,8 @@ export declare function loadAxSteeringFromDB(db: Database, q?: AxTimelineQuery &
161
167
  export declare function loadPendingAxSteeringFromDB(db: Database, options?: {
162
168
  consumer?: string;
163
169
  limit?: number;
170
+ addressedOnly?: boolean;
171
+ offset?: number;
164
172
  }): PmxAxSteeringMessage[];
165
173
  /**
166
174
  * NEWEST undelivered steering first (report #57) for the compact AX context lead
@@ -173,6 +181,8 @@ export declare function loadPendingAxSteeringFromDB(db: Database, options?: {
173
181
  export declare function loadNewestPendingAxSteeringFromDB(db: Database, options?: {
174
182
  consumer?: string;
175
183
  limit?: number;
184
+ addressedOnly?: boolean;
185
+ offset?: number;
176
186
  }): PmxAxSteeringMessage[];
177
187
  /** Total undelivered steering for a consumer (loop-safe — excludes the consumer's own; target-scoped). */
178
188
  export declare function countPendingAxSteeringFromDB(db: Database, consumer?: string): number;
@@ -206,16 +206,15 @@ export declare function restoreCanvasSnapshot(idOrName: string): Promise<{
206
206
  ok: boolean;
207
207
  }>;
208
208
  /**
209
- * Open a board (or Home for null): the state layer saves the current board and
210
- * loads the next, and everything else that holds the old board in memory is
211
- * reset — undo closures, pending intents, file watchers, app sessions and the
212
- * code graph (the trace chain restarts itself when its last node is gone).
213
- * Agent and human presence are kept: they belong to the people and agents,
214
- * not to a board.
209
+ * Open a board (or Home for null), retaining other live boards and their
210
+ * undo history, intents, watchers and app sessions for background operations.
215
211
  */
216
212
  export declare function openCanvasBoard(id: string | null): {
217
213
  ok: boolean;
218
214
  };
215
+ export declare function startBoardRuntime(options?: {
216
+ forceRehydrateExtApps?: boolean;
217
+ }): void;
219
218
  /**
220
219
  * Restore the whole library from a backup file (the current file is kept as
221
220
  * `<db>.before-restore`); the restored library opens on its last open board.
@@ -8,9 +8,9 @@ declare const observedSourceSchema: z.ZodObject<{
8
8
  contentRevision: z.ZodOptional<z.ZodNumber>;
9
9
  observedAt: z.ZodOptional<z.ZodISODateTime>;
10
10
  availability: z.ZodOptional<z.ZodEnum<{
11
+ unavailable: "unavailable";
11
12
  live: "live";
12
13
  cached: "cached";
13
- unavailable: "unavailable";
14
14
  }>>;
15
15
  }, z.core.$strip>;
16
16
  declare const recipeSchema: z.ZodObject<{
@@ -28,6 +28,7 @@ export interface CanvasAnnotationSummary {
28
28
  export interface CanvasAnnotationContextSummary {
29
29
  id: string;
30
30
  label: string | null;
31
+ text?: string;
31
32
  bounds: CanvasAnnotation['bounds'];
32
33
  targetNodeIds: string[];
33
34
  targetNodeTitles: string[];
@@ -11,6 +11,7 @@
11
11
  * `.pmx-canvas-snapshots/`, loose blob files) are no longer imported as of 0.4.0 —
12
12
  * the one-shot boot migration into SQLite was retired.
13
13
  */
14
+ import { type BoardMoveInput, type BoardMovePreview, type BoardMoveResult } from './board-move.js';
14
15
  import { type WorkspaceSettings } from '../shared/workspace-settings.js';
15
16
  import { KnowledgeLifecycle, type Lifecycle } from './knowledge-lifecycle.js';
16
17
  import { type Tour } from '../shared/tour.js';
@@ -170,6 +171,7 @@ export interface CanvasNodeUpdate {
170
171
  height: number;
171
172
  };
172
173
  collapsed?: boolean;
174
+ zIndex?: number;
173
175
  }
174
176
  export type CanvasChangeType = 'pins' | 'nodes' | 'ax' | 'ax-timeline';
175
177
  /** Name for a board nobody named yet: when it was made, to the minute. */
@@ -189,20 +191,60 @@ interface ApplyUpdatesOptions {
189
191
  skipGroupChildTranslation?: boolean;
190
192
  }
191
193
  declare class CanvasStateManager {
192
- private nodes;
193
- private edges;
194
- private annotations;
195
- private _viewport;
196
- private _tour;
194
+ private readonly boardExecution;
195
+ private readonly liveBoards;
196
+ private nextGeneration;
197
+ private navigationGeneration;
198
+ private readonly hostState;
199
+ private visibleBoard;
200
+ private get boardState();
201
+ /** Identity for board-owned runtime caches. Never shared by a replacement board. */
202
+ get boardIdentity(): object;
203
+ onBoardDispose(cleanup: () => void): () => void;
204
+ private disposeBoardRuntime;
205
+ /** The human's navigation target, independent of the calling operation's board. */
206
+ get visibleBoardId(): string | null;
207
+ get visibleBoardGeneration(): number;
208
+ get isBackgroundBoard(): boolean;
209
+ /** Execute on a live board without activating it, retaining ownership across awaits. */
210
+ withBoard<T>(id: string, fn: () => T): T;
211
+ /** Bind callbacks to their board, rather than the context of whoever invokes them. */
212
+ bindBoard<T extends unknown[], R>(fn: (...args: T) => R): (...args: T) => R;
213
+ /** Viewer/global projections must not inherit the producer's board scope. */
214
+ withVisibleBoard<T>(fn: () => T): T;
215
+ /** Sweep resident runtime owners without loading the entire stored library. */
216
+ forEachLiveBoard(fn: () => void): void;
217
+ private loadBoardState;
218
+ private createBoardState;
219
+ private get nodes();
220
+ private get edges();
221
+ private get annotations();
222
+ private get _viewport();
223
+ private set _viewport(value);
224
+ private get _tour();
225
+ private set _tour(value);
226
+ private get _contextPinnedNodeIds();
227
+ private set _contextPinnedNodeIds(value);
228
+ private get _contextPinMeta();
229
+ private set _contextPinMeta(value);
230
+ private get _storageVersion();
231
+ private set _storageVersion(value);
232
+ private get _contentRevision();
233
+ private set _contentRevision(value);
234
+ private get _revisionFloor();
235
+ private set _revisionFloor(value);
236
+ private get _deletionTombstones();
237
+ private set _deletionTombstones(value);
238
+ private get _boardGeneration();
239
+ private set _boardGeneration(value);
240
+ private get _saveTimer();
241
+ private set _saveTimer(value);
242
+ private get _lastPersistenceError();
243
+ private set _lastPersistenceError(value);
244
+ private get ax();
197
245
  private _theme;
198
- private _contextPinnedNodeIds;
199
- /** Who pinned each pin, when and why; kept only for ids in `_contextPinnedNodeIds`. */
200
- private _contextPinMeta;
201
246
  private _workspaceRoot;
202
- private _contentRevision;
203
- private _revisionFloor;
204
- private _deletionTombstones;
205
- private readonly ax;
247
+ private moveRuntimeBlockers;
206
248
  private _changeListeners;
207
249
  /**
208
250
  * Register a listener for state changes. Used by MCP server to emit resource
@@ -237,6 +279,12 @@ declare class CanvasStateManager {
237
279
  private applyResolvedGroupBounds;
238
280
  private getGroupSnapshot;
239
281
  private normalizeNode;
282
+ private refreshLiveWorkCards;
283
+ private refreshCurrentLiveWorkCards;
284
+ /** Reconcile a stored display cache and its cursor clock in the same SQLite transaction. */
285
+ private readProjectedBoard;
286
+ /** Call before capturing a context snapshot, never from per-node getters used during writes. */
287
+ refreshContextWorkCards(): void;
240
288
  private nextContentRevision;
241
289
  private revisionState;
242
290
  /**
@@ -253,7 +301,6 @@ declare class CanvasStateManager {
253
301
  private compactGroupChildren;
254
302
  private _db;
255
303
  private _dbPath;
256
- private _saveTimer;
257
304
  readonly knowledge: KnowledgeLifecycle;
258
305
  /** Workspace root backing persistence and workspace-relative path resolution. */
259
306
  get workspaceRoot(): string;
@@ -288,11 +335,12 @@ declare class CanvasStateManager {
288
335
  * layout) on the board it had open last.
289
336
  */
290
337
  replaceDatabase(file: string): void;
291
- private _activeBoardId;
292
- private _boardGeneration;
338
+ private get _activeBoardId();
339
+ private set _activeBoardId(value);
293
340
  /** Invalidates asynchronous work whenever the loaded board state is replaced. */
294
341
  get boardGeneration(): number;
295
- /** The open board, or null on Home. */
342
+ get boardLifetimeGeneration(): number;
343
+ /** The execution board, or the open board outside a scoped operation. */
296
344
  get activeBoardId(): string | null;
297
345
  getActiveBoard(): CanvasBoard | null;
298
346
  /** Synchronous, owner-controlled static creation. No board activation or runtime hydration. */
@@ -302,6 +350,10 @@ declare class CanvasStateManager {
302
350
  createStoredEdge(boardId: string, requestId: string | undefined, fingerprint: string, build: (nodes: CanvasNodeState[]) => CanvasEdge): CanvasEdge;
303
351
  /** Stored creations share one durable receipt/commit boundary, never a temporary board switch. */
304
352
  private createStoredCreation;
353
+ /** Called inside a transaction: publish no storage clocks until it commits. */
354
+ private stageLiveBoards;
355
+ /** A stored multi-board write retains each live owner's runtime and camera. */
356
+ private reconcileStoredBoards;
305
357
  /** Read a board without activating it. This projection is not a write payload. */
306
358
  readBoard(id: string, includeBlobs?: boolean): {
307
359
  board: CanvasBoard;
@@ -336,6 +388,14 @@ declare class CanvasStateManager {
336
388
  advanceContextBriefCursor(boardId: string, consumer: string, revision: number): void;
337
389
  /** Creates a board without opening it. */
338
390
  createBoard(name: string, folder?: string | null): CanvasBoard | null;
391
+ /** The host supplies runtime ownership, not another copy of board state. */
392
+ setMoveRuntimeBlockers(read: () => ReadonlyMap<string, string>): void;
393
+ moveSelectionToNewBoard(input: BoardMoveInput): {
394
+ preview: BoardMovePreview;
395
+ } | {
396
+ result: BoardMoveResult;
397
+ replayed: boolean;
398
+ };
339
399
  updateBoard(id: string, patch: Pick<Parameters<typeof updateBoardInDB>[2], 'name' | 'folder' | 'mapPosition' | 'relationVocabulary'>): boolean;
340
400
  setBoardReadme(id: string, nodeId: string | null): boolean;
341
401
  /**
@@ -357,9 +417,8 @@ declare class CanvasStateManager {
357
417
  /** Deletes a board and its snapshots; deleting the open board returns to Home first. */
358
418
  deleteBoard(id: string): boolean;
359
419
  /**
360
- * Save the open board, then open `id` (or Home for null). The canvas state is
361
- * replaced wholesale; callers own the runtime side (undo history, app
362
- * sessions, watchers, SSE) — see `openCanvasBoard` in canvas-operations.
420
+ * Save pending boards, then select the visible owner. Existing partitions
421
+ * remain live; canvas-operations starts the selected board's runtime/SSE.
363
422
  */
364
423
  switchBoard(id: string | null): boolean;
365
424
  /**
@@ -374,7 +433,6 @@ declare class CanvasStateManager {
374
433
  private persistedState;
375
434
  /** Write current state to SQLite immediately. */
376
435
  private saveToDisk;
377
- private _lastPersistenceError;
378
436
  /** Health view of state persistence: ok until a save fails, ok again after the next success. */
379
437
  get persistenceHealth(): {
380
438
  ok: boolean;
@@ -399,6 +457,8 @@ declare class CanvasStateManager {
399
457
  gcSnapshots(options?: CanvasSnapshotGcOptions): CanvasSnapshotGcResult;
400
458
  /** Restore canvas state from a snapshot. */
401
459
  restoreSnapshot(idOrName: string): boolean;
460
+ /** Old snapshots stay readable, but neither whole-board nor one-card restore crosses a move. */
461
+ assertSnapshotRestorable(idOrName: string): void;
402
462
  /** Read a snapshot's data without restoring it (for diff). Resolves by ID or name. */
403
463
  getSnapshotData(idOrName: string): {
404
464
  name: string;
@@ -496,6 +556,7 @@ declare class CanvasStateManager {
496
556
  }): PmxAxFocusState;
497
557
  clearAxFocus(): PmxAxFocusState;
498
558
  getWorkItems(): PmxAxWorkItem[];
559
+ getWorkItemsOnBoard(boardId: string): PmxAxWorkItem[];
499
560
  addWorkItem(input: {
500
561
  title: string;
501
562
  status?: PmxAxWorkItemStatus;
@@ -674,10 +735,14 @@ declare class CanvasStateManager {
674
735
  getPendingSteering(options?: {
675
736
  consumer?: string;
676
737
  limit?: number;
738
+ addressedOnly?: boolean;
739
+ offset?: number;
677
740
  }): PmxAxSteeringMessage[];
678
741
  getPendingSteeringForContext(options?: {
679
742
  consumer?: string;
680
743
  limit?: number;
744
+ addressedOnly?: boolean;
745
+ offset?: number;
681
746
  }): PmxAxSteeringMessage[];
682
747
  getPendingSteeringCount(consumer?: string): number;
683
748
  getAxTimelineSummary(): PmxAxTimelineSummary;
@@ -740,4 +805,5 @@ declare class CanvasStateManager {
740
805
  releaseGroupChildren(groupId: string): boolean;
741
806
  clear(): void;
742
807
  }
808
+ export declare const boardCatalogEpoch: `${string}-${string}-${string}-${string}-${string}`;
743
809
  export declare const canvasState: CanvasStateManager;
@@ -0,0 +1,6 @@
1
+ import type { Database } from 'bun:sqlite';
2
+ /** JSON target list parameter; event ranges prevent a reused old ID inheriting the moved card's history. */
3
+ export declare const CARD_HISTORY_CTE = "WITH RECURSIVE\n targets AS (SELECT json_extract(value, '$.boardId') AS current_board,\n json_extract(value, '$.cardId') AS node_id FROM json_each(?)),\n history(current_board, node_id, board_id, review_after, review_through, read_after, read_through, move_before) AS (\n SELECT current_board, node_id, current_board,\n COALESCE((SELECT MAX(review_through) FROM card_relocations r WHERE (r.from_board = t.current_board OR r.to_board = t.current_board) AND r.node_id = t.node_id), 0),\n 9223372036854775807,\n COALESCE((SELECT MAX(read_through) FROM card_relocations r WHERE (r.from_board = t.current_board OR r.to_board = t.current_board) AND r.node_id = t.node_id), 0),\n 9223372036854775807, 9223372036854775807 FROM targets t\n UNION ALL\n SELECT h.current_board, h.node_id, r.from_board, r.review_after, r.review_through,\n r.read_after, r.read_through, r.sequence\n FROM history h JOIN card_relocations r ON r.to_board = h.board_id AND r.node_id = h.node_id\n AND r.sequence = (SELECT MAX(sequence) FROM card_relocations prior\n WHERE (prior.to_board = h.board_id OR prior.from_board = h.board_id)\n AND prior.node_id = h.node_id AND prior.sequence < h.move_before)\n )";
4
+ /** Record locations, not new reads or validations. Called inside the move transaction. */
5
+ export declare function recordCardRelocation(db: Database, requestId: string, from: string, to: string, nodeIds: string[]): void;
6
+ export declare function boardMoveBoundary(db: Database, boardId: string): string | null;
@@ -32,6 +32,8 @@ export interface ContextRead {
32
32
  boardId: string | null;
33
33
  }
34
34
  export type ContextReadInput = Omit<ContextRead, 'seq' | 'id' | 'at' | 'boardId' | 'readNodes' | 'seenLinks'> & {
35
+ /** Stable adapter receipt identity. Retries record this delivery once per consumer and board. */
36
+ deliveryId?: string;
35
37
  /** Explicit read target, captured before asynchronous formatting/proxy work. */
36
38
  boardId?: string | null;
37
39
  /** Ids of every serialized node in what the reader received; the server keeps those on the board. */
@@ -83,7 +85,7 @@ export declare function contextReadFromPayload(base: Omit<ContextReadInput, 'del
83
85
  export declare function pinnedBoardReads(base: Omit<ContextReadInput, 'deliveredNodeIds' | 'bytes' | 'readNodeIds' | 'pinnedNodeIds' | 'boardId'>, payload: unknown): ContextReadInput[];
84
86
  /** Graph summaries are seen on their own boards, never full-content reads or a board switch. */
85
87
  export declare function graphReads(base: Pick<ContextReadInput, 'channel' | 'resource' | 'source' | 'consumer' | 'agentId'>, graph: MemoryGraph): ContextReadInput[];
86
- export declare const CONTEXT_READS_SCHEMA_SQL = "\n CREATE TABLE IF NOT EXISTS context_reads (\n seq INTEGER PRIMARY KEY AUTOINCREMENT,\n id TEXT NOT NULL UNIQUE,\n at TEXT NOT NULL,\n channel TEXT NOT NULL,\n resource TEXT NOT NULL,\n source TEXT NOT NULL,\n consumer TEXT,\n agent_id TEXT,\n pinned_node_ids TEXT NOT NULL DEFAULT '[]',\n delivered_node_ids TEXT NOT NULL DEFAULT '[]',\n bytes INTEGER NOT NULL DEFAULT 0,\n board_id TEXT,\n read_nodes TEXT NOT NULL DEFAULT '{}',\n seen_links TEXT NOT NULL DEFAULT '{}'\n );\n";
88
+ export declare const CONTEXT_READS_SCHEMA_SQL = "\n CREATE TABLE IF NOT EXISTS context_read_receipts (id TEXT PRIMARY KEY);\n CREATE TABLE IF NOT EXISTS context_reads (\n seq INTEGER PRIMARY KEY AUTOINCREMENT,\n id TEXT NOT NULL UNIQUE,\n at TEXT NOT NULL,\n channel TEXT NOT NULL,\n resource TEXT NOT NULL,\n source TEXT NOT NULL,\n consumer TEXT,\n agent_id TEXT,\n pinned_node_ids TEXT NOT NULL DEFAULT '[]',\n delivered_node_ids TEXT NOT NULL DEFAULT '[]',\n bytes INTEGER NOT NULL DEFAULT 0,\n board_id TEXT,\n read_nodes TEXT NOT NULL DEFAULT '{}',\n seen_links TEXT NOT NULL DEFAULT '{}'\n );\n";
87
89
  export declare function appendContextReadToDB(db: Database, input: ContextReadInput, boardId: string | null, readNodes?: Record<string, number>, seenLinks?: Record<string, number>): ContextRead;
88
90
  /** Per node on a board, the latest agent read that delivered its content (newest row wins). */
89
91
  export declare function loadNodeReadStatusFromDB(db: Database, boardId: string): NodeReadStatus[];
@@ -28,7 +28,7 @@ export declare class HumanPresenceRegistry {
28
28
  set(raw: unknown, now?: number): HumanPresence | null;
29
29
  snapshot(now?: number): HumanPresenceSnapshot;
30
30
  /** Nodes a human is holding right now → that human's name. The edit lock. */
31
- lockedNodes(now?: number): Map<string, string>;
31
+ lockedNodes(now?: number, boardId?: string | null): Map<string, string>;
32
32
  reset(): void;
33
33
  private publicView;
34
34
  private sweep;
@@ -1,8 +1,10 @@
1
1
  import { EventEmitter } from 'node:events';
2
- import type { Camera, Tour, TourStop } from '../shared/tour.js';
3
- import { type TourState, type TourStep, type TourStepResult } from './tour-control.js';
4
- export type { Tour, TourStop } from '../shared/tour.js';
5
- export type { TourState, TourStep, TourStepResult } from './tour-control.js';
2
+ import type { BoardMoveInput, BoardMovePreview, BoardMoveResult } from './board-move.js';
3
+ export type { BoardMoveInput, BoardMovePreview, BoardMoveResult } from './board-move.js';
4
+ import type { Camera, Tour, TourPresenter, TourStop } from '../shared/tour.js';
5
+ import { type TourState, type TourStep, type TourStepResult, type TourSuperseded } from './tour-control.js';
6
+ export type { Tour, TourPresenter, TourStop } from '../shared/tour.js';
7
+ export type { TourState, TourStep, TourStepResult, TourSuperseded } from './tour-control.js';
6
8
  import type { AgentPhase, AgentPresence, AgentPresenceSnapshot } from '../shared/agent-presence.js';
7
9
  import { canvasState } from './canvas-state.js';
8
10
  import type { CanvasAnnotation, CanvasNodeState, CanvasEdge, CanvasLayout } from './canvas-state.js';
@@ -130,11 +132,8 @@ export declare class PmxCanvas extends EventEmitter {
130
132
  animated?: boolean;
131
133
  }): string;
132
134
  updateEdge(id: string, patch: Partial<Pick<CanvasEdge, 'type' | 'kind' | 'reason' | 'label' | 'style' | 'animated'>>): Promise<CanvasEdge>;
133
- addAnnotation(input: Omit<CanvasAnnotation, 'id' | 'createdAt'> & {
134
- id?: string;
135
- createdAt?: string;
136
- }): string;
137
- removeAnnotation(id: string): boolean;
135
+ addAnnotation(input: Pick<CanvasAnnotation, 'points'> & Partial<Pick<CanvasAnnotation, 'id' | 'type' | 'color' | 'width' | 'text' | 'label'>>): Promise<string>;
136
+ removeAnnotation(id: string): Promise<boolean>;
138
137
  removeEdge(id: string): void;
139
138
  /**
140
139
  * Create a group node and optionally add child nodes to it.
@@ -168,9 +167,14 @@ export declare class PmxCanvas extends EventEmitter {
168
167
  /** Present a tour stop (index, `next` or `previous`) in the workbench. Not recorded in undo history. */
169
168
  goToTourStop(step: TourStep, options?: {
170
169
  present?: boolean;
170
+ presenter?: undefined;
171
171
  }): TourStepResult;
172
+ goToTourStop(step: TourStep, options: {
173
+ present?: boolean;
174
+ presenter?: TourPresenter;
175
+ }): TourStepResult | TourSuperseded;
172
176
  /** Leave presentation in every viewer. */
173
- exitTour(): void;
177
+ exitTour(presenter?: TourPresenter): void;
174
178
  /** Ease the camera to a node, world rect or viewport. Not recorded in undo history. */
175
179
  moveCamera(stop: TourStop): {
176
180
  viewport: Camera;
@@ -224,6 +228,8 @@ export declare class PmxCanvas extends EventEmitter {
224
228
  getPendingSteering(options?: {
225
229
  consumer?: string;
226
230
  limit?: number;
231
+ addressedOnly?: boolean;
232
+ offset?: number;
227
233
  }): PmxAxSteeringMessage[];
228
234
  /**
229
235
  * Submit a node-originated AX interaction (plan-004 Phase 1). Validates the
@@ -284,6 +290,14 @@ export declare class PmxCanvas extends EventEmitter {
284
290
  includeStructure?: boolean;
285
291
  preview?: boolean;
286
292
  }): Promise<Record<string, unknown>>;
293
+ /** Relocate identities atomically; preview is read-only and retries reuse the original receipt. */
294
+ moveSelectionToNewBoard(input: BoardMoveInput): Promise<{
295
+ ok: true;
296
+ preview: BoardMovePreview;
297
+ } | (BoardMoveResult & {
298
+ ok: true;
299
+ replayed: boolean;
300
+ })>;
287
301
  searchLibrary(query: string, limit?: number): Promise<Record<string, unknown>>;
288
302
  /** Same projection as Home Graph. Discovery summaries never count as full-content reads. */
289
303
  getMemoryGraph(options?: {
@@ -296,6 +310,8 @@ export declare class PmxCanvas extends EventEmitter {
296
310
  consumer?: string;
297
311
  since?: number;
298
312
  budget?: number;
313
+ contextDelivery?: boolean;
314
+ includeSteering?: boolean;
299
315
  }): Promise<Record<string, unknown>>;
300
316
  /** Open a board, or Home with null. */
301
317
  openBoard(id: string | null): Promise<void>;
@@ -1,14 +1,18 @@
1
1
  import { type PmxAxIntent, type PmxAxIntentKind } from '../shared/ax-intent.js';
2
2
  type IntentEmitter = (event: string, payload: Record<string, unknown>) => void;
3
3
  export declare class IntentRegistry {
4
- private readonly intents;
5
- private readonly vetoedIntentIds;
6
- private readonly committingIntentIds;
4
+ private readonly board;
5
+ private get intents();
6
+ private get vetoedIntentIds();
7
+ private get committingIntentIds();
7
8
  private emit;
8
- private sweepTimer;
9
+ private get sweepTimer();
10
+ private set sweepTimer(value);
9
11
  /** Inject the workbench SSE emitter (server.ts wires this at module load). */
10
12
  setEmitter(emitter: IntentEmitter | null): void;
11
13
  list(): PmxAxIntent[];
14
+ /** The first write from Home adopts its ghosts and vetoes without opening on signal. */
15
+ moveHomeIntentsToBoard(boardId: string): void;
12
16
  /** Signal a new (or replace an existing) intent. Returns the stored envelope. */
13
17
  signal(raw: unknown): PmxAxIntent;
14
18
  /** Patch a live intent (position/label/reason/confidence/seq) and bump its TTL. */
@@ -183,7 +183,7 @@ export declare class KnowledgeLifecycle {
183
183
  cadenceDays?: number | undefined;
184
184
  } | null;
185
185
  lifecycleSourceFolder: string | null;
186
- lifecycleSource: "card" | "unknown" | "folder";
186
+ lifecycleSource: "unknown" | "card" | "folder";
187
187
  };
188
188
  resolveCard(folderPath: string | null, node: Pick<CanvasNodeState, 'type' | 'data'>, catalog?: {
189
189
  categories: KnowledgeCategory[];
@@ -209,7 +209,7 @@ export declare class KnowledgeLifecycle {
209
209
  cadenceDays?: number | undefined;
210
210
  } | null;
211
211
  lifecycleSourceFolder: string | null;
212
- lifecycleSource: "card" | "unknown" | "folder";
212
+ lifecycleSource: "unknown" | "card" | "folder";
213
213
  };
214
214
  private indexedDb;
215
215
  /** Stored owners of semantic sources; the caller overlays the active board's unsaved edges. */
@@ -219,6 +219,8 @@ export declare class KnowledgeLifecycle {
219
219
  lastValidation: ReviewRecord | null;
220
220
  retired: boolean;
221
221
  }>;
222
+ /** Resolve a current card's location when evidence was recorded, without rewriting that evidence. */
223
+ locationAtReview(review: ReviewRecord, target: MemoryTarget): MemoryTarget;
222
224
  reviews(boardId: string, nodeId: string): {
223
225
  records: ReviewRecord[];
224
226
  retired: boolean;
@@ -71,11 +71,13 @@ export interface SnapshotDiffResult {
71
71
  }[];
72
72
  }
73
73
  declare class MutationHistory {
74
- private entries;
75
- /** Index of the last applied mutation. -1 means nothing applied / all undone. */
76
- private cursor;
77
- /** When true, mutations triggered by undo/redo are not recorded. */
78
- private _replaying;
74
+ private readonly board;
75
+ private get entries();
76
+ private set entries(value);
77
+ private get cursor();
78
+ private set cursor(value);
79
+ private get _replaying();
80
+ private set _replaying(value);
79
81
  get isReplaying(): boolean;
80
82
  /**
81
83
  * Record a new mutation. Truncates any redo-able future, then appends.
@@ -1,6 +1,5 @@
1
1
  import { type CanvasLayout } from '../../canvas-state.js';
2
2
  import { type Operation } from '../types.js';
3
- export declare const boardCatalogEpoch: `${string}-${string}-${string}-${string}-${string}`;
4
3
  export declare function boardsPayload(reloaded?: boolean): Record<string, unknown>;
5
4
  /** Read a board without opening it. Omitted board preserves the active-board contract. */
6
5
  export declare function readTargetBoard(boardId?: unknown, includeBlobs?: boolean): {
@@ -39,5 +39,7 @@ export interface ExecuteOperationMeta extends OperationExecutionOptions {
39
39
  */
40
40
  proxiedRead?: boolean;
41
41
  }
42
+ /** Also used by batch's internal node path, which does not dispatch an operation. */
43
+ export declare function validateOperationTarget(name: string, input: Record<string, unknown>): string | undefined;
42
44
  export declare function executeOperation(name: string, rawInput: unknown, meta?: ExecuteOperationMeta): Promise<unknown>;
43
45
  export {};
@@ -8,13 +8,21 @@
8
8
  *
9
9
  * This module must never import server.ts or index.ts.
10
10
  */
11
- import { type Camera, type Tour, type TourStop } from '../shared/tour.js';
11
+ import { type Camera, type Tour, type TourPresenter, type TourStop } from '../shared/tour.js';
12
12
  export type TourStep = number | 'next' | 'previous';
13
- export interface TourStepResult {
13
+ export interface TourDelivery {
14
+ catalogEpoch: string;
15
+ boardGeneration: number;
16
+ sequence: number;
17
+ }
18
+ export interface TourStepResult extends TourDelivery {
14
19
  index: number;
15
20
  total: number;
16
21
  stop: TourStop;
17
22
  }
23
+ export interface TourSuperseded {
24
+ superseded: true;
25
+ }
18
26
  export interface TourState {
19
27
  tour: Tour;
20
28
  derived: boolean;
@@ -23,7 +31,9 @@ export interface TourState {
23
31
  export declare function currentTour(): TourState;
24
32
  /** Move the shared cursor. `next`/`previous` clamp at the ends; an explicit index must exist. */
25
33
  export declare function goToTourStop(step: TourStep): TourStepResult;
26
- export declare function exitTour(): void;
34
+ export declare function goToTourStop(step: TourStep, presenter: TourPresenter | undefined): TourStepResult | TourSuperseded;
35
+ export declare function exitTour(): TourDelivery;
36
+ export declare function exitTour(presenter: TourPresenter | undefined): TourDelivery | TourSuperseded;
27
37
  /**
28
38
  * Resolve an eased camera move and store its end camera as the board viewport
29
39
  * (unrecorded). The size is the last window a browser reported, so this is the
@@ -12,6 +12,7 @@ declare class TraceManager {
12
12
  private traceOrigin;
13
13
  private chainIndex;
14
14
  get enabled(): boolean;
15
+ get ownedNodeIds(): readonly string[];
15
16
  setEnabled(value: boolean): void;
16
17
  onToolStart(payload: {
17
18
  name: string;
@@ -4,6 +4,12 @@
4
4
  * silently render unrecognized on the other.
5
5
  */
6
6
  export type AxWorkItemStatus = 'todo' | 'in-progress' | 'blocked' | 'done' | 'cancelled';
7
+ /** Authored work cards use the task vocabulary without creating an AX task. */
8
+ export declare const WORK_CARD_STATES: Record<AxWorkItemStatus, {
9
+ label: string;
10
+ glyph: string;
11
+ }>;
12
+ export declare function isWorkCardState(value: unknown): value is AxWorkItemStatus;
7
13
  /** `held` = auto-held by the unattended-approval policy: the action did NOT proceed. */
8
14
  export type AxApprovalStatus = 'pending' | 'approved' | 'rejected' | 'held';
9
15
  export type AxEventKind = 'prompt' | 'assistant-message' | 'tool-start' | 'tool-result' | 'failure' | 'approval' | 'steering' | 'command' | 'note' | 'policy'