@thirdfy/agent-cli 0.2.67 → 0.2.68

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.2.68] - 2026-09-16
8
+
9
+ ### Fixed
10
+
11
+ - Merge `--confirmWrites` / `--confirm` into execute params and default `estimatedAmountUsd` to `1` for `complete_avantis_onboarding` when omitted. Matches MCP `walletExecute` so Claude-style root confirmation reaches AgentKit. Pairs with `thirdfy-mcp` **0.0.118** and Thirdfy API **3.14.44**. Pin: `test/avantis-agent-wallet-defaults.test.cjs`.
12
+
7
13
  ## [0.2.67] - 2026-09-15
8
14
 
9
15
  ### Added
package/README.md CHANGED
@@ -40,10 +40,10 @@ Run without global install:
40
40
  npx @thirdfy/agent-cli --help
41
41
  ```
42
42
 
43
- ## What's new in v0.2.67
43
+ ## What's new in v0.2.68
44
44
 
45
- - `chat send` and `console-mandate` accept `--network arc-testnet` (chain 5042002), `arc-mainnet`, and `arc` (chain 5042).
46
- - `actions --provider arc` lists ERC-8183 job actions (`get_arc_job`, `create_arc_job`, budget, fund, submit, complete).
45
+ - Avantis `complete_avantis_onboarding` defaults `estimatedAmountUsd` to `1` when the caller omits it.
46
+ - `--confirmWrites` / `--confirm` merge into execute params so a Claude-style root confirmation reaches AgentKit.
47
47
  - See [CHANGELOG.md](./CHANGELOG.md) and GitHub Releases for older versions.
48
48
 
49
49
  ## Quick start
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thirdfy/agent-cli",
3
- "version": "0.2.67",
3
+ "version": "0.2.68",
4
4
  "description": "Thirdfy Agent CLI for onboarding, governance preflight, execute-intent, and status polling.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,6 +9,9 @@ export function attachExecutionOptions(cmd) {
9
9
  .option('--estimated-amount-usd <usd>', 'estimated amount USD')
10
10
  .option('--broadcast', 'with run --run-mode self, sign and broadcast using OWS')
11
11
  .option('--skip-preflight', 'skip preflight')
12
+ .option('--confirm-writes', 'Confirm write execution')
13
+ .option('--confirmWrites', 'Alias of --confirm-writes')
14
+ .option('--confirm', 'Alias of --confirm-writes')
12
15
  .option('--user-did <did>', 'user DID for managed paths')
13
16
  .option('--allow-wallet-mismatch', 'bypass strict funded-wallet vs execution-wallet guard')
14
17
  .option('--execution-scope <scope>', 'execution scope')
@@ -5,6 +5,35 @@ import { createCliError } from '../../core/envelope.mjs';
5
5
  import { normalizeRunMode, normalizeManagedRunMode, normalizeHybridWalletMode } from '../../core/runMode.mjs';
6
6
  import { assertEarnclawPolymarketWriteIdempotency } from './earnclawRuntimeWriteGate.mjs';
7
7
  import { resolveTokenInForFunding } from '../../core/fundingTokenIn.mjs';
8
+
9
+ function isTruthyFlag(value) {
10
+ return value === true || String(value || '').trim().toLowerCase() === 'true';
11
+ }
12
+
13
+ export function mergeConfirmWritesIntoParams(params, flags) {
14
+ const next = { ...(params && typeof params === 'object' ? params : {}) };
15
+ if (
16
+ isTruthyFlag(flags?.confirmWrites) ||
17
+ isTruthyFlag(flags?.confirm) ||
18
+ next.confirmWrites === true ||
19
+ next.confirm === true
20
+ ) {
21
+ next.confirmWrites = true;
22
+ }
23
+ return next;
24
+ }
25
+
26
+ export function resolveExecuteEstimatedAmountUsd(action, flags) {
27
+ const fromFlags = Number(flags?.estimatedAmountUsd);
28
+ if (Number.isFinite(fromFlags) && fromFlags > 0) return fromFlags;
29
+ const key = String(action || '')
30
+ .trim()
31
+ .toLowerCase()
32
+ .replace(/-/g, '_');
33
+ if (key === 'complete_avantis_onboarding') return 1;
34
+ return undefined;
35
+ }
36
+
8
37
  export function createExecutionPayloads({ getPreparedParams, rawUnitsToDecimalString }) {
9
38
  function buildBuildTxPayload(flags, resolvedAction) {
10
39
  const runMode = String(flags.runMode || '').trim().toLowerCase() || 'self';
@@ -74,7 +103,7 @@ function resolveEffectiveUserDid(flags, options = {}) {
74
103
  function buildManagedExecutePayload(flags, options) {
75
104
  const runMode = String(options.runMode || flags.runMode || 'agent_wallet').trim().toLowerCase();
76
105
  const params = getPreparedParams(flags);
77
- const managedParams = { ...params };
106
+ const managedParams = mergeConfirmWritesIntoParams({ ...params }, flags);
78
107
  if (flags.__swapInput?.unitSource === 'human' && flags.__swapInput.amountInHuman) {
79
108
  delete managedParams.amountInRaw;
80
109
  delete managedParams.amountInHuman;
@@ -119,7 +148,8 @@ function buildManagedExecutePayload(flags, options) {
119
148
  'Managed wallet execution requires --user-did, --agent-key (solo did:wallet identity), THIRDFY_USER_DID, or a saved userDid from `thirdfy-agent login email`.'
120
149
  );
121
150
  }
122
- if (flags.estimatedAmountUsd) payload.estimatedAmountUsd = Number(flags.estimatedAmountUsd);
151
+ const estimatedAmountUsd = resolveExecuteEstimatedAmountUsd(payload.action, flags);
152
+ if (estimatedAmountUsd != null) payload.estimatedAmountUsd = estimatedAmountUsd;
123
153
  if (options.forceIdempotency) {
124
154
  payload.executionIdempotencyKey = String(
125
155
  flags.idempotencyKey || `cli:walletExecute:${payload.action}:${Date.now()}:${randomUUID()}`
@@ -140,11 +170,12 @@ function buildIntentPayload(flags, options) {
140
170
  const payload = {
141
171
  agentApiKey: resolveAgentApiKey(flags, runMode),
142
172
  action: String(options.resolvedAction || requireFlag(flags, 'action', 'Missing --action')).trim(),
143
- params: getPreparedParams(flags),
173
+ params: mergeConfirmWritesIntoParams(getPreparedParams(flags), flags),
144
174
  };
145
175
  if (flags.catalog) payload.catalog = String(flags.catalog).trim();
146
176
  if (flags.chainId) payload.chainId = Number(flags.chainId);
147
- if (flags.estimatedAmountUsd) payload.estimatedAmountUsd = Number(flags.estimatedAmountUsd);
177
+ const estimatedAmountUsd = resolveExecuteEstimatedAmountUsd(payload.action, flags);
178
+ if (estimatedAmountUsd != null) payload.estimatedAmountUsd = estimatedAmountUsd;
148
179
  const intentRunMode = String(options.runMode || flags.runMode || '').trim().toLowerCase();
149
180
  const userDid = resolveEffectiveUserDid(flags, {
150
181
  runMode: intentRunMode,