pmx-canvas 0.1.33 → 0.1.35
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 +67 -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/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/html-surface.ts +18 -1
- package/src/server/server.ts +70 -8
- package/src/shared/content-height-reporter.ts +35 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,71 @@ All notable changes to `pmx-canvas` are documented here. This project follows
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.1.35] - 2026-06-08
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **HTTP batch accepts a bare-array body again (report #49).** `POST /api/canvas/batch`
|
|
13
|
+
with a top-level `[ ... ]` array created nothing and returned `{ ok: true, results: [] }`
|
|
14
|
+
— the 0.1.33 `readJson` hardening (empty/whitespace/non-object → `{}`) also coerced
|
|
15
|
+
top-level arrays to `{}`, so the handler's bare-array branch was dead. Batch now reads
|
|
16
|
+
the body with an array-preserving variant, so both documented shapes work: the canonical
|
|
17
|
+
`{ "operations": [...] }` and a bare `[...]`. `readJson` is unchanged for every other
|
|
18
|
+
endpoint (still object-only), so the malformed-body robustness is preserved.
|
|
19
|
+
|
|
20
|
+
## [0.1.34] - 2026-06-08
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- **Adapterless agents see browser-originated AX activity (report #43).**
|
|
25
|
+
`canvas://ax-pending-steering` and `canvas_claim_ax_delivery` now return a
|
|
26
|
+
`pendingActivity` digest alongside `pending` steering: open canvas-bound items
|
|
27
|
+
awaiting the agent — open work items and pending approval gates / elicitations /
|
|
28
|
+
mode requests, typically created by the human in the browser. Every AX mutation
|
|
29
|
+
already fires `ax-state-changed` (so MCP clients that subscribe are pushed
|
|
30
|
+
`canvas://ax-work` live); `pendingActivity` closes the gap for clients that
|
|
31
|
+
**poll** the delivery surface instead. Loop-safe (a consumer never sees items it
|
|
32
|
+
originated) and read-only there — resolve each via its own tool
|
|
33
|
+
(`canvas_resolve_approval` / `canvas_respond_elicitation` / `canvas_resolve_mode`
|
|
34
|
+
/ `canvas_update_work_item`), not `canvas_mark_ax_delivery` (that stays
|
|
35
|
+
steering-only).
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- **`POST /api/canvas/graph` accepts `heightPx` / `nodeHeight` for the node frame
|
|
40
|
+
height.** `height` sets the chart's plot height; the node frame previously only
|
|
41
|
+
honored `nodeHeight` / `size.height`, so a caller passing `height`/`heightPx`
|
|
42
|
+
expecting the node to resize got the default. `heightPx` is now an alias for the
|
|
43
|
+
node frame height (matching the SDK input field), removing the silent surprise.
|
|
44
|
+
(With content-fit the node grows to the chart regardless; this is a DX fix.)
|
|
45
|
+
- **"Open as site" opens in the system browser.** A node's "Open as site" action
|
|
46
|
+
(the header `↗` and the expanded-overlay button) now opens the standalone surface
|
|
47
|
+
in the real OS browser via `POST /api/canvas/open-external`, replacing the
|
|
48
|
+
separate "Open in system browser" button (one action instead of two). The
|
|
49
|
+
endpoint accepts an optional `{ url }` limited to the node's own surface route
|
|
50
|
+
(origin + pathname checked, `400` otherwise) so a caller can preserve safe
|
|
51
|
+
presentation params like the current theme without any SSRF risk; it still falls
|
|
52
|
+
back to a normal new browser tab when the OS launch is unavailable.
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
|
|
56
|
+
- **Nodes grow to fit their content — graph clipping (report #48).** Iframe-backed
|
|
57
|
+
surfaces (graph, json-render, html/html-primitive, web-artifact) now report their
|
|
58
|
+
natural content height to the parent over a nonce-validated `content-height`
|
|
59
|
+
postMessage bridge, and the node **grows** to fit it. This fixes graphs created at
|
|
60
|
+
a small height (e.g. 300px in an embedded panel) rendering with the chart cut off
|
|
61
|
+
at the bottom — the node now sizes to the chart (title + plot + axes + labels).
|
|
62
|
+
- **Grow-only & gated:** a node only ever grows (never shrinks), so it can't
|
|
63
|
+
clip and — being monotonic with a dead-band — can't oscillate (the old
|
|
64
|
+
Tufte-chart flicker is structurally impossible). Skipped for `strictSize`,
|
|
65
|
+
user-resized, docked, collapsed, and group nodes, and for unbounded/scrolling
|
|
66
|
+
surfaces (presentation decks, hosted ext-apps, URL/webpage viewers).
|
|
67
|
+
- Charts render at their **intrinsic** height when the node is auto-fitting (so
|
|
68
|
+
the reported height is stable and the node converges in one step); they still
|
|
69
|
+
fill the frame down for fixed-size (strictSize / user-resized) nodes.
|
|
70
|
+
- Iframe surfaces grow up to ~1400px before scrolling (text nodes keep the ~600px
|
|
71
|
+
cap). A manual resize marks the node `userResized` and turns content-fit off.
|
|
72
|
+
|
|
8
73
|
## [0.1.33] - 2026-06-08
|
|
9
74
|
|
|
10
75
|
### Changed
|
|
@@ -1710,6 +1775,8 @@ otherwise have to discover by trial and error.
|
|
|
1710
1775
|
- Regression coverage for snapshot flat-`id` aliases on both MCP and
|
|
1711
1776
|
HTTP surfaces, plus async / top-level-`await` WebView script bodies.
|
|
1712
1777
|
|
|
1778
|
+
[0.1.35]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.35
|
|
1779
|
+
[0.1.34]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.34
|
|
1713
1780
|
[0.1.33]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.33
|
|
1714
1781
|
[0.1.32]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.32
|
|
1715
1782
|
[0.1.31]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.31
|