@sherwoodagent/cli 0.58.3 → 0.58.6

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 (34) hide show
  1. package/dist/{addresses-NX3SHRBT.js → addresses-4UI26LWU.js} +2 -2
  2. package/dist/{chat-UNDF6HZA.js → chat-SQCWYIKG.js} +5 -5
  3. package/dist/{chunk-HKOPANVM.js → chunk-3OAGUA2S.js} +2 -2
  4. package/dist/{chunk-3M6K2MNV.js → chunk-3UETTXXU.js} +3 -3
  5. package/dist/{chunk-3M6K2MNV.js.map → chunk-3UETTXXU.js.map} +1 -1
  6. package/dist/{chunk-TMPH4P63.js → chunk-TPDRDOCF.js} +2 -2
  7. package/dist/{chunk-EWKFWF3G.js → chunk-V5DYFQCQ.js} +2 -2
  8. package/dist/{chunk-XHNSF4NV.js → chunk-XFVLEE5S.js} +2 -2
  9. package/dist/{chunk-KG7BGVBR.js → chunk-ZORVNIGX.js} +2 -2
  10. package/dist/{eas-6HFFZZ52.js → eas-OEBIB5RW.js} +3 -3
  11. package/dist/{governor-GVDZOYJQ.js → governor-UWI3QYHV.js} +3 -3
  12. package/dist/index.js +102 -37
  13. package/dist/index.js.map +1 -1
  14. package/dist/{price-H4X2AAAQ.js → price-MUILXUC4.js} +2 -2
  15. package/dist/{research-PYUIY4VC.js → research-AR4TABCF.js} +3 -3
  16. package/dist/{session-AZKLV2T7.js → session-ISY5VAUS.js} +5 -5
  17. package/dist/{trade-P2LBGWVY.js → trade-VTRYXGP4.js} +6 -6
  18. package/dist/{xmtp-SQIOIRCX.js → xmtp-IVDHDORA.js} +3 -3
  19. package/package.json +1 -1
  20. package/scripts/pin-xmtp-bindings.cjs +120 -18
  21. /package/dist/{addresses-NX3SHRBT.js.map → addresses-4UI26LWU.js.map} +0 -0
  22. /package/dist/{chat-UNDF6HZA.js.map → chat-SQCWYIKG.js.map} +0 -0
  23. /package/dist/{chunk-HKOPANVM.js.map → chunk-3OAGUA2S.js.map} +0 -0
  24. /package/dist/{chunk-TMPH4P63.js.map → chunk-TPDRDOCF.js.map} +0 -0
  25. /package/dist/{chunk-EWKFWF3G.js.map → chunk-V5DYFQCQ.js.map} +0 -0
  26. /package/dist/{chunk-XHNSF4NV.js.map → chunk-XFVLEE5S.js.map} +0 -0
  27. /package/dist/{chunk-KG7BGVBR.js.map → chunk-ZORVNIGX.js.map} +0 -0
  28. /package/dist/{eas-6HFFZZ52.js.map → eas-OEBIB5RW.js.map} +0 -0
  29. /package/dist/{governor-GVDZOYJQ.js.map → governor-UWI3QYHV.js.map} +0 -0
  30. /package/dist/{price-H4X2AAAQ.js.map → price-MUILXUC4.js.map} +0 -0
  31. /package/dist/{research-PYUIY4VC.js.map → research-AR4TABCF.js.map} +0 -0
  32. /package/dist/{session-AZKLV2T7.js.map → session-ISY5VAUS.js.map} +0 -0
  33. /package/dist/{trade-P2LBGWVY.js.map → trade-VTRYXGP4.js.map} +0 -0
  34. /package/dist/{xmtp-SQIOIRCX.js.map → xmtp-IVDHDORA.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SYNTHRA,
3
3
  UNISWAP
4
- } from "./chunk-3M6K2MNV.js";
4
+ } from "./chunk-3UETTXXU.js";
5
5
  import {
6
6
  getPublicClient
7
7
  } from "./chunk-XDBRKW7I.js";
@@ -155,4 +155,4 @@ export {
155
155
  getTokenPriceInAsset,
156
156
  getTokenPricesInAsset
157
157
  };
158
- //# sourceMappingURL=price-H4X2AAAQ.js.map
158
+ //# sourceMappingURL=price-MUILXUC4.js.map
@@ -16,7 +16,7 @@ import ora from "ora";
16
16
  import { confirm } from "@inquirer/prompts";
17
17
  import { isAddress } from "viem";
18
18
  async function loadXmtp() {
19
- return import("./xmtp-SQIOIRCX.js");
19
+ return import("./xmtp-IVDHDORA.js");
20
20
  }
21
21
  var COST_ESTIMATES = {
22
22
  messari: MESSARI_COST_ESTIMATE,
@@ -83,7 +83,7 @@ function formatValue(value) {
83
83
  }
84
84
  async function postResearch(syndicateName, result, prompt) {
85
85
  const { pinJSON } = await import("./ipfs-IGXLLJCF.js");
86
- const { createResearchAttestation, getEasScanUrl } = await import("./eas-6HFFZZ52.js");
86
+ const { createResearchAttestation, getEasScanUrl } = await import("./eas-OEBIB5RW.js");
87
87
  const xmtp = await loadXmtp();
88
88
  const pinSpinner = ora("Pinning research result to IPFS...").start();
89
89
  let resultUri;
@@ -312,4 +312,4 @@ function registerResearchCommands(program) {
312
312
  export {
313
313
  registerResearchCommands
314
314
  };
315
- //# sourceMappingURL=research-PYUIY4VC.js.map
315
+ //# sourceMappingURL=research-AR4TABCF.js.map
@@ -6,14 +6,14 @@ import {
6
6
  } from "./chunk-W2ZUPR3W.js";
7
7
  import {
8
8
  resolveSyndicate
9
- } from "./chunk-EWKFWF3G.js";
9
+ } from "./chunk-V5DYFQCQ.js";
10
10
  import {
11
11
  PROPOSAL_STATES,
12
12
  getProposal
13
- } from "./chunk-KG7BGVBR.js";
13
+ } from "./chunk-ZORVNIGX.js";
14
14
  import {
15
15
  SHERWOOD
16
- } from "./chunk-3M6K2MNV.js";
16
+ } from "./chunk-3UETTXXU.js";
17
17
  import {
18
18
  getPublicClient
19
19
  } from "./chunk-XDBRKW7I.js";
@@ -187,7 +187,7 @@ async function enrichProposalEvents(events, metadataCache) {
187
187
 
188
188
  // src/commands/session.ts
189
189
  async function loadXmtp() {
190
- return import("./xmtp-SQIOIRCX.js");
190
+ return import("./xmtp-IVDHDORA.js");
191
191
  }
192
192
  async function resolveGovernor(vaultAddress) {
193
193
  const client = getPublicClient();
@@ -477,4 +477,4 @@ function registerSessionCommands(program) {
477
477
  export {
478
478
  registerSessionCommands
479
479
  };
480
- //# sourceMappingURL=session-AZKLV2T7.js.map
480
+ //# sourceMappingURL=session-ISY5VAUS.js.map
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  UniswapProvider,
6
6
  getQuote
7
- } from "./chunk-XHNSF4NV.js";
7
+ } from "./chunk-XFVLEE5S.js";
8
8
  import {
9
9
  chatCompletion
10
10
  } from "./chunk-7HJXZ4NM.js";
11
11
  import {
12
12
  TOKENS
13
- } from "./chunk-3M6K2MNV.js";
13
+ } from "./chunk-3UETTXXU.js";
14
14
  import {
15
15
  formatContractError,
16
16
  getAccount,
@@ -334,7 +334,7 @@ async function getCurrentPrice(tokenAddress, tokenDecimals, feeTier) {
334
334
  // src/commands/trade.ts
335
335
  var uniswap = new UniswapProvider();
336
336
  async function loadXmtp() {
337
- return import("./xmtp-SQIOIRCX.js");
337
+ return import("./xmtp-IVDHDORA.js");
338
338
  }
339
339
  var ETH_ADDRESS = "0x0000000000000000000000000000000000000000";
340
340
  var KNOWN_MEMECOINS = {
@@ -641,7 +641,7 @@ function registerTradeCommands(program) {
641
641
  }
642
642
  console.log(` Tx: ${chalk.dim(getExplorerUrl(txHash))}`);
643
643
  try {
644
- const { createTradeAttestation, getEasScanUrl } = await import("./eas-6HFFZZ52.js");
644
+ const { createTradeAttestation, getEasScanUrl } = await import("./eas-OEBIB5RW.js");
645
645
  const { getChainContracts } = await import("./config-REASKDIK.js");
646
646
  const { getChain: getActiveChain } = await import("./network-3ZU7UBDU.js");
647
647
  const vaultRecipient = getChainContracts(getActiveChain().id).vault;
@@ -769,7 +769,7 @@ function registerTradeCommands(program) {
769
769
  }
770
770
  console.log(` Tx: ${chalk.dim(getExplorerUrl(txHash))}`);
771
771
  try {
772
- const { createTradeAttestation, getEasScanUrl } = await import("./eas-6HFFZZ52.js");
772
+ const { createTradeAttestation, getEasScanUrl } = await import("./eas-OEBIB5RW.js");
773
773
  const { getChainContracts } = await import("./config-REASKDIK.js");
774
774
  const { getChain: getActiveChain } = await import("./network-3ZU7UBDU.js");
775
775
  const vaultRecipient = getChainContracts(getActiveChain().id).vault;
@@ -946,4 +946,4 @@ function sleep(ms) {
946
946
  export {
947
947
  registerTradeCommands
948
948
  };
949
- //# sourceMappingURL=trade-P2LBGWVY.js.map
949
+ //# sourceMappingURL=trade-VTRYXGP4.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getTextRecord
3
- } from "./chunk-EWKFWF3G.js";
4
- import "./chunk-3M6K2MNV.js";
3
+ } from "./chunk-V5DYFQCQ.js";
4
+ import "./chunk-3UETTXXU.js";
5
5
  import {
6
6
  getAccount
7
7
  } from "./chunk-XDBRKW7I.js";
@@ -281,4 +281,4 @@ export {
281
281
  sendReaction,
282
282
  streamMessages
283
283
  };
284
- //# sourceMappingURL=xmtp-SQIOIRCX.js.map
284
+ //# sourceMappingURL=xmtp-IVDHDORA.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sherwoodagent/cli",
3
- "version": "0.58.3",
3
+ "version": "0.58.6",
4
4
  "description": "CLI for agent-managed investment syndicates — onchain DeFi syndicates with XMTP chat",
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,10 +17,20 @@
17
17
  *
18
18
  * This postinstall forcibly replaces the installed binding with the dev
19
19
  * version. --no-save keeps package.json unchanged. --force tells npm to
20
- * ignore the semver conflict with @xmtp/node-sdk's own dep range (the
21
- * dev pre-release doesn't satisfy `^1.10.0` under npm's strict semver).
22
- * After the force-install, `npm dedupe` collapses any nested copies
23
- * inside @xmtp/node-sdk's own node_modules.
20
+ * ignore the semver conflict with @xmtp/node-sdk's own dep declaration
21
+ * (the dev pre-release doesn't satisfy `1.10.0` under npm's strict
22
+ * semver pre-releases only match an explicitly named version).
23
+ *
24
+ * The force-install hoists the dev binding to <cli>/node_modules/@xmtp/
25
+ * node-bindings, but @xmtp/node-sdk's own nested copy at <cli>/
26
+ * node_modules/@xmtp/node-sdk/node_modules/@xmtp/node-bindings persists
27
+ * — `npm dedupe` won't collapse it because the pre-release fails the
28
+ * SDK's strict `1.10.0` dep check. Node's `require()` from inside
29
+ * @xmtp/node-sdk then resolves the nested glibc-2.38 binding before
30
+ * walking up to the hoisted dev one.
31
+ *
32
+ * To force resolution back to the hoisted dev binding we recursively
33
+ * delete every nested @xmtp/node-bindings copy in the install tree.
24
34
  *
25
35
  * If npm isn't available or the network is unreachable at postinstall
26
36
  * time, this script exits quietly with status 0. Runtime XMTP calls
@@ -36,10 +46,14 @@
36
46
  "use strict";
37
47
 
38
48
  const { execSync } = require("node:child_process");
39
- const { existsSync } = require("node:fs");
49
+ const fs = require("node:fs");
40
50
  const path = require("node:path");
41
51
 
42
- const PINNED = "@xmtp/node-bindings@1.10.0-dev.97e86c6";
52
+ const PINNED_VERSION = "1.10.0-dev.97e86c6";
53
+ const PINNED = `@xmtp/node-bindings@${PINNED_VERSION}`;
54
+ const MANUAL_RECOVERY =
55
+ `cd $(dirname $(readlink -f $(which sherwood)))/../lib/node_modules/@sherwoodagent/cli && ` +
56
+ `npm install --no-save --force ${PINNED}`;
43
57
 
44
58
  // Skip in CI / test / sandbox envs where network is unavailable or unwanted.
45
59
  if (process.env.SHERWOOD_SKIP_XMTP_BINDING_PIN === "1") {
@@ -51,8 +65,12 @@ if (process.env.SHERWOOD_SKIP_XMTP_BINDING_PIN === "1") {
51
65
 
52
66
  // Skip when running from the monorepo (cli/ is itself the root during dev;
53
67
  // overrides work and this would create a redundant nested copy).
68
+ const cliRoot = path.resolve(__dirname, "..");
54
69
  const parentDir = path.resolve(__dirname, "..", "..");
55
- if (existsSync(path.join(parentDir, "contracts")) && existsSync(path.join(parentDir, "cli"))) {
70
+ if (
71
+ fs.existsSync(path.join(parentDir, "contracts")) &&
72
+ fs.existsSync(path.join(parentDir, "cli"))
73
+ ) {
56
74
  process.stderr.write(
57
75
  "[sherwood-cli] postinstall: monorepo dev install detected — skipping binding pin\n",
58
76
  );
@@ -65,18 +83,55 @@ try {
65
83
  );
66
84
  execSync(`npm install --no-save --force ${PINNED}`, {
67
85
  stdio: ["ignore", "pipe", "pipe"],
68
- cwd: path.resolve(__dirname, ".."),
86
+ cwd: cliRoot,
69
87
  });
70
- // Collapse any nested copies that @xmtp/node-sdk installed separately
71
- // (its own deps range `^1.10.0` rejects our pre-release by strict semver).
72
- try {
73
- execSync("npm dedupe @xmtp/node-bindings", {
74
- stdio: ["ignore", "pipe", "pipe"],
75
- cwd: path.resolve(__dirname, ".."),
76
- });
77
- } catch {
78
- // dedupe is best-effort; failure doesn't mean the primary install failed.
88
+
89
+ const rootNodeModules = path.join(cliRoot, "node_modules");
90
+ const hoistedBinding = path.join(rootNodeModules, "@xmtp", "node-bindings");
91
+
92
+ const allBindings = findBindingDirs(rootNodeModules);
93
+ const nested = allBindings.filter(
94
+ (p) => path.resolve(p) !== path.resolve(hoistedBinding),
95
+ );
96
+ for (const p of nested) {
97
+ try {
98
+ fs.rmSync(p, { recursive: true, force: true });
99
+ process.stderr.write(
100
+ `[sherwood-cli] postinstall: removed nested binding ${p}\n`,
101
+ );
102
+ } catch (rmErr) {
103
+ process.stderr.write(
104
+ `[sherwood-cli] postinstall: WARN failed to remove nested binding ${p} ` +
105
+ `(${rmErr && rmErr.message ? rmErr.message : rmErr}). ` +
106
+ "XMTP features may load the nested glibc-2.38 binding instead. To retry manually:\n" +
107
+ ` ${MANUAL_RECOVERY}\n`,
108
+ );
109
+ }
110
+ }
111
+
112
+ const hoistedPkgJson = path.join(hoistedBinding, "package.json");
113
+ if (fs.existsSync(hoistedPkgJson)) {
114
+ let installed;
115
+ try {
116
+ installed = JSON.parse(fs.readFileSync(hoistedPkgJson, "utf8")).version;
117
+ } catch {
118
+ installed = "<unparseable>";
119
+ }
120
+ if (installed !== PINNED_VERSION) {
121
+ process.stderr.write(
122
+ `[sherwood-cli] postinstall: WARN @xmtp/node-bindings is ${installed}, expected ${PINNED_VERSION}. ` +
123
+ "XMTP features may fail with GLIBC_2.38 errors. To retry manually:\n" +
124
+ ` ${MANUAL_RECOVERY}\n`,
125
+ );
126
+ }
127
+ } else {
128
+ process.stderr.write(
129
+ `[sherwood-cli] postinstall: WARN hoisted @xmtp/node-bindings missing at ${hoistedBinding}. ` +
130
+ "XMTP features may fail. To retry manually:\n" +
131
+ ` ${MANUAL_RECOVERY}\n`,
132
+ );
79
133
  }
134
+
80
135
  process.stderr.write("[sherwood-cli] postinstall: binding pin applied\n");
81
136
  } catch (err) {
82
137
  // Don't fail the install — non-XMTP commands still work. The error
@@ -85,7 +140,54 @@ try {
85
140
  process.stderr.write(
86
141
  `[sherwood-cli] postinstall: binding pin failed (${err && err.message ? err.message : err}). ` +
87
142
  "XMTP features may fail at runtime. To retry manually:\n" +
88
- ` cd $(dirname $(readlink -f $(which sherwood)))/../lib/node_modules/@sherwoodagent/cli && npm install --no-save --force ${PINNED}\n`,
143
+ ` ${MANUAL_RECOVERY}\n`,
89
144
  );
90
145
  process.exit(0);
91
146
  }
147
+
148
+ /**
149
+ * Walk a node_modules tree and return absolute paths of every directory
150
+ * that is an installed @xmtp/node-bindings package. Includes the hoisted
151
+ * copy at the root — caller filters that one out.
152
+ */
153
+ function findBindingDirs(rootNodeModules) {
154
+ const found = [];
155
+ walkNodeModules(rootNodeModules);
156
+ return found;
157
+
158
+ function walkNodeModules(nm) {
159
+ let entries;
160
+ try {
161
+ entries = fs.readdirSync(nm, { withFileTypes: true });
162
+ } catch {
163
+ return;
164
+ }
165
+ for (const entry of entries) {
166
+ if (!entry.isDirectory()) continue;
167
+ const entryPath = path.join(nm, entry.name);
168
+ if (entry.name.startsWith("@")) {
169
+ let scoped;
170
+ try {
171
+ scoped = fs.readdirSync(entryPath, { withFileTypes: true });
172
+ } catch {
173
+ continue;
174
+ }
175
+ for (const pkg of scoped) {
176
+ if (!pkg.isDirectory()) continue;
177
+ const pkgPath = path.join(entryPath, pkg.name);
178
+ if (entry.name === "@xmtp" && pkg.name === "node-bindings") {
179
+ found.push(pkgPath);
180
+ }
181
+ recurseInto(pkgPath);
182
+ }
183
+ } else {
184
+ recurseInto(entryPath);
185
+ }
186
+ }
187
+ }
188
+
189
+ function recurseInto(pkgPath) {
190
+ const nested = path.join(pkgPath, "node_modules");
191
+ if (fs.existsSync(nested)) walkNodeModules(nested);
192
+ }
193
+ }