pmx-canvas 0.1.31 → 0.1.33

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 (40) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/dist/canvas/global.css +18 -3
  3. package/dist/canvas/index.js +57 -57
  4. package/dist/json-render/index.js +97 -97
  5. package/dist/types/client/nodes/surface-url.d.ts +7 -0
  6. package/dist/types/client/state/canvas-store.d.ts +1 -0
  7. package/dist/types/client/state/intent-bridge.d.ts +7 -0
  8. package/dist/types/json-render/renderer/index.d.ts +1 -0
  9. package/dist/types/json-render/server.d.ts +1 -0
  10. package/dist/types/server/ax-context.d.ts +24 -1
  11. package/dist/types/server/canvas-operations.d.ts +1 -5
  12. package/dist/types/server/html-surface.d.ts +23 -0
  13. package/dist/types/server/index.d.ts +6 -0
  14. package/package.json +1 -1
  15. package/skills/pmx-canvas/SKILL.md +96 -1
  16. package/src/cli/agent.ts +18 -1
  17. package/src/client/App.tsx +3 -3
  18. package/src/client/canvas/CanvasNode.tsx +16 -1
  19. package/src/client/canvas/ExpandedNodeOverlay.tsx +12 -1
  20. package/src/client/nodes/ContextNode.tsx +1 -1
  21. package/src/client/nodes/HtmlNode.tsx +26 -1
  22. package/src/client/nodes/McpAppNode.tsx +35 -8
  23. package/src/client/nodes/StatusNode.tsx +0 -20
  24. package/src/client/nodes/surface-url.ts +12 -0
  25. package/src/client/state/canvas-store.ts +4 -0
  26. package/src/client/state/intent-bridge.ts +19 -0
  27. package/src/client/state/sse-bridge.ts +17 -0
  28. package/src/client/theme/global.css +18 -3
  29. package/src/json-render/renderer/index.tsx +31 -2
  30. package/src/json-render/server.ts +3 -0
  31. package/src/mcp/canvas-access.ts +3 -0
  32. package/src/mcp/server.ts +23 -1
  33. package/src/server/ax-context.ts +49 -1
  34. package/src/server/ax-interaction.ts +3 -0
  35. package/src/server/ax-state.ts +3 -1
  36. package/src/server/canvas-operations.ts +2 -2
  37. package/src/server/canvas-state.ts +6 -1
  38. package/src/server/html-surface.ts +48 -11
  39. package/src/server/index.ts +8 -0
  40. package/src/server/server.ts +81 -14
package/CHANGELOG.md CHANGED
@@ -3,6 +3,84 @@
3
3
  All notable changes to `pmx-canvas` are documented here. This project follows
4
4
  [Semantic Versioning](https://semver.org/).
5
5
 
6
+ ## [Unreleased]
7
+
8
+ ## [0.1.33] - 2026-06-08
9
+
10
+ ### Changed
11
+
12
+ - **Edge creation echoes the full edge.** `POST /api/canvas/edge` now returns the
13
+ complete created edge — `from`, `to`, `type`, `style`, and `animated` alongside
14
+ `ok` and `id` — instead of just `{ ok, id }`. This mirrors how node creation
15
+ echoes the created node, so a client no longer has to re-read the layout to learn
16
+ the resolved edge shape. Additive on the HTTP response; the SDK `addEdge` still
17
+ returns the bare edge id.
18
+
19
+ ### Fixed
20
+
21
+ - **Bodyless and malformed JSON `POST`s are handled cleanly.** `readJson` now
22
+ reads the raw request body and treats an empty/whitespace body as `{}` without
23
+ logging a spurious warning (e.g. `POST /api/canvas/fit` with no body), and
24
+ rejects a top-level JSON array (or any non-object) to `{}` instead of letting it
25
+ flow through as though it were an object. Endpoints that read optional fields
26
+ from the body keep working with or without a payload.
27
+
28
+ ## [0.1.32] - 2026-06-07
29
+
30
+ ### Added
31
+
32
+ - **Composable AX surfaces (emit + reflect).** AX-enabled `html`, `json-render`,
33
+ and `web-artifact` nodes can now both EMIT AX interactions and RENDER live AX
34
+ state, so an agent (or human) can build an interactive work board / review board
35
+ / inbox as a canvas node. The canvas seeds each surface with a compact AX
36
+ snapshot and pushes live updates over the existing nonce-validated postMessage
37
+ channel: `html` exposes `window.PMX_AX.state` + a `pmx-ax-update` event;
38
+ `json-render` binds the snapshot under `/ax` (e.g. `{ "$state": "/ax/workItems" }`);
39
+ `web-artifact` gets the same `window.PMX_AX` bridge injected at the `/artifact`
40
+ route. New `GET /api/canvas/ax/surface-snapshot`. See the "Building an AX
41
+ surface" section in the pmx-canvas skill.
42
+ - **AX opt-in via MCP/SDK (report #42).** `canvas_add_html_node` and
43
+ `canvas_update_node` accept an `axCapabilities` parameter ({ enabled, allowed })
44
+ so an agent can turn an html node into an AX surface without hand-crafting raw
45
+ HTTP — the previously-missing opt-in that made the (already-working) AX bridge
46
+ look broken. Clamped to the node-type ceiling server-side; cannot escalate.
47
+ (#42 was not a missing listener — the emit bridge + listeners already existed
48
+ and are e2e-verified.)
49
+ - **Open in system browser.** A node-header / expanded-overlay "Open in system
50
+ browser" action (and `POST /api/canvas/open-external`) opens a node's surface in
51
+ the real OS browser via the existing launcher — for hosts (e.g. Codex) whose
52
+ embedded browser makes a normal new tab feel in-place. Accepts only `{ nodeId }`
53
+ (opens this server's own surface URL — no arbitrary-URL launch), honors
54
+ `PMX_CANVAS_DISABLE_BROWSER_OPEN`, and falls back to a normal new tab.
55
+
56
+ ### Changed
57
+
58
+ - **Responsive top HUD (report #41).** The toolbar + docked status/context pills
59
+ now wrap instead of clipping in narrow embedding panels (e.g. the Copilot side
60
+ panel); low-value text (session id, zoom %, counts) is hidden below ~720px.
61
+
62
+ ### Fixed
63
+
64
+ - **Body-only review annotations succeed (report #39).** `ax.review.add` /
65
+ `canvas_add_review_annotation` with only a `body` (no `anchorType`, no `nodeId`)
66
+ now creates an unanchored note instead of returning 400 — `anchorType` defaults
67
+ to a node anchor only when a usable `nodeId` is present. An explicit bad node
68
+ anchor still rejects.
69
+ - **CLI can undock a node (report #40).** `pmx-canvas node update --dock-position
70
+ left|right|none` docks/undocks a node (`none` → `null`). The previous
71
+ `--data '{"dockPosition":null}'` never worked because `--data` is reserved for
72
+ graph datasets; the CLI had no path mapping it to the top-level field.
73
+
74
+ ### Removed
75
+
76
+ - **Status node "Track as work" button.** Tracking a status signal as a work item
77
+ produced a thin, auto-titled item (often just "idle") with no visible effect on
78
+ the board and no proactive agent reaction — confusing UI for little value. The
79
+ underlying AX work-item primitive (`ax.work.create`) is unchanged and still
80
+ available to agents, the SDK/MCP/HTTP API, and authored AX surfaces
81
+ (json-render/HTML bridges) — the better home for a deliberate, in-canvas
82
+ work-item/steering experience.
83
+
6
84
  ## [0.1.31] - 2026-06-07
7
85
 
8
86
  ### Added
@@ -1632,6 +1710,8 @@ otherwise have to discover by trial and error.
1632
1710
  - Regression coverage for snapshot flat-`id` aliases on both MCP and
1633
1711
  HTTP surfaces, plus async / top-level-`await` WebView script bodies.
1634
1712
 
1713
+ [0.1.33]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.33
1714
+ [0.1.32]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.32
1635
1715
  [0.1.31]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.31
1636
1716
  [0.1.30]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.30
1637
1717
  [0.1.29]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.29
@@ -457,13 +457,15 @@ body,
457
457
  font-weight: 600;
458
458
  }
459
459
 
460
- /* HUD layer — fixed row: [left-dock] [toolbar] [right-dock] */
460
+ /* HUD layer — [left-dock] [toolbar] [right-dock]. Wraps onto multiple rows in a
461
+ narrow embedding panel (e.g. the Copilot side panel) instead of clipping. */
461
462
  .hud-layer {
462
463
  position: fixed;
463
464
  top: 12px;
464
465
  left: 12px;
465
466
  right: 12px;
466
467
  display: flex;
468
+ flex-wrap: wrap;
467
469
  align-items: flex-start;
468
470
  justify-content: center;
469
471
  gap: 8px;
@@ -476,22 +478,24 @@ body,
476
478
  .hud-left,
477
479
  .hud-right {
478
480
  display: flex;
481
+ flex-wrap: wrap;
479
482
  gap: 8px;
480
483
  }
481
484
 
482
485
  /* Toolbar */
483
486
  .canvas-toolbar {
484
487
  display: flex;
488
+ flex-wrap: wrap;
485
489
  align-items: center;
486
490
  gap: 6px;
487
491
  padding: 6px 10px;
488
492
  min-height: var(--hud-bar-height);
493
+ max-width: 100%;
489
494
  box-sizing: border-box;
490
495
  background: var(--c-panel-glass);
491
496
  backdrop-filter: blur(12px);
492
497
  border: 1px solid var(--c-line);
493
498
  border-radius: var(--radius);
494
- flex-shrink: 0;
495
499
  }
496
500
 
497
501
  .toolbar-tooltip-anchor {
@@ -666,9 +670,11 @@ body,
666
670
 
667
671
  .toolbar-group {
668
672
  display: flex;
673
+ flex-wrap: wrap;
669
674
  align-items: center;
670
675
  gap: 6px;
671
- flex-shrink: 0;
676
+ min-width: 0;
677
+ max-width: 100%;
672
678
  }
673
679
 
674
680
  .canvas-toolbar button svg {
@@ -692,6 +698,15 @@ body,
692
698
  }
693
699
  }
694
700
 
701
+ /* Narrow embedding panels: drop low-value text from the HUD so the icon controls
702
+ fit in fewer rows. Buttons keep their aria-labels + tooltips, so nothing is
703
+ lost for a11y or discovery. */
704
+ @media (max-width: 720px) {
705
+ .hud-collapsible-text {
706
+ display: none;
707
+ }
708
+ }
709
+
695
710
  /* Raw markdown source editor */
696
711
  .md-editor-split {
697
712
  display: flex;