@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.
- package/dist/{addresses-NX3SHRBT.js → addresses-4UI26LWU.js} +2 -2
- package/dist/{chat-UNDF6HZA.js → chat-SQCWYIKG.js} +5 -5
- package/dist/{chunk-HKOPANVM.js → chunk-3OAGUA2S.js} +2 -2
- package/dist/{chunk-3M6K2MNV.js → chunk-3UETTXXU.js} +3 -3
- package/dist/{chunk-3M6K2MNV.js.map → chunk-3UETTXXU.js.map} +1 -1
- package/dist/{chunk-TMPH4P63.js → chunk-TPDRDOCF.js} +2 -2
- package/dist/{chunk-EWKFWF3G.js → chunk-V5DYFQCQ.js} +2 -2
- package/dist/{chunk-XHNSF4NV.js → chunk-XFVLEE5S.js} +2 -2
- package/dist/{chunk-KG7BGVBR.js → chunk-ZORVNIGX.js} +2 -2
- package/dist/{eas-6HFFZZ52.js → eas-OEBIB5RW.js} +3 -3
- package/dist/{governor-GVDZOYJQ.js → governor-UWI3QYHV.js} +3 -3
- package/dist/index.js +102 -37
- package/dist/index.js.map +1 -1
- package/dist/{price-H4X2AAAQ.js → price-MUILXUC4.js} +2 -2
- package/dist/{research-PYUIY4VC.js → research-AR4TABCF.js} +3 -3
- package/dist/{session-AZKLV2T7.js → session-ISY5VAUS.js} +5 -5
- package/dist/{trade-P2LBGWVY.js → trade-VTRYXGP4.js} +6 -6
- package/dist/{xmtp-SQIOIRCX.js → xmtp-IVDHDORA.js} +3 -3
- package/package.json +1 -1
- package/scripts/pin-xmtp-bindings.cjs +120 -18
- /package/dist/{addresses-NX3SHRBT.js.map → addresses-4UI26LWU.js.map} +0 -0
- /package/dist/{chat-UNDF6HZA.js.map → chat-SQCWYIKG.js.map} +0 -0
- /package/dist/{chunk-HKOPANVM.js.map → chunk-3OAGUA2S.js.map} +0 -0
- /package/dist/{chunk-TMPH4P63.js.map → chunk-TPDRDOCF.js.map} +0 -0
- /package/dist/{chunk-EWKFWF3G.js.map → chunk-V5DYFQCQ.js.map} +0 -0
- /package/dist/{chunk-XHNSF4NV.js.map → chunk-XFVLEE5S.js.map} +0 -0
- /package/dist/{chunk-KG7BGVBR.js.map → chunk-ZORVNIGX.js.map} +0 -0
- /package/dist/{eas-6HFFZZ52.js.map → eas-OEBIB5RW.js.map} +0 -0
- /package/dist/{governor-GVDZOYJQ.js.map → governor-UWI3QYHV.js.map} +0 -0
- /package/dist/{price-H4X2AAAQ.js.map → price-MUILXUC4.js.map} +0 -0
- /package/dist/{research-PYUIY4VC.js.map → research-AR4TABCF.js.map} +0 -0
- /package/dist/{session-AZKLV2T7.js.map → session-ISY5VAUS.js.map} +0 -0
- /package/dist/{trade-P2LBGWVY.js.map → trade-VTRYXGP4.js.map} +0 -0
- /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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
9
|
+
} from "./chunk-V5DYFQCQ.js";
|
|
10
10
|
import {
|
|
11
11
|
PROPOSAL_STATES,
|
|
12
12
|
getProposal
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZORVNIGX.js";
|
|
14
14
|
import {
|
|
15
15
|
SHERWOOD
|
|
16
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
480
|
+
//# sourceMappingURL=session-ISY5VAUS.js.map
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
UniswapProvider,
|
|
6
6
|
getQuote
|
|
7
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
949
|
+
//# sourceMappingURL=trade-VTRYXGP4.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTextRecord
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
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-
|
|
284
|
+
//# sourceMappingURL=xmtp-IVDHDORA.js.map
|
package/package.json
CHANGED
|
@@ -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
|
|
21
|
-
* dev pre-release doesn't satisfy
|
|
22
|
-
*
|
|
23
|
-
*
|
|
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
|
|
49
|
+
const fs = require("node:fs");
|
|
40
50
|
const path = require("node:path");
|
|
41
51
|
|
|
42
|
-
const
|
|
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 (
|
|
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:
|
|
86
|
+
cwd: cliRoot,
|
|
69
87
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
`
|
|
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
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|