zk-agent-cli 0.1.0-rc.6 → 0.1.0-rc.8

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 +208 -48
  2. package/dist/index.js +1793 -680
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -3,7 +3,9 @@
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` and `workspace` as the current Agent Pay shortcuts.
7
9
 
8
10
  ## Why This CLI Exists
9
11
 
@@ -11,6 +13,15 @@ This is the canonical CLI manual.
11
13
  - keep the default execution story zkSync-native and `sed-lite`-first
12
14
  - add an Agent Pay request layer above direct workflow execution
13
15
 
16
+ ## What Makes It Different
17
+
18
+ - local-first by default, with hosted approval only as a fallback path when
19
+ the browser is remote
20
+ - one zkSync-native operator path from wallet readiness to paymaster-aware
21
+ execution
22
+ - one Agent Pay layer that stays attached to the same wallet runtime instead
23
+ of splitting into a separate product
24
+
14
25
  Use:
15
26
 
16
27
  - [`skills/QUICKSTART.md`](../../skills/QUICKSTART.md) for the shortest
@@ -18,6 +29,24 @@ Use:
18
29
  - [`docs/15-codex-plugin-onboarding.md`](../../docs/15-codex-plugin-onboarding.md)
19
30
  for the native Codex plugin install path
20
31
 
32
+ ## Start Here
33
+
34
+ - first touch: `zk-agent start`
35
+ - first successful proof: follow the one-minute path and stop at the first
36
+ `zk-agent pay`
37
+ - compact Agent Pay ingress: `zk-agent submit`
38
+ - cross-request Agent Pay workbench: `zk-agent workspace`
39
+ - broader post-flagship packaged surface: `zk-agent suite`
40
+ - remote-browser fallback: `zk-agent relay baseline --relay-url <relay-url>`
41
+
42
+ Rule of thumb:
43
+
44
+ - start with `start`
45
+ - prove the product once with `pay`
46
+ - stay on `suite` when the question is broader than one send
47
+ - stay on `submit` / `workspace` when the question is specifically Agent Pay
48
+ - switch to relay only when the browser is remote
49
+
21
50
  ## One-minute path
22
51
 
23
52
  Use this path unless the task explicitly needs a lower-level command:
@@ -27,14 +56,33 @@ zk-agent setup
27
56
  zk-agent next
28
57
  zk-agent wallet create --await-local
29
58
  zk-agent next
30
- zk-agent workflow pay --wallet main --to <address> --amount <amount>
31
- zk-agent suite
59
+ zk-agent pay --wallet main --to <address> --amount <amount>
32
60
  ```
33
61
 
34
- If you are new, stop at the first successful `zk-agent workflow pay`. Ignore
35
- remote approval and Agent Pay until that baseline path works once. Use
36
- `zk-agent suite` only after that first success or when the question becomes
37
- broader than one immediate write.
62
+ If you are not sure whether the question is onboarding, recovery, direct send,
63
+ or Agent Pay follow-up, jump to `Start here by question` below and take the
64
+ smallest matching entrypoint.
65
+
66
+ `zk-agent start` is the public onboarding command that keeps the same output
67
+ contract as `zk-agent next`. Use `start` when you want the shortest obvious
68
+ first-touch command. Keep `next` as the canonical operator/runtime contract in
69
+ scripts and JSON examples.
70
+
71
+ `zk-agent pay` is the public shortcut for the flagship send path. The scoped
72
+ form remains `zk-agent workflow pay`.
73
+ `zk-agent submit` is the public shortcut for the compact Agent Pay ingress
74
+ path. The scoped form remains `zk-agent payment submit`.
75
+
76
+ If you are new, stop at the first successful `zk-agent pay`. Ignore
77
+ `suite`, `payment`, and `relay` until that baseline path works once, unless
78
+ the CLI explicitly points you there. Use `zk-agent suite` only after that
79
+ first success or when you want the broader question-first packaged surface.
80
+
81
+ After that first success, the default broader follow-up is:
82
+
83
+ ```bash
84
+ zk-agent suite
85
+ ```
38
86
 
39
87
  What each step is doing:
40
88
 
@@ -42,17 +90,74 @@ What each step is doing:
42
90
  - `next` gives the shortest valid follow-up step and now labels the current
43
91
  product question as `bootstrap`, `recover`, `operate`, or `workflow`
44
92
  - `wallet create --await-local` is the preferred local approval path
45
- - `workflow pay` is the flagship zkSync-native AA native-send path
46
- - `suite` is the packaged surface
93
+ - `pay` is the flagship zkSync-native public native-send shortcut
94
+ - `suite` is the broader question-first packaged surface
47
95
 
48
96
  The packaged default story is payment-first: send native value now, stay on
49
97
  the approval-based pay path when fee-token/default state matters, and recover
50
98
  funding only when the workflow says the write path is blocked.
51
99
 
100
+ The three public proof paths today are:
101
+
102
+ - flagship pay: prove the default ready-wallet zkSync-native send path
103
+ - Agent Pay: prove local request capture plus follow-up surfaces around the
104
+ same wallet runtime
105
+ - hosted approval recovery: prove remote-browser session recovery on the
106
+ current single-host relay baseline
107
+
108
+ The fastest flagship proof path after wallet readiness is:
109
+
110
+ ```bash
111
+ zk-agent pay --wallet main --to <address> --amount <amount>
112
+ zk-agent workflow next --request-id <id>
113
+ zk-agent workflow status --request-id <id>
114
+ ```
115
+
116
+ That path proves the default ready-wallet execution route plus checkpoint
117
+ follow-up and status inspection without leaving the flagship workflow surface.
118
+
119
+ Choose between the direct flagship pay surface and Agent Pay this way:
120
+
121
+ - `pay`: the same public shortcut when you want the shortest first-screen
122
+ flagship send path
123
+ - `workflow pay`: the same execution surface once you are already working
124
+ inside the scoped workflow layer
125
+ - `submit`: the public shortcut when execution is no longer the whole story
126
+ and you want the shortest Agent Pay ingress path
127
+ - `payment`: execution is no longer the whole story and you need request
128
+ capture plus follow-up, sharing, reporting, export, or approval repair
129
+ around the write path
130
+
131
+ `payment` does not replace the execution path. It keeps local request state,
132
+ follow-up, and export surfaces around `pay`, `submit`, `workflow pay`, and
133
+ `send-token`.
134
+
135
+ Choose between the two Agent Pay-facing surfaces this way:
136
+
137
+ - `payment`: the packaged question has already narrowed to one request layer
138
+ and its follow-up surface
139
+ - `suite`: wallet readiness is already clear, but you still want the broader
140
+ packaged catalog across requests, discovery, paymaster, funding, and hosted
141
+ recovery
142
+
143
+ The shortest way to think about Agent Pay is:
144
+
145
+ - `submit`: capture one payment request
146
+ - `workspace`: review the cross-request operator surface
147
+ - `handoff`: export one stable integration bundle
148
+ - `feed`: export the stable cross-request batch view
149
+
150
+ Why Agent Pay instead of only direct execution:
151
+
152
+ - capture one request before or after the write path
153
+ - keep a cross-request operator workspace around the same wallet runtime
154
+ - export stable handoff and feed views for external agents, dashboards, or backends
155
+
52
156
  The current local-first Agent Pay entry surface is:
53
157
 
54
158
  ```bash
55
- zk-agent payment submit --wallet main --to <address> --amount <amount>
159
+ zk-agent submit --wallet main --to <address> --amount <amount>
160
+ zk-agent workspace
56
161
  zk-agent payment dashboard
57
162
  zk-agent payment feed
58
163
  zk-agent payment queue
@@ -60,22 +165,55 @@ zk-agent payment report
60
165
  zk-agent payment approval --request-id <id>
61
166
  ```
62
167
 
168
+ The scoped equivalents remain `zk-agent payment submit` and
169
+ `zk-agent payment workspace`.
170
+
63
171
  The fastest Agent Pay proof path is:
64
172
 
65
173
  ```bash
66
- zk-agent payment submit --wallet main --to <address> --amount <amount>
174
+ zk-agent submit --wallet main --to <address> --amount <amount>
67
175
  zk-agent payment next --request-id <id>
68
176
  zk-agent payment approval --request-id <id>
69
- zk-agent payment dashboard
177
+ zk-agent workspace
70
178
  zk-agent payment handoff --request-id <id>
71
179
  zk-agent payment feed
72
180
  ```
73
181
 
74
182
  That path shows compact ingress, wallet-aware follow-up, approval readiness,
75
- dashboard summary, single-request handoff bundling, and cross-request feed
183
+ workspace summary, single-request handoff bundling, and cross-request feed
76
184
  export without leaving the local-first surface.
77
185
 
78
- Use those commands for the public "start here" path:
186
+ If request capture is no longer enough and you need one current cross-request
187
+ operator view, open the workbench directly:
188
+
189
+ ```bash
190
+ zk-agent workspace
191
+ ```
192
+
193
+ That is the current public shortcut to the Agent Pay workbench anchor above
194
+ dashboard, queue, report, and feed. The scoped form remains
195
+ `zk-agent payment workspace`.
196
+
197
+ When the browser is remote, the fastest hosted approval proof path on the
198
+ current supported recovery baseline is:
199
+
200
+ ```bash
201
+ zk-agent relay baseline --relay-url <relay-url>
202
+ zk-agent wallet reapprove --name main --relay-url <relay-url> --wait-relay --prompt-code
203
+ zk-agent wallet status --name main
204
+ ```
205
+
206
+ That path proves outside-in relay readiness, one hosted reapproval, and the
207
+ post-approval wallet-readiness readout without claiming multi-host durability.
208
+
209
+ If the wallet does not exist yet, swap `wallet reapprove` for:
210
+
211
+ ```bash
212
+ zk-agent wallet create --relay-url <relay-url> --wait-relay --prompt-code
213
+ zk-agent next
214
+ ```
215
+
216
+ Current compact Agent Pay command layer:
79
217
 
80
218
  - `submit`: capture one payment request through the compact ingress surface
81
219
  - `dashboard`: review one cross-request dashboard summary above wallet groups,
@@ -115,8 +253,8 @@ If readiness is unclear before you choose a fix, use:
115
253
  zk-agent doctor
116
254
  ```
117
255
 
118
- When `doctor` shows local readiness is clear and the question is broader than
119
- one immediate next step, move to:
256
+ When `doctor` shows local readiness is clear and you want the broader
257
+ question-first packaged surface, move to:
120
258
 
121
259
  ```bash
122
260
  zk-agent suite
@@ -129,18 +267,13 @@ the post-flagship packaged surface, use:
129
267
  zk-agent suite --include-onboarding
130
268
  ```
131
269
 
132
- Use the surfaces this way:
270
+ Inside `suite`, the smallest question-first entry layer is:
133
271
 
134
- - `next`: the CLI is still deciding the shortest path across setup, wallet
135
- readiness, recovery, or workflow continuation
136
- - `workflow pay`: the wallet is already ready and you want the flagship
137
- native-send path now
138
- - `suite`: the wallet is already ready and you want the packaged surface
139
- because the question is broader than one immediate flagship pay step
140
- - `payment`: the execution path is no longer the whole story and you need
141
- local request capture, queueing, reporting, or approval tracking around it
142
- - `suite --include-onboarding`: you want one combined readout from first-run
143
- bootstrap through the packaged post-flagship surface
272
+ - `send now`
273
+ - `track payments`
274
+ - `inspect before token action`
275
+ - `unstick write`
276
+ - `recover remote approval`
144
277
 
145
278
  The remote relay path is a fallback, not part of the default happy path. Only
146
279
  open it when the browser is on another machine or cannot return directly to
@@ -190,22 +323,38 @@ ZK_AGENT_TOKEN_DIRECTORY_ROOT=
190
323
  ZK_AGENT_STORAGE_DIR=
191
324
  ```
192
325
 
193
- ## Choose the right surface
326
+ ## Start here by question
194
327
 
195
- - `zk-agent next`: the top-level product entrypoint when the CLI still needs to
196
- choose the shortest path
197
- - `zk-agent workflow pay ...`: the direct flagship execution surface when you
198
- already know the wallet is ready and the goal is "send value now"
199
- - `zk-agent suite`: the packaged post-flagship catalog once wallet readiness is
200
- no longer the blocker and the question is broader than one immediate write
328
+ - `zk-agent start`: the public first-touch command when you want the shortest
329
+ obvious entrypoint
330
+ - `zk-agent next`: the CLI still needs to choose bootstrap, recovery, or
331
+ workflow continuation
201
332
  - `zk-agent doctor`: local-only diagnosis before you choose a fix
202
333
  - `zk-agent wallet status --name <wallet>` and
203
- `zk-agent wallet next --name <wallet>`: wallet-scoped repair and readiness
204
- - `zk-agent workflow ...`: explicit workflow planning, persistence, status,
205
- resume questions, and the flagship pay execution path
206
- - `zk-agent payment ...`: local-first payment ingress, request capture, routing,
207
- queueing, approval tracking, and settlement-state tracking for the Agent Pay
208
- platform layer
334
+ `zk-agent wallet next --name <wallet>`: the blocker is clearly wallet-scoped
335
+ but the exact repair step is still unclear
336
+ - `zk-agent pay ...`: the wallet is ready and the goal is "send value now"
337
+ - `zk-agent workflow ...`: the question is already workflow-specific and you
338
+ need planning, persistence, status, resume, or multi-intent execution
339
+ - `zk-agent payment ...`: execution is no longer the whole story and you need
340
+ the Agent Pay request layer around the write path
341
+ - `zk-agent workspace`: you already know you need the current cross-request
342
+ Agent Pay workbench anchor
343
+ - `zk-agent suite`: wallet readiness is clear and the question is broader than
344
+ one immediate send
345
+ - `zk-agent relay baseline --relay-url <relay-url>`: the browser is remote and
346
+ approval must move to the hosted fallback path
347
+
348
+ Keep the split strict: `pay` is the public direct send surface, `workflow pay`
349
+ is the scoped workflow form of that same path, and `payment` is the request
350
+ and follow-up layer around the send surface.
351
+
352
+ Use `suite` when the question is broader than one request lifecycle and you
353
+ still need the packaged catalog.
354
+
355
+ Use `workspace` when the question has already narrowed to the current
356
+ cross-request Agent Pay workbench. The scoped form remains
357
+ `payment workspace`.
209
358
 
210
359
  ## Repair locally first
211
360
 
@@ -236,7 +385,7 @@ Use the relay-backed path only when the browser is not colocated with the
236
385
  terminal:
237
386
 
238
387
  ```bash
239
- zk-agent relay inspect --relay-url <relay-url>
388
+ zk-agent relay baseline --relay-url <relay-url>
240
389
  zk-agent wallet create --relay-url <relay-url> --wait-relay --prompt-code
241
390
  zk-agent next
242
391
  ```
@@ -244,6 +393,7 @@ zk-agent next
244
393
  For an existing wallet:
245
394
 
246
395
  ```bash
396
+ zk-agent relay baseline --relay-url <relay-url>
247
397
  zk-agent wallet reapprove --name main --relay-url <relay-url> --wait-relay --prompt-code
248
398
  zk-agent next
249
399
  ```
@@ -263,9 +413,9 @@ If the relay is self-hosted through the built-in server:
263
413
  zk-agent relay serve --public-origin https://relay.example.com
264
414
  ```
265
415
 
266
- Use `relay inspect` before sending users to a share link. It exposes hosted
267
- readiness, URL shape, persistence mode, and the exact create/reapprove follow-up
268
- path.
416
+ Use `relay baseline` before sending users to a share link when you want the
417
+ packaged public summary and proof paths first. Use `relay inspect` when you
418
+ need the lower-level hosted-readiness, URL shape, and persistence contract.
269
419
 
270
420
  For the supported hosted operating contract, use
271
421
  [`docs/16-hosted-approval-operated-baseline.md`](../../docs/16-hosted-approval-operated-baseline.md).
@@ -304,7 +454,7 @@ Current `suite` catalog categories:
304
454
  Current `suite` handoff surfaces:
305
455
 
306
456
  - `workflow`: flagship pay, approval-based pay, and funding recovery
307
- - `payment`: request capture, queueing, reporting, feed export, and approval repair
457
+ - `payment`: request capture, follow-up, sharing, export, and approval repair
308
458
  - `discovery`: assets/defaults/token inspection
309
459
  - `relay`: hosted approval recovery
310
460
 
@@ -319,19 +469,29 @@ Current `suite` product journeys:
319
469
  If you only need one default starting point inside `suite`, start with
320
470
  `send value now`.
321
471
 
472
+ Inside `suite`, the shortest way to think about Agent Pay is:
473
+
474
+ - `submit`: capture one payment request
475
+ - `workspace`: review the cross-request operator surface
476
+ - `handoff`: export one stable single-request bundle
477
+ - `feed`: export the stable cross-request batch view
478
+
479
+ The shortest tracked route inside `suite` remains:
480
+ `submit -> next -> approval -> workspace -> handoff -> feed`.
481
+
322
482
  For the clearest Agent Pay proof path inside `suite`, follow:
323
483
 
324
484
  ```bash
325
- zk-agent payment submit --wallet main --to <address> --amount <amount>
485
+ zk-agent submit --wallet main --to <address> --amount <amount>
326
486
  zk-agent payment next --request-id <id>
327
487
  zk-agent payment approval --request-id <id>
328
- zk-agent payment dashboard
488
+ zk-agent workspace
329
489
  zk-agent payment handoff --request-id <id>
330
490
  zk-agent payment feed
331
491
  ```
332
492
 
333
493
  That is the shortest packaged route from one local request write into
334
- wallet-aware follow-up, approval readiness, dashboard summary, and
494
+ wallet-aware follow-up, approval readiness, workspace summary, and
335
495
  integration-ready export.
336
496
 
337
497
  Use `--wallet <name>` or `--chain <chain>` when the returned suite commands