@thirdfy/agent-cli 0.1.44 → 0.1.46
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 +20 -0
- package/README.md +2 -1
- package/bin/thirdfy-agent.mjs +91 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@ All notable changes to `@thirdfy/agent-cli` are documented here. The format is b
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.1.46] - 2026-05-22
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- `polymarket status` uses `get_polymarket_funding_status` with `agentKey` from flags or `~/.thirdfy/config.json` so operators see the agent-owned deposit wallet and nested setup readiness (not the legacy server setup path).
|
|
12
|
+
- `polymarket dry-run` defaults to `place-polymarket-order` for preflight. Pairs with thirdfy-api-v2 **v3.4.37** CLOB derive-miss → create fallback.
|
|
13
|
+
|
|
14
|
+
## [0.1.45] - 2026-05-22
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Polymarket operator commands: `polymarket status` (wraps `get_polymarket_setup_status` with balance/geoblock flags), `polymarket setup` (onboarding plan + next-step guide), and `polymarket dry-run` (preflight for `place_polymarket_order`). Pairs with thirdfy-api-v2 **v3.4.35** EU egress readiness fields.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- [`docs/command-reference.md`](./docs/command-reference.md) documents the new Polymarket commands and agent-scoped setup status params.
|
|
23
|
+
- Polymarket commands default `--run-mode` via `flags.runMode` (`agent_wallet` when omitted) and use `parseBooleanFlag` for `--include-balance` / `--include-geoblock`.
|
|
24
|
+
- `polymarket setup --json` emits a single JSON envelope by embedding setup guidance in the preflight payload.
|
|
25
|
+
- Polymarket provider hints list `get_polymarket_onboarding_plan` in read/setup actions so `actions --provider polymarket --json` discovers the setup command's underlying action.
|
|
26
|
+
|
|
7
27
|
## [0.1.44] - 2026-05-20
|
|
8
28
|
|
|
9
29
|
### Added
|
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ npx @thirdfy/agent-cli --help
|
|
|
42
42
|
|
|
43
43
|
## Release notes
|
|
44
44
|
|
|
45
|
-
Version history and highlights: [CHANGELOG.md](./CHANGELOG.md). **v0.1.44** adds Aegis provider hints for Base and Unichain earn reads and fail-closed Engine writes (pairs with API **v3.4.28**). **v0.1.43** injects Hyperliquid `userAddress` from the managed execution wallet for solo `agent_wallet` reads when omitted (pairs with API **v3.4.27**). **v0.1.42** persists API `executionWallets` from email login, updates `doctor auth` / onboarding help for agent execution wallet funding vs owner embedded auth wallet, and documents Bridge2 `FUND_AGENT_EXECUTION_WALLET` remediation (pairs with API **v3.4.25**). **v0.1.41** documents Hyperliquid `get_hyperliquid_funding_status` as setup step 0, Bridge2 sender custody, and `deposit_hyperliquid_bridge --estimated-amount-usd` (pairs with API **v3.4.24**). **v0.1.40** fixes email/bootstrap credential persistence when the API returns nested registration payloads, so owner-session onboarding can save the hidden execution identity without exposing a raw agent API key. **v0.1.39** makes `agent_wallet` the fresh solo default, adds framework guidance for Hermes/OpenClaw/Claude Managed Agents, clarifies Gator/ERC-7710 delegation flows, and keeps BYOW/self plus hybrid/thirdfy mode switching explicit. **v0.1.38** is a **documentation and metadata patch**: it republishes to npm so the package homepage matches the updated `README.md` on `main`, and aligns root `package-lock.json` version fields with `package.json`. **v0.1.37** adds **email OTP** `thirdfy-agent login email` (send code, then complete with `--code --accept-terms`), **`help onboarding`**, **`doctor auth`**, **`wallet list`**, and **masked `whoami`** output so agents and operators get first-run guidance without dumping secrets. Earlier releases added provider discovery parity, portfolio analytics, managed-wallet swap normalization, and **self/build-tx** swap human-decimal `amountIn` parity when using `amountInHuman` + `tokenInDecimals`.
|
|
45
|
+
Version history and highlights: [CHANGELOG.md](./CHANGELOG.md). **v0.1.46** routes `polymarket status` through `get_polymarket_funding_status` with config `agentKey` and defaults dry-run to `place-polymarket-order` (pairs with API **v3.4.37**). **v0.1.45** adds `polymarket status`, `polymarket setup`, and `polymarket dry-run` for agent-scoped setup/geoblock preflight (pairs with API **v3.4.35**). **v0.1.44** adds Aegis provider hints for Base and Unichain earn reads and fail-closed Engine writes (pairs with API **v3.4.28**). **v0.1.43** injects Hyperliquid `userAddress` from the managed execution wallet for solo `agent_wallet` reads when omitted (pairs with API **v3.4.27**). **v0.1.42** persists API `executionWallets` from email login, updates `doctor auth` / onboarding help for agent execution wallet funding vs owner embedded auth wallet, and documents Bridge2 `FUND_AGENT_EXECUTION_WALLET` remediation (pairs with API **v3.4.25**). **v0.1.41** documents Hyperliquid `get_hyperliquid_funding_status` as setup step 0, Bridge2 sender custody, and `deposit_hyperliquid_bridge --estimated-amount-usd` (pairs with API **v3.4.24**). **v0.1.40** fixes email/bootstrap credential persistence when the API returns nested registration payloads, so owner-session onboarding can save the hidden execution identity without exposing a raw agent API key. **v0.1.39** makes `agent_wallet` the fresh solo default, adds framework guidance for Hermes/OpenClaw/Claude Managed Agents, clarifies Gator/ERC-7710 delegation flows, and keeps BYOW/self plus hybrid/thirdfy mode switching explicit. **v0.1.38** is a **documentation and metadata patch**: it republishes to npm so the package homepage matches the updated `README.md` on `main`, and aligns root `package-lock.json` version fields with `package.json`. **v0.1.37** adds **email OTP** `thirdfy-agent login email` (send code, then complete with `--code --accept-terms`), **`help onboarding`**, **`doctor auth`**, **`wallet list`**, and **masked `whoami`** output so agents and operators get first-run guidance without dumping secrets. Earlier releases added provider discovery parity, portfolio analytics, managed-wallet swap normalization, and **self/build-tx** swap human-decimal `amountIn` parity when using `amountInHuman` + `tokenInDecimals`.
|
|
46
46
|
|
|
47
47
|
**Maintainers — npm:** follow [docs/releasing.md](./docs/releasing.md). From a clone with gitignored `.env`, use `npm run publish:npm:local -- --dry-run` then `npm run publish:npm:local`. Or run `npm run release:npm` after exporting tokens in the shell. Never commit npm tokens — use [.env.example](./.env.example) as a template only.
|
|
48
48
|
|
|
@@ -294,6 +294,7 @@ Provider and venue guides are kept outside `README` so this page stays stable as
|
|
|
294
294
|
|
|
295
295
|
- 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)
|
|
296
296
|
- Execution: `preflight`, `run`, `intent-status`, `jeff preflight`, `jeff trade`, `jeff status`
|
|
297
|
+
- Polymarket: `polymarket status`, `polymarket setup`, `polymarket dry-run`
|
|
297
298
|
- Managed signer execution: `wallet execute`, `wallet sign`, `wallet submit`, `agent run`
|
|
298
299
|
- Profiles: `profile init`, `profile use`, `profile show`, `whoami`
|
|
299
300
|
- 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/bin/thirdfy-agent.mjs
CHANGED
|
@@ -219,6 +219,15 @@ async function main() {
|
|
|
219
219
|
case 'wallet list':
|
|
220
220
|
await commandWalletList(context, subFlags);
|
|
221
221
|
return;
|
|
222
|
+
case 'polymarket status':
|
|
223
|
+
await commandPolymarketStatus(context, subFlags);
|
|
224
|
+
return;
|
|
225
|
+
case 'polymarket setup':
|
|
226
|
+
await commandPolymarketSetup(context, subFlags);
|
|
227
|
+
return;
|
|
228
|
+
case 'polymarket dry-run':
|
|
229
|
+
await commandPolymarketDryRun(context, subFlags);
|
|
230
|
+
return;
|
|
222
231
|
default:
|
|
223
232
|
break;
|
|
224
233
|
}
|
|
@@ -594,6 +603,7 @@ function getTradingProviderHint(providerId) {
|
|
|
594
603
|
'get_polymarket_prices',
|
|
595
604
|
'get_polymarket_price_history',
|
|
596
605
|
'get_polymarket_setup_status',
|
|
606
|
+
'get_polymarket_onboarding_plan',
|
|
597
607
|
'get_polymarket_order',
|
|
598
608
|
'get_polymarket_user_orders',
|
|
599
609
|
],
|
|
@@ -603,7 +613,7 @@ function getTradingProviderHint(providerId) {
|
|
|
603
613
|
'get_polymarket_market or get_polymarket_markets',
|
|
604
614
|
'get_polymarket_order_book',
|
|
605
615
|
'get_polymarket_prices or get_polymarket_price_history',
|
|
606
|
-
'get_polymarket_setup_status before place_polymarket_order',
|
|
616
|
+
'get_polymarket_setup_status and get_polymarket_onboarding_plan before place_polymarket_order',
|
|
607
617
|
],
|
|
608
618
|
orderManagementActions: [
|
|
609
619
|
'place_polymarket_order',
|
|
@@ -613,6 +623,7 @@ function getTradingProviderHint(providerId) {
|
|
|
613
623
|
],
|
|
614
624
|
setupActions: [
|
|
615
625
|
'get_polymarket_setup_status',
|
|
626
|
+
'get_polymarket_onboarding_plan',
|
|
616
627
|
'agent_wallet_setup:ensure_agent_wallet_deposit_wallet',
|
|
617
628
|
'agent_wallet_setup:deploy_deposit_wallet_and_set_approvals',
|
|
618
629
|
'agent_wallet_setup:create_or_derive_clob_credentials',
|
|
@@ -1267,12 +1278,25 @@ async function commandPreflight(ctx, flags, capabilities) {
|
|
|
1267
1278
|
runMode,
|
|
1268
1279
|
resolvedAction: resolved.resolvedAction,
|
|
1269
1280
|
});
|
|
1281
|
+
const data = flags.__polymarketSetupGuide
|
|
1282
|
+
? {
|
|
1283
|
+
...normalized,
|
|
1284
|
+
setupGuide: {
|
|
1285
|
+
message:
|
|
1286
|
+
'Review onboarding plan output above. Run agent-wallet setup via API when liveOrderReady is false. Fund pUSD on deposit wallet before live orders.',
|
|
1287
|
+
nextCommands: [
|
|
1288
|
+
'thirdfy-agent polymarket status --agent-key <key> --json',
|
|
1289
|
+
'thirdfy-agent preflight --action get_polymarket_setup_status --params \'{"agentKey":"<key>","includeGeoblock":true}\' --json',
|
|
1290
|
+
],
|
|
1291
|
+
},
|
|
1292
|
+
}
|
|
1293
|
+
: normalized;
|
|
1270
1294
|
const preflightBlocked = !normalized.success && Boolean(normalized.preflightBlocked);
|
|
1271
1295
|
printEnvelope({
|
|
1272
1296
|
success: normalized.success,
|
|
1273
1297
|
code: normalized.success ? 'PREFLIGHT_OK' : preflightBlocked ? 'PREFLIGHT_BLOCKED' : 'PREFLIGHT_FAILED',
|
|
1274
1298
|
message: backendResult.message,
|
|
1275
|
-
data
|
|
1299
|
+
data,
|
|
1276
1300
|
meta: {
|
|
1277
1301
|
apiBase: ctx.apiBase,
|
|
1278
1302
|
catalog: flags.catalog || null,
|
|
@@ -4863,6 +4887,68 @@ function printEnvelope(payload) {
|
|
|
4863
4887
|
process.stdout.write(`${JSON.stringify(payload.data || {}, null, 2)}\n`);
|
|
4864
4888
|
}
|
|
4865
4889
|
|
|
4890
|
+
function resolveConfigAgentKey(flags) {
|
|
4891
|
+
const fromFlags = String(flags.agentKey || flags.agentApiKey || '').trim();
|
|
4892
|
+
if (fromFlags) return fromFlags;
|
|
4893
|
+
const config = loadProfileConfig();
|
|
4894
|
+
const fromAgent = String(config?.agent?.agentKey || '').trim();
|
|
4895
|
+
if (fromAgent) return fromAgent;
|
|
4896
|
+
return extractAgentKey(config);
|
|
4897
|
+
}
|
|
4898
|
+
|
|
4899
|
+
async function commandPolymarketStatus(ctx, flags) {
|
|
4900
|
+
const agentKey = resolveConfigAgentKey(flags);
|
|
4901
|
+
const capabilities = await negotiateCapabilities(ctx);
|
|
4902
|
+
if (!flags.runMode) flags.runMode = 'agent_wallet';
|
|
4903
|
+
if (agentKey) {
|
|
4904
|
+
flags.action = 'get_polymarket_funding_status';
|
|
4905
|
+
flags.params = JSON.stringify({
|
|
4906
|
+
agentKey,
|
|
4907
|
+
amountPusd: flags.amountPusd ? String(flags.amountPusd) : '5',
|
|
4908
|
+
includeSetupStatus: true,
|
|
4909
|
+
});
|
|
4910
|
+
} else {
|
|
4911
|
+
const params = {
|
|
4912
|
+
includeBalance: parseBooleanFlag(flags.includeBalance, true),
|
|
4913
|
+
includeGeoblock: parseBooleanFlag(flags.includeGeoblock, true),
|
|
4914
|
+
};
|
|
4915
|
+
flags.action = 'get_polymarket_setup_status';
|
|
4916
|
+
flags.params = JSON.stringify(params);
|
|
4917
|
+
}
|
|
4918
|
+
await commandPreflight(ctx, flags, capabilities);
|
|
4919
|
+
}
|
|
4920
|
+
|
|
4921
|
+
async function commandPolymarketSetup(ctx, flags) {
|
|
4922
|
+
const capabilities = await negotiateCapabilities(ctx);
|
|
4923
|
+
flags.action = 'get_polymarket_onboarding_plan';
|
|
4924
|
+
const agentKey = resolveConfigAgentKey(flags);
|
|
4925
|
+
flags.params =
|
|
4926
|
+
flags.params ||
|
|
4927
|
+
JSON.stringify({
|
|
4928
|
+
...(agentKey ? { agentKey } : {}),
|
|
4929
|
+
});
|
|
4930
|
+
if (!flags.runMode) flags.runMode = 'agent_wallet';
|
|
4931
|
+
flags.__polymarketSetupGuide = true;
|
|
4932
|
+
await commandPreflight(ctx, flags, capabilities);
|
|
4933
|
+
}
|
|
4934
|
+
|
|
4935
|
+
async function commandPolymarketDryRun(ctx, flags) {
|
|
4936
|
+
if (!flags.action) flags.action = 'place-polymarket-order';
|
|
4937
|
+
if (!flags.params) {
|
|
4938
|
+
printEnvelope({
|
|
4939
|
+
success: false,
|
|
4940
|
+
code: 'MISSING_PARAMS',
|
|
4941
|
+
message: 'Provide --params for place_polymarket_order dry-run (tokenID, price, size, side)',
|
|
4942
|
+
data: {},
|
|
4943
|
+
meta: { apiBase: ctx.apiBase },
|
|
4944
|
+
});
|
|
4945
|
+
process.exit(1);
|
|
4946
|
+
}
|
|
4947
|
+
const capabilities = await negotiateCapabilities(ctx);
|
|
4948
|
+
if (!flags.runMode) flags.runMode = 'agent_wallet';
|
|
4949
|
+
await commandPreflight(ctx, flags, capabilities);
|
|
4950
|
+
}
|
|
4951
|
+
|
|
4866
4952
|
function printHelp() {
|
|
4867
4953
|
const help = `
|
|
4868
4954
|
thirdfy-agent ${CLI_VERSION}
|
|
@@ -4900,6 +4986,9 @@ Core commands:
|
|
|
4900
4986
|
thirdfy-agent managed setup [--auth-token <token> | --owner-session-token <token>] --agent-key <key> [--run-mode thirdfy|hybrid|agent_wallet] [--token-address <addr>] [--max-usd-per-day <usd>] [--chain-id <id>] [--json]
|
|
4901
4987
|
thirdfy-agent wallet execute --agent-api-key <key> --user-did <did> --action <id> --params <json> [--chain-id <id>] [--idempotency-key <key>] [--wallet-address <expected>] [--allow-wallet-mismatch] [--json]
|
|
4902
4988
|
thirdfy-agent wallet list [--json]
|
|
4989
|
+
thirdfy-agent polymarket status [--agent-key <key>] [--amount-pusd <n>] [--json]
|
|
4990
|
+
thirdfy-agent polymarket setup [--agent-key <key>] [--params <json>] [--json]
|
|
4991
|
+
thirdfy-agent polymarket dry-run --params <json> [--action place_polymarket_order] [--json]
|
|
4903
4992
|
thirdfy-agent wallet sign --agent-api-key <key> --action <id> --params <json> [--chain-id <id>] [--json]
|
|
4904
4993
|
thirdfy-agent wallet submit --signed-tx-hex <hex> [--chain-id <id>] [--rpc-url <url>] [--json]
|
|
4905
4994
|
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]
|