pmx-canvas 0.1.9 → 0.1.11

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 (34) hide show
  1. package/CHANGELOG.md +154 -0
  2. package/dist/canvas/index.js +44 -44
  3. package/dist/json-render/index.css +1 -1
  4. package/dist/json-render/index.js +115 -115
  5. package/dist/types/client/canvas/auto-fit.d.ts +1 -1
  6. package/dist/types/json-render/catalog.d.ts +326 -310
  7. package/dist/types/json-render/charts/components.d.ts +18 -0
  8. package/dist/types/json-render/charts/definitions.d.ts +4 -0
  9. package/dist/types/json-render/charts/extra-components.d.ts +3 -0
  10. package/dist/types/json-render/charts/extra-definitions.d.ts +6 -0
  11. package/dist/types/json-render/server.d.ts +4 -0
  12. package/dist/types/server/canvas-operations.d.ts +2 -0
  13. package/dist/types/server/index.d.ts +2 -0
  14. package/package.json +1 -1
  15. package/skills/pmx-canvas/SKILL.md +9 -0
  16. package/src/cli/agent.ts +103 -5
  17. package/src/cli/index.ts +6 -3
  18. package/src/client/canvas/CanvasNode.tsx +3 -1
  19. package/src/client/canvas/auto-fit.ts +3 -3
  20. package/src/json-render/catalog.ts +9 -0
  21. package/src/json-render/charts/components.tsx +18 -10
  22. package/src/json-render/charts/definitions.ts +4 -0
  23. package/src/json-render/charts/extra-components.tsx +23 -16
  24. package/src/json-render/charts/extra-definitions.ts +6 -0
  25. package/src/json-render/renderer/index.css +61 -0
  26. package/src/json-render/renderer/index.tsx +22 -0
  27. package/src/json-render/server.ts +11 -11
  28. package/src/mcp/server.ts +10 -0
  29. package/src/server/canvas-operations.ts +21 -1
  30. package/src/server/canvas-schema.ts +5 -0
  31. package/src/server/canvas-validation.ts +9 -2
  32. package/src/server/diagram-presets.ts +82 -4
  33. package/src/server/index.ts +7 -1
  34. package/src/server/server.ts +33 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,158 @@
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.11] - 2026-05-02
7
+
8
+ Agent ergonomics + chart polish on top of 0.1.10. Adds a `--strict-size`
9
+ mode for nodes that should scroll instead of auto-fit, surfaces
10
+ `pmx-canvas json-render` and `pmx-canvas screenshot` as top-level CLI
11
+ shortcuts, lets graph nodes hide legends and pie labels for compact
12
+ tile layouts, propagates explicit geometry to reused MCP-app nodes, and
13
+ folds Excalidraw bound text into container labels before sending it
14
+ through the diagram MCP.
15
+
16
+ ### Added
17
+
18
+ - **`--strict-size` / `--scroll-overflow` for node create and update.**
19
+ All node types now accept `strictSize` to keep the explicit
20
+ `width`/`height` frame fixed and scroll overflowing content instead of
21
+ letting the canvas auto-fit the node to its content. Surfaced through
22
+ CLI flags, HTTP `POST/PATCH /api/canvas/node`, dedicated json-render
23
+ and graph endpoints, and MCP tools (`canvas_add_node`,
24
+ `canvas_add_json_render_node`, `canvas_add_graph_node`).
25
+ `canvas_describe_schema` and `canvas://schema` advertise the field on
26
+ markdown, webpage, and graph entries with kebab-case aliases.
27
+ - **`pmx-canvas json-render` top-level CLI command.** Agent-friendly
28
+ shortcut for the json-render schema/example explorer. Supports
29
+ `--schema`, `--summary`, `--component <name>`, `--field <name>`, and
30
+ `--example`/`--examples`, mirroring the existing `node schema --type
31
+ json-render` data in a more direct shape.
32
+ - **`pmx-canvas screenshot` top-level CLI command.** Shorthand for
33
+ `pmx-canvas webview screenshot`, with the same `--output`,
34
+ `--format`, and `--quality` flags. Routes through the agent CLI like
35
+ the other top-level subcommands.
36
+ - **`showLegend` / `showLabels` chart display flags.** Graph node
37
+ payloads now accept `showLegend` and `showLabels` booleans that
38
+ cascade through CLI (`--show-legend`, `--show-labels`), HTTP, MCP,
39
+ and the json-render chart components. Set `showLegend: false` for
40
+ compact tile dashboards or `showLabels: false` to hide pie slice
41
+ labels.
42
+ - **Skill catches up to the new CLI surface.** The agent-facing
43
+ `skills/pmx-canvas/SKILL.md` now documents `pmx-canvas screenshot`,
44
+ `pmx-canvas json-render`, the `--strict-size` flag, and the chart
45
+ display flags, so agents do not have to discover them by reading the
46
+ CHANGELOG.
47
+
48
+ ### Changed
49
+
50
+ - **Reused MCP-app nodes accept explicit geometry on reopen.** When
51
+ `canvas_open_mcp_app` (or the workbench `ext-app-open` SSE event)
52
+ reopens an existing mcp-app node and the call passes `x`, `y`,
53
+ `width`, or `height`, the server now applies that geometry to the
54
+ existing node instead of leaving the original frame in place. This
55
+ lets agents resize a previously created Excalidraw or other reusable
56
+ app node with a single call.
57
+ - **Compact json-render charts trim whitespace.** Bar, line, area,
58
+ scatter, pie, radar, stacked-bar, and composed charts share new
59
+ `chartMargin`, `polarChartMargin`, `axisTickMargin`, and
60
+ `legendMargin` constants, so axis ticks and legends sit closer to the
61
+ plot and small graph nodes keep more of their frame for the actual
62
+ chart.
63
+ - **Diagram preset folds bound text into container labels.** The
64
+ Excalidraw normalization path now collapses `text` elements that
65
+ reference a container into the container's `label` field (when the
66
+ container does not already carry a label) and removes the redundant
67
+ text element from the outgoing payload. This produces the in-shape
68
+ labels Excalidraw renders by default while still keeping the
69
+ bound-element references repaired from 0.1.10. The same normalization
70
+ also runs through `buildExcalidrawOpenMcpAppInput` so MCP `open`
71
+ payloads are repaired identically to checkpoint and tool-input
72
+ payloads.
73
+ - **Diagram preset seeds defaults when nothing renderable is present.**
74
+ An elements array containing only deletion or camera-update entries
75
+ (or stale ghosts) now falls back to the default Excalidraw preset
76
+ instead of being sent as an empty diagram.
77
+
78
+ ### Internal
79
+
80
+ - Regression coverage for: `--strict-size` end-to-end through CLI,
81
+ HTTP, and MCP plus the auto-fit guard that keeps strict-size content
82
+ nodes from being auto-fitted; top-level CLI routing for `screenshot`
83
+ and `json-render`; compact graph specs that hide legends and pie
84
+ labels; reused mcp-app open with explicit geometry; Excalidraw
85
+ defaults for non-renderable element arrays; shared MCP open
86
+ normalization through the diagram-preset path.
87
+
88
+ ## [0.1.10] - 2026-05-01
89
+
90
+ Agent-ergonomics and correctness pass on top of 0.1.9. Tightens
91
+ structured-frame auto-fit behavior, restores semantic Badge variants in
92
+ json-render, repairs Excalidraw bound-text references on the way out,
93
+ fixes `pmx-canvas fit` routing through the top-level CLI, and grows the
94
+ `node update` surface with `--pinned` and `--node-height`.
95
+
96
+ ### Added
97
+
98
+ - **`pmx-canvas node update --pinned <true|false>`.** Agents can flip a
99
+ node's pin state directly through `node update` without round-tripping
100
+ through `pin add`/`pin remove`. The flag goes through the same
101
+ PATCH path as the rest of `node update`, so it composes with geometry
102
+ and arrange-lock flags.
103
+ - **`pmx-canvas node update --node-height` alias.** `--node-height` is now
104
+ accepted as an alias for `--height` on `node update`, matching the
105
+ alias already supported on `node add`. Passing both `--height` and
106
+ `--node-height` rejects with a clear error.
107
+ - **AGENTS.md mirrors CLAUDE.md for harness-agnostic guidance.** The
108
+ AGENTS.md guidance file is now a complete, self-contained mirror of
109
+ the project instructions in CLAUDE.md so any coding agent harness
110
+ finds the same architecture rules, TypeScript guardrails, build
111
+ commands, and testing conventions.
112
+
113
+ ### Changed
114
+
115
+ - **`pmx-canvas fit` routes through the top-level CLI.** The `fit`
116
+ subcommand was added to the agent dispatcher in 0.1.9 but was missing
117
+ from the top-level CLI's known-subcommand list, so `pmx-canvas fit`
118
+ was being treated as a server-startup invocation. It now routes to
119
+ the agent CLI like every other subcommand.
120
+ - **All explicit graph and json-render frames are preserved by auto-fit.**
121
+ The client-side auto-fit guard previously only respected explicit
122
+ heights when they exceeded the 600px content-fit cap. It now treats
123
+ all `graph` and `json-render` nodes as having explicit visual frames,
124
+ so agent-authored sizes survive expand-and-close cycles regardless of
125
+ the chosen height.
126
+ - **json-render Badge keeps semantic variants.** The 0.1.6 normalizer
127
+ that mapped `success`/`info`/`warning`/`error`/`danger` to the
128
+ shadcn-default `default`/`secondary`/`outline`/`destructive` set has
129
+ been removed. The json-render catalog now declares these variants as
130
+ first-class, and the bundled renderer ships a Badge component that
131
+ styles them, so dashboards keep their intended traffic-light
132
+ semantics instead of collapsing to a generic neutral palette.
133
+
134
+ ### Fixed
135
+
136
+ - **Group containment accepts the canonical children list.** Layout
137
+ validation flagged group/child overlaps as containment violations
138
+ whenever the child only carried `parentGroup` via the parent's
139
+ `children` array instead of the back-reference field. The check now
140
+ treats either side of the relationship as authoritative, so grouped
141
+ nodes pinned via `data.children` are no longer reported as overlap
142
+ violations.
143
+ - **Excalidraw tool input repairs one-sided bound-text references.**
144
+ When a text element points at a container via `containerId` but the
145
+ container's `boundElements` list is missing the reverse pointer, the
146
+ diagram preset now reattaches the missing reference before sending
147
+ the elements to the Excalidraw MCP app. This stops labels from
148
+ silently dropping out of agent-authored diagrams.
149
+
150
+ ### Internal
151
+
152
+ - Regression coverage for: structured-frame auto-fit preservation across
153
+ graph and json-render heights (including small frames), `node update
154
+ --pinned` end-to-end through CLI/HTTP, top-level CLI routing for the
155
+ `fit` subcommand, group-children list containment validation, and
156
+ Excalidraw bound-text repair on the diagram preset.
157
+
6
158
  ## [0.1.9] - 2026-05-01
7
159
 
8
160
  Workflow ergonomics pass for agent-authored boards. This release tightens
@@ -164,6 +316,8 @@ otherwise have to discover by trial and error.
164
316
  - Regression coverage for snapshot flat-`id` aliases on both MCP and
165
317
  HTTP surfaces, plus async / top-level-`await` WebView script bodies.
166
318
 
319
+ [0.1.11]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.11
320
+ [0.1.10]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.10
167
321
  [0.1.9]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.9
168
322
  [0.1.8]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.8
169
323
  [0.1.7]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.7