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
@@ -7,11 +7,13 @@ export declare function BarPortal({ children }: {
7
7
  * Styled hover/focus tooltip for bar controls — the replacement for native
8
8
  * `title` hints, which are delay-gated and never render in embedded panes.
9
9
  */
10
- export declare function BarHint({ label, shortcut, body, align, side, tapToOpen, fitWithin, children, }: {
10
+ export declare function BarHint({ id, label, shortcut, body, align, side, tapToOpen, fitWithin, children, }: {
11
+ /** Optional description target for the control's aria-describedby. */
12
+ id?: string;
11
13
  label: string;
12
14
  shortcut?: string;
13
- /** One or two plain sentences under the label — the explanation a native `title` used to hide. */
14
- body?: string;
15
+ /** Explanatory text, optionally split into readable paragraphs. */
16
+ body?: ComponentChildren;
15
17
  align?: 'start' | 'center' | 'end';
16
18
  /** Which way the tooltip opens. Bars at the bottom of the region open 'up'. */
17
19
  side?: 'down' | 'up';
@@ -0,0 +1,2 @@
1
+ export declare function openBoardMove(nodeIds: string[]): void;
2
+ export declare function BoardMoveDialog(): import("preact/jsx-runtime").JSX.Element | null;
@@ -4,17 +4,6 @@ export declare function nearestNodeInDirection(from: CanvasNodeState, dir: {
4
4
  dx: number;
5
5
  dy: number;
6
6
  }, candidates: Iterable<CanvasNodeState>): CanvasNodeState | null;
7
- /**
8
- * How much to enlarge node chrome (title bar, badges, icons) when zoomed out so
9
- * it stays legible. Full inverse compensation is capped at 2.2x — but the cap
10
- * alone ignored the node it is drawn on, so on SHORT nodes the growing bar ate
11
- * the body: a 116px-tall section label at 46% zoom gave the title bar 72% of the
12
- * node and left 14px for text that needed 41, so the markdown was simply cut off.
13
- * The scale is therefore also bounded by the node's own height, keeping the bar
14
- * under MAX_TITLEBAR_HEIGHT_RATIO of it. Tall nodes are unaffected (their height
15
- * never binds); pass height 0 for collapsed/auto-height nodes to skip the bound.
16
- */
17
- export declare function nodeChromeScale(viewportScale: number, nodeHeight: number, nodeWidth?: number): number;
18
7
  interface CanvasNodeProps {
19
8
  node: CanvasNodeState;
20
9
  children: preact.ComponentChildren;
@@ -0,0 +1,19 @@
1
+ import type { CanvasEdge } from '../types';
2
+ export declare const edgeEditorAnchor: import("@preact/signals-core").Signal<{
3
+ id: string;
4
+ incarnation: number;
5
+ point: {
6
+ x: number;
7
+ y: number;
8
+ };
9
+ } | null>;
10
+ /** Like EdgeHint, the editor lives in App's screen layer, outside the transformed world. */
11
+ export declare function SelectedEdgeEditor(): import("preact/jsx-runtime").JSX.Element | null;
12
+ /** Screen-sized controls anchored to the selected relation, not scaled with its SVG. */
13
+ export declare function EdgeEditor({ edge, point }: {
14
+ edge: CanvasEdge;
15
+ point: {
16
+ x: number;
17
+ y: number;
18
+ };
19
+ }): import("preact/jsx-runtime").JSX.Element;
@@ -22,7 +22,6 @@ export type EdgeLayerPart = 'lines' | 'pills' | 'pill-hits';
22
22
  interface EdgeLayerProps {
23
23
  nodes: Signal<Map<string, CanvasNodeState>>;
24
24
  edges: Signal<Map<string, CanvasEdge>>;
25
- part: EdgeLayerPart;
26
25
  }
27
- export declare function EdgeLayer({ nodes, edges, part }: EdgeLayerProps): import("preact/src").JSX.Element | null;
26
+ export declare function EdgeLayer({ nodes, edges }: EdgeLayerProps): import("preact/src").JSX.Element | null;
28
27
  export {};
@@ -0,0 +1,2 @@
1
+ export declare function GroupBreadcrumbs(): import("preact/src").JSX.Element | null;
2
+ export declare function GroupOutsideLinks(): import("preact/src").JSX.Element | null;
@@ -6,6 +6,8 @@
6
6
  interface TextPromptRequest {
7
7
  title: string;
8
8
  placeholder: string;
9
+ description?: string;
10
+ maxLength?: number;
9
11
  /** Prefilled (and pre-selected) value — edit flows start from the current text. */
10
12
  initial: string;
11
13
  /** Submitting an empty field resolves '' instead of null — "clear the value" flows. */
@@ -20,6 +22,8 @@ export declare function askText(title: string, placeholder: string, opts?: {
20
22
  initial?: string;
21
23
  allowEmpty?: boolean;
22
24
  confirm?: string;
25
+ description?: string;
26
+ maxLength?: number;
23
27
  }): Promise<string | null>;
24
28
  export declare function TextPrompt(): import("preact/src").JSX.Element | null;
25
29
  export {};
@@ -2,7 +2,6 @@ import type { CanvasNodeState } from '../types';
2
2
  export declare const AUTO_FIT_TITLEBAR_HEIGHT = 37;
3
3
  export declare const AUTO_FIT_MAX_HEIGHT = 600;
4
4
  export declare const AUTO_FIT_MAX_HEIGHT_IFRAME = 1400;
5
- export declare const AUTO_FIT_BODY_PADDING = 24;
6
5
  /** DOM-content nodes (markdown/status/file/…) whose body scrollHeight is directly
7
6
  * measurable — the one-shot ResizeObserver auto-fit in CanvasNode handles these. */
8
7
  export declare function shouldAutoFitNode(node: CanvasNodeState): boolean;
@@ -12,11 +11,11 @@ export declare function shouldContentFitIframeNode(node: CanvasNodeState): boole
12
11
  /**
13
12
  * Grow-only target height from a surface-reported content height. Returns null
14
13
  * when the node is exempt, the report is non-positive, or the node already fits
15
- * (so it never shrinks — monotonic growth can't oscillate). Adds the titlebar +
16
- * node-body padding so the content fully clears (no residual inner scrollbar),
17
- * capped at the iframe ceiling.
14
+ * (so it never shrinks). Callers measure the actual chrome in world pixels,
15
+ * including zoom-compensated headers and any captions. A fixed padding allowance
16
+ * makes a full-height viewer grow again on every content-height report.
18
17
  */
19
- export declare function computeContentGrowHeight(node: CanvasNodeState, contentHeight: number): number | null;
18
+ export declare function computeContentGrowHeight(node: CanvasNodeState, contentHeight: number, chromeHeight: number): number | null;
20
19
  /** Keep an automatically growing card clear without moving its neighbors or
21
20
  * changing its column. Groups and screen-pinned cards retain authored placement. */
22
21
  export declare function contentFitPosition(node: CanvasNodeState, height: number, allNodes: CanvasNodeState[]): CanvasNodeState['position'];
@@ -5,7 +5,6 @@
5
5
  * HTML-escaped diagram source in `<pre class="mermaid-source">`; this script
6
6
  * reads it back via textContent, renders it to SVG, and re-renders when the
7
7
  * parent canvas live-switches the theme (the theme bridge toggles the document's
8
- * `data-theme` attribute). Keeping mermaid out of the main SPA bundle keeps the
9
- * canvas boot lean — only mermaid-node surfaces pay for the library.
8
+ * `data-theme` attribute). Standalone views and exports share the canvas renderer.
10
9
  */
11
10
  export {};
@@ -0,0 +1 @@
1
+ export declare function renderMermaid(source: string): Promise<string>;
@@ -1,5 +1,5 @@
1
1
  import type { CanvasNodeState } from '../types';
2
- /** Native text-only cross-board link. Target identity is the durable board id. */
2
+ /** Target identity is the durable board id; a missing target can be relinked. */
3
3
  export declare function BoardNode({ node }: {
4
4
  node: CanvasNodeState;
5
5
  }): import("preact/src").JSX.Element;
@@ -1,100 +1,18 @@
1
- import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
- import { AppBridge } from '@modelcontextprotocol/ext-apps/app-bridge';
3
1
  import type { CanvasNodeState } from '../types';
4
- type ExtAppBridgeNotifications = Pick<AppBridge, 'sendToolInput' | 'sendToolResult'>;
5
2
  type DisplayMode = 'inline' | 'fullscreen' | 'pip';
6
- /** Paint probe outcome: only a content-carrying tick counts as painted. */
7
- export type PaintProbeVerdict = 'content-verified' | 'tick-no-content' | 'timeout';
8
- interface ExtAppHostDimensionsTarget {
9
- clientWidth?: number;
10
- clientHeight?: number;
11
- getBoundingClientRect(): Pick<DOMRectReadOnly, 'width' | 'height'>;
12
- }
13
- /**
14
- * Finding F (0.2.4): detect a WebKit-only host — Safari or a WKWebView (e.g. the
15
- * GitHub Copilot app's embedded panel). Blink engines (Chrome / Chromium / Edge /
16
- * the Codex browser, all of which carry a Chrome/Chromium/CriOS/Edg token) and
17
- * Android WebView are excluded, as is Gecko (no `AppleWebKit`). Used to gate the
18
- * one-time ext-app iframe repaint remount to the only engine that exhibits the
19
- * present-at-load black-tile paint race, so the remount is a strict no-op
20
- * everywhere we can test (Chrome / Codex / Playwright).
21
- */
22
- export declare function isWebKitOnlyHost(userAgent: string): boolean;
23
- /**
24
- * Finding N (0.4.7 report): the GitHub Copilot panel's WKWebView reports
25
- * `document.visibilityState === 'hidden'` CONTINUOUSLY — the workbench document
26
- * never transitions to 'visible' even with the panel open and on-screen. Two
27
- * things break as a result: the `visibilitychange` re-arm below can never fire
28
- * (there is no transition to listen for), and `paint-ok` becomes a false green —
29
- * the app document happily answers the double-rAF paint probe while the
30
- * compositor still shows black. The instrumented trail from that session carries
31
- * `visibility: "hidden"` on essentially every recovery event.
32
- *
33
- * So: when the document CLAIMS hidden but the frame is demonstrably on-screen,
34
- * do not trust the claim — spend one more recovery round as if visible. A host
35
- * that ever reports 'visible' has a working signal and is left to the
36
- * visibilitychange path, which keeps a genuinely backgrounded panel quiet.
37
- */
38
- export declare function shouldAssumeVisibleRearm(options: {
39
- userAgent: string;
40
- visibilityState: string;
41
- rect: {
42
- top: number;
43
- left: number;
44
- bottom: number;
45
- right: number;
46
- width: number;
47
- height: number;
48
- };
49
- viewport: {
50
- width: number;
51
- height: number;
52
- };
53
- alreadyRearmed: boolean;
54
- }): boolean;
55
- export declare const WEBKIT_REMOUNT_SETTLE_MS = 1000;
56
- export interface WebkitRemountTask {
57
- /** Perform the remount. Return false if the node no longer needs it (skips the boot wait). */
58
- remount: () => boolean;
59
- /** Resolves when the remounted app genuinely boots AND finishes its bootstrap replay, or after a bounded timeout. */
60
- awaitBoot: () => Promise<void>;
61
- }
62
- export declare function extAppRecoveryLog(nodeId: string, event: string): void;
63
- export declare function enqueueWebkitRemount(task: WebkitRemountTask): void;
64
- export declare function getExtAppBridgeInitKey(node: CanvasNodeState, retryKey: number): string;
65
3
  export declare function resolveExtAppDisplayModeRequest(requestedMode: DisplayMode, isExpanded: boolean): {
66
4
  nextMode: DisplayMode;
67
5
  shouldExpand: boolean;
68
6
  shouldCollapse: boolean;
69
7
  };
70
- export declare function sendExtAppBootstrapState(bridge: ExtAppBridgeNotifications, toolInput: Record<string, unknown>, toolResult: CallToolResult | undefined): Promise<void>;
71
- export declare function resolveExtAppSandbox(value: unknown): string;
72
8
  export declare function buildExtAppAxBridgeScript(axToken: string, nodeId: string): string;
73
- /**
74
- * Boot beacon injected into EVERY ext-app document (not gated on AX): posts one
75
- * parent message the moment the iframe's scripts execute. This is the liveness
76
- * signal the WebKit never-booted watchdog keys on — it distinguishes an app
77
- * that is alive but boots via the 1200ms bootstrap fallback (e.g. a non-SDK
78
- * widget that never sends ui/notifications/initialized) from a dead window
79
- * whose scripts never ran. Without it, the watchdog treated every
80
- * fallback-booted app as never-booted and remounted it up to the attempt cap —
81
- * a reboot/flicker loop for exactly the apps the fallback exists to support
82
- * (0.3.2 pre-release review). The token scopes the message to this component;
83
- * the host also checks event.source against the live iframe.
84
- */
85
- export declare function buildExtAppBootBeaconScript(frameToken: string, nodeId: string): string;
86
- /**
87
- * Base styles injected into every ext-app document (Finding Q, 0.3.4 report):
88
- * apps aspect-fit their drawn surface to the frame width, and on narrow/tall
89
- * tiles the leftover region shows the app document's own body background —
90
- * pure black for the hosted Excalidraw bundle, in every engine. Making the
91
- * app document transparent lets the host iframe's theme background
92
- * (var(--c-panel)) show through the letterbox instead. Background only — app
93
- * content, its drawn scene, and its own foreground styling are untouched.
94
- */
95
9
  export declare function buildExtAppSurfaceBaseStyles(): string;
96
- export declare function injectExtAppAxBridgeScript(html: string, axBridgeScript: string): string;
97
- export declare function resolveExtAppContainerDimensions(target: ExtAppHostDimensionsTarget | null | undefined, fallback: {
10
+ export declare function injectExtAppAxBridgeScript(html: string, script: string): string;
11
+ export declare function resolveExtAppContainerDimensions(target: {
12
+ clientWidth?: number;
13
+ clientHeight?: number;
14
+ getBoundingClientRect(): Pick<DOMRectReadOnly, 'width' | 'height'>;
15
+ } | null | undefined, fallback: {
98
16
  width: number;
99
17
  height: number;
100
18
  }): {
@@ -102,9 +20,8 @@ export declare function resolveExtAppContainerDimensions(target: ExtAppHostDimen
102
20
  height: number;
103
21
  };
104
22
  export declare function shouldApplyExtAppSizeChange(height: unknown, isExpanded: boolean): height is number;
105
- export declare function resolveExtAppInlineFrameHeight(appHeight: number, hostHeight: number): number;
106
23
  export declare function ExtAppFrame({ node, expanded }: {
107
24
  node: CanvasNodeState;
108
25
  expanded?: boolean;
109
- }): import("preact/src").JSX.Element;
26
+ }): import("preact/jsx-runtime").JSX.Element;
110
27
  export {};
@@ -1,30 +1,6 @@
1
- import type { RefObject } from 'preact';
2
1
  import type { CanvasNodeState } from '../types';
3
2
  export declare function isSameOriginFrameDocumentUrl(url: string, origin?: string): boolean;
4
- type ViewerFrameSource = {
5
- src?: string;
6
- srcdoc?: string;
7
- };
8
- /**
9
- * Keep the last painted viewer in front while its replacement navigates. Viewer
10
- * specs are immutable documents, so updates normally change `?v=` and reload the
11
- * iframe; putting the new document behind the old one conceals Chromium's white
12
- * navigation paint without suppressing rendering. Wait for restore and render commit,
13
- * then two animation frames before the old viewer is removed.
14
- */
15
- export declare function RefreshingViewerFrame({ source, iframeRef, onLoad, onDocumentLoad, title, className, sandbox, allow, tabIndex, }: {
16
- source: ViewerFrameSource;
17
- iframeRef: RefObject<HTMLIFrameElement>;
18
- onLoad: () => void;
19
- onDocumentLoad?: (frame: HTMLIFrameElement, signal: AbortSignal) => void | Promise<boolean | 'cancelled' | void>;
20
- title: string;
21
- className?: string;
22
- sandbox?: string;
23
- allow?: string;
24
- tabIndex?: number;
25
- }): import("preact").JSX.Element;
26
3
  export declare function McpAppNode({ node, expanded }: {
27
4
  node: CanvasNodeState;
28
5
  expanded?: boolean;
29
- }): import("preact").JSX.Element;
30
- export {};
6
+ }): import("preact/jsx-runtime").JSX.Element;
@@ -1,12 +1,5 @@
1
1
  import type { CanvasNodeState } from '../types';
2
- /**
3
- * Mermaid diagram node — a display-only iframe surface. The server renders the
4
- * surface document (escaped diagram source + /canvas/mermaid-entry.js) at
5
- * /api/canvas/surface/:id; the iframe and "Open as site" share that one render
6
- * path, exactly like html nodes. Minimal subset of HtmlNode: theme push and
7
- * content-height growth, no AX bridge, no presentation mode.
8
- */
9
2
  export declare function MermaidNode({ node, expanded }: {
10
3
  node: CanvasNodeState;
11
4
  expanded?: boolean;
12
- }): import("preact/jsx-runtime").JSX.Element;
5
+ }): import("preact/src").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import type { CanvasNodeState } from '../types';
2
+ export declare function hasUnsavedPrompt(boardId: string, nodeId: string): boolean;
2
3
  export declare function PromptNode({ node, expanded }: {
3
4
  node: CanvasNodeState;
4
5
  expanded?: boolean;
@@ -0,0 +1,29 @@
1
+ import type { JSX, RefObject } from 'preact';
2
+ export declare const VIEWER_LOAD_DEADLINE_MS = 10000;
3
+ export type ViewerSource = {
4
+ src?: string;
5
+ srcdoc?: string;
6
+ error?: boolean;
7
+ retry?: () => void;
8
+ };
9
+ type LoadDocument = (frame: HTMLIFrameElement, signal: AbortSignal) => Promise<boolean | 'cancelled' | undefined> | undefined;
10
+ type MountFrame = (frame: HTMLIFrameElement, fail: () => void) => () => void;
11
+ /** The document acknowledges mounting before its frame-gated paint signal. */
12
+ export declare function waitForViewerPaint(frame: HTMLIFrameElement, token: string, signal: AbortSignal, jsonRpc?: boolean): Promise<boolean>;
13
+ /** Preserve the painted document until its replacement restores and paints. */
14
+ export declare function RefreshingViewerFrame({ source, identity, iframeRef, onLoad, onMount, onOpen, onDocumentLoad, title, className, sandbox, allow, tabIndex, referrerPolicy, }: {
15
+ source: ViewerSource;
16
+ identity?: string;
17
+ iframeRef: RefObject<HTMLIFrameElement>;
18
+ onLoad?: () => void;
19
+ onMount?: MountFrame;
20
+ onOpen?: () => void;
21
+ onDocumentLoad?: LoadDocument;
22
+ title: string;
23
+ className?: string;
24
+ sandbox?: string;
25
+ allow?: string;
26
+ tabIndex?: number;
27
+ referrerPolicy?: JSX.IntrinsicElements['iframe']['referrerPolicy'];
28
+ }): JSX.Element;
29
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { ComponentChildren } from 'preact';
2
+ import type { CanvasNodeState } from '../types';
3
+ export declare function ViewerHost({ node, children }: {
4
+ node: CanvasNodeState;
5
+ children: ComponentChildren;
6
+ }): import("preact").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type AxWorkItemStatus } from '../../shared/ax-kinds.js';
2
+ import type { CanvasNodeState } from '../types';
3
+ export declare function hasUnsavedWorkCard(boardId: string, nodeId: string): boolean;
4
+ export declare function WorkCard({ node, state }: {
5
+ node: CanvasNodeState;
6
+ state: AxWorkItemStatus;
7
+ }): import("preact/jsx-runtime").JSX.Element;
@@ -1,9 +1,3 @@
1
- export declare function createIframeDocumentUrl(html: string, sandbox: string): Promise<string>;
2
- export declare function useIframeDocument(html: string, sandbox: string): {
3
- attributes: {
4
- src?: string;
5
- srcdoc?: string;
6
- };
7
- ready: boolean;
8
- key: string;
9
- };
1
+ import { type ViewerSource } from './ViewerFrame';
2
+ export declare function createIframeDocumentUrl(html: string, sandbox: string, signal?: AbortSignal): Promise<string>;
3
+ export declare function useIframeDocument(html: string, sandbox: string): ViewerSource;
@@ -0,0 +1,5 @@
1
+ import type { RefObject } from 'preact';
2
+ import type { CanvasNodeState } from '../types';
3
+ export declare function canCopyPrimitiveJson(node: CanvasNodeState): boolean;
4
+ export declare function usePrimitiveJson(node: CanvasNodeState, token: string, frame: RefObject<HTMLIFrameElement>, expanded: boolean): void;
5
+ export declare function copyPrimitiveJson(nodeId: string): Promise<void>;
@@ -17,4 +17,5 @@ export declare function useAxSurfaceBridge(options: {
17
17
  nodeId: string;
18
18
  sourceSurface: AxSurfaceBridgeSurface;
19
19
  iframeRef: RefObject<HTMLIFrameElement>;
20
+ jsonRpc?: boolean;
20
21
  }): void;
@@ -13,4 +13,4 @@ import type { CanvasNodeState } from '../types';
13
13
  */
14
14
  export declare function useIframeContentHeight(node: CanvasNodeState, iframeRef: {
15
15
  current: HTMLIFrameElement | null;
16
- }, frameToken: string): void;
16
+ }, frameToken: string): () => void;
@@ -1,13 +1,11 @@
1
+ import { type ViewerSource } from './ViewerFrame';
1
2
  /**
2
3
  * Attributes for a surface iframe, honoring the boot-wide iframe mode
3
4
  * (state/iframe-mode.ts): `src` by default, fetch() + `srcdoc` when src-URL
4
5
  * iframes are blocked by the embedding context (nested-iframe hosts like Amp
5
6
  * orb portals). Cross-origin URLs always stay `src` — they cannot be fetched
6
7
  * from here. While the probe is pending, same-origin frames stay empty rather
7
- * than loading a src that may show the broken placeholder; a failed srcdoc
8
- * fetch falls back to `src` (no worse than before).
8
+ * than loading a src that may show the broken placeholder. Preparation failures
9
+ * use the shared host's Retry, never a second load path the embed probe rejected.
9
10
  */
10
- export declare function useSurfaceFrame(url: string): {
11
- src?: string;
12
- srcdoc?: string;
13
- };
11
+ export declare function useSurfaceFrame(url: string): ViewerSource;
@@ -1 +1,2 @@
1
- export declare function restoreViewerRuntimeState(nodeId: string, token: string, source: Window, signal?: AbortSignal): Promise<boolean | 'cancelled'>;
1
+ import type { CanvasNodeState } from '../types';
2
+ export declare function restoreViewerRuntimeState(authored: CanvasNodeState, token: string, source: Window, signal?: AbortSignal): Promise<boolean | 'cancelled'>;
@@ -77,6 +77,20 @@ export declare function trackDragMembership(nodeId: string): void;
77
77
  export declare const hiddenByCollapsedGroup: import("@preact/signals-core").ReadonlySignal<Map<string, string>>;
78
78
  /** The node that stands in for `id` on the canvas: itself, or its collapsed group's chip. */
79
79
  export declare function visibleNodeFor(id: string): CanvasNodeState | undefined;
80
+ interface GroupVisit {
81
+ id: string;
82
+ parent: unknown;
83
+ viewport: ViewportState;
84
+ selection: Set<string>;
85
+ active: string | null;
86
+ }
87
+ /** Human navigation only. The canonical node/edge maps and agent reads remain whole-board. */
88
+ export declare const groupPath: import("@preact/signals-core").Signal<GroupVisit[]>;
89
+ export declare const groupContents: import("@preact/signals-core").ReadonlySignal<Set<string> | null>;
90
+ /** The drawing's outside endpoints are view-only stubs, never inserted into nodes. */
91
+ export declare const groupViewNodes: import("@preact/signals-core").ReadonlySignal<Map<string, CanvasNodeState>>;
92
+ export declare function leaveGroup(depth?: number): void;
93
+ export declare function openGroup(id: string, fit?: boolean): void;
80
94
  /** Collapsed groups render as a chip; children keep their positions for restore. */
81
95
  export declare function groupsOfSelection(): string[];
82
96
  export declare function alignSelection(edge: 'left' | 'top'): void;
@@ -120,7 +134,7 @@ export declare function resizeNode(id: string, size: {
120
134
  width: number;
121
135
  height: number;
122
136
  }): void;
123
- export declare function bringToFront(id: string): void;
137
+ export declare function bringToFront(id: string, persist?: boolean): void;
124
138
  export declare function toggleCollapsed(id: string): void;
125
139
  export declare function setViewport(v: Partial<ViewportState>): void;
126
140
  export declare function replaceViewport(next: ViewportState): void;
@@ -161,11 +175,13 @@ export declare function animateCameraPath(frameAt: (t: number) => ViewportState,
161
175
  export declare function cancelViewportAnimation(): void;
162
176
  export declare function persistLayout(options?: {
163
177
  recordHistory?: boolean;
178
+ raisedNodeId?: string;
164
179
  }): void;
165
180
  export declare function restoreLayout(): Map<string, Partial<CanvasNodeState>> | null;
166
181
  export declare function fitAll(containerW: number, containerH: number): void;
167
182
  export declare function focusNode(id: string, options?: {
168
183
  recordHistory?: boolean;
184
+ persistStacking?: boolean;
169
185
  }): void;
170
186
  export declare function cycleActiveNode(direction?: 1 | -1): void;
171
187
  export declare function walkGraph(direction: 'up' | 'down' | 'left' | 'right'): void;
@@ -173,3 +189,4 @@ export declare function expandNode(id: string): void;
173
189
  export declare function collapseExpandedNode(): void;
174
190
  export declare function autoArrange(): void;
175
191
  export declare function forceDirectedArrange(): void;
192
+ export {};
@@ -3,6 +3,8 @@ export declare const humanClientId: string;
3
3
  export declare const humanName: import("@preact/signals-core").Signal<string>;
4
4
  export declare const humans: import("@preact/signals-core").Signal<HumanPresence[]>;
5
5
  export declare const otherHumans: import("@preact/signals-core").ReadonlySignal<HumanPresence[]>;
6
+ /** Change the display label, never the per-tab identity or anyone's access. */
7
+ export declare function setHumanName(name: string): void;
6
8
  /** Nodes a human took over mid-edit → that human's name, shown as the yield pill for a moment. */
7
9
  export declare const yieldedNodes: import("@preact/signals-core").Signal<Map<string, string>>;
8
10
  export declare function applyHumanSnapshot(snapshot: Partial<HumanPresenceSnapshot> | null | undefined): void;
@@ -76,6 +76,7 @@ export declare function pushCanvasUpdate(updates: Array<{
76
76
  height: number;
77
77
  };
78
78
  collapsed?: boolean;
79
+ zIndex?: number;
79
80
  }>, options?: {
80
81
  recordHistory?: boolean;
81
82
  }): Promise<void>;
@@ -92,11 +93,13 @@ export declare function createNodeFromClient(opts: {
92
93
  type?: string;
93
94
  title?: string;
94
95
  content?: string;
96
+ data?: Record<string, unknown>;
95
97
  x?: number;
96
98
  y?: number;
97
99
  width?: number;
98
100
  height?: number;
99
101
  boardId?: string;
102
+ expectedBoardId?: string;
100
103
  }): Promise<{
101
104
  ok: boolean;
102
105
  id?: string;
@@ -236,10 +239,10 @@ export declare function updateEdgeFromClient(edgeId: string, patch: {
236
239
  type?: string;
237
240
  style?: string;
238
241
  animated?: boolean;
239
- }): Promise<{
242
+ }, expectedBoardId?: string | null): Promise<{
240
243
  ok: boolean;
241
244
  }>;
242
245
  /** Remove a canvas edge via the server. */
243
- export declare function removeEdgeFromClient(edgeId: string): Promise<{
246
+ export declare function removeEdgeFromClient(edgeId: string, expectedBoardId?: string | null): Promise<{
244
247
  ok: boolean;
245
248
  }>;
@@ -4,6 +4,11 @@ export declare const presenting: import("@preact/signals-core").Signal<boolean>;
4
4
  export declare const recordingCamera: import("@preact/signals-core").Signal<boolean>;
5
5
  /** Why the current stop cannot be shown (missing target, no stops, server unreachable). */
6
6
  export declare const presentationError: import("@preact/signals-core").Signal<string>;
7
+ /** Read-only mirror of the server's shared cursor, never advanced optimistically. */
8
+ export declare const presentationCursor: import("@preact/signals-core").Signal<{
9
+ index: number;
10
+ total: number;
11
+ } | null>;
7
12
  export declare function ownsCamera(): boolean;
8
13
  /**
9
14
  * Ease this viewer's camera to a stop: log-space zoom, optional pull-back.
@@ -16,16 +21,22 @@ export declare function playStop(stop: TourStop, onDone?: (end: ViewportState) =
16
21
  * committed (two frames); the latest step always wins.
17
22
  */
18
23
  export declare function presentStop(stop: TourStop): void;
19
- /**
20
- * Move the server's shared tour cursor. The `canvas-tour-step` echo does the
21
- * animating, here and in every other presenting viewer, so a human's keys and
22
- * an agent's `tour.go` always agree on where the tour is.
23
- */
24
+ /** Apply either delivery of the server's shared cursor, without replaying its echo. */
25
+ export declare function applyTourStep(data: Record<string, unknown>): void;
26
+ export declare function applyTourExit(data: Record<string, unknown>): void;
27
+ /** Move the shared cursor. A successful response also works while events are delayed or disconnected. */
24
28
  export declare function stepTour(to: {
25
29
  stop: number;
26
30
  } | {
27
31
  step: 'next' | 'previous';
28
- }): Promise<void>;
32
+ }, presenter?: {
33
+ clientId: string;
34
+ intent: number;
35
+ catalogEpoch: string;
36
+ boardGeneration: number;
37
+ } | null): Promise<void>;
29
38
  /** Present from the first stop, or resume where the tour already is (`?present=1`). */
30
39
  export declare function startPresentation(resume?: boolean): Promise<void>;
40
+ /** Local cancellation also fences pending requests from this presentation. */
41
+ export declare function dismissPresentation(): void;
31
42
  export declare function endPresentation(): void;
@@ -1,7 +1,18 @@
1
+ import type { CanvasEdge } from '../types';
1
2
  export declare const relationFilter: import("@preact/signals-core").Signal<{
2
3
  boardId: string;
3
4
  kind: string;
4
5
  } | null>;
6
+ export declare function showRelationsOnCanvas(nodeId: string, mode: 'lineage' | 'connections'): void;
7
+ /** Only qualified dependency/lineage sources warn; citations and illustrated loops never do. */
8
+ export declare function relationWarning(edge: CanvasEdge): string[];
9
+ export declare const dependencyAnalysis: import("@preact/signals-core").ReadonlySignal<{
10
+ cycles: number;
11
+ cycleEdges: Set<string>;
12
+ affected: Set<string>;
13
+ focused: boolean;
14
+ hasDependencies: boolean;
15
+ }>;
5
16
  export declare const relationFocus: import("@preact/signals-core").ReadonlySignal<string | null>;
6
17
  /** View-only highlights. They never infer evidence, change a decision or execute a flow. */
7
18
  export declare const relationHighlight: import("@preact/signals-core").ReadonlySignal<{
@@ -75,7 +75,7 @@ export type AnnotationTool = 'pen' | 'eraser' | 'text' | null;
75
75
  export type ConnectionStatus = 'connecting' | 'connected' | 'disconnected';
76
76
  export declare const TYPE_LABELS: Record<CanvasNodeState['type'], string>;
77
77
  /** Node types that support the full-viewport expand/focus overlay. */
78
- export declare const EXPANDABLE_TYPES: Set<"board" | "image" | "file" | "markdown" | "mcp-app" | "webpage" | "json-render" | "graph" | "prompt" | "response" | "status" | "context" | "ledger" | "trace" | "diff" | "mermaid" | "html" | "group">;
78
+ export declare const EXPANDABLE_TYPES: Set<"prompt" | "mcp-app" | "markdown" | "webpage" | "json-render" | "graph" | "board" | "response" | "status" | "context" | "ledger" | "trace" | "file" | "diff" | "mermaid" | "image" | "html" | "group">;
79
79
  export declare const EXCALIDRAW_SERVER_NAME = "Excalidraw";
80
80
  export declare const EXCALIDRAW_CREATE_VIEW_TOOL = "create_view";
81
81
  export declare function isExcalidrawNode(node: CanvasNodeState): boolean;
@@ -474,10 +474,10 @@ export declare const allComponentDefinitions: {
474
474
  text: z.ZodString;
475
475
  variant: z.ZodNullable<z.ZodEnum<{
476
476
  error: "error";
477
- success: "success";
478
- default: "default";
479
477
  info: "info";
480
478
  warning: "warning";
479
+ success: "success";
480
+ default: "default";
481
481
  secondary: "secondary";
482
482
  destructive: "destructive";
483
483
  outline: "outline";
@@ -1,3 +1,4 @@
1
+ import type { CanvasThemeName } from '../shared/themes.js';
1
2
  export interface JsonRenderSpec {
2
3
  root: string;
3
4
  elements: Record<string, unknown>;
@@ -95,7 +96,7 @@ export declare function readJsonRenderBundle(): Promise<{
95
96
  export declare function buildJsonRenderViewerHtml(options: {
96
97
  title: string;
97
98
  spec: JsonRenderSpec;
98
- theme?: 'dark' | 'light' | 'high-contrast';
99
+ theme?: CanvasThemeName | 'dark' | 'light';
99
100
  display?: 'expanded' | 'site';
100
101
  devtools?: boolean;
101
102
  nodeId?: string;
@@ -178,6 +178,7 @@ export declare class AgentPresenceRegistry {
178
178
  /** A board opened: attached sessions record it as they find it, before any write lands. */
179
179
  boardOpened(): void;
180
180
  /** Remove a writer (session-end). */
181
+ private endSession;
181
182
  detach(sessionId: string): boolean;
182
183
  snapshot(now?: number): AgentPresenceSnapshot;
183
184
  /** Latest attached session: a newly attached reviewer must check fast context again. */