zk-agent-cli 0.1.0-rc.7 → 0.1.0-rc.9

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.
Files changed (3) hide show
  1. package/README.md +223 -72
  2. package/dist/index.js +1765 -403
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -3,7 +3,10 @@
3
3
  `zk-agent-cli` is the packaged terminal CLI for the default zk-agent product path on
4
4
  zkSync Era and zkSync Sepolia.
5
5
 
6
- This is the canonical CLI manual.
6
+ This is the packaged CLI manual for the public product shell:
7
+ `start -> next -> wallet create/reapprove -> next -> pay -> suite`,
8
+ with `submit`, `workspace`, `handoff`, and `feed` as the current Agent Pay
9
+ shortcuts.
7
10
 
8
11
  ## Why This CLI Exists
9
12
 
@@ -11,6 +14,29 @@ This is the canonical CLI manual.
11
14
  - keep the default execution story zkSync-native and `sed-lite`-first
12
15
  - add an Agent Pay request layer above direct workflow execution
13
16
 
17
+ ## What Makes It Different
18
+
19
+ - local-first by default, with hosted approval only as a fallback path when
20
+ the browser is remote
21
+ - one zkSync-native operator path from wallet readiness to paymaster-aware
22
+ execution
23
+ - one Agent Pay layer that stays attached to the same wallet runtime instead
24
+ of splitting into a separate product
25
+
26
+ ## Best Fit
27
+
28
+ - local-first wallet and session control on zkSync is the real need
29
+ - the first proof should be one zkSync-native pay path, not broad multichain
30
+ exploration
31
+ - Agent Pay should stay attached to the same wallet runtime instead of
32
+ becoming a separate operator tool
33
+
34
+ ## Current Boundary
35
+
36
+ - hosted relay is still the fallback path, not the default onboarding story
37
+ - Agent Pay is a local-first workbench today, not yet a hosted multi-tenant
38
+ control plane
39
+
14
40
  Use:
15
41
 
16
42
  - [`skills/QUICKSTART.md`](../../skills/QUICKSTART.md) for the shortest
@@ -18,28 +44,74 @@ Use:
18
44
  - [`docs/15-codex-plugin-onboarding.md`](../../docs/15-codex-plugin-onboarding.md)
19
45
  for the native Codex plugin install path
20
46
 
47
+ ## Start Here
48
+
49
+ - clean machine bootstrap: `zk-agent setup` once
50
+ - first touch: `zk-agent start`
51
+ - first successful proof: follow the one-minute path and stop at the first
52
+ `zk-agent pay`
53
+ - compact Agent Pay ingress: `zk-agent submit`
54
+ - cross-request Agent Pay workbench: `zk-agent workspace`
55
+ - single-request Agent Pay export: `zk-agent handoff --request-id <id>`
56
+ - cross-request Agent Pay export: `zk-agent feed`
57
+ - broader post-flagship packaged surface: `zk-agent suite`
58
+ - remote-browser fallback: `zk-agent relay baseline --relay-url <relay-url>`
59
+
60
+ Rule of thumb:
61
+
62
+ - start with `start`
63
+ - prove the product once with `pay`
64
+ - stay on `suite` when the question is broader than one send
65
+ - stay on `submit` / `workspace` / `handoff` / `feed` when the question is specifically Agent Pay
66
+ - switch to relay only when the browser is remote
67
+
21
68
  ## One-minute path
22
69
 
23
- Use this path unless the task explicitly needs a lower-level command:
70
+ Use this path unless the task explicitly needs a lower-level command. This is
71
+ the first proof from a clean machine:
24
72
 
25
73
  ```bash
26
74
  zk-agent setup
27
75
  zk-agent next
28
76
  zk-agent wallet create --await-local
29
77
  zk-agent next
30
- zk-agent workflow pay --wallet main --to <address> --amount <amount>
31
- zk-agent suite
78
+ zk-agent pay --wallet main --to <address> --amount <amount>
32
79
  ```
33
80
 
81
+ On the default local-first path, the approved wallet now auto-syncs its local
82
+ smart-account metadata when chain reads are available, so the happy path does
83
+ not depend on a separate manual `zk-agent wallet sync`.
84
+
85
+ If you are not sure whether the question is onboarding, recovery, direct send,
86
+ or Agent Pay follow-up, jump to `Start here by question` below and take the
87
+ smallest matching entrypoint.
88
+
34
89
  `zk-agent start` is the public onboarding command that keeps the same output
35
90
  contract as `zk-agent next`. Use `start` when you want the shortest obvious
36
91
  first-touch command. Keep `next` as the canonical operator/runtime contract in
37
- scripts and JSON examples.
92
+ scripts and JSON examples. If local defaults do not exist yet, both `start`
93
+ and `next` still send you through `zk-agent setup` first.
94
+
95
+ `zk-agent pay` is the public shortcut for the flagship send path. The scoped
96
+ form remains `zk-agent workflow pay`.
97
+ `zk-agent submit` is the public shortcut for the compact Agent Pay ingress
98
+ path. The scoped form remains `zk-agent payment submit`.
99
+ `zk-agent handoff --request-id <id>` is the public shortcut for the
100
+ single-request integration-ready Agent Pay export. The scoped form remains
101
+ `zk-agent payment handoff`.
102
+ `zk-agent feed` is the public shortcut for the integration-ready Agent Pay
103
+ cross-request export. The scoped form remains `zk-agent payment feed`.
104
+
105
+ If you are new, stop at the first successful `zk-agent pay`. Ignore
106
+ `suite`, `payment`, and `relay` until that baseline path works once, unless
107
+ the CLI explicitly points you there. Use `zk-agent suite` only after that
108
+ first success or when you want the broader question-first packaged surface.
109
+
110
+ After that first success, the default broader follow-up is:
38
111
 
39
- If you are new, stop at the first successful `zk-agent workflow pay`. Ignore
40
- remote approval and Agent Pay until that baseline path works once. Use
41
- `zk-agent suite` only after that first success or when you want the broader
42
- question-first packaged surface.
112
+ ```bash
113
+ zk-agent suite
114
+ ```
43
115
 
44
116
  What each step is doing:
45
117
 
@@ -47,7 +119,7 @@ What each step is doing:
47
119
  - `next` gives the shortest valid follow-up step and now labels the current
48
120
  product question as `bootstrap`, `recover`, `operate`, or `workflow`
49
121
  - `wallet create --await-local` is the preferred local approval path
50
- - `workflow pay` is the flagship zkSync-native AA native-send path
122
+ - `pay` is the flagship zkSync-native public native-send shortcut
51
123
  - `suite` is the broader question-first packaged surface
52
124
 
53
125
  The packaged default story is payment-first: send native value now, stay on
@@ -65,7 +137,7 @@ The three public proof paths today are:
65
137
  The fastest flagship proof path after wallet readiness is:
66
138
 
67
139
  ```bash
68
- zk-agent workflow pay --wallet main --to <address> --amount <amount>
140
+ zk-agent pay --wallet main --to <address> --amount <amount>
69
141
  zk-agent workflow next --request-id <id>
70
142
  zk-agent workflow status --request-id <id>
71
143
  ```
@@ -73,37 +145,93 @@ zk-agent workflow status --request-id <id>
73
145
  That path proves the default ready-wallet execution route plus checkpoint
74
146
  follow-up and status inspection without leaving the flagship workflow surface.
75
147
 
148
+ Choose between the direct flagship pay surface and Agent Pay this way:
149
+
150
+ - `pay`: the same public shortcut when you want the shortest first-screen
151
+ flagship send path
152
+ - `workflow pay`: the same execution surface once you are already working
153
+ inside the scoped workflow layer
154
+ - `submit`: the public shortcut when execution is no longer the whole story
155
+ and you want the shortest Agent Pay ingress path
156
+ - `payment`: execution is no longer the whole story and you need request
157
+ capture plus follow-up, sharing, reporting, export, or approval repair
158
+ around the write path
159
+
160
+ `payment` does not replace the execution path. It keeps local request state,
161
+ follow-up, and export surfaces around `pay`, `submit`, `workflow pay`, and
162
+ `send-token`.
163
+
164
+ Choose between the two Agent Pay-facing surfaces this way:
165
+
166
+ - `payment`: the packaged question has already narrowed to one request layer
167
+ and its follow-up surface
168
+ - `suite`: wallet readiness is already clear, but you still want the broader
169
+ packaged catalog across requests, discovery, paymaster, funding, and hosted
170
+ recovery
171
+
172
+ The shortest way to think about Agent Pay is:
173
+
174
+ - `submit`: capture one payment request
175
+ - `workspace`: review the cross-request operator surface
176
+ - `handoff`: export one stable integration bundle
177
+ - `feed`: export the stable cross-request batch view
178
+
179
+ Why Agent Pay instead of only direct execution:
180
+
181
+ - capture one request before or after the write path
182
+ - keep a cross-request operator workspace around the same wallet runtime
183
+ - export stable handoff and feed views for external agents, dashboards, or backends
184
+
76
185
  The current local-first Agent Pay entry surface is:
77
186
 
78
187
  ```bash
79
- zk-agent payment submit --wallet main --to <address> --amount <amount>
188
+ zk-agent submit --wallet main --to <address> --amount <amount>
189
+ zk-agent workspace
80
190
  zk-agent payment dashboard
81
- zk-agent payment feed
191
+ zk-agent feed
82
192
  zk-agent payment queue
83
193
  zk-agent payment report
84
- zk-agent payment approval --request-id <id>
194
+ zk-agent approval --request-id <id>
85
195
  ```
86
196
 
197
+ The scoped equivalents remain `zk-agent payment submit`,
198
+ `zk-agent payment workspace`, `zk-agent payment handoff`,
199
+ `zk-agent payment feed`, and `zk-agent payment approval`.
200
+
87
201
  The fastest Agent Pay proof path is:
88
202
 
89
203
  ```bash
90
- zk-agent payment submit --wallet main --to <address> --amount <amount>
204
+ zk-agent submit --wallet main --to <address> --amount <amount>
91
205
  zk-agent payment next --request-id <id>
92
- zk-agent payment approval --request-id <id>
93
- zk-agent payment dashboard
94
- zk-agent payment handoff --request-id <id>
95
- zk-agent payment feed
206
+ zk-agent approval --request-id <id>
207
+ zk-agent workspace
208
+ zk-agent handoff --request-id <id>
209
+ zk-agent feed
96
210
  ```
97
211
 
98
212
  That path shows compact ingress, wallet-aware follow-up, approval readiness,
99
- dashboard summary, single-request handoff bundling, and cross-request feed
213
+ workspace summary, single-request handoff bundling, and cross-request feed
100
214
  export without leaving the local-first surface.
101
215
 
216
+ For the shortest product demo narrative behind that path, use
217
+ [`docs/20-agent-pay-demo-narrative.md`](../../docs/20-agent-pay-demo-narrative.md).
218
+
219
+ If request capture is no longer enough and you need one current cross-request
220
+ operator view, open the workbench directly:
221
+
222
+ ```bash
223
+ zk-agent workspace
224
+ ```
225
+
226
+ That is the current public shortcut to the Agent Pay workbench anchor above
227
+ dashboard, queue, report, and feed. The scoped form remains
228
+ `zk-agent payment workspace`.
229
+
102
230
  When the browser is remote, the fastest hosted approval proof path on the
103
231
  current supported recovery baseline is:
104
232
 
105
233
  ```bash
106
- zk-agent relay inspect --relay-url <relay-url>
234
+ zk-agent relay baseline --relay-url <relay-url>
107
235
  zk-agent wallet reapprove --name main --relay-url <relay-url> --wait-relay --prompt-code
108
236
  zk-agent wallet status --name main
109
237
  ```
@@ -118,11 +246,13 @@ zk-agent wallet create --relay-url <relay-url> --wait-relay --prompt-code
118
246
  zk-agent next
119
247
  ```
120
248
 
121
- Use those commands for the public "start here" path:
249
+ Current compact Agent Pay command layer:
122
250
 
123
251
  - `submit`: capture one payment request through the compact ingress surface
124
252
  - `dashboard`: review one cross-request dashboard summary above wallet groups,
125
253
  actionable queue items, and recent payment activity
254
+ - `handoff`: expose one stable single-request export bundle for external
255
+ dashboards, agents, or backend ingestion
126
256
  - `feed`: expose an integration-ready cross-request batch feed for external
127
257
  dashboards, agents, or backend ingestion
128
258
  - `queue`: review the current actionable request queue
@@ -145,11 +275,11 @@ Use `zk-agent payment parties --request-id <id>` when an external agent or
145
275
  backend needs the stable request parties model with separate local and
146
276
  share-safe payer projections.
147
277
 
148
- Use `zk-agent payment handoff --request-id <id>` when an external dashboard,
278
+ Use `zk-agent handoff --request-id <id>` when an external dashboard,
149
279
  agent, or backend needs one stable integration bundle instead of
150
280
  reassembling local reads.
151
281
 
152
- Use `zk-agent payment feed` when that same external surface needs the stable
282
+ Use `zk-agent feed` when that same external surface needs the stable
153
283
  cross-request batch feed instead of one request at a time.
154
284
 
155
285
  If readiness is unclear before you choose a fix, use:
@@ -180,22 +310,6 @@ Inside `suite`, the smallest question-first entry layer is:
180
310
  - `unstick write`
181
311
  - `recover remote approval`
182
312
 
183
- Use the surfaces this way:
184
-
185
- - `start`: you are just beginning and want the public onboarding command that
186
- mirrors `next`
187
- - `next`: the CLI is still deciding the shortest path across setup, wallet
188
- readiness, recovery, or workflow continuation
189
- - `workflow pay`: the wallet is already ready and you want the flagship
190
- native-send path now
191
- - `suite`: the wallet is already ready and you want the broader question-first
192
- packaged surface because the task is broader than one immediate flagship pay
193
- step
194
- - `payment`: the execution path is no longer the whole story and you need
195
- local request capture, queueing, reporting, or approval tracking around it
196
- - `suite --include-onboarding`: you want one combined readout from first-run
197
- bootstrap through the packaged post-flagship surface
198
-
199
313
  The remote relay path is a fallback, not part of the default happy path. Only
200
314
  open it when the browser is on another machine or cannot return directly to
201
315
  the waiting terminal.
@@ -244,23 +358,42 @@ ZK_AGENT_TOKEN_DIRECTORY_ROOT=
244
358
  ZK_AGENT_STORAGE_DIR=
245
359
  ```
246
360
 
247
- ## Choose the right surface
361
+ ## Start here by question
248
362
 
249
- - `zk-agent next`: the top-level product entrypoint when the CLI still needs to
250
- choose the shortest path
251
- - `zk-agent workflow pay ...`: the direct flagship execution surface when you
252
- already know the wallet is ready and the goal is "send value now"
253
- - `zk-agent suite`: the packaged post-flagship catalog once wallet readiness is
254
- no longer the blocker and you want the broader question-first packaged
255
- surface
363
+ - `zk-agent start`: the public first-touch command when you want the shortest
364
+ obvious entrypoint
365
+ - `zk-agent next`: the CLI still needs to choose bootstrap, recovery, or
366
+ workflow continuation
256
367
  - `zk-agent doctor`: local-only diagnosis before you choose a fix
257
368
  - `zk-agent wallet status --name <wallet>` and
258
- `zk-agent wallet next --name <wallet>`: wallet-scoped repair and readiness
259
- - `zk-agent workflow ...`: explicit workflow planning, persistence, status,
260
- resume questions, and the flagship pay execution path
261
- - `zk-agent payment ...`: local-first payment ingress, request capture, routing,
262
- queueing, approval tracking, and settlement-state tracking for the Agent Pay
263
- platform layer
369
+ `zk-agent wallet next --name <wallet>`: the blocker is clearly wallet-scoped
370
+ but the exact repair step is still unclear
371
+ - `zk-agent pay ...`: the wallet is ready and the goal is "send value now"
372
+ - `zk-agent workflow ...`: the question is already workflow-specific and you
373
+ need planning, persistence, status, resume, or multi-intent execution
374
+ - `zk-agent payment ...`: execution is no longer the whole story and you need
375
+ the Agent Pay request layer around the write path
376
+ - `zk-agent workspace`: you already know you need the current cross-request
377
+ Agent Pay workbench anchor
378
+ - `zk-agent handoff --request-id <id>`: you already need one stable
379
+ single-request Agent Pay export bundle
380
+ - `zk-agent feed`: you already need the integration-ready cross-request Agent
381
+ Pay export
382
+ - `zk-agent suite`: wallet readiness is clear and the question is broader than
383
+ one immediate send
384
+ - `zk-agent relay baseline --relay-url <relay-url>`: the browser is remote and
385
+ approval must move to the hosted fallback path
386
+
387
+ Keep the split strict: `pay` is the public direct send surface, `workflow pay`
388
+ is the scoped workflow form of that same path, and `payment` is the request
389
+ and follow-up layer around the send surface.
390
+
391
+ Use `suite` when the question is broader than one request lifecycle and you
392
+ still need the packaged catalog.
393
+
394
+ Use `workspace` when the question has already narrowed to the current
395
+ cross-request Agent Pay workbench. The scoped form remains
396
+ `payment workspace`.
264
397
 
265
398
  ## Repair locally first
266
399
 
@@ -287,19 +420,27 @@ zk-agent wallet next --name main
287
420
 
288
421
  ## Switch to remote approval only when needed
289
422
 
290
- Use the relay-backed path only when the browser is not colocated with the
291
- terminal:
423
+ Use the relay-backed path only when the browser is remote and cannot return to
424
+ the waiting terminal.
425
+
426
+ Start with `relay baseline`. It is the packaged hosted-approval entrypoint and
427
+ tells you whether the relay matches the current supported fallback contract.
428
+ Open `relay inspect` only when you need the raw hosted-readiness, URL-shape,
429
+ and persistence fields directly.
430
+
431
+ Existing wallet:
292
432
 
293
433
  ```bash
294
- zk-agent relay inspect --relay-url <relay-url>
295
- zk-agent wallet create --relay-url <relay-url> --wait-relay --prompt-code
296
- zk-agent next
434
+ zk-agent relay baseline --relay-url <relay-url>
435
+ zk-agent wallet reapprove --name main --relay-url <relay-url> --wait-relay --prompt-code
436
+ zk-agent wallet status --name main
297
437
  ```
298
438
 
299
- For an existing wallet:
439
+ No saved wallet yet:
300
440
 
301
441
  ```bash
302
- zk-agent wallet reapprove --name main --relay-url <relay-url> --wait-relay --prompt-code
442
+ zk-agent relay baseline --relay-url <relay-url>
443
+ zk-agent wallet create --relay-url <relay-url> --wait-relay --prompt-code
303
444
  zk-agent next
304
445
  ```
305
446
 
@@ -318,10 +459,6 @@ If the relay is self-hosted through the built-in server:
318
459
  zk-agent relay serve --public-origin https://relay.example.com
319
460
  ```
320
461
 
321
- Use `relay inspect` before sending users to a share link. It exposes hosted
322
- readiness, URL shape, persistence mode, and the exact create/reapprove follow-up
323
- path.
324
-
325
462
  For the supported hosted operating contract, use
326
463
  [`docs/16-hosted-approval-operated-baseline.md`](../../docs/16-hosted-approval-operated-baseline.md).
327
464
 
@@ -359,7 +496,7 @@ Current `suite` catalog categories:
359
496
  Current `suite` handoff surfaces:
360
497
 
361
498
  - `workflow`: flagship pay, approval-based pay, and funding recovery
362
- - `payment`: request capture, queueing, reporting, feed export, and approval repair
499
+ - `payment`: request capture, follow-up, sharing, export, and approval repair
363
500
  - `discovery`: assets/defaults/token inspection
364
501
  - `relay`: hosted approval recovery
365
502
 
@@ -371,22 +508,36 @@ Current `suite` product journeys:
371
508
  - `unstick a write`
372
509
  - `recover remote approval`
373
510
 
511
+ In JSON mode, `suite` now also returns a top-level `platformLayer` summary so
512
+ wrappers, docs, and demos can read the current product shell directly without
513
+ reconstructing it from `proofPaths[]` and `journeys[]`.
514
+
374
515
  If you only need one default starting point inside `suite`, start with
375
516
  `send value now`.
376
517
 
518
+ Inside `suite`, the shortest way to think about Agent Pay is:
519
+
520
+ - `submit`: capture one payment request
521
+ - `workspace`: review the cross-request operator surface
522
+ - `handoff`: export one stable single-request bundle
523
+ - `feed`: export the stable cross-request batch view
524
+
525
+ The shortest tracked route inside `suite` remains:
526
+ `submit -> next -> approval -> workspace -> handoff -> feed`.
527
+
377
528
  For the clearest Agent Pay proof path inside `suite`, follow:
378
529
 
379
530
  ```bash
380
- zk-agent payment submit --wallet main --to <address> --amount <amount>
531
+ zk-agent submit --wallet main --to <address> --amount <amount>
381
532
  zk-agent payment next --request-id <id>
382
- zk-agent payment approval --request-id <id>
383
- zk-agent payment dashboard
384
- zk-agent payment handoff --request-id <id>
385
- zk-agent payment feed
533
+ zk-agent approval --request-id <id>
534
+ zk-agent workspace
535
+ zk-agent handoff --request-id <id>
536
+ zk-agent feed
386
537
  ```
387
538
 
388
539
  That is the shortest packaged route from one local request write into
389
- wallet-aware follow-up, approval readiness, dashboard summary, and
540
+ wallet-aware follow-up, approval readiness, workspace summary, and
390
541
  integration-ready export.
391
542
 
392
543
  Use `--wallet <name>` or `--chain <chain>` when the returned suite commands