pmx-canvas 0.1.14 → 0.1.16
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 +153 -0
- package/Readme.md +108 -1058
- package/dist/canvas/global.css +141 -0
- package/dist/canvas/index.js +124 -74
- package/dist/json-render/index.css +1 -1
- package/dist/types/client/nodes/ContextNode.d.ts +11 -2
- package/dist/types/client/nodes/HtmlNode.d.ts +5 -0
- package/dist/types/client/nodes/StatusNode.d.ts +1 -0
- package/dist/types/client/state/canvas-store.d.ts +11 -3
- package/dist/types/client/state/intent-bridge.d.ts +5 -1
- package/dist/types/client/types.d.ts +2 -2
- package/dist/types/json-render/catalog.d.ts +1 -1
- package/dist/types/mcp/canvas-access.d.ts +7 -1
- package/dist/types/server/agent-context.d.ts +1 -0
- package/dist/types/server/canvas-operations.d.ts +4 -2
- package/dist/types/server/canvas-provenance.d.ts +1 -1
- package/dist/types/server/canvas-serialization.d.ts +3 -0
- package/dist/types/server/canvas-state.d.ts +51 -4
- package/dist/types/server/demo.d.ts +5 -0
- package/dist/types/server/index.d.ts +13 -3
- package/dist/types/server/web-artifacts.d.ts +18 -0
- package/dist/types/shared/canvas-node-kind.d.ts +5 -0
- package/package.json +1 -1
- package/skills/pmx-canvas/SKILL.md +43 -0
- package/skills/pmx-canvas-testing/SKILL.md +17 -0
- package/src/cli/agent.ts +52 -5
- package/src/cli/index.ts +2 -23
- package/src/client/canvas/AttentionHistory.tsx +14 -1
- package/src/client/canvas/CanvasNode.tsx +1 -1
- package/src/client/canvas/CanvasViewport.tsx +3 -0
- package/src/client/canvas/ContextPinBar.tsx +2 -1
- package/src/client/canvas/DockedNode.tsx +112 -13
- package/src/client/canvas/ExpandedNodeOverlay.tsx +5 -0
- package/src/client/canvas/Minimap.tsx +1 -0
- package/src/client/icons.tsx +1 -0
- package/src/client/nodes/ContextNode.tsx +128 -6
- package/src/client/nodes/HtmlNode.tsx +151 -0
- package/src/client/nodes/StatusNode.tsx +16 -1
- package/src/client/nodes/StatusSummary.tsx +2 -1
- package/src/client/state/canvas-store.ts +37 -7
- package/src/client/state/intent-bridge.ts +9 -4
- package/src/client/state/sse-bridge.ts +2 -1
- package/src/client/theme/global.css +141 -0
- package/src/client/types.ts +3 -0
- package/src/mcp/canvas-access.ts +34 -7
- package/src/mcp/server.ts +178 -25
- package/src/server/agent-context.ts +50 -3
- package/src/server/canvas-operations.ts +20 -3
- package/src/server/canvas-provenance.ts +2 -1
- package/src/server/canvas-serialization.ts +38 -13
- package/src/server/canvas-state.ts +305 -34
- package/src/server/demo.ts +792 -0
- package/src/server/index.ts +33 -3
- package/src/server/server.ts +98 -14
- package/src/server/web-artifacts.ts +116 -3
- package/src/shared/canvas-node-kind.ts +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,157 @@
|
|
|
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.16] - 2026-05-04
|
|
7
|
+
|
|
8
|
+
Live-context-dock and undo-history hygiene pass on top of 0.1.15. The
|
|
9
|
+
context dock now renders the actual pinned nodes instead of falling back
|
|
10
|
+
to stale context-card data, auto-focus from ext-app opens stops
|
|
11
|
+
polluting undo history, and a couple of HTTP endpoints reject malformed
|
|
12
|
+
payloads instead of creating blank or empty nodes.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **`ContextNode` renders the active pinned nodes.** A new exported
|
|
17
|
+
`normalizePinnedContextDisplay()` produces a stable `{id, title,
|
|
18
|
+
summary, kind, path}` shape per pinned node, and the component now
|
|
19
|
+
takes a `pinnedNodes` prop. The dock falls back to the previous
|
|
20
|
+
context-card data only when no nodes are pinned, so what the agent
|
|
21
|
+
reads via `canvas://pinned-context` and what the human sees in the
|
|
22
|
+
dock are now the same view.
|
|
23
|
+
- **`StatusNode` exposes `getStatusDisplayPhase()` with a documented
|
|
24
|
+
fallback chain.** The display phase falls back `phase → content
|
|
25
|
+
→ status → 'idle'` and is shared by the inline node, the summary,
|
|
26
|
+
and any consumer that needs the phase shown to the user.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- **`ContextPinBar` is mutually exclusive with the Updates panel.**
|
|
31
|
+
Like the docked context node, the floating pin bar now hides while
|
|
32
|
+
the right-edge attention history panel is open so the two surfaces
|
|
33
|
+
no longer collide on the same anchor.
|
|
34
|
+
- **Browser-driven viewport updates support `recordHistory: false`.**
|
|
35
|
+
Client `focusNode(id, options)` and the matching
|
|
36
|
+
`commitViewportWithOptions()` thread an optional
|
|
37
|
+
`{ recordHistory: false }` flag through to `POST
|
|
38
|
+
/api/canvas/viewport`, which now wraps the mutation in
|
|
39
|
+
`withSuppressedRecording` when the flag is set. Auto-focus
|
|
40
|
+
triggered by ext-app opens uses this path so opening an external
|
|
41
|
+
app no longer fills undo history with viewport churn.
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- **HTML nodes reject non-string `html` payloads.** `POST
|
|
46
|
+
/api/canvas/node` and the matching MCP path now return a 400
|
|
47
|
+
with a clear error when an html node is created with `html` (or
|
|
48
|
+
`data.html`) set to a non-string value, instead of accepting the
|
|
49
|
+
payload and producing a blank node.
|
|
50
|
+
- **Group creation rejects missing child IDs.** `POST
|
|
51
|
+
/api/canvas/group` (and `canvas_create_group`) no longer silently
|
|
52
|
+
creates an empty group when one or more of the requested children
|
|
53
|
+
do not exist; it returns a 400 listing the missing IDs.
|
|
54
|
+
|
|
55
|
+
### Internal
|
|
56
|
+
|
|
57
|
+
- Regression coverage for: client status-node display-phase fallback,
|
|
58
|
+
ext-app auto-focus history suppression on the client side, the
|
|
59
|
+
context dock rendering pinned nodes (e2e), HTML-node payload type
|
|
60
|
+
validation over HTTP, group-create child-presence validation over
|
|
61
|
+
HTTP, and the `recordHistory: false` flag on the viewport
|
|
62
|
+
endpoint.
|
|
63
|
+
|
|
64
|
+
## [0.1.15] - 2026-05-03
|
|
65
|
+
|
|
66
|
+
A bigger release focused on right-sizing what flows through MCP and the
|
|
67
|
+
canvas state file. Adds an `html` node type, sidecar blob storage so
|
|
68
|
+
rich ext-app payloads stay out of the main `state.json`, compact-by-
|
|
69
|
+
default MCP responses with an opt-in `full` mode, `canvas_gc_snapshots`,
|
|
70
|
+
a shared `getCanvasNodeKind` classifier so pinned reads tell agents the
|
|
71
|
+
real kind of `mcp-app` subtypes, web-artifact source context for pinned
|
|
72
|
+
reads, an extracted demo module, and a five-file `docs/` reference set.
|
|
73
|
+
The README, AGENTS.md, and CLAUDE.md catch up to the new shape.
|
|
74
|
+
|
|
75
|
+
### Added
|
|
76
|
+
|
|
77
|
+
- **`html` node type and `canvas_add_html_node` MCP tool.** Adds a
|
|
78
|
+
dedicated HTML node renderer that sandboxes user-authored markup in
|
|
79
|
+
an iframe and injects canvas theme tokens (`--c-*` plus
|
|
80
|
+
`--color-*` aliases) so embedded content inherits the theme. Token
|
|
81
|
+
values are sanitized before interpolation. `canvas_add_node` now
|
|
82
|
+
also accepts `type: 'html'` for parity, with `canvas_add_html_node`
|
|
83
|
+
the preferred entry point. MCP tool count is now 40 (was 39).
|
|
84
|
+
- **Snapshot list filtering and `canvas_gc_snapshots`.**
|
|
85
|
+
`canvas_list_snapshots` accepts options (`limit`, `before`,
|
|
86
|
+
`after`), and `canvas_gc_snapshots({keep, dryRun})` deletes older
|
|
87
|
+
snapshots while keeping the newest N. CLI `pmx-canvas snapshot
|
|
88
|
+
list` and `pmx-canvas snapshot gc` expose the same surface; HTTP
|
|
89
|
+
endpoints support both.
|
|
90
|
+
- **Sidecar blob storage for large ext-app payloads.** When an
|
|
91
|
+
ext-app field on a node would exceed the configured threshold
|
|
92
|
+
(default 2048 bytes; override via
|
|
93
|
+
`PMX_CANVAS_BLOB_THRESHOLD_BYTES`), the value is written to
|
|
94
|
+
`.pmx-canvas/blobs/<sha>.json` and replaced with a checksum
|
|
95
|
+
reference in the main `state.json`. Blob refs are reinflated
|
|
96
|
+
transparently on read, with a checksum-mismatch warning if the
|
|
97
|
+
sidecar file has been tampered with.
|
|
98
|
+
- **`getCanvasNodeKind()` shared classifier.** New
|
|
99
|
+
`src/shared/canvas-node-kind.ts` returns
|
|
100
|
+
`'web-artifact' | 'external-app' | 'mcp-app' | <type>` so pinned
|
|
101
|
+
reads, agent context, and CLI output report the real subtype of
|
|
102
|
+
`mcp-app` nodes (web-artifact viewers vs. external apps vs. plain
|
|
103
|
+
hosted content). `canvas://pinned-context` now includes `kind` for
|
|
104
|
+
every node.
|
|
105
|
+
- **Web-artifact source context on pinned reads.** When a pinned
|
|
106
|
+
node is a web-artifact, agent context now exposes a bounded source
|
|
107
|
+
summary (`buildWebArtifactSourceContext`): a capped list of source
|
|
108
|
+
filenames plus a truncated preview, instead of inlining the full
|
|
109
|
+
bundled HTML. Total file count is preserved even when the list is
|
|
110
|
+
truncated.
|
|
111
|
+
- **Standalone reference docs.** New `docs/cli.md`,
|
|
112
|
+
`docs/http-api.md`, `docs/mcp.md`, `docs/node-types.md`, and
|
|
113
|
+
`docs/sdk.md` document each surface in detail alongside the
|
|
114
|
+
README.
|
|
115
|
+
- **Extracted demo module (`src/server/demo.ts`).** The project-tour
|
|
116
|
+
demo seed is now its own module with `seedDemoCanvas()` exported
|
|
117
|
+
and unit-tested, so contributors can read and iterate on the
|
|
118
|
+
demo without spelunking through the server boot path.
|
|
119
|
+
- **DockedNode context dock with item-count badge.** The dock
|
|
120
|
+
surfaces a pill with the count of pinned cards plus aux tabs, and
|
|
121
|
+
the dock and the right-edge Updates panel are mutually exclusive
|
|
122
|
+
(one open at a time) so they no longer collide on the same anchor.
|
|
123
|
+
- **Trace field aliases on `node update`.** `node update` accepts
|
|
124
|
+
both camel (`--toolName`) and kebab (`--tool-name`) variants for
|
|
125
|
+
trace fields, matching the `node add` flag style.
|
|
126
|
+
|
|
127
|
+
### Changed
|
|
128
|
+
|
|
129
|
+
- **MCP responses are compact by default.** `canvas_add_node`,
|
|
130
|
+
`canvas_get_node`, `canvas_get_layout`, and `canvas_batch` now
|
|
131
|
+
return compact node/layout payloads (id, type, position, size,
|
|
132
|
+
pinned, kind, plus a small data digest) by default. Pass
|
|
133
|
+
`full: true` (or `verbose: true`) to opt into the full payload.
|
|
134
|
+
This keeps response token counts stable for agents iterating over
|
|
135
|
+
large boards.
|
|
136
|
+
- **README reframed around "moldable canvas" + curation flow.** The
|
|
137
|
+
README opens with a moldable-canvas summary, calls out
|
|
138
|
+
curation-as-communication, and adds two top-level sections:
|
|
139
|
+
`01 / Curate` (drag, group, pin) and `02 / Mix any data source`.
|
|
140
|
+
- **AGENTS.md and CLAUDE.md updated for the new tool set.** Both
|
|
141
|
+
guidance files now list `canvas_add_html_node` and
|
|
142
|
+
`canvas_gc_snapshots` and the new `html` node type. Quick-start
|
|
143
|
+
shows `bun run dev:demo` for the project-tour board.
|
|
144
|
+
|
|
145
|
+
### Internal
|
|
146
|
+
|
|
147
|
+
- Regression coverage for: snapshot list filtering and gc through
|
|
148
|
+
CLI / HTTP / MCP, blob-sidecar persistence for large ext-app
|
|
149
|
+
payloads with opt-in full reads, pinned-context `kind`
|
|
150
|
+
serialization for native, graph, and mcp-app subtype nodes,
|
|
151
|
+
web-artifact pinned context returning a bounded source-file
|
|
152
|
+
summary instead of bundled HTML, capped source file metadata
|
|
153
|
+
preserving total count, trace field camel/kebab alias forwarding
|
|
154
|
+
on update, demo seeding, and external-app kind serialization
|
|
155
|
+
for pinned context consumers.
|
|
156
|
+
|
|
6
157
|
## [0.1.14] - 2026-05-02
|
|
7
158
|
|
|
8
159
|
External-MCP-app and trace-node ergonomics on top of 0.1.13. Trace node
|
|
@@ -512,6 +663,8 @@ otherwise have to discover by trial and error.
|
|
|
512
663
|
- Regression coverage for snapshot flat-`id` aliases on both MCP and
|
|
513
664
|
HTTP surfaces, plus async / top-level-`await` WebView script bodies.
|
|
514
665
|
|
|
666
|
+
[0.1.16]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.16
|
|
667
|
+
[0.1.15]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.15
|
|
515
668
|
[0.1.14]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.14
|
|
516
669
|
[0.1.13]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.13
|
|
517
670
|
[0.1.12]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.12
|