@thirdfy/agent-cli 0.1.42 → 0.1.43

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,12 @@ All notable changes to `@thirdfy/agent-cli` are documented here. The format is b
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.1.43] - 2026-05-19
8
+
9
+ ### Changed
10
+
11
+ - 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**.
12
+
7
13
  ## [0.1.42] - 2026-05-19
8
14
 
9
15
  ### 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.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
 
@@ -1001,6 +1001,45 @@ function getPreparedParams(flags) {
1001
1001
  return parseJsonFlag(flags, 'params');
1002
1002
  }
1003
1003
 
1004
+ function hyperliquidDefaultAddressParamForAction(action) {
1005
+ const canonical = String(action || '').trim().toLowerCase().replace(/_/g, '-');
1006
+ if (
1007
+ canonical === 'get-hyperliquid-open-orders'
1008
+ || canonical === 'get-hyperliquid-user-state'
1009
+ || canonical === 'get-hyperliquid-builder-fee-status'
1010
+ || canonical === 'get-hyperliquid-referral-status'
1011
+ ) {
1012
+ return 'userAddress';
1013
+ }
1014
+ if (
1015
+ canonical === 'get-hyperliquid-setup-status'
1016
+ || canonical === 'get-hyperliquid-funding-status'
1017
+ || canonical === 'get-hyperliquid-onboarding-plan'
1018
+ || canonical === 'prepare-hyperliquid-onboarding'
1019
+ ) {
1020
+ return 'mainWalletAddress';
1021
+ }
1022
+ return null;
1023
+ }
1024
+
1025
+ async function applyHyperliquidAgentWalletAddressDefault(ctx, flags, resolved, runMode) {
1026
+ if (runMode !== 'agent_wallet') return null;
1027
+ const paramName = hyperliquidDefaultAddressParamForAction(resolved?.resolvedAction);
1028
+ if (!paramName) return null;
1029
+ const params = getPreparedParams(flags);
1030
+ if (String(params?.[paramName] || '').trim()) return null;
1031
+ const preflight = await resolveManagedExecutionPreflight(ctx, flags, resolved, {
1032
+ runMode: 'agent_wallet',
1033
+ requireFundingCheck: false,
1034
+ });
1035
+ if (!preflight.success || !preflight.executionWalletAddress) return preflight;
1036
+ flags.__preparedParams = {
1037
+ ...(params || {}),
1038
+ [paramName]: preflight.executionWalletAddress,
1039
+ };
1040
+ return preflight;
1041
+ }
1042
+
1004
1043
  async function commandCatalogsList(ctx, flags, capabilities) {
1005
1044
  const response = await apiGet(ctx, '/api/v1/agent/actions/catalog');
1006
1045
  const actions = extractActions(response);
@@ -1194,7 +1233,8 @@ async function commandPreflight(ctx, flags, capabilities) {
1194
1233
  enforceOffchainVenueLaneCompatibility(resolved.resolvedAction, runMode);
1195
1234
  const hybridWalletMode = runMode === 'hybrid' ? normalizeHybridWalletMode(flags.hybridWalletMode) : null;
1196
1235
  enforceChainCompatibility(capabilities, flags, runMode);
1197
- const backendResult = await runPreflightByMode(runMode, ctx, flags, resolved, { hybridWalletMode });
1236
+ const managedPreflight = await applyHyperliquidAgentWalletAddressDefault(ctx, flags, resolved, runMode);
1237
+ const backendResult = await runPreflightByMode(runMode, ctx, flags, resolved, { hybridWalletMode, managedPreflight });
1198
1238
  const normalized = applyExecutionFallbackHints(backendResult.normalized, {
1199
1239
  flags,
1200
1240
  runMode,
@@ -1229,10 +1269,12 @@ async function commandRun(ctx, flags, capabilities) {
1229
1269
  enforceOffchainVenueLaneCompatibility(resolved.resolvedAction, runMode);
1230
1270
  const hybridWalletMode = runMode === 'hybrid' ? normalizeHybridWalletMode(flags.hybridWalletMode) : null;
1231
1271
  enforceChainCompatibility(capabilities, flags, runMode);
1272
+ const managedPreflight = await applyHyperliquidAgentWalletAddressDefault(ctx, flags, resolved, runMode);
1232
1273
  const skipPreflight = Boolean(flags.skipPreflight);
1233
1274
  const backendResult = await runExecutionByMode(runMode, ctx, flags, resolved, {
1234
1275
  skipPreflight,
1235
1276
  hybridWalletMode,
1277
+ managedPreflight,
1236
1278
  });
1237
1279
  const normalized = applyExecutionFallbackHints(backendResult.normalized, {
1238
1280
  flags,
@@ -1327,8 +1369,9 @@ async function commandWalletExecute(ctx, flags, capabilities) {
1327
1369
  const resolved = await resolveActionSelection(ctx, normalizedFlags);
1328
1370
  prepareActionParamsForFlags(normalizedFlags, resolved.resolvedAction);
1329
1371
  enforceChainCompatibility(capabilities, normalizedFlags, 'agent_wallet');
1372
+ const managedPreflight = await applyHyperliquidAgentWalletAddressDefault(ctx, normalizedFlags, resolved, 'agent_wallet');
1330
1373
  const skipPreflight = Boolean(normalizedFlags.skipPreflight);
1331
- const result = await executeManagedWalletRun(ctx, normalizedFlags, resolved, { skipPreflight });
1374
+ const result = await executeManagedWalletRun(ctx, normalizedFlags, resolved, { skipPreflight, managedPreflight });
1332
1375
  printEnvelope({
1333
1376
  success: result.success,
1334
1377
  code: result.success ? 'WALLET_EXECUTED' : result.preflightBlocked ? 'PREFLIGHT_BLOCKED' : 'RUN_FAILED',
@@ -3358,6 +3401,7 @@ async function runPreflightByMode(runMode, ctx, flags, resolved, options = {}) {
3358
3401
  const preflight = await resolveManagedExecutionPreflight(ctx, flags, resolved, {
3359
3402
  runMode,
3360
3403
  requireFundingCheck: true,
3404
+ preflightSeed: options.managedPreflight,
3361
3405
  });
3362
3406
  const normalized = normalizeIntentResponse({
3363
3407
  success: preflight.success,
@@ -3569,6 +3613,7 @@ async function executeManagedWalletRun(ctx, flags, resolved, options) {
3569
3613
  preflight = await resolveManagedExecutionPreflight(ctx, flags, resolved, {
3570
3614
  runMode: 'agent_wallet',
3571
3615
  requireFundingCheck: true,
3616
+ preflightSeed: options?.managedPreflight,
3572
3617
  });
3573
3618
  if (!preflight.success) {
3574
3619
  const normalized = normalizeIntentResponse({
@@ -3821,9 +3866,21 @@ async function resolveManagedExecutionPreflight(ctx, flags, resolved, options =
3821
3866
  runMode,
3822
3867
  });
3823
3868
  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
- });
3869
+ const preflightSeed = options.preflightSeed && typeof options.preflightSeed === 'object'
3870
+ ? options.preflightSeed
3871
+ : null;
3872
+ if (preflightSeed && preflightSeed.success === false) {
3873
+ return preflightSeed;
3874
+ }
3875
+ const response = preflightSeed
3876
+ ? {
3877
+ executionWalletAddress: preflightSeed.executionWalletAddress || null,
3878
+ signerMethod: preflightSeed.signerMethod || null,
3879
+ fundingTokenBalance: preflightSeed.fundingTokenBalance || null,
3880
+ }
3881
+ : await apiGet(ctx, `/api/v1/agent/execution-wallet?${query.toString()}`, {
3882
+ 'x-agent-api-key': agentApiKey,
3883
+ });
3827
3884
  const executionWalletAddress = String(response?.executionWalletAddress || '').trim().toLowerCase();
3828
3885
  const signerMethod = String(response?.signerMethod || 'managed_wallet_server').trim();
3829
3886
  const rawBalance = String(response?.fundingTokenBalance?.raw || '').trim();
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.43",
4
4
  "description": "Thirdfy Agent CLI for onboarding, governance preflight, execute-intent, and status polling.",
5
5
  "type": "module",
6
6
  "bin": {