@everfir/az8-cli 0.2.0-preview.5 → 0.3.0-preview.1
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 +64 -0
- package/README.md +118 -41
- package/RELEASE.md +47 -13
- package/dist/main.js +24300 -4035
- package/package.json +9 -6
- package/skills/az8-cli/SKILL.md +117 -41
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everfir/az8-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-preview.1",
|
|
4
4
|
"description": "Semantic Project Canvas client for AZ8 Studio agents.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -19,17 +19,18 @@
|
|
|
19
19
|
"tag": "preview"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "rm -rf dist && esbuild src/main.ts --bundle --platform=node --format=esm --target=
|
|
22
|
+
"build": "pnpm build:dependencies && rm -rf dist && esbuild src/main.ts --bundle --platform=node --format=esm --target=node22.12 --banner:js='import { createRequire } from \"node:module\"; const require = createRequire(import.meta.url);' --outfile=dist/main.js",
|
|
23
|
+
"build:dependencies": "pnpm --filter @everfir/az8-cli^... build",
|
|
23
24
|
"dev": "tsx src/main.ts",
|
|
24
25
|
"start": "node dist/main.js",
|
|
25
26
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
26
27
|
"lint": "biome check .",
|
|
27
28
|
"prepack": "pnpm build",
|
|
28
29
|
"prepublishOnly": "pnpm release:check",
|
|
29
|
-
"release:check": "pnpm test && pnpm typecheck && node scripts/verify-package.js",
|
|
30
|
+
"release:check": "pnpm build:dependencies && pnpm test && pnpm typecheck && node scripts/verify-package.js",
|
|
30
31
|
"release:pack": "node scripts/verify-package.js --output-dir ../../tmp/az8-cli-release --keep-install",
|
|
31
32
|
"release:smoke": "node scripts/smoke-test.js",
|
|
32
|
-
"test": "tsx --tsconfig tsconfig.test.json --test src/**/*.test.ts"
|
|
33
|
+
"test": "tsx --tsconfig tsconfig.test.json --test src/**/*.test.ts && node --test scripts/*.test.js"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"@types/node": "^25.5.0",
|
|
@@ -47,9 +48,11 @@
|
|
|
47
48
|
"yjs": "^13.6.30"
|
|
48
49
|
},
|
|
49
50
|
"engines": {
|
|
50
|
-
"node": ">=
|
|
51
|
+
"node": ">=22.12.0"
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
|
-
"
|
|
54
|
+
"commander": "^15.0.0",
|
|
55
|
+
"file-type": "^21.3.4",
|
|
56
|
+
"zod": "^4.4.3"
|
|
54
57
|
}
|
|
55
58
|
}
|
package/skills/az8-cli/SKILL.md
CHANGED
|
@@ -11,8 +11,9 @@ capabilities instead of guessing operation names or input shapes.
|
|
|
11
11
|
|
|
12
12
|
## Contract
|
|
13
13
|
|
|
14
|
-
- Use only public `az8 projects` and `az8 canvas` commands. Never mutate backend
|
|
15
|
-
Collaborative Document fields, Core Node payloads, or Project Content bindings
|
|
14
|
+
- Use only public `az8 projects`, `az8 session`, and `az8 canvas` commands. Never mutate backend
|
|
15
|
+
records, Yjs, Collaborative Document fields, Core Node payloads, or Project Content bindings
|
|
16
|
+
directly.
|
|
16
17
|
- Explicitly select `test` or `production`. Never infer authorization to write production data.
|
|
17
18
|
- Read the relevant Canvas facts before planning a write. Submit one semantic Operation at a time.
|
|
18
19
|
- Treat every accepted write as a blocker: wait for its terminal Receipt before issuing any later
|
|
@@ -33,7 +34,13 @@ capabilities instead of guessing operation names or input shapes.
|
|
|
33
34
|
has its own connection, lifecycle, projection, History, Receipt Log, and Awareness identity.
|
|
34
35
|
- **View Node** is a Canvas placement: note, group, or resource target with position, size, parent,
|
|
35
36
|
stacking, Draft, and presentation state.
|
|
36
|
-
- **
|
|
37
|
+
- **Note** is a sticky Canvas annotation. Its content uses `createNote` and `editNoteContent`; its
|
|
38
|
+
optional accent uses `setNoteColor` with only `blue`, `orange`, `red`, `gold`, `purple`, or
|
|
39
|
+
`green`. A Note is not a Text Resource.
|
|
40
|
+
- **Text Resource** is creative text content. Use `createTextNode` and `editTextContent` for manual
|
|
41
|
+
text, or `createGenerationTarget` with `contentType: "text"` for generated text. Do not represent
|
|
42
|
+
requested Text content by creating a Note.
|
|
43
|
+
- **Core Node** is immutable or server-owned creative content such as text, image, video, or audio.
|
|
37
44
|
Resource View Nodes resolve Core Nodes through Project Content. Do not manufacture Core Nodes or
|
|
38
45
|
bindings.
|
|
39
46
|
- **Project Content** is the authority that associates a View Node target with its effective Core
|
|
@@ -99,12 +106,22 @@ capabilities instead of guessing operation names or input shapes.
|
|
|
99
106
|
|
|
100
107
|
Retain the returned Project ID. Confirm the authenticated role before assuming write access.
|
|
101
108
|
|
|
102
|
-
4.
|
|
109
|
+
4. Choose the Canvas carrier before discovery. If the task may perform any Canvas write, open one
|
|
110
|
+
daemon-backed Agent Collaboration Session now and retain it through the authoring task:
|
|
103
111
|
|
|
104
112
|
```bash
|
|
105
|
-
az8
|
|
106
|
-
az8
|
|
107
|
-
az8
|
|
113
|
+
az8 session open <project-id> --environment test
|
|
114
|
+
az8 session query capabilities.summary
|
|
115
|
+
az8 session query capabilities.detail
|
|
116
|
+
az8 session query canvas.summary
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
For an isolated read-only task, use the process-independent query instead and do not open a
|
|
120
|
+
Session merely to retain unused state:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
az8 canvas query <project-id> capabilities.summary --environment test
|
|
124
|
+
az8 canvas query <project-id> canvas.summary --environment test
|
|
108
125
|
```
|
|
109
126
|
|
|
110
127
|
`capabilities.summary` is the short menu. `capabilities.detail` is authoritative for exact JSON
|
|
@@ -114,41 +131,82 @@ capabilities instead of guessing operation names or input shapes.
|
|
|
114
131
|
5. Use `canvas.detail` only when exact node geometry, Draft, status, or bindings are needed:
|
|
115
132
|
|
|
116
133
|
```bash
|
|
117
|
-
az8
|
|
134
|
+
az8 session query canvas.detail --view-node-id <view-node-id>
|
|
118
135
|
```
|
|
119
136
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
than trusting visual assumptions.
|
|
137
|
+
For the isolated read-only carrier, use `az8 canvas query <project-id> canvas.detail` with the
|
|
138
|
+
same selector. Opening a Session selects it for the current canonical working directory, so
|
|
139
|
+
later Session commands do not repeat its ID. Finish by inspecting affected View Nodes or
|
|
140
|
+
Workflow Runs, then close any opened Session rather than trusting visual assumptions.
|
|
124
141
|
|
|
125
142
|
## Interaction modes
|
|
126
143
|
|
|
127
|
-
Default to
|
|
128
|
-
is the normal mode whenever a task may create, edit, move, organize, remove,
|
|
129
|
-
or upload Canvas content.
|
|
130
|
-
|
|
144
|
+
Default to a daemon-backed Agent Collaboration Session for Canvas authoring. A one-write plan still
|
|
145
|
+
uses a Session. This is the normal mode whenever a task may create, edit, move, organize, remove,
|
|
146
|
+
undo, generate, import, or upload Canvas content. One private local daemon retains the authenticated
|
|
147
|
+
connection, Awareness, History, Receipts, Interests, and Watch Journal across ordinary short CLI
|
|
148
|
+
calls:
|
|
131
149
|
|
|
132
150
|
```bash
|
|
133
|
-
az8
|
|
151
|
+
az8 session open <project-id> --environment test
|
|
152
|
+
az8 session current
|
|
153
|
+
az8 session status
|
|
134
154
|
```
|
|
135
155
|
|
|
136
156
|
Use `--client-name <suffix>` only when a more specific CLI presence label helps collaborators. The
|
|
137
157
|
CLI owns the surrounding parentheses, rejects parentheses in the supplied suffix, and always keeps
|
|
138
158
|
the authenticated user display name first.
|
|
139
159
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
160
|
+
Session resolution is explicit and discoverable. A command-level `--session <id>` wins, then
|
|
161
|
+
`AZ8_SESSION_ID`, then the current Session for the local context. Use `AZ8_CONTEXT` to separate
|
|
162
|
+
parallel Agents intentionally sharing one working directory. `session list`, `current`, `status`,
|
|
163
|
+
and `use` must be used whenever the binding is uncertain; never guess a Session or Project.
|
|
164
|
+
|
|
165
|
+
Configure named semantic Interests once, then use the singular blocking Watch instead of polling:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
az8 session interests patch --input-json '{"upsert":[{"key":"canvas-ambient","patch":{"kind":"canvas"}},{"key":"workflow-terminal","patch":{"kind":"workflow"}}]}'
|
|
169
|
+
az8 session watch --timeout-ms 30000
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
- 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.
|
|
174
|
+
- `idle` ends one observation window normally. It does not indicate a failed connection or Run.
|
|
175
|
+
- `resync-required` means bounded continuity was lost. Query authoritative summary/detail, then run
|
|
176
|
+
`az8 session resynchronize`; never pretend the missing interval was observed.
|
|
177
|
+
- Exactly one consumer may wait on a Session. The daemon does not wake or restart an Agent that has
|
|
178
|
+
exited; it only completes an active `session watch` call.
|
|
179
|
+
- Watch acknowledgement is internal. If stdout delivery is interrupted before confirmation, the
|
|
180
|
+
same result may repeat. Treat repeat delivery as at-least-once readiness, not a new business fact.
|
|
181
|
+
- Queries wait behind an executing write. Watch collection remains independent of the write lane.
|
|
182
|
+
|
|
183
|
+
For a bounded human–Agent latency check, report readiness first, start
|
|
184
|
+
`az8 session watch --timeout-ms 60000`, and ask the human to make one recognizable Web Canvas change
|
|
185
|
+
only after the wait is active. Acknowledge the returned semantic change immediately, then wait again
|
|
186
|
+
for the next trial. `result.timing.waitedMs` measures the blocking window and each change's
|
|
187
|
+
`quietForMs` measures local observation-to-delivery delay; neither includes speech recognition or
|
|
188
|
+
Agent-host scheduling. Do not infer an end-to-end latency number from either field alone.
|
|
189
|
+
|
|
190
|
+
Execute reads and writes through the selected Session:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
az8 session query canvas.detail --view-node-id <view-node-id>
|
|
194
|
+
az8 session operation createNote --request-id <unique-id> \
|
|
195
|
+
--input-json '{"name":"Plan","content":"...","position":{"x":80,"y":80}}'
|
|
196
|
+
az8 session query receipt.detail --receipt-request-id <unique-id>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Every Session Operation returns one terminal Receipt. Keep writes sequential and stop after the
|
|
200
|
+
first failed or indeterminate Receipt. Close the Session explicitly when collaboration is complete:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
az8 session close
|
|
204
|
+
```
|
|
149
205
|
|
|
150
|
-
|
|
151
|
-
|
|
206
|
+
`az8 canvas open <project-id> --write --format ndjson` remains the lower-level persistent stdio
|
|
207
|
+
surface for a host that deliberately owns and continuously drains one child process. It has the
|
|
208
|
+
same semantic capabilities, but ordinary Agents should prefer `az8 session` and should not manually
|
|
209
|
+
implement its daemon behavior.
|
|
152
210
|
|
|
153
211
|
Use one-shot only for:
|
|
154
212
|
|
|
@@ -156,12 +214,12 @@ Use one-shot only for:
|
|
|
156
214
|
- a standalone media download;
|
|
157
215
|
- an explicitly standalone upload/import whose caller does not want an ongoing authoring session;
|
|
158
216
|
- an explicit user request for one-shot behavior; or
|
|
159
|
-
- a
|
|
217
|
+
- a platform that cannot run the local Session daemon or persistent stdio carrier.
|
|
160
218
|
|
|
161
219
|
Do not choose one-shot merely because the current plan has one write or because it requires fewer
|
|
162
|
-
tool calls. Codex and
|
|
163
|
-
limitation forces fallback, disclose that the client will not preserve local History,
|
|
164
|
-
Awareness, observations, or request replay across invocations.
|
|
220
|
+
tool calls. Codex and ordinary shell hosts can use daemon-backed Sessions without retaining stdin.
|
|
221
|
+
If a host limitation forces fallback, disclose that the client will not preserve local History,
|
|
222
|
+
Receipt Log, Awareness, observations, or request replay across invocations.
|
|
165
223
|
|
|
166
224
|
For a permitted one-shot call, supply Operation input through exactly one of `--input-stdin`,
|
|
167
225
|
`--input-file`, or `--input-json`, give every write a meaningful unique `--request-id`, and retain its
|
|
@@ -179,8 +237,9 @@ one-shot processes.
|
|
|
179
237
|
work depends on its exact state.
|
|
180
238
|
6. Only then plan the next interaction.
|
|
181
239
|
|
|
182
|
-
Common capabilities include notes, move/resize/rename, duplicate/remove,
|
|
183
|
-
Node placement, and
|
|
240
|
+
Common capabilities include notes, manual Text Resources, move/resize/rename, duplicate/remove,
|
|
241
|
+
groups and stacking, Core Node placement, and generation targets. The runtime catalog is
|
|
242
|
+
authoritative. Group nodes cannot nest;
|
|
184
243
|
stacking applies only among siblings. Unsupported World, Decoration, Asset, alignment, and automatic
|
|
185
244
|
layout behavior must not be simulated through lower-level writes.
|
|
186
245
|
|
|
@@ -192,19 +251,36 @@ entries. Never use compensating low-level mutations to imitate undo.
|
|
|
192
251
|
|
|
193
252
|
Generation is an explicit sequence, never one transaction:
|
|
194
253
|
|
|
195
|
-
1. Create a target with `
|
|
254
|
+
1. Create a target with `createGenerationTarget` and retain its View Node ID. It accepts `audio`,
|
|
255
|
+
`image`, `text`, or `video`; `createMediaTarget` remains a compatibility capability for non-text
|
|
256
|
+
targets when advertised.
|
|
196
257
|
2. Call the read-only `planGeneration` Operation with the target, prompt, and any references. Use
|
|
197
258
|
`detail: "detail"` when configuration fields or dynamic enum options are needed.
|
|
259
|
+
Every reference must be `{ "viewNodeId": "..." }`. If the desired Core Node is not currently
|
|
260
|
+
on the Canvas, first call `placeCoreNode`, wait for its successful Receipt, and use the returned
|
|
261
|
+
View Node ID. Never pass a Core Node ID as a generation reference or silently choose among
|
|
262
|
+
multiple placements of the same Core Node. A manual Text Resource is also a valid reference:
|
|
263
|
+
pass its View Node ID instead of copying its text into `prompt`. Planning reads its current text,
|
|
264
|
+
the Draft retains the View Node binding for Web lineage and connection rendering, and
|
|
265
|
+
`startGeneration` materializes the Text Core Node only after estimation succeeds. The stable
|
|
266
|
+
operation names `addVisualReference` and `removeVisualReference` cover these planned Text
|
|
267
|
+
bindings as well as image/video bindings; execute the names returned by the plan rather than
|
|
268
|
+
interpreting them literally.
|
|
198
269
|
3. If the plan reports blocking issues, resolve them and plan again. Do not execute a non-ready
|
|
199
270
|
plan.
|
|
200
271
|
4. Execute `plan.operations` exactly in order, one Operation at a time. Each step revalidates
|
|
201
272
|
current facts. Stop after the first non-success.
|
|
202
273
|
5. `startGeneration` succeeds when the Workflow Run is accepted and immediate Canvas effects are
|
|
203
274
|
acknowledged. This completes the start interaction; it does not mean generation finished.
|
|
204
|
-
6. Retain the Workflow Run ID.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
7.
|
|
275
|
+
6. Retain the Workflow Run ID. After the successful start Receipt, continue any work that does not
|
|
276
|
+
require the generated output. Prefer `workflowChanged` observations while the persistent client
|
|
277
|
+
is active, and use `getWorkflowRun` at a meaningful later checkpoint.
|
|
278
|
+
7. Use `waitWorkflowRun` only when the next step actually requires terminal output and the current
|
|
279
|
+
request lane can remain dedicated to waiting. Choose one intentional observation window; do not
|
|
280
|
+
emulate polling with repeated short waits. An observation-window timeout while the authoritative
|
|
281
|
+
Run remains pending/running is an ordinary read outcome and does not cancel the Run or take a
|
|
282
|
+
healthy context offline.
|
|
283
|
+
8. On terminal success, query the target detail and resolve its current output Core Node through
|
|
208
284
|
Project Content before downloading or placing it elsewhere.
|
|
209
285
|
|
|
210
286
|
Workflow Definitions change over time. Query `workflowDefinitions.summary`, then
|
|
@@ -315,8 +391,8 @@ Before reporting a task complete, verify all applicable facts:
|
|
|
315
391
|
- Generation start and generation completion were reported as separate interactions; the target's
|
|
316
392
|
effective Core Node was resolved after completion.
|
|
317
393
|
- Media transfers were verified by identities and checksums without exposing URLs or credentials.
|
|
318
|
-
-
|
|
319
|
-
was disclosed.
|
|
394
|
+
- The daemon-backed Session was closed explicitly (or persistent stdio was shut down in order), and
|
|
395
|
+
any abnormal termination or uncertain active write was disclosed.
|
|
320
396
|
- Deferred scopes were not approximated by bypassing the public semantic surface.
|
|
321
397
|
|
|
322
398
|
When any item cannot be proven, report the uncertainty and the next safe read or reconciliation
|