pmx-canvas 0.3.4 → 0.4.1

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 (51) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/Readme.md +16 -3
  3. package/dist/canvas/index.js +80 -80
  4. package/dist/types/client/index.d.ts +1 -1
  5. package/dist/types/client/nodes/ExtAppFrame.d.ts +10 -0
  6. package/dist/types/client/nodes/iframe-document-url.d.ts +1 -0
  7. package/dist/types/client/nodes/use-surface-frame.d.ts +13 -0
  8. package/dist/types/client/state/canvas-store.d.ts +1 -0
  9. package/dist/types/client/state/iframe-mode.d.ts +25 -0
  10. package/dist/types/client/state/node-factory.d.ts +29 -0
  11. package/dist/types/client/uuid-polyfill.d.ts +0 -0
  12. package/dist/types/server/canvas-db.d.ts +0 -1
  13. package/dist/types/server/canvas-state.d.ts +14 -15
  14. package/dist/types/server/operations/composites.d.ts +6 -21
  15. package/dist/types/server/server.d.ts +1 -0
  16. package/docs/RELEASE.md +10 -4
  17. package/docs/cli.md +5 -0
  18. package/docs/environment.md +2 -2
  19. package/docs/http-api.md +47 -1
  20. package/docs/mcp.md +21 -30
  21. package/docs/plans/plan-009-tech-debt-backlog.md +22 -13
  22. package/docs/screenshot.png +0 -0
  23. package/docs/tech-debt-assessment-2026-06.md +5 -5
  24. package/package.json +7 -7
  25. package/skills/pmx-canvas/SKILL.md +36 -10
  26. package/skills/pmx-canvas/evals/evals.json +2 -2
  27. package/skills/pmx-canvas/references/full-reference.md +17 -15
  28. package/skills/pmx-canvas-testing/SKILL.md +3 -0
  29. package/src/cli/commands/history.ts +1 -1
  30. package/src/cli/commands/nodes.ts +31 -1
  31. package/src/cli/index.ts +8 -2
  32. package/src/cli/shared.ts +1 -0
  33. package/src/client/index.tsx +7 -0
  34. package/src/client/nodes/ExtAppFrame.tsx +50 -2
  35. package/src/client/nodes/HtmlNode.tsx +5 -1
  36. package/src/client/nodes/McpAppNode.tsx +5 -1
  37. package/src/client/nodes/iframe-document-url.ts +62 -9
  38. package/src/client/nodes/use-surface-frame.ts +53 -0
  39. package/src/client/state/canvas-store.ts +5 -0
  40. package/src/client/state/iframe-mode.ts +103 -0
  41. package/src/client/state/node-factory.ts +72 -0
  42. package/src/client/state/sse-bridge.ts +212 -86
  43. package/src/client/uuid-polyfill.ts +14 -0
  44. package/src/server/canvas-db.ts +0 -8
  45. package/src/server/canvas-schema.ts +2 -8
  46. package/src/server/canvas-state.ts +51 -151
  47. package/src/server/index.ts +3 -9
  48. package/src/server/operations/composites.ts +24 -21
  49. package/src/server/operations/ops/snapshots.ts +6 -7
  50. package/src/server/operations/registry.ts +4 -1
  51. package/src/server/server.ts +194 -75
package/CHANGELOG.md CHANGED
@@ -3,6 +3,80 @@
3
3
  All notable changes to `pmx-canvas` are documented here. This project follows
4
4
  [Semantic Versioning](https://semver.org/).
5
5
 
6
+ ## [0.4.1] - 2026-08-04
7
+
8
+ ### Added
9
+
10
+ - Iframe-backed nodes (HTML, graph, json-render, MCP apps) now render inside
11
+ nested-iframe hosts like Amp orb portals: the canvas probes at boot whether
12
+ the embedding context loads iframe `src` URLs at all, and falls back to
13
+ fetching same-origin surfaces and rendering them inline via `srcdoc` when it
14
+ does not. Force a mode with `/workbench?iframe-mode=srcdoc` (or `=src`).
15
+
16
+ ### Fixed
17
+
18
+ - Ext-app nodes now survive a daemon restart without a full panel reload
19
+ (Finding S): the browser revalidates its frame-document URLs on every
20
+ reconnect and automatically re-mints them against the new server process
21
+ when they have gone stale.
22
+ - Best-effort mitigation for residual black ext-app tiles in WebKit host
23
+ panels (Finding N): after an app finishes booting, the canvas briefly nudges
24
+ the iframe's layout size so WebKit must re-rasterize the frame — the same
25
+ mechanism as the manual enlarge-then-close unstick, without the reload. The
26
+ nudge is recorded as `repaint-nudge` in the ext-app recovery trail.
27
+
28
+ ## [0.4.0] - 2026-08-04
29
+
30
+ ### Breaking
31
+
32
+ - **The `canvas_snapshot` MCP tool is now a composite** with actions `save`,
33
+ `list`, `restore`, `delete`, `gc`, and `diff`, and the 6 deprecated snapshot
34
+ standalones (`canvas_snapshot` save tool, `canvas_list_snapshots`,
35
+ `canvas_restore`, `canvas_delete_snapshot`, `canvas_gc_snapshots`,
36
+ `canvas_diff`) are removed after their deprecated 0.3.x window. The MCP
37
+ surface is now 22 tools: 16 composites + 6 standalones. Arguments are
38
+ unchanged apart from adding the `action` field; the CLI and HTTP snapshot
39
+ surfaces are unaffected.
40
+ - Pre-0.2 legacy layouts (`.pmx-canvas/state.json`, `.pmx-canvas.json`, legacy
41
+ snapshot dirs and blob files) are no longer imported on boot. Upgrade
42
+ through a 0.3.x install first if you still have one. `PMX_CANVAS_STATE_FILE`
43
+ remains only as a `.db`-path alias; other values are ignored with a warning.
44
+ - HTTP error responses are now JSON envelopes (`{ ok: false, error }`) with
45
+ unchanged status codes, instead of plain text — one error shape across every
46
+ endpoint.
47
+
48
+ ### Added
49
+
50
+ - The canvas now works behind proxies that buffer streaming responses (e.g.
51
+ Amp orb portals): if the live event stream delivers nothing shortly after
52
+ connecting, the browser switches to a polling transport
53
+ (`GET /api/workbench/poll`) that carries the same events as ordinary JSON
54
+ responses. Force a mode with `/workbench?transport=poll` or `?transport=sse`.
55
+ - `crypto.randomUUID` is polyfilled in the browser client, so the canvas also
56
+ boots in embedded pages served outside a secure context.
57
+ - `/health` reports persistence health: `persistence.ok` turns false after a
58
+ failed state save (the canvas keeps serving from memory) and true again
59
+ after the next successful save.
60
+
61
+ ### Changed
62
+
63
+ - The server now falls back to `PMX_CANVAS_PORT` when `--port` and
64
+ `PMX_WEB_CANVAS_PORT` are unset, so one variable can point the client and
65
+ server at the same port.
66
+
67
+ - `pmx-canvas node update` returns a compact `{ ok, id, position, size,
68
+ updatedFields }` envelope by default; pass `--full` for the complete node
69
+ payload (a no-op ext-app resize previously echoed ~940 KB — 0.3.4 report
70
+ Finding R).
71
+
72
+ ### Fixed
73
+
74
+ - App documents are made background-transparent so tiles that letterbox at the
75
+ document level show the theme background instead of black. Narrow or tall
76
+ Excalidraw tiles can still show the app's own dark fill below the diagram —
77
+ that part lives inside the hosted app bundle (0.3.4 report Finding Q,
78
+ documented with a sizing workaround in the skill).
79
+
6
80
  ## [0.3.4] - 2026-08-03
7
81
 
8
82
  ### Added
@@ -2779,6 +2853,8 @@ otherwise have to discover by trial and error.
2779
2853
  - Regression coverage for snapshot flat-`id` aliases on both MCP and
2780
2854
  HTTP surfaces, plus async / top-level-`await` WebView script bodies.
2781
2855
 
2856
+ [0.4.1]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.4.1
2857
+ [0.4.0]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.4.0
2782
2858
  [0.3.4]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.3.4
2783
2859
  [0.3.3]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.3.3
2784
2860
  [0.3.2]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.3.2
package/Readme.md CHANGED
@@ -98,14 +98,14 @@ vendor-specific.
98
98
 
99
99
  Spatial state auto-saves to `.pmx-canvas/canvas.db` (debounced ~500 ms) —
100
100
  git-committable, shareable across machines, and survives both browser
101
- refresh and server restart. Named [snapshots](docs/mcp.md#standalone-tools), full
101
+ refresh and server restart. Named [snapshots](docs/mcp.md), full
102
102
  undo/redo, and an auto-detected code graph (JS/TS, Python, Go, Rust) make
103
103
  the canvas durable rather than throwaway. Stop the server before committing
104
104
  the DB so SQLite WAL data is checkpointed into the file.
105
105
 
106
106
  ### 06 / Any agent
107
107
 
108
- Harness-agnostic. Drive the canvas from [MCP](docs/mcp.md) (27 tools,
108
+ Harness-agnostic. Drive the canvas from [MCP](docs/mcp.md) (22 tools,
109
109
  14 resources, change notifications), the [CLI](docs/cli.md), the
110
110
  [HTTP API](docs/http-api.md), or the [Bun SDK](docs/sdk.md) — all
111
111
  [environment variables documented here](docs/environment.md). Works with
@@ -140,6 +140,19 @@ surfaces (the core never imports a host SDK).
140
140
  `canvas_ax_state { action: "get" }` and label Codex-originated focus with
141
141
  `source: "codex"`. No extension API needed — Codex's two native surfaces
142
142
  (MCP + in-app Browser) are exactly what the canvas requires.
143
+ - **Claude Code desktop app** — the workbench runs in the desktop app's
144
+ built-in browser pane alongside the PMX MCP server, same zero-adapter recipe
145
+ as Codex: open `http://localhost:4313/workbench` in the app's browser and the
146
+ live board, pins, and Ghost Cursor all work in-panel.
147
+ - **Amp orb portals** (and other buffering proxies / nested-iframe embeds) —
148
+ the canvas detects when the live event stream is being buffered by the proxy
149
+ and automatically switches to a polling transport, so the board boots and
150
+ stays live through the portal with no proxy shims
151
+ (`/workbench?transport=poll` forces it). It also detects when the nested
152
+ iframe embed blocks `src`-URL iframes entirely and renders HTML, graph,
153
+ json-render, and app surfaces inline via `srcdoc` instead
154
+ (`?iframe-mode=srcdoc` forces it), so iframe-backed nodes work in the portal
155
+ too.
143
156
 
144
157
  The contract is host-agnostic, so a new host plugs in the same way: map its
145
158
  hooks, canvas, and session APIs onto PMX's AX primitives — no core changes.
@@ -257,7 +270,7 @@ the agent can read `canvas://skills` and pull in companion skills
257
270
  the three-tier visual matrix (json-render → html → web-artifact)
258
271
  - **[CLI reference](docs/cli.md)** — full command surface, daemon mode,
259
272
  watch streams, WebView automation
260
- - **[MCP reference](docs/mcp.md)** — 27 tools, 14 resources, change
273
+ - **[MCP reference](docs/mcp.md)** — 22 tools, 14 resources, change
261
274
  notifications, node-type routing
262
275
  - **[HTTP API](docs/http-api.md)** — REST endpoints, SSE, batch operations
263
276
  - **[AX host-adapter contract](docs/ax-host-adapter-contract.md)** — how native