pmx-canvas 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/extensions/pmx-canvas/extension.mjs +3 -1
- package/.github/extensions/pmx-canvas/runtime.json +1 -1
- package/.github/extensions/pmx-canvas/tools.json +688 -128
- package/CHANGELOG.md +69 -0
- package/dist/amp-plugin/pmx-canvas/LICENSE +21 -0
- package/dist/amp-plugin/pmx-canvas/THIRD_PARTY_LICENSES.txt +331 -0
- package/dist/amp-plugin/pmx-canvas/index.js +5445 -0
- package/dist/amp-plugin/pmx-canvas/runtime.json +3 -0
- package/dist/amp-plugin/pmx-canvas/shared-runtime.mjs +194 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/SKILL.md +251 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/evals.json +1086 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/jwt.ts +17 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/login.ts +12 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/middleware.ts +13 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/routes/auth.ts +13 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/investigation-board/src/handlers/users.ts +27 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/mcp.json +36 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/ax-html-control-surface.md +101 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/codex-app-adapter.md +151 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/excalidraw-diagram-authoring.md +150 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/full-reference.md +1785 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/github-copilot-app-adapter.md +223 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/html-primitives.md +139 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/importing-context.md +132 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/installing-pmx-canvas.md +251 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/tours-and-recording.md +111 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/workbench-workflows.md +900 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas-orchestration/SKILL.md +141 -0
- package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas-testing/SKILL.md +266 -0
- package/dist/amp-plugin/pmx-canvas/start-mcp.mjs +14857 -0
- package/dist/amp-plugin/pmx-canvas/tools.json +10963 -0
- package/dist/canvas/chunks/abnfDiagram-N423BO3Z-cwtsds5d.js +1 -0
- package/dist/canvas/chunks/architecture-TIHT7OUA-x63cwejs.js +1 -0
- package/dist/canvas/chunks/architectureDiagram-T3A2C74G-b4xc9tpz.js +36 -0
- package/dist/canvas/chunks/blockDiagram-VBNYF7ZC-ahp3yxxs.js +132 -0
- package/dist/canvas/chunks/c4Diagram-5PPSVZJV-nappnay7.js +10 -0
- package/dist/canvas/chunks/classDiagram-JCYQIIEL-k1j2xc1t.js +1 -0
- package/dist/canvas/chunks/classDiagram-v2-OCEON4UE-33x08xf2.js +1 -0
- package/dist/canvas/chunks/cose-bilkent-JH36ORCC-a428syda.js +1 -0
- package/dist/canvas/chunks/cynefin-VYW2F7L2-8v6jxfz8.js +1 -0
- package/dist/canvas/chunks/cynefinDiagram-MW4NZA55-nspsqebj.js +62 -0
- package/dist/canvas/chunks/dagre-VZM6K2ZE-8y6177fh.js +4 -0
- package/dist/canvas/chunks/diagram-7IWD3JNH-vym028wn.js +30 -0
- package/dist/canvas/chunks/diagram-B4RE2ZJO-jddqb8sy.js +3 -0
- package/dist/canvas/chunks/diagram-LBJQPF4R-bjwbpkrn.js +24 -0
- package/dist/canvas/chunks/diagram-Q27KOJAE-j6ph6hcx.js +24 -0
- package/dist/canvas/chunks/diagram-UB23O5K3-p09w8jej.js +41 -0
- package/dist/canvas/chunks/ebnfDiagram-BXEA7PRR-j975ycq5.js +1 -0
- package/dist/canvas/chunks/erDiagram-JOGREHBK-sxp6hjn8.js +85 -0
- package/dist/canvas/chunks/eventmodeling-45OFAUF4-xzfgn6xg.js +1 -0
- package/dist/canvas/chunks/flowDiagram-UKHOOZJN-2nsmkskb.js +1 -0
- package/dist/canvas/chunks/ganttDiagram-PKOTCBZU-4tv230y2.js +292 -0
- package/dist/canvas/chunks/gitGraph-TEB2WS4Q-macbhand.js +1 -0
- package/dist/canvas/chunks/gitGraphDiagram-DS77QQ5N-mqgmnw9g.js +106 -0
- package/dist/canvas/chunks/index-037z5dz2.js +232 -0
- package/dist/canvas/chunks/index-081n3har.js +207 -0
- package/dist/canvas/chunks/index-5n03dmb9.js +2 -0
- package/dist/canvas/chunks/index-5tv8v1hk.js +1 -0
- package/dist/canvas/chunks/index-60pgzdqe.js +157 -0
- package/dist/canvas/chunks/index-6ceya556.js +332 -0
- package/dist/canvas/chunks/index-8g1vb57n.js +2 -0
- package/dist/canvas/chunks/index-8rjes9r6.js +2 -0
- package/dist/canvas/chunks/index-9022d1n9.js +16 -0
- package/dist/canvas/chunks/index-9b02042t.js +2 -0
- package/dist/canvas/chunks/index-ap4q4vez.js +2 -0
- package/dist/canvas/chunks/index-dyp2nhd3.js +2 -0
- package/dist/canvas/chunks/index-frvta4tm.js +2 -0
- package/dist/canvas/chunks/index-gf4e0et4.js +2 -0
- package/dist/canvas/chunks/index-h9ycj8n2.js +2 -0
- package/dist/canvas/chunks/index-hj99nz1f.js +1 -0
- package/dist/canvas/chunks/index-mergmj97.js +2 -0
- package/dist/canvas/chunks/index-nwsya6dj.js +301 -0
- package/dist/canvas/chunks/index-nz8qbd1p.js +2 -0
- package/dist/canvas/chunks/index-qhfrazv3.js +2 -0
- package/dist/canvas/chunks/index-v119nznk.js +4 -0
- package/dist/canvas/chunks/index-vpt37m3d.js +89 -0
- package/dist/canvas/chunks/index-y9ma6azy.js +2 -0
- package/dist/canvas/chunks/index-zx0j3a2z.js +179 -0
- package/dist/canvas/chunks/info-DKCQHKI2-a0ykzs9z.js +1 -0
- package/dist/canvas/chunks/infoDiagram-6WML65LV-qv97qq6a.js +2 -0
- package/dist/canvas/chunks/ishikawaDiagram-WSZJBQD7-p9306gh0.js +70 -0
- package/dist/canvas/chunks/journeyDiagram-NVQOT4AX-sv67zats.js +139 -0
- package/dist/canvas/chunks/kanban-definition-27J2QSJJ-k2pfam6p.js +89 -0
- package/dist/canvas/chunks/katex-dmg8k4zm.js +257 -0
- package/dist/canvas/chunks/mermaid.core-83r0fdce.js +12 -0
- package/dist/canvas/chunks/mindmap-definition-FAOFIHXS-vg2newm1.js +96 -0
- package/dist/canvas/chunks/packet-7NZHBO7P-tqnabcdv.js +1 -0
- package/dist/canvas/chunks/pegDiagram-VL7TDLO6-k2h7zc5n.js +1 -0
- package/dist/canvas/chunks/pie-RZYD4A2V-wke6gyhe.js +1 -0
- package/dist/canvas/chunks/pieDiagram-7S7Q4E2Y-hg169p1v.js +39 -0
- package/dist/canvas/chunks/quadrantDiagram-CIZ2JOQS-bxtvsq0b.js +7 -0
- package/dist/canvas/chunks/radar-I7S5WNFK-w7ka0drw.js +1 -0
- package/dist/canvas/chunks/railroad-3IZDKUUU-y3vg318x.js +1 -0
- package/dist/canvas/chunks/railroad-abnf-AHOZXSZD-6hqvcz3c.js +1 -0
- package/dist/canvas/chunks/railroad-ebnf-EBAXGLYW-vcae260m.js +1 -0
- package/dist/canvas/chunks/railroad-peg-LSFZ7HO6-0dbyme23.js +1 -0
- package/dist/canvas/chunks/railroadDiagram-AXF67PYL-njyhcp4p.js +1 -0
- package/dist/canvas/chunks/requirementDiagram-LRYGKXZP-2z6v09gm.js +84 -0
- package/dist/canvas/chunks/sankeyDiagram-W5VNT64P-15mzam0e.js +40 -0
- package/dist/canvas/chunks/sequenceDiagram-SI44F4Z6-rbshyd2c.js +162 -0
- package/dist/canvas/chunks/sizeCapture-X5ZJPWSS-sg26xwts.js +1 -0
- package/dist/canvas/chunks/stateDiagram-OKZ733FA-6eahp98e.js +1 -0
- package/dist/canvas/chunks/stateDiagram-v2-UEYNNEHI-tty0ggn5.js +1 -0
- package/dist/canvas/chunks/swimlanes-SLNWSIFB-ze5db10t.js +1 -0
- package/dist/canvas/chunks/swimlanesDiagram-ULZ7WXOC-thze75gq.js +8 -0
- package/dist/canvas/chunks/timeline-definition-Z64GVDOM-vnp7jyy8.js +120 -0
- package/dist/canvas/chunks/treeView-QDETBFTQ-6ysffnm6.js +1 -0
- package/dist/canvas/chunks/treemap-6X3UGDF4-m3h9p066.js +1 -0
- package/dist/canvas/chunks/vennDiagram-T6HMQDX7-0qrnb7mj.js +34 -0
- package/dist/canvas/chunks/wardley-OPB4EBWU-dp37drwx.js +1 -0
- package/dist/canvas/chunks/wardleyDiagram-T6FBY63Y-8nxg8wqt.js +78 -0
- package/dist/canvas/chunks/xychartDiagram-ELKLHX3M-nj921e7s.js +7 -0
- package/dist/canvas/global.css +483 -230
- package/dist/canvas/index.js +158 -219
- package/dist/canvas/mcp-app.html +4301 -548
- 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/BoardMoveDialog.d.ts +2 -0
- package/dist/types/client/canvas/CanvasNode.d.ts +0 -11
- package/dist/types/client/canvas/EdgeEditor.d.ts +19 -0
- package/dist/types/client/canvas/EdgeLayer.d.ts +1 -2
- package/dist/types/client/canvas/GroupNavigation.d.ts +2 -0
- package/dist/types/client/canvas/TextPrompt.d.ts +4 -0
- 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/PromptNode.d.ts +1 -0
- 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/WorkCard.d.ts +7 -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-ax-surface-bridge.d.ts +1 -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 +18 -1
- package/dist/types/client/state/human-store.d.ts +2 -0
- package/dist/types/client/state/intent-bridge.d.ts +5 -2
- package/dist/types/client/state/presentation.d.ts +17 -6
- package/dist/types/client/state/relation-store.d.ts +11 -0
- package/dist/types/client/types.d.ts +1 -1
- package/dist/types/json-render/catalog.d.ts +2 -2
- package/dist/types/json-render/server.d.ts +2 -1
- package/dist/types/server/agent-presence.d.ts +1 -0
- package/dist/types/server/ax-interaction.d.ts +1 -0
- package/dist/types/server/ax-state-manager.d.ts +10 -2
- package/dist/types/server/board-local.d.ts +4 -0
- package/dist/types/server/board-move.d.ts +38 -0
- package/dist/types/server/canvas-db.d.ts +12 -2
- package/dist/types/server/canvas-operations.d.ts +5 -6
- package/dist/types/server/canvas-provenance.d.ts +1 -1
- package/dist/types/server/canvas-serialization.d.ts +1 -0
- package/dist/types/server/canvas-state.d.ts +86 -20
- package/dist/types/server/card-relocation.d.ts +6 -0
- package/dist/types/server/context-reads.d.ts +3 -1
- package/dist/types/server/human-presence.d.ts +1 -1
- package/dist/types/server/index.d.ts +26 -10
- package/dist/types/server/intent-registry.d.ts +8 -4
- package/dist/types/server/knowledge-lifecycle.d.ts +4 -2
- package/dist/types/server/mutation-history.d.ts +7 -5
- package/dist/types/server/operations/ops/boards.d.ts +0 -1
- package/dist/types/server/operations/registry.d.ts +2 -0
- package/dist/types/server/tour-control.d.ts +13 -3
- package/dist/types/server/trace-manager.d.ts +1 -0
- package/dist/types/shared/ax-kinds.d.ts +6 -0
- package/dist/types/shared/ax-surface-protocol.d.ts +8 -9
- package/dist/types/shared/human-presence.d.ts +1 -0
- package/dist/types/shared/lifecycle-status.d.ts +2 -0
- package/dist/types/shared/tour.d.ts +8 -0
- package/docs/RELEASE.md +21 -14
- package/docs/agent-plugin.md +16 -2
- package/docs/amp-plugin.md +271 -0
- package/docs/cli.md +42 -3
- package/docs/design/Chrome.dc.html +32 -6
- package/docs/design/GuestName.dc.html +50 -0
- package/docs/design/PluginLogo.svg +7 -0
- 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/WorkCards.dc.html +39 -0
- package/docs/design/Zoom.dc.html +37 -60
- package/docs/design/canvas.json +17 -1
- package/docs/design/plugin-logo.png +0 -0
- package/docs/design.md +280 -12
- package/docs/evals/agents-md-sections.md +38 -0
- package/docs/http-api.md +179 -11
- package/docs/mcp.md +69 -9
- package/docs/node-types.md +109 -4
- package/docs/plans/plan-009-tech-debt-backlog.md +3 -3
- package/docs/plans/plan-019-post-0.9-roadmap.md +327 -31
- package/docs/plans/plan-020-wave-5-work-planning.md +553 -0
- package/docs/product-vision-2026-09.md +42 -17
- package/docs/sdk.md +18 -0
- package/package.json +7 -4
- package/plugins/pmx-canvas/assets/preview.png +0 -0
- package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/extension.mjs +3 -1
- package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/runtime.json +1 -1
- package/plugins/pmx-canvas/plugin.json +2 -2
- package/plugins/pmx-canvas/runtime.json +1 -1
- package/plugins/pmx-canvas/tools.json +688 -128
- package/skills/data-analysis/SKILL.md +13 -26
- package/skills/frontend-design/LICENSE.txt +177 -0
- package/skills/frontend-design/SKILL.md +3 -0
- package/skills/pmx-canvas/SKILL.md +232 -849
- package/skills/pmx-canvas/evals/evals.json +26 -3
- package/skills/pmx-canvas/references/full-reference.md +89 -24
- package/skills/pmx-canvas/references/html-primitives.md +7 -0
- package/skills/pmx-canvas/references/installing-pmx-canvas.md +6 -6
- package/skills/pmx-canvas/references/tours-and-recording.md +29 -2
- package/skills/pmx-canvas/references/workbench-workflows.md +900 -0
- package/skills/pmx-canvas-testing/SKILL.md +7 -5
- package/skills/published-consumer-e2e/SKILL.md +25 -8
- package/skills/published-consumer-e2e/scripts/run-published-consumer-e2e.sh +51 -77
- package/skills/web-artifacts-builder/LICENSE.txt +202 -0
- package/skills/web-artifacts-builder/SKILL.md +6 -0
- package/skills/web-artifacts-builder/scripts/init-artifact.sh +2 -2
- package/src/cli/commands/apps.ts +1 -0
- package/src/cli/commands/boards.ts +30 -0
- package/src/client/App.tsx +20 -4
- package/src/client/canvas/AttentionHistory.tsx +10 -2
- package/src/client/canvas/BarHint.tsx +6 -3
- package/src/client/canvas/BoardMoveDialog.tsx +225 -0
- package/src/client/canvas/CanvasNode.tsx +79 -49
- package/src/client/canvas/CanvasViewport.tsx +42 -14
- package/src/client/canvas/ContextMenu.tsx +97 -15
- package/src/client/canvas/EdgeEditor.tsx +149 -0
- package/src/client/canvas/EdgeLayer.tsx +441 -174
- package/src/client/canvas/ExpandedNodeOverlay.tsx +5 -2
- package/src/client/canvas/GroupNavigation.tsx +85 -0
- package/src/client/canvas/Presentation.tsx +53 -3
- package/src/client/canvas/RelationsPanel.tsx +9 -0
- package/src/client/canvas/SelectionBar.tsx +21 -0
- package/src/client/canvas/SessionPanel.tsx +35 -1
- package/src/client/canvas/TextPrompt.tsx +18 -1
- package/src/client/canvas/TopBar.tsx +54 -9
- package/src/client/canvas/auto-fit.ts +9 -11
- package/src/client/canvas/canvas-area.ts +2 -2
- 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 +302 -1465
- 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 +14 -24
- package/src/client/nodes/McpAppNode.tsx +48 -154
- package/src/client/nodes/MermaidNode.tsx +80 -69
- package/src/client/nodes/PromptNode.tsx +44 -17
- package/src/client/nodes/ResponseNode.tsx +8 -6
- package/src/client/nodes/StatusNode.tsx +34 -7
- package/src/client/nodes/StatusSummary.tsx +16 -3
- package/src/client/nodes/TraceNode.tsx +8 -8
- package/src/client/nodes/ViewerFrame.tsx +273 -0
- package/src/client/nodes/ViewerHost.tsx +41 -0
- package/src/client/nodes/WebpageNode.tsx +22 -24
- package/src/client/nodes/WorkCard.tsx +175 -0
- package/src/client/nodes/iframe-document-url.ts +20 -27
- package/src/client/nodes/primitive-copy.ts +97 -0
- package/src/client/nodes/use-ax-surface-bridge.ts +18 -14
- 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/attention-bridge.ts +5 -0
- package/src/client/state/attention-store.ts +1 -0
- package/src/client/state/canvas-store.ts +202 -26
- package/src/client/state/human-store.ts +22 -2
- package/src/client/state/intent-bridge.ts +20 -5
- package/src/client/state/presentation.ts +135 -15
- package/src/client/state/relation-store.ts +127 -1
- package/src/client/state/sse-bridge.ts +18 -19
- package/src/client/theme/global.css +483 -230
- package/src/client/theme/surface-theme.css +6 -6
- package/src/client/types.ts +1 -0
- 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/server.ts +13 -3
- package/src/server/agent-presence.ts +43 -23
- package/src/server/ax-flow-loop.ts +6 -0
- package/src/server/ax-gate-ttl.ts +8 -1
- package/src/server/ax-interaction.ts +16 -10
- package/src/server/ax-state-manager.ts +17 -4
- package/src/server/ax-wait.ts +20 -6
- package/src/server/board-export.ts +54 -30
- package/src/server/board-local.ts +20 -0
- package/src/server/board-move.ts +297 -0
- package/src/server/canvas-db.ts +249 -158
- package/src/server/canvas-geometry.ts +1 -0
- package/src/server/canvas-operations.ts +139 -109
- package/src/server/canvas-schema.ts +21 -0
- package/src/server/canvas-serialization.ts +2 -0
- package/src/server/canvas-state.ts +797 -159
- package/src/server/card-relocation.ts +53 -0
- package/src/server/code-graph.ts +4 -3
- package/src/server/context-reads.ts +83 -55
- package/src/server/demo-state.json +140 -114
- package/src/server/file-watcher.ts +30 -10
- package/src/server/html-primitives.ts +3 -9
- package/src/server/html-surface.ts +8 -0
- package/src/server/human-presence.ts +18 -5
- package/src/server/index.ts +54 -24
- package/src/server/intent-registry.ts +43 -5
- package/src/server/knowledge-lifecycle.ts +32 -9
- package/src/server/lifecycle-status.ts +29 -1
- package/src/server/mcp-app-runtime.ts +26 -7
- package/src/server/mutation-history.ts +37 -8
- package/src/server/operations/composites.ts +6 -3
- package/src/server/operations/mcp-contracts.ts +32 -2
- package/src/server/operations/mcp.ts +36 -9
- package/src/server/operations/ops/annotation.ts +22 -1
- package/src/server/operations/ops/ax-await.ts +1 -0
- package/src/server/operations/ops/ax-timeline.ts +28 -2
- package/src/server/operations/ops/batch.ts +25 -11
- package/src/server/operations/ops/boards.ts +45 -6
- package/src/server/operations/ops/nodes.ts +70 -0
- package/src/server/operations/ops/query.ts +32 -3
- package/src/server/operations/ops/snapshots.ts +1 -0
- package/src/server/operations/ops/viewport.ts +11 -9
- package/src/server/operations/registry.ts +49 -4
- package/src/server/server.ts +69 -75
- package/src/server/tour-control.ts +97 -12
- package/src/server/trace-manager.ts +4 -0
- package/src/server/web-artifacts/scripts/init-artifact.sh +2 -2
- package/src/shared/agent-context.ts +7 -1
- package/src/shared/auto-arrange.ts +5 -4
- package/src/shared/ax-kinds.ts +13 -0
- package/src/shared/ax-surface-protocol.ts +20 -9
- package/src/shared/content-height-reporter.ts +4 -3
- package/src/shared/human-presence.ts +1 -0
- package/src/shared/lifecycle-status.ts +2 -0
- package/src/shared/tour.ts +8 -0
|
@@ -8,26 +8,88 @@
|
|
|
8
8
|
*
|
|
9
9
|
* This module must never import server.ts or index.ts.
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
12
|
-
|
|
11
|
+
import {
|
|
12
|
+
derivedTour,
|
|
13
|
+
resolveStop,
|
|
14
|
+
tourPresenterSchema,
|
|
15
|
+
tourStopSchema,
|
|
16
|
+
type Camera,
|
|
17
|
+
type Tour,
|
|
18
|
+
type TourPresenter,
|
|
19
|
+
type TourStop,
|
|
20
|
+
} from '../shared/tour.js';
|
|
21
|
+
import { boardCatalogEpoch, canvasState } from './canvas-state.js';
|
|
13
22
|
import { getClientViewportSize } from './canvas-operations.js';
|
|
14
23
|
import { OperationError } from './operations/types.js';
|
|
24
|
+
import { createBoardLocal } from './board-local.js';
|
|
15
25
|
|
|
16
26
|
export type TourStep = number | 'next' | 'previous';
|
|
17
27
|
|
|
18
|
-
export interface
|
|
28
|
+
export interface TourDelivery {
|
|
29
|
+
catalogEpoch: string;
|
|
30
|
+
boardGeneration: number;
|
|
31
|
+
sequence: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface TourStepResult extends TourDelivery {
|
|
19
35
|
index: number;
|
|
20
36
|
total: number;
|
|
21
37
|
stop: TourStop;
|
|
22
38
|
}
|
|
23
39
|
|
|
40
|
+
export interface TourSuperseded {
|
|
41
|
+
superseded: true;
|
|
42
|
+
}
|
|
43
|
+
|
|
24
44
|
export interface TourState {
|
|
25
45
|
tour: Tour;
|
|
26
46
|
derived: boolean;
|
|
27
47
|
position: number | null;
|
|
28
48
|
}
|
|
29
49
|
|
|
30
|
-
|
|
50
|
+
const boardTour = createBoardLocal(() => ({
|
|
51
|
+
cursor: null as { boardGeneration: number; viewGeneration: number; tour: string; index: number } | null,
|
|
52
|
+
presenterGeneration: -1,
|
|
53
|
+
presenterIntents: new Map<string, number>(),
|
|
54
|
+
}));
|
|
55
|
+
// One order for both HTTP acknowledgements and event delivery in this server run.
|
|
56
|
+
let sequence = 0;
|
|
57
|
+
|
|
58
|
+
function claimPresenter(presenter: TourPresenter | undefined): boolean {
|
|
59
|
+
if (presenter === undefined) return true;
|
|
60
|
+
const state = boardTour.current;
|
|
61
|
+
const { presenterIntents } = state;
|
|
62
|
+
const { clientId, intent, catalogEpoch, boardGeneration } = tourPresenterSchema.parse(presenter);
|
|
63
|
+
if (
|
|
64
|
+
canvasState.isBackgroundBoard ||
|
|
65
|
+
catalogEpoch !== boardCatalogEpoch ||
|
|
66
|
+
boardGeneration !== canvasState.visibleBoardGeneration
|
|
67
|
+
)
|
|
68
|
+
return false;
|
|
69
|
+
if (state.presenterGeneration !== boardGeneration) {
|
|
70
|
+
presenterIntents.clear();
|
|
71
|
+
state.presenterGeneration = boardGeneration;
|
|
72
|
+
}
|
|
73
|
+
const previous = presenterIntents.get(clientId);
|
|
74
|
+
if (previous !== undefined && intent <= previous) return false;
|
|
75
|
+
// Never evict an identity: that would make its delayed requests valid again.
|
|
76
|
+
if (previous === undefined && presenterIntents.size >= 4096)
|
|
77
|
+
throw new OperationError(
|
|
78
|
+
'Too many presentation documents on this board activation. Reopen the board to continue.',
|
|
79
|
+
409,
|
|
80
|
+
);
|
|
81
|
+
// Even a later invalid stop supersedes older commands. Claim before resolving it.
|
|
82
|
+
presenterIntents.set(clientId, intent);
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function nextDelivery(): TourDelivery {
|
|
87
|
+
return {
|
|
88
|
+
catalogEpoch: boardCatalogEpoch,
|
|
89
|
+
boardGeneration: canvasState.isBackgroundBoard ? canvasState.boardGeneration : canvasState.visibleBoardGeneration,
|
|
90
|
+
sequence: ++sequence,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
31
93
|
|
|
32
94
|
export function currentTour(): TourState {
|
|
33
95
|
const saved = canvasState.getTour();
|
|
@@ -37,14 +99,23 @@ export function currentTour(): TourState {
|
|
|
37
99
|
|
|
38
100
|
/** The stop the tour is on for the active board, or null when not touring. */
|
|
39
101
|
function tourPosition(tour: Tour): number | null {
|
|
40
|
-
|
|
41
|
-
|
|
102
|
+
const { cursor } = boardTour.current;
|
|
103
|
+
if (
|
|
104
|
+
cursor &&
|
|
105
|
+
(cursor.boardGeneration !== canvasState.boardLifetimeGeneration ||
|
|
106
|
+
(!canvasState.isBackgroundBoard && cursor.viewGeneration !== canvasState.visibleBoardGeneration) ||
|
|
107
|
+
cursor.tour !== JSON.stringify(tour))
|
|
108
|
+
) {
|
|
109
|
+
boardTour.current.cursor = null;
|
|
42
110
|
}
|
|
43
|
-
return cursor?.index ?? null;
|
|
111
|
+
return boardTour.current.cursor?.index ?? null;
|
|
44
112
|
}
|
|
45
113
|
|
|
46
114
|
/** Move the shared cursor. `next`/`previous` clamp at the ends; an explicit index must exist. */
|
|
47
|
-
export function goToTourStop(step: TourStep): TourStepResult
|
|
115
|
+
export function goToTourStop(step: TourStep): TourStepResult;
|
|
116
|
+
export function goToTourStop(step: TourStep, presenter: TourPresenter | undefined): TourStepResult | TourSuperseded;
|
|
117
|
+
export function goToTourStop(step: TourStep, presenter?: TourPresenter): TourStepResult | TourSuperseded {
|
|
118
|
+
if (!claimPresenter(presenter)) return { superseded: true };
|
|
48
119
|
const { tour, position: at } = currentTour();
|
|
49
120
|
const { stops } = tour;
|
|
50
121
|
if (stops.length === 0) {
|
|
@@ -55,12 +126,26 @@ export function goToTourStop(step: TourStep): TourStepResult {
|
|
|
55
126
|
else if (step === 'previous') index = at === null ? 0 : Math.max(0, Math.min(stops.length - 1, at - 1));
|
|
56
127
|
else if (Number.isInteger(step) && step >= 0 && step < stops.length) index = step;
|
|
57
128
|
else throw new OperationError(`Tour stop ${step} does not exist (stops 0–${stops.length - 1}).`, 400);
|
|
58
|
-
cursor = {
|
|
59
|
-
|
|
129
|
+
boardTour.current.cursor = {
|
|
130
|
+
boardGeneration: canvasState.boardLifetimeGeneration,
|
|
131
|
+
viewGeneration: canvasState.visibleBoardGeneration,
|
|
132
|
+
tour: JSON.stringify(tour),
|
|
133
|
+
index,
|
|
134
|
+
};
|
|
135
|
+
return {
|
|
136
|
+
...nextDelivery(),
|
|
137
|
+
index,
|
|
138
|
+
total: stops.length,
|
|
139
|
+
stop: stops[index] as TourStop,
|
|
140
|
+
};
|
|
60
141
|
}
|
|
61
142
|
|
|
62
|
-
export function exitTour():
|
|
63
|
-
|
|
143
|
+
export function exitTour(): TourDelivery;
|
|
144
|
+
export function exitTour(presenter: TourPresenter | undefined): TourDelivery | TourSuperseded;
|
|
145
|
+
export function exitTour(presenter?: TourPresenter): TourDelivery | TourSuperseded {
|
|
146
|
+
if (!claimPresenter(presenter)) return { superseded: true };
|
|
147
|
+
boardTour.current.cursor = null;
|
|
148
|
+
return nextDelivery();
|
|
64
149
|
}
|
|
65
150
|
|
|
66
151
|
/**
|
|
@@ -146,8 +146,8 @@ fi
|
|
|
146
146
|
|
|
147
147
|
echo "🚀 Creating new React + Vite project: $PROJECT_NAME"
|
|
148
148
|
|
|
149
|
-
#
|
|
150
|
-
run_pnpm_quiet create vite "$PROJECT_NAME" --template react-ts --no-interactive
|
|
149
|
+
# 9.3.2 shipped without templates; keep scaffolding on the verified complete package.
|
|
150
|
+
run_pnpm_quiet create vite@9.3.1 "$PROJECT_NAME" --template react-ts --no-interactive
|
|
151
151
|
|
|
152
152
|
# Navigate into project directory
|
|
153
153
|
cd "$PROJECT_NAME"
|
|
@@ -374,8 +374,14 @@ export function summarizeNodeForAgentContext(node: CanvasNodeState, options: Age
|
|
|
374
374
|
return truncateContextText(`${prefix}${fileContent}`, defaultTextLength);
|
|
375
375
|
}
|
|
376
376
|
case 'status':
|
|
377
|
+
if (typeof node.data.workItemId === 'string') {
|
|
378
|
+
return truncateContextText(
|
|
379
|
+
`Read-only live task: ${node.data.workItemId}\n${node.data.liveWorkAvailable === false ? 'Task unavailable' : textFields(node.data, ['title', 'workState', 'detail', 'liveWorkSource'])}`,
|
|
380
|
+
defaultTextLength,
|
|
381
|
+
);
|
|
382
|
+
}
|
|
377
383
|
return truncateContextText(
|
|
378
|
-
`Status: ${textFields(node.data, ['phase']) || textFields(node.data, ['content']) || textFields(node.data, ['status']) || 'unknown'}\n${textFields(node.data, ['detail', 'message', 'activeTool'])}`,
|
|
384
|
+
`Status: ${textFields(node.data, ['workState']) || textFields(node.data, ['phase']) || textFields(node.data, ['content']) || textFields(node.data, ['status']) || 'unknown'}\n${textFields(node.data, ['detail', 'message', 'activeTool'])}${typeof node.data.progress === 'number' ? `\nProgress: ${node.data.progress}%` : ''}`,
|
|
379
385
|
defaultTextLength,
|
|
380
386
|
);
|
|
381
387
|
case 'context':
|
|
@@ -463,10 +463,11 @@ export function computeAutoArrange(
|
|
|
463
463
|
const { outgoing, undirected, indegree, outdegree } = buildUnitGraphs(units, nodeToUnit, allEdges);
|
|
464
464
|
const clusters = collectSpatialClusters(units, undirected);
|
|
465
465
|
const absoluteUnitPositions = new Map<string, ArrangePosition>();
|
|
466
|
-
//
|
|
467
|
-
//
|
|
468
|
-
|
|
469
|
-
|
|
466
|
+
// Reserve fixed cards as well as already-packed clusters. A growing cluster
|
|
467
|
+
// shifts below blockers without moving pinned cards or splitting its groups.
|
|
468
|
+
const packedRects: Array<ArrangePosition & ArrangeSize> = allNodes
|
|
469
|
+
.filter((node) => node.pinned)
|
|
470
|
+
.map((node) => ({ ...node.position, ...node.size }));
|
|
470
471
|
|
|
471
472
|
for (const clusterUnits of clusters) {
|
|
472
473
|
const components = collectComponents(clusterUnits, undirected).map((component) =>
|
package/src/shared/ax-kinds.ts
CHANGED
|
@@ -5,6 +5,19 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export type AxWorkItemStatus = 'todo' | 'in-progress' | 'blocked' | 'done' | 'cancelled';
|
|
7
7
|
|
|
8
|
+
/** Authored work cards use the task vocabulary without creating an AX task. */
|
|
9
|
+
export const WORK_CARD_STATES: Record<AxWorkItemStatus, { label: string; glyph: string }> = {
|
|
10
|
+
todo: { label: 'To do', glyph: '○' },
|
|
11
|
+
'in-progress': { label: 'In progress', glyph: '◐' },
|
|
12
|
+
blocked: { label: 'Blocked', glyph: '⧗' },
|
|
13
|
+
done: { label: 'Done', glyph: '✓' },
|
|
14
|
+
cancelled: { label: 'Cancelled', glyph: '×' },
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export function isWorkCardState(value: unknown): value is AxWorkItemStatus {
|
|
18
|
+
return typeof value === 'string' && Object.hasOwn(WORK_CARD_STATES, value);
|
|
19
|
+
}
|
|
20
|
+
|
|
8
21
|
/** `held` = auto-held by the unattended-approval policy: the action did NOT proceed. */
|
|
9
22
|
export type AxApprovalStatus = 'pending' | 'approved' | 'rejected' | 'held';
|
|
10
23
|
|
|
@@ -21,13 +21,24 @@ export const HTML_SURFACE_PUSH_SOURCE = 'pmx-canvas-html-node';
|
|
|
21
21
|
/** Tab-local JSON viewer state handoff, independent of AX capabilities. */
|
|
22
22
|
export const JSON_VIEWER_STATE_SOURCE = 'pmx-canvas-json-state';
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
export const
|
|
24
|
+
/** MCP apps share their window channel with an SDK JSON-RPC transport. */
|
|
25
|
+
export const MCP_SURFACE_METHOD = 'notifications/pmx/surface';
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
export function surfaceNotification(params: Record<string, unknown>) {
|
|
28
|
+
return { jsonrpc: '2.0' as const, method: MCP_SURFACE_METHOD, params };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function readSurfaceNotification(message: unknown): unknown {
|
|
32
|
+
if (
|
|
33
|
+
message &&
|
|
34
|
+
typeof message === 'object' &&
|
|
35
|
+
'jsonrpc' in message &&
|
|
36
|
+
message.jsonrpc === '2.0' &&
|
|
37
|
+
'method' in message &&
|
|
38
|
+
message.method === MCP_SURFACE_METHOD &&
|
|
39
|
+
!('id' in message) &&
|
|
40
|
+
'params' in message
|
|
41
|
+
)
|
|
42
|
+
return message.params;
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
@@ -22,11 +22,12 @@ export function sanitizeFrameToken(token: string): string {
|
|
|
22
22
|
export function contentHeightReporterSource(frameToken: string): string {
|
|
23
23
|
const token = JSON.stringify(sanitizeFrameToken(frameToken));
|
|
24
24
|
return (
|
|
25
|
-
`(function(){var T=${token};var last=0,timer=null;` +
|
|
25
|
+
`(function(){var T=${token};var last=0,lastViewport=0,timer=null;` +
|
|
26
26
|
`function m(){var d=document.documentElement;return Math.max(d?d.scrollHeight:0,document.body?document.body.scrollHeight:0);}` +
|
|
27
|
-
`function r(){var h=m();if(Math.abs(h-last)<=4)return;last=h;window.parent.postMessage({source:'pmx-canvas-frame',type:'content-height',token:T,height:h},'*');}` +
|
|
27
|
+
`function r(force){var h=m(),v=window.innerHeight;if(!force&&Math.abs(h-last)<=4&&v===lastViewport)return;last=h;lastViewport=v;window.parent.postMessage({source:'pmx-canvas-frame',type:'content-height',token:T,height:h},'*');}` +
|
|
28
28
|
`function s(){if(timer)return;timer=setTimeout(function(){timer=null;r();},100);}` +
|
|
29
|
-
`
|
|
29
|
+
`window.addEventListener('message',function(e){var d=e.data;if(e.source===window.parent&&d&&d.source==='pmx-canvas-frame'&&d.type==='measure-content'&&d.token===T)r(true);});` +
|
|
30
|
+
`if(document.readyState!=='loading')s();window.addEventListener('load',s,true);window.addEventListener('resize',s);` +
|
|
30
31
|
`try{new ResizeObserver(s).observe(document.documentElement);}catch(e){}` +
|
|
31
32
|
`new MutationObserver(s).observe(document.documentElement,{subtree:true,childList:true,characterData:true,attributes:true});` +
|
|
32
33
|
`if(document.fonts)document.fonts.ready.then(s);setTimeout(s,60);})();`
|
|
@@ -21,6 +21,7 @@ export interface HumanPresenceSnapshot {
|
|
|
21
21
|
humans: HumanPresence[];
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
export const HUMAN_NAME_MAX_LENGTH = 40;
|
|
24
25
|
/** A tab that stops reporting is gone after this. */
|
|
25
26
|
export const HUMAN_PRESENCE_TTL_MS = 30_000;
|
|
26
27
|
/** A grab the tab stops renewing (crash, tab closed mid-drag) releases after this. */
|
|
@@ -21,6 +21,8 @@ export interface LifecycleQualification {
|
|
|
21
21
|
contentChangedAt: string | null;
|
|
22
22
|
/** The revisions a validating reviewer must have inspected, qualified by source relation. */
|
|
23
23
|
observations: Record<string, number | null>;
|
|
24
|
+
/** Warnings keyed by the same qualified source identity as observations. */
|
|
25
|
+
sourceWarnings?: Record<string, string[]>;
|
|
24
26
|
sources: SourceQualification[];
|
|
25
27
|
relevance: 'card-pinned' | 'board-pinned' | 'not-selected';
|
|
26
28
|
}
|
package/src/shared/tour.ts
CHANGED
|
@@ -21,6 +21,14 @@ export const tourStopSchema = z.object({
|
|
|
21
21
|
pullback: z.number().min(0).max(4).optional(),
|
|
22
22
|
});
|
|
23
23
|
export const tourSchema = z.object({ stops: z.array(tourStopSchema).max(1000) });
|
|
24
|
+
/** Latest intent from one document, scoped to the server's board activation. */
|
|
25
|
+
export const tourPresenterSchema = z.object({
|
|
26
|
+
clientId: z.string().min(1).max(128),
|
|
27
|
+
intent: z.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|
|
28
|
+
catalogEpoch: z.string().min(1).max(128),
|
|
29
|
+
boardGeneration: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
30
|
+
});
|
|
31
|
+
export type TourPresenter = z.infer<typeof tourPresenterSchema>;
|
|
24
32
|
export type Tour = z.infer<typeof tourSchema>;
|
|
25
33
|
export type TourStop = z.infer<typeof tourStopSchema>;
|
|
26
34
|
export type Camera = z.infer<typeof cameraSchema>;
|