zk-agent-cli 0.1.0-rc.1 → 0.1.0-rc.3

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 +164 -108
  2. package/dist/index.js +721 -73
  3. package/package.json +5 -1
package/README.md CHANGED
@@ -3,7 +3,65 @@
3
3
  `zk-agent-cli` is the packaged terminal CLI for the zk-agent operator path on
4
4
  zkSync Era and zkSync Sepolia.
5
5
 
6
- This file is the canonical operator manual for CLI users.
6
+ This is the canonical CLI operator manual.
7
+
8
+ Use:
9
+
10
+ - [`skills/QUICKSTART.md`](../../skills/QUICKSTART.md) for the shortest
11
+ verified path
12
+ - [`docs/15-codex-plugin-onboarding.md`](../../docs/15-codex-plugin-onboarding.md)
13
+ for the native Codex plugin/local marketplace path
14
+
15
+ ## One-minute path
16
+
17
+ Use this path unless the task explicitly needs a lower-level command:
18
+
19
+ ```bash
20
+ zk-agent setup
21
+ zk-agent next
22
+ zk-agent wallet create --await-local
23
+ zk-agent next
24
+ zk-agent workflow pay --wallet main --to <address> --amount <amount>
25
+ zk-agent suite
26
+ ```
27
+
28
+ What each step is doing:
29
+
30
+ - `setup` writes local defaults
31
+ - `next` gives the shortest valid follow-up step and now labels the current
32
+ product question as `bootstrap`, `recover`, `operate`, or `workflow`
33
+ - `wallet create --await-local` is the preferred local approval path
34
+ - `workflow pay` is the flagship zkSync-native AA native-send path
35
+ - `suite` is the packaged surface
36
+
37
+ If readiness is unclear before you choose a fix, use:
38
+
39
+ ```bash
40
+ zk-agent doctor
41
+ ```
42
+
43
+ When `doctor` shows local readiness is clear and the question is broader than
44
+ one immediate next step, move to:
45
+
46
+ ```bash
47
+ zk-agent suite
48
+ ```
49
+
50
+ If you want one packaged readout that includes both first-run onboarding and
51
+ the post-flagship operator surface, use:
52
+
53
+ ```bash
54
+ zk-agent suite --include-onboarding
55
+ ```
56
+
57
+ Use the surfaces this way:
58
+
59
+ - `next`: the CLI is still deciding the shortest path across setup, wallet
60
+ readiness, recovery, or workflow continuation
61
+ - `suite`: the wallet is already ready and you want the packaged operator
62
+ catalog after the flagship pay path
63
+ - `suite --include-onboarding`: you want one combined readout from first-run
64
+ bootstrap through the packaged post-flagship surface
7
65
 
8
66
  ## Install
9
67
 
@@ -26,7 +84,10 @@ The package also ships the alias:
26
84
  zksync-agent --help
27
85
  ```
28
86
 
29
- ## Defaults and prerequisites
87
+ The `npx skills add ...` path belongs to the repo skill bundle, not the
88
+ packaged CLI install surface.
89
+
90
+ ## Defaults
30
91
 
31
92
  - Node.js `>=24`
32
93
  - the default chain is `zksync-sepolia`
@@ -46,32 +107,19 @@ ZK_AGENT_TOKEN_DIRECTORY_ROOT=
46
107
  ZK_AGENT_STORAGE_DIR=
47
108
  ```
48
109
 
49
- ## Fastest verified path
50
-
51
- Use this path unless the task explicitly needs a lower-level command:
52
-
53
- ```bash
54
- zk-agent setup
55
- zk-agent next
56
- zk-agent wallet create --await-local
57
- zk-agent next
58
- zk-agent workflow pay --wallet main --to <address> --amount <amount>
59
- ```
60
-
61
- Interpretation:
62
-
63
- - `setup` writes local defaults
64
- - `next` gives the shortest valid follow-up step
65
- - `wallet create --await-local` is the preferred local approval path
66
- - `workflow pay` is the flagship zkSync-native AA native-send path
110
+ ## Choose the right surface
67
111
 
68
- If readiness is unclear before you choose a fix, use:
69
-
70
- ```bash
71
- zk-agent doctor
72
- ```
112
+ - `zk-agent next`: the top-level product entrypoint when the CLI still needs to
113
+ choose the shortest path
114
+ - `zk-agent doctor`: local-only diagnosis before you choose a fix
115
+ - `zk-agent wallet status --name <wallet>` and
116
+ `zk-agent wallet next --name <wallet>`: wallet-scoped repair and readiness
117
+ - `zk-agent workflow ...`: explicit workflow planning, persistence, status, and
118
+ resume questions
119
+ - `zk-agent suite`: the packaged post-flagship catalog once wallet readiness is
120
+ no longer the blocker
73
121
 
74
- ## Existing wallet recovery
122
+ ## Repair locally first
75
123
 
76
124
  If the wallet already exists and approval is missing or expired:
77
125
 
@@ -94,7 +142,7 @@ zk-agent wallet status --name main
94
142
  zk-agent wallet next --name main
95
143
  ```
96
144
 
97
- ## Remote approval
145
+ ## Switch to remote approval only when needed
98
146
 
99
147
  Use the relay-backed path only when the browser is not colocated with the
100
148
  terminal:
@@ -112,6 +160,15 @@ zk-agent wallet reapprove --name main --relay-url <relay-url> --wait-relay --pro
112
160
  zk-agent next
113
161
  ```
114
162
 
163
+ Current supportable product shape on this path:
164
+
165
+ - one externally reachable public origin
166
+ - one relay host with same-host file persistence
167
+ - one same-origin share-link + approval UI surface
168
+
169
+ Do not assume multi-host or load-balanced durability on the current relay
170
+ surface.
171
+
115
172
  If the relay is self-hosted through the built-in server:
116
173
 
117
174
  ```bash
@@ -125,16 +182,9 @@ path.
125
182
  For the supported hosted operating contract, use
126
183
  [`docs/16-hosted-approval-operated-baseline.md`](../../docs/16-hosted-approval-operated-baseline.md).
127
184
 
128
- ## Funding and execution
185
+ ## After the wallet is ready
129
186
 
130
- Only fund when the CLI tells you funding is required:
131
-
132
- ```bash
133
- zk-agent workflow fund --wallet main
134
- zk-agent workflow fund --wallet main --amount <amount> --execute
135
- ```
136
-
137
- Flagship pay path:
187
+ Default flagship write path:
138
188
 
139
189
  ```bash
140
190
  zk-agent workflow pay --wallet main --to <address> --amount <amount>
@@ -144,112 +194,117 @@ zk-agent workflow pay --wallet main --to <address> --amount <amount> --broadcast
144
194
  Keep `sed-lite` as the default AA baseline. Use `daily-spend-limit` only when
145
195
  you intentionally need that narrower policy profile.
146
196
 
147
- ## Operator suite
148
-
149
- Use:
197
+ Default packaged surface:
150
198
 
151
199
  ```bash
152
200
  zk-agent suite
153
201
  ```
154
202
 
155
- when you want the flagship path plus the current post-flagship surfaces in one
156
- place.
203
+ Use `suite` when the wallet is already ready and you want one packaged surface
204
+ for flagship pay, discovery/defaults, funding readiness, approval-based
205
+ paymaster readiness, and hosted approval recovery.
157
206
 
158
- Current suite shape:
207
+ Current `suite` catalog categories:
159
208
 
160
- - flagship pay:
161
- `zk-agent workflow pay --wallet main --to <address> --amount <amount>`
162
- - discovery/defaults:
163
- `zk-agent assets --wallet main`
164
- `zk-agent defaults`
165
- `zk-agent resolve-token --chain zksync-sepolia --symbol USDC`
166
- - funding readiness:
167
- `zk-agent workflow fund --wallet main`
168
- - paymaster readiness:
169
- `zk-agent workflow pay --wallet main --to <address> --amount <amount> --paymaster-mode approval-based`
170
- `zk-agent tokens --chain zksync-sepolia --role paymaster-fee-token`
209
+ - `operate`
210
+ - `discover`
211
+ - `pay`
212
+ - `fund`
213
+ - `recover`
171
214
 
172
- ## Discovery and direct commands
215
+ Current `suite` handoff surfaces:
173
216
 
174
- Preferred discovery order:
217
+ - `workflow`: flagship pay, approval-based pay, and funding recovery
218
+ - `discovery`: assets/defaults/token inspection
219
+ - `relay`: hosted approval recovery
175
220
 
176
- - `zk-agent assets --wallet main`
177
- - `zk-agent tokens --wallet main --owned`
178
- - `zk-agent defaults`
179
- - `zk-agent resolve-token --chain zksync-sepolia --symbol <symbol>`
180
-
181
- Use the direct commands when you intentionally want to bypass the workflow
182
- layer:
221
+ Current `suite` operator journeys:
183
222
 
184
- - `zk-agent send-token --wallet main --symbol USDC --to <address> --amount <amount>`
185
- - `zk-agent swap --wallet main --token-in-symbol USDC --token-out-symbol ETH --amount-in <amount>`
186
- - `zk-agent fund --wallet main --symbol USDC --amount <amount>`
187
- - `zk-agent deposit --wallet main --symbol USDC --amount <amount>`
188
- - `zk-agent withdraw --wallet main --symbol USDC --amount <amount>`
223
+ - `send value now`
224
+ - `inspect before acting`
225
+ - `unstick a write`
226
+ - `recover remote approval`
189
227
 
190
- ## Local storage
228
+ Use `--wallet <name>` or `--chain <chain>` when the returned suite commands
229
+ should stay on a non-default wallet or chain.
191
230
 
192
- By default the CLI stores local state under:
231
+ Only fund when the CLI tells you funding is required:
193
232
 
194
- ```text
195
- ~/.zk-agent/
233
+ ```bash
234
+ zk-agent workflow fund --wallet main
235
+ zk-agent workflow fund --wallet main --amount <amount> --execute
196
236
  ```
197
237
 
198
- Common files:
238
+ Do not guess the route. Use the exact funding command suggested by `next`,
239
+ `doctor`, `wallet status`, a blocked workflow, or `suite`.
199
240
 
200
- - `config.json`
201
- - `wallets/*.json`
202
- - `requests/*.json`
203
- - `workflows/*.json`
241
+ ## Leave the default path only on purpose
204
242
 
205
- ## Smart-account profiles
243
+ Prefer `suite` first when you want the packaged discovery/defaults/funding/
244
+ paymaster surface. Drop to lower-level commands only when the question is
245
+ already narrower than the packaged catalog.
206
246
 
207
- The packaged CLI includes built-in profile artifacts for:
247
+ Preferred discovery order:
208
248
 
209
- - `sed-lite`
210
- - `daily-spend-limit`
249
+ - `zk-agent assets --wallet main`
250
+ - `zk-agent tokens --wallet main --owned`
251
+ - `zk-agent defaults`
252
+ - `zk-agent resolve-token --chain zksync-sepolia --symbol <symbol>`
211
253
 
212
- Inspect them with:
254
+ - direct token transfer or send path:
255
+ `zk-agent send-token --wallet main --symbol USDC --to <address> --amount <amount>`
256
+ - explicit workflow planning, swap, bridge, deposit, withdraw, or resume:
257
+ `zk-agent workflow --help`
258
+ - wallet lifecycle, recovery, approval requests, signer management, or
259
+ smart-account profile operations:
260
+ `zk-agent wallet --help`
261
+ - hosted relay inspection or built-in relay serving:
262
+ `zk-agent relay --help`
213
263
 
214
- ```bash
215
- zk-agent wallet smart-account profiles --json
216
- ```
264
+ Built-in smart-account profiles remain:
217
265
 
218
- Use the packaged path for:
266
+ - `sed-lite`
267
+ - `daily-spend-limit`
219
268
 
220
- ```bash
221
- zk-agent wallet smart-account predict --profile sed-lite
222
- zk-agent wallet smart-account deploy --profile sed-lite
223
- ```
269
+ Keep `sed-lite` as the default product baseline. Use
270
+ `zk-agent wallet smart-account --help` when the task is specifically about
271
+ predict, deploy, or profile-level self-calls rather than the normal operator
272
+ path.
224
273
 
225
274
  ## Common failures
226
275
 
227
- Connector callback never arrives:
228
-
229
- - verify the connector URL saved by `zk-agent setup`
230
- - if local callback is impossible in the current environment, switch to the
231
- relay-backed path
232
-
233
- CLI says the wallet is missing a writable session:
276
+ - connector callback never arrives:
277
+ verify the connector URL saved by `zk-agent setup`; if local callback is not
278
+ viable in the current environment, switch to the relay-backed path
279
+ - wallet is missing a writable session:
280
+ run `zk-agent doctor --wallet <wallet>`, then inspect
281
+ `zk-agent wallet status --name <wallet>`; reapprove when approval is missing,
282
+ attach the signer when approval is still present
283
+ - workflow stops on funding:
284
+ do not guess the route; run the exact `workflow fund` command suggested by
285
+ the CLI
286
+ - locked-down environment blocks local callback or relay binding:
287
+ rerun from a normal host shell or use the relay/manual approval path that
288
+ matches the environment
234
289
 
235
- - run `zk-agent doctor --wallet <wallet>`
236
- - inspect `zk-agent wallet status --name <wallet>`
237
- - reapprove when approval is missing
238
- - attach the signer when approval is present but local write readiness is not
290
+ ## Reference
239
291
 
240
- Workflow stops on funding:
292
+ Local storage:
241
293
 
242
- - do not guess the route
243
- - run the exact `workflow fund` command suggested by the CLI
294
+ By default the CLI stores local state under:
244
295
 
245
- Locked-down environment blocks local callback or relay binding:
296
+ ```text
297
+ ~/.zk-agent/
298
+ ```
246
299
 
247
- - rerun from a normal host shell
248
- - or use a relay/manual approval path that matches the environment
300
+ Common files:
249
301
 
250
- ## Command help
302
+ - `config.json`
303
+ - `wallets/*.json`
304
+ - `requests/*.json`
305
+ - `workflows/*.json`
251
306
 
252
- Use:
307
+ Help surfaces:
253
308
 
254
309
  ```bash
255
310
  zk-agent --help
@@ -257,6 +312,7 @@ zk-agent doctor --help
257
312
  zk-agent wallet --help
258
313
  zk-agent workflow --help
259
314
  zk-agent suite --help
315
+ zk-agent relay --help
260
316
  ```
261
317
 
262
318
  ## License