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

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,75 @@ it does not inherit the Web application or monorepo root version.
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## 0.4.0 - 2026-07-24
9
+
10
+ ### Added
11
+
12
+ - Browser-assisted local authentication through `az8 login`, account inspection through
13
+ `az8 whoami`, and local sign-out through `az8 logout`.
14
+ - Environment-isolated local credential storage with atomic writes, restrictive filesystem
15
+ permissions, authenticated account metadata, and automatic persistence of rotated tokens.
16
+ - A standalone Studio authorization page that requires an explicit approve or deny decision and
17
+ never exposes the delivered credential to browser JavaScript.
18
+
19
+ ### Changed
20
+
21
+ - Capability discovery can select one exact Operation schema with `--operation-name`; Workflow
22
+ Definition discovery always uses compact target counts, target filtering, and opaque cursor
23
+ pagination.
24
+ - The built-in Skill uses focused capability detail and bounded Workflow catalog pages instead of
25
+ loading full catalogs into agent context.
26
+ - Persistent Canvas protocol `1.1` removes selector-free capability detail and full Workflow
27
+ catalog responses. Callers must select one Operation detail and page Workflow summaries.
28
+ - Credential resolution now prefers explicit process and env-file tokens before the local login
29
+ credential, while reporting which non-secret source is active.
30
+ - Daemon Session descriptors retain only the credential source and account identity so logout can
31
+ close affected local-token Sessions without recording a secret.
32
+ - Agent onboarding recommends browser login by default and explains the at-most-once exchange
33
+ failure boundary: an ambiguous exchange must begin a new authorization rather than retry.
34
+
35
+ ### Safety and compatibility
36
+
37
+ - Browser authorization uses PKCE, a short-lived user code, explicit CSRF intent, and at-most-once
38
+ token delivery. A consumed exchange is never replayed after a lost response or local save
39
+ failure.
40
+ - `logout` clears only local CLI state; it does not promise server-side revocation. Existing
41
+ environment and env-file provisioning remains supported and is never rewritten by the CLI.
42
+
43
+ ## 0.3.0 - 2026-07-23
44
+
45
+ ### Added
46
+
47
+ - Account-aware Workflow discovery and selection, using the same free-account eligibility rule as
48
+ Web while keeping unavailable historical Definitions inspectable in detail.
49
+ - Web-equivalent default generation Drafts and private local Workflow preferences scoped by
50
+ environment, authenticated account, and output content type.
51
+ - Truthful terminal Workflow target identity derived from retained launch facts or unique Canvas
52
+ History, with explicit unresolved and ambiguous states when evidence is insufficient.
53
+ - Daemon-backed collaboration Sessions, manual and generated Text Resources, semantic Prompt
54
+ reference insertion, structured transfer progress, and bounded download recovery.
55
+
56
+ ### Changed
57
+
58
+ - `createGenerationTarget` initializes an eligible default Draft in the same undoable interaction;
59
+ prompt-only `editGenerationDraft` uses the same resolver when a historical target has no Draft.
60
+ - Generation plans preserve their effective prompt and configuration when input modality switches
61
+ to another Workflow Definition and rebuilds the target Draft.
62
+ - Workflow summary, defaults, planning, reference edits, and generation start reject Definitions
63
+ unavailable to the authenticated account. `available:free` is treated only as free-tier access,
64
+ never as pricing evidence.
65
+ - Agent guidance prioritizes one foreground `session watch`, early visible targets, authoritative
66
+ planning, and explicit reconciliation instead of polling, guessed At syntax, or write retries.
67
+
68
+ ### Safety and compatibility
69
+
70
+ - Public writes remain semantic Operations backed by internal Commands. No Workflow preference,
71
+ access rule, or Watch enrichment grants a raw Canvas mutation path.
72
+ - Local preferences contain only a Definition id and sanitized scalar config values; they never
73
+ contain credentials, prompts, media URLs, or Project data.
74
+ - Stable protocol `1.0`, sequential write blocking, no automatic write retry, and explicit
75
+ generation acceptance/completion boundaries remain unchanged from `0.2.0`.
76
+
8
77
  ## 0.3.0-preview.3 - 2026-07-23
9
78
 
10
79
  ### Added
package/README.md CHANGED
@@ -15,10 +15,10 @@ az8 help
15
15
  az8 guide
16
16
  ```
17
17
 
18
- For a supplied preview artifact, install the exact immutable tarball instead:
18
+ For a supplied release artifact, install the exact immutable tarball instead:
19
19
 
20
20
  ```bash
21
- npm install --global ./everfir-az8-cli-0.3.0-preview.3.tgz
21
+ npm install --global ./everfir-az8-cli-0.4.0.tgz
22
22
  az8 --version
23
23
  ```
24
24
 
@@ -40,15 +40,30 @@ az8 guide --format json
40
40
  ```
41
41
 
42
42
  The guide teaches discovery; it does not freeze dynamic product schemas. After selecting a Project,
43
- the agent must query `capabilities.summary` and `capabilities.detail` for the effective Operations,
44
- permissions, input schema, History, completion, and retry semantics of the installed version and
45
- current account. Workflow Definition queries and `planGeneration` remain authoritative for current
46
- generation inputs.
43
+ the agent must query `capabilities.summary`, then focused `capabilities.detail --operation-name`
44
+ responses for the effective Operations, permissions, input schema, History, completion, and retry
45
+ semantics of the installed version and current account. Workflow Definition queries and
46
+ `planGeneration` remain authoritative for current generation inputs.
47
47
 
48
48
  ## Credentials and environment
49
49
 
50
- Credentials must be provisioned outside the agent's recorded interaction. Use an ignored
51
- `.env.local`, an explicit env-file path, or an inherited process environment:
50
+ Use browser authorization for the default local account:
51
+
52
+ ```bash
53
+ az8 login --environment test
54
+ az8 whoami --environment test
55
+ az8 logout --environment test
56
+ ```
57
+
58
+ `login` opens `studio.az8.studio` or `studio.az8.art`, waits for explicit approval, validates the
59
+ issued account, and stores the credential in the current operating-system user's private AZ8 CLI
60
+ state directory. `whoami` reports the active account and credential source without exposing the
61
+ token. `logout` closes daemon Sessions that depend on that local credential and removes it locally;
62
+ it does not revoke copies on other machines. Use `login --no-open` when the browser must be opened
63
+ manually; the verification URL is emitted as structured progress on stderr.
64
+
65
+ Externally provisioned credentials remain supported for automation. Use an ignored `.env.local`,
66
+ an explicit env-file path, or an inherited process environment:
52
67
 
53
68
  ```dotenv
54
69
  AZ8_TOKEN=<operator-provisioned-secret>
@@ -58,9 +73,10 @@ AZ8_ENVIRONMENT=test
58
73
  `AZ8_ENVIRONMENT` accepts `test` or `production`. Command-line `--environment` overrides the env
59
74
  value. Without `--env-file`, the CLI searches from the working directory upward for `.env.local`.
60
75
  An explicit file is selected by path, for example
61
- `--environment test --env-file /secure/path/.env.local`. Agents must not read, print, edit, or ask
62
- users to paste credential contents; verify authentication with a bounded `projects list` read.
63
- Tokens must not be passed through argv or stdio protocol payloads.
76
+ `--environment test --env-file /secure/path/.env.local`. Process-environment credentials take
77
+ precedence over env files, which take precedence over the locally saved login. The CLI never
78
+ rewrites an env file or inherited environment. Agents must not read, print, edit, or ask users to
79
+ paste credential contents. Tokens must not be passed through argv or stdio protocol payloads.
64
80
 
65
81
  ## CLI architecture
66
82
 
@@ -69,7 +85,8 @@ validation boundary. CLI-specific code is organized by responsibility:
69
85
 
70
86
  - `src/cli/` owns program assembly, runtime config, persistent stdio transport, output framing, and
71
87
  package version resolution.
72
- - `src/commands/` declares Project, Canvas, and guide commands.
88
+ - `src/auth/` owns browser authorization, account-service exchange, and private local credentials.
89
+ - `src/commands/` declares account, Project, Canvas, and guide commands.
73
90
  - `src/agent-session/` owns isolated daemon lifecycles, local Session discovery, the private RPC
74
91
  carrier, Watch delivery, and current-context selection.
75
92
  - `src/canvas/` owns collaboration sessions, one-shot execution, awareness, and the NDJSON
@@ -100,10 +117,11 @@ indeterminate.
100
117
 
101
118
  ## First agent loop
102
119
 
103
- A new agent needs only the installed package, a token, and this document. Start by creating its own
104
- Project, then open one daemon-backed Agent Collaboration Session:
120
+ A new agent needs only the installed package, an authorized account, and this document. Confirm the
121
+ active identity, then create its own Project and open one daemon-backed Agent Collaboration Session:
105
122
 
106
123
  ```bash
124
+ az8 whoami --environment test
107
125
  az8 projects create --name "Agent preview workspace"
108
126
  az8 session open <project-id> --environment test
109
127
  az8 session query capabilities.summary
@@ -148,14 +166,16 @@ the CLI's local observation-to-delivery delay; neither includes speech recogniti
148
166
  host's scheduling time. Repeat only a small bounded sample, keep the Session open between trials,
149
167
  and remove the temporary Interest or close the Session afterward.
150
168
 
151
- For generation, create a target with `createGenerationTarget` (including `contentType: "text"`) and
152
- call `planGeneration` with the returned View Node and a prompt. Execute its returned
169
+ For generation, create a target with `createGenerationTarget` (including `contentType: "text"`).
170
+ Creation initializes an account-eligible default Draft when available and reports
171
+ `draftInitialized`, `definitionId`, and `selectionSource`; it never starts generation. Call
172
+ `planGeneration` with the returned View Node and a prompt. Execute its returned
153
173
  `plan.operations` in order, stopping after the first failure. A
154
174
  successful `startGeneration` Receipt contains the Workflow Run identity; call `waitWorkflowRun`
155
175
  separately when a terminal output is required. Planning and starting are intentionally not one
156
176
  transaction. In an active Session, prefer one foreground `session watch`: the system terminal event
157
- includes Workflow Run, target View Node, and output Core Node identities when supplied by Workflow
158
- Runtime.
177
+ includes the target View Node only when it can be mapped uniquely from authoritative launch or
178
+ Canvas History facts; unresolved or ambiguous mappings are reported rather than guessed.
159
179
 
160
180
  For media transfer, `canvas upload` places a verified local image/video/audio file through the
161
181
  server-owned Core Node path. After detail query resolves the target's `resolvedCoreNodeId`, `canvas
@@ -292,7 +312,7 @@ az8 canvas open <project-id> --write --format ndjson [--client-name codex]
292
312
  The process writes one `hello` frame, then waits for an `initialize` request on stdin:
293
313
 
294
314
  ```json
295
- {"protocolVersion":"1.0","requestId":"init-1","type":"initialize","payload":{"projectId":"<project-id>","client":{"name":"my-agent"},"observationPreset":"compact"}}
315
+ {"protocolVersion":"1.1","requestId":"init-1","type":"initialize","payload":{"projectId":"<project-id>","client":{"name":"my-agent"},"observationPreset":"compact"}}
296
316
  ```
297
317
 
298
318
  Before readiness the client hydrates the current authenticated account profile. Canvas Operations use
@@ -313,9 +333,24 @@ Node hierarchy operations, and the Stage 3 Core Node creative loop. Note operati
313
333
  `createGenerationTarget`, the compatible non-text `createMediaTarget`, `planGeneration`,
314
334
  `importExternalMedia`, `uploadMedia`, `editGenerationDraft`,
315
335
  `addVisualReference`, `removeVisualReference`, `startGeneration`, `getWorkflowRun`, and
316
- `waitWorkflowRun`. Capability detail is discoverable through `capabilities.detail`; callers should
317
- use it instead of hard-coding input schemas. Workflow Definitions are available through
318
- `workflowDefinitions.summary` and `workflowDefinition.detail` queries.
336
+ `waitWorkflowRun`. Capability detail is discoverable through
337
+ `capabilities.detail --operation-name <operation-name>`; callers should select only the Operation
338
+ they plan to invoke instead of loading every schema or hard-coding inputs. Workflow Definitions are
339
+ available through `workflowDefinitions.summary` and `workflowDefinition.detail` queries.
340
+ `workflowDefinitions.summary` always returns a compact paginated catalog with a default page size of
341
+ 10, target counts, and an opaque next cursor; use `--workflow-target`, `--page-size`, and `--cursor`
342
+ to narrow or continue it. Summary discovery, default Drafts, planning, and generation start use only
343
+ Definitions available to the authenticated account. Detail may retain an unavailable historical
344
+ Definition for diagnosis with `availableForAccount: false` and an `accessReason`.
345
+
346
+ Workflow tags describe classification, compatibility, access, and rollout rather than price.
347
+ `available:free` means a free-tier account may select the Workflow; it does not mean zero-credit
348
+ generation. Credit claims must come from planning/start estimates or terminal usage records.
349
+
350
+ `getCoreNode` requires a non-empty unique `coreNodeIds` batch and returns `coreNodes` in the same
351
+ order. If any requested Core Node does not exist, the whole read fails instead of returning an
352
+ ambiguous partial result. The CLI adapter uses the backend's batch endpoint and transparently chunks
353
+ large requests.
319
354
 
320
355
  Before editing a Draft, an agent can call the read-only `planGeneration` Operation for an existing
321
356
  generation target. It recommends a Definition from the target and resolved generation-reference modalities,
@@ -325,15 +360,18 @@ field metadata, including dynamic enum options. Planning never creates a Core No
325
360
  Canvas; returned Operations still execute independently and stop at the first failure.
326
361
 
327
362
  Generation references always identify visible Canvas placements. Public planning and
328
- `addVisualReference` accept only a View Node ID. If desired content exists only as a Core Node, call
363
+ `addVisualReference` accept only View Node IDs. `addVisualReference` requires a non-empty unique
364
+ `referenceViewNodeIds` batch; `removeVisualReference` requires a non-empty unique `referenceIds`
365
+ batch. Both Operations validate the complete batch before one atomic Draft write, so a failure never
366
+ leaves a partial batch. If desired content exists only as a Core Node, call
329
367
  `placeCoreNode` first, wait for its successful Receipt, and reference the returned View Node. This
330
368
  preserves the same visible inferred connection as Web and avoids guessing when one Core Node has
331
369
  multiple Canvas placements. Manual Text Resources are valid prompt references even though they do
332
370
  not have a Core Node before generation starts. Their View Node binding remains in the launch history
333
371
  for Web lineage and inferred-edge rendering; estimation uses the current text and materialization
334
372
  creates the Text Core Node only after the estimate succeeds. The published operation names
335
- `addVisualReference` and `removeVisualReference` are retained for compatibility and also carry these
336
- planned Text bindings.
373
+ `addVisualReference` and `removeVisualReference` cover these planned Text bindings as well as image
374
+ and video bindings.
337
375
 
338
376
  `insertPromptReference` additionally places the platform-owned At token at `start`, `end`, or
339
377
  before/after an exact text anchor such as
@@ -342,7 +380,7 @@ only for a unique anchor. Missing or ambiguous anchors fail without writing. Cal
342
380
  At syntax, binding IDs, or slot indexes.
343
381
 
344
382
  ```json
345
- {"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"}}}
383
+ {"protocolVersion":"1.1","requestId":"plan-1","type":"operation","payload":{"name":"planGeneration","input":{"targetViewNodeId":"<target-id>","prompt":"A quiet observatory","references":[{"viewNodeId":"<reference-id>"}],"detail":"detail"}}}
346
384
  ```
347
385
 
348
386
  `editNoteContent`, `setNoteColor`, `editTextContent`, `renameViewNode`, and `resizeViewNodes` match
@@ -361,41 +399,41 @@ is scoped to siblings with the same parent. Decoration, Asset, and all World tar
361
399
  Example write:
362
400
 
363
401
  ```json
364
- {"protocolVersion":"1.0","requestId":"create-1","type":"operation","payload":{"name":"createNote","input":{"text":"idea","position":{"x":160,"y":160}}}}
402
+ {"protocolVersion":"1.1","requestId":"create-1","type":"operation","payload":{"name":"createNote","input":{"text":"idea","position":{"x":160,"y":160}}}}
365
403
  ```
366
404
 
367
405
  Example Stage 2 edits:
368
406
 
369
407
  ```json
370
- {"protocolVersion":"1.0","requestId":"edit-1","type":"operation","payload":{"name":"editNoteContent","input":{"viewNodeId":"view_node_1","text":"revised idea"}}}
371
- {"protocolVersion":"1.0","requestId":"color-1","type":"operation","payload":{"name":"setNoteColor","input":{"viewNodeId":"view_node_1","color":"purple"}}}
372
- {"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}}}}}
373
- {"protocolVersion":"1.0","requestId":"resize-1","type":"operation","payload":{"name":"resizeViewNodes","input":{"resizes":[{"viewNodeId":"view_node_1","size":{"width":420,"height":360}}]}}}
374
- {"protocolVersion":"1.0","requestId":"duplicate-1","type":"operation","payload":{"name":"duplicateViewNodes","input":{"viewNodeIds":["view_node_1"]}}}
408
+ {"protocolVersion":"1.1","requestId":"edit-1","type":"operation","payload":{"name":"editNoteContent","input":{"viewNodeId":"view_node_1","text":"revised idea"}}}
409
+ {"protocolVersion":"1.1","requestId":"color-1","type":"operation","payload":{"name":"setNoteColor","input":{"viewNodeId":"view_node_1","color":"purple"}}}
410
+ {"protocolVersion":"1.1","requestId":"text-1","type":"operation","payload":{"name":"createTextNode","input":{"text":"A manual Text Resource","name":"Draft copy","position":{"x":520,"y":160}}}}}
411
+ {"protocolVersion":"1.1","requestId":"resize-1","type":"operation","payload":{"name":"resizeViewNodes","input":{"resizes":[{"viewNodeId":"view_node_1","size":{"width":420,"height":360}}]}}}
412
+ {"protocolVersion":"1.1","requestId":"duplicate-1","type":"operation","payload":{"name":"duplicateViewNodes","input":{"viewNodeIds":["view_node_1"]}}}
375
413
  ```
376
414
 
377
415
  Example hierarchy sequence (each successful write is one independent undoable interaction):
378
416
 
379
417
  ```json
380
- {"protocolVersion":"1.0","requestId":"group-1","type":"operation","payload":{"name":"groupViewNodes","input":{"viewNodeIds":["view_node_1","view_node_2"],"name":"References"}}}
381
- {"protocolVersion":"1.0","requestId":"reparent-1","type":"operation","payload":{"name":"moveViewNodes","input":{"moves":[{"id":"view_node_3","position":{"x":640,"y":360},"targetParentId":"<group-id>"}]}}}
382
- {"protocolVersion":"1.0","requestId":"front-1","type":"operation","payload":{"name":"updateViewNodeStacking","input":{"viewNodeId":"view_node_3","direction":"front"}}}
383
- {"protocolVersion":"1.0","requestId":"ungroup-1","type":"operation","payload":{"name":"ungroupViewNode","input":{"groupViewNodeId":"<group-id>"}}}
418
+ {"protocolVersion":"1.1","requestId":"group-1","type":"operation","payload":{"name":"groupViewNodes","input":{"viewNodeIds":["view_node_1","view_node_2"],"name":"References"}}}
419
+ {"protocolVersion":"1.1","requestId":"reparent-1","type":"operation","payload":{"name":"moveViewNodes","input":{"moves":[{"id":"view_node_3","position":{"x":640,"y":360},"targetParentId":"<group-id>"}]}}}
420
+ {"protocolVersion":"1.1","requestId":"front-1","type":"operation","payload":{"name":"updateViewNodeStacking","input":{"viewNodeId":"view_node_3","direction":"front"}}}
421
+ {"protocolVersion":"1.1","requestId":"ungroup-1","type":"operation","payload":{"name":"ungroupViewNode","input":{"groupViewNodeId":"<group-id>"}}}
384
422
  ```
385
423
 
386
424
  Example Stage 3 generation sequence (each line is a separate ordered interaction):
387
425
 
388
426
  ```json
389
- {"protocolVersion":"1.0","requestId":"target-1","type":"operation","payload":{"name":"createGenerationTarget","input":{"contentType":"image"}}}
390
- {"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"}}}}
391
- {"protocolVersion":"1.0","requestId":"start-1","type":"operation","payload":{"name":"startGeneration","input":{"viewNodeId":"<target-id>"}}}
392
- {"protocolVersion":"1.0","requestId":"wait-1","type":"operation","payload":{"name":"waitWorkflowRun","input":{"workflowRunId":"<run-id>"},"timeoutMs":120000}}
427
+ {"protocolVersion":"1.1","requestId":"target-1","type":"operation","payload":{"name":"createGenerationTarget","input":{"contentType":"image"}}}
428
+ {"protocolVersion":"1.1","requestId":"draft-1","type":"operation","payload":{"name":"editGenerationDraft","input":{"viewNodeId":"<target-id>","definitionId":"<definition-id>","prompt":"A quiet observatory","config":{"aspect_ratio":"16:9"}}}}
429
+ {"protocolVersion":"1.1","requestId":"start-1","type":"operation","payload":{"name":"startGeneration","input":{"viewNodeId":"<target-id>"}}}
430
+ {"protocolVersion":"1.1","requestId":"wait-1","type":"operation","payload":{"name":"waitWorkflowRun","input":{"workflowRunId":"<run-id>"},"timeoutMs":120000}}
393
431
  ```
394
432
 
395
433
  Example public media URL import:
396
434
 
397
435
  ```json
398
- {"protocolVersion":"1.0","requestId":"import-1","type":"operation","payload":{"name":"importExternalMedia","input":{"contentType":"image","idempotencyKey":"reference-image-1","url":"https://example.com/reference.png","name":"Reference image","position":{"x":640,"y":160}}}}
436
+ {"protocolVersion":"1.1","requestId":"import-1","type":"operation","payload":{"name":"importExternalMedia","input":{"contentType":"image","idempotencyKey":"reference-image-1","url":"https://example.com/reference.png","name":"Reference image","position":{"x":640,"y":160}}}}
399
437
  ```
400
438
 
401
439
  `idempotencyKey` is required. Repeating the same normalized input returns the existing View Node and
package/RELEASE.md CHANGED
@@ -57,18 +57,18 @@ Before publishing, also run the test-environment acceptance checklist in the pac
57
57
  repository-wide `pnpm verify`. Publishing is an external action and requires explicit operator
58
58
  authorization:
59
59
 
60
- For a preview candidate, publish the exact retained artifact to the preview channel:
60
+ For the `0.4.0` stable candidate, publish the exact retained artifact to the stable channel only
61
+ after its test-environment acceptance succeeds:
61
62
 
62
63
  ```bash
63
- npm publish ./tmp/az8-cli-release/everfir-az8-cli-0.3.0-preview.3.tgz --tag preview
64
+ npm publish ./tmp/az8-cli-release/everfir-az8-cli-0.4.0.tgz --tag latest
64
65
  npm view @everfir/az8-cli dist-tags versions --json
65
66
  ```
66
67
 
67
68
  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
71
- version:
69
+ Do not publish from an unverified source directory, retag a preview artifact as stable, or rebuild
70
+ after acceptance. If the obsolete misspelled `prewview` tag still exists, remove that tag without
71
+ unpublishing its immutable version:
72
72
 
73
73
  ```bash
74
74
  npm dist-tag rm @everfir/az8-cli prewview