@thirdfy/agent-cli 0.2.13 → 0.2.15

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 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.15] - 2026-06-26
8
+
9
+ ### Added
10
+
11
+ - 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+**.
12
+
13
+ ## [0.2.14] - 2026-06-24
14
+
15
+ ### Changed
16
+
17
+ - HTTP client (`src/core/http.mjs`) retries once on **502/503/504** and timeout/abort errors with short jittered backoff. Pairs with Thirdfy API **v3.5.6+** Supabase REST resilience (`UPSTREAM_DB_UNAVAILABLE`).
18
+
7
19
  ## [0.2.13] - 2026-06-23
8
20
 
9
21
  ### Changed
package/README.md CHANGED
@@ -40,14 +40,9 @@ Run without global install:
40
40
  npx @thirdfy/agent-cli --help
41
41
  ```
42
42
 
43
- ## What's new in v0.2.13
43
+ ## What's new in v0.2.15
44
44
 
45
- - Lighter provider hints prioritize Base-first `complete_lighter_onboarding` and catalog-aligned action names for CCTP funding, API-key setup, and integrator approval. Pairs with Thirdfy API **v3.5.3+** and `thirdfy-mcp` **v0.0.62+**.
46
-
47
- ## What's new in v0.2.12
48
-
49
- - Lighter perps provider support: funding discovery, `complete_lighter_onboarding`, market/account reads, API-key setup, and signed perps order management via the `lighter` command group. Pairs with Thirdfy API **v3.5.2+**.
50
- - Provider parity validation and command reference updated for `provider=lighter` actions.
45
+ - `hummingbot` command group for governed Condor CEX executor ops: `status`, `connectors`, `executor-schema`, `executor-create`. Provider runbook at [`docs/providers/hummingbot.md`](./docs/providers/hummingbot.md). Pairs with Thirdfy API **v3.6.0+** and `thirdfy-mcp` **v0.0.64+**.
51
46
 
52
47
  Older versions: see [CHANGELOG.md](./CHANGELOG.md) and [GitHub Releases](https://github.com/thirdfy/agent-cli/releases).
53
48
 
@@ -309,6 +304,7 @@ Provider and venue guides are kept outside `README` so this page stays stable as
309
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)
310
305
  - Execution: `preflight`, `run`, `intent-status`, `jeff preflight`, `jeff trade`, `jeff status`
311
306
  - Polymarket: `polymarket status`, `polymarket setup`, `polymarket dry-run`
307
+ - Hummingbot: `hummingbot status`, `hummingbot connectors`, `hummingbot executor-schema`, `hummingbot executor-create`
312
308
  - Managed signer execution: `wallet execute`, `wallet sign`, `wallet submit`, `agent run`
313
309
  - Profiles: `profile init`, `profile use`, `profile show`, `whoami`
314
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thirdfy/agent-cli",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "description": "Thirdfy Agent CLI for onboarding, governance preflight, execute-intent, and status polling.",
5
5
  "type": "module",
6
6
  "bin": {
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]
@@ -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'],
@@ -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,6 +8,7 @@ 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';
13
14
 
@@ -21,6 +22,7 @@ const BUNDLES = {
21
22
  credentials: attachCredentialsOptions,
22
23
  analytics: attachAnalyticsOptions,
23
24
  polymarket: attachPolymarketOptions,
25
+ hummingbot: attachHummingbotOptions,
24
26
  agent: attachAgentRegisterOptions,
25
27
  chains: attachChainOptions,
26
28
  };
@@ -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
+ }
@@ -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/core/http.mjs CHANGED
@@ -4,6 +4,25 @@ import {
4
4
  resolveExecutionContextFromInput,
5
5
  } from './executionContext.mjs';
6
6
 
7
+ function sleep(ms) {
8
+ return new Promise((resolve) => setTimeout(resolve, ms));
9
+ }
10
+
11
+ function isRetryableApiStatus(statusCode) {
12
+ return statusCode === 502 || statusCode === 503 || statusCode === 504;
13
+ }
14
+
15
+ function isRetryableApiError(error) {
16
+ const statusCode = Number(error?.statusCode || 0);
17
+ const message = String(error?.message || '').toLowerCase();
18
+ return (
19
+ isRetryableApiStatus(statusCode) ||
20
+ error?.name === 'AbortError' ||
21
+ message.includes('abort') ||
22
+ message.includes('timeout')
23
+ );
24
+ }
25
+
7
26
  export async function apiGet(ctx, route, headers = {}) {
8
27
  return requestJson(ctx, route, { method: 'GET', headers: mergeExecutionContextHeaders(headers) });
9
28
  }
@@ -28,7 +47,7 @@ export async function apiPost(ctx, route, body, headers = {}) {
28
47
  });
29
48
  }
30
49
 
31
- export async function requestJson(ctx, route, init) {
50
+ async function requestJsonOnce(ctx, route, init) {
32
51
  const controller = new AbortController();
33
52
  const timeout = setTimeout(() => controller.abort(), ctx.timeoutMs);
34
53
  try {
@@ -50,6 +69,23 @@ export async function requestJson(ctx, route, init) {
50
69
  }
51
70
  }
52
71
 
72
+ export async function requestJson(ctx, route, init) {
73
+ let lastError = null;
74
+ for (let attempt = 0; attempt < 2; attempt += 1) {
75
+ try {
76
+ return await requestJsonOnce(ctx, route, init);
77
+ } catch (error) {
78
+ lastError = error;
79
+ if (attempt === 0 && isRetryableApiError(error)) {
80
+ await sleep(250 + Math.floor(Math.random() * 250));
81
+ continue;
82
+ }
83
+ throw error;
84
+ }
85
+ }
86
+ throw lastError || new Error('Request failed');
87
+ }
88
+
53
89
  export async function requestWithRouteFallback(ctx, options) {
54
90
  const routes = Array.isArray(options.routes) ? options.routes : [];
55
91
  let lastError = null;
@@ -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';
@@ -142,6 +143,10 @@ export function createRuntimeHandlers(deps) {
142
143
  printEnvelope,
143
144
  });
144
145
 
146
+ const __hummingbot = createHummingbotCommands({
147
+ printEnvelope,
148
+ });
149
+
145
150
  const __bootstrap = createBootstrapCommands({
146
151
  printEnvelope,
147
152
  extractAgentApiKey,
@@ -160,6 +165,7 @@ export function createRuntimeHandlers(deps) {
160
165
  ...__wallet,
161
166
  ...__delegation,
162
167
  ...__polymarket,
168
+ ...__hummingbot,
163
169
  ...__bootstrap,
164
170
  ...__discovery,
165
171
  ...__telemetry,