@thirdfy/agent-cli 0.1.44 → 0.1.45

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,19 @@ All notable changes to `@thirdfy/agent-cli` are documented here. The format is b
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.1.45] - 2026-05-22
8
+
9
+ ### Added
10
+
11
+ - 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.
12
+
13
+ ### Changed
14
+
15
+ - [`docs/command-reference.md`](./docs/command-reference.md) documents the new Polymarket commands and agent-scoped setup status params.
16
+ - Polymarket commands default `--run-mode` via `flags.runMode` (`agent_wallet` when omitted) and use `parseBooleanFlag` for `--include-balance` / `--include-geoblock`.
17
+ - `polymarket setup --json` emits a single JSON envelope by embedding setup guidance in the preflight payload.
18
+ - Polymarket provider hints list `get_polymarket_onboarding_plan` in read/setup actions so `actions --provider polymarket --json` discovers the setup command's underlying action.
19
+
7
20
  ## [0.1.44] - 2026-05-20
8
21
 
9
22
  ### 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.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`
@@ -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: normalized,
1299
+ data,
1276
1300
  meta: {
1277
1301
  apiBase: ctx.apiBase,
1278
1302
  catalog: flags.catalog || null,
@@ -4863,6 +4887,46 @@ function printEnvelope(payload) {
4863
4887
  process.stdout.write(`${JSON.stringify(payload.data || {}, null, 2)}\n`);
4864
4888
  }
4865
4889
 
4890
+ async function commandPolymarketStatus(ctx, flags) {
4891
+ const params = {
4892
+ includeBalance: parseBooleanFlag(flags.includeBalance, true),
4893
+ includeGeoblock: parseBooleanFlag(flags.includeGeoblock, true),
4894
+ };
4895
+ if (flags.agentKey) params.agentKey = String(flags.agentKey);
4896
+ if (flags.amountPusd) params.amountPusd = String(flags.amountPusd);
4897
+ const capabilities = await negotiateCapabilities(ctx);
4898
+ flags.action = 'get_polymarket_setup_status';
4899
+ flags.params = JSON.stringify(params);
4900
+ if (!flags.runMode) flags.runMode = 'agent_wallet';
4901
+ await commandPreflight(ctx, flags, capabilities);
4902
+ }
4903
+
4904
+ async function commandPolymarketSetup(ctx, flags) {
4905
+ const capabilities = await negotiateCapabilities(ctx);
4906
+ flags.action = 'get_polymarket_onboarding_plan';
4907
+ flags.params = flags.params || JSON.stringify({ agentKey: flags.agentKey || undefined });
4908
+ if (!flags.runMode) flags.runMode = 'agent_wallet';
4909
+ flags.__polymarketSetupGuide = true;
4910
+ await commandPreflight(ctx, flags, capabilities);
4911
+ }
4912
+
4913
+ async function commandPolymarketDryRun(ctx, flags) {
4914
+ if (!flags.action) flags.action = 'place_polymarket_order';
4915
+ if (!flags.params) {
4916
+ printEnvelope({
4917
+ success: false,
4918
+ code: 'MISSING_PARAMS',
4919
+ message: 'Provide --params for place_polymarket_order dry-run (tokenID, price, size, side)',
4920
+ data: {},
4921
+ meta: { apiBase: ctx.apiBase },
4922
+ });
4923
+ process.exit(1);
4924
+ }
4925
+ const capabilities = await negotiateCapabilities(ctx);
4926
+ if (!flags.runMode) flags.runMode = 'agent_wallet';
4927
+ await commandPreflight(ctx, flags, capabilities);
4928
+ }
4929
+
4866
4930
  function printHelp() {
4867
4931
  const help = `
4868
4932
  thirdfy-agent ${CLI_VERSION}
@@ -4900,6 +4964,9 @@ Core commands:
4900
4964
  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
4965
  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
4966
  thirdfy-agent wallet list [--json]
4967
+ thirdfy-agent polymarket status [--agent-key <key>] [--amount-pusd <n>] [--json]
4968
+ thirdfy-agent polymarket setup [--agent-key <key>] [--params <json>] [--json]
4969
+ thirdfy-agent polymarket dry-run --params <json> [--action place_polymarket_order] [--json]
4903
4970
  thirdfy-agent wallet sign --agent-api-key <key> --action <id> --params <json> [--chain-id <id>] [--json]
4904
4971
  thirdfy-agent wallet submit --signed-tx-hex <hex> [--chain-id <id>] [--rpc-url <url>] [--json]
4905
4972
  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]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thirdfy/agent-cli",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "description": "Thirdfy Agent CLI for onboarding, governance preflight, execute-intent, and status polling.",
5
5
  "type": "module",
6
6
  "bin": {