@thirdfy/agent-cli 0.2.66 → 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 +13 -0
- package/README.md +3 -2
- package/package.json +1 -1
- package/src/cli/options/execution.mjs +3 -0
- package/src/commands/chat.mjs +3 -0
- package/src/commands/consoleMandate.mjs +3 -0
- package/src/runtime/actions/selection.mjs +1 -0
- package/src/runtime/execution/payloads.mjs +35 -4
- package/src/runtime/providerHints.mjs +23 -0
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.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
|
+
|
|
13
|
+
## [0.2.67] - 2026-09-15
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `--network arc-testnet` (5042002), `arc-mainnet`, and `arc` (5042) for `chat send` and `console-mandate`. Cash rail only. Pairs with `thirdfy-mcp` **0.0.116** and Thirdfy API **3.14.40**.
|
|
18
|
+
- `provider=arc` jobs hints (`get_arc_job`, `create_arc_job`, budget, fund, submit, complete). Infer `arc` from `*_arc_job` before the generic `earn` fallback. See [`docs/providers/arc.md`](./docs/providers/arc.md).
|
|
19
|
+
|
|
7
20
|
## [0.2.66] - 2026-09-15
|
|
8
21
|
|
|
9
22
|
### Fixed
|
package/README.md
CHANGED
|
@@ -40,9 +40,10 @@ Run without global install:
|
|
|
40
40
|
npx @thirdfy/agent-cli --help
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
## What's new in v0.2.
|
|
43
|
+
## What's new in v0.2.68
|
|
44
44
|
|
|
45
|
-
-
|
|
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.
|
|
46
47
|
- See [CHANGELOG.md](./CHANGELOG.md) and GitHub Releases for older versions.
|
|
47
48
|
|
|
48
49
|
## Quick start
|
package/package.json
CHANGED
|
@@ -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')
|
package/src/commands/chat.mjs
CHANGED
|
@@ -13,6 +13,9 @@ const CONSOLE_MANDATE_NETWORK_CHAIN_IDS = {
|
|
|
13
13
|
'arbitrum-mainnet': 42161,
|
|
14
14
|
'robinhood-mainnet': 4663,
|
|
15
15
|
'dogeos-testnet': 6281971,
|
|
16
|
+
'arc-testnet': 5042002,
|
|
17
|
+
'arc-mainnet': 5042,
|
|
18
|
+
'arc': 5042,
|
|
16
19
|
};
|
|
17
20
|
|
|
18
21
|
function resolveConsoleMandateChainId(flags) {
|
|
@@ -207,6 +207,7 @@ function inferActionProvider(action) {
|
|
|
207
207
|
if (key.includes('uniswap')) return 'uniswap';
|
|
208
208
|
if (key.includes('ratehopper')) return 'ratehopper';
|
|
209
209
|
if (key.includes('bermuda')) return 'bermuda';
|
|
210
|
+
if (key.includes('arc-job') || key === 'get-arc-job') return 'arc';
|
|
210
211
|
if (key.includes('earn') || key.includes('yield') || key.includes('vault')) return 'earn';
|
|
211
212
|
if (key.includes('bridge')) return 'bridge';
|
|
212
213
|
if (key.includes('dogeos-barkswap')) return 'dogeos-barkswap';
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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,
|
|
@@ -798,6 +798,27 @@ export function createProviderHints({ getNegotiatedCapabilitiesCache }) {
|
|
|
798
798
|
'thirdfy-agent run --action get_bermuda_setup_status --params \'{"chainId":84532}\' --provider bermuda --json',
|
|
799
799
|
};
|
|
800
800
|
}
|
|
801
|
+
if (provider === 'arc') {
|
|
802
|
+
return {
|
|
803
|
+
provider,
|
|
804
|
+
category: 'internal',
|
|
805
|
+
canonicalReadAction: 'get_arc_job',
|
|
806
|
+
canonicalWriteAction: 'create_arc_job',
|
|
807
|
+
readActions: ['get_arc_job'],
|
|
808
|
+
orderManagementActions: [
|
|
809
|
+
'create_arc_job',
|
|
810
|
+
'set_arc_job_budget',
|
|
811
|
+
'fund_arc_job',
|
|
812
|
+
'submit_arc_job',
|
|
813
|
+
'complete_arc_job',
|
|
814
|
+
],
|
|
815
|
+
supportedChains: [5042002, 5042],
|
|
816
|
+
laneCompatibility:
|
|
817
|
+
'Arc ERC-8183 job escrow. Testnet 5042002 is live. Mainnet 5042 cash is ready. Jobs writes on 5042 need the API jobs contract. Use Privy agent_wallet. USDC pays gas. No Uniswap, Li.Fi, or Yield.xyz on Arc yet.',
|
|
818
|
+
example:
|
|
819
|
+
'thirdfy-agent run --action get_arc_job --params \'{"chainId":5042002,"jobId":1}\' --provider arc --json',
|
|
820
|
+
};
|
|
821
|
+
}
|
|
801
822
|
if (provider === 'nansen') {
|
|
802
823
|
return {
|
|
803
824
|
provider,
|
|
@@ -892,6 +913,7 @@ export function createProviderHints({ getNegotiatedCapabilitiesCache }) {
|
|
|
892
913
|
aegis: 'deposit_aegis_lender',
|
|
893
914
|
basedbid: 'basedbid_create_lbp',
|
|
894
915
|
bermuda: 'bermuda_deposit',
|
|
916
|
+
arc: 'create_arc_job',
|
|
895
917
|
curve: 'deposit_earn_position',
|
|
896
918
|
uniswap: 'mint_uniswap_position',
|
|
897
919
|
ratehopper: 'setup_ratehopper_cash_lp',
|
|
@@ -914,6 +936,7 @@ export function createProviderHints({ getNegotiatedCapabilitiesCache }) {
|
|
|
914
936
|
nansen: 'get_nansen_perp_screener',
|
|
915
937
|
basedbid: 'basedbid_get_tokens',
|
|
916
938
|
bermuda: 'get_bermuda_setup_status',
|
|
939
|
+
arc: 'get_arc_job',
|
|
917
940
|
cmc: 'get_cmc_quotes',
|
|
918
941
|
prediction: 'get_prediction_markets',
|
|
919
942
|
};
|