@thirdfy/agent-cli 0.2.32 → 0.2.33
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 +6 -0
- package/README.md +2 -2
- package/package.json +1 -1
- package/src/commands/bootstrap.mjs +34 -5
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.33] - 2026-07-24
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- `login email` always prints `executionWallets` / `executionWalletsError` and fails closed with `LOGIN_EMAIL_INCOMPLETE` when `runMode=agent_wallet` and execution wallets are missing or errored. Fund the managed execution wallet, not the owner embed.
|
|
12
|
+
|
|
7
13
|
## [0.2.32] - 2026-07-23
|
|
8
14
|
|
|
9
15
|
### Fixed
|
package/README.md
CHANGED
|
@@ -40,9 +40,9 @@ 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.33
|
|
44
44
|
|
|
45
|
-
-
|
|
45
|
+
- `login email` always surfaces `executionWallets` (and `executionWalletsError` when present) and fails closed for `agent_wallet` when execution wallets are missing. Fund the printed execution address, not the owner login wallet.
|
|
46
46
|
|
|
47
47
|
Older versions: see [CHANGELOG.md](./CHANGELOG.md) and [GitHub Releases](https://github.com/thirdfy/agent-cli/releases).
|
|
48
48
|
|
package/package.json
CHANGED
|
@@ -450,13 +450,18 @@ async function commandLoginEmail(ctx, flags) {
|
|
|
450
450
|
const agentKey = extractAgentKey(data);
|
|
451
451
|
const wallets = data.wallets && typeof data.wallets === 'object' ? data.wallets : {};
|
|
452
452
|
const executionWallets = data.executionWallets && typeof data.executionWallets === 'object' ? data.executionWallets : {};
|
|
453
|
+
const executionWalletsError = data.executionWalletsError
|
|
454
|
+
? String(data.executionWalletsError)
|
|
455
|
+
: data.execution_wallets_error
|
|
456
|
+
? String(data.execution_wallets_error)
|
|
457
|
+
: null;
|
|
453
458
|
const userDid = String(data.owner?.creatorDid || wallets.userDid || '').trim();
|
|
454
459
|
const primaryEvmWallet = String(wallets.primaryEvmWallet || data.owner?.creatorWallet || '').trim();
|
|
455
460
|
const persistedWallets = {
|
|
456
461
|
...wallets,
|
|
457
462
|
...(userDid ? { userDid } : {}),
|
|
458
463
|
...(primaryEvmWallet ? { primaryEvmWallet } : {}),
|
|
459
|
-
|
|
464
|
+
executionWallets,
|
|
460
465
|
};
|
|
461
466
|
const runMode = normalizeRunMode(flags.runMode || current.runMode || process.env.THIRDFY_RUN_MODE || 'agent_wallet');
|
|
462
467
|
const custodyMode = normalizeCustodyMode(flags.custodyMode || current.custodyMode || process.env.THIRDFY_CUSTODY_MODE, runMode);
|
|
@@ -491,7 +496,27 @@ async function commandLoginEmail(ctx, flags) {
|
|
|
491
496
|
...(agentKey ? { agentKey } : {}),
|
|
492
497
|
};
|
|
493
498
|
}
|
|
499
|
+
// Persist first so operators keep session tokens even when wallet provisioning failed.
|
|
494
500
|
persistProfileConfig(next);
|
|
501
|
+
|
|
502
|
+
const executionWalletAddresses = Object.values(executionWallets)
|
|
503
|
+
.map((row) => (row && typeof row === 'object' ? String(row.walletAddress || '').trim() : ''))
|
|
504
|
+
.filter((addr) => /^0x[a-fA-F0-9]{40}$/.test(addr));
|
|
505
|
+
const hasExecutionWallet = executionWalletAddresses.length > 0;
|
|
506
|
+
if (runMode === 'agent_wallet' && (executionWalletsError || !hasExecutionWallet)) {
|
|
507
|
+
const fundHint = executionWalletAddresses[0] || 'the managed execution wallet address for each chain';
|
|
508
|
+
throw createCliError(
|
|
509
|
+
'LOGIN_EMAIL_INCOMPLETE',
|
|
510
|
+
executionWalletsError
|
|
511
|
+
? `Email login completed but execution wallets failed: ${executionWalletsError}. Fund the managed execution wallet (${fundHint}), not the owner embedded login wallet.`
|
|
512
|
+
: `Email login completed without execution wallets. Fund the managed execution wallet for agent_wallet trading (${fundHint}), not the owner embedded login wallet. Re-run login email or call /api/v1/agent/onboarding/cli/email/complete and confirm executionWallets is returned.`,
|
|
513
|
+
{
|
|
514
|
+
executionWallets,
|
|
515
|
+
executionWalletsError: executionWalletsError || null,
|
|
516
|
+
}
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
|
|
495
520
|
printEnvelope({
|
|
496
521
|
success: true,
|
|
497
522
|
code: 'LOGIN_EMAIL_OK',
|
|
@@ -504,13 +529,17 @@ async function commandLoginEmail(ctx, flags) {
|
|
|
504
529
|
evmWallets: Array.isArray(persistedWallets.evm) ? persistedWallets.evm : [],
|
|
505
530
|
solanaWallets: Array.isArray(persistedWallets.solana) ? persistedWallets.solana : [],
|
|
506
531
|
primaryEvmWallet: persistedWallets.primaryEvmWallet || null,
|
|
507
|
-
executionWallets
|
|
508
|
-
|
|
509
|
-
? persistedWallets.executionWallets
|
|
510
|
-
: {},
|
|
532
|
+
executionWallets,
|
|
533
|
+
executionWalletsError: executionWalletsError || null,
|
|
511
534
|
ownerLinkedWallet: data.ownerLinkedWallet || null,
|
|
512
535
|
configPath: getProfileConfigPath(),
|
|
513
536
|
nextSteps: response?.nextSteps || [],
|
|
537
|
+
...(runMode === 'agent_wallet'
|
|
538
|
+
? {
|
|
539
|
+
fundingReminder:
|
|
540
|
+
'Fund executionWallets addresses for agent_wallet. Do not fund the owner embedded wallet for Path A trading.',
|
|
541
|
+
}
|
|
542
|
+
: {}),
|
|
514
543
|
},
|
|
515
544
|
meta: { apiBase: ctx.apiBase },
|
|
516
545
|
});
|