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.
- package/.github/extensions/pmx-canvas/runtime.json +1 -1
- package/.github/extensions/pmx-canvas/tools.json +9418 -2016
- package/CHANGELOG.md +54 -1
- package/dist/canvas/chunks/abnfDiagram-N423BO3Z-p8dtp6va.js +1 -0
- package/dist/canvas/chunks/architecture-TIHT7OUA-9tffvpsv.js +1 -0
- package/dist/canvas/chunks/architectureDiagram-T3A2C74G-5jhmxrzf.js +36 -0
- package/dist/canvas/chunks/blockDiagram-VBNYF7ZC-pw1fa9yb.js +132 -0
- package/dist/canvas/chunks/c4Diagram-5PPSVZJV-x07nq0tt.js +10 -0
- package/dist/canvas/chunks/classDiagram-JCYQIIEL-nc6g5x1r.js +1 -0
- package/dist/canvas/chunks/classDiagram-v2-OCEON4UE-0qnbpwvh.js +1 -0
- package/dist/canvas/chunks/cose-bilkent-JH36ORCC-nm39npq0.js +1 -0
- package/dist/canvas/chunks/cynefin-VYW2F7L2-ys8p46ts.js +1 -0
- package/dist/canvas/chunks/cynefinDiagram-MW4NZA55-vdxrwahz.js +62 -0
- package/dist/canvas/chunks/dagre-VZM6K2ZE-bqdm7wpd.js +4 -0
- package/dist/canvas/chunks/diagram-7IWD3JNH-gs5gpr93.js +30 -0
- package/dist/canvas/chunks/diagram-B4RE2ZJO-cgwjg47s.js +3 -0
- package/dist/canvas/chunks/diagram-LBJQPF4R-w3vahpav.js +24 -0
- package/dist/canvas/chunks/diagram-Q27KOJAE-42837z6h.js +24 -0
- package/dist/canvas/chunks/diagram-UB23O5K3-4fz83q59.js +41 -0
- package/dist/canvas/chunks/ebnfDiagram-BXEA7PRR-zphtgegj.js +1 -0
- package/dist/canvas/chunks/erDiagram-JOGREHBK-zvbbdxp4.js +85 -0
- package/dist/canvas/chunks/eventmodeling-45OFAUF4-v9q6dn4c.js +1 -0
- package/dist/canvas/chunks/flowDiagram-UKHOOZJN-yrr5z8tc.js +1 -0
- package/dist/canvas/chunks/ganttDiagram-PKOTCBZU-282jzycm.js +292 -0
- package/dist/canvas/chunks/gitGraph-TEB2WS4Q-kdwb8m0a.js +1 -0
- package/dist/canvas/chunks/gitGraphDiagram-DS77QQ5N-vqqy6p1b.js +106 -0
- package/dist/canvas/chunks/index-0rk4gp1g.js +2 -0
- package/dist/canvas/chunks/index-194m3hc3.js +2 -0
- package/dist/canvas/chunks/index-1r72hdzb.js +301 -0
- package/dist/canvas/chunks/index-353m7b0p.js +2 -0
- package/dist/canvas/chunks/index-3cy1bzwh.js +2 -0
- package/dist/canvas/chunks/index-5tv8v1hk.js +1 -0
- package/dist/canvas/chunks/index-6ceya556.js +332 -0
- package/dist/canvas/chunks/index-6qmsnxwy.js +4 -0
- package/dist/canvas/chunks/index-d3b3gqe9.js +2 -0
- package/dist/canvas/chunks/index-fjtdggjn.js +2 -0
- package/dist/canvas/chunks/index-g3pwnqeb.js +2 -0
- package/dist/canvas/chunks/index-gf4e0et4.js +2 -0
- package/dist/canvas/chunks/index-hj99nz1f.js +1 -0
- package/dist/canvas/chunks/index-nprm96xp.js +16 -0
- package/dist/canvas/chunks/index-qj8fxwsf.js +2 -0
- package/dist/canvas/chunks/index-r2fyc9w1.js +89 -0
- package/dist/canvas/chunks/index-rft2hcz5.js +2 -0
- package/dist/canvas/chunks/index-rh7nv68n.js +2 -0
- package/dist/canvas/chunks/index-s4j678gj.js +2 -0
- package/dist/canvas/chunks/index-tb1wf525.js +179 -0
- package/dist/canvas/chunks/index-vv56h019.js +2 -0
- package/dist/canvas/chunks/index-w2mra17t.js +207 -0
- package/dist/canvas/chunks/index-wgv7en21.js +232 -0
- package/dist/canvas/chunks/index-yw8h9vha.js +157 -0
- package/dist/canvas/chunks/info-DKCQHKI2-wpzs6sz3.js +1 -0
- package/dist/canvas/chunks/infoDiagram-6WML65LV-v1yvggqj.js +2 -0
- package/dist/canvas/chunks/ishikawaDiagram-WSZJBQD7-5hnq1a9p.js +70 -0
- package/dist/canvas/chunks/journeyDiagram-NVQOT4AX-zjcffveh.js +139 -0
- package/dist/canvas/chunks/kanban-definition-27J2QSJJ-dakqtfp1.js +89 -0
- package/dist/canvas/chunks/katex-dmg8k4zm.js +257 -0
- package/dist/canvas/chunks/mermaid.core-j2geswrd.js +12 -0
- package/dist/canvas/chunks/mindmap-definition-FAOFIHXS-142xhr3k.js +96 -0
- package/dist/canvas/chunks/packet-7NZHBO7P-xn439f0s.js +1 -0
- package/dist/canvas/chunks/pegDiagram-VL7TDLO6-5wvk7vsd.js +1 -0
- package/dist/canvas/chunks/pie-RZYD4A2V-0kf16rwh.js +1 -0
- package/dist/canvas/chunks/pieDiagram-7S7Q4E2Y-ztdhwycc.js +39 -0
- package/dist/canvas/chunks/quadrantDiagram-CIZ2JOQS-c5p9gmg6.js +7 -0
- package/dist/canvas/chunks/radar-I7S5WNFK-0g2pz36t.js +1 -0
- package/dist/canvas/chunks/railroad-3IZDKUUU-fcaran6j.js +1 -0
- package/dist/canvas/chunks/railroad-abnf-AHOZXSZD-wgdya41q.js +1 -0
- package/dist/canvas/chunks/railroad-ebnf-EBAXGLYW-gy07a4ka.js +1 -0
- package/dist/canvas/chunks/railroad-peg-LSFZ7HO6-ewk6wtkh.js +1 -0
- package/dist/canvas/chunks/railroadDiagram-AXF67PYL-xkmqkjwf.js +1 -0
- package/dist/canvas/chunks/requirementDiagram-LRYGKXZP-9wm2dyaw.js +84 -0
- package/dist/canvas/chunks/sankeyDiagram-W5VNT64P-2w19etgb.js +40 -0
- package/dist/canvas/chunks/sequenceDiagram-SI44F4Z6-0jn0vwmz.js +162 -0
- package/dist/canvas/chunks/sizeCapture-X5ZJPWSS-x75epwdq.js +1 -0
- package/dist/canvas/chunks/stateDiagram-OKZ733FA-schjpy6d.js +1 -0
- package/dist/canvas/chunks/stateDiagram-v2-UEYNNEHI-k8sfp2e7.js +1 -0
- package/dist/canvas/chunks/swimlanes-SLNWSIFB-gkw4xce3.js +1 -0
- package/dist/canvas/chunks/swimlanesDiagram-ULZ7WXOC-nqysw67j.js +8 -0
- package/dist/canvas/chunks/timeline-definition-Z64GVDOM-x7nkcy01.js +120 -0
- package/dist/canvas/chunks/treeView-QDETBFTQ-cesw6gp0.js +1 -0
- package/dist/canvas/chunks/treemap-6X3UGDF4-zdv4knp9.js +1 -0
- package/dist/canvas/chunks/vennDiagram-T6HMQDX7-x8dqn9yf.js +34 -0
- package/dist/canvas/chunks/wardley-OPB4EBWU-44pdddez.js +1 -0
- package/dist/canvas/chunks/wardleyDiagram-T6FBY63Y-t1j52t9r.js +78 -0
- package/dist/canvas/chunks/xychartDiagram-ELKLHX3M-38t16pme.js +7 -0
- package/dist/canvas/global.css +389 -229
- package/dist/canvas/index.js +141 -211
- package/dist/canvas/mcp-app.html +4205 -554
- package/dist/canvas/mermaid-entry.js +338 -338
- package/dist/canvas/surface-theme.css +6 -6
- package/dist/json-render/index.css +1 -1
- package/dist/json-render/index.js +49 -49
- package/dist/types/client/canvas/BarHint.d.ts +5 -3
- package/dist/types/client/canvas/CanvasNode.d.ts +0 -11
- package/dist/types/client/canvas/EdgeLayer.d.ts +1 -2
- package/dist/types/client/canvas/auto-fit.d.ts +4 -5
- package/dist/types/client/mermaid-entry.d.ts +1 -2
- package/dist/types/client/mermaid-render.d.ts +1 -0
- package/dist/types/client/nodes/BoardNode.d.ts +1 -1
- package/dist/types/client/nodes/ExtAppFrame.d.ts +7 -90
- package/dist/types/client/nodes/McpAppNode.d.ts +1 -25
- package/dist/types/client/nodes/MermaidNode.d.ts +1 -8
- package/dist/types/client/nodes/ViewerFrame.d.ts +29 -0
- package/dist/types/client/nodes/ViewerHost.d.ts +6 -0
- package/dist/types/client/nodes/iframe-document-url.d.ts +3 -9
- package/dist/types/client/nodes/primitive-copy.d.ts +5 -0
- package/dist/types/client/nodes/use-iframe-content-height.d.ts +1 -1
- package/dist/types/client/nodes/use-surface-frame.d.ts +4 -6
- package/dist/types/client/nodes/viewer-runtime-state.d.ts +2 -1
- package/dist/types/client/state/canvas-store.d.ts +3 -1
- package/dist/types/client/state/intent-bridge.d.ts +1 -0
- package/dist/types/client/state/presentation.d.ts +17 -6
- package/dist/types/json-render/server.d.ts +2 -1
- package/dist/types/mcp/canvas-access.d.ts +1 -12
- package/dist/types/mcp/resource-subscriptions.d.ts +7 -0
- package/dist/types/mcp/server.d.ts +2 -0
- package/dist/types/server/ax-wait.d.ts +1 -0
- package/dist/types/server/canvas-operations.d.ts +1 -0
- package/dist/types/server/canvas-state.d.ts +2 -0
- package/dist/types/server/index.d.ts +11 -6
- package/dist/types/server/operations/http.d.ts +10 -0
- package/dist/types/server/operations/index.d.ts +2 -2
- package/dist/types/server/operations/invoker.d.ts +4 -3
- package/dist/types/server/operations/mcp-contracts.d.ts +20 -0
- package/dist/types/server/operations/mcp.d.ts +2 -0
- package/dist/types/server/operations/ops/batch.d.ts +1 -0
- package/dist/types/server/operations/ops/boards.d.ts +0 -1
- package/dist/types/server/operations/registry.d.ts +2 -2
- package/dist/types/server/operations/types.d.ts +12 -2
- package/dist/types/server/server.d.ts +2 -0
- package/dist/types/server/tour-control.d.ts +13 -3
- package/dist/types/server/webpage-node.d.ts +1 -0
- package/dist/types/shared/ax-surface-protocol.d.ts +0 -9
- package/dist/types/shared/tour.d.ts +8 -0
- package/docs/api-reference.md +2 -2
- package/docs/cli.md +1 -1
- package/docs/design/Chrome.dc.html +32 -6
- package/docs/design/Types1.dc.html +3 -2
- package/docs/design/Types2.dc.html +1 -1
- package/docs/design/Types3.dc.html +1 -1
- package/docs/design/Zoom.dc.html +37 -60
- package/docs/design/canvas.json +1 -1
- package/docs/design.md +169 -4
- package/docs/http-api.md +82 -1
- package/docs/mcp.md +101 -21
- package/docs/node-types.md +38 -3
- package/docs/plans/plan-009-tech-debt-backlog.md +2 -2
- package/docs/plans/plan-019-post-0.9-roadmap.md +402 -13
- package/docs/product-vision-2026-09.md +9 -0
- package/docs/sdk.md +5 -2
- package/package.json +2 -2
- package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/runtime.json +1 -1
- package/plugins/pmx-canvas/plugin.json +1 -1
- package/plugins/pmx-canvas/runtime.json +1 -1
- package/plugins/pmx-canvas/tools.json +9418 -2016
- package/skills/pmx-canvas/SKILL.md +19 -21
- package/skills/pmx-canvas/references/full-reference.md +44 -6
- package/skills/pmx-canvas/references/installing-pmx-canvas.md +7 -7
- package/skills/published-consumer-e2e/scripts/run-published-consumer-e2e.sh +3 -5
- package/src/client/canvas/BarHint.tsx +6 -3
- package/src/client/canvas/CanvasNode.tsx +34 -47
- package/src/client/canvas/CanvasViewport.tsx +6 -7
- package/src/client/canvas/ContextMenu.tsx +63 -3
- package/src/client/canvas/EdgeLayer.tsx +365 -169
- package/src/client/canvas/ExpandedNodeOverlay.tsx +1 -2
- package/src/client/canvas/Presentation.tsx +53 -3
- package/src/client/canvas/ToolRail.tsx +2 -0
- package/src/client/canvas/TopBar.tsx +24 -9
- package/src/client/canvas/auto-fit.ts +9 -11
- package/src/client/canvas/canvas-area.ts +1 -1
- package/src/client/canvas/use-focus-trap.ts +6 -1
- package/src/client/mermaid-entry.ts +6 -20
- package/src/client/mermaid-render.ts +39 -0
- package/src/client/nodes/AxStepControls.tsx +45 -69
- package/src/client/nodes/BoardNode.tsx +65 -9
- package/src/client/nodes/ContextNode.tsx +88 -396
- package/src/client/nodes/ExtAppFrame.tsx +283 -1462
- package/src/client/nodes/FileNode.tsx +92 -81
- package/src/client/nodes/HtmlNode.tsx +8 -36
- package/src/client/nodes/LedgerNode.tsx +31 -17
- package/src/client/nodes/MarkdownNode.tsx +8 -17
- package/src/client/nodes/McpAppNode.tsx +48 -154
- package/src/client/nodes/MermaidNode.tsx +80 -69
- package/src/client/nodes/PromptNode.tsx +12 -14
- package/src/client/nodes/ResponseNode.tsx +8 -6
- package/src/client/nodes/StatusNode.tsx +22 -7
- package/src/client/nodes/StatusSummary.tsx +5 -3
- package/src/client/nodes/TraceNode.tsx +8 -8
- package/src/client/nodes/ViewerFrame.tsx +262 -0
- package/src/client/nodes/ViewerHost.tsx +41 -0
- package/src/client/nodes/WebpageNode.tsx +22 -24
- package/src/client/nodes/iframe-document-url.ts +20 -27
- package/src/client/nodes/primitive-copy.ts +97 -0
- package/src/client/nodes/use-iframe-content-height.ts +34 -10
- package/src/client/nodes/use-surface-frame.ts +22 -11
- package/src/client/nodes/viewer-runtime-state.ts +41 -35
- package/src/client/state/canvas-store.ts +18 -12
- package/src/client/state/intent-bridge.ts +1 -0
- package/src/client/state/presentation.ts +135 -15
- package/src/client/state/sse-bridge.ts +18 -19
- package/src/client/theme/global.css +389 -229
- package/src/client/theme/surface-theme.css +6 -6
- package/src/json-render/charts/tufte-components.tsx +44 -2
- package/src/json-render/renderer/index.css +62 -2
- package/src/json-render/renderer/index.tsx +31 -7
- package/src/json-render/server.ts +3 -2
- package/src/mcp/canvas-access.ts +6 -47
- package/src/mcp/resource-subscriptions.ts +181 -0
- package/src/mcp/server.ts +185 -219
- package/src/server/ax-wait.ts +21 -6
- package/src/server/board-export.ts +35 -24
- package/src/server/canvas-geometry.ts +1 -0
- package/src/server/canvas-operations.ts +6 -2
- package/src/server/canvas-state.ts +5 -0
- package/src/server/demo-state.json +106 -100
- package/src/server/html-primitives.ts +3 -9
- package/src/server/html-surface.ts +8 -0
- package/src/server/index.ts +30 -12
- package/src/server/operations/http.ts +69 -21
- package/src/server/operations/index.ts +8 -1
- package/src/server/operations/invoker.ts +53 -5
- package/src/server/operations/mcp-contracts.ts +354 -0
- package/src/server/operations/mcp.ts +153 -18
- package/src/server/operations/ops/ax-await.ts +18 -10
- package/src/server/operations/ops/ax-read.ts +2 -0
- package/src/server/operations/ops/ax-timeline.ts +2 -2
- package/src/server/operations/ops/batch.ts +27 -8
- package/src/server/operations/ops/boards.ts +1 -3
- package/src/server/operations/ops/nodes.ts +18 -3
- package/src/server/operations/ops/viewport.ts +11 -9
- package/src/server/operations/registry.ts +24 -4
- package/src/server/operations/types.ts +16 -2
- package/src/server/server.ts +17 -59
- package/src/server/tour-control.ts +66 -6
- package/src/server/webpage-node.ts +9 -4
- package/src/shared/ax-surface-protocol.ts +0 -11
- package/src/shared/content-height-reporter.ts +4 -3
- 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
|
-
/**
|
|
14
|
-
body?:
|
|
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
|
|
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
|
|
16
|
-
*
|
|
17
|
-
*
|
|
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).
|
|
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
|
-
/**
|
|
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,
|
|
97
|
-
export declare function resolveExtAppContainerDimensions(target:
|
|
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/
|
|
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/
|
|
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 {};
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
3
|
-
|
|
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>;
|
|
@@ -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
|
|
8
|
-
*
|
|
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
|
-
|
|
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;
|
|
@@ -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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
}
|
|
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?:
|
|
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
|
+
};
|
|
@@ -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():
|
|
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
|
|
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
|
|
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
|
|
28
|
+
invoke(name: string, rawInput: Record<string, unknown>, options?: OperationExecutionOptions): Promise<unknown>;
|
|
28
29
|
}
|