pmx-canvas 0.1.34 → 0.1.36

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
@@ -5,6 +5,69 @@ All notable changes to `pmx-canvas` are documented here. This project follows
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.1.36] - 2026-06-09
9
+
10
+ ### Added
11
+
12
+ - **Activity ingestion closes the AX loop (report primitive A).** New
13
+ `POST /api/canvas/ax/activity` + `canvas_ingest_activity` MCP tool let a harness
14
+ forward the agent's real tool/session events; the board auto-reacts with
15
+ kind-driven, overridable defaults — `failure`/`error` (or `outcome:"failure"`) →
16
+ a blocked work item + a review finding + a `logs` evidence item; `tool-result` +
17
+ `outcome:"success"` → a `tool-result` evidence item; everything else (tool-start,
18
+ `session-start`/`session-end`, command, note) records a timeline event only. A
19
+ reaction set to `false` suppresses it; an object overrides its fields. AX is now
20
+ bidirectional (agent → board *and* work → board), no longer one-directional.
21
+ - **Blocking gates (report primitive D).** Single-item `GET /api/canvas/ax/{approval
22
+ |elicitation|mode}/<id>` returns the primitive (404 if unknown) and accepts an
23
+ optional `?waitMs=` long-poll that resolves the moment the human resolves the gate
24
+ in the browser (or times out, ≤120000ms). New `canvas_await_approval` /
25
+ `canvas_await_elicitation` / `canvas_await_mode` MCP tools block the same way, so an
26
+ agent can request a gate and *wait* for the decision instead of polling. Gates that
27
+ actually gate.
28
+ - **Context delivery lead block (report #54 hardening, harness-neutral).**
29
+ `GET /api/canvas/ax/context` (and `canvas://ax-context`) now include a compact
30
+ `delivery: { pendingSteering, pendingActivity }` block, with an optional
31
+ `?consumer=` filter (loop-safe — a consumer never sees what it originated). A host
32
+ adapter can inject this small, un-truncated block per turn so steering survives the
33
+ full-context char clip on a busy board.
34
+ - **AX host-adapter contract.** New `docs/ax-host-adapter-contract.md` documents the
35
+ harness-neutral interface (pull-context / deliver-steer / ingest-activity /
36
+ await-gate / mirror-log), what PMX owns vs. what each adapter implements, and the
37
+ steering lifecycle + gating conditions.
38
+
39
+ ### Fixed
40
+
41
+ - **`window.PMX_AX.emit` now confirms (report #55).** Emit returns a Promise that
42
+ resolves with the interaction result once the parent acks it (and fires a
43
+ `pmx-ax-ack` event / `window.PMX_AX.on('ack', cb)`), so a surface button can
44
+ self-confirm (`queued ✓`) instead of looking like "nothing happened". Falls back to
45
+ an `ax-ack-timeout` result after 10s so `await emit()` never hangs.
46
+ - **HTTP node creation requires a `type` (report #50).** `POST /api/canvas/node` with
47
+ an empty / type-less body now returns `400` (with the valid-type list) instead of
48
+ silently creating a phantom markdown node. The `?type=` query param still resolves it.
49
+ - **HTTP accepts top-level `html` / `axCapabilities` on html nodes (report #53).** Both
50
+ `POST /api/canvas/node` and `PATCH /api/canvas/node/<id>` now accept these fields at
51
+ the top level (previously dropped on update, and `axCapabilities` dropped on add) —
52
+ transport parity with `canvas_add_html_node` / `canvas_update_node`. `data.*` nesting
53
+ still works.
54
+ - **`POST`/`PATCH /api/canvas/ax/work` reject an unknown status (report #56).** Sending
55
+ `status: "in_progress"` (underscore) now returns `400` with the valid enum instead of
56
+ `ok:true` + a silent no-op. Accepted tokens: `todo`, `in-progress`, `blocked`, `done`,
57
+ `cancelled`.
58
+
59
+ ## [0.1.35] - 2026-06-08
60
+
61
+ ### Fixed
62
+
63
+ - **HTTP batch accepts a bare-array body again (report #49).** `POST /api/canvas/batch`
64
+ with a top-level `[ ... ]` array created nothing and returned `{ ok: true, results: [] }`
65
+ — the 0.1.33 `readJson` hardening (empty/whitespace/non-object → `{}`) also coerced
66
+ top-level arrays to `{}`, so the handler's bare-array branch was dead. Batch now reads
67
+ the body with an array-preserving variant, so both documented shapes work: the canonical
68
+ `{ "operations": [...] }` and a bare `[...]`. `readJson` is unchanged for every other
69
+ endpoint (still object-only), so the malformed-body robustness is preserved.
70
+
8
71
  ## [0.1.34] - 2026-06-08
9
72
 
10
73
  ### Added
@@ -1763,6 +1826,8 @@ otherwise have to discover by trial and error.
1763
1826
  - Regression coverage for snapshot flat-`id` aliases on both MCP and
1764
1827
  HTTP surfaces, plus async / top-level-`await` WebView script bodies.
1765
1828
 
1829
+ [0.1.36]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.36
1830
+ [0.1.35]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.35
1766
1831
  [0.1.34]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.34
1767
1832
  [0.1.33]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.33
1768
1833
  [0.1.32]: https://github.com/pskoett/pmx-canvas/releases/tag/v0.1.32
package/Readme.md CHANGED
@@ -61,6 +61,10 @@ immediately — an explicit, low-noise control over what the agent sees next.
61
61
  On top of pins, a host-agnostic **AX (agent-experience) layer** turns the
62
62
  canvas into a shared workspace between you and the agent:
63
63
 
64
+ - **Agent-native nodes** — create markdown, status, HTML, json-render, graph,
65
+ web-artifact, or MCP app nodes that can act as interactive controls for the
66
+ agent. A node can focus context, create or update work, add evidence, request
67
+ input or approval, or send steering without leaving the board.
64
68
  - **Focus** — promote nodes into the agent's active context without moving the viewport.
65
69
  - **Work items & approval gates** — track visible tasks tied to nodes, and gate
66
70
  high-impact actions behind a human `pending → approved/rejected` decision.
@@ -76,6 +80,12 @@ canvas into a shared workspace between you and the agent:
76
80
  commands (`pmx.plan`, `pmx.review`, …), and read a tool/prompt policy.
77
81
  - **Host capability** — adapters report what the host can do, for diagnostics.
78
82
 
83
+ Recent additions in this layer: agent-native nodes can now complete the full
84
+ AX loop; agent tool/session activity can flow back into the board as work,
85
+ evidence, and findings; approval, input, and mode gates can wait for a human
86
+ decision instead of polling; and AX-enabled HTML/web-artifact or MCP app
87
+ controls can show an in-surface confirmation after an action is accepted.
88
+
79
89
  Canvas-bound state (focus, work items, approvals, review annotations,
80
90
  elicitations, mode requests, policy) rides canvas snapshots and restore; the
81
91
  timeline persists for continuity but is retention-bounded and never restored by a
@@ -95,7 +105,7 @@ the DB so SQLite WAL data is checkpointed into the file.
95
105
 
96
106
  ### 06 / Any agent
97
107
 
98
- Harness-agnostic. Drive the canvas from [MCP](docs/mcp.md) (65 tools,
108
+ Harness-agnostic. Drive the canvas from [MCP](docs/mcp.md) (69 tools,
99
109
  14 resources, change notifications), the [CLI](docs/cli.md), the
100
110
  [HTTP API](docs/http-api.md), or the [Bun SDK](docs/sdk.md). Works with
101
111
  Claude Code, GitHub Copilot CLI, Codex, Cursor, Windsurf, or any agent
@@ -245,9 +255,11 @@ the agent can read `canvas://skills` and pull in companion skills
245
255
  the three-tier visual matrix (json-render → html → web-artifact)
246
256
  - **[CLI reference](docs/cli.md)** — full command surface, daemon mode,
247
257
  watch streams, WebView automation
248
- - **[MCP reference](docs/mcp.md)** — 65 tools, 14 resources, change
258
+ - **[MCP reference](docs/mcp.md)** — 69 tools, 14 resources, change
249
259
  notifications, node-type routing
250
260
  - **[HTTP API](docs/http-api.md)** — REST endpoints, SSE, batch operations
261
+ - **[AX host-adapter contract](docs/ax-host-adapter-contract.md)** — how native
262
+ host adapters connect context, steering, activity, and human gates
251
263
  - **[Bun SDK](docs/sdk.md)** — `createCanvas()` for TypeScript on Bun
252
264
  - **[Release process](docs/RELEASE.md)** — maintainer-only
253
265