@sherwoodagent/cli 0.77.0 → 0.78.0
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/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6880,11 +6880,25 @@ function registerGuardianCommands(program2) {
|
|
|
6880
6880
|
process.exit(1);
|
|
6881
6881
|
}
|
|
6882
6882
|
});
|
|
6883
|
-
guardian.command("stake <amount>").description("Stake as a guardian. Amount in WOOD (min = registry.minGuardianStake).").option("--agent-id <id>", "ERC-8004 agent ID to associate (first-stake only
|
|
6883
|
+
guardian.command("stake <amount>").description("Stake as a guardian. Amount in WOOD (min = registry.minGuardianStake).").option("--agent-id <id>", "ERC-8004 agent ID to associate (first-stake only; default: your linked identity, else 0)").action(async (amountStr, opts) => {
|
|
6884
6884
|
const amount = parseUnits6(amountStr, 18);
|
|
6885
|
-
|
|
6885
|
+
let agentIdStr = opts.agentId;
|
|
6886
|
+
if (agentIdStr == null) {
|
|
6887
|
+
const linked = getAgentId();
|
|
6888
|
+
if (linked != null) {
|
|
6889
|
+
agentIdStr = String(linked);
|
|
6890
|
+
const provider = getIdentityProvider();
|
|
6891
|
+
const chainNote = provider === "virtuals" ? getIdentityChainId() === 0 ? " (Virtuals, wallet-only)" : ` (Virtuals, chain ${getIdentityChainId()})` : "";
|
|
6892
|
+
console.log(chalk9.dim(` Associating linked identity #${linked}${chainNote} \u2014 override with --agent-id`));
|
|
6893
|
+
} else {
|
|
6894
|
+
agentIdStr = "0";
|
|
6895
|
+
console.log(chalk9.dim(" No linked identity \u2014 staking with agentId 0."));
|
|
6896
|
+
console.log(chalk9.dim(" Tip: sherwood identity mint / identity link-virtuals first to attribute your guardian work."));
|
|
6897
|
+
}
|
|
6898
|
+
}
|
|
6899
|
+
const agentId = BigInt(agentIdStr);
|
|
6886
6900
|
if (isCalldataOnly()) {
|
|
6887
|
-
emitCalldata(encodeGuardianStake({ amount, agentId:
|
|
6901
|
+
emitCalldata(encodeGuardianStake({ amount, agentId: agentIdStr }, getChain().id));
|
|
6888
6902
|
return;
|
|
6889
6903
|
}
|
|
6890
6904
|
await ensureWoodAllowance(amount);
|
|
@@ -9617,7 +9631,7 @@ try {
|
|
|
9617
9631
|
} catch {
|
|
9618
9632
|
}
|
|
9619
9633
|
var require2 = createRequire(import.meta.url);
|
|
9620
|
-
var CLI_VERSION = "0.
|
|
9634
|
+
var CLI_VERSION = "0.78.0";
|
|
9621
9635
|
async function loadXmtp() {
|
|
9622
9636
|
return import("./xmtp-OZ5PJFCT.js");
|
|
9623
9637
|
}
|