@thirdfy/agent-cli 0.1.42 → 0.1.44

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.44] - 2026-05-20
8
+
9
+ ### Added
10
+
11
+ - Aegis AgentKit provider hints for `get_aegis_pools`, pool/vault reads, and gated Engine writes on Base `8453` and Unichain `130` (fail-closed until partner Engine addresses/ABIs). Pairs with thirdfy-api-v2 **v3.4.28**.
12
+ - Hyperliquid provider hints list `search_hyperliquid_markets` for joined perps meta + mids discovery (pairs with API **v3.4.28**).
13
+
14
+ ## [0.1.43] - 2026-05-19
15
+
16
+ ### Changed
17
+
18
+ - Solo `agent_wallet` Hyperliquid account reads inject `userAddress` from the managed execution wallet via preflight when omitted (open orders, user state, funding status). Pairs with thirdfy-api-v2 **v3.4.27**.
19
+
7
20
  ## [0.1.42] - 2026-05-19
8
21
 
9
22
  ### Changed
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.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.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
 
@@ -479,6 +479,7 @@ function getTradingProviderHint(providerId) {
479
479
  readActions: [
480
480
  'get_hyperliquid_perps_meta',
481
481
  'get_hyperliquid_all_mids',
482
+ 'search_hyperliquid_markets',
482
483
  'get_hyperliquid_l2_book',
483
484
  'get_hyperliquid_candles',
484
485
  'get_hyperliquid_user_state',
@@ -540,7 +541,7 @@ function getTradingProviderHint(providerId) {
540
541
  laneCompatibility:
541
542
  'Use self only for setup signatures or Arbitrum funding transactions. Perps orders should use thirdfy, hybrid, or agent_wallet.',
542
543
  setupExample:
543
- 'actions --provider hyperliquid -> get_hyperliquid_funding_status -> get_hyperliquid_onboarding_plan -> prepare_hyperliquid_onboarding -> get_bridge_quote/execute_bridge if source is Base -> deposit_hyperliquid_bridge on 42161 -> approve_hyperliquid_agent -> approve_hyperliquid_builder_fee if required -> get_hyperliquid_setup_status',
544
+ 'actions --provider hyperliquid -> search_hyperliquid_markets (or get_hyperliquid_perps_meta + get_hyperliquid_all_mids) -> get_hyperliquid_funding_status -> get_hyperliquid_onboarding_plan -> prepare_hyperliquid_onboarding -> get_bridge_quote/execute_bridge if source is Base -> deposit_hyperliquid_bridge on 42161 -> approve_hyperliquid_agent -> approve_hyperliquid_builder_fee if required -> get_hyperliquid_setup_status',
544
545
  example:
545
546
  'thirdfy-agent actions --provider hyperliquid && thirdfy-agent preflight --action place_hyperliquid_perps_order --params \'{"coin":"ETH","isBuy":true,"size":0.01,"limitPx":3500,"orderType":"market"}\'',
546
547
  };
@@ -669,6 +670,9 @@ function getTradingProviderHint(providerId) {
669
670
  'get_earn_provider',
670
671
  'get_earn_position',
671
672
  'get_morpho_vaults',
673
+ 'get_aegis_pools',
674
+ 'get_aegis_pool_state',
675
+ 'get_aegis_vault_state',
672
676
  'get_curve_pools',
673
677
  'get_vaults_fyi_vaults',
674
678
  'get_yield_xyz_opportunities',
@@ -692,6 +696,27 @@ function getTradingProviderHint(providerId) {
692
696
  'thirdfy-agent actions --provider morpho && thirdfy-agent run --action deposit_earn_position --params \'{"providerId":"morpho","vaultAddress":"0x...","tokenAddress":"0x...","amount":"10","chainId":8453}\'',
693
697
  };
694
698
  }
699
+ if (provider === 'aegis') {
700
+ return {
701
+ provider,
702
+ category: 'earn',
703
+ canonicalReadAction: 'get_aegis_pools',
704
+ canonicalWriteAction: 'deposit_aegis_lender',
705
+ readActions: ['get_earn_opportunities', 'get_aegis_pools', 'get_aegis_pool_state', 'get_aegis_vault_state', 'get_earn_provider'],
706
+ orderManagementActions: [
707
+ 'deposit_aegis_lender',
708
+ 'redeem_aegis_lender',
709
+ 'open_aegis_vault_and_borrow',
710
+ 'repay_aegis_vault',
711
+ 'stabilize_aegis_vault',
712
+ ],
713
+ supportedChains: [8453, 130],
714
+ laneCompatibility:
715
+ 'Aegis reads are live on Base allowlisted pools and Unichain DFM defaults. Engine writes use AegisRouterV1 with router-only approvals and eth_call simulation; writes stay fail-closed until partner addresses, PoolKeys, Engine ABI/opcodes, and audit sign-off. Use agent_wallet / walletExecute for solo Hermes — not execute-intent.',
716
+ example:
717
+ 'thirdfy-agent actions --provider aegis --chain-id 8453 --json && thirdfy-agent run --action get_aegis_pool_state --run-mode agent_wallet --params \'{"pool":"tfy-usdc","chainId":8453}\'',
718
+ };
719
+ }
695
720
  if (provider === 'curve') {
696
721
  return {
697
722
  provider,
@@ -751,6 +776,7 @@ function getCachedProviderHintFromCapabilities(provider) {
751
776
  prediction: 'place_prediction_order',
752
777
  earn: 'deposit_earn_position',
753
778
  morpho: 'deposit_earn_position',
779
+ aegis: 'deposit_aegis_lender',
754
780
  curve: 'deposit_earn_position',
755
781
  'vaults-fyi': 'deposit_earn_position',
756
782
  'yield-xyz': 'deposit_earn_position',
@@ -758,6 +784,7 @@ function getCachedProviderHintFromCapabilities(provider) {
758
784
  const canonicalReadActions = {
759
785
  earn: 'get_earn_opportunities',
760
786
  morpho: 'get_morpho_vaults',
787
+ aegis: 'get_aegis_pools',
761
788
  curve: 'get_curve_pools',
762
789
  'vaults-fyi': 'get_vaults_fyi_vaults',
763
790
  'yield-xyz': 'get_yield_xyz_opportunities',
@@ -1001,6 +1028,45 @@ function getPreparedParams(flags) {
1001
1028
  return parseJsonFlag(flags, 'params');
1002
1029
  }
1003
1030
 
1031
+ function hyperliquidDefaultAddressParamForAction(action) {
1032
+ const canonical = String(action || '').trim().toLowerCase().replace(/_/g, '-');
1033
+ if (
1034
+ canonical === 'get-hyperliquid-open-orders'
1035
+ || canonical === 'get-hyperliquid-user-state'
1036
+ || canonical === 'get-hyperliquid-builder-fee-status'
1037
+ || canonical === 'get-hyperliquid-referral-status'
1038
+ ) {
1039
+ return 'userAddress';
1040
+ }
1041
+ if (
1042
+ canonical === 'get-hyperliquid-setup-status'
1043
+ || canonical === 'get-hyperliquid-funding-status'
1044
+ || canonical === 'get-hyperliquid-onboarding-plan'
1045
+ || canonical === 'prepare-hyperliquid-onboarding'
1046
+ ) {
1047
+ return 'mainWalletAddress';
1048
+ }
1049
+ return null;
1050
+ }
1051
+
1052
+ async function applyHyperliquidAgentWalletAddressDefault(ctx, flags, resolved, runMode) {
1053
+ if (runMode !== 'agent_wallet') return null;
1054
+ const paramName = hyperliquidDefaultAddressParamForAction(resolved?.resolvedAction);
1055
+ if (!paramName) return null;
1056
+ const params = getPreparedParams(flags);
1057
+ if (String(params?.[paramName] || '').trim()) return null;
1058
+ const preflight = await resolveManagedExecutionPreflight(ctx, flags, resolved, {
1059
+ runMode: 'agent_wallet',
1060
+ requireFundingCheck: false,
1061
+ });
1062
+ if (!preflight.success || !preflight.executionWalletAddress) return preflight;
1063
+ flags.__preparedParams = {
1064
+ ...(params || {}),
1065
+ [paramName]: preflight.executionWalletAddress,
1066
+ };
1067
+ return preflight;
1068
+ }
1069
+
1004
1070
  async function commandCatalogsList(ctx, flags, capabilities) {
1005
1071
  const response = await apiGet(ctx, '/api/v1/agent/actions/catalog');
1006
1072
  const actions = extractActions(response);
@@ -1194,7 +1260,8 @@ async function commandPreflight(ctx, flags, capabilities) {
1194
1260
  enforceOffchainVenueLaneCompatibility(resolved.resolvedAction, runMode);
1195
1261
  const hybridWalletMode = runMode === 'hybrid' ? normalizeHybridWalletMode(flags.hybridWalletMode) : null;
1196
1262
  enforceChainCompatibility(capabilities, flags, runMode);
1197
- const backendResult = await runPreflightByMode(runMode, ctx, flags, resolved, { hybridWalletMode });
1263
+ const managedPreflight = await applyHyperliquidAgentWalletAddressDefault(ctx, flags, resolved, runMode);
1264
+ const backendResult = await runPreflightByMode(runMode, ctx, flags, resolved, { hybridWalletMode, managedPreflight });
1198
1265
  const normalized = applyExecutionFallbackHints(backendResult.normalized, {
1199
1266
  flags,
1200
1267
  runMode,
@@ -1229,10 +1296,12 @@ async function commandRun(ctx, flags, capabilities) {
1229
1296
  enforceOffchainVenueLaneCompatibility(resolved.resolvedAction, runMode);
1230
1297
  const hybridWalletMode = runMode === 'hybrid' ? normalizeHybridWalletMode(flags.hybridWalletMode) : null;
1231
1298
  enforceChainCompatibility(capabilities, flags, runMode);
1299
+ const managedPreflight = await applyHyperliquidAgentWalletAddressDefault(ctx, flags, resolved, runMode);
1232
1300
  const skipPreflight = Boolean(flags.skipPreflight);
1233
1301
  const backendResult = await runExecutionByMode(runMode, ctx, flags, resolved, {
1234
1302
  skipPreflight,
1235
1303
  hybridWalletMode,
1304
+ managedPreflight,
1236
1305
  });
1237
1306
  const normalized = applyExecutionFallbackHints(backendResult.normalized, {
1238
1307
  flags,
@@ -1327,8 +1396,9 @@ async function commandWalletExecute(ctx, flags, capabilities) {
1327
1396
  const resolved = await resolveActionSelection(ctx, normalizedFlags);
1328
1397
  prepareActionParamsForFlags(normalizedFlags, resolved.resolvedAction);
1329
1398
  enforceChainCompatibility(capabilities, normalizedFlags, 'agent_wallet');
1399
+ const managedPreflight = await applyHyperliquidAgentWalletAddressDefault(ctx, normalizedFlags, resolved, 'agent_wallet');
1330
1400
  const skipPreflight = Boolean(normalizedFlags.skipPreflight);
1331
- const result = await executeManagedWalletRun(ctx, normalizedFlags, resolved, { skipPreflight });
1401
+ const result = await executeManagedWalletRun(ctx, normalizedFlags, resolved, { skipPreflight, managedPreflight });
1332
1402
  printEnvelope({
1333
1403
  success: result.success,
1334
1404
  code: result.success ? 'WALLET_EXECUTED' : result.preflightBlocked ? 'PREFLIGHT_BLOCKED' : 'RUN_FAILED',
@@ -3358,6 +3428,7 @@ async function runPreflightByMode(runMode, ctx, flags, resolved, options = {}) {
3358
3428
  const preflight = await resolveManagedExecutionPreflight(ctx, flags, resolved, {
3359
3429
  runMode,
3360
3430
  requireFundingCheck: true,
3431
+ preflightSeed: options.managedPreflight,
3361
3432
  });
3362
3433
  const normalized = normalizeIntentResponse({
3363
3434
  success: preflight.success,
@@ -3569,6 +3640,7 @@ async function executeManagedWalletRun(ctx, flags, resolved, options) {
3569
3640
  preflight = await resolveManagedExecutionPreflight(ctx, flags, resolved, {
3570
3641
  runMode: 'agent_wallet',
3571
3642
  requireFundingCheck: true,
3643
+ preflightSeed: options?.managedPreflight,
3572
3644
  });
3573
3645
  if (!preflight.success) {
3574
3646
  const normalized = normalizeIntentResponse({
@@ -3821,9 +3893,21 @@ async function resolveManagedExecutionPreflight(ctx, flags, resolved, options =
3821
3893
  runMode,
3822
3894
  });
3823
3895
  if (tokenIn) query.set('tokenIn', tokenIn);
3824
- const response = await apiGet(ctx, `/api/v1/agent/execution-wallet?${query.toString()}`, {
3825
- 'x-agent-api-key': agentApiKey,
3826
- });
3896
+ const preflightSeed = options.preflightSeed && typeof options.preflightSeed === 'object'
3897
+ ? options.preflightSeed
3898
+ : null;
3899
+ if (preflightSeed && preflightSeed.success === false) {
3900
+ return preflightSeed;
3901
+ }
3902
+ const response = preflightSeed
3903
+ ? {
3904
+ executionWalletAddress: preflightSeed.executionWalletAddress || null,
3905
+ signerMethod: preflightSeed.signerMethod || null,
3906
+ fundingTokenBalance: preflightSeed.fundingTokenBalance || null,
3907
+ }
3908
+ : await apiGet(ctx, `/api/v1/agent/execution-wallet?${query.toString()}`, {
3909
+ 'x-agent-api-key': agentApiKey,
3910
+ });
3827
3911
  const executionWalletAddress = String(response?.executionWalletAddress || '').trim().toLowerCase();
3828
3912
  const signerMethod = String(response?.signerMethod || 'managed_wallet_server').trim();
3829
3913
  const rawBalance = String(response?.fundingTokenBalance?.raw || '').trim();
@@ -4028,6 +4112,7 @@ function inferActionProvider(action) {
4028
4112
  'get-governance-v2-breakdowns': 'governance-v2',
4029
4113
  'get-hyperliquid-perps-meta': 'hyperliquid',
4030
4114
  'get-hyperliquid-all-mids': 'hyperliquid',
4115
+ 'search-hyperliquid-markets': 'hyperliquid',
4031
4116
  'get-hyperliquid-l2-book': 'hyperliquid',
4032
4117
  'get-hyperliquid-candles': 'hyperliquid',
4033
4118
  'get-hyperliquid-user-state': 'hyperliquid',
@@ -4064,6 +4149,14 @@ function inferActionProvider(action) {
4064
4149
  'get-curve-pool-details': 'curve',
4065
4150
  'deposit-curve-pool': 'curve',
4066
4151
  'withdraw-curve-pool': 'curve',
4152
+ 'get-aegis-pools': 'aegis',
4153
+ 'get-aegis-pool-state': 'aegis',
4154
+ 'get-aegis-vault-state': 'aegis',
4155
+ 'deposit-aegis-lender': 'aegis',
4156
+ 'redeem-aegis-lender': 'aegis',
4157
+ 'open-aegis-vault-and-borrow': 'aegis',
4158
+ 'repay-aegis-vault': 'aegis',
4159
+ 'stabilize-aegis-vault': 'aegis',
4067
4160
  'get-vaults-fyi-vaults': 'vaults-fyi',
4068
4161
  'get-vaults-fyi-opportunities': 'vaults-fyi',
4069
4162
  'get-yield-xyz-opportunities': 'yield-xyz',
@@ -4098,6 +4191,7 @@ function inferActionProvider(action) {
4098
4191
  if (key.includes('vaults-fyi')) return 'vaults-fyi';
4099
4192
  if (key.includes('yield-xyz')) return 'yield-xyz';
4100
4193
  if (key.includes('morpho')) return 'morpho';
4194
+ if (key.includes('aegis')) return 'aegis';
4101
4195
  if (key.includes('curve')) return 'curve';
4102
4196
  if (key.includes('earn') || key.includes('yield') || key.includes('vault')) return 'earn';
4103
4197
  if (key.includes('bridge')) return 'bridge';
@@ -4148,9 +4242,9 @@ function actionMatchesProvider(action, requestedProvider, allActions) {
4148
4242
  if (requestedProvider === 'bridge') return isProviderActionKey(action, 'bridge');
4149
4243
  if (requestedProvider.startsWith('dogeos')) return isProviderActionKey(action, requestedProvider);
4150
4244
  if (requestedProvider === 'earn') {
4151
- return provider === 'earn' || provider === 'morpho' || provider === 'curve' || provider === 'vaults-fyi' || provider === 'yield-xyz' || isEarnCatalogAction(action);
4245
+ return provider === 'earn' || provider === 'morpho' || provider === 'aegis' || provider === 'curve' || provider === 'vaults-fyi' || provider === 'yield-xyz' || isEarnCatalogAction(action);
4152
4246
  }
4153
- if (requestedProvider === 'morpho' || requestedProvider === 'curve' || requestedProvider === 'vaults-fyi' || requestedProvider === 'yield-xyz') {
4247
+ if (requestedProvider === 'morpho' || requestedProvider === 'aegis' || requestedProvider === 'curve' || requestedProvider === 'vaults-fyi' || requestedProvider === 'yield-xyz') {
4154
4248
  const hasProtocolSpecificEarnRows = allActions.some((candidate) => getActionProviderWithInference(candidate) === requestedProvider);
4155
4249
  return isProviderActionKey(action, requestedProvider) || (!hasProtocolSpecificEarnRows && isEarnCatalogAction(action));
4156
4250
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thirdfy/agent-cli",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "description": "Thirdfy Agent CLI for onboarding, governance preflight, execute-intent, and status polling.",
5
5
  "type": "module",
6
6
  "bin": {