pmx-canvas 0.1.10 → 0.1.12

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 CHANGED
@@ -3,6 +3,135 @@
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.1.12] - 2026-05-02
7
+
8
+ MCP/canvas state-sharing pass on top of 0.1.11. The MCP server now
9
+ attaches to an already-running canvas daemon for the current workspace
10
+ instead of spinning up a parallel in-process state, so HTTP-created
11
+ nodes and browser pins show up immediately in MCP responses and emit
12
+ the matching resource notifications. The SDK's port binding is also
13
+ hardened so explicit `port:` requests no longer silently land on a
14
+ fallback port.
15
+
16
+ ### Added
17
+
18
+ - **`startCanvasServer({ allowPortFallback: false })` and SDK port
19
+ determinism.** The HTTP server option lets callers opt out of the
20
+ fallback-port walk. The Bun SDK's `PmxCanvas.start()` and
21
+ `PmxCanvas.startAutomationWebView()` now pass this flag, so when an
22
+ SDK consumer says `createCanvas({ port: 4313 })` they either bind to
23
+ 4313 or fail loudly — preventing two SDK instances or an SDK + a
24
+ daemon from racing onto silently different ports.
25
+ - **`CanvasAccess` abstraction with local + remote backends.** A new
26
+ `src/mcp/canvas-access.ts` module defines the interface the MCP
27
+ server uses to talk to canvas state. `LocalCanvasAccess` wraps an
28
+ in-process `PmxCanvas` (legacy behavior); `RemoteCanvasAccess` talks
29
+ to an existing daemon over HTTP and consumes its SSE stream. The
30
+ factory probes for an existing canvas server in the workspace before
31
+ starting a new one.
32
+
33
+ ### Changed
34
+
35
+ - **MCP server defers to an existing canvas daemon as the state
36
+ authority.** When `pmx-canvas --mcp` boots in a workspace that
37
+ already has a canvas server running on the agreed port, the MCP
38
+ process now reads and writes through that daemon's HTTP API instead
39
+ of starting its own canvas. Nodes created via the daemon's HTTP API
40
+ (or by a human in the browser) are visible to MCP queries
41
+ immediately, and SSE events from the daemon are translated into
42
+ MCP `notifications/resources/updated` calls for `canvas://layout`,
43
+ `canvas://summary`, `canvas://spatial-context`, `canvas://history`,
44
+ `canvas://code-graph`, and `canvas://pinned-context`.
45
+
46
+ ### Internal
47
+
48
+ - Regression coverage for: `canvas_add_node` strict-size persistence
49
+ through MCP, an MCP session using an existing daemon as the state
50
+ authority for HTTP-created nodes, and HTTP node creation broadcasting
51
+ a live `canvas-layout-update` SSE event.
52
+
53
+ ## [0.1.11] - 2026-05-02
54
+
55
+ Agent ergonomics + chart polish on top of 0.1.10. Adds a `--strict-size`
56
+ mode for nodes that should scroll instead of auto-fit, surfaces
57
+ `pmx-canvas json-render` and `pmx-canvas screenshot` as top-level CLI
58
+ shortcuts, lets graph nodes hide legends and pie labels for compact
59
+ tile layouts, propagates explicit geometry to reused MCP-app nodes, and
60
+ folds Excalidraw bound text into container labels before sending it
61
+ through the diagram MCP.
62
+
63
+ ### Added
64
+
65
+ - **`--strict-size` / `--scroll-overflow` for node create and update.**
66
+ All node types now accept `strictSize` to keep the explicit
67
+ `width`/`height` frame fixed and scroll overflowing content instead of
68
+ letting the canvas auto-fit the node to its content. Surfaced through
69
+ CLI flags, HTTP `POST/PATCH /api/canvas/node`, dedicated json-render
70
+ and graph endpoints, and MCP tools (`canvas_add_node`,
71
+ `canvas_add_json_render_node`, `canvas_add_graph_node`).
72
+ `canvas_describe_schema` and `canvas://schema` advertise the field on
73
+ markdown, webpage, and graph entries with kebab-case aliases.
74
+ - **`pmx-canvas json-render` top-level CLI command.** Agent-friendly
75
+ shortcut for the json-render schema/example explorer. Supports
76
+ `--schema`, `--summary`, `--component <name>`, `--field <name>`, and
77
+ `--example`/`--examples`, mirroring the existing `node schema --type
78
+ json-render` data in a more direct shape.
79
+ - **`pmx-canvas screenshot` top-level CLI command.** Shorthand for
80
+ `pmx-canvas webview screenshot`, with the same `--output`,
81
+ `--format`, and `--quality` flags. Routes through the agent CLI like
82
+ the other top-level subcommands.
83
+ - **`showLegend` / `showLabels` chart display flags.** Graph node
84
+ payloads now accept `showLegend` and `showLabels` booleans that
85
+ cascade through CLI (`--show-legend`, `--show-labels`), HTTP, MCP,
86
+ and the json-render chart components. Set `showLegend: false` for
87
+ compact tile dashboards or `showLabels: false` to hide pie slice
88
+ labels.
89
+ - **Skill catches up to the new CLI surface.** The agent-facing
90
+ `skills/pmx-canvas/SKILL.md` now documents `pmx-canvas screenshot`,
91
+ `pmx-canvas json-render`, the `--strict-size` flag, and the chart
92
+ display flags, so agents do not have to discover them by reading the
93
+ CHANGELOG.
94
+
95
+ ### Changed
96
+
97
+ - **Reused MCP-app nodes accept explicit geometry on reopen.** When
98
+ `canvas_open_mcp_app` (or the workbench `ext-app-open` SSE event)
99
+ reopens an existing mcp-app node and the call passes `x`, `y`,
100
+ `width`, or `height`, the server now applies that geometry to the
101
+ existing node instead of leaving the original frame in place. This
102
+ lets agents resize a previously created Excalidraw or other reusable
103
+ app node with a single call.
104
+ - **Compact json-render charts trim whitespace.** Bar, line, area,
105
+ scatter, pie, radar, stacked-bar, and composed charts share new
106
+ `chartMargin`, `polarChartMargin`, `axisTickMargin`, and
107
+ `legendMargin` constants, so axis ticks and legends sit closer to the
108
+ plot and small graph nodes keep more of their frame for the actual
109
+ chart.
110
+ - **Diagram preset folds bound text into container labels.** The
111
+ Excalidraw normalization path now collapses `text` elements that
112
+ reference a container into the container's `label` field (when the
113
+ container does not already carry a label) and removes the redundant
114
+ text element from the outgoing payload. This produces the in-shape
115
+ labels Excalidraw renders by default while still keeping the
116
+ bound-element references repaired from 0.1.10. The same normalization
117
+ also runs through `buildExcalidrawOpenMcpAppInput` so MCP `open`
118
+ payloads are repaired identically to checkpoint and tool-input
119
+ payloads.
120
+ - **Diagram preset seeds defaults when nothing renderable is present.**
121
+ An elements array containing only deletion or camera-update entries
122
+ (or stale ghosts) now falls back to the default Excalidraw preset
123
+ instead of being sent as an empty diagram.
124
+
125
+ ### Internal
126
+
127
+ - Regression coverage for: `--strict-size` end-to-end through CLI,
128
+ HTTP, and MCP plus the auto-fit guard that keeps strict-size content
129
+ nodes from being auto-fitted; top-level CLI routing for `screenshot`
130
+ and `json-render`; compact graph specs that hide legends and pie
131
+ labels; reused mcp-app open with explicit geometry; Excalidraw
132
+ defaults for non-renderable element arrays; shared MCP open
133
+ normalization through the diagram-preset path.
134
+
6
135
  ## [0.1.10] - 2026-05-01
7
136
 
8
137
  Agent-ergonomics and correctness pass on top of 0.1.9. Tightens
@@ -234,6 +363,8 @@ otherwise have to discover by trial and error.
234
363
  - Regression coverage for snapshot flat-`id` aliases on both MCP and
235
364
  HTTP surfaces, plus async / top-level-`await` WebView script bodies.
236
365
 
366
+ [0.1.12]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.12
367
+ [0.1.11]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.11
237
368
  [0.1.10]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.10
238
369
  [0.1.9]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.9
239
370
  [0.1.8]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.8