@thirdfy/agent-cli 0.2.14 → 0.2.16
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 +12 -0
- package/README.md +3 -2
- package/package.json +1 -1
- package/src/cli/help.mjs +9 -0
- package/src/cli/manifest.mjs +60 -0
- package/src/cli/options/credits.mjs +15 -0
- package/src/cli/options/hummingbot.mjs +8 -0
- package/src/cli/options/index.mjs +4 -0
- package/src/commands/credits.mjs +134 -0
- package/src/commands/hummingbot.mjs +79 -0
- package/src/commands/index.mjs +1 -0
- package/src/runtime/handlers.mjs +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ All notable changes to `@thirdfy/agent-cli` are documented here. The format is b
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.2.16] - 2026-06-30
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `credits` command group: `balance`, `transactions` (with `includeMetadata`), `usage`, `models list`, `models estimate`, and `pricing quote`. Passes `toolCallsList` into pricing estimate for action-tier line items. Pairs with Thirdfy API **v3.8.2+** and `thirdfy-mcp` **v0.0.65+**.
|
|
12
|
+
|
|
13
|
+
## [0.2.15] - 2026-06-26
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- Hummingbot API provider: `hummingbot` command group (`status`, `connectors`, `executor-schema`, `executor-create`) and provider runbook [`docs/providers/hummingbot.md`](./docs/providers/hummingbot.md). Pairs with Thirdfy API **v3.6.0+** (governed `/api/v1/agent/hummingbot/*` proxy) and `thirdfy-mcp` **v0.0.64+**.
|
|
18
|
+
|
|
7
19
|
## [0.2.14] - 2026-06-24
|
|
8
20
|
|
|
9
21
|
### Changed
|
package/README.md
CHANGED
|
@@ -40,9 +40,9 @@ 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.16
|
|
44
44
|
|
|
45
|
-
-
|
|
45
|
+
- `credits` commands for balance, transactions (optional billing metadata), usage summary, model pricing, turn estimate, and action quote. Pairs with Thirdfy API **v3.8.2+** and `thirdfy-mcp` **v0.0.65+**.
|
|
46
46
|
|
|
47
47
|
Older versions: see [CHANGELOG.md](./CHANGELOG.md) and [GitHub Releases](https://github.com/thirdfy/agent-cli/releases).
|
|
48
48
|
|
|
@@ -304,6 +304,7 @@ Provider and venue guides are kept outside `README` so this page stays stable as
|
|
|
304
304
|
- Discovery: `catalogs list`, `actions` (optional `--provider`, `--chain-id`; see [`docs/command-reference.md`](./docs/command-reference.md) for trading vs earn vs prediction providers and case-insensitive matching)
|
|
305
305
|
- Execution: `preflight`, `run`, `intent-status`, `jeff preflight`, `jeff trade`, `jeff status`
|
|
306
306
|
- Polymarket: `polymarket status`, `polymarket setup`, `polymarket dry-run`
|
|
307
|
+
- Hummingbot: `hummingbot status`, `hummingbot connectors`, `hummingbot executor-schema`, `hummingbot executor-create`
|
|
307
308
|
- Managed signer execution: `wallet execute`, `wallet sign`, `wallet submit`, `agent run`
|
|
308
309
|
- Profiles: `profile init`, `profile use`, `profile show`, `whoami`
|
|
309
310
|
- Onboarding: `login email`, `help onboarding`, `doctor auth`, `wallet list`, `bootstrap begin`, `bootstrap complete`, `onboarding begin`, `onboarding complete`, `agent auth challenge`, `agent auth verify`, `agent register`, `agent key rotate`, `agent key revoke`, `developer bootstrap`
|
package/package.json
CHANGED
package/src/cli/help.mjs
CHANGED
|
@@ -38,6 +38,10 @@ Core commands:
|
|
|
38
38
|
thirdfy-agent polymarket status [--agent-key <key>] [--amount-pusd <n>] [--json]
|
|
39
39
|
thirdfy-agent polymarket setup [--agent-key <key>] [--params <json>] [--json]
|
|
40
40
|
thirdfy-agent polymarket dry-run --params <json> [--action place_polymarket_order] [--json]
|
|
41
|
+
thirdfy-agent hummingbot status [--org-id <id>] [--runtime-id <id>] [--agent-api-key <key>] [--json]
|
|
42
|
+
thirdfy-agent hummingbot connectors [--org-id <id>] [--json]
|
|
43
|
+
thirdfy-agent hummingbot executor-schema [--org-id <id>] [--executor-type position_executor] [--json]
|
|
44
|
+
thirdfy-agent hummingbot executor-create --agent-api-key <key> --user-did <did> [--org-id <id>] [--connector <name>] [--pair <pair>] [--params <json>] [--json]
|
|
41
45
|
thirdfy-agent wallet sign --agent-api-key <key> --action <id> --params <json> [--chain-id <id>] [--json]
|
|
42
46
|
thirdfy-agent wallet submit --signed-tx-hex <hex> [--chain-id <id>] [--rpc-url <url>] [--json]
|
|
43
47
|
thirdfy-agent agent run --agent-api-key <key> --action <id> --params <json> [--signer-method managed_wallet_server|byow|fanout_intent] [--strategy-intent single_wallet|fanout] [--run-mode <mode>] [--user-did <did>] [--json]
|
|
@@ -64,6 +68,11 @@ Core commands:
|
|
|
64
68
|
thirdfy-agent prompt "<natural language prompt>" [--json]
|
|
65
69
|
thirdfy-agent intent-status --intent-id <id> [--json]
|
|
66
70
|
thirdfy-agent credits balance --auth-token <token> [--json]
|
|
71
|
+
thirdfy-agent credits transactions --auth-token <token> [--page <n>] [--limit <n>] [--include-metadata] [--json]
|
|
72
|
+
thirdfy-agent credits usage --auth-token <token> [--range 7d|30d|90d] [--json]
|
|
73
|
+
thirdfy-agent models list --auth-token <token> [--json]
|
|
74
|
+
thirdfy-agent models estimate --auth-token <token> --model <key> [--input-tokens <n>] [--output-tokens <n>] [--json]
|
|
75
|
+
thirdfy-agent pricing quote --auth-token <token> --action <action-key> [--chain-id <id>] [--json]
|
|
67
76
|
|
|
68
77
|
Global flags:
|
|
69
78
|
--api-base <url> default: https://api.thirdfy.com
|
package/src/cli/manifest.mjs
CHANGED
|
@@ -92,6 +92,31 @@ export const CLI_MANIFEST = [
|
|
|
92
92
|
options: ['auth', 'execution', 'polymarket'],
|
|
93
93
|
description: 'Polymarket dry-run preflight',
|
|
94
94
|
},
|
|
95
|
+
{
|
|
96
|
+
path: ['hummingbot', 'status'],
|
|
97
|
+
handler: 'commandHummingbotStatus',
|
|
98
|
+
options: ['auth', 'hummingbot'],
|
|
99
|
+
description: 'Hummingbot instance health summary for an org',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
path: ['hummingbot', 'connectors'],
|
|
103
|
+
handler: 'commandHummingbotConnectors',
|
|
104
|
+
options: ['auth', 'hummingbot'],
|
|
105
|
+
description: 'List Hummingbot connectors for an org HB instance',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
path: ['hummingbot', 'executor-schema'],
|
|
109
|
+
handler: 'commandHummingbotExecutorSchema',
|
|
110
|
+
options: ['auth', 'hummingbot'],
|
|
111
|
+
description: 'Fetch Hummingbot executor config schema',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
path: ['hummingbot', 'executor-create'],
|
|
115
|
+
handler: 'commandHummingbotExecutorCreate',
|
|
116
|
+
tier: 'online',
|
|
117
|
+
options: ['auth', 'execution', 'hummingbot'],
|
|
118
|
+
description: 'Governed Hummingbot executor create via Thirdfy proxy',
|
|
119
|
+
},
|
|
95
120
|
// online
|
|
96
121
|
{
|
|
97
122
|
path: ['agent', 'run'],
|
|
@@ -136,6 +161,41 @@ export const CLI_MANIFEST = [
|
|
|
136
161
|
options: ['auth'],
|
|
137
162
|
description: 'Credits balance',
|
|
138
163
|
},
|
|
164
|
+
{
|
|
165
|
+
path: ['credits', 'transactions'],
|
|
166
|
+
handler: 'commandCreditsTransactions',
|
|
167
|
+
tier: 'online',
|
|
168
|
+
options: ['auth', 'credits'],
|
|
169
|
+
description: 'Paginated credit transactions with optional billing metadata',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
path: ['credits', 'usage'],
|
|
173
|
+
handler: 'commandCreditsUsage',
|
|
174
|
+
tier: 'online',
|
|
175
|
+
options: ['auth', 'credits'],
|
|
176
|
+
description: 'Credits usage summary by model, provider, and action',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
path: ['models', 'list'],
|
|
180
|
+
handler: 'commandModelsList',
|
|
181
|
+
tier: 'online',
|
|
182
|
+
options: ['auth'],
|
|
183
|
+
description: 'List model pricing from chat_model_catalog',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
path: ['models', 'estimate'],
|
|
187
|
+
handler: 'commandModelsEstimate',
|
|
188
|
+
tier: 'online',
|
|
189
|
+
options: ['auth', 'credits', 'execution'],
|
|
190
|
+
description: 'Estimate model and action credits before execution',
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
path: ['pricing', 'quote'],
|
|
194
|
+
handler: 'commandPricingQuote',
|
|
195
|
+
tier: 'online',
|
|
196
|
+
options: ['auth', 'execution'],
|
|
197
|
+
description: 'Quote action-tier credits for a catalog action',
|
|
198
|
+
},
|
|
139
199
|
{
|
|
140
200
|
path: ['data', 'summary'],
|
|
141
201
|
handler: 'commandDataSummary',
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function attachCreditsOptions(cmd) {
|
|
2
|
+
return cmd
|
|
3
|
+
.option('--page <n>', 'page number for transactions', '1')
|
|
4
|
+
.option('--limit <n>', 'page size for transactions', '20')
|
|
5
|
+
.option('--include-metadata', 'include unified billing metadata on transactions')
|
|
6
|
+
.option('--range <range>', 'usage summary range (7d, 30d, 90d)', '7d')
|
|
7
|
+
.option('--model <key>', 'chat model key for pricing estimate')
|
|
8
|
+
.option('--input-tokens <n>', 'estimated input tokens for pricing estimate', '0')
|
|
9
|
+
.option('--output-tokens <n>', 'estimated output tokens for pricing estimate', '0')
|
|
10
|
+
.option(
|
|
11
|
+
'--tool-calls <value>',
|
|
12
|
+
'tool call count or comma-separated AgentKit tool names for pricing estimate',
|
|
13
|
+
)
|
|
14
|
+
.option('--surface <surface>', 'billing surface (console, automation, cli, agent_api)', 'cli');
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function attachHummingbotOptions(cmd) {
|
|
2
|
+
return cmd
|
|
3
|
+
.option('--org-id <id>', 'Hummingbot org id (default: HUMMINGBOT_ORG_ID or default)')
|
|
4
|
+
.option('--runtime-id <id>', 'EarnClaw runtime id for health summary scoping')
|
|
5
|
+
.option('--executor-type <type>', 'Hummingbot executor type')
|
|
6
|
+
.option('--connector <name>', 'Hummingbot connector name')
|
|
7
|
+
.option('--pair <pair>', 'Hummingbot trading pair');
|
|
8
|
+
}
|
|
@@ -8,8 +8,10 @@ import { attachBootstrapOptions } from './bootstrap.mjs';
|
|
|
8
8
|
import { attachCredentialsOptions } from './credentials.mjs';
|
|
9
9
|
import { attachAnalyticsOptions } from './analytics.mjs';
|
|
10
10
|
import { attachPolymarketOptions } from './polymarket.mjs';
|
|
11
|
+
import { attachHummingbotOptions } from './hummingbot.mjs';
|
|
11
12
|
import { attachAgentRegisterOptions } from './agent.mjs';
|
|
12
13
|
import { attachChainOptions } from './chains.mjs';
|
|
14
|
+
import { attachCreditsOptions } from './credits.mjs';
|
|
13
15
|
|
|
14
16
|
const BUNDLES = {
|
|
15
17
|
auth: attachAuthOptions,
|
|
@@ -21,8 +23,10 @@ const BUNDLES = {
|
|
|
21
23
|
credentials: attachCredentialsOptions,
|
|
22
24
|
analytics: attachAnalyticsOptions,
|
|
23
25
|
polymarket: attachPolymarketOptions,
|
|
26
|
+
hummingbot: attachHummingbotOptions,
|
|
24
27
|
agent: attachAgentRegisterOptions,
|
|
25
28
|
chains: attachChainOptions,
|
|
29
|
+
credits: attachCreditsOptions,
|
|
26
30
|
};
|
|
27
31
|
|
|
28
32
|
/** @param {import('commander').Command} cmd */
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { requireFlag } from '../core/args.mjs';
|
|
2
|
+
import { apiGet, apiPost } from '../core/http.mjs';
|
|
3
|
+
|
|
4
|
+
function resolveToolCallsEstimate(flags) {
|
|
5
|
+
const raw = flags.toolCalls ?? flags.toolCallsList;
|
|
6
|
+
if (raw == null || raw === '') {
|
|
7
|
+
return { toolCalls: 0, toolCallsList: undefined };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const value = String(raw).trim();
|
|
11
|
+
if (!value) {
|
|
12
|
+
return { toolCalls: 0, toolCallsList: undefined };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (/^\d+$/.test(value)) {
|
|
16
|
+
return { toolCalls: Number(value), toolCallsList: undefined };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const toolCallsList = value
|
|
20
|
+
.split(',')
|
|
21
|
+
.map((entry) => entry.trim())
|
|
22
|
+
.filter(Boolean);
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
toolCalls: toolCallsList.length,
|
|
26
|
+
toolCallsList,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function createCreditsCommands({ printEnvelope, getAuthToken }) {
|
|
31
|
+
async function commandCreditsTransactions(ctx, flags) {
|
|
32
|
+
const authToken = getAuthToken(flags, 'Missing --auth-token (or THIRDFY_AUTH_TOKEN) for credits transactions');
|
|
33
|
+
const page = Number(flags.page || 1);
|
|
34
|
+
const limit = Number(flags.limit || 20);
|
|
35
|
+
const includeMetadata = flags.includeMetadata === true || flags.includeMetadata === 'true';
|
|
36
|
+
const response = await apiGet(
|
|
37
|
+
ctx,
|
|
38
|
+
`/api/v1/credits/transactions?page=${page}&limit=${limit}&includeMetadata=${includeMetadata}`,
|
|
39
|
+
{ Authorization: `Bearer ${authToken}` },
|
|
40
|
+
);
|
|
41
|
+
printEnvelope({
|
|
42
|
+
success: true,
|
|
43
|
+
code: 'OK',
|
|
44
|
+
message: 'Credit transactions loaded',
|
|
45
|
+
data: response,
|
|
46
|
+
meta: { apiBase: ctx.apiBase, page, limit, includeMetadata },
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function commandCreditsUsage(ctx, flags) {
|
|
51
|
+
const authToken = getAuthToken(flags, 'Missing --auth-token (or THIRDFY_AUTH_TOKEN) for credits usage');
|
|
52
|
+
const range = String(flags.range || '7d');
|
|
53
|
+
const response = await apiGet(ctx, `/api/v1/credits/usage/summary?range=${encodeURIComponent(range)}`, {
|
|
54
|
+
Authorization: `Bearer ${authToken}`,
|
|
55
|
+
});
|
|
56
|
+
printEnvelope({
|
|
57
|
+
success: true,
|
|
58
|
+
code: 'OK',
|
|
59
|
+
message: 'Credits usage summary loaded',
|
|
60
|
+
data: response,
|
|
61
|
+
meta: { apiBase: ctx.apiBase, range },
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function commandModelsList(ctx, flags) {
|
|
66
|
+
const authToken = getAuthToken(flags, 'Missing --auth-token (or THIRDFY_AUTH_TOKEN) for models list');
|
|
67
|
+
const response = await apiGet(ctx, '/api/v1/credits/pricing/models', {
|
|
68
|
+
Authorization: `Bearer ${authToken}`,
|
|
69
|
+
});
|
|
70
|
+
printEnvelope({
|
|
71
|
+
success: true,
|
|
72
|
+
code: 'OK',
|
|
73
|
+
message: 'Model pricing loaded',
|
|
74
|
+
data: response,
|
|
75
|
+
meta: { apiBase: ctx.apiBase },
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function commandModelsEstimate(ctx, flags) {
|
|
80
|
+
const authToken = getAuthToken(flags, 'Missing --auth-token (or THIRDFY_AUTH_TOKEN) for models estimate');
|
|
81
|
+
const modelKey = requireFlag(flags, 'model', 'Missing --model for models estimate');
|
|
82
|
+
const { toolCalls, toolCallsList } = resolveToolCallsEstimate(flags);
|
|
83
|
+
const response = await apiPost(
|
|
84
|
+
ctx,
|
|
85
|
+
'/api/v1/credits/pricing/estimate',
|
|
86
|
+
{
|
|
87
|
+
modelKey,
|
|
88
|
+
inputTokens: Number(flags.inputTokens || 0),
|
|
89
|
+
outputTokens: Number(flags.outputTokens || 0),
|
|
90
|
+
toolCalls,
|
|
91
|
+
toolCallsList,
|
|
92
|
+
chainId: Number(flags.chainId || 0) || undefined,
|
|
93
|
+
surface: flags.surface || 'cli',
|
|
94
|
+
},
|
|
95
|
+
{ Authorization: `Bearer ${authToken}` },
|
|
96
|
+
);
|
|
97
|
+
printEnvelope({
|
|
98
|
+
success: true,
|
|
99
|
+
code: 'OK',
|
|
100
|
+
message: 'Model estimate generated',
|
|
101
|
+
data: response,
|
|
102
|
+
meta: { apiBase: ctx.apiBase, modelKey },
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async function commandPricingQuote(ctx, flags) {
|
|
107
|
+
const authToken = getAuthToken(flags, 'Missing --auth-token (or THIRDFY_AUTH_TOKEN) for pricing quote');
|
|
108
|
+
const action = requireFlag(flags, 'action', 'Missing --action for pricing quote');
|
|
109
|
+
const response = await apiPost(
|
|
110
|
+
ctx,
|
|
111
|
+
'/api/v1/credits/pricing/quote',
|
|
112
|
+
{
|
|
113
|
+
actionKey: action,
|
|
114
|
+
chainId: Number(flags.chainId || 8453),
|
|
115
|
+
},
|
|
116
|
+
{ Authorization: `Bearer ${authToken}` },
|
|
117
|
+
);
|
|
118
|
+
printEnvelope({
|
|
119
|
+
success: true,
|
|
120
|
+
code: 'OK',
|
|
121
|
+
message: 'Action pricing quote generated',
|
|
122
|
+
data: response,
|
|
123
|
+
meta: { apiBase: ctx.apiBase, action },
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
commandCreditsTransactions,
|
|
129
|
+
commandCreditsUsage,
|
|
130
|
+
commandModelsList,
|
|
131
|
+
commandModelsEstimate,
|
|
132
|
+
commandPricingQuote,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { apiGet, apiPost } from '../core/http.mjs';
|
|
2
|
+
import { parseJsonFlag } from '../core/args.mjs';
|
|
3
|
+
import { resolveConfigAgentKey } from './polymarket.mjs';
|
|
4
|
+
|
|
5
|
+
function orgIdFromFlags(flags) {
|
|
6
|
+
return String(flags.orgId || flags.org_id || process.env.HUMMINGBOT_ORG_ID || 'default').trim();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function agentApiKeyFromFlags(flags, ctx) {
|
|
10
|
+
return String(flags.agentApiKey || flags.agent_api_key || ctx?.agentApiKey || '').trim();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function createHummingbotCommands({ printEnvelope }) {
|
|
14
|
+
async function commandHummingbotStatus(ctx, flags) {
|
|
15
|
+
const orgId = orgIdFromFlags(flags);
|
|
16
|
+
const agentApiKey = agentApiKeyFromFlags(flags, ctx);
|
|
17
|
+
const query = new URLSearchParams({ orgId });
|
|
18
|
+
if (flags.runtimeId) query.set('runtimeId', String(flags.runtimeId));
|
|
19
|
+
const headers = agentApiKey ? { 'x-agent-api-key': agentApiKey } : {};
|
|
20
|
+
const data = await apiGet(ctx, `/api/v1/agent/hummingbot/health/summary?${query.toString()}`, headers);
|
|
21
|
+
printEnvelope({ success: true, data, meta: { apiBase: ctx.apiBase, orgId } });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async function commandHummingbotConnectors(ctx, flags) {
|
|
25
|
+
const orgId = orgIdFromFlags(flags);
|
|
26
|
+
const data = await apiGet(ctx, `/api/v1/agent/hummingbot/connectors?orgId=${encodeURIComponent(orgId)}`);
|
|
27
|
+
printEnvelope({ success: true, data, meta: { apiBase: ctx.apiBase, orgId } });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function commandHummingbotExecutorSchema(ctx, flags) {
|
|
31
|
+
const orgId = orgIdFromFlags(flags);
|
|
32
|
+
const executorType = String(flags.executorType || flags.executor_type || 'position_executor');
|
|
33
|
+
const data = await apiGet(
|
|
34
|
+
ctx,
|
|
35
|
+
`/api/v1/agent/hummingbot/executors/types/${encodeURIComponent(executorType)}/config?orgId=${encodeURIComponent(orgId)}`
|
|
36
|
+
);
|
|
37
|
+
printEnvelope({ success: true, data, meta: { apiBase: ctx.apiBase, orgId, executorType } });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async function commandHummingbotExecutorCreate(ctx, flags) {
|
|
41
|
+
const orgId = orgIdFromFlags(flags);
|
|
42
|
+
const agentApiKey = agentApiKeyFromFlags(flags, ctx);
|
|
43
|
+
const userDid = String(flags.userDid || flags.user_did || '').trim();
|
|
44
|
+
const params = parseJsonFlag(flags, 'params') || {};
|
|
45
|
+
if (!agentApiKey || !userDid) {
|
|
46
|
+
printEnvelope({
|
|
47
|
+
success: false,
|
|
48
|
+
code: 'MISSING_AUTH',
|
|
49
|
+
message: 'Provide --agent-api-key and --user-did for governed executor create',
|
|
50
|
+
data: {},
|
|
51
|
+
});
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
const body = {
|
|
55
|
+
...params,
|
|
56
|
+
orgId,
|
|
57
|
+
userDid,
|
|
58
|
+
connector_name: flags.connector || params.connector_name,
|
|
59
|
+
trading_pair: flags.pair || params.trading_pair,
|
|
60
|
+
estimatedAmountUsd: Number(flags.estimatedAmountUsd || params.estimatedAmountUsd || 0),
|
|
61
|
+
type: flags.executorType || flags.executor_type || params.type || 'position_executor',
|
|
62
|
+
};
|
|
63
|
+
const data = await apiPost(
|
|
64
|
+
ctx,
|
|
65
|
+
'/api/v1/agent/hummingbot/executors',
|
|
66
|
+
body,
|
|
67
|
+
{ 'x-agent-api-key': agentApiKey }
|
|
68
|
+
);
|
|
69
|
+
printEnvelope({ success: true, data, meta: { apiBase: ctx.apiBase, orgId } });
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
commandHummingbotStatus,
|
|
74
|
+
commandHummingbotConnectors,
|
|
75
|
+
commandHummingbotExecutorSchema,
|
|
76
|
+
commandHummingbotExecutorCreate,
|
|
77
|
+
resolveHummingbotAgentKey: resolveConfigAgentKey,
|
|
78
|
+
};
|
|
79
|
+
}
|
package/src/commands/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { createPolymarketCommands, resolveConfigAgentKey } from './polymarket.mjs';
|
|
2
2
|
export { createHyperliquidHelpers } from './hyperliquid.mjs';
|
|
3
3
|
export { createLighterHelpers } from './lighter.mjs';
|
|
4
|
+
export { createHummingbotCommands } from './hummingbot.mjs';
|
|
4
5
|
export { createExecuteCommands } from './execute.mjs';
|
|
5
6
|
export { createWalletCommands } from './wallet.mjs';
|
|
6
7
|
export { createDelegationCommands } from './delegation.mjs';
|
package/src/runtime/handlers.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { negotiateCapabilities } from '../core/http.mjs';
|
|
2
2
|
import { createPolymarketCommands } from '../commands/polymarket.mjs';
|
|
3
|
+
import { createHummingbotCommands } from '../commands/hummingbot.mjs';
|
|
3
4
|
import { createHyperliquidHelpers } from '../commands/hyperliquid.mjs';
|
|
4
5
|
import { createLighterHelpers } from '../commands/lighter.mjs';
|
|
5
6
|
import { createExecuteCommands } from '../commands/execute.mjs';
|
|
@@ -7,6 +8,7 @@ import { createWalletCommands } from '../commands/wallet.mjs';
|
|
|
7
8
|
import { createDelegationCommands } from '../commands/delegation.mjs';
|
|
8
9
|
import { createBootstrapCommands } from '../commands/bootstrap.mjs';
|
|
9
10
|
import { createDiscoveryCommands } from '../commands/discovery.mjs';
|
|
11
|
+
import { createCreditsCommands } from '../commands/credits.mjs';
|
|
10
12
|
import { createTelemetryCommands } from '../commands/telemetry.mjs';
|
|
11
13
|
import { createCredentialsCommands } from '../commands/credentials.mjs';
|
|
12
14
|
import { createAgentCommands } from '../commands/agent.mjs';
|
|
@@ -55,6 +57,11 @@ export function createRuntimeHandlers(deps) {
|
|
|
55
57
|
resolveAgentApiKey,
|
|
56
58
|
});
|
|
57
59
|
|
|
60
|
+
const __credits = createCreditsCommands({
|
|
61
|
+
printEnvelope,
|
|
62
|
+
getAuthToken,
|
|
63
|
+
});
|
|
64
|
+
|
|
58
65
|
const __telemetry = createTelemetryCommands({
|
|
59
66
|
printEnvelope,
|
|
60
67
|
resolveAgentApiKey,
|
|
@@ -142,6 +149,10 @@ export function createRuntimeHandlers(deps) {
|
|
|
142
149
|
printEnvelope,
|
|
143
150
|
});
|
|
144
151
|
|
|
152
|
+
const __hummingbot = createHummingbotCommands({
|
|
153
|
+
printEnvelope,
|
|
154
|
+
});
|
|
155
|
+
|
|
145
156
|
const __bootstrap = createBootstrapCommands({
|
|
146
157
|
printEnvelope,
|
|
147
158
|
extractAgentApiKey,
|
|
@@ -160,6 +171,7 @@ export function createRuntimeHandlers(deps) {
|
|
|
160
171
|
...__wallet,
|
|
161
172
|
...__delegation,
|
|
162
173
|
...__polymarket,
|
|
174
|
+
...__hummingbot,
|
|
163
175
|
...__bootstrap,
|
|
164
176
|
...__discovery,
|
|
165
177
|
...__telemetry,
|
|
@@ -173,6 +185,11 @@ export function createRuntimeHandlers(deps) {
|
|
|
173
185
|
commandCatalogsList: __discovery.commandCatalogsList,
|
|
174
186
|
commandActions: __discovery.commandActions,
|
|
175
187
|
commandCreditsBalance: __discovery.commandCreditsBalance,
|
|
188
|
+
commandCreditsTransactions: __credits.commandCreditsTransactions,
|
|
189
|
+
commandCreditsUsage: __credits.commandCreditsUsage,
|
|
190
|
+
commandModelsList: __credits.commandModelsList,
|
|
191
|
+
commandModelsEstimate: __credits.commandModelsEstimate,
|
|
192
|
+
commandPricingQuote: __credits.commandPricingQuote,
|
|
176
193
|
commandDataSummary: __telemetry.commandDataSummary,
|
|
177
194
|
commandTrackList: __telemetry.commandTrackList,
|
|
178
195
|
commandTrackAction: __telemetry.commandTrackAction,
|