@sherwoodagent/cli 0.89.3 → 0.90.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 (28) hide show
  1. package/dist/{chat-EVRY5BV3.js → chat-PFXIL6WT.js} +5 -5
  2. package/dist/{chunk-WAF3JU5J.js → chunk-J3JMMJLN.js} +2 -2
  3. package/dist/{chunk-NJNK6GTJ.js → chunk-KRASHQRB.js} +4 -4
  4. package/dist/{chunk-UCULHATO.js → chunk-XQHRKFFH.js} +48 -9
  5. package/dist/chunk-XQHRKFFH.js.map +1 -0
  6. package/dist/{chunk-6KXITNND.js → chunk-ZCRVHITI.js} +9 -9
  7. package/dist/{identity-462SMK5H.js → identity-M6UIVBNX.js} +4 -4
  8. package/dist/index.js +291 -197
  9. package/dist/index.js.map +1 -1
  10. package/dist/{lighter-preflight-TSLSSYWI.js → lighter-preflight-R7C6HY3M.js} +5 -5
  11. package/dist/{price-QKOARHS4.js → price-PBFF6NFU.js} +3 -3
  12. package/dist/{research-3L3BTHWY.js → research-ZH34O7YL.js} +1 -1
  13. package/dist/{session-27X337LQ.js → session-GSWEE4M3.js} +3 -3
  14. package/dist/{trade-6Q7VCDEA.js → trade-SHK7GKSI.js} +3 -3
  15. package/dist/{vault-TQWUWBSG.js → vault-3T6UHCPE.js} +4 -4
  16. package/package.json +1 -1
  17. package/dist/chunk-UCULHATO.js.map +0 -1
  18. /package/dist/{chat-EVRY5BV3.js.map → chat-PFXIL6WT.js.map} +0 -0
  19. /package/dist/{chunk-WAF3JU5J.js.map → chunk-J3JMMJLN.js.map} +0 -0
  20. /package/dist/{chunk-NJNK6GTJ.js.map → chunk-KRASHQRB.js.map} +0 -0
  21. /package/dist/{chunk-6KXITNND.js.map → chunk-ZCRVHITI.js.map} +0 -0
  22. /package/dist/{identity-462SMK5H.js.map → identity-M6UIVBNX.js.map} +0 -0
  23. /package/dist/{lighter-preflight-TSLSSYWI.js.map → lighter-preflight-R7C6HY3M.js.map} +0 -0
  24. /package/dist/{price-QKOARHS4.js.map → price-PBFF6NFU.js.map} +0 -0
  25. /package/dist/{research-3L3BTHWY.js.map → research-ZH34O7YL.js.map} +0 -0
  26. /package/dist/{session-27X337LQ.js.map → session-GSWEE4M3.js.map} +0 -0
  27. /package/dist/{trade-6Q7VCDEA.js.map → trade-SHK7GKSI.js.map} +0 -0
  28. /package/dist/{vault-TQWUWBSG.js.map → vault-3T6UHCPE.js.map} +0 -0
@@ -2,10 +2,6 @@ import {
2
2
  getFund,
3
3
  updateMetadata
4
4
  } from "./chunk-DQZJULNP.js";
5
- import {
6
- fetchMetadata,
7
- uploadMetadata
8
- } from "./chunk-YMB4RJOR.js";
9
5
  import {
10
6
  getTextRecord,
11
7
  resolveFund,
@@ -24,6 +20,10 @@ import {
24
20
  getCachedGroupId
25
21
  } from "./chunk-QUAVAJWE.js";
26
22
  import "./chunk-SCWNKVNW.js";
23
+ import {
24
+ fetchMetadata,
25
+ uploadMetadata
26
+ } from "./chunk-YMB4RJOR.js";
27
27
 
28
28
  // src/commands/chat.ts
29
29
  import chalk from "chalk";
@@ -563,4 +563,4 @@ function registerChatCommands(program) {
563
563
  export {
564
564
  registerChatCommands
565
565
  };
566
- //# sourceMappingURL=chat-EVRY5BV3.js.map
566
+ //# sourceMappingURL=chat-PFXIL6WT.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getLogsChunked
3
- } from "./chunk-NJNK6GTJ.js";
3
+ } from "./chunk-KRASHQRB.js";
4
4
  import {
5
5
  TOKENS
6
6
  } from "./chunk-3R57ETXQ.js";
@@ -557,4 +557,4 @@ export {
557
557
  registerAgent,
558
558
  getVaultInfo
559
559
  };
560
- //# sourceMappingURL=chunk-WAF3JU5J.js.map
560
+ //# sourceMappingURL=chunk-J3JMMJLN.js.map
@@ -1,6 +1,3 @@
1
- import {
2
- resolveMetadataSummary
3
- } from "./chunk-YMB4RJOR.js";
4
1
  import {
5
2
  PROPOSAL_STATES,
6
3
  getProposal
@@ -8,6 +5,9 @@ import {
8
5
  import {
9
6
  getPublicClient
10
7
  } from "./chunk-I7NYU4JB.js";
8
+ import {
9
+ resolveMetadataSummary
10
+ } from "./chunk-YMB4RJOR.js";
11
11
 
12
12
  // src/lib/events.ts
13
13
  import { parseAbiItem } from "viem";
@@ -212,4 +212,4 @@ export {
212
212
  getCurrentBlock,
213
213
  enrichProposalEvents
214
214
  };
215
- //# sourceMappingURL=chunk-NJNK6GTJ.js.map
215
+ //# sourceMappingURL=chunk-KRASHQRB.js.map
@@ -1,13 +1,10 @@
1
- import {
2
- resolveMetadataSummary
3
- } from "./chunk-YMB4RJOR.js";
4
- import {
5
- COORDINATION_NETWORK
6
- } from "./chunk-2SIUEMPV.js";
7
1
  import {
8
2
  emitCalldata,
9
3
  isCalldataOnly
10
4
  } from "./chunk-GAQMHH44.js";
5
+ import {
6
+ COORDINATION_NETWORK
7
+ } from "./chunk-2SIUEMPV.js";
11
8
  import {
12
9
  AGENT_REGISTRY
13
10
  } from "./chunk-3R57ETXQ.js";
@@ -30,6 +27,9 @@ import {
30
27
  setAgentId,
31
28
  setVirtualsIdentity
32
29
  } from "./chunk-QUAVAJWE.js";
30
+ import {
31
+ resolveMetadataSummary
32
+ } from "./chunk-YMB4RJOR.js";
33
33
 
34
34
  // src/commands/identity.ts
35
35
  import { getAddress as getAddress9, isAddress as isAddress3 } from "viem";
@@ -982,6 +982,15 @@ var STAKED_WOOD_ABI = [
982
982
  ],
983
983
  outputs: []
984
984
  },
985
+ // Vault-creator bond. `createSyndicate` reverts PreparedStakeNotFound
986
+ // until the creator has called this (min = minOwnerStake).
987
+ {
988
+ name: "prepareOwnerStake",
989
+ type: "function",
990
+ stateMutability: "nonpayable",
991
+ inputs: [{ name: "amount", type: "uint256" }],
992
+ outputs: []
993
+ },
985
994
  // Self-stake unstake flow. Moved off GUARDIAN_REGISTRY_ABI in SHE-185 —
986
995
  // the registry holds zero WOOD and implements none of these.
987
996
  {
@@ -2108,11 +2117,11 @@ function encodeCreateFund(args, chainId) {
2108
2117
  txs: [{ to: factory, data, value: ZERO_VALUE3, chainId }],
2109
2118
  preconditions: [
2110
2119
  // Creator must own the ERC-8004 NFT for `creatorAgentId` and have
2111
- // pre-staked the owner bond via guardianRegistry.prepareOwnerStake.
2120
+ // pre-staked the owner bond via StakedWood.prepareOwnerStake.
2112
2121
  // No on-chain check from the SDK side — agent verifies upstream.
2113
2122
  ],
2114
2123
  description: `Create fund "${args.subdomain}" with ${args.openDeposits ? "open" : "whitelisted"} deposits.`,
2115
- note: "Caller must own the ERC-8004 NFT for `creatorAgentId` and must have called `guardianRegistry.prepareOwnerStake` first to bond the owner stake. The factory's `createSyndicate` deploys a vault proxy + binds the owner stake atomically."
2124
+ note: "Caller must own the ERC-8004 NFT for `creatorAgentId` and must have called `StakedWood.prepareOwnerStake` first to bond the owner stake. The factory's `createSyndicate` deploys a vault proxy + binds the owner stake atomically."
2116
2125
  };
2117
2126
  }
2118
2127
 
@@ -2398,6 +2407,35 @@ function encodeGuardianStake(args, chainId) {
2398
2407
  note: "Caller must have approved WOOD for sWOOD (StakedWood) first. Stake locks the WOOD; use /prepare/guardian-unstake later to start the 7d unstake cooldown."
2399
2408
  };
2400
2409
  }
2410
+ function encodePrepareOwnerStake(args, chainId) {
2411
+ if (args.amount <= 0n)
2412
+ throw usage("`amount` must be > 0");
2413
+ const wood = getDeployment(chainId).tokens.wood?.address;
2414
+ if (!wood || wood === "0x0000000000000000000000000000000000000000") {
2415
+ throw unsupported(`WOOD is not deployed on chain ${chainId} yet`);
2416
+ }
2417
+ const stake = swoodTx(chainId, encodeFunctionData7({
2418
+ abi: STAKED_WOOD_ABI,
2419
+ functionName: "prepareOwnerStake",
2420
+ args: [args.amount]
2421
+ }));
2422
+ const approve = {
2423
+ to: wood,
2424
+ data: encodeFunctionData7({
2425
+ abi: ERC20_ABI,
2426
+ functionName: "approve",
2427
+ args: [stake.to, args.amount]
2428
+ }),
2429
+ value: ZERO_VALUE5,
2430
+ chainId
2431
+ };
2432
+ return {
2433
+ txs: [approve, stake],
2434
+ preconditions: [],
2435
+ description: `Bond ${args.amount.toString()} WOOD (raw) as the vault-creator owner stake.`,
2436
+ note: "Send in order from the wallet that will create the vault. Must be at least StakedWood.minOwnerStake(). Required once before `createSyndicate`, which binds the prepared stake to the new vault."
2437
+ };
2438
+ }
2401
2439
  var GUARDIAN_UNSTAKE_FN = {
2402
2440
  request: "requestUnstakeGuardian",
2403
2441
  cancel: "cancelUnstakeGuardian",
@@ -3011,6 +3049,7 @@ export {
3011
3049
  encodeJoinRequest,
3012
3050
  encodeApproveAgent,
3013
3051
  encodeGuardianStake,
3052
+ encodePrepareOwnerStake,
3014
3053
  encodeGuardianUnstake,
3015
3054
  encodeVoteOnProposal,
3016
3055
  DEFAULT_ISSUING_CHAIN_ID,
@@ -3023,4 +3062,4 @@ export {
3023
3062
  lookupAgentIdByWallet,
3024
3063
  registerIdentityCommands
3025
3064
  };
3026
- //# sourceMappingURL=chunk-UCULHATO.js.map
3065
+ //# sourceMappingURL=chunk-XQHRKFFH.js.map