@thirdfy/agent-cli 0.1.46 → 0.2.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 +16 -1
- package/bin/thirdfy-agent.mjs +3 -5037
- package/package.json +17 -4
- package/scripts/validate-npm-pack.mjs +43 -0
- package/src/cli/errors.mjs +103 -0
- package/src/cli/flags.mjs +66 -0
- package/src/cli/help.mjs +89 -0
- package/src/cli/manifest.mjs +422 -0
- package/src/cli/options/agent.mjs +9 -0
- package/src/cli/options/analytics.mjs +5 -0
- package/src/cli/options/auth.mjs +10 -0
- package/src/cli/options/bootstrap.mjs +19 -0
- package/src/cli/options/chains.mjs +3 -0
- package/src/cli/options/credentials.mjs +15 -0
- package/src/cli/options/delegation.mjs +22 -0
- package/src/cli/options/execution.mjs +24 -0
- package/src/cli/options/global.mjs +16 -0
- package/src/cli/options/index.mjs +37 -0
- package/src/cli/options/polymarket.mjs +3 -0
- package/src/cli/options/tracking.mjs +18 -0
- package/src/cli/options/wallet.mjs +7 -0
- package/src/cli/program.mjs +5 -0
- package/src/cli/register.mjs +118 -0
- package/src/commands/agent.mjs +194 -0
- package/src/commands/bootstrap.mjs +762 -0
- package/src/commands/credentials.mjs +102 -0
- package/src/commands/delegation.mjs +355 -0
- package/src/commands/discovery.mjs +77 -0
- package/src/commands/doctor.mjs +320 -0
- package/src/commands/execute.mjs +255 -0
- package/src/commands/hyperliquid.mjs +51 -0
- package/src/commands/index.mjs +6 -0
- package/src/commands/polymarket.mjs +89 -0
- package/src/commands/prompt.mjs +33 -0
- package/src/commands/telemetry.mjs +146 -0
- package/src/commands/wallet.mjs +129 -0
- package/src/core/args.mjs +68 -0
- package/src/core/constants.mjs +31 -0
- package/src/core/context.mjs +145 -0
- package/src/core/envelope.mjs +20 -0
- package/src/core/http.mjs +77 -0
- package/src/core/index.mjs +6 -0
- package/src/core/runMode.mjs +72 -0
- package/src/runtime/actions/selection.mjs +339 -0
- package/src/runtime/agentExtract.mjs +52 -0
- package/src/runtime/authHelpers.mjs +53 -0
- package/src/runtime/bitfinexProbe.mjs +121 -0
- package/src/runtime/context.mjs +28 -0
- package/src/runtime/createThirdfyAgentRuntime.mjs +2 -0
- package/src/runtime/errors.mjs +3 -0
- package/src/runtime/execution/amounts.mjs +193 -0
- package/src/runtime/execution/lanes.mjs +75 -0
- package/src/runtime/execution/payloads.mjs +148 -0
- package/src/runtime/execution/runners.mjs +702 -0
- package/src/runtime/handlers.mjs +181 -0
- package/src/runtime/index.mjs +4 -0
- package/src/runtime/main.mjs +204 -0
- package/src/runtime/onboardingHints.mjs +54 -0
- package/src/runtime/owsSigning.mjs +118 -0
- package/src/runtime/providerHints.mjs +414 -0
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commander command manifest — mirrors former dispatch.mjs routing.
|
|
3
|
+
* @typedef {'offline'|'online'} CapabilityTier
|
|
4
|
+
* @typedef {object} ManifestEntry
|
|
5
|
+
* @property {string[]} path - command path segments
|
|
6
|
+
* @property {string} handler - key on handlers object
|
|
7
|
+
* @property {CapabilityTier} [tier='offline']
|
|
8
|
+
* @property {string[]} [aliases] - alternate paths (same handler/options)
|
|
9
|
+
* @property {string[]} [options] - option bundle names from options/index.mjs
|
|
10
|
+
* @property {string} [description]
|
|
11
|
+
* @property {object} [args] - Commander arguments, e.g. { email: '<address>' }
|
|
12
|
+
* @property {string} [trackKind] - for commandTrackList: 'actions' | 'events'
|
|
13
|
+
* @property {boolean} [jeffAlias] - maps jeff * to root handlers
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** @type {ManifestEntry[]} */
|
|
17
|
+
export const CLI_MANIFEST = [
|
|
18
|
+
// profile / config
|
|
19
|
+
{
|
|
20
|
+
path: ['profile', 'init'],
|
|
21
|
+
handler: 'commandProfileInit',
|
|
22
|
+
options: ['bootstrap'],
|
|
23
|
+
description: 'Initialize CLI profile and run mode defaults',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
path: ['profile', 'use'],
|
|
27
|
+
handler: 'commandProfileUse',
|
|
28
|
+
options: ['bootstrap'],
|
|
29
|
+
description: 'Switch active profile and run mode',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
path: ['profile', 'show'],
|
|
33
|
+
handler: 'commandProfileShow',
|
|
34
|
+
description: 'Show persisted profile configuration',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
path: ['config', 'set'],
|
|
38
|
+
handler: 'commandConfigSet',
|
|
39
|
+
options: ['bootstrap'],
|
|
40
|
+
description: 'Set a nested config value',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
path: ['config', 'get'],
|
|
44
|
+
handler: 'commandProfileShow',
|
|
45
|
+
description: 'Show persisted profile configuration (alias of profile show)',
|
|
46
|
+
},
|
|
47
|
+
// auth
|
|
48
|
+
{
|
|
49
|
+
path: ['login'],
|
|
50
|
+
handler: 'commandLogin',
|
|
51
|
+
options: ['auth', 'bootstrap'],
|
|
52
|
+
description: 'Login with auth token, owner session, or agent API key',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
path: ['login', 'email'],
|
|
56
|
+
handler: 'commandLoginEmail',
|
|
57
|
+
options: ['auth', 'bootstrap'],
|
|
58
|
+
description: 'Privy email OTP login',
|
|
59
|
+
args: { address: '<address>' },
|
|
60
|
+
},
|
|
61
|
+
{ path: ['logout'], handler: 'commandLogout', options: ['bootstrap'], description: 'Logout and clear local credentials' },
|
|
62
|
+
{ path: ['whoami'], handler: 'commandWhoami', description: 'Show masked local identity' },
|
|
63
|
+
{ path: ['doctor', 'self'], handler: 'commandDoctorSelf', options: ['wallet'], description: 'Self-mode wallet diagnostics' },
|
|
64
|
+
{ path: ['doctor', 'auth'], handler: 'commandDoctorAuth', description: 'Auth and onboarding diagnostics' },
|
|
65
|
+
{
|
|
66
|
+
path: ['help', 'onboarding'],
|
|
67
|
+
handler: 'commandHelpOnboarding',
|
|
68
|
+
description: 'Structured onboarding help (JSON envelope)',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
path: ['onboarding', 'help'],
|
|
72
|
+
handler: 'commandHelpOnboarding',
|
|
73
|
+
description: 'Structured onboarding help (JSON envelope)',
|
|
74
|
+
},
|
|
75
|
+
{ path: ['wallet', 'list'], handler: 'commandWalletList', description: 'List configured wallets' },
|
|
76
|
+
// polymarket (offline wrappers)
|
|
77
|
+
{
|
|
78
|
+
path: ['polymarket', 'status'],
|
|
79
|
+
handler: 'commandPolymarketStatus',
|
|
80
|
+
options: ['auth', 'polymarket'],
|
|
81
|
+
description: 'Polymarket funding/setup status',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
path: ['polymarket', 'setup'],
|
|
85
|
+
handler: 'commandPolymarketSetup',
|
|
86
|
+
options: ['auth', 'execution', 'polymarket'],
|
|
87
|
+
description: 'Polymarket onboarding preflight',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
path: ['polymarket', 'dry-run'],
|
|
91
|
+
handler: 'commandPolymarketDryRun',
|
|
92
|
+
options: ['auth', 'execution', 'polymarket'],
|
|
93
|
+
description: 'Polymarket dry-run preflight',
|
|
94
|
+
},
|
|
95
|
+
// online
|
|
96
|
+
{
|
|
97
|
+
path: ['agent', 'run'],
|
|
98
|
+
handler: 'commandAgentRun',
|
|
99
|
+
tier: 'online',
|
|
100
|
+
options: ['auth', 'execution'],
|
|
101
|
+
description: 'Run agent action via managed/self paths',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
path: ['managed', 'setup'],
|
|
105
|
+
handler: 'commandManagedSetup',
|
|
106
|
+
tier: 'online',
|
|
107
|
+
options: ['auth', 'delegation', 'bootstrap'],
|
|
108
|
+
description: 'Managed wallet + delegation setup',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
path: ['jeff', 'trade'],
|
|
112
|
+
handler: 'commandRun',
|
|
113
|
+
tier: 'online',
|
|
114
|
+
options: ['auth', 'execution'],
|
|
115
|
+
description: 'Execute intent (jeff alias)',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
path: ['jeff', 'preflight'],
|
|
119
|
+
handler: 'commandPreflight',
|
|
120
|
+
tier: 'online',
|
|
121
|
+
options: ['auth', 'execution'],
|
|
122
|
+
description: 'Governance preflight (jeff alias)',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
path: ['jeff', 'status'],
|
|
126
|
+
handler: 'commandIntentStatus',
|
|
127
|
+
tier: 'online',
|
|
128
|
+
options: ['execution'],
|
|
129
|
+
description: 'Intent status (jeff alias)',
|
|
130
|
+
},
|
|
131
|
+
{ path: ['catalogs', 'list'], handler: 'commandCatalogsList', tier: 'online', description: 'List action catalogs' },
|
|
132
|
+
{
|
|
133
|
+
path: ['credits', 'balance'],
|
|
134
|
+
handler: 'commandCreditsBalance',
|
|
135
|
+
tier: 'online',
|
|
136
|
+
options: ['auth'],
|
|
137
|
+
description: 'Credits balance',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
path: ['data', 'summary'],
|
|
141
|
+
handler: 'commandDataSummary',
|
|
142
|
+
tier: 'online',
|
|
143
|
+
options: ['auth', 'tracking', 'chains'],
|
|
144
|
+
description: 'Agent data summary',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
path: ['track', 'actions'],
|
|
148
|
+
handler: 'commandTrackList',
|
|
149
|
+
tier: 'online',
|
|
150
|
+
options: ['auth', 'tracking'],
|
|
151
|
+
trackKind: 'actions',
|
|
152
|
+
description: 'List tracked actions',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
path: ['track', 'events'],
|
|
156
|
+
handler: 'commandTrackList',
|
|
157
|
+
tier: 'online',
|
|
158
|
+
options: ['auth', 'tracking'],
|
|
159
|
+
trackKind: 'events',
|
|
160
|
+
description: 'List tracked events',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
path: ['track', 'action'],
|
|
164
|
+
handler: 'commandTrackAction',
|
|
165
|
+
tier: 'online',
|
|
166
|
+
options: ['auth', 'execution', 'tracking'],
|
|
167
|
+
description: 'Record a tracked action',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
path: ['delegation', 'create'],
|
|
171
|
+
handler: 'commandDelegationCreate',
|
|
172
|
+
tier: 'online',
|
|
173
|
+
options: ['auth', 'delegation'],
|
|
174
|
+
description: 'Create delegation',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
path: ['delegation', 'grant'],
|
|
178
|
+
handler: 'commandDelegationCreate',
|
|
179
|
+
tier: 'online',
|
|
180
|
+
options: ['auth', 'delegation'],
|
|
181
|
+
description: 'Create delegation (alias)',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
path: ['delegation', 'init-custodial'],
|
|
185
|
+
handler: 'commandDelegationInitCustodial',
|
|
186
|
+
tier: 'online',
|
|
187
|
+
options: ['auth', 'delegation', 'chains'],
|
|
188
|
+
description: 'Initialize custodial session account',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
path: ['delegation', 'custodial-grant'],
|
|
192
|
+
handler: 'commandDelegationCustodialGrant',
|
|
193
|
+
tier: 'online',
|
|
194
|
+
options: ['auth', 'delegation'],
|
|
195
|
+
description: 'Custodial delegation grant',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
path: ['delegation', 'activate'],
|
|
199
|
+
handler: 'commandDelegationActivate',
|
|
200
|
+
tier: 'online',
|
|
201
|
+
options: ['auth', 'delegation'],
|
|
202
|
+
description: 'Activate delegation on-chain',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
path: ['delegation', 'status'],
|
|
206
|
+
handler: 'commandDelegationStatus',
|
|
207
|
+
tier: 'online',
|
|
208
|
+
options: ['auth', 'delegation'],
|
|
209
|
+
description: 'Delegation status',
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
path: ['delegation', 'show'],
|
|
213
|
+
handler: 'commandDelegationStatus',
|
|
214
|
+
tier: 'online',
|
|
215
|
+
options: ['auth', 'delegation'],
|
|
216
|
+
description: 'Delegation status (alias)',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
path: ['delegation', 'inspect'],
|
|
220
|
+
handler: 'commandDelegationInspect',
|
|
221
|
+
tier: 'online',
|
|
222
|
+
options: ['auth', 'delegation'],
|
|
223
|
+
description: 'Delegation inspect',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
path: ['delegation', 'balance'],
|
|
227
|
+
handler: 'commandDelegationBalance',
|
|
228
|
+
tier: 'online',
|
|
229
|
+
options: ['auth', 'delegation'],
|
|
230
|
+
description: 'Delegation balance',
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
path: ['delegation', 'revoke'],
|
|
234
|
+
handler: 'commandDelegationRevoke',
|
|
235
|
+
tier: 'online',
|
|
236
|
+
options: ['auth', 'delegation'],
|
|
237
|
+
description: 'Revoke delegation',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
path: ['delegation', 'redeem'],
|
|
241
|
+
handler: 'commandDelegationRedeem',
|
|
242
|
+
tier: 'online',
|
|
243
|
+
options: ['auth', 'execution'],
|
|
244
|
+
description: 'Redeem via delegation',
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
path: ['credentials', 'upsert'],
|
|
248
|
+
handler: 'commandCredentialsUpsert',
|
|
249
|
+
tier: 'online',
|
|
250
|
+
options: ['auth', 'credentials'],
|
|
251
|
+
description: 'Upsert CEX credentials',
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
path: ['credentials', 'status'],
|
|
255
|
+
handler: 'commandCredentialsStatus',
|
|
256
|
+
tier: 'online',
|
|
257
|
+
options: ['auth', 'credentials'],
|
|
258
|
+
description: 'CEX credential status',
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
path: ['agent', 'register'],
|
|
262
|
+
handler: 'commandAgentRegister',
|
|
263
|
+
tier: 'online',
|
|
264
|
+
options: ['auth', 'bootstrap', 'agent'],
|
|
265
|
+
description: 'Register agent',
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
path: ['developer', 'bootstrap'],
|
|
269
|
+
handler: 'commandDeveloperBootstrap',
|
|
270
|
+
tier: 'online',
|
|
271
|
+
options: ['auth', 'bootstrap'],
|
|
272
|
+
description: 'Developer bootstrap flow',
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
path: ['bootstrap', 'begin'],
|
|
276
|
+
handler: 'commandBootstrapBegin',
|
|
277
|
+
tier: 'online',
|
|
278
|
+
options: ['auth', 'bootstrap'],
|
|
279
|
+
description: 'Begin agent bootstrap',
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
path: ['onboarding', 'begin'],
|
|
283
|
+
handler: 'commandBootstrapBegin',
|
|
284
|
+
tier: 'online',
|
|
285
|
+
options: ['auth', 'bootstrap'],
|
|
286
|
+
description: 'Begin agent bootstrap (alias)',
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
path: ['bootstrap', 'complete'],
|
|
290
|
+
handler: 'commandBootstrapComplete',
|
|
291
|
+
tier: 'online',
|
|
292
|
+
options: ['auth', 'bootstrap'],
|
|
293
|
+
description: 'Complete agent bootstrap',
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
path: ['onboarding', 'complete'],
|
|
297
|
+
handler: 'commandBootstrapComplete',
|
|
298
|
+
tier: 'online',
|
|
299
|
+
options: ['auth', 'bootstrap'],
|
|
300
|
+
description: 'Complete agent bootstrap (alias)',
|
|
301
|
+
},
|
|
302
|
+
// three-deep
|
|
303
|
+
{
|
|
304
|
+
path: ['agent', 'key', 'rotate'],
|
|
305
|
+
handler: 'commandAgentKeyRotate',
|
|
306
|
+
tier: 'online',
|
|
307
|
+
options: ['auth'],
|
|
308
|
+
description: 'Rotate agent API key',
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
path: ['agent', 'key', 'revoke'],
|
|
312
|
+
handler: 'commandAgentKeyRevoke',
|
|
313
|
+
tier: 'online',
|
|
314
|
+
options: ['auth'],
|
|
315
|
+
description: 'Revoke agent API key',
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
path: ['agent', 'auth', 'challenge'],
|
|
319
|
+
handler: 'commandAgentAuthChallenge',
|
|
320
|
+
tier: 'online',
|
|
321
|
+
options: ['auth'],
|
|
322
|
+
description: 'Agent wallet auth challenge',
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
path: ['agent', 'auth', 'verify'],
|
|
326
|
+
handler: 'commandAgentAuthVerify',
|
|
327
|
+
tier: 'online',
|
|
328
|
+
options: ['auth'],
|
|
329
|
+
description: 'Agent wallet auth verify',
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
path: ['managed', 'wallet', 'init'],
|
|
333
|
+
handler: 'commandDelegationInitCustodial',
|
|
334
|
+
tier: 'online',
|
|
335
|
+
options: ['auth', 'delegation', 'chains'],
|
|
336
|
+
description: 'Initialize managed wallet (custodial)',
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
path: ['managed', 'wallet', 'grant'],
|
|
340
|
+
handler: 'commandDelegationCustodialGrant',
|
|
341
|
+
tier: 'online',
|
|
342
|
+
options: ['auth', 'delegation', 'chains'],
|
|
343
|
+
description: 'Managed wallet grant',
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
path: ['wallet', 'execute'],
|
|
347
|
+
handler: 'commandWalletExecute',
|
|
348
|
+
tier: 'online',
|
|
349
|
+
options: ['auth', 'execution'],
|
|
350
|
+
description: 'Execute via wallet API',
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
path: ['wallet', 'sign'],
|
|
354
|
+
handler: 'commandWalletSign',
|
|
355
|
+
tier: 'online',
|
|
356
|
+
options: ['auth', 'execution'],
|
|
357
|
+
description: 'Sign via wallet API',
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
path: ['wallet', 'submit'],
|
|
361
|
+
handler: 'commandWalletSubmit',
|
|
362
|
+
tier: 'online',
|
|
363
|
+
options: ['wallet'],
|
|
364
|
+
description: 'Submit signed transaction',
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
path: ['analytics', 'portfolio'],
|
|
368
|
+
handler: 'commandAnalyticsPortfolio',
|
|
369
|
+
tier: 'online',
|
|
370
|
+
options: ['auth', 'tracking', 'analytics', 'chains'],
|
|
371
|
+
description: 'Portfolio analytics',
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
path: ['analytics', 'leaderboard'],
|
|
375
|
+
handler: 'commandAnalyticsLeaderboard',
|
|
376
|
+
tier: 'online',
|
|
377
|
+
options: ['tracking', 'analytics'],
|
|
378
|
+
description: 'Leaderboard analytics',
|
|
379
|
+
},
|
|
380
|
+
// root commands
|
|
381
|
+
{
|
|
382
|
+
path: ['prompt'],
|
|
383
|
+
handler: 'commandPrompt',
|
|
384
|
+
tier: 'online',
|
|
385
|
+
options: ['auth', 'execution'],
|
|
386
|
+
description: 'Natural language prompt (experimental)',
|
|
387
|
+
args: { query: '[query...]' },
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
path: ['actions'],
|
|
391
|
+
handler: 'commandActions',
|
|
392
|
+
tier: 'online',
|
|
393
|
+
options: ['auth', 'execution'],
|
|
394
|
+
description: 'List allowed actions',
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
path: ['preflight'],
|
|
398
|
+
handler: 'commandPreflight',
|
|
399
|
+
tier: 'online',
|
|
400
|
+
options: ['auth', 'execution'],
|
|
401
|
+
description: 'Governance preflight',
|
|
402
|
+
},
|
|
403
|
+
{ path: ['run'], handler: 'commandRun', tier: 'online', options: ['auth', 'execution'], description: 'Execute intent' },
|
|
404
|
+
{
|
|
405
|
+
path: ['self-exec'],
|
|
406
|
+
handler: 'commandSelfExec',
|
|
407
|
+
tier: 'online',
|
|
408
|
+
options: ['auth', 'execution', 'wallet'],
|
|
409
|
+
description: 'Self-custody execute with OWS',
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
path: ['intent-status'],
|
|
413
|
+
handler: 'commandIntentStatus',
|
|
414
|
+
tier: 'online',
|
|
415
|
+
options: ['execution'],
|
|
416
|
+
description: 'Poll intent status',
|
|
417
|
+
},
|
|
418
|
+
];
|
|
419
|
+
|
|
420
|
+
export function manifestPathKey(path) {
|
|
421
|
+
return path.join(' ');
|
|
422
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function attachAgentRegisterOptions(cmd) {
|
|
2
|
+
return cmd
|
|
3
|
+
.option('--bio <text>', 'agent bio')
|
|
4
|
+
.option('--website <url>', 'agent website')
|
|
5
|
+
.option('--github <handle>', 'agent github')
|
|
6
|
+
.option('--tags <csv>', 'agent tags csv')
|
|
7
|
+
.option('--strategy <json>', 'agent strategy JSON')
|
|
8
|
+
.option('--api-key-envelope-public-key <key>', 'API key envelope public key');
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function attachAuthOptions(cmd) {
|
|
2
|
+
return cmd
|
|
3
|
+
.option('--auth-token <token>', 'Thirdfy auth token')
|
|
4
|
+
.option('--owner-session-token <token>', 'owner session token')
|
|
5
|
+
.option('--agent-api-key <key>', 'agent API key')
|
|
6
|
+
.option('--agent-key <key>', 'agent key')
|
|
7
|
+
.option('--wallet-address <addr>', 'wallet address')
|
|
8
|
+
.option('--challenge-id <id>', 'wallet challenge id')
|
|
9
|
+
.option('--signature <hex>', 'wallet signature hex');
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function attachBootstrapOptions(cmd) {
|
|
2
|
+
return cmd
|
|
3
|
+
.option('--proof-type <type>', 'session_token|wallet_signature')
|
|
4
|
+
.option('--lane <mode>', 'bootstrap lane alias for run-mode')
|
|
5
|
+
.option('--key <path>', 'config key path')
|
|
6
|
+
.option('--value <value>', 'config value')
|
|
7
|
+
.option('--name <name>', 'profile or agent name')
|
|
8
|
+
.option('--email <address>', 'email address')
|
|
9
|
+
.option('--code <otp>', 'email OTP code')
|
|
10
|
+
.option('--otp <otp>', 'email OTP alias')
|
|
11
|
+
.option('--accept-terms', 'accept terms for email login')
|
|
12
|
+
.option('--key-name <name>', 'Privy key name')
|
|
13
|
+
.option('-ni, --not-interactive', 'fail fast when required login input is missing')
|
|
14
|
+
.option('--no-bootstrap-agent', 'skip agent bootstrap on email login')
|
|
15
|
+
.option('--rotate-agent-key', 'rotate agent key')
|
|
16
|
+
.option('--login-attempt-id <id>', 'email login attempt id')
|
|
17
|
+
.option('--all', 'logout all sessions')
|
|
18
|
+
.option('--clear-agent-key', 'clear stored agent key on logout');
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function attachCredentialsOptions(cmd) {
|
|
2
|
+
return cmd
|
|
3
|
+
.option('--venue <id>', 'credential venue')
|
|
4
|
+
.option('--api-key <key>', 'exchange API key')
|
|
5
|
+
.option('--api-secret <secret>', 'exchange API secret')
|
|
6
|
+
.option('--permission-profile <profile>', 'funding|spot')
|
|
7
|
+
.option('--credential-ref <ref>', 'credential reference')
|
|
8
|
+
.option('--credential-type <type>', 'credential type')
|
|
9
|
+
.option('--verify-permissions', 'verify exchange permissions')
|
|
10
|
+
.option('--skip-permissions-probe', 'skip permissions probe')
|
|
11
|
+
.option('--bitfinex-base-url <url>', 'Bitfinex API base URL')
|
|
12
|
+
.option('--passphrase <value>', 'exchange passphrase')
|
|
13
|
+
.option('--metadata <json>', 'credential metadata JSON')
|
|
14
|
+
.option('--policy <json>', 'credential policy JSON');
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function attachDelegationOptions(cmd) {
|
|
2
|
+
return cmd
|
|
3
|
+
.option('--owner-address <addr>', 'owner address')
|
|
4
|
+
.option('--session-account-address <addr>', 'session account address')
|
|
5
|
+
.option('--token-address <addr>', 'token address')
|
|
6
|
+
.option('--max-usd-per-day <usd>', 'max USD per day')
|
|
7
|
+
.option('--period-duration <sec>', 'period duration seconds')
|
|
8
|
+
.option('--expiry-seconds <sec>', 'expiry seconds')
|
|
9
|
+
.option('--delegation-manager <addr>', 'delegation manager address')
|
|
10
|
+
.option('--delegation <json>', 'delegation JSON')
|
|
11
|
+
.option('--permission <json>', 'permission JSON')
|
|
12
|
+
.option('--permission-type <type>', 'permission type')
|
|
13
|
+
.option('--permission-data <json>', 'permission data JSON')
|
|
14
|
+
.option('--model-a-constraints <json>', 'model A constraints JSON')
|
|
15
|
+
.option('--permissions-expiry <value>', 'permissions expiry')
|
|
16
|
+
.option('--permissions-context <value>', 'permissions context')
|
|
17
|
+
.option('--session-account-type <type>', 'session account type')
|
|
18
|
+
.option('--verify', 'verify on-chain')
|
|
19
|
+
.option('--include-onchain', 'include on-chain data')
|
|
20
|
+
.option('--onchain', 'alias for include on-chain')
|
|
21
|
+
.option('--reason <text>', 'revoke reason');
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function attachExecutionOptions(cmd) {
|
|
2
|
+
return cmd
|
|
3
|
+
.option('--action <id>', 'action id')
|
|
4
|
+
.option('--params <json>', 'action params JSON')
|
|
5
|
+
.option('--catalog <id>', 'actions catalog id')
|
|
6
|
+
.option('--provider <id>', 'provider filter')
|
|
7
|
+
.option('--chain-id <id>', 'chain id')
|
|
8
|
+
.option('--idempotency-key <key>', 'idempotency key')
|
|
9
|
+
.option('--estimated-amount-usd <usd>', 'estimated amount USD')
|
|
10
|
+
.option('--broadcast', 'with run --run-mode self, sign and broadcast using OWS')
|
|
11
|
+
.option('--skip-preflight', 'skip preflight')
|
|
12
|
+
.option('--user-did <did>', 'user DID for managed paths')
|
|
13
|
+
.option('--allow-wallet-mismatch', 'bypass strict funded-wallet vs execution-wallet guard')
|
|
14
|
+
.option('--execution-scope <scope>', 'execution scope')
|
|
15
|
+
.option('--signer-method <method>', 'managed_wallet_server|byow|fanout_intent')
|
|
16
|
+
.option('--strategy-intent <intent>', 'single_wallet|fanout')
|
|
17
|
+
.option('--intent-id <id>', 'intent id')
|
|
18
|
+
.option('--execution-wallet-address <addr>', 'expected execution wallet')
|
|
19
|
+
.option('--effect-check <mode>', 'self-exec: strict|relaxed|off')
|
|
20
|
+
.option('--effect-check-retries <n>', 'effect check retries')
|
|
21
|
+
.option('--effect-check-wait-ms <ms>', 'effect check wait ms')
|
|
22
|
+
.option('--effect-token-in <addr>', 'effect check token in')
|
|
23
|
+
.option('--effect-token-out <addr>', 'effect check token out');
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Root-program globals only (also inherited by subcommands via opts merge). */
|
|
2
|
+
export function attachGlobalOptions(program) {
|
|
3
|
+
program
|
|
4
|
+
.option('-V, --version', 'print version number')
|
|
5
|
+
.option('--api-base <url>', 'Thirdfy API base URL')
|
|
6
|
+
.option('--mcp-base <url>', 'MCP base URL for bootstrap token issuance')
|
|
7
|
+
.option('--timeout <ms>', 'HTTP timeout in milliseconds')
|
|
8
|
+
.option('--env <file>', 'load environment variables from file')
|
|
9
|
+
.option('--json', 'stable machine-readable envelopes')
|
|
10
|
+
.option('--verbose', 'print adapter diagnostics')
|
|
11
|
+
.option('--run-mode <mode>', 'thirdfy | self | hybrid | agent_wallet')
|
|
12
|
+
.option('--hybrid-wallet-mode <mode>', 'self | agent_wallet (hybrid only)')
|
|
13
|
+
.option('--custody-mode <mode>', 'managed | external')
|
|
14
|
+
.option('--profile <name>', 'personal | builder | network');
|
|
15
|
+
return program;
|
|
16
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { attachGlobalOptions } from './global.mjs';
|
|
2
|
+
import { attachAuthOptions } from './auth.mjs';
|
|
3
|
+
import { attachExecutionOptions } from './execution.mjs';
|
|
4
|
+
import { attachDelegationOptions } from './delegation.mjs';
|
|
5
|
+
import { attachTrackingOptions } from './tracking.mjs';
|
|
6
|
+
import { attachWalletOptions } from './wallet.mjs';
|
|
7
|
+
import { attachBootstrapOptions } from './bootstrap.mjs';
|
|
8
|
+
import { attachCredentialsOptions } from './credentials.mjs';
|
|
9
|
+
import { attachAnalyticsOptions } from './analytics.mjs';
|
|
10
|
+
import { attachPolymarketOptions } from './polymarket.mjs';
|
|
11
|
+
import { attachAgentRegisterOptions } from './agent.mjs';
|
|
12
|
+
import { attachChainOptions } from './chains.mjs';
|
|
13
|
+
|
|
14
|
+
const BUNDLES = {
|
|
15
|
+
auth: attachAuthOptions,
|
|
16
|
+
execution: attachExecutionOptions,
|
|
17
|
+
delegation: attachDelegationOptions,
|
|
18
|
+
tracking: attachTrackingOptions,
|
|
19
|
+
wallet: attachWalletOptions,
|
|
20
|
+
bootstrap: attachBootstrapOptions,
|
|
21
|
+
credentials: attachCredentialsOptions,
|
|
22
|
+
analytics: attachAnalyticsOptions,
|
|
23
|
+
polymarket: attachPolymarketOptions,
|
|
24
|
+
agent: attachAgentRegisterOptions,
|
|
25
|
+
chains: attachChainOptions,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @param {import('commander').Command} cmd */
|
|
29
|
+
export function attachOptionBundles(cmd, bundleNames = []) {
|
|
30
|
+
for (const name of bundleNames) {
|
|
31
|
+
const fn = BUNDLES[name];
|
|
32
|
+
if (fn) fn(cmd);
|
|
33
|
+
}
|
|
34
|
+
return cmd;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { attachGlobalOptions, BUNDLES };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function attachTrackingOptions(cmd) {
|
|
2
|
+
return cmd
|
|
3
|
+
.option('--limit <n>', 'result limit')
|
|
4
|
+
.option('--network <id>', 'network id')
|
|
5
|
+
.option('--network-id <id>', 'network id')
|
|
6
|
+
.option('--chain-type <type>', 'chain type')
|
|
7
|
+
.option('--category <name>', 'category')
|
|
8
|
+
.option('--status <status>', 'track status')
|
|
9
|
+
.option('--source <source>', 'track source')
|
|
10
|
+
.option('--protocol <id>', 'protocol id')
|
|
11
|
+
.option('--namespace <name>', 'namespace')
|
|
12
|
+
.option('--action-type <type>', 'action type')
|
|
13
|
+
.option('--event-id <id>', 'event id')
|
|
14
|
+
.option('--amount-usd <usd>', 'amount USD')
|
|
15
|
+
.option('--tx-hash <hash>', 'transaction hash')
|
|
16
|
+
.option('--decision <json>', 'decision JSON')
|
|
17
|
+
.option('--proof <json>', 'proof JSON');
|
|
18
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function attachWalletOptions(cmd) {
|
|
2
|
+
return cmd
|
|
3
|
+
.option('--signed-tx-hex <hex>', 'signed transaction hex')
|
|
4
|
+
.option('--signed-tx <hex>', 'signed transaction hex alias')
|
|
5
|
+
.option('--rpc-url <url>', 'RPC URL')
|
|
6
|
+
.option('--ows-wallet-name <name>', 'OWS wallet name');
|
|
7
|
+
}
|