@everfir/az8-cli 0.2.0 → 0.3.0-preview.2

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,63 @@
3
3
  All notable AZ8 CLI changes are recorded here. The CLI package has its own linear version sequence;
4
4
  it does not inherit the Web application or monorepo root version.
5
5
 
6
+ ## Unreleased
7
+
8
+ ## 0.3.0-preview.2 - 2026-07-23
9
+
10
+ ### Added
11
+
12
+ - Cursor-only Awareness acknowledgement after a remote Canvas Watch delivery has been flushed and
13
+ internally acknowledged.
14
+ - Advisory `data.createdByCli` provenance on every View Node created through the CLI.
15
+
16
+ ### Changed
17
+
18
+ - CLI-created Notes retain the authenticated Actor id and display the current client suffix in
19
+ their visible creator label.
20
+ - Ordinary Resource View Nodes no longer receive invented generic creator metadata.
21
+ - The built-in agent Skill recommends early visible generation targets and empty Text Resources
22
+ when artifact type and placement are already unambiguous.
23
+
24
+ ### Safety and compatibility
25
+
26
+ - Delivery Awareness never responds to the CLI's own changes, never publishes Selection, and does
27
+ not represent understanding or completion.
28
+ - Editing an existing View Node preserves its creation provenance; duplicating stamps the new node
29
+ with the current client suffix.
30
+
31
+ ## 0.3.0-preview.1 - 2026-07-23
32
+
33
+ ### Added
34
+
35
+ - Manual Text Resources through `createTextNode` and `editTextContent`, generated Text targets
36
+ through `createGenerationTarget`, and Web-compatible Note accents through `setNoteColor`.
37
+ - Daemon-backed Agent Collaboration Sessions through `az8 session`, with one isolated local daemon
38
+ per Session, current-context discovery, retained authenticated Canvas lifecycle, semantic
39
+ Operations and queries, Interests, bounded Watch delivery, and explicit close.
40
+ - A single semantic collaboration Watch for Canvas, Workflow, and Session facts, with bounded recent
41
+ history, pending continuity inspection, at-least-once stdout delivery, and explicit
42
+ resynchronization after journal loss.
43
+
44
+ ### Changed
45
+
46
+ - New generation references accept only visible Canvas View Node identities. Content available only
47
+ as a Core Node must first be placed with `placeCoreNode`, preserving Web's inferred connection
48
+ lines and preventing ambiguous placement selection.
49
+ - Agent authoring now defaults to daemon-backed Sessions. Persistent stdio remains the lower-level
50
+ carrier, while one-shot remains limited to isolated reads, standalone transfers, explicit caller
51
+ choice, or hosts that cannot retain a collaborative client.
52
+ - Numeric Workflow configuration enums normalize transport string values back to their declared
53
+ numeric domain before planning validation, matching Web behavior.
54
+
55
+ ### Safety and compatibility
56
+
57
+ - Tokens remain outside command arguments, daemon descriptors, and the private daemon protocol.
58
+ - Session writes remain serialized and never retry automatically. Queries wait behind executing
59
+ writes; Watch collection remains independent.
60
+ - The initial local daemon transport supports macOS and Linux. Windows remains explicitly
61
+ unsupported until the same private Session carrier is hosted through a named pipe.
62
+
6
63
  ## 0.2.0 - 2026-07-22
7
64
 
8
65
  First stable semantic Project Canvas client for agents.
@@ -14,6 +71,15 @@ First stable semantic Project Canvas client for agents.
14
71
  media upload/download.
15
72
  - A runtime-discoverable built-in agent Skill covering platform concepts, capability discovery,
16
73
  persistent request/process lifecycle, generation sequencing, recovery, and prohibited bypasses.
74
+ - Commander 15 command routing and generated help, with Zod 4 schemas for typed option and
75
+ cross-option validation.
76
+
77
+ ### Changed
78
+
79
+ - Source is grouped into `src/cli`, `src/commands`, `src/canvas`, `src/media`, `src/integrations`,
80
+ `src/guide`, `src/schemas`, `src/errors`, and `src/utils`; tests remain colocated and domain
81
+ modules remain framework-independent.
82
+ - The CLI and repository development contract now require Node.js 22.12 or newer.
17
83
 
18
84
  ### Stability contract
19
85
 
package/README.md CHANGED
@@ -5,7 +5,8 @@ and does not expose raw backend, Yjs, or document mutation commands.
5
5
 
6
6
  ## Install
7
7
 
8
- AZ8 CLI requires Node.js 20 or newer. Install the stable channel from the configured npm registry:
8
+ AZ8 CLI requires Node.js 22.12 or newer. Install the stable channel from the configured npm
9
+ registry:
9
10
 
10
11
  ```bash
11
12
  npm install --global @everfir/az8-cli
@@ -14,10 +15,10 @@ az8 help
14
15
  az8 guide
15
16
  ```
16
17
 
17
- For a supplied release artifact, install the exact immutable tarball instead:
18
+ For a supplied preview artifact, install the exact immutable tarball instead:
18
19
 
19
20
  ```bash
20
- npm install --global ./everfir-az8-cli-0.2.0.tgz
21
+ npm install --global ./everfir-az8-cli-0.3.0-preview.2.tgz
21
22
  az8 --version
22
23
  ```
23
24
 
@@ -61,6 +62,29 @@ An explicit file is selected by path, for example
61
62
  users to paste credential contents; verify authentication with a bounded `projects list` read.
62
63
  Tokens must not be passed through argv or stdio protocol payloads.
63
64
 
65
+ ## CLI architecture
66
+
67
+ The executable uses Commander for the command tree and generated help, and Zod as the typed option
68
+ validation boundary. CLI-specific code is organized by responsibility:
69
+
70
+ - `src/cli/` owns program assembly, runtime config, persistent stdio transport, output framing, and
71
+ package version resolution.
72
+ - `src/commands/` declares Project, Canvas, and guide commands.
73
+ - `src/agent-session/` owns isolated daemon lifecycles, local Session discovery, the private RPC
74
+ carrier, Watch delivery, and current-context selection.
75
+ - `src/canvas/` owns collaboration sessions, one-shot execution, awareness, and the NDJSON
76
+ protocol.
77
+ - `src/media/` owns safe local upload and download behavior.
78
+ - `src/integrations/` adapts AZ8 backend APIs to the account, Project, Project Content, Foundation
79
+ Data, Workflow, and snapshot ports.
80
+ - `src/guide/` loads and renders the packaged agent Skill.
81
+ - `src/schemas/` owns parsed option contracts and cross-option validation.
82
+ - `src/errors/` maps validation failures to stable CLI and Canvas error codes.
83
+ - `src/utils/` contains shared output and Commander option adapters.
84
+ - `src/index.ts` and `src/main.ts` remain the programmatic and executable entry points.
85
+
86
+ Canvas, media, guide, and integration modules do not depend on Commander or Zod.
87
+
64
88
  ## Project Management
65
89
 
66
90
  ```bash
@@ -77,23 +101,52 @@ indeterminate.
77
101
  ## First agent loop
78
102
 
79
103
  A new agent needs only the installed package, a token, and this document. Start by creating its own
80
- Project and retaining the returned `project.id`:
104
+ Project, then open one daemon-backed Agent Collaboration Session:
81
105
 
82
106
  ```bash
83
107
  az8 projects create --name "Agent preview workspace"
84
- az8 canvas query <project-id> capabilities.summary
85
- printf '%s\n' '{"text":"Release smoke note","position":{"x":160,"y":160}}' \
86
- | az8 canvas operation <project-id> createNote \
87
- --input-stdin --request-id preview-note-1
108
+ az8 session open <project-id> --environment test
109
+ az8 session query capabilities.summary
110
+ az8 session operation createNote --request-id preview-note-1 \
111
+ --input-json '{"text":"Release smoke note","position":{"x":160,"y":160}}'
112
+ az8 session query canvas.summary
113
+ ```
114
+
115
+ The Session remains selected for the current canonical working directory, so subsequent commands do
116
+ not repeat its ID. Use `session current`, `list`, and `status` rather than guessing which Project or
117
+ daemon is active. Configure semantic Interests and block on one Watch call when collaboration
118
+ updates matter:
119
+
120
+ ```bash
121
+ az8 session interests patch \
122
+ --input-json '{"upsert":[{"key":"canvas-ambient","patch":{"kind":"canvas"}},{"key":"workflow-terminal","patch":{"kind":"workflow"}}]}'
123
+ az8 session watch --timeout-ms 30000
124
+ az8 session close
88
125
  ```
89
126
 
90
- For a long-lived collaborative context, start `az8 canvas open <project-id> --write --format ndjson`,
91
- read its `hello` frame, send the documented `initialize` request, and wait for `ready` before sending
92
- queries or Operations. Keep the process and stdin/stdout pipes alive to preserve awareness, local
93
- History, Receipts, observations, and request replay.
127
+ `watch` returning `idle` is a successful empty observation window, not a connection error. Exactly
128
+ one caller may wait on a Session. The daemon retains the authenticated connection and collaboration
129
+ state between short CLI invocations, but it does not wake or restart an Agent that has exited.
130
+
131
+ For a manual human–Agent interaction latency check, have the Agent report that it is ready, start
132
+ one 60-second Watch, and only then make one recognizable Canvas change from Web:
94
133
 
95
- For generation, create an image target and call `planGeneration` with the returned View Node and a
96
- prompt. Execute its returned `plan.operations` in order, stopping after the first failure. A
134
+ ```bash
135
+ az8 session interests patch \
136
+ --input-json '{"upsert":[{"key":"latency-check","patch":{"kind":"canvas","filter":{"includeOwn":false}}}]}'
137
+ az8 session watch --timeout-ms 60000
138
+ ```
139
+
140
+ The Agent should acknowledge the returned semantic change immediately and then wait again. Record
141
+ the human-observed time from completing the Web interaction to seeing the Agent response.
142
+ `result.timing.waitedMs` is how long the blocking call waited, while each change's `quietForMs` is
143
+ the CLI's local observation-to-delivery delay; neither includes speech recognition or the Agent
144
+ host's scheduling time. Repeat only a small bounded sample, keep the Session open between trials,
145
+ and remove the temporary Interest or close the Session afterward.
146
+
147
+ For generation, create a target with `createGenerationTarget` (including `contentType: "text"`) and
148
+ call `planGeneration` with the returned View Node and a prompt. Execute its returned
149
+ `plan.operations` in order, stopping after the first failure. A
97
150
  successful `startGeneration` Receipt contains the Workflow Run identity; call `waitWorkflowRun`
98
151
  separately when a terminal output is required. Planning and starting are intentionally not one
99
152
  transaction.
@@ -108,9 +161,9 @@ the agent can verify identities, byte count, MIME, and SHA-256.
108
161
  One-shot commands open a real Canvas client, complete synchronization and hydration, invoke the same
109
162
  query or Operation used by the persistent client, and close after the result is authoritative:
110
163
 
111
- Persistent stdio is the default for any Canvas authoring task, including a plan with only one write.
112
- Use this wrapper only for an isolated read, standalone transfer, explicit one-shot request, or a host
113
- that cannot retain a child process and write later NDJSON to stdin.
164
+ Daemon-backed Sessions are the default for any Canvas authoring task, including a plan with only one
165
+ write. Use this wrapper only for an isolated read, standalone transfer, explicit one-shot request,
166
+ or a host that cannot run a Session daemon or retain a child process.
114
167
 
115
168
  ```bash
116
169
  az8 canvas query <project-id> canvas.summary
@@ -212,11 +265,13 @@ source, HTTP 4xx, or local-path failure; exit `2` is a retryable connection, HTT
212
265
  integrity, or timeout failure; exit `130` is caller cancellation. Downloads are never automatically
213
266
  retried. After any non-success, the agent must decide whether a new invocation is safe.
214
267
 
215
- ## Persistent Canvas client
268
+ ## Lower-level persistent stdio client
216
269
 
217
- This is the default mode whenever a task may perform any Canvas write. Open it before the first
218
- Canvas query, keep capability discovery and all ordered Operations in the same lifecycle, and shut
219
- it down only after the authoring task is complete.
270
+ This is the lower-level carrier for a host that deliberately owns and continuously drains one child
271
+ process. Ordinary Agents should use `az8 session`, whose private daemon retains the same Canvas
272
+ lifecycle across short commands. When using stdio directly, open it before the first Canvas query,
273
+ keep capability discovery and all ordered Operations in the same lifecycle, and shut it down only
274
+ after the authoring task is complete.
220
275
 
221
276
  ```bash
222
277
  az8 canvas open <project-id> --write --format ndjson [--client-name codex]
@@ -237,28 +292,45 @@ rename the persisted author. The CLI publishes its Attention Cursor but delibera
237
292
  bounds. Project owner metadata is likewise never treated as the current actor on shared Projects.
238
293
 
239
294
  After `ready`, requests use `query`, `configureObservations`, `operation`, `reconnect`, or `shutdown`.
240
- The public authoring surface includes the note lifecycle, non-World View Node hierarchy operations,
241
- and the Stage 3 Core Node creative loop. Hierarchy operations are `groupViewNodes`,
295
+ The public authoring surface includes distinct Note and Text Resource lifecycles, non-World View
296
+ Node hierarchy operations, and the Stage 3 Core Node creative loop. Note operations include
297
+ `createNote`, `editNoteContent`, and `setNoteColor`; manual Text Resource operations are
298
+ `createTextNode` and `editTextContent`. Hierarchy operations are `groupViewNodes`,
242
299
  `ungroupViewNode`, `moveViewNodes` with an optional `targetParentId`, and
243
300
  `updateViewNodeStacking`. Core Node operations are `getCoreNode`, `placeCoreNode`,
244
- `createMediaTarget`, `planGeneration`, `importExternalMedia`, `uploadMedia`, `editGenerationDraft`,
301
+ `createGenerationTarget`, the compatible non-text `createMediaTarget`, `planGeneration`,
302
+ `importExternalMedia`, `uploadMedia`, `editGenerationDraft`,
245
303
  `addVisualReference`, `removeVisualReference`, `startGeneration`, `getWorkflowRun`, and
246
304
  `waitWorkflowRun`. Capability detail is discoverable through `capabilities.detail`; callers should
247
305
  use it instead of hard-coding input schemas. Workflow Definitions are available through
248
306
  `workflowDefinitions.summary` and `workflowDefinition.detail` queries.
249
307
 
250
308
  Before editing a Draft, an agent can call the read-only `planGeneration` Operation for an existing
251
- media target. It recommends a Definition from the target and resolved Visual Reference modalities,
309
+ generation target. It recommends a Definition from the target and resolved generation-reference modalities,
252
310
  constructs configuration defaults, validates required inputs, and returns compact alternatives plus
253
311
  an ordered semantic Operation sequence. Use `detail: "detail"` to include slot and configuration
254
312
  field metadata, including dynamic enum options. Planning never creates a Core Node or changes the
255
313
  Canvas; returned Operations still execute independently and stop at the first failure.
256
314
 
315
+ Generation references always identify visible Canvas placements. Public planning and
316
+ `addVisualReference` accept only a View Node ID. If desired content exists only as a Core Node, call
317
+ `placeCoreNode` first, wait for its successful Receipt, and reference the returned View Node. This
318
+ preserves the same visible inferred connection as Web and avoids guessing when one Core Node has
319
+ multiple Canvas placements. Manual Text Resources are valid prompt references even though they do
320
+ not have a Core Node before generation starts. Their View Node binding remains in the launch history
321
+ for Web lineage and inferred-edge rendering; estimation uses the current text and materialization
322
+ creates the Text Core Node only after the estimate succeeds. The published operation names
323
+ `addVisualReference` and `removeVisualReference` are retained for compatibility and also carry these
324
+ planned Text bindings.
325
+
257
326
  ```json
258
327
  {"protocolVersion":"1.0","requestId":"plan-1","type":"operation","payload":{"name":"planGeneration","input":{"targetViewNodeId":"<target-id>","prompt":"A quiet observatory","references":[{"viewNodeId":"<reference-id>"}],"detail":"detail"}}}
259
328
  ```
260
329
 
261
- `editNoteContent`, `renameViewNode`, and `resizeViewNodes` match Web's silent History policy.
330
+ `editNoteContent`, `setNoteColor`, `editTextContent`, `renameViewNode`, and `resizeViewNodes` match
331
+ Web's silent History policy. Note colors are limited to `blue`, `orange`, `red`, `gold`, `purple`,
332
+ and `green`. A manual Text Resource is `type: "resource"`, `contentType: "text"`; it must not be
333
+ approximated with a Note.
262
334
  `duplicateViewNodes` and `removeViewNodes` are undoable. Removal atomically cleans Draft references
263
335
  from surviving nodes. Duplication supports notes and non-World resource nodes; resource copies retain
264
336
  the currently displayed Project Content output without cloning a Core Node or creating Project
@@ -278,6 +350,8 @@ Example Stage 2 edits:
278
350
 
279
351
  ```json
280
352
  {"protocolVersion":"1.0","requestId":"edit-1","type":"operation","payload":{"name":"editNoteContent","input":{"viewNodeId":"view_node_1","text":"revised idea"}}}
353
+ {"protocolVersion":"1.0","requestId":"color-1","type":"operation","payload":{"name":"setNoteColor","input":{"viewNodeId":"view_node_1","color":"purple"}}}
354
+ {"protocolVersion":"1.0","requestId":"text-1","type":"operation","payload":{"name":"createTextNode","input":{"text":"A manual Text Resource","name":"Draft copy","position":{"x":520,"y":160}}}}}
281
355
  {"protocolVersion":"1.0","requestId":"resize-1","type":"operation","payload":{"name":"resizeViewNodes","input":{"resizes":[{"viewNodeId":"view_node_1","size":{"width":420,"height":360}}]}}}
282
356
  {"protocolVersion":"1.0","requestId":"duplicate-1","type":"operation","payload":{"name":"duplicateViewNodes","input":{"viewNodeIds":["view_node_1"]}}}
283
357
  ```
@@ -294,7 +368,7 @@ Example hierarchy sequence (each successful write is one independent undoable in
294
368
  Example Stage 3 generation sequence (each line is a separate ordered interaction):
295
369
 
296
370
  ```json
297
- {"protocolVersion":"1.0","requestId":"target-1","type":"operation","payload":{"name":"createMediaTarget","input":{"contentType":"image"}}}
371
+ {"protocolVersion":"1.0","requestId":"target-1","type":"operation","payload":{"name":"createGenerationTarget","input":{"contentType":"image"}}}
298
372
  {"protocolVersion":"1.0","requestId":"draft-1","type":"operation","payload":{"name":"editGenerationDraft","input":{"viewNodeId":"<target-id>","definitionId":"<definition-id>","prompt":"A quiet observatory","config":{"aspect_ratio":"16:9"}}}}
299
373
  {"protocolVersion":"1.0","requestId":"start-1","type":"operation","payload":{"name":"startGeneration","input":{"viewNodeId":"<target-id>"}}}
300
374
  {"protocolVersion":"1.0","requestId":"wait-1","type":"operation","payload":{"name":"waitWorkflowRun","input":{"workflowRunId":"<run-id>"},"timeoutMs":120000}}
@@ -355,20 +429,23 @@ Before distributing a release tarball, verify all of the following from its clea
355
429
  from TypeScript source:
356
430
 
357
431
  1. `az8 --version` matches the immutable package version; `az8 help` lists the built-in guide,
358
- Project, persistent Canvas, one-shot, upload, and download entry points; and `az8 guide` plus its
359
- JSON form work without credentials or network access.
432
+ Project, Session, persistent Canvas, one-shot, upload, and download entry points; and `az8 guide`
433
+ plus its JSON form work without credentials or network access.
360
434
  2. With no credential, an authenticated command fails without connecting and without printing a
361
435
  token. With the test token, `projects create` returns a new Project owned by the authenticated
362
436
  account.
363
- 3. Persistent stdio reaches `ready`, accepts a summary query, creates a note whose Receipt records
437
+ 3. A daemon-backed Session opens, becomes current, accepts a summary query and one semantic write,
438
+ reports healthy status, delivers an interested external change through `watch`, returns `idle`
439
+ for an empty bounded wait, and closes without leaving a live daemon or current binding.
440
+ 4. Persistent stdio reaches `ready`, accepts a summary query, creates a note whose Receipt records
364
441
  the authenticated Actor, and completes an ordered shutdown.
365
- 4. One-shot `createMediaTarget` plus `planGeneration` returns a ready semantic sequence; executing
366
- that sequence starts one Workflow Run, and `waitWorkflowRun` or later `getWorkflowRun` observes
367
- its authoritative state.
368
- 5. Upload one small local media file, confirm immediate detail resolution to its Core Node, replay
442
+ 5. One-shot `createGenerationTarget` plus `planGeneration` returns a ready semantic sequence with
443
+ only visible View Node references; executing that sequence starts one Workflow Run, and
444
+ `waitWorkflowRun` or later `getWorkflowRun` observes its authoritative state.
445
+ 6. Upload one small local media file, confirm immediate detail resolution to its Core Node, replay
369
446
  the same idempotency key without another transfer, and download the resolved media to a fresh
370
447
  destination whose SHA-256 is reported.
371
- 6. Run repository `pnpm verify`, retain the tarball SHA-512, and record the tested environment. Never
448
+ 7. Run repository `pnpm verify`, retain the tarball SHA-512, and record the tested environment. Never
372
449
  perform these acceptance writes against production.
373
450
 
374
451
  Release and rollback commands are in `RELEASE.md`; package changes are in `CHANGELOG.md`.
package/RELEASE.md CHANGED
@@ -19,7 +19,8 @@ preserves the verified tarball and clean installation under `tmp/az8-cli-release
19
19
  acceptance. Never bundle against pre-existing workspace `dist/` output.
20
20
 
21
21
  Run the live smoke only against the test environment. It creates one Project unless `--project-id`
22
- reuses an explicit test Project, starts one image generation, and uploads one tiny PNG:
22
+ reuses an explicit test Project, starts one visible-reference image generation, and uploads one
23
+ generated 512×512 PNG:
23
24
 
24
25
  ```bash
25
26
  node apps/az8-cli/scripts/smoke-test.js \
@@ -41,18 +42,32 @@ node apps/az8-cli/scripts/smoke-test.js \
41
42
  --require-generation-estimate
42
43
  ```
43
44
 
45
+ When a release changes Text generation, add one bounded Text Workflow to the smoke with a known
46
+ test Definition. This is additive to the image acceptance unless the image path is being diagnosed
47
+ separately:
48
+
49
+ ```bash
50
+ node apps/az8-cli/scripts/smoke-test.js \
51
+ --bin ./tmp/az8-cli-release/install/node_modules/.bin/az8 \
52
+ --env-file ./.env.local \
53
+ --text-generation-definition-id <test-text-definition-id>
54
+ ```
55
+
44
56
  Before publishing, also run the test-environment acceptance checklist in the packaged README and the
45
57
  repository-wide `pnpm verify`. Publishing is an external action and requires explicit operator
46
58
  authorization:
47
59
 
60
+ For a preview candidate, publish the exact retained artifact to the preview channel:
61
+
48
62
  ```bash
49
- npm publish ./tmp/az8-cli-release/everfir-az8-cli-0.2.0.tgz --tag latest
63
+ npm publish ./tmp/az8-cli-release/everfir-az8-cli-0.3.0-preview.2.tgz --tag preview
50
64
  npm view @everfir/az8-cli dist-tags versions --json
51
65
  ```
52
66
 
53
- Publish only the exact retained tarball whose SHA-512 appears in the stable release verification
54
- record. Do not publish from an unverified source directory. If the obsolete misspelled `prewview`
55
- tag still exists after stable publication, remove that tag without unpublishing its immutable
67
+ Publish only the exact retained tarball whose SHA-512 appears in its release verification record.
68
+ Do not publish from an unverified source directory. A later stable promotion uses a new stable
69
+ version and `--tag latest`; it never retags or republishes this immutable preview artifact. If the
70
+ obsolete misspelled `prewview` tag still exists, remove that tag without unpublishing its immutable
56
71
  version:
57
72
 
58
73
  ```bash