pmx-canvas 0.1.32 → 0.1.34
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/CHANGELOG.md +75 -0
- package/dist/canvas/index.js +61 -61
- package/dist/json-render/index.js +112 -112
- package/dist/types/client/canvas/auto-fit.d.ts +14 -0
- package/dist/types/client/nodes/surface-url.d.ts +6 -7
- package/dist/types/client/nodes/use-iframe-content-height.d.ts +16 -0
- package/dist/types/client/state/intent-bridge.d.ts +1 -1
- package/dist/types/json-render/server.d.ts +6 -0
- package/dist/types/server/canvas-operations.d.ts +1 -5
- package/dist/types/server/html-surface.d.ts +9 -0
- package/dist/types/shared/content-height-reporter.d.ts +20 -0
- package/package.json +1 -1
- package/skills/pmx-canvas/SKILL.md +17 -5
- package/src/client/canvas/CanvasNode.tsx +15 -21
- package/src/client/canvas/ExpandedNodeOverlay.tsx +3 -14
- package/src/client/canvas/auto-fit.ts +61 -7
- package/src/client/nodes/HtmlNode.tsx +9 -2
- package/src/client/nodes/McpAppNode.tsx +33 -4
- package/src/client/nodes/surface-url.ts +10 -12
- package/src/client/nodes/use-iframe-content-height.ts +53 -0
- package/src/client/state/intent-bridge.ts +2 -2
- package/src/json-render/charts/components.tsx +11 -1
- package/src/json-render/server.ts +13 -1
- package/src/mcp/server.ts +58 -6
- package/src/server/canvas-operations.ts +2 -2
- package/src/server/html-surface.ts +18 -1
- package/src/server/server.ts +55 -16
- package/src/shared/content-height-reporter.ts +35 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,79 @@ All notable changes to `pmx-canvas` are documented here. This project follows
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.1.34] - 2026-06-08
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Adapterless agents see browser-originated AX activity (report #43).**
|
|
13
|
+
`canvas://ax-pending-steering` and `canvas_claim_ax_delivery` now return a
|
|
14
|
+
`pendingActivity` digest alongside `pending` steering: open canvas-bound items
|
|
15
|
+
awaiting the agent — open work items and pending approval gates / elicitations /
|
|
16
|
+
mode requests, typically created by the human in the browser. Every AX mutation
|
|
17
|
+
already fires `ax-state-changed` (so MCP clients that subscribe are pushed
|
|
18
|
+
`canvas://ax-work` live); `pendingActivity` closes the gap for clients that
|
|
19
|
+
**poll** the delivery surface instead. Loop-safe (a consumer never sees items it
|
|
20
|
+
originated) and read-only there — resolve each via its own tool
|
|
21
|
+
(`canvas_resolve_approval` / `canvas_respond_elicitation` / `canvas_resolve_mode`
|
|
22
|
+
/ `canvas_update_work_item`), not `canvas_mark_ax_delivery` (that stays
|
|
23
|
+
steering-only).
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **`POST /api/canvas/graph` accepts `heightPx` / `nodeHeight` for the node frame
|
|
28
|
+
height.** `height` sets the chart's plot height; the node frame previously only
|
|
29
|
+
honored `nodeHeight` / `size.height`, so a caller passing `height`/`heightPx`
|
|
30
|
+
expecting the node to resize got the default. `heightPx` is now an alias for the
|
|
31
|
+
node frame height (matching the SDK input field), removing the silent surprise.
|
|
32
|
+
(With content-fit the node grows to the chart regardless; this is a DX fix.)
|
|
33
|
+
- **"Open as site" opens in the system browser.** A node's "Open as site" action
|
|
34
|
+
(the header `↗` and the expanded-overlay button) now opens the standalone surface
|
|
35
|
+
in the real OS browser via `POST /api/canvas/open-external`, replacing the
|
|
36
|
+
separate "Open in system browser" button (one action instead of two). The
|
|
37
|
+
endpoint accepts an optional `{ url }` limited to the node's own surface route
|
|
38
|
+
(origin + pathname checked, `400` otherwise) so a caller can preserve safe
|
|
39
|
+
presentation params like the current theme without any SSRF risk; it still falls
|
|
40
|
+
back to a normal new browser tab when the OS launch is unavailable.
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
|
|
44
|
+
- **Nodes grow to fit their content — graph clipping (report #48).** Iframe-backed
|
|
45
|
+
surfaces (graph, json-render, html/html-primitive, web-artifact) now report their
|
|
46
|
+
natural content height to the parent over a nonce-validated `content-height`
|
|
47
|
+
postMessage bridge, and the node **grows** to fit it. This fixes graphs created at
|
|
48
|
+
a small height (e.g. 300px in an embedded panel) rendering with the chart cut off
|
|
49
|
+
at the bottom — the node now sizes to the chart (title + plot + axes + labels).
|
|
50
|
+
- **Grow-only & gated:** a node only ever grows (never shrinks), so it can't
|
|
51
|
+
clip and — being monotonic with a dead-band — can't oscillate (the old
|
|
52
|
+
Tufte-chart flicker is structurally impossible). Skipped for `strictSize`,
|
|
53
|
+
user-resized, docked, collapsed, and group nodes, and for unbounded/scrolling
|
|
54
|
+
surfaces (presentation decks, hosted ext-apps, URL/webpage viewers).
|
|
55
|
+
- Charts render at their **intrinsic** height when the node is auto-fitting (so
|
|
56
|
+
the reported height is stable and the node converges in one step); they still
|
|
57
|
+
fill the frame down for fixed-size (strictSize / user-resized) nodes.
|
|
58
|
+
- Iframe surfaces grow up to ~1400px before scrolling (text nodes keep the ~600px
|
|
59
|
+
cap). A manual resize marks the node `userResized` and turns content-fit off.
|
|
60
|
+
|
|
61
|
+
## [0.1.33] - 2026-06-08
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
|
|
65
|
+
- **Edge creation echoes the full edge.** `POST /api/canvas/edge` now returns the
|
|
66
|
+
complete created edge — `from`, `to`, `type`, `style`, and `animated` alongside
|
|
67
|
+
`ok` and `id` — instead of just `{ ok, id }`. This mirrors how node creation
|
|
68
|
+
echoes the created node, so a client no longer has to re-read the layout to learn
|
|
69
|
+
the resolved edge shape. Additive on the HTTP response; the SDK `addEdge` still
|
|
70
|
+
returns the bare edge id.
|
|
71
|
+
|
|
72
|
+
### Fixed
|
|
73
|
+
|
|
74
|
+
- **Bodyless and malformed JSON `POST`s are handled cleanly.** `readJson` now
|
|
75
|
+
reads the raw request body and treats an empty/whitespace body as `{}` without
|
|
76
|
+
logging a spurious warning (e.g. `POST /api/canvas/fit` with no body), and
|
|
77
|
+
rejects a top-level JSON array (or any non-object) to `{}` instead of letting it
|
|
78
|
+
flow through as though it were an object. Endpoints that read optional fields
|
|
79
|
+
from the body keep working with or without a payload.
|
|
80
|
+
|
|
8
81
|
## [0.1.32] - 2026-06-07
|
|
9
82
|
|
|
10
83
|
### Added
|
|
@@ -1690,6 +1763,8 @@ otherwise have to discover by trial and error.
|
|
|
1690
1763
|
- Regression coverage for snapshot flat-`id` aliases on both MCP and
|
|
1691
1764
|
HTTP surfaces, plus async / top-level-`await` WebView script bodies.
|
|
1692
1765
|
|
|
1766
|
+
[0.1.34]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.34
|
|
1767
|
+
[0.1.33]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.33
|
|
1693
1768
|
[0.1.32]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.32
|
|
1694
1769
|
[0.1.31]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.31
|
|
1695
1770
|
[0.1.30]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.30
|