@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 +66 -0
- package/README.md +112 -35
- package/RELEASE.md +20 -5
- package/dist/main.js +27746 -7059
- package/package.json +7 -5
- package/skills/az8-cli/SKILL.md +139 -60
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.2",
|
|
4
4
|
"description": "Semantic Project Canvas client for AZ8 Studio agents.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"main": "./dist/main.js",
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public",
|
|
19
|
-
"tag": "
|
|
19
|
+
"tag": "preview"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "pnpm build:dependencies && 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
23
|
"build:dependencies": "pnpm --filter @everfir/az8-cli^... build",
|
|
24
24
|
"dev": "tsx src/main.ts",
|
|
25
25
|
"start": "node dist/main.js",
|
|
@@ -48,9 +48,11 @@
|
|
|
48
48
|
"yjs": "^13.6.30"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
|
-
"node": ">=
|
|
51
|
+
"node": ">=22.12.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"
|
|
54
|
+
"commander": "^15.0.0",
|
|
55
|
+
"file-type": "^21.3.4",
|
|
56
|
+
"zod": "^4.4.3"
|
|
55
57
|
}
|
|
56
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,59 +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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
-
|
|
156
|
-
`
|
|
157
|
-
-
|
|
158
|
-
|
|
159
|
-
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
+
```
|
|
205
|
+
|
|
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.
|
|
170
210
|
|
|
171
211
|
Use one-shot only for:
|
|
172
212
|
|
|
@@ -174,12 +214,12 @@ Use one-shot only for:
|
|
|
174
214
|
- a standalone media download;
|
|
175
215
|
- an explicitly standalone upload/import whose caller does not want an ongoing authoring session;
|
|
176
216
|
- an explicit user request for one-shot behavior; or
|
|
177
|
-
- a
|
|
217
|
+
- a platform that cannot run the local Session daemon or persistent stdio carrier.
|
|
178
218
|
|
|
179
219
|
Do not choose one-shot merely because the current plan has one write or because it requires fewer
|
|
180
|
-
tool calls. Codex and
|
|
181
|
-
limitation forces fallback, disclose that the client will not preserve local History,
|
|
182
|
-
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.
|
|
183
223
|
|
|
184
224
|
For a permitted one-shot call, supply Operation input through exactly one of `--input-stdin`,
|
|
185
225
|
`--input-file`, or `--input-json`, give every write a meaningful unique `--request-id`, and retain its
|
|
@@ -190,15 +230,24 @@ one-shot processes.
|
|
|
190
230
|
|
|
191
231
|
1. Query `canvas.summary`; query selected details only as needed.
|
|
192
232
|
2. Query `capabilities.detail` and validate the planned Operation input against its schema.
|
|
193
|
-
3.
|
|
233
|
+
3. When artifact type and placement are already clear, make the first meaningful Canvas state
|
|
234
|
+
visible before doing lengthy prompt refinement or generation planning:
|
|
235
|
+
- create the empty generation target first, then plan and edit its Draft;
|
|
236
|
+
- create an empty manual Text Resource with `text: ""`, then fill it with
|
|
237
|
+
`editTextContent`;
|
|
238
|
+
- create a Note with its useful content directly rather than creating an empty sticky.
|
|
239
|
+
Do not create a placeholder while its type or placement is still ambiguous. Watch and the
|
|
240
|
+
Session daemon never create placeholders automatically.
|
|
241
|
+
4. Pick explicit absolute Canvas coordinates. Public move positions remain absolute even for group
|
|
194
242
|
children.
|
|
195
|
-
|
|
196
|
-
|
|
243
|
+
5. Submit one Operation with a new request ID and wait for its terminal Receipt.
|
|
244
|
+
6. Confirm the Receipt outcome and affected IDs, then query the changed View Node when subsequent
|
|
197
245
|
work depends on its exact state.
|
|
198
|
-
|
|
246
|
+
7. Only then plan the next interaction.
|
|
199
247
|
|
|
200
|
-
Common capabilities include notes, move/resize/rename, duplicate/remove,
|
|
201
|
-
Node placement, and
|
|
248
|
+
Common capabilities include notes, manual Text Resources, move/resize/rename, duplicate/remove,
|
|
249
|
+
groups and stacking, Core Node placement, and generation targets. The runtime catalog is
|
|
250
|
+
authoritative. Group nodes cannot nest;
|
|
202
251
|
stacking applies only among siblings. Unsupported World, Decoration, Asset, alignment, and automatic
|
|
203
252
|
layout behavior must not be simulated through lower-level writes.
|
|
204
253
|
|
|
@@ -210,13 +259,30 @@ entries. Never use compensating low-level mutations to imitate undo.
|
|
|
210
259
|
|
|
211
260
|
Generation is an explicit sequence, never one transaction:
|
|
212
261
|
|
|
213
|
-
1. Create a target with `
|
|
262
|
+
1. Create a target with `createGenerationTarget` and retain its View Node ID. It accepts `audio`,
|
|
263
|
+
`image`, `text`, or `video`; `createMediaTarget` remains a compatibility capability for non-text
|
|
264
|
+
targets when advertised.
|
|
214
265
|
2. Call the read-only `planGeneration` Operation with the target, prompt, and any references. Use
|
|
215
266
|
`detail: "detail"` when configuration fields or dynamic enum options are needed.
|
|
267
|
+
Every reference must be `{ "viewNodeId": "..." }`. If the desired Core Node is not currently
|
|
268
|
+
on the Canvas, first call `placeCoreNode`, wait for its successful Receipt, and use the returned
|
|
269
|
+
View Node ID. Never pass a Core Node ID as a generation reference or silently choose among
|
|
270
|
+
multiple placements of the same Core Node. A manual Text Resource is also a valid reference:
|
|
271
|
+
pass its View Node ID instead of copying its text into `prompt`. Planning reads its current text,
|
|
272
|
+
the Draft retains the View Node binding for Web lineage and connection rendering, and
|
|
273
|
+
`startGeneration` materializes the Text Core Node only after estimation succeeds. The stable
|
|
274
|
+
operation names `addVisualReference` and `removeVisualReference` cover these planned Text
|
|
275
|
+
bindings as well as image/video bindings; execute the names returned by the plan rather than
|
|
276
|
+
interpreting them literally.
|
|
216
277
|
3. If the plan reports blocking issues, resolve them and plan again. Do not execute a non-ready
|
|
217
278
|
plan.
|
|
218
279
|
4. Execute `plan.operations` exactly in order, one Operation at a time. Each step revalidates
|
|
219
280
|
current facts. Stop after the first non-success.
|
|
281
|
+
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
|
|
284
|
+
atomically. Do not write `{{@...}}`, choose an input slot/index, or allocate a binding ID
|
|
285
|
+
yourself. `addVisualReference` remains the connection-only operation.
|
|
220
286
|
5. `startGeneration` succeeds when the Workflow Run is accepted and immediate Canvas effects are
|
|
221
287
|
acknowledged. This completes the start interaction; it does not mean generation finished.
|
|
222
288
|
6. Retain the Workflow Run ID. After the successful start Receipt, continue any work that does not
|
|
@@ -230,6 +296,19 @@ Generation is an explicit sequence, never one transaction:
|
|
|
230
296
|
8. On terminal success, query the target detail and resolve its current output Core Node through
|
|
231
297
|
Project Content before downloading or placing it elsewhere.
|
|
232
298
|
|
|
299
|
+
If `startGeneration` returns an indeterminate Receipt after the Workflow was accepted, retain
|
|
300
|
+
`receipt.result.workflowRunId` and `receipt.result.viewNodeId`, reconnect the Session, and invoke
|
|
301
|
+
`reconcileGenerationStart` with those two identities. Never call `startGeneration` again for that
|
|
302
|
+
intent. `running-insufficient` means the Run is still authoritative but does not yet expose enough
|
|
303
|
+
target evidence: wait and reconcile later. `repaired` means the CLI restored the missing Canvas
|
|
304
|
+
launch facts through the semantic Command path. `conflict` or `insufficient` requires inspection;
|
|
305
|
+
neither authorizes a retry.
|
|
306
|
+
|
|
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.
|
|
311
|
+
|
|
233
312
|
Workflow Definitions change over time. Query `workflowDefinitions.summary`, then
|
|
234
313
|
`workflowDefinition.detail` only when planning detail is insufficient. Never guess a Definition,
|
|
235
314
|
configuration option, modality, cost, or media compatibility from its display name.
|
|
@@ -338,8 +417,8 @@ Before reporting a task complete, verify all applicable facts:
|
|
|
338
417
|
- Generation start and generation completion were reported as separate interactions; the target's
|
|
339
418
|
effective Core Node was resolved after completion.
|
|
340
419
|
- Media transfers were verified by identities and checksums without exposing URLs or credentials.
|
|
341
|
-
-
|
|
342
|
-
was disclosed.
|
|
420
|
+
- The daemon-backed Session was closed explicitly (or persistent stdio was shut down in order), and
|
|
421
|
+
any abnormal termination or uncertain active write was disclosed.
|
|
343
422
|
- Deferred scopes were not approximated by bypassing the public semantic surface.
|
|
344
423
|
|
|
345
424
|
When any item cannot be proven, report the uncertainty and the next safe read or reconciliation
|