@sherwoodagent/cli 0.85.0 → 0.86.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.
Files changed (29) hide show
  1. package/dist/{chat-DNWTI4CZ.js → chat-PRYOT3ZV.js} +9 -9
  2. package/dist/chat-PRYOT3ZV.js.map +1 -0
  3. package/dist/{chunk-TWT56FTL.js → chunk-5NFAEOFG.js} +2 -2
  4. package/dist/{chunk-65G5BFYR.js → chunk-HODME7UJ.js} +2 -2
  5. package/dist/{chunk-ILHOW6IA.js → chunk-LRUSZUEU.js} +197 -65
  6. package/dist/chunk-LRUSZUEU.js.map +1 -0
  7. package/dist/{chunk-VR4VHX4D.js → chunk-YMB4RJOR.js} +2 -2
  8. package/dist/{chunk-VR4VHX4D.js.map → chunk-YMB4RJOR.js.map} +1 -1
  9. package/dist/{identity-RMEPBFOL.js → identity-XOAYQFUW.js} +2 -2
  10. package/dist/index.js +148 -123
  11. package/dist/index.js.map +1 -1
  12. package/dist/{ipfs-EJ7IHXCU.js → ipfs-M56BLMCW.js} +2 -2
  13. package/dist/{research-GZNVG3SP.js → research-NKGP3M4J.js} +12 -12
  14. package/dist/research-NKGP3M4J.js.map +1 -0
  15. package/dist/{session-M5QB25PK.js → session-LJT3SAED.js} +3 -3
  16. package/dist/{trade-TCQ5NUNA.js → trade-OTZ7UHDK.js} +5 -5
  17. package/dist/trade-OTZ7UHDK.js.map +1 -0
  18. package/dist/{vault-K2R4VHVI.js → vault-7O4N6WZG.js} +4 -4
  19. package/package.json +2 -2
  20. package/dist/chat-DNWTI4CZ.js.map +0 -1
  21. package/dist/chunk-ILHOW6IA.js.map +0 -1
  22. package/dist/research-GZNVG3SP.js.map +0 -1
  23. package/dist/trade-TCQ5NUNA.js.map +0 -1
  24. /package/dist/{chunk-TWT56FTL.js.map → chunk-5NFAEOFG.js.map} +0 -0
  25. /package/dist/{chunk-65G5BFYR.js.map → chunk-HODME7UJ.js.map} +0 -0
  26. /package/dist/{identity-RMEPBFOL.js.map → identity-XOAYQFUW.js.map} +0 -0
  27. /package/dist/{ipfs-EJ7IHXCU.js.map → ipfs-M56BLMCW.js.map} +0 -0
  28. /package/dist/{session-M5QB25PK.js.map → session-LJT3SAED.js.map} +0 -0
  29. /package/dist/{vault-K2R4VHVI.js.map → vault-7O4N6WZG.js.map} +0 -0
package/dist/index.js CHANGED
@@ -64,7 +64,7 @@ import {
64
64
  setCalldataOnly,
65
65
  stripVidTag,
66
66
  verifyVidTag
67
- } from "./chunk-ILHOW6IA.js";
67
+ } from "./chunk-LRUSZUEU.js";
68
68
  import {
69
69
  createApproval,
70
70
  createJoinRequest,
@@ -110,8 +110,8 @@ import {
110
110
  removeDepositor,
111
111
  setAgentFeeBps,
112
112
  setVaultAddress
113
- } from "./chunk-TWT56FTL.js";
114
- import "./chunk-65G5BFYR.js";
113
+ } from "./chunk-5NFAEOFG.js";
114
+ import "./chunk-HODME7UJ.js";
115
115
  import {
116
116
  PROPOSAL_STATE,
117
117
  PROPOSAL_STATES,
@@ -217,7 +217,7 @@ import {
217
217
  fetchMetadata,
218
218
  mergeFundMetadata,
219
219
  uploadMetadata
220
- } from "./chunk-VR4VHX4D.js";
220
+ } from "./chunk-YMB4RJOR.js";
221
221
 
222
222
  // src/index.ts
223
223
  import { config as loadDotenv } from "dotenv";
@@ -490,7 +490,7 @@ function registerGuardianCommands(program2) {
490
490
  }
491
491
  });
492
492
  guardian.command("prepare-owner-stake <amount>").description(
493
- "Bond WOOD as a prospective vault owner \u2014 required before `fund create`. Amount in WOOD (min = swood.minOwnerStake, default 10000)."
493
+ "Bond WOOD as a prospective vault owner \u2014 required before `vault create`. Amount in WOOD (min = swood.minOwnerStake, default 10000)."
494
494
  ).action(async (amountStr) => {
495
495
  const amount = parseUnits(amountStr, 18);
496
496
  await ensureWoodAllowance(amount);
@@ -564,7 +564,7 @@ var TEMPLATES = [
564
564
  {
565
565
  name: "Moonwell Supply",
566
566
  key: "moonwell-supply",
567
- description: "Supply tokens to Moonwell lending market, earn yield",
567
+ description: "Supply tokens to the Moonwell lending market",
568
568
  addressKey: "MOONWELL_SUPPLY"
569
569
  },
570
570
  {
@@ -582,13 +582,13 @@ var TEMPLATES = [
582
582
  {
583
583
  name: "wstETH Moonwell Yield",
584
584
  key: "wsteth-moonwell",
585
- description: "WETH \u2192 wstETH \u2192 Moonwell \u2014 stack Lido + lending yield",
585
+ description: "WETH \u2192 wstETH \u2192 Moonwell \u2014 Lido staking plus lending",
586
586
  addressKey: "WSTETH_MOONWELL"
587
587
  },
588
588
  {
589
589
  name: "Mamo Yield",
590
590
  key: "mamo-yield",
591
- description: "Deposit into Mamo for optimized yield across Moonwell + Morpho vaults",
591
+ description: "Deposit into Mamo \u2014 routes across Moonwell + Morpho vaults",
592
592
  addressKey: "MAMO_YIELD"
593
593
  },
594
594
  {
@@ -940,7 +940,7 @@ function registerStrategyProposeCommands(strategy2) {
940
940
  `--proposer ${proposer} is not a registered agent on ${vault}; cloneAndInitDeterministic and propose will both revert.`
941
941
  )
942
942
  );
943
- console.error(chalk3.yellow(` Register first: sherwood fund approve --wallet ${proposer}`));
943
+ console.error(chalk3.yellow(` Register first: sherwood vault approve --wallet ${proposer}`));
944
944
  process.exit(1);
945
945
  }
946
946
  if (paused) {
@@ -1048,7 +1048,7 @@ function registerStrategyProposeCommands(strategy2) {
1048
1048
  console.error(
1049
1049
  chalk3.red(
1050
1050
  ` Signer ${account.address} is not a registered agent on ${vault}.
1051
- Register first via: sherwood fund approve --wallet ${account.address}`
1051
+ Register first via: sherwood vault approve --wallet ${account.address}`
1052
1052
  )
1053
1053
  );
1054
1054
  process.exit(1);
@@ -1209,7 +1209,7 @@ function registerStrategyProposeCommands(strategy2) {
1209
1209
  process.exit(1);
1210
1210
  }
1211
1211
  const { propose: propose2 } = await import("./governor-35IXAEDJ.js");
1212
- const { pinJSON } = await import("./ipfs-EJ7IHXCU.js");
1212
+ const { pinJSON } = await import("./ipfs-M56BLMCW.js");
1213
1213
  const { parseDuration: parseDuration2 } = await import("./governor-35IXAEDJ.js");
1214
1214
  const strategyDuration = parseDuration2(opts.duration);
1215
1215
  const metaSpinner = ora2("Pinning metadata to IPFS...").start();
@@ -1242,11 +1242,11 @@ function registerStrategyProposeCommands(strategy2) {
1242
1242
  metadataURI = `data:application/json;base64,${Buffer.from(inline).toString("base64")}`;
1243
1243
  }
1244
1244
  try {
1245
- const { getAgentFeeBps: getAgentFeeBps2 } = await import("./vault-K2R4VHVI.js");
1245
+ const { getAgentFeeBps: getAgentFeeBps2 } = await import("./vault-7O4N6WZG.js");
1246
1246
  const feeBps = await getAgentFeeBps2(vault);
1247
1247
  console.log(
1248
1248
  chalk3.yellow(
1249
- ` Agent fee for this proposal: ${Number(feeBps) / 100}% (the vault's current agentFeeBps). Run \`sherwood fund set-agent-fee --bps <bps>\` first to change it.`
1249
+ ` Agent fee for this proposal: ${Number(feeBps) / 100}% (the vault's current agentFeeBps). Run \`sherwood vault set-agent-fee --bps <bps>\` first to change it.`
1250
1250
  )
1251
1251
  );
1252
1252
  } catch {
@@ -4774,7 +4774,7 @@ function registerProposalCommands(program2) {
4774
4774
  process.exit(1);
4775
4775
  }
4776
4776
  });
4777
- proposal.command("simulate").description("Simulate proposal calls via Tenderly (or eth_call fallback)").option("--id <proposalId>", "Proposal ID to simulate").option("--vault <address>", "Vault address (required \u2014 proposal IDs are per-vault)").option("--execute-calls <path>", "Path to JSON execute calls file").option("--settle-calls <path>", "Path to JSON settlement calls file").option("--notify <subdomain>", "Send results to fund XMTP chat").action(async (opts) => {
4777
+ proposal.command("simulate").description("Simulate proposal calls via Tenderly (or eth_call fallback)").option("--id <proposalId>", "Proposal ID to simulate").option("--vault <address>", "Vault address (required \u2014 proposal IDs are per-vault)").option("--execute-calls <path>", "Path to JSON execute calls file").option("--settle-calls <path>", "Path to JSON settlement calls file").option("--notify <subdomain>", "Send results to vault XMTP chat").action(async (opts) => {
4778
4778
  try {
4779
4779
  let vault;
4780
4780
  let executeCalls;
@@ -7985,7 +7985,7 @@ try {
7985
7985
  } catch {
7986
7986
  }
7987
7987
  var require2 = createRequire(import.meta.url);
7988
- var CLI_VERSION = "0.85.0";
7988
+ var CLI_VERSION = "0.86.0";
7989
7989
  async function loadXmtp() {
7990
7990
  return import("./xmtp-R25Q5GWY.js");
7991
7991
  }
@@ -8007,7 +8007,7 @@ function validateAddress(value, name) {
8007
8007
  }
8008
8008
  function fundShareUrl(subdomain, refParam) {
8009
8009
  const host = isTestnet() ? "https://testnet.sherwood.sh" : "https://sherwood.sh";
8010
- return `${host}/fund/${subdomain}${refParam}`;
8010
+ return `${host}/vault/${subdomain}${refParam}`;
8011
8011
  }
8012
8012
  function resolveVault(opts) {
8013
8013
  if (opts.vault) {
@@ -8015,7 +8015,22 @@ function resolveVault(opts) {
8015
8015
  }
8016
8016
  }
8017
8017
  var program = new Command();
8018
- program.name("sherwood").description("CLI for agent-managed investment funds").version(CLI_VERSION).addOption(
8018
+ program.name("sherwood").description("CLI for agent-managed onchain vaults").version(CLI_VERSION).configureHelp({
8019
+ subcommandTerm: (cmd) => {
8020
+ const args = cmd.registeredArguments.map((arg) => {
8021
+ const name = arg.name() + (arg.variadic ? "..." : "");
8022
+ return arg.required ? `<${name}>` : `[${name}]`;
8023
+ }).join(" ");
8024
+ return cmd.name() + (cmd.options.length ? " [options]" : "") + (args ? ` ${args}` : "");
8025
+ },
8026
+ commandUsage: (cmd) => {
8027
+ const names = [cmd.name()];
8028
+ for (let ancestor = cmd.parent; ancestor; ancestor = ancestor.parent) {
8029
+ names.unshift(ancestor.name());
8030
+ }
8031
+ return `${names.join(" ")} ${cmd.usage()}`;
8032
+ }
8033
+ }).addOption(
8019
8034
  new Option(
8020
8035
  "--chain <network>",
8021
8036
  "Target network (default: robinhood-fork, chain 9994663 \u2014 where the product lives; robinhood-testnet is chain 46630)"
@@ -8029,11 +8044,21 @@ program.name("sherwood").description("CLI for agent-managed investment funds").v
8029
8044
  setCalldataOnly(Boolean(opts.calldataOnly));
8030
8045
  setNetwork(opts.chain);
8031
8046
  });
8032
- var fund = program.command("fund").alias("syndicate");
8033
- fund.command("create").description("Create a new fund via the factory (interactive)").option("--subdomain <name>", "ENS subdomain (skip prompt)").option("--name <name>", "Fund name (skip prompt)").option("--agent-id <id>", "ERC-8004 agent identity token ID (skip prompt)").option("--asset <symbol-or-address>", "Vault asset: USDC, WETH, or a token address").option("--description <text>", "Short description").option("--metadata-uri <uri>", "Override metadata URI (skip IPFS upload)").option("--open-deposits", "Allow anyone to deposit (default: whitelist only)").option("--public-chat", "Enable dashboard spectator mode", false).option("-y, --yes", "Skip confirmation prompt (non-interactive mode)", false).action(async (opts) => {
8047
+ var LEGACY_GROUP_ALIASES = ["fund", "syndicate"];
8048
+ var vaultCmd = program.command("vault").alias("fund").alias("syndicate").description("Vaults \u2014 launch, inspect, join, and manage deposits").hook("preSubcommand", () => {
8049
+ const typed = process.argv.slice(2).find((arg) => arg === "vault" || LEGACY_GROUP_ALIASES.includes(arg));
8050
+ if (typed && typed !== "vault") {
8051
+ console.error(
8052
+ chalk17.dim(
8053
+ `note: 'sherwood ${typed}' is now 'sherwood vault' \u2014 the old name keeps working for now`
8054
+ )
8055
+ );
8056
+ }
8057
+ });
8058
+ vaultCmd.command("create").description("Launch a new vault via the factory (interactive)").option("--subdomain <name>", "ENS subdomain (skip prompt)").option("--name <name>", "Vault name (skip prompt)").option("--agent-id <id>", "ERC-8004 agent identity token ID (skip prompt)").option("--asset <symbol-or-address>", "Vault asset: USDC, WETH, or a token address").option("--description <text>", "Short description").option("--metadata-uri <uri>", "Override metadata URI (skip IPFS upload)").option("--open-deposits", "Allow anyone to deposit (default: whitelist only)").option("--public-chat", "Enable dashboard spectator mode", false).option("-y, --yes", "Skip confirmation prompt (non-interactive mode)", false).action(async (opts) => {
8034
8059
  try {
8035
8060
  console.log();
8036
- console.log(LABEL5(" \u25C6 Create Fund"));
8061
+ console.log(LABEL5(" \u25C6 Launch Vault"));
8037
8062
  SEP6();
8038
8063
  if (!isCalldataOnly()) {
8039
8064
  const wallet = getAccount();
@@ -8046,7 +8071,7 @@ fund.command("create").description("Create a new fund via the factory (interacti
8046
8071
  const name = opts.name || (nonInteractive ? (() => {
8047
8072
  throw new Error("--name is required in non-interactive mode (-y)");
8048
8073
  })() : await input({
8049
- message: G6("Fund name"),
8074
+ message: G6("Vault name"),
8050
8075
  validate: (v) => v.length > 0 || "Name is required"
8051
8076
  }));
8052
8077
  const subdomain = opts.subdomain || (nonInteractive ? name.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "") : await input({
@@ -8054,9 +8079,9 @@ fund.command("create").description("Create a new fund via the factory (interacti
8054
8079
  default: name.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, ""),
8055
8080
  validate: (v) => v.length >= 3 || "Must be at least 3 characters"
8056
8081
  }));
8057
- const description = opts.description || (nonInteractive ? `${name} \u2014 a Sherwood fund` : await input({
8082
+ const description = opts.description || (nonInteractive ? `${name} \u2014 a Sherwood vault` : await input({
8058
8083
  message: G6("Description"),
8059
- default: `${name} \u2014 a Sherwood fund`
8084
+ default: `${name} \u2014 a Sherwood vault`
8060
8085
  }));
8061
8086
  const agentIdStr = opts.agentId || (savedAgentId ? nonInteractive ? String(savedAgentId) : await input({ message: G6("Agent ID (ERC-8004)"), default: String(savedAgentId) }) : nonInteractive ? "0" : await input({ message: G6("Agent ID (ERC-8004)"), validate: (v) => /^\d+$/.test(v) || "Must be a number" }));
8062
8087
  const openDeposits = opts.openDeposits !== void 0 ? opts.openDeposits : nonInteractive ? false : await confirm({
@@ -8128,7 +8153,7 @@ fund.command("create").description("Create a new fund via the factory (interacti
8128
8153
  console.log(W6(` Open deposits: ${openDeposits ? chalk17.yellow("yes (anyone can deposit)") : G6("no (whitelist)")}`));
8129
8154
  SEP6();
8130
8155
  if (!nonInteractive) {
8131
- const go = await confirm({ message: G6("Deploy fund?"), default: true });
8156
+ const go = await confirm({ message: G6("Deploy vault?"), default: true });
8132
8157
  if (!go) {
8133
8158
  console.log(DIM6(" Cancelled."));
8134
8159
  return;
@@ -8180,12 +8205,12 @@ fund.command("create").description("Create a new fund via the factory (interacti
8180
8205
  const callerAddress = getAccount().address.toLowerCase();
8181
8206
  if (existingInfo.creator.toLowerCase() !== callerAddress) {
8182
8207
  console.error(chalk17.red(`
8183
- \u2716 Subdomain '${subdomain}' is already taken by another fund.
8208
+ \u2716 Subdomain '${subdomain}' is already taken by another vault.
8184
8209
  `));
8185
8210
  process.exit(1);
8186
8211
  }
8187
8212
  console.log(chalk17.yellow(`
8188
- \u26A0 Fund '${subdomain}' already exists \u2014 resuming setup...
8213
+ \u26A0 Vault '${subdomain}' already exists \u2014 resuming setup...
8189
8214
  `));
8190
8215
  const spinner2 = ora9({ text: W6("Resuming setup..."), color: "green" }).start();
8191
8216
  const chainId2 = getChain().id;
@@ -8228,7 +8253,7 @@ fund.command("create").description("Create a new fund via the factory (interacti
8228
8253
  }
8229
8254
  spinner2.stop();
8230
8255
  console.log();
8231
- console.log(LABEL5(" \u25C6 Fund Setup Resumed"));
8256
+ console.log(LABEL5(" \u25C6 Vault Setup Resumed"));
8232
8257
  SEP6();
8233
8258
  console.log(W6(` ID: ${G6(`#${existingId}`)}`));
8234
8259
  console.log(W6(` Vault: ${G6(existingInfo.vault)}`));
@@ -8237,7 +8262,7 @@ fund.command("create").description("Create a new fund via the factory (interacti
8237
8262
  const refParam2 = getAgentId() ? `?ref=${getAgentId()}` : "";
8238
8263
  console.log(W6(` Share: ${G6(fundShareUrl(subdomain, refParam2))}`));
8239
8264
  SEP6();
8240
- console.log(G6(" \u2713 Fund saved to ~/.sherwood/config.json (set as primary)"));
8265
+ console.log(G6(" \u2713 Vault saved to ~/.sherwood/config.json (set as primary)"));
8241
8266
  console.log();
8242
8267
  return;
8243
8268
  }
@@ -8266,7 +8291,7 @@ fund.command("create").description("Create a new fund via the factory (interacti
8266
8291
  // agentAddress = creator EOA (direct execution)
8267
8292
  );
8268
8293
  } catch (regErr) {
8269
- console.warn(chalk17.yellow("\n \u26A0 Could not auto-register creator as agent \u2014 register manually with `fund add`"));
8294
+ console.warn(chalk17.yellow("\n \u26A0 Could not auto-register creator as agent \u2014 register manually with `vault add`"));
8270
8295
  }
8271
8296
  spinner.text = W6("Setting up chat...");
8272
8297
  try {
@@ -8295,7 +8320,7 @@ fund.command("create").description("Create a new fund via the factory (interacti
8295
8320
  }
8296
8321
  spinner.stop();
8297
8322
  console.log();
8298
- console.log(LABEL5(" \u25C6 Fund Created"));
8323
+ console.log(LABEL5(" \u25C6 Vault Launched"));
8299
8324
  SEP6();
8300
8325
  console.log(W6(` ID: ${G6(`#${result.fundId}`)}`));
8301
8326
  console.log(W6(` Vault: ${G6(result.vault)}`));
@@ -8306,7 +8331,7 @@ fund.command("create").description("Create a new fund via the factory (interacti
8306
8331
  const refParam = getAgentId() ? `?ref=${getAgentId()}` : "";
8307
8332
  console.log(W6(` Share: ${G6(fundShareUrl(subdomain, refParam))}`));
8308
8333
  SEP6();
8309
- console.log(G6(" \u2713 Fund saved to ~/.sherwood/config.json (set as primary)"));
8334
+ console.log(G6(" \u2713 Vault saved to ~/.sherwood/config.json (set as primary)"));
8310
8335
  console.log();
8311
8336
  } catch (err) {
8312
8337
  console.error(chalk17.red(`
@@ -8314,8 +8339,8 @@ fund.command("create").description("Create a new fund via the factory (interacti
8314
8339
  process.exit(1);
8315
8340
  }
8316
8341
  });
8317
- fund.command("list").description("List active funds (queries subgraph, falls back to on-chain)").option("--creator <address>", "Filter by creator address").option("--all-chains", "Aggregate active funds across all supported chains (on-chain only)").action(async (opts) => {
8318
- const spinner = ora9("Loading funds...").start();
8342
+ vaultCmd.command("list").description("List active vaults (queries subgraph, falls back to on-chain)").option("--creator <address>", "Filter by creator address").option("--all-chains", "Aggregate active vaults across all supported chains (on-chain only)").action(async (opts) => {
8343
+ const spinner = ora9("Loading vaults...").start();
8319
8344
  try {
8320
8345
  let funds = [];
8321
8346
  if (opts.allChains) {
@@ -8358,11 +8383,11 @@ fund.command("list").description("List active funds (queries subgraph, falls bac
8358
8383
  }
8359
8384
  spinner.stop();
8360
8385
  if (funds.length === 0) {
8361
- console.log(chalk17.dim("No active funds found."));
8386
+ console.log(chalk17.dim("No active vaults found."));
8362
8387
  return;
8363
8388
  }
8364
8389
  console.log();
8365
- console.log(chalk17.bold(`Active Funds (${funds.length})`));
8390
+ console.log(chalk17.bold(`Active Vaults (${funds.length})`));
8366
8391
  if (!process.env.SUBGRAPH_URL && !opts.allChains) {
8367
8392
  console.log(chalk17.dim(" (Set SUBGRAPH_URL for faster indexed queries)"));
8368
8393
  }
@@ -8388,13 +8413,35 @@ fund.command("list").description("List active funds (queries subgraph, falls bac
8388
8413
  console.log();
8389
8414
  }
8390
8415
  } catch (err) {
8391
- spinner.fail("Failed to load funds");
8416
+ spinner.fail("Failed to load vaults");
8392
8417
  console.error(chalk17.red(formatContractError(err)));
8393
8418
  process.exit(1);
8394
8419
  }
8395
8420
  });
8396
- fund.command("info").description("Display fund details by ID or subdomain").argument("<id>", "Fund ID or subdomain name").action(async (idStr) => {
8397
- const spinner = ora9("Loading fund info...").start();
8421
+ vaultCmd.command("info").description("Display vault details by ID or subdomain (omit the ID to read the configured vault)").argument("[id]", "Vault ID or subdomain name (default: the vault from --vault or config)").option("--vault <address>", "Vault address (default: from config)").action(async (idStr, opts) => {
8422
+ if (!idStr) {
8423
+ resolveVault(opts);
8424
+ const spinner2 = ora9("Loading vault info...").start();
8425
+ try {
8426
+ const info = await getVaultInfo();
8427
+ spinner2.stop();
8428
+ console.log();
8429
+ console.log(chalk17.bold("Vault Info"));
8430
+ console.log(chalk17.dim("\u2500".repeat(40)));
8431
+ console.log(` Address: ${info.address}`);
8432
+ console.log(` Total Assets: ${info.totalAssets}`);
8433
+ console.log(` Agent Count: ${info.agentCount}`);
8434
+ console.log(` Redemptions Locked: ${info.redemptionsLocked}`);
8435
+ console.log(` Management Fee: ${Number(info.managementFeeBps) / 100}%`);
8436
+ console.log();
8437
+ } catch (err) {
8438
+ spinner2.fail("Failed to load vault info");
8439
+ console.error(chalk17.red(formatContractError(err)));
8440
+ process.exit(1);
8441
+ }
8442
+ return;
8443
+ }
8444
+ const spinner = ora9("Loading vault info...").start();
8398
8445
  try {
8399
8446
  let id;
8400
8447
  let crossChainHint = null;
@@ -8409,7 +8456,7 @@ fund.command("info").description("Display fund details by ID or subdomain").argu
8409
8456
  spinner.text = `Searching across chains...`;
8410
8457
  const hits = await searchFundAcrossChains(idStr);
8411
8458
  if (hits.length === 0) {
8412
- spinner.fail(`Fund "${idStr}" not found on any supported chain`);
8459
+ spinner.fail(`Vault "${idStr}" not found on any supported chain`);
8413
8460
  process.exit(1);
8414
8461
  }
8415
8462
  const active = getNetwork();
@@ -8430,16 +8477,16 @@ fund.command("info").description("Display fund details by ID or subdomain").argu
8430
8477
  if (crossChainHint) {
8431
8478
  const others = crossChainHint.others.length > 0 ? ` (also on: ${crossChainHint.others.join(", ")})` : "";
8432
8479
  console.log(chalk17.yellow(` Found on chain: ${chalk17.bold(crossChainHint.network)}${others}`));
8433
- console.log(chalk17.dim(` Re-run with --chain ${crossChainHint.network} to interact with this fund.`));
8480
+ console.log(chalk17.dim(` Re-run with --chain ${crossChainHint.network} to interact with this vault.`));
8434
8481
  console.log();
8435
8482
  }
8436
8483
  if (!info.vault || info.vault === "0x0000000000000000000000000000000000000000") {
8437
- console.log(chalk17.red(`Fund #${id} not found.`));
8484
+ console.log(chalk17.red(`Vault #${id} not found.`));
8438
8485
  process.exit(1);
8439
8486
  }
8440
8487
  const date = new Date(Number(info.createdAt) * 1e3).toLocaleDateString();
8441
8488
  console.log();
8442
- console.log(chalk17.bold(`Fund #${info.id}`));
8489
+ console.log(chalk17.bold(`Vault #${info.id}`));
8443
8490
  console.log(chalk17.dim("\u2500".repeat(40)));
8444
8491
  if (info.subdomain) {
8445
8492
  console.log(` ENS: ${chalk17.bold(`${info.subdomain}.sherwoodagent.eth`)}`);
@@ -8467,20 +8514,20 @@ fund.command("info").description("Display fund details by ID or subdomain").argu
8467
8514
  console.log(` Management Fee: ${Number(vaultInfo.managementFeeBps) / 100}%`);
8468
8515
  console.log();
8469
8516
  } catch (err) {
8470
- spinner.fail("Failed to load fund info");
8517
+ spinner.fail("Failed to load vault info");
8471
8518
  console.error(chalk17.red(formatContractError(err)));
8472
8519
  process.exit(1);
8473
8520
  }
8474
8521
  });
8475
- fund.command("update-metadata").description("Update fund metadata (creator only)").requiredOption("--id <id>", "Fund ID").option("--name <name>", "Fund name").option("--description <text>", "Short description").option("--uri <uri>", "Direct metadata URI (skips IPFS upload)").action(async (opts) => {
8476
- const spinner = ora9({ text: W6("Loading fund..."), color: "green" }).start();
8522
+ vaultCmd.command("update-metadata").description("Update vault metadata (creator only)").requiredOption("--id <id>", "Vault ID").option("--name <name>", "Vault name").option("--description <text>", "Short description").option("--uri <uri>", "Direct metadata URI (skips IPFS upload)").action(async (opts) => {
8523
+ const spinner = ora9({ text: W6("Loading vault..."), color: "green" }).start();
8477
8524
  try {
8478
8525
  const fundId = BigInt(opts.id);
8479
8526
  let metadataURI = opts.uri;
8480
8527
  if (!metadataURI) {
8481
8528
  const info = await getFund(fundId);
8482
8529
  if (!info.vault || info.vault === "0x0000000000000000000000000000000000000000") {
8483
- spinner.fail(`Fund #${opts.id} not found.`);
8530
+ spinner.fail(`Vault #${opts.id} not found.`);
8484
8531
  process.exit(1);
8485
8532
  }
8486
8533
  spinner.text = W6("Fetching current metadata...");
@@ -8515,7 +8562,7 @@ fund.command("update-metadata").description("Update fund metadata (creator only)
8515
8562
  process.exit(1);
8516
8563
  }
8517
8564
  });
8518
- fund.command("approve-depositor").description("Approve an address to deposit (owner only)").option("--vault <address>", "Vault address (default: from config)").requiredOption("--depositor <address>", "Address to approve").action(async (opts) => {
8565
+ vaultCmd.command("approve-depositor").description("Approve an address to deposit (owner only)").option("--vault <address>", "Vault address (default: from config)").requiredOption("--depositor <address>", "Address to approve").action(async (opts) => {
8519
8566
  resolveVault(opts);
8520
8567
  const depositor = validateAddress(opts.depositor, "depositor");
8521
8568
  if (isCalldataOnly()) {
@@ -8538,7 +8585,7 @@ fund.command("approve-depositor").description("Approve an address to deposit (ow
8538
8585
  process.exit(1);
8539
8586
  }
8540
8587
  });
8541
- fund.command("remove-depositor").description("Remove an address from the depositor whitelist (owner only)").option("--vault <address>", "Vault address (default: from config)").requiredOption("--depositor <address>", "Address to remove").action(async (opts) => {
8588
+ vaultCmd.command("remove-depositor").description("Remove an address from the depositor whitelist (owner only)").option("--vault <address>", "Vault address (default: from config)").requiredOption("--depositor <address>", "Address to remove").action(async (opts) => {
8542
8589
  resolveVault(opts);
8543
8590
  const spinner = ora9("Removing depositor...").start();
8544
8591
  try {
@@ -8552,7 +8599,7 @@ fund.command("remove-depositor").description("Remove an address from the deposit
8552
8599
  process.exit(1);
8553
8600
  }
8554
8601
  });
8555
- fund.command("set-agent-fee").description("Set the vault's agent performance fee in bps (vault owner only)").option("--vault <address>", "Vault address (default: from config)").requiredOption(
8602
+ vaultCmd.command("set-agent-fee").description("Set the vault's agent performance fee in bps (vault owner only)").option("--vault <address>", "Vault address (default: from config)").requiredOption(
8556
8603
  "--bps <bps>",
8557
8604
  `Agent fee in bps (e.g. 1000 = 10%; max ${MAX_AGENT_FEE_BPS} = ${MAX_AGENT_FEE_BPS / 100}%). The governor clamps the realized fee to its configured maxPerformanceFeeBps, which may be lower.`
8558
8605
  ).action(async (opts) => {
@@ -8571,7 +8618,7 @@ fund.command("set-agent-fee").description("Set the vault's agent performance fee
8571
8618
  process.exit(1);
8572
8619
  }
8573
8620
  });
8574
- fund.command("add").description("Register an agent on a fund vault (creator only)").option("--vault <address>", "Vault address (default: from config)").option("--agent-id <id>", "Agent's ERC-8004 identity token ID (resolved from wallet if omitted)").requiredOption("--wallet <address>", "Agent wallet address").action(async (opts) => {
8621
+ vaultCmd.command("add").description("Register an agent on a vault (creator only)").option("--vault <address>", "Vault address (default: from config)").option("--agent-id <id>", "Agent's ERC-8004 identity token ID (resolved from wallet if omitted)").requiredOption("--wallet <address>", "Agent wallet address").action(async (opts) => {
8575
8622
  if (isCalldataOnly()) {
8576
8623
  resolveVault(opts);
8577
8624
  const agentWallet = validateAddress(opts.wallet, "wallet");
@@ -8602,7 +8649,7 @@ fund.command("add").description("Register an agent on a fund vault (creator only
8602
8649
  const { creator, subdomain } = await resolveVaultFund(vaultAddress);
8603
8650
  const callerAddress = getAccount().address.toLowerCase();
8604
8651
  if (creator.toLowerCase() !== callerAddress) {
8605
- spinner.fail("Only the fund creator can add agents");
8652
+ spinner.fail("Only the vault creator can add agents");
8606
8653
  process.exit(1);
8607
8654
  }
8608
8655
  const agentWallet = validateAddress(opts.wallet, "wallet");
@@ -8611,7 +8658,7 @@ fund.command("add").description("Register an agent on a fund vault (creator only
8611
8658
  agentId = BigInt(opts.agentId);
8612
8659
  } else {
8613
8660
  spinner.text = "Looking up ERC-8004 identity from wallet...";
8614
- const { lookupAgentIdByWallet } = await import("./identity-RMEPBFOL.js");
8661
+ const { lookupAgentIdByWallet } = await import("./identity-XOAYQFUW.js");
8615
8662
  const resolved = await lookupAgentIdByWallet(agentWallet);
8616
8663
  if (resolved === null) {
8617
8664
  spinner.fail("Agent wallet does not own an ERC-8004 identity NFT");
@@ -8647,11 +8694,11 @@ fund.command("add").description("Register an agent on a fund vault (creator only
8647
8694
  process.exit(1);
8648
8695
  }
8649
8696
  });
8650
- fund.command("share").description("Print the shareable dashboard URL for your fund").option("--subdomain <name>", "Fund subdomain (default: primary)").action(async (opts) => {
8697
+ vaultCmd.command("share").description("Print the shareable dashboard URL for your vault").option("--subdomain <name>", "Vault subdomain (default: primary)").action(async (opts) => {
8651
8698
  try {
8652
8699
  const subdomain = opts.subdomain || getPrimaryFund(getChain().id)?.subdomain;
8653
8700
  if (!subdomain) {
8654
- console.error(chalk17.red(" No fund configured. Pass --subdomain <name> or run 'fund create/join' first."));
8701
+ console.error(chalk17.red(" No vault configured. Pass --subdomain <name> or run 'vault create/join' first."));
8655
8702
  process.exit(1);
8656
8703
  }
8657
8704
  const fundInfo = await resolveFund(subdomain);
@@ -8659,12 +8706,12 @@ fund.command("share").description("Print the shareable dashboard URL for your fu
8659
8706
  const refParam = agentId ? `?ref=${agentId}` : "";
8660
8707
  const dashboardUrl = fundShareUrl(subdomain, refParam);
8661
8708
  console.log();
8662
- console.log(LABEL5(" \u25C6 Share Your Fund"));
8709
+ console.log(LABEL5(" \u25C6 Share Your Vault"));
8663
8710
  SEP6();
8664
8711
  console.log(W6(` Dashboard: ${G6(dashboardUrl)}`));
8665
8712
  console.log(W6(` ENS: ${DIM6(`${subdomain}.sherwoodagent.eth`)}`));
8666
8713
  console.log(W6(` Vault: ${DIM6(fundInfo.vault)}`));
8667
- console.log(W6(` Join CLI: ${DIM6(`sherwood fund join --subdomain ${subdomain}`)}`));
8714
+ console.log(W6(` Join CLI: ${DIM6(`sherwood vault join --subdomain ${subdomain}`)}`));
8668
8715
  SEP6();
8669
8716
  try {
8670
8717
  const { exec } = await import("child_process");
@@ -8682,12 +8729,12 @@ fund.command("share").description("Print the shareable dashboard URL for your fu
8682
8729
  process.exit(1);
8683
8730
  }
8684
8731
  });
8685
- fund.command("join").description("Request to join a fund (creates an EAS attestation)").option("--subdomain <name>", "Fund subdomain to join").option("--ref <agentId>", "Referrer agent ID (from invite link)").option("--message <text>", "Message to the creator", "Requesting to join your fund").action(async (opts) => {
8686
- const spinner = ora9("Resolving fund...").start();
8732
+ vaultCmd.command("join").description("Request to join a vault (creates an EAS attestation)").option("--subdomain <name>", "Vault subdomain to join").option("--ref <agentId>", "Referrer agent ID (from invite link)").option("--message <text>", "Message to the creator", "Requesting to join your vault").action(async (opts) => {
8733
+ const spinner = ora9("Resolving vault...").start();
8687
8734
  try {
8688
8735
  const subdomain = opts.subdomain || getPrimaryFund(getChain().id)?.subdomain;
8689
8736
  if (!subdomain) {
8690
- spinner.fail("No fund configured. Pass --subdomain <name> or run 'fund create' first.");
8737
+ spinner.fail("No vault configured. Pass --subdomain <name> or run 'vault create' first.");
8691
8738
  process.exit(1);
8692
8739
  }
8693
8740
  const agentId = getAgentId();
@@ -8695,18 +8742,18 @@ fund.command("join").description("Request to join a fund (creates an EAS attesta
8695
8742
  spinner.fail("No agent identity found. Run 'sherwood identity mint' first.");
8696
8743
  process.exit(1);
8697
8744
  }
8698
- let fund2;
8745
+ let fund;
8699
8746
  try {
8700
- fund2 = await resolveFund(subdomain);
8747
+ fund = await resolveFund(subdomain);
8701
8748
  } catch {
8702
8749
  spinner.text = "Searching across chains...";
8703
8750
  const hits = await searchFundAcrossChains(subdomain);
8704
- spinner.fail(`Fund "${subdomain}" not found on ${getNetwork()}`);
8751
+ spinner.fail(`Vault "${subdomain}" not found on ${getNetwork()}`);
8705
8752
  if (hits.length === 0) {
8706
8753
  console.error(chalk17.red(` Not found on any supported chain.`));
8707
8754
  } else if (hits.length === 1) {
8708
8755
  console.error(chalk17.yellow(` Found on chain: ${chalk17.bold(hits[0].network)}`));
8709
- console.error(chalk17.dim(` Re-run: sherwood --chain ${hits[0].network} fund join --subdomain ${subdomain}`));
8756
+ console.error(chalk17.dim(` Re-run: sherwood --chain ${hits[0].network} vault join --subdomain ${subdomain}`));
8710
8757
  } else {
8711
8758
  const chains = hits.map((h) => h.network).join(", ");
8712
8759
  console.error(chalk17.yellow(` Found on chains: ${chalk17.bold(chains)}`));
@@ -8730,10 +8777,10 @@ fund.command("join").description("Request to join a fund (creates an EAS attesta
8730
8777
  emitCalldata(
8731
8778
  encodeJoinRequest(
8732
8779
  {
8733
- fundId: fund2.id,
8780
+ fundId: fund.id,
8734
8781
  agentId: BigInt(agentId),
8735
- vault: fund2.vault,
8736
- creator: fund2.creator,
8782
+ vault: fund.vault,
8783
+ creator: fund.creator,
8737
8784
  message: joinMessage,
8738
8785
  referrerAgentId: referrerAgentId2
8739
8786
  },
@@ -8744,10 +8791,10 @@ fund.command("join").description("Request to join a fund (creates an EAS attesta
8744
8791
  }
8745
8792
  const callerAddress = getAccount().address;
8746
8793
  spinner.text = "Checking membership...";
8747
- setVaultAddress(fund2.vault);
8794
+ setVaultAddress(fund.vault);
8748
8795
  const alreadyAgent = await isAgent(callerAddress);
8749
8796
  if (alreadyAgent) {
8750
- spinner.succeed("You are already a registered agent on this fund");
8797
+ spinner.succeed("You are already a registered agent on this vault");
8751
8798
  try {
8752
8799
  const xmtp = await loadXmtp();
8753
8800
  await xmtp.getXmtpClient();
@@ -8768,12 +8815,12 @@ fund.command("join").description("Request to join a fund (creates an EAS attesta
8768
8815
  return;
8769
8816
  }
8770
8817
  spinner.text = "Checking pending requests...";
8771
- const pendingRequests = await queryJoinRequests(fund2.creator);
8818
+ const pendingRequests = await queryJoinRequests(fund.creator);
8772
8819
  const existingRequest = pendingRequests.find(
8773
- (r) => r.attester.toLowerCase() === callerAddress.toLowerCase() && r.decoded.vault.toLowerCase() === fund2.vault.toLowerCase()
8820
+ (r) => r.attester.toLowerCase() === callerAddress.toLowerCase() && r.decoded.vault.toLowerCase() === fund.vault.toLowerCase()
8774
8821
  );
8775
8822
  if (existingRequest) {
8776
- spinner.succeed("You already have a pending join request for this fund");
8823
+ spinner.succeed("You already have a pending join request for this vault");
8777
8824
  console.log(chalk17.dim(` Attestation: ${existingRequest.uid}`));
8778
8825
  console.log(chalk17.dim(` Submitted: ${new Date(existingRequest.time * 1e3).toLocaleString()}`));
8779
8826
  try {
@@ -8788,10 +8835,10 @@ fund.command("join").description("Request to join a fund (creates an EAS attesta
8788
8835
  spinner.text = "Creating join request attestation...";
8789
8836
  const referrerAgentId = opts.ref ? parseInt(opts.ref, 10) : void 0;
8790
8837
  const joinAttestation = await createJoinRequest(
8791
- fund2.id,
8838
+ fund.id,
8792
8839
  BigInt(agentId),
8793
- fund2.vault,
8794
- fund2.creator,
8840
+ fund.vault,
8841
+ fund.creator,
8795
8842
  joinMessage,
8796
8843
  referrerAgentId
8797
8844
  );
@@ -8804,7 +8851,7 @@ fund.command("join").description("Request to join a fund (creates an EAS attesta
8804
8851
  spinner.succeed("Join request created");
8805
8852
  console.warn(chalk17.yellow(" \u26A0 Could not initialize XMTP identity \u2014 creator may not be able to auto-add you to chat"));
8806
8853
  }
8807
- addFund(getChain().id, { subdomain, vault: fund2.vault, role: "agent" });
8854
+ addFund(getChain().id, { subdomain, vault: fund.vault, role: "agent" });
8808
8855
  setPrimaryFund(getChain().id, subdomain);
8809
8856
  try {
8810
8857
  const cron = await loadCron();
@@ -8819,9 +8866,9 @@ fund.command("join").description("Request to join a fund (creates an EAS attesta
8819
8866
  console.log();
8820
8867
  console.log(LABEL5(" \u25C6 Join Request Submitted"));
8821
8868
  SEP6();
8822
- console.log(W6(` Fund: ${G6(`${subdomain}.sherwoodagent.eth`)}`));
8869
+ console.log(W6(` Vault: ${G6(`${subdomain}.sherwoodagent.eth`)}`));
8823
8870
  console.log(W6(` Agent ID: #${agentId}`));
8824
- console.log(W6(` Creator: ${DIM6(fund2.creator)}`));
8871
+ console.log(W6(` Creator: ${DIM6(fund.creator)}`));
8825
8872
  if (joinAttestation) {
8826
8873
  console.log(W6(` Attestation: ${DIM6(joinAttestation.uid)}`));
8827
8874
  console.log(W6(` Explorer: ${DIM6(getEasExplorerUrl(joinAttestation.hash))}`));
@@ -8829,9 +8876,9 @@ fund.command("join").description("Request to join a fund (creates an EAS attesta
8829
8876
  console.log(W6(` Attestation: ${DIM6("skipped on this chain")}`));
8830
8877
  }
8831
8878
  SEP6();
8832
- console.log(G6(" \u2713 Fund saved to ~/.sherwood/config.json (set as primary)"));
8879
+ console.log(G6(" \u2713 Vault saved to ~/.sherwood/config.json (set as primary)"));
8833
8880
  console.log(G6(" \u2713 The creator can review with:"));
8834
- console.log(DIM6(` sherwood fund requests --subdomain ${subdomain}`));
8881
+ console.log(DIM6(` sherwood vault requests --subdomain ${subdomain}`));
8835
8882
  console.log();
8836
8883
  } catch (err) {
8837
8884
  spinner.fail("Join request failed");
@@ -8839,7 +8886,7 @@ fund.command("join").description("Request to join a fund (creates an EAS attesta
8839
8886
  process.exit(1);
8840
8887
  }
8841
8888
  });
8842
- fund.command("requests").description("View pending join requests for a fund (creator only)").option("--subdomain <name>", "Fund subdomain").option("--vault <address>", "Vault address (default: from config)").action(async (opts) => {
8889
+ vaultCmd.command("requests").description("View pending join requests for a vault (creator only)").option("--subdomain <name>", "Vault subdomain").option("--vault <address>", "Vault address (default: from config)").action(async (opts) => {
8843
8890
  const spinner = ora9("Loading join requests...").start();
8844
8891
  try {
8845
8892
  let creatorAddress;
@@ -8860,7 +8907,7 @@ fund.command("requests").description("View pending join requests for a fund (cre
8860
8907
  }
8861
8908
  const callerAddress = getAccount().address.toLowerCase();
8862
8909
  if (creatorAddress.toLowerCase() !== callerAddress) {
8863
- spinner.fail("Only the fund creator can view join requests");
8910
+ spinner.fail("Only the vault creator can view join requests");
8864
8911
  process.exit(1);
8865
8912
  }
8866
8913
  spinner.text = "Querying EAS attestations...";
@@ -8908,9 +8955,9 @@ fund.command("requests").description("View pending join requests for a fund (cre
8908
8955
  console.log();
8909
8956
  }
8910
8957
  console.log(G6(" To approve:"));
8911
- console.log(DIM6(` sherwood fund approve --agent-id <id> --wallet <addr>`));
8958
+ console.log(DIM6(` sherwood vault approve --agent-id <id> --wallet <addr>`));
8912
8959
  console.log(G6(" To reject:"));
8913
- console.log(DIM6(` sherwood fund reject --attestation <uid>`));
8960
+ console.log(DIM6(` sherwood vault reject --attestation <uid>`));
8914
8961
  console.log();
8915
8962
  } catch (err) {
8916
8963
  spinner.fail("Failed to load requests");
@@ -8918,7 +8965,7 @@ fund.command("requests").description("View pending join requests for a fund (cre
8918
8965
  process.exit(1);
8919
8966
  }
8920
8967
  });
8921
- fund.command("approve").description("Approve an agent join request (registers agent + creates EAS approval)").option("--vault <address>", "Vault address (default: from config)").option("--subdomain <name>", "Fund subdomain (alternative to --vault)").requiredOption("--agent-id <id>", "Agent's ERC-8004 identity token ID").requiredOption("--wallet <address>", "Agent wallet address").action(async (opts) => {
8968
+ vaultCmd.command("approve").description("Approve an agent join request (registers agent + creates EAS approval)").option("--vault <address>", "Vault address (default: from config)").option("--subdomain <name>", "Vault subdomain (alternative to --vault)").requiredOption("--agent-id <id>", "Agent's ERC-8004 identity token ID").requiredOption("--wallet <address>", "Agent wallet address").action(async (opts) => {
8922
8969
  const spinner = ora9("Verifying creator...").start();
8923
8970
  try {
8924
8971
  const approveSubdomain = opts.subdomain || getPrimaryFund(getChain().id)?.subdomain;
@@ -8948,7 +8995,7 @@ fund.command("approve").description("Approve an agent join request (registers ag
8948
8995
  }
8949
8996
  const callerAddress = getAccount().address.toLowerCase();
8950
8997
  if (creator.toLowerCase() !== callerAddress) {
8951
- spinner.fail("Only the fund creator can approve agents");
8998
+ spinner.fail("Only the vault creator can approve agents");
8952
8999
  process.exit(1);
8953
9000
  }
8954
9001
  spinner.text = "Registering agent on vault...";
@@ -9023,7 +9070,7 @@ fund.command("approve").description("Approve an agent join request (registers ag
9023
9070
  process.exit(1);
9024
9071
  }
9025
9072
  });
9026
- fund.command("reject").description("Reject a join request by revoking its attestation").requiredOption("--attestation <uid>", "Join request attestation UID to revoke").action(async (opts) => {
9073
+ vaultCmd.command("reject").description("Reject a join request by revoking its attestation").requiredOption("--attestation <uid>", "Join request attestation UID to revoke").action(async (opts) => {
9027
9074
  const spinner = ora9("Revoking attestation...").start();
9028
9075
  try {
9029
9076
  const hash = await revokeJoinRequest(opts.attestation);
@@ -9039,10 +9086,10 @@ fund.command("reject").description("Reject a join request by revoking its attest
9039
9086
  process.exit(1);
9040
9087
  }
9041
9088
  });
9042
- fund.command("leave").description("Leave a fund \u2014 removes participation crons and session state").option("--subdomain <name>", "Fund subdomain to leave").action(async (opts) => {
9089
+ vaultCmd.command("leave").description("Leave a vault \u2014 removes participation crons and session state").option("--subdomain <name>", "Vault subdomain to leave").action(async (opts) => {
9043
9090
  const subdomain = opts.subdomain || getPrimaryFund(getChain().id)?.subdomain;
9044
9091
  if (!subdomain) {
9045
- console.error(chalk17.red(" No fund configured. Pass --subdomain <name>."));
9092
+ console.error(chalk17.red(" No vault configured. Pass --subdomain <name>."));
9046
9093
  process.exit(1);
9047
9094
  }
9048
9095
  const spinner = ora9("Cleaning up...").start();
@@ -9056,7 +9103,7 @@ fund.command("leave").description("Leave a fund \u2014 removes participation cro
9056
9103
  }
9057
9104
  const { resetSession } = await import("./session-XBQY7SBJ.js");
9058
9105
  resetSession(subdomain);
9059
- spinner.succeed("Left fund");
9106
+ spinner.succeed("Left vault");
9060
9107
  if (cronsRemoved) {
9061
9108
  console.log(G6(" \u2713 Participation crons removed"));
9062
9109
  }
@@ -9072,18 +9119,18 @@ fund.command("leave").description("Leave a fund \u2014 removes participation cro
9072
9119
  process.exit(1);
9073
9120
  }
9074
9121
  });
9075
- fund.command("set-primary").description("Set the active fund for CLI commands (auto-used when --subdomain is omitted)").option("--subdomain <name>", "Fund subdomain").option("--vault <address>", "Vault address").action(async (opts) => {
9122
+ vaultCmd.command("set-primary").description("Set the active vault for CLI commands (auto-used when --subdomain is omitted)").option("--subdomain <name>", "Vault subdomain").option("--vault <address>", "Vault address").action(async (opts) => {
9076
9123
  try {
9077
9124
  const chainId = getChain().id;
9078
9125
  const memberships = getFunds(chainId);
9079
9126
  if (!opts.subdomain && !opts.vault) {
9080
9127
  const primary = getPrimaryFund(chainId);
9081
9128
  if (memberships.length === 0) {
9082
- console.log(DIM6("\n No funds saved. Create or join one first.\n"));
9129
+ console.log(DIM6("\n No vaults saved. Create or join one first.\n"));
9083
9130
  return;
9084
9131
  }
9085
9132
  console.log();
9086
- console.log(LABEL5(" \u25C6 Your Funds"));
9133
+ console.log(LABEL5(" \u25C6 Your Vaults"));
9087
9134
  SEP6();
9088
9135
  for (const m of memberships) {
9089
9136
  const isPrimary = primary?.subdomain === m.subdomain;
@@ -9093,7 +9140,7 @@ fund.command("set-primary").description("Set the active fund for CLI commands (a
9093
9140
  }
9094
9141
  SEP6();
9095
9142
  if (memberships.length > 1) {
9096
- console.log(DIM6(" Switch with: sherwood fund set-primary --subdomain <name>"));
9143
+ console.log(DIM6(" Switch with: sherwood vault set-primary --subdomain <name>"));
9097
9144
  }
9098
9145
  console.log();
9099
9146
  return;
@@ -9119,19 +9166,18 @@ fund.command("set-primary").description("Set the active fund for CLI commands (a
9119
9166
  }
9120
9167
  }
9121
9168
  if (!target) {
9122
- console.error(chalk17.red(" Could not resolve fund. Pass --subdomain or --vault."));
9169
+ console.error(chalk17.red(" Could not resolve vault. Pass --subdomain or --vault."));
9123
9170
  process.exit(1);
9124
9171
  }
9125
9172
  setPrimaryFund(chainId, target);
9126
9173
  console.log(G6(`
9127
- \u2713 Primary fund set to ${target}.sherwoodagent.eth
9174
+ \u2713 Primary vault set to ${target}.sherwoodagent.eth
9128
9175
  `));
9129
9176
  } catch (err) {
9130
9177
  console.error(chalk17.red(formatContractError(err)));
9131
9178
  process.exit(1);
9132
9179
  }
9133
9180
  });
9134
- var vaultCmd = program.command("vault");
9135
9181
  vaultCmd.command("deposit").description("Deposit into a vault").option("--vault <address>", "Vault address (default: from config)").requiredOption("--amount <amount>", "Amount to deposit (in asset units)").option("--use-eth", "Auto-wrap ETH \u2192 WETH before depositing (for WETH vaults)").option("--receiver <address>", "Depositor / share receiver (required with --calldata-only)").action(async (opts) => {
9136
9182
  resolveVault(opts);
9137
9183
  const decimals = await getAssetDecimals();
@@ -9210,27 +9256,6 @@ vaultCmd.command("deposit").description("Deposit into a vault").option("--vault
9210
9256
  process.exit(1);
9211
9257
  }
9212
9258
  });
9213
- vaultCmd.command("info").description("Display vault state").option("--vault <address>", "Vault address (default: from config)").action(async (opts) => {
9214
- resolveVault(opts);
9215
- const spinner = ora9("Loading vault info...").start();
9216
- try {
9217
- const info = await getVaultInfo();
9218
- spinner.stop();
9219
- console.log();
9220
- console.log(chalk17.bold("Vault Info"));
9221
- console.log(chalk17.dim("\u2500".repeat(40)));
9222
- console.log(` Address: ${info.address}`);
9223
- console.log(` Total Assets: ${info.totalAssets}`);
9224
- console.log(` Agent Count: ${info.agentCount}`);
9225
- console.log(` Redemptions Locked: ${info.redemptionsLocked}`);
9226
- console.log(` Management Fee: ${Number(info.managementFeeBps) / 100}%`);
9227
- console.log();
9228
- } catch (err) {
9229
- spinner.fail("Failed to load vault info");
9230
- console.error(chalk17.red(formatContractError(err)));
9231
- process.exit(1);
9232
- }
9233
- });
9234
9259
  vaultCmd.command("balance").description("Show LP share balance and asset value").option("--vault <address>", "Vault address (default: from config)").option("--address <address>", "Address to check (default: your wallet)").action(async (opts) => {
9235
9260
  resolveVault(opts);
9236
9261
  const spinner = ora9("Loading balance...").start();
@@ -9346,17 +9371,17 @@ ${info.name} (${info.type})`);
9346
9371
  }
9347
9372
  });
9348
9373
  try {
9349
- const { registerChatCommands } = await import("./chat-DNWTI4CZ.js");
9374
+ const { registerChatCommands } = await import("./chat-PRYOT3ZV.js");
9350
9375
  registerChatCommands(program);
9351
9376
  } catch {
9352
- program.command("chat <name> [action] [actionArgs...]").description("Fund chat (XMTP) \u2014 requires @xmtp/cli").action(() => {
9377
+ program.command("chat <name> [action] [actionArgs...]").description("Vault chat (XMTP) \u2014 requires @xmtp/cli").action(() => {
9353
9378
  console.error(chalk17.red("XMTP CLI not available."));
9354
9379
  console.error(chalk17.dim("Install with: npm install -g @xmtp/cli"));
9355
9380
  console.error(chalk17.dim("Or reinstall: npm i -g @sherwoodagent/cli"));
9356
9381
  process.exit(1);
9357
9382
  });
9358
9383
  }
9359
- var { registerSessionCommands } = await import("./session-M5QB25PK.js");
9384
+ var { registerSessionCommands } = await import("./session-LJT3SAED.js");
9360
9385
  registerSessionCommands(program);
9361
9386
  registerVeniceCommands(program);
9362
9387
  registerAllowanceCommands(program);
@@ -9365,15 +9390,15 @@ registerProposalCommands(program);
9365
9390
  registerQueueCommands(program);
9366
9391
  registerGovernorCommands(program);
9367
9392
  registerGuardianCommands(program);
9368
- var { registerResearchCommands } = await import("./research-GZNVG3SP.js");
9393
+ var { registerResearchCommands } = await import("./research-NKGP3M4J.js");
9369
9394
  registerResearchCommands(program);
9370
9395
  var { registerAgentCommands } = await import("./agent-TBLC3WNJ.js");
9371
9396
  registerAgentCommands(program);
9372
- var { registerTradeCommands } = await import("./trade-TCQ5NUNA.js");
9397
+ var { registerTradeCommands } = await import("./trade-OTZ7UHDK.js");
9373
9398
  registerTradeCommands(program);
9374
9399
  registerGridCommand(program);
9375
9400
  var configCmd = program.command("config");
9376
- configCmd.command("set").description("Save settings to ~/.sherwood/config.json (persists across sessions)").option("--private-key <key>", "Wallet private key (0x-prefixed)").option("--vault <address>", "Default vault address").option("--rpc <url>", "Custom RPC URL for the active --chain network").option("--notify-to <id>", "Destination for cron summaries (Telegram chat ID, phone, etc.)").option("--uniswap-api-key <key>", "Uniswap Trading API key (from developers.uniswap.org)").option("--venice-api-key <key>", "Venice AI inference API key").option("--anthropic-api-key <key>", "Anthropic Claude API key (for LLM judge)").option("--xmtp-group <subdomain:groupId>", "Cache an XMTP group ID for a fund (e.g. my-fund:abc123)").action((opts) => {
9401
+ configCmd.command("set").description("Save settings to ~/.sherwood/config.json (persists across sessions)").option("--private-key <key>", "Wallet private key (0x-prefixed)").option("--vault <address>", "Default vault address").option("--rpc <url>", "Custom RPC URL for the active --chain network").option("--notify-to <id>", "Destination for cron summaries (Telegram chat ID, phone, etc.)").option("--uniswap-api-key <key>", "Uniswap Trading API key (from developers.uniswap.org)").option("--venice-api-key <key>", "Venice AI inference API key").option("--anthropic-api-key <key>", "Anthropic Claude API key (for LLM judge)").option("--xmtp-group <subdomain:groupId>", "Cache an XMTP group ID for a vault (e.g. my-vault:abc123)").action((opts) => {
9377
9402
  let saved = false;
9378
9403
  if (opts.privateKey) {
9379
9404
  setPrivateKey(opts.privateKey);