pmx-canvas 0.3.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/Readme.md +11 -3
  3. package/dist/canvas/index.js +67 -67
  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/state/node-factory.d.ts +29 -0
  7. package/dist/types/client/uuid-polyfill.d.ts +0 -0
  8. package/dist/types/server/canvas-db.d.ts +0 -1
  9. package/dist/types/server/canvas-state.d.ts +14 -15
  10. package/dist/types/server/operations/composites.d.ts +6 -21
  11. package/dist/types/server/server.d.ts +1 -0
  12. package/docs/cli.md +5 -0
  13. package/docs/environment.md +2 -2
  14. package/docs/http-api.md +25 -1
  15. package/docs/mcp.md +21 -30
  16. package/docs/plans/plan-009-tech-debt-backlog.md +13 -12
  17. package/docs/screenshot.png +0 -0
  18. package/docs/tech-debt-assessment-2026-06.md +5 -5
  19. package/package.json +7 -7
  20. package/skills/pmx-canvas/SKILL.md +16 -6
  21. package/skills/pmx-canvas/evals/evals.json +2 -2
  22. package/skills/pmx-canvas/references/full-reference.md +17 -15
  23. package/src/cli/commands/history.ts +1 -1
  24. package/src/cli/commands/nodes.ts +31 -1
  25. package/src/cli/index.ts +8 -2
  26. package/src/cli/shared.ts +1 -0
  27. package/src/client/index.tsx +2 -0
  28. package/src/client/nodes/ExtAppFrame.tsx +17 -2
  29. package/src/client/state/node-factory.ts +72 -0
  30. package/src/client/state/sse-bridge.ts +209 -86
  31. package/src/client/uuid-polyfill.ts +14 -0
  32. package/src/server/canvas-db.ts +0 -8
  33. package/src/server/canvas-schema.ts +2 -8
  34. package/src/server/canvas-state.ts +51 -151
  35. package/src/server/index.ts +3 -9
  36. package/src/server/operations/composites.ts +24 -21
  37. package/src/server/operations/ops/snapshots.ts +6 -7
  38. package/src/server/operations/registry.ts +4 -1
  39. package/src/server/server.ts +170 -74
package/CHANGELOG.md CHANGED
@@ -3,6 +3,58 @@
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.0] - 2026-08-04
7
+
8
+ ### Breaking
9
+
10
+ - **The `canvas_snapshot` MCP tool is now a composite** with actions `save`,
11
+ `list`, `restore`, `delete`, `gc`, and `diff`, and the 6 deprecated snapshot
12
+ standalones (`canvas_snapshot` save tool, `canvas_list_snapshots`,
13
+ `canvas_restore`, `canvas_delete_snapshot`, `canvas_gc_snapshots`,
14
+ `canvas_diff`) are removed after their deprecated 0.3.x window. The MCP
15
+ surface is now 22 tools: 16 composites + 6 standalones. Arguments are
16
+ unchanged apart from adding the `action` field; the CLI and HTTP snapshot
17
+ surfaces are unaffected.
18
+ - Pre-0.2 legacy layouts (`.pmx-canvas/state.json`, `.pmx-canvas.json`, legacy
19
+ snapshot dirs and blob files) are no longer imported on boot. Upgrade
20
+ through a 0.3.x install first if you still have one. `PMX_CANVAS_STATE_FILE`
21
+ remains only as a `.db`-path alias; other values are ignored with a warning.
22
+ - HTTP error responses are now JSON envelopes (`{ ok: false, error }`) with
23
+ unchanged status codes, instead of plain text — one error shape across every
24
+ endpoint.
25
+
26
+ ### Added
27
+
28
+ - The canvas now works behind proxies that buffer streaming responses (e.g.
29
+ Amp orb portals): if the live event stream delivers nothing shortly after
30
+ connecting, the browser switches to a polling transport
31
+ (`GET /api/workbench/poll`) that carries the same events as ordinary JSON
32
+ responses. Force a mode with `/workbench?transport=poll` or `?transport=sse`.
33
+ - `crypto.randomUUID` is polyfilled in the browser client, so the canvas also
34
+ boots in embedded pages served outside a secure context.
35
+ - `/health` reports persistence health: `persistence.ok` turns false after a
36
+ failed state save (the canvas keeps serving from memory) and true again
37
+ after the next successful save.
38
+
39
+ ### Changed
40
+
41
+ - The server now falls back to `PMX_CANVAS_PORT` when `--port` and
42
+ `PMX_WEB_CANVAS_PORT` are unset, so one variable can point the client and
43
+ server at the same port.
44
+
45
+ - `pmx-canvas node update` returns a compact `{ ok, id, position, size,
46
+ updatedFields }` envelope by default; pass `--full` for the complete node
47
+ payload (a no-op ext-app resize previously echoed ~940 KB — 0.3.4 report
48
+ Finding R).
49
+
50
+ ### Fixed
51
+
52
+ - App documents are made background-transparent so tiles that letterbox at the
53
+ document level show the theme background instead of black. Narrow or tall
54
+ Excalidraw tiles can still show the app's own dark fill below the diagram —
55
+ that part lives inside the hosted app bundle (0.3.4 report Finding Q,
56
+ documented with a sizing workaround in the skill).
57
+
6
58
  ## [0.3.4] - 2026-08-03
7
59
 
8
60
  ### Added
@@ -2779,6 +2831,7 @@ otherwise have to discover by trial and error.
2779
2831
  - Regression coverage for snapshot flat-`id` aliases on both MCP and
2780
2832
  HTTP surfaces, plus async / top-level-`await` WebView script bodies.
2781
2833
 
2834
+ [0.4.0]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.4.0
2782
2835
  [0.3.4]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.3.4
2783
2836
  [0.3.3]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.3.3
2784
2837
  [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,14 @@ 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) — the canvas detects when
148
+ the live event stream is being buffered by the proxy and automatically
149
+ switches to a polling transport, so the board boots and stays live through
150
+ the portal with no proxy shims (`/workbench?transport=poll` forces it).
143
151
 
144
152
  The contract is host-agnostic, so a new host plugs in the same way: map its
145
153
  hooks, canvas, and session APIs onto PMX's AX primitives — no core changes.
@@ -257,7 +265,7 @@ the agent can read `canvas://skills` and pull in companion skills
257
265
  the three-tier visual matrix (json-render → html → web-artifact)
258
266
  - **[CLI reference](docs/cli.md)** — full command surface, daemon mode,
259
267
  watch streams, WebView automation
260
- - **[MCP reference](docs/mcp.md)** — 27 tools, 14 resources, change
268
+ - **[MCP reference](docs/mcp.md)** — 22 tools, 14 resources, change
261
269
  notifications, node-type routing
262
270
  - **[HTTP API](docs/http-api.md)** — REST endpoints, SSE, batch operations
263
271
  - **[AX host-adapter contract](docs/ax-host-adapter-contract.md)** — how native