pmx-canvas 0.1.4 → 0.1.6

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.6] - 2026-04-26
7
+
8
+ CLI/MCP regression cleanup after the 0.1.5 coverage pass. This release tightens
9
+ graph creation routing, restores legacy json-render Badge compatibility, and
10
+ makes MCP node creation routes explicit enough for agents to recover from schema
11
+ drift without guessing.
12
+
13
+ ### Added
14
+
15
+ - **Top-level `pmx-canvas graph add`.** This now routes through the agent CLI
16
+ and creates graph nodes via the same HTTP path as the canonical
17
+ `pmx-canvas node add --type graph ...` command, instead of falling through to
18
+ server startup.
19
+ - **MCP node-type routing metadata.** `canvas_describe_schema` and
20
+ `canvas://schema` now expose `mcp.nodeTypeRouting`, so agents can discover
21
+ that `json-render`, `graph`, `web-artifact`, `external-app`, and `group`
22
+ use dedicated creation tools instead of guessing `canvas_add_node`.
23
+ - **MCP schema entry for `external-app`.** The running schema now lists
24
+ `external-app` as a virtual node family backed by `canvas_open_mcp_app`, with
25
+ notes pointing Excalidraw callers to the higher-level `canvas_add_diagram`
26
+ preset.
27
+ - **`mcpTool` field on every node-type schema entry**, plus
28
+ `canvas_open_mcp_app` and `canvas_create_group` added to the published
29
+ `mcp.tools` array — both surfaces help an agent discover the right tool for
30
+ each canvas operation without guessing.
31
+
32
+ ### Changed
33
+
34
+ - **Graph height semantics are documented consistently across surfaces.** For
35
+ CLI graph commands, `--node-height` / `--nodeHeight` set the canvas node frame
36
+ height, `--chart-height` sets the chart content height, and `--height` remains
37
+ a compatibility alias for frame height. For MCP/HTTP/batch payloads,
38
+ `nodeHeight` is frame height and `height` is chart content height.
39
+ - **PMX Canvas skill guidance now includes MCP-specific gotchas.** The bundled
40
+ skill documents the MCP node-type routing table, `canvas_open_mcp_app`
41
+ transport requirements, `canvas_build_web_artifact` source-string behavior and
42
+ cold-build timeout expectations, `canvas_pin_nodes.nodeIds`, and the required
43
+ `canvas_diff.snapshot` argument.
44
+ - **Legacy `props.label` is removed from Badge specs after normalization.** The
45
+ validated/persisted spec now carries exactly one of `text` or `label`, never
46
+ both — a stricter future validator can flag the legacy key without breaking
47
+ saved canvases written before this release.
48
+ - **`canvas_build_web_artifact` `id` alias is conditional.** When
49
+ `openInCanvas` is `false` (or no canvas node was created), the `id` field is
50
+ omitted from the response instead of being `undefined`. Consumers can now
51
+ reliably use `'id' in response` to detect the build-only case. `nodeId` is
52
+ always present and remains the canonical identifier.
53
+
54
+ ### Fixed
55
+
56
+ - **`pmx-canvas graph add` no longer starts a rogue server.** The top-level
57
+ command is registered with the agent CLI, so malformed or valid graph commands
58
+ cannot fall through to server startup and leak a fallback daemon.
59
+ - **Legacy json-render `Badge` specs are accepted again.** Saved specs using
60
+ `props.label` now normalize to `props.text`, and legacy status variants
61
+ (`success`, `info`, `warning`, `error`, `danger`) normalize to the current
62
+ shadcn Badge enum before validation.
63
+ - **Web-artifact build responses include `id` (alias for `nodeId`) when a
64
+ canvas node was created.** Keeps MCP/HTTP add-style responses consistent.
65
+ - **Graph CLI node-height aliases now work.** `--node-height` and
66
+ `--nodeHeight` set the canvas node frame height, `--chart-height` sets the
67
+ chart content height, and CLI `--height` remains a compatibility alias for
68
+ the frame height.
69
+
70
+ ### Internal
71
+
72
+ - Regression coverage for top-level graph CLI routing, graph height flags,
73
+ legacy Badge normalization (now including `info → secondary` and
74
+ `error → destructive` plus the post-normalization `label` removal), MCP
75
+ node-type routing metadata, and web-artifact response ID aliases.
76
+
77
+ [0.1.6]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.6
78
+
79
+ ## [0.1.5] - 2026-04-26
80
+
81
+ Image-validation hardening + CLI ergonomics. The boundary where untrusted
82
+ file paths become canvas state now validates magic bytes, and common CLI
83
+ typos produce one-line suggestions instead of help-block dumps.
84
+
85
+ ### Added
86
+
87
+ - **Magic-byte validation for local image nodes.** PNG / JPEG / GIF / SVG /
88
+ WebP / BMP / ICO / AVIF headers are sniffed before a file becomes an
89
+ `image` node. A file renamed `screenshot.png` containing PowerPoint XML
90
+ is now rejected with a clear error before it reaches the renderer.
91
+ - **macOS cloud-on-demand placeholder detection.** Files in iCloud Drive,
92
+ OneDrive, etc. that are not yet downloaded locally are detected via
93
+ `stat -f %Xf` flags and rejected with a hint to download them first —
94
+ no more silent freezes when an iCloud-only file is dropped on the canvas.
95
+ - **`/bin/dd` escape hatch with a 5s timeout** for macOS-only paths where
96
+ the direct fs read could hang on an unresponsive volume (e.g. an
97
+ unmounted SMB share that still satisfies `existsSync`). Distinguishes
98
+ timeout (`SIGTERM` / `ETIMEDOUT`) from generic spawn failures so the
99
+ cloud-storage hint isn't shown for unrelated errors.
100
+ - **CLI typo hints for resource subcommands.**
101
+ - `pmx-canvas node delete <id>` and `pmx-canvas node rm <id>` exit 1 with
102
+ `Did you mean: pmx-canvas node remove?`.
103
+ - `pmx-canvas edge delete <id>` and `pmx-canvas edge rm <id>` get the
104
+ same treatment.
105
+ - `pmx-canvas node pin <id>` redirects to the top-level
106
+ `pmx-canvas pin <id>` command.
107
+
108
+ ### Changed
109
+
110
+ - **`GET /api/canvas/image/:id` is now async** (`fs/promises.readFile`) and
111
+ validates content before serving — returns **400** on invalid image bytes
112
+ instead of 200 with `application/octet-stream`.
113
+ - **Bare `pmx-canvas node` (no subcommand)** now exits 1 with structured
114
+ JSON instead of printing the resource help block. Use
115
+ `pmx-canvas node --help` for the listing.
116
+
117
+ ### Internal
118
+
119
+ - New module `src/server/image-source.ts` extracts and extends image
120
+ validation from `canvas-operations.ts`. Same error contract; richer
121
+ checks. The MCP and HTTP layers both flow through `addCanvasNode`, so
122
+ CLAUDE.md rule #5 (four-layer parity) is preserved without touching
123
+ the SDK or MCP server.
124
+ - Direct fs read is the fast path on every platform (no fork, no shell);
125
+ `dd` is only consulted on macOS as a fallback when direct read fails on
126
+ a path that wasn't flagged as a placeholder.
127
+ - Real magic-byte fixtures in `tests/unit/canvas-operations.test.ts` (was:
128
+ `*.png` extension smoke tests). New HTTP coverage in
129
+ `tests/unit/server-api.test.ts` for valid / invalid / missing image
130
+ paths. New CLI coverage for `node delete`, `node pin`, `edge delete`,
131
+ `edge rm` typo hints.
132
+
133
+ [0.1.5]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.5
134
+
6
135
  ## [0.1.4] - 2026-04-26
7
136
 
8
137
  Graph/CLI ergonomics + canvas-node taxonomy hardening. Three threads: