@thirdfy/agent-cli 0.2.20 → 0.2.21
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 +6 -0
- package/README.md +4 -4
- package/package.json +1 -1
- package/src/cli/manifest.mjs +28 -0
- package/src/commands/consoleMandate.mjs +125 -0
- package/src/runtime/handlers.mjs +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to `@thirdfy/agent-cli` are documented here. The format is b
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.2.21] - 2026-07-05
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `console-mandate` command group: `status`, `draft`, `activate`, `revoke` for Console delegated execution (daily cap + expiry). Uses `/api/v1/console/delegation/*` and is separate from certified-agent `delegation *` commands. Pairs with Thirdfy API **v3.10.2+**.
|
|
12
|
+
|
|
7
13
|
## [0.2.20] - 2026-07-04
|
|
8
14
|
|
|
9
15
|
### Added
|
package/README.md
CHANGED
|
@@ -40,11 +40,11 @@ Run without global install:
|
|
|
40
40
|
npx @thirdfy/agent-cli --help
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
## What's new in v0.2.
|
|
43
|
+
## What's new in v0.2.21
|
|
44
44
|
|
|
45
|
-
- **Console
|
|
46
|
-
-
|
|
47
|
-
- Pairs with Thirdfy API **v3.10.
|
|
45
|
+
- **Console mandate:** `thirdfy-agent console-mandate status|draft|activate|revoke` for Console delegated execution with daily cap and expiry.
|
|
46
|
+
- Uses the same `/api/v1/console/delegation/*` routes as Console and Account. Separate from certified-agent `delegation *` commands.
|
|
47
|
+
- Pairs with Thirdfy API **v3.10.2+**. See [`docs/command-reference.md`](./docs/command-reference.md).
|
|
48
48
|
|
|
49
49
|
Older versions: see [CHANGELOG.md](./CHANGELOG.md) and [GitHub Releases](https://github.com/thirdfy/agent-cli/releases).
|
|
50
50
|
|
package/package.json
CHANGED
package/src/cli/manifest.mjs
CHANGED
|
@@ -377,6 +377,34 @@ export const CLI_MANIFEST = [
|
|
|
377
377
|
options: ['auth', 'execution'],
|
|
378
378
|
description: 'Redeem via delegation',
|
|
379
379
|
},
|
|
380
|
+
{
|
|
381
|
+
path: ['console-mandate', 'status'],
|
|
382
|
+
handler: 'commandConsoleMandateStatus',
|
|
383
|
+
tier: 'online',
|
|
384
|
+
options: ['auth', 'delegation'],
|
|
385
|
+
description: 'Console delegated execution status',
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
path: ['console-mandate', 'draft'],
|
|
389
|
+
handler: 'commandConsoleMandateDraft',
|
|
390
|
+
tier: 'online',
|
|
391
|
+
options: ['auth', 'delegation'],
|
|
392
|
+
description: 'Create Console mandate draft',
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
path: ['console-mandate', 'activate'],
|
|
396
|
+
handler: 'commandConsoleMandateActivate',
|
|
397
|
+
tier: 'online',
|
|
398
|
+
options: ['auth', 'delegation'],
|
|
399
|
+
description: 'Activate signed Console mandate',
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
path: ['console-mandate', 'revoke'],
|
|
403
|
+
handler: 'commandConsoleMandateRevoke',
|
|
404
|
+
tier: 'online',
|
|
405
|
+
options: ['auth', 'delegation'],
|
|
406
|
+
description: 'Revoke Console mandate',
|
|
407
|
+
},
|
|
380
408
|
{
|
|
381
409
|
path: ['credentials', 'upsert'],
|
|
382
410
|
handler: 'commandCredentialsUpsert',
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { requireFlag } from '../core/args.mjs';
|
|
2
|
+
import { apiGet, apiPost } from '../core/http.mjs';
|
|
3
|
+
|
|
4
|
+
export function createConsoleMandateCommands(deps) {
|
|
5
|
+
const { buildOwnerAuthHeaders, printEnvelope } = deps;
|
|
6
|
+
|
|
7
|
+
async function commandConsoleMandateStatus(ctx, flags) {
|
|
8
|
+
const authHeaders = buildOwnerAuthHeaders(
|
|
9
|
+
flags,
|
|
10
|
+
'Missing --auth-token/--owner-session-token for console mandate status',
|
|
11
|
+
);
|
|
12
|
+
const chainId = Number(flags.chainId || 8453);
|
|
13
|
+
const walletAddress = String(flags.walletAddress || flags.ownerAddress || '').trim();
|
|
14
|
+
const query = new URLSearchParams({ chainId: String(chainId) });
|
|
15
|
+
if (walletAddress) query.set('walletAddress', walletAddress);
|
|
16
|
+
const response = await apiGet(ctx, `/api/v1/console/delegation/status?${query.toString()}`, {
|
|
17
|
+
...authHeaders,
|
|
18
|
+
headers: {
|
|
19
|
+
...(authHeaders.headers || {}),
|
|
20
|
+
'x-thirdfy-surface': 'cli',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
printEnvelope({
|
|
24
|
+
success: Boolean(response?.success !== false),
|
|
25
|
+
code: 'CONSOLE_MANDATE_STATUS',
|
|
26
|
+
message: 'Console delegated execution status',
|
|
27
|
+
data: response?.data || response,
|
|
28
|
+
meta: { apiBase: ctx.apiBase },
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function commandConsoleMandateDraft(ctx, flags) {
|
|
33
|
+
const authHeaders = buildOwnerAuthHeaders(
|
|
34
|
+
flags,
|
|
35
|
+
'Missing --auth-token/--owner-session-token for console mandate draft',
|
|
36
|
+
);
|
|
37
|
+
const payload = {
|
|
38
|
+
ownerAddress: requireFlag(flags, 'ownerAddress', 'Missing --owner-address'),
|
|
39
|
+
chainId: Number(flags.chainId || 8453),
|
|
40
|
+
maxUsdPerDay: Number(requireFlag(flags, 'maxUsdPerDay', 'Missing --max-usd-per-day')),
|
|
41
|
+
expirySeconds: Number(flags.expirySeconds || 30 * 24 * 60 * 60),
|
|
42
|
+
tokenAddress: flags.tokenAddress,
|
|
43
|
+
periodDuration: Number(flags.periodDuration || 86_400),
|
|
44
|
+
};
|
|
45
|
+
const response = await apiPost(ctx, '/api/v1/console/delegation/draft', payload, {
|
|
46
|
+
...authHeaders,
|
|
47
|
+
headers: {
|
|
48
|
+
...(authHeaders.headers || {}),
|
|
49
|
+
'x-thirdfy-surface': 'cli',
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
printEnvelope({
|
|
53
|
+
success: Boolean(response?.success !== false),
|
|
54
|
+
code: 'CONSOLE_MANDATE_DRAFT',
|
|
55
|
+
message: 'Console mandate draft created',
|
|
56
|
+
data: response?.data || response,
|
|
57
|
+
meta: { apiBase: ctx.apiBase },
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function commandConsoleMandateActivate(ctx, flags) {
|
|
62
|
+
const authHeaders = buildOwnerAuthHeaders(
|
|
63
|
+
flags,
|
|
64
|
+
'Missing --auth-token/--owner-session-token for console mandate activate',
|
|
65
|
+
);
|
|
66
|
+
const payload = {
|
|
67
|
+
walletAddress: requireFlag(flags, 'walletAddress', 'Missing --wallet-address'),
|
|
68
|
+
chainId: Number(flags.chainId || 8453),
|
|
69
|
+
delegationManager: requireFlag(flags, 'delegationManager', 'Missing --delegation-manager'),
|
|
70
|
+
delegation: JSON.parse(requireFlag(flags, 'delegation', 'Missing --delegation JSON')),
|
|
71
|
+
signature: requireFlag(flags, 'signature', 'Missing --signature'),
|
|
72
|
+
permissionsExpiry: flags.permissionsExpiry,
|
|
73
|
+
maxUsdPerDay: Number(requireFlag(flags, 'maxUsdPerDay', 'Missing --max-usd-per-day')),
|
|
74
|
+
periodDuration: Number(flags.periodDuration || 86_400),
|
|
75
|
+
tokenAddress: flags.tokenAddress,
|
|
76
|
+
};
|
|
77
|
+
const response = await apiPost(ctx, '/api/v1/console/delegation/activate', payload, {
|
|
78
|
+
...authHeaders,
|
|
79
|
+
headers: {
|
|
80
|
+
...(authHeaders.headers || {}),
|
|
81
|
+
'x-thirdfy-surface': 'cli',
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
printEnvelope({
|
|
85
|
+
success: Boolean(response?.success !== false),
|
|
86
|
+
code: 'CONSOLE_MANDATE_ACTIVATED',
|
|
87
|
+
message: 'Console mandate activated',
|
|
88
|
+
data: response?.data || response,
|
|
89
|
+
meta: { apiBase: ctx.apiBase },
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async function commandConsoleMandateRevoke(ctx, flags) {
|
|
94
|
+
const authHeaders = buildOwnerAuthHeaders(
|
|
95
|
+
flags,
|
|
96
|
+
'Missing --auth-token/--owner-session-token for console mandate revoke',
|
|
97
|
+
);
|
|
98
|
+
const payload = {
|
|
99
|
+
walletAddress: flags.walletAddress,
|
|
100
|
+
chainId: Number(flags.chainId || 8453),
|
|
101
|
+
reason: flags.reason || 'cli_revoked',
|
|
102
|
+
};
|
|
103
|
+
const response = await apiPost(ctx, '/api/v1/console/delegation/revoke', payload, {
|
|
104
|
+
...authHeaders,
|
|
105
|
+
headers: {
|
|
106
|
+
...(authHeaders.headers || {}),
|
|
107
|
+
'x-thirdfy-surface': 'cli',
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
printEnvelope({
|
|
111
|
+
success: Boolean(response?.success !== false),
|
|
112
|
+
code: 'CONSOLE_MANDATE_REVOKED',
|
|
113
|
+
message: 'Console mandate revoked',
|
|
114
|
+
data: response?.data || response,
|
|
115
|
+
meta: { apiBase: ctx.apiBase },
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
commandConsoleMandateStatus,
|
|
121
|
+
commandConsoleMandateDraft,
|
|
122
|
+
commandConsoleMandateActivate,
|
|
123
|
+
commandConsoleMandateRevoke,
|
|
124
|
+
};
|
|
125
|
+
}
|
package/src/runtime/handlers.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { createLighterHelpers } from '../commands/lighter.mjs';
|
|
|
6
6
|
import { createExecuteCommands } from '../commands/execute.mjs';
|
|
7
7
|
import { createWalletCommands } from '../commands/wallet.mjs';
|
|
8
8
|
import { createDelegationCommands } from '../commands/delegation.mjs';
|
|
9
|
+
import { createConsoleMandateCommands } from '../commands/consoleMandate.mjs';
|
|
9
10
|
import { createBootstrapCommands } from '../commands/bootstrap.mjs';
|
|
10
11
|
import { createDiscoveryCommands } from '../commands/discovery.mjs';
|
|
11
12
|
import { createCreditsCommands } from '../commands/credits.mjs';
|
|
@@ -156,6 +157,11 @@ export function createRuntimeHandlers(deps) {
|
|
|
156
157
|
commandRun: __execute.commandRun,
|
|
157
158
|
});
|
|
158
159
|
|
|
160
|
+
const __consoleMandate = createConsoleMandateCommands({
|
|
161
|
+
buildOwnerAuthHeaders,
|
|
162
|
+
printEnvelope,
|
|
163
|
+
});
|
|
164
|
+
|
|
159
165
|
const __polymarket = createPolymarketCommands({
|
|
160
166
|
commandPreflight: __execute.commandPreflight,
|
|
161
167
|
printEnvelope,
|
|
@@ -184,6 +190,7 @@ export function createRuntimeHandlers(deps) {
|
|
|
184
190
|
...__execute,
|
|
185
191
|
...__wallet,
|
|
186
192
|
...__delegation,
|
|
193
|
+
...__consoleMandate,
|
|
187
194
|
...__polymarket,
|
|
188
195
|
...__hummingbot,
|
|
189
196
|
...__bootstrap,
|