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

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everfir/az8-cli",
3
- "version": "0.3.0-preview.2",
3
+ "version": "0.3.0-preview.3",
4
4
  "description": "Semantic Project Canvas client for AZ8 Studio agents.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -62,7 +62,9 @@ capabilities instead of guessing operation names or input shapes.
62
62
 
63
63
  ## Bootstrap
64
64
 
65
- 1. Verify the installed client without credentials:
65
+ 1. Report the canonical working directory and intended environment before asking the operator to
66
+ provision an env file. This tells them where automatic `.env.local` discovery begins without
67
+ inspecting the file or secret. Then verify the installed client without credentials:
66
68
 
67
69
  ```bash
68
70
  az8 --version
@@ -162,15 +164,28 @@ Session resolution is explicit and discoverable. A command-level `--session <id>
162
164
  parallel Agents intentionally sharing one working directory. `session list`, `current`, `status`,
163
165
  and `use` must be used whenever the binding is uncertain; never guess a Session or Project.
164
166
 
165
- Configure named semantic Interests once, then use the singular blocking Watch instead of polling:
167
+ The Session always installs the visible, read-only `system.workflow-terminal` Interest. It retains
168
+ every terminal Workflow fact discoverable during this Project Session, including locally started
169
+ Runs and pending Runs introduced by Web or another client. Do not add or maintain Run ID filters
170
+ merely to receive completions. Configure only additional semantic Interests, then use the singular
171
+ blocking Watch:
166
172
 
167
173
  ```bash
168
- az8 session interests patch --input-json '{"upsert":[{"key":"canvas-ambient","patch":{"kind":"canvas"}},{"key":"workflow-terminal","patch":{"kind":"workflow"}}]}'
174
+ az8 session interests patch \
175
+ --input-json '{"upsert":[{"key":"canvas-ambient","patch":{"kind":"canvas"}}]}'
169
176
  az8 session watch --timeout-ms 30000
170
177
  ```
171
178
 
179
+ - Whenever waiting is the next useful action, invoke exactly one `az8 session watch` immediately in
180
+ the foreground. Process its result, act if needed, then invoke one new foreground Watch if waiting
181
+ is still useful. This is the fastest Agent response path because the daemon journals facts between
182
+ calls.
183
+ - Never wrap Watch in a `while`, `for`, recursive, timer, or repeated shell loop. Never launch it
184
+ with `&`, `nohup`, a detached terminal, or a background task. Such a process can consume the
185
+ readiness event before the Agent can reason about it.
172
186
  - Canvas Interests exclude the Session's own changes unless `includeOwn: true` is explicit.
173
- - Workflow Interests are terminal-only unless progress status is explicitly requested.
187
+ - The system Workflow Interest is terminal-only. Add a user Workflow Interest only when
188
+ pending/running progress affects a concrete decision.
174
189
  - `idle` ends one observation window normally. It does not indicate a failed connection or Run.
175
190
  - `resync-required` means bounded continuity was lost. Query authoritative summary/detail, then run
176
191
  `az8 session resynchronize`; never pretend the missing interval was observed.
@@ -279,15 +294,31 @@ Generation is an explicit sequence, never one transaction:
279
294
  4. Execute `plan.operations` exactly in order, one Operation at a time. Each step revalidates
280
295
  current facts. Stop after the first non-success.
281
296
  When a reference must also appear at a meaningful Prompt position, use
282
- `insertPromptReference` with the target View Node, visible reference View Node, and
283
- `placement: "start"` or `"end"`. The CLI creates and validates the binding and At token
297
+ `insertPromptReference` with the target View Node and visible reference View Node. Use
298
+ `placement: "start"` or `"end"` for boundary placement, or anchor a named concept precisely:
299
+
300
+ ```json
301
+ {
302
+ "viewNodeId": "target_view_node",
303
+ "referenceViewNodeId": "character_view_node",
304
+ "placement": {
305
+ "kind": "after",
306
+ "anchor": { "text": "豆豆", "occurrence": 2 }
307
+ }
308
+ }
309
+ ```
310
+
311
+ `occurrence` is one-based and may be omitted only when the text occurs once. A missing or
312
+ ambiguous anchor fails without writing. The CLI creates and validates the binding and At token
284
313
  atomically. Do not write `{{@...}}`, choose an input slot/index, or allocate a binding ID
285
314
  yourself. `addVisualReference` remains the connection-only operation.
286
315
  5. `startGeneration` succeeds when the Workflow Run is accepted and immediate Canvas effects are
287
316
  acknowledged. This completes the start interaction; it does not mean generation finished.
288
- 6. Retain the Workflow Run ID. After the successful start Receipt, continue any work that does not
289
- require the generated output. Prefer `workflowChanged` observations while the persistent client
290
- is active, and use `getWorkflowRun` at a meaningful later checkpoint.
317
+ 6. Retain the Workflow Run ID. The Session automatically covers its terminal state through
318
+ `system.workflow-terminal`; call one foreground `az8 session watch` whenever completion is the
319
+ next useful event. The terminal summary contains the Run, target View Node, and output Core Node
320
+ identities supplied by Workflow Runtime. Continue other work first when it does not require the
321
+ output, and use `getWorkflowRun` at a meaningful authoritative checkpoint.
291
322
  7. Use `waitWorkflowRun` only when the next step actually requires terminal output and the current
292
323
  request lane can remain dedicated to waiting. Choose one intentional observation window; do not
293
324
  emulate polling with repeated short waits. An observation-window timeout while the authoritative
@@ -304,10 +335,10 @@ target evidence: wait and reconcile later. `repaired` means the CLI restored the
304
335
  launch facts through the semantic Command path. `conflict` or `insufficient` requires inspection;
305
336
  neither authorizes a retry.
306
337
 
307
- A Workflow Interest performs an authoritative status catch-up for Run IDs already known to the
308
- Session; explicit `filter.runIds` narrows or restores that set when needed. This closes
309
- missed-live-event races and delivers each unchanged terminal fact once. Keep explicit Run ID filters
310
- current across handoffs; the daemon does not scan unrelated Workflow Runs.
338
+ The system Workflow Interest performs authoritative catch-up for Run IDs known to the Session and
339
+ delivers each unchanged terminal fact once. User Workflow Interests are additive and may narrow
340
+ progress observations, but cannot remove or narrow the system terminal stream. This is Session
341
+ discovery, not an account-wide or historical Workflow event log.
311
342
 
312
343
  Workflow Definitions change over time. Query `workflowDefinitions.summary`, then
313
344
  `workflowDefinition.detail` only when planning detail is insufficient. Never guess a Definition,
@@ -337,6 +368,9 @@ az8 canvas upload <project-id> \
337
368
  error. Replay only after inspecting and reconciling the prior attempt.
338
369
  - Let the CLI inspect bytes, MIME, size, and checksum and let the server create the Core Node and
339
370
  binding. Do not supply a claimed media type, upload URL, Core Node ID, or Project Content record.
371
+ - Treat `az8.operation-progress.v1` lines on stderr as provisional feedback. The stages are
372
+ `inspecting`, `requesting-upload`, `uploading`, `creating-content`, and `updating-canvas`; only the
373
+ terminal Receipt proves the Operation outcome. Progress never authorizes a retry.
340
374
  - A known failure may leave one inspectable `failed` View Node. An unknown response leaves it
341
375
  `pending` and isolates the context; do not create a replacement until reconciliation.
342
376
 
@@ -351,7 +385,10 @@ az8 canvas download <project-id> --view-node-id <view-node-id> --output ./result
351
385
 
352
386
  The destination must be explicit. Existing files are preserved unless `--overwrite` is explicitly
353
387
  chosen. Verify the returned absolute path, byte count, detected MIME, Core Node ID, and SHA-256.
354
- Never extract or reuse hidden media URLs as a general downloader.
388
+ The CLI may automatically retry only retryable read/transfer phases, at most three total attempts
389
+ under the original deadline. It re-resolves the source and removes every partial temporary file
390
+ before retrying. Inspect `error.phase`, `retryable`, `attempts`, sanitized `cause`, `localState`, and
391
+ `remoteState` after failure. Never extract or reuse hidden media URLs as a general downloader.
355
392
 
356
393
  ## Recovery
357
394