pmx-canvas 0.9.3 → 0.11.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 (237) hide show
  1. package/.github/extensions/pmx-canvas/runtime.json +1 -1
  2. package/.github/extensions/pmx-canvas/tools.json +9418 -2016
  3. package/CHANGELOG.md +54 -1
  4. package/dist/canvas/chunks/abnfDiagram-N423BO3Z-p8dtp6va.js +1 -0
  5. package/dist/canvas/chunks/architecture-TIHT7OUA-9tffvpsv.js +1 -0
  6. package/dist/canvas/chunks/architectureDiagram-T3A2C74G-5jhmxrzf.js +36 -0
  7. package/dist/canvas/chunks/blockDiagram-VBNYF7ZC-pw1fa9yb.js +132 -0
  8. package/dist/canvas/chunks/c4Diagram-5PPSVZJV-x07nq0tt.js +10 -0
  9. package/dist/canvas/chunks/classDiagram-JCYQIIEL-nc6g5x1r.js +1 -0
  10. package/dist/canvas/chunks/classDiagram-v2-OCEON4UE-0qnbpwvh.js +1 -0
  11. package/dist/canvas/chunks/cose-bilkent-JH36ORCC-nm39npq0.js +1 -0
  12. package/dist/canvas/chunks/cynefin-VYW2F7L2-ys8p46ts.js +1 -0
  13. package/dist/canvas/chunks/cynefinDiagram-MW4NZA55-vdxrwahz.js +62 -0
  14. package/dist/canvas/chunks/dagre-VZM6K2ZE-bqdm7wpd.js +4 -0
  15. package/dist/canvas/chunks/diagram-7IWD3JNH-gs5gpr93.js +30 -0
  16. package/dist/canvas/chunks/diagram-B4RE2ZJO-cgwjg47s.js +3 -0
  17. package/dist/canvas/chunks/diagram-LBJQPF4R-w3vahpav.js +24 -0
  18. package/dist/canvas/chunks/diagram-Q27KOJAE-42837z6h.js +24 -0
  19. package/dist/canvas/chunks/diagram-UB23O5K3-4fz83q59.js +41 -0
  20. package/dist/canvas/chunks/ebnfDiagram-BXEA7PRR-zphtgegj.js +1 -0
  21. package/dist/canvas/chunks/erDiagram-JOGREHBK-zvbbdxp4.js +85 -0
  22. package/dist/canvas/chunks/eventmodeling-45OFAUF4-v9q6dn4c.js +1 -0
  23. package/dist/canvas/chunks/flowDiagram-UKHOOZJN-yrr5z8tc.js +1 -0
  24. package/dist/canvas/chunks/ganttDiagram-PKOTCBZU-282jzycm.js +292 -0
  25. package/dist/canvas/chunks/gitGraph-TEB2WS4Q-kdwb8m0a.js +1 -0
  26. package/dist/canvas/chunks/gitGraphDiagram-DS77QQ5N-vqqy6p1b.js +106 -0
  27. package/dist/canvas/chunks/index-0rk4gp1g.js +2 -0
  28. package/dist/canvas/chunks/index-194m3hc3.js +2 -0
  29. package/dist/canvas/chunks/index-1r72hdzb.js +301 -0
  30. package/dist/canvas/chunks/index-353m7b0p.js +2 -0
  31. package/dist/canvas/chunks/index-3cy1bzwh.js +2 -0
  32. package/dist/canvas/chunks/index-5tv8v1hk.js +1 -0
  33. package/dist/canvas/chunks/index-6ceya556.js +332 -0
  34. package/dist/canvas/chunks/index-6qmsnxwy.js +4 -0
  35. package/dist/canvas/chunks/index-d3b3gqe9.js +2 -0
  36. package/dist/canvas/chunks/index-fjtdggjn.js +2 -0
  37. package/dist/canvas/chunks/index-g3pwnqeb.js +2 -0
  38. package/dist/canvas/chunks/index-gf4e0et4.js +2 -0
  39. package/dist/canvas/chunks/index-hj99nz1f.js +1 -0
  40. package/dist/canvas/chunks/index-nprm96xp.js +16 -0
  41. package/dist/canvas/chunks/index-qj8fxwsf.js +2 -0
  42. package/dist/canvas/chunks/index-r2fyc9w1.js +89 -0
  43. package/dist/canvas/chunks/index-rft2hcz5.js +2 -0
  44. package/dist/canvas/chunks/index-rh7nv68n.js +2 -0
  45. package/dist/canvas/chunks/index-s4j678gj.js +2 -0
  46. package/dist/canvas/chunks/index-tb1wf525.js +179 -0
  47. package/dist/canvas/chunks/index-vv56h019.js +2 -0
  48. package/dist/canvas/chunks/index-w2mra17t.js +207 -0
  49. package/dist/canvas/chunks/index-wgv7en21.js +232 -0
  50. package/dist/canvas/chunks/index-yw8h9vha.js +157 -0
  51. package/dist/canvas/chunks/info-DKCQHKI2-wpzs6sz3.js +1 -0
  52. package/dist/canvas/chunks/infoDiagram-6WML65LV-v1yvggqj.js +2 -0
  53. package/dist/canvas/chunks/ishikawaDiagram-WSZJBQD7-5hnq1a9p.js +70 -0
  54. package/dist/canvas/chunks/journeyDiagram-NVQOT4AX-zjcffveh.js +139 -0
  55. package/dist/canvas/chunks/kanban-definition-27J2QSJJ-dakqtfp1.js +89 -0
  56. package/dist/canvas/chunks/katex-dmg8k4zm.js +257 -0
  57. package/dist/canvas/chunks/mermaid.core-j2geswrd.js +12 -0
  58. package/dist/canvas/chunks/mindmap-definition-FAOFIHXS-142xhr3k.js +96 -0
  59. package/dist/canvas/chunks/packet-7NZHBO7P-xn439f0s.js +1 -0
  60. package/dist/canvas/chunks/pegDiagram-VL7TDLO6-5wvk7vsd.js +1 -0
  61. package/dist/canvas/chunks/pie-RZYD4A2V-0kf16rwh.js +1 -0
  62. package/dist/canvas/chunks/pieDiagram-7S7Q4E2Y-ztdhwycc.js +39 -0
  63. package/dist/canvas/chunks/quadrantDiagram-CIZ2JOQS-c5p9gmg6.js +7 -0
  64. package/dist/canvas/chunks/radar-I7S5WNFK-0g2pz36t.js +1 -0
  65. package/dist/canvas/chunks/railroad-3IZDKUUU-fcaran6j.js +1 -0
  66. package/dist/canvas/chunks/railroad-abnf-AHOZXSZD-wgdya41q.js +1 -0
  67. package/dist/canvas/chunks/railroad-ebnf-EBAXGLYW-gy07a4ka.js +1 -0
  68. package/dist/canvas/chunks/railroad-peg-LSFZ7HO6-ewk6wtkh.js +1 -0
  69. package/dist/canvas/chunks/railroadDiagram-AXF67PYL-xkmqkjwf.js +1 -0
  70. package/dist/canvas/chunks/requirementDiagram-LRYGKXZP-9wm2dyaw.js +84 -0
  71. package/dist/canvas/chunks/sankeyDiagram-W5VNT64P-2w19etgb.js +40 -0
  72. package/dist/canvas/chunks/sequenceDiagram-SI44F4Z6-0jn0vwmz.js +162 -0
  73. package/dist/canvas/chunks/sizeCapture-X5ZJPWSS-x75epwdq.js +1 -0
  74. package/dist/canvas/chunks/stateDiagram-OKZ733FA-schjpy6d.js +1 -0
  75. package/dist/canvas/chunks/stateDiagram-v2-UEYNNEHI-k8sfp2e7.js +1 -0
  76. package/dist/canvas/chunks/swimlanes-SLNWSIFB-gkw4xce3.js +1 -0
  77. package/dist/canvas/chunks/swimlanesDiagram-ULZ7WXOC-nqysw67j.js +8 -0
  78. package/dist/canvas/chunks/timeline-definition-Z64GVDOM-x7nkcy01.js +120 -0
  79. package/dist/canvas/chunks/treeView-QDETBFTQ-cesw6gp0.js +1 -0
  80. package/dist/canvas/chunks/treemap-6X3UGDF4-zdv4knp9.js +1 -0
  81. package/dist/canvas/chunks/vennDiagram-T6HMQDX7-x8dqn9yf.js +34 -0
  82. package/dist/canvas/chunks/wardley-OPB4EBWU-44pdddez.js +1 -0
  83. package/dist/canvas/chunks/wardleyDiagram-T6FBY63Y-t1j52t9r.js +78 -0
  84. package/dist/canvas/chunks/xychartDiagram-ELKLHX3M-38t16pme.js +7 -0
  85. package/dist/canvas/global.css +389 -229
  86. package/dist/canvas/index.js +141 -211
  87. package/dist/canvas/mcp-app.html +4205 -554
  88. package/dist/canvas/mermaid-entry.js +338 -338
  89. package/dist/canvas/surface-theme.css +6 -6
  90. package/dist/json-render/index.css +1 -1
  91. package/dist/json-render/index.js +49 -49
  92. package/dist/types/client/canvas/BarHint.d.ts +5 -3
  93. package/dist/types/client/canvas/CanvasNode.d.ts +0 -11
  94. package/dist/types/client/canvas/EdgeLayer.d.ts +1 -2
  95. package/dist/types/client/canvas/auto-fit.d.ts +4 -5
  96. package/dist/types/client/mermaid-entry.d.ts +1 -2
  97. package/dist/types/client/mermaid-render.d.ts +1 -0
  98. package/dist/types/client/nodes/BoardNode.d.ts +1 -1
  99. package/dist/types/client/nodes/ExtAppFrame.d.ts +7 -90
  100. package/dist/types/client/nodes/McpAppNode.d.ts +1 -25
  101. package/dist/types/client/nodes/MermaidNode.d.ts +1 -8
  102. package/dist/types/client/nodes/ViewerFrame.d.ts +29 -0
  103. package/dist/types/client/nodes/ViewerHost.d.ts +6 -0
  104. package/dist/types/client/nodes/iframe-document-url.d.ts +3 -9
  105. package/dist/types/client/nodes/primitive-copy.d.ts +5 -0
  106. package/dist/types/client/nodes/use-iframe-content-height.d.ts +1 -1
  107. package/dist/types/client/nodes/use-surface-frame.d.ts +4 -6
  108. package/dist/types/client/nodes/viewer-runtime-state.d.ts +2 -1
  109. package/dist/types/client/state/canvas-store.d.ts +3 -1
  110. package/dist/types/client/state/intent-bridge.d.ts +1 -0
  111. package/dist/types/client/state/presentation.d.ts +17 -6
  112. package/dist/types/json-render/server.d.ts +2 -1
  113. package/dist/types/mcp/canvas-access.d.ts +1 -12
  114. package/dist/types/mcp/resource-subscriptions.d.ts +7 -0
  115. package/dist/types/mcp/server.d.ts +2 -0
  116. package/dist/types/server/ax-wait.d.ts +1 -0
  117. package/dist/types/server/canvas-operations.d.ts +1 -0
  118. package/dist/types/server/canvas-state.d.ts +2 -0
  119. package/dist/types/server/index.d.ts +11 -6
  120. package/dist/types/server/operations/http.d.ts +10 -0
  121. package/dist/types/server/operations/index.d.ts +2 -2
  122. package/dist/types/server/operations/invoker.d.ts +4 -3
  123. package/dist/types/server/operations/mcp-contracts.d.ts +20 -0
  124. package/dist/types/server/operations/mcp.d.ts +2 -0
  125. package/dist/types/server/operations/ops/batch.d.ts +1 -0
  126. package/dist/types/server/operations/ops/boards.d.ts +0 -1
  127. package/dist/types/server/operations/registry.d.ts +2 -2
  128. package/dist/types/server/operations/types.d.ts +12 -2
  129. package/dist/types/server/server.d.ts +2 -0
  130. package/dist/types/server/tour-control.d.ts +13 -3
  131. package/dist/types/server/webpage-node.d.ts +1 -0
  132. package/dist/types/shared/ax-surface-protocol.d.ts +0 -9
  133. package/dist/types/shared/tour.d.ts +8 -0
  134. package/docs/api-reference.md +2 -2
  135. package/docs/cli.md +1 -1
  136. package/docs/design/Chrome.dc.html +32 -6
  137. package/docs/design/Types1.dc.html +3 -2
  138. package/docs/design/Types2.dc.html +1 -1
  139. package/docs/design/Types3.dc.html +1 -1
  140. package/docs/design/Zoom.dc.html +37 -60
  141. package/docs/design/canvas.json +1 -1
  142. package/docs/design.md +169 -4
  143. package/docs/http-api.md +82 -1
  144. package/docs/mcp.md +101 -21
  145. package/docs/node-types.md +38 -3
  146. package/docs/plans/plan-009-tech-debt-backlog.md +2 -2
  147. package/docs/plans/plan-019-post-0.9-roadmap.md +402 -13
  148. package/docs/product-vision-2026-09.md +9 -0
  149. package/docs/sdk.md +5 -2
  150. package/package.json +2 -2
  151. package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/runtime.json +1 -1
  152. package/plugins/pmx-canvas/plugin.json +1 -1
  153. package/plugins/pmx-canvas/runtime.json +1 -1
  154. package/plugins/pmx-canvas/tools.json +9418 -2016
  155. package/skills/pmx-canvas/SKILL.md +19 -21
  156. package/skills/pmx-canvas/references/full-reference.md +44 -6
  157. package/skills/pmx-canvas/references/installing-pmx-canvas.md +7 -7
  158. package/skills/published-consumer-e2e/scripts/run-published-consumer-e2e.sh +3 -5
  159. package/src/client/canvas/BarHint.tsx +6 -3
  160. package/src/client/canvas/CanvasNode.tsx +34 -47
  161. package/src/client/canvas/CanvasViewport.tsx +6 -7
  162. package/src/client/canvas/ContextMenu.tsx +63 -3
  163. package/src/client/canvas/EdgeLayer.tsx +365 -169
  164. package/src/client/canvas/ExpandedNodeOverlay.tsx +1 -2
  165. package/src/client/canvas/Presentation.tsx +53 -3
  166. package/src/client/canvas/ToolRail.tsx +2 -0
  167. package/src/client/canvas/TopBar.tsx +24 -9
  168. package/src/client/canvas/auto-fit.ts +9 -11
  169. package/src/client/canvas/canvas-area.ts +1 -1
  170. package/src/client/canvas/use-focus-trap.ts +6 -1
  171. package/src/client/mermaid-entry.ts +6 -20
  172. package/src/client/mermaid-render.ts +39 -0
  173. package/src/client/nodes/AxStepControls.tsx +45 -69
  174. package/src/client/nodes/BoardNode.tsx +65 -9
  175. package/src/client/nodes/ContextNode.tsx +88 -396
  176. package/src/client/nodes/ExtAppFrame.tsx +283 -1462
  177. package/src/client/nodes/FileNode.tsx +92 -81
  178. package/src/client/nodes/HtmlNode.tsx +8 -36
  179. package/src/client/nodes/LedgerNode.tsx +31 -17
  180. package/src/client/nodes/MarkdownNode.tsx +8 -17
  181. package/src/client/nodes/McpAppNode.tsx +48 -154
  182. package/src/client/nodes/MermaidNode.tsx +80 -69
  183. package/src/client/nodes/PromptNode.tsx +12 -14
  184. package/src/client/nodes/ResponseNode.tsx +8 -6
  185. package/src/client/nodes/StatusNode.tsx +22 -7
  186. package/src/client/nodes/StatusSummary.tsx +5 -3
  187. package/src/client/nodes/TraceNode.tsx +8 -8
  188. package/src/client/nodes/ViewerFrame.tsx +262 -0
  189. package/src/client/nodes/ViewerHost.tsx +41 -0
  190. package/src/client/nodes/WebpageNode.tsx +22 -24
  191. package/src/client/nodes/iframe-document-url.ts +20 -27
  192. package/src/client/nodes/primitive-copy.ts +97 -0
  193. package/src/client/nodes/use-iframe-content-height.ts +34 -10
  194. package/src/client/nodes/use-surface-frame.ts +22 -11
  195. package/src/client/nodes/viewer-runtime-state.ts +41 -35
  196. package/src/client/state/canvas-store.ts +18 -12
  197. package/src/client/state/intent-bridge.ts +1 -0
  198. package/src/client/state/presentation.ts +135 -15
  199. package/src/client/state/sse-bridge.ts +18 -19
  200. package/src/client/theme/global.css +389 -229
  201. package/src/client/theme/surface-theme.css +6 -6
  202. package/src/json-render/charts/tufte-components.tsx +44 -2
  203. package/src/json-render/renderer/index.css +62 -2
  204. package/src/json-render/renderer/index.tsx +31 -7
  205. package/src/json-render/server.ts +3 -2
  206. package/src/mcp/canvas-access.ts +6 -47
  207. package/src/mcp/resource-subscriptions.ts +181 -0
  208. package/src/mcp/server.ts +185 -219
  209. package/src/server/ax-wait.ts +21 -6
  210. package/src/server/board-export.ts +35 -24
  211. package/src/server/canvas-geometry.ts +1 -0
  212. package/src/server/canvas-operations.ts +6 -2
  213. package/src/server/canvas-state.ts +5 -0
  214. package/src/server/demo-state.json +106 -100
  215. package/src/server/html-primitives.ts +3 -9
  216. package/src/server/html-surface.ts +8 -0
  217. package/src/server/index.ts +30 -12
  218. package/src/server/operations/http.ts +69 -21
  219. package/src/server/operations/index.ts +8 -1
  220. package/src/server/operations/invoker.ts +53 -5
  221. package/src/server/operations/mcp-contracts.ts +354 -0
  222. package/src/server/operations/mcp.ts +153 -18
  223. package/src/server/operations/ops/ax-await.ts +18 -10
  224. package/src/server/operations/ops/ax-read.ts +2 -0
  225. package/src/server/operations/ops/ax-timeline.ts +2 -2
  226. package/src/server/operations/ops/batch.ts +27 -8
  227. package/src/server/operations/ops/boards.ts +1 -3
  228. package/src/server/operations/ops/nodes.ts +18 -3
  229. package/src/server/operations/ops/viewport.ts +11 -9
  230. package/src/server/operations/registry.ts +24 -4
  231. package/src/server/operations/types.ts +16 -2
  232. package/src/server/server.ts +17 -59
  233. package/src/server/tour-control.ts +66 -6
  234. package/src/server/webpage-node.ts +9 -4
  235. package/src/shared/ax-surface-protocol.ts +0 -11
  236. package/src/shared/content-height-reporter.ts +4 -3
  237. 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';
@@ -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;
@@ -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 {};
@@ -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;
@@ -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): 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;
@@ -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>;
@@ -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'>;
@@ -120,7 +120,7 @@ export declare function resizeNode(id: string, size: {
120
120
  width: number;
121
121
  height: number;
122
122
  }): void;
123
- export declare function bringToFront(id: string): void;
123
+ export declare function bringToFront(id: string, persist?: boolean): void;
124
124
  export declare function toggleCollapsed(id: string): void;
125
125
  export declare function setViewport(v: Partial<ViewportState>): void;
126
126
  export declare function replaceViewport(next: ViewportState): void;
@@ -161,11 +161,13 @@ export declare function animateCameraPath(frameAt: (t: number) => ViewportState,
161
161
  export declare function cancelViewportAnimation(): void;
162
162
  export declare function persistLayout(options?: {
163
163
  recordHistory?: boolean;
164
+ raisedNodeId?: string;
164
165
  }): void;
165
166
  export declare function restoreLayout(): Map<string, Partial<CanvasNodeState>> | null;
166
167
  export declare function fitAll(containerW: number, containerH: number): void;
167
168
  export declare function focusNode(id: string, options?: {
168
169
  recordHistory?: boolean;
170
+ persistStacking?: boolean;
169
171
  }): void;
170
172
  export declare function cycleActiveNode(direction?: 1 | -1): void;
171
173
  export declare function walkGraph(direction: 'up' | 'down' | 'left' | 'right'): 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>;
@@ -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,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;
@@ -1,16 +1,11 @@
1
1
  import { type CanvasLayout, type CanvasNodeState, type PmxCanvas } from '../server/index.js';
2
- import type { PmxAxSource } from '../server/ax-state.js';
3
2
  import type { ContextReadInput } from '../server/context-reads.js';
4
3
  import { type OperationInvoker } from '../server/operations/index.js';
5
4
  type AxStateResult = ReturnType<PmxCanvas['getAxState']>;
6
5
  type AxContextResult = ReturnType<PmxCanvas['getAxContext']>;
7
- type SubmitAxInteractionInput = Parameters<PmxCanvas['submitAxInteraction']>[0];
8
- type SubmitAxInteractionResult = ReturnType<PmxCanvas['submitAxInteraction']>;
9
6
  type GetPendingSteeringResult = ReturnType<PmxCanvas['getPendingSteering']>;
10
7
  type ListElicitationsResult = ReturnType<PmxCanvas['listElicitations']>;
11
8
  type ListModeRequestsResult = ReturnType<PmxCanvas['listModeRequests']>;
12
- type IngestActivityInput = Parameters<PmxCanvas['ingestActivity']>[0];
13
- type IngestActivityResult = ReturnType<PmxCanvas['ingestActivity']>;
14
9
  type GetPolicyResult = ReturnType<PmxCanvas['getPolicy']>;
15
10
  type GetAxTimelineQuery = Parameters<PmxCanvas['getAxTimeline']>[0];
16
11
  type GetAxTimelineResult = ReturnType<PmxCanvas['getAxTimeline']>;
@@ -38,18 +33,12 @@ export interface CanvasAccess {
38
33
  listWorkItems(): Promise<ListWorkItemsResult>;
39
34
  listApprovalGates(): Promise<ListApprovalGatesResult>;
40
35
  listReviewAnnotations(): Promise<ListReviewAnnotationsResult>;
41
- submitAxInteraction(input: SubmitAxInteractionInput, options?: {
42
- source?: PmxAxSource;
43
- }): Promise<SubmitAxInteractionResult>;
44
36
  getPendingSteering(options?: {
45
37
  consumer?: string;
46
38
  limit?: number;
47
39
  }): Promise<GetPendingSteeringResult>;
48
40
  listElicitations(): Promise<ListElicitationsResult>;
49
41
  listModeRequests(): Promise<ListModeRequestsResult>;
50
- ingestActivity(input: IngestActivityInput, options?: {
51
- source?: PmxAxSource;
52
- }): Promise<IngestActivityResult>;
53
42
  getPolicy(): Promise<GetPolicyResult>;
54
43
  getHistory(): Promise<HistoryResult>;
55
44
  getPinnedNodeIds(board?: string): Promise<string[]>;
@@ -62,7 +51,7 @@ export interface CanvasAccess {
62
51
  runBatch(operations: RunBatchInput): Promise<RunBatchResult>;
63
52
  getCodeGraph(): Promise<CodeGraphResult>;
64
53
  getAutomationWebViewStatus(): Promise<AutomationWebViewStatus>;
65
- screenshotAutomationWebView(options?: AutomationScreenshotOptions): Promise<Uint8Array>;
54
+ screenshotAutomationWebView(options?: AutomationScreenshotOptions, signal?: AbortSignal): Promise<Uint8Array>;
66
55
  }
67
56
  export declare function refreshCanvasAccess(access: CanvasAccess): Promise<CanvasAccess>;
68
57
  /**
@@ -0,0 +1,7 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { CanvasAccess } from './canvas-access.js';
3
+ /** One subscription set and event source per MCP connection. Notifications are not reads. */
4
+ export declare function registerResourceSubscriptions(server: McpServer, getCanvas: () => Promise<CanvasAccess>): {
5
+ attach: (canvas: CanvasAccess) => void;
6
+ dispose: () => void;
7
+ };
@@ -19,4 +19,6 @@
19
19
  * }
20
20
  * ```
21
21
  */
22
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
23
+ export declare function createMcpServer(): McpServer;
22
24
  export declare function startMcpServer(): Promise<void>;
@@ -33,4 +33,5 @@ export declare function waitForAxCondition(opts: {
33
33
  ready: () => boolean;
34
34
  timeoutMs: number;
35
35
  channel?: string;
36
+ signal?: AbortSignal;
36
37
  }): Promise<void>;
@@ -168,6 +168,7 @@ export declare function resolveCanvasNode(nodeRef: CanvasNodeLookupInput): {
168
168
  };
169
169
  export declare function refreshCanvasWebpageNode(id: string, options?: {
170
170
  url?: string;
171
+ signal?: AbortSignal;
171
172
  }): Promise<{
172
173
  ok: boolean;
173
174
  id: string;
@@ -170,6 +170,7 @@ export interface CanvasNodeUpdate {
170
170
  height: number;
171
171
  };
172
172
  collapsed?: boolean;
173
+ zIndex?: number;
173
174
  }
174
175
  export type CanvasChangeType = 'pins' | 'nodes' | 'ax' | 'ax-timeline';
175
176
  /** Name for a board nobody named yet: when it was made, to the minute. */
@@ -740,4 +741,5 @@ declare class CanvasStateManager {
740
741
  releaseGroupChildren(groupId: string): boolean;
741
742
  clear(): void;
742
743
  }
744
+ export declare const boardCatalogEpoch: `${string}-${string}-${string}-${string}-${string}`;
743
745
  export declare const canvasState: CanvasStateManager;
@@ -1,8 +1,8 @@
1
1
  import { EventEmitter } from 'node:events';
2
- import type { Camera, Tour, TourStop } from '../shared/tour.js';
3
- import { type TourStep, type TourStepResult } from './tour-control.js';
4
- export type { Tour, TourStop } from '../shared/tour.js';
5
- export type { TourStep, TourStepResult } from './tour-control.js';
2
+ import type { Camera, Tour, TourPresenter, TourStop } from '../shared/tour.js';
3
+ import { type TourState, type TourStep, type TourStepResult, type TourSuperseded } from './tour-control.js';
4
+ export type { Tour, TourPresenter, TourStop } from '../shared/tour.js';
5
+ export type { TourState, TourStep, TourStepResult, TourSuperseded } from './tour-control.js';
6
6
  import type { AgentPhase, AgentPresence, AgentPresenceSnapshot } from '../shared/agent-presence.js';
7
7
  import { canvasState } from './canvas-state.js';
8
8
  import type { CanvasAnnotation, CanvasNodeState, CanvasEdge, CanvasLayout } from './canvas-state.js';
@@ -163,14 +163,19 @@ export declare class PmxCanvas extends EventEmitter {
163
163
  ungroupNodes(groupId: string, options?: {
164
164
  intentId?: string;
165
165
  }): boolean;
166
- getTour(): Tour;
166
+ getTour(): TourState;
167
167
  setTour(tour: Tour | null): void;
168
168
  /** Present a tour stop (index, `next` or `previous`) in the workbench. Not recorded in undo history. */
169
169
  goToTourStop(step: TourStep, options?: {
170
170
  present?: boolean;
171
+ presenter?: undefined;
171
172
  }): TourStepResult;
173
+ goToTourStop(step: TourStep, options: {
174
+ present?: boolean;
175
+ presenter?: TourPresenter;
176
+ }): TourStepResult | TourSuperseded;
172
177
  /** Leave presentation in every viewer. */
173
- exitTour(): void;
178
+ exitTour(presenter?: TourPresenter): void;
174
179
  /** Ease the camera to a node, world rect or viewport. Not recorded in undo history. */
175
180
  moveCamera(stop: TourStop): {
176
181
  viewport: Camera;
@@ -1,3 +1,13 @@
1
+ import { type OperationProgress } from './types.js';
2
+ /** Opt-in NDJSON; the terminal frame retains the ordinary HTTP status/body. */
3
+ export type OperationStreamFrame = {
4
+ type: 'progress';
5
+ progress: OperationProgress;
6
+ } | {
7
+ type: 'result';
8
+ status: number;
9
+ body: unknown;
10
+ };
1
11
  export declare function matchOperationPath(template: string, pathname: string): Record<string, string> | null;
2
12
  /**
3
13
  * Shared body reader: preserves the parsed JSON value as-is (object, array,
@@ -3,6 +3,6 @@ export { dispatchOperationRoute } from './http.js';
3
3
  export { runCanvasBatchOperation, type BatchEnvelope } from './ops/batch.js';
4
4
  export type { OpenMcpAppCoreResult } from './ops/app.js';
5
5
  export { LocalOperationInvoker, HttpOperationInvoker, type OperationInvoker } from './invoker.js';
6
- export { registerOperationTools, registerCompositeTools, type OperationToolHost } from './mcp.js';
6
+ export { registerOperationTools, registerCompositeTools, registerOperationHelpTool, type OperationToolHost, } from './mcp.js';
7
7
  export { compositeToolDefinitions, type CompositeToolDefinition } from './composites.js';
8
- export { OperationError, defineOperation, type Operation, type OperationContext, type OperationDefinition, type OperationErrorStatus, } from './types.js';
8
+ export { OperationError, defineOperation, type Operation, type OperationContext, type OperationDefinition, type OperationExecutionOptions, type OperationErrorStatus, type OperationProgress, } from './types.js';
@@ -1,5 +1,6 @@
1
+ import { type OperationExecutionOptions } from './types.js';
1
2
  export interface OperationInvoker {
2
- invoke(name: string, input: Record<string, unknown>): Promise<unknown>;
3
+ invoke(name: string, input: Record<string, unknown>, options?: OperationExecutionOptions): Promise<unknown>;
3
4
  }
4
5
  /**
5
6
  * The agent-presence label for a transport: `PMX_CANVAS_AGENT_SOURCE` lets a
@@ -14,7 +15,7 @@ export declare class LocalOperationInvoker implements OperationInvoker {
14
15
  private readonly proxiedRead;
15
16
  /** `source` labels this caller's agent presence ('mcp', 'sdk', …). */
16
17
  constructor(source?: string, allowExternalMcp?: boolean);
17
- invoke(name: string, input: Record<string, unknown>): Promise<unknown>;
18
+ invoke(name: string, input: Record<string, unknown>, options?: OperationExecutionOptions): Promise<unknown>;
18
19
  }
19
20
  /** Builds the HTTP request from the op's route template (`:id` from input, GET flags to query). */
20
21
  export declare class HttpOperationInvoker implements OperationInvoker {
@@ -24,5 +25,5 @@ export declare class HttpOperationInvoker implements OperationInvoker {
24
25
  private readonly proxiedRead;
25
26
  /** `source` labels this caller's agent presence on the server ('cli', 'mcp', …). */
26
27
  constructor(baseUrl: string, source?: string, allowExternalMcp?: boolean);
27
- invoke(name: string, rawInput: Record<string, unknown>): Promise<unknown>;
28
+ invoke(name: string, rawInput: Record<string, unknown>, options?: OperationExecutionOptions): Promise<unknown>;
28
29
  }