@sherwoodagent/cli 0.18.0 → 0.18.1
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/{chat-MQPTP4QO.js → chat-7CB4YGGP.js} +4 -4
- package/dist/{chunk-EMDEQLUU.js → chunk-5ZC2A7UP.js} +2 -2
- package/dist/{chunk-PRX5GLSN.js → chunk-ARD44YTT.js} +2 -2
- package/dist/{chunk-KYABEFLH.js → chunk-FR4LYDPJ.js} +2 -2
- package/dist/chunk-L24NGLKY.js +124 -0
- package/dist/chunk-L24NGLKY.js.map +1 -0
- package/dist/{chunk-EDH6ICCT.js → chunk-Z2PNK3CC.js} +2 -2
- package/dist/{eas-Y7HS7FXK.js → eas-DOC4QKDF.js} +3 -3
- package/dist/{governor-UGIUQYPB.js → governor-E6AU3UWV.js} +3 -3
- package/dist/index.js +17 -18
- package/dist/index.js.map +1 -1
- package/dist/{research-NCY3MCN4.js → research-MHN7UGIU.js} +5 -5
- package/dist/{research-IUHVRHR3.js → research-V63URK4C.js} +3 -3
- package/dist/{session-CQZ743DX.js → session-OJX2MILJ.js} +4 -4
- package/dist/{xmtp-MJ53JW2W.js → xmtp-ATRMY76G.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-N65F7HRF.js +0 -74
- package/dist/chunk-N65F7HRF.js.map +0 -1
- /package/dist/{chat-MQPTP4QO.js.map → chat-7CB4YGGP.js.map} +0 -0
- /package/dist/{chunk-EMDEQLUU.js.map → chunk-5ZC2A7UP.js.map} +0 -0
- /package/dist/{chunk-PRX5GLSN.js.map → chunk-ARD44YTT.js.map} +0 -0
- /package/dist/{chunk-KYABEFLH.js.map → chunk-FR4LYDPJ.js.map} +0 -0
- /package/dist/{chunk-EDH6ICCT.js.map → chunk-Z2PNK3CC.js.map} +0 -0
- /package/dist/{eas-Y7HS7FXK.js.map → eas-DOC4QKDF.js.map} +0 -0
- /package/dist/{governor-UGIUQYPB.js.map → governor-E6AU3UWV.js.map} +0 -0
- /package/dist/{research-NCY3MCN4.js.map → research-MHN7UGIU.js.map} +0 -0
- /package/dist/{research-IUHVRHR3.js.map → research-V63URK4C.js.map} +0 -0
- /package/dist/{session-CQZ743DX.js.map → session-OJX2MILJ.js.map} +0 -0
- /package/dist/{xmtp-MJ53JW2W.js.map → xmtp-ATRMY76G.js.map} +0 -0
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
MESSARI_COST_ESTIMATE,
|
|
3
3
|
NANSEN_COST_ESTIMATE,
|
|
4
4
|
getResearchProvider
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Z2PNK3CC.js";
|
|
6
6
|
import {
|
|
7
7
|
getAccount
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-L24NGLKY.js";
|
|
9
9
|
import "./chunk-MJMWA4LY.js";
|
|
10
10
|
import "./chunk-TWX6FSCM.js";
|
|
11
11
|
|
|
@@ -15,7 +15,7 @@ import ora from "ora";
|
|
|
15
15
|
import { confirm } from "@inquirer/prompts";
|
|
16
16
|
import { isAddress } from "viem";
|
|
17
17
|
async function loadXmtp() {
|
|
18
|
-
return import("./xmtp-
|
|
18
|
+
return import("./xmtp-ATRMY76G.js");
|
|
19
19
|
}
|
|
20
20
|
var COST_ESTIMATES = {
|
|
21
21
|
messari: MESSARI_COST_ESTIMATE,
|
|
@@ -82,7 +82,7 @@ function formatValue(value) {
|
|
|
82
82
|
}
|
|
83
83
|
async function postResearch(syndicateName, result, prompt) {
|
|
84
84
|
const { pinJSON } = await import("./ipfs-6XVOOHSR.js");
|
|
85
|
-
const { createResearchAttestation, getEasScanUrl } = await import("./eas-
|
|
85
|
+
const { createResearchAttestation, getEasScanUrl } = await import("./eas-DOC4QKDF.js");
|
|
86
86
|
const xmtp = await loadXmtp();
|
|
87
87
|
const pinSpinner = ora("Pinning research result to IPFS...").start();
|
|
88
88
|
let resultUri;
|
|
@@ -307,4 +307,4 @@ function registerResearchCommands(program) {
|
|
|
307
307
|
export {
|
|
308
308
|
registerResearchCommands
|
|
309
309
|
};
|
|
310
|
-
//# sourceMappingURL=research-
|
|
310
|
+
//# sourceMappingURL=research-MHN7UGIU.js.map
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
MessariProvider,
|
|
3
3
|
NansenProvider,
|
|
4
4
|
getResearchProvider
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-Z2PNK3CC.js";
|
|
6
|
+
import "./chunk-L24NGLKY.js";
|
|
7
7
|
import "./chunk-MJMWA4LY.js";
|
|
8
8
|
import "./chunk-TWX6FSCM.js";
|
|
9
9
|
export {
|
|
@@ -11,4 +11,4 @@ export {
|
|
|
11
11
|
NansenProvider,
|
|
12
12
|
getResearchProvider
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=research-
|
|
14
|
+
//# sourceMappingURL=research-V63URK4C.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSyndicate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ARD44YTT.js";
|
|
4
4
|
import {
|
|
5
5
|
SHERWOOD,
|
|
6
6
|
SYNDICATE_VAULT_ABI
|
|
7
7
|
} from "./chunk-TPE6ZTUI.js";
|
|
8
8
|
import {
|
|
9
9
|
getPublicClient
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-L24NGLKY.js";
|
|
11
11
|
import "./chunk-MJMWA4LY.js";
|
|
12
12
|
import {
|
|
13
13
|
loadConfig
|
|
@@ -164,7 +164,7 @@ async function getCurrentBlock() {
|
|
|
164
164
|
|
|
165
165
|
// src/commands/session.ts
|
|
166
166
|
async function loadXmtp() {
|
|
167
|
-
return import("./xmtp-
|
|
167
|
+
return import("./xmtp-ATRMY76G.js");
|
|
168
168
|
}
|
|
169
169
|
async function resolveGovernor(vaultAddress) {
|
|
170
170
|
const client = getPublicClient();
|
|
@@ -434,4 +434,4 @@ function registerSessionCommands(program) {
|
|
|
434
434
|
export {
|
|
435
435
|
registerSessionCommands
|
|
436
436
|
};
|
|
437
|
-
//# sourceMappingURL=session-
|
|
437
|
+
//# sourceMappingURL=session-OJX2MILJ.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTextRecord
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ARD44YTT.js";
|
|
4
4
|
import "./chunk-TPE6ZTUI.js";
|
|
5
5
|
import {
|
|
6
6
|
getAccount
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-L24NGLKY.js";
|
|
8
8
|
import {
|
|
9
9
|
getChainConfig
|
|
10
10
|
} from "./chunk-MJMWA4LY.js";
|
|
@@ -364,4 +364,4 @@ export {
|
|
|
364
364
|
sendReaction,
|
|
365
365
|
streamMessages
|
|
366
366
|
};
|
|
367
|
-
//# sourceMappingURL=xmtp-
|
|
367
|
+
//# sourceMappingURL=xmtp-ATRMY76G.js.map
|
package/package.json
CHANGED
package/dist/chunk-N65F7HRF.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getChain,
|
|
3
|
-
getRpcUrl
|
|
4
|
-
} from "./chunk-MJMWA4LY.js";
|
|
5
|
-
import {
|
|
6
|
-
loadConfig
|
|
7
|
-
} from "./chunk-TWX6FSCM.js";
|
|
8
|
-
|
|
9
|
-
// src/lib/client.ts
|
|
10
|
-
import { createPublicClient, createWalletClient, http } from "viem";
|
|
11
|
-
import { privateKeyToAccount } from "viem/accounts";
|
|
12
|
-
var _publicClient = null;
|
|
13
|
-
var _walletClient = null;
|
|
14
|
-
function getPrivateKey() {
|
|
15
|
-
const config = loadConfig();
|
|
16
|
-
if (config.privateKey) {
|
|
17
|
-
const k = config.privateKey;
|
|
18
|
-
return k.startsWith("0x") ? k : `0x${k}`;
|
|
19
|
-
}
|
|
20
|
-
const env = process.env.PRIVATE_KEY;
|
|
21
|
-
if (env) {
|
|
22
|
-
return env.startsWith("0x") ? env : `0x${env}`;
|
|
23
|
-
}
|
|
24
|
-
throw new Error(
|
|
25
|
-
"Private key not found. Run 'sherwood config set --private-key <key>' or set PRIVATE_KEY env var."
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
function getPublicClient() {
|
|
29
|
-
const chain = getChain();
|
|
30
|
-
if (_publicClient && _publicClient.chain?.id !== chain.id) {
|
|
31
|
-
_publicClient = null;
|
|
32
|
-
}
|
|
33
|
-
if (!_publicClient) {
|
|
34
|
-
_publicClient = createPublicClient({
|
|
35
|
-
chain,
|
|
36
|
-
transport: http(getRpcUrl())
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
return _publicClient;
|
|
40
|
-
}
|
|
41
|
-
function getWalletClient() {
|
|
42
|
-
const chain = getChain();
|
|
43
|
-
if (_walletClient && _walletClient.chain?.id !== chain.id) {
|
|
44
|
-
_walletClient = null;
|
|
45
|
-
}
|
|
46
|
-
if (!_walletClient) {
|
|
47
|
-
const account = privateKeyToAccount(getPrivateKey());
|
|
48
|
-
_walletClient = createWalletClient({
|
|
49
|
-
account,
|
|
50
|
-
chain,
|
|
51
|
-
transport: http(getRpcUrl())
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return _walletClient;
|
|
55
|
-
}
|
|
56
|
-
function getAccount() {
|
|
57
|
-
return privateKeyToAccount(getPrivateKey());
|
|
58
|
-
}
|
|
59
|
-
async function estimateFeesWithBuffer() {
|
|
60
|
-
const client = getPublicClient();
|
|
61
|
-
const { maxFeePerGas, maxPriorityFeePerGas } = await client.estimateFeesPerGas();
|
|
62
|
-
return {
|
|
63
|
-
maxFeePerGas: maxFeePerGas * 120n / 100n,
|
|
64
|
-
maxPriorityFeePerGas: maxPriorityFeePerGas * 120n / 100n
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export {
|
|
69
|
-
getPublicClient,
|
|
70
|
-
getWalletClient,
|
|
71
|
-
getAccount,
|
|
72
|
-
estimateFeesWithBuffer
|
|
73
|
-
};
|
|
74
|
-
//# sourceMappingURL=chunk-N65F7HRF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/client.ts"],"sourcesContent":["/**\n * viem client factory — resolves chain and RPC from the network module.\n * Private key is read from ~/.sherwood/config.json (set via `sherwood config set --private-key`),\n * with PRIVATE_KEY env var as fallback.\n */\n\n// dotenv loaded at entrypoint\nimport { createPublicClient, createWalletClient, http } from \"viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\nimport { getChain, getRpcUrl } from \"./network.js\";\nimport { loadConfig } from \"./config.js\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet _publicClient: any = null;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet _walletClient: any = null;\n\n/**\n * Resolve the private key: config → env → error.\n */\nfunction getPrivateKey(): `0x${string}` {\n // 1. Config (~/.sherwood/config.json)\n const config = loadConfig();\n if (config.privateKey) {\n const k = config.privateKey;\n return (k.startsWith(\"0x\") ? k : `0x${k}`) as `0x${string}`;\n }\n\n // 2. Env var fallback\n const env = process.env.PRIVATE_KEY;\n if (env) {\n return (env.startsWith(\"0x\") ? env : `0x${env}`) as `0x${string}`;\n }\n\n throw new Error(\n \"Private key not found. Run 'sherwood config set --private-key <key>' or set PRIVATE_KEY env var.\",\n );\n}\n\nexport function getPublicClient() {\n const chain = getChain();\n // Auto-invalidate if network changed since last creation\n if (_publicClient && _publicClient.chain?.id !== chain.id) {\n _publicClient = null;\n }\n if (!_publicClient) {\n _publicClient = createPublicClient({\n chain,\n transport: http(getRpcUrl()),\n });\n }\n return _publicClient as ReturnType<typeof createPublicClient>;\n}\n\nexport function getWalletClient() {\n const chain = getChain();\n // Auto-invalidate if network changed since last creation\n if (_walletClient && _walletClient.chain?.id !== chain.id) {\n _walletClient = null;\n }\n if (!_walletClient) {\n const account = privateKeyToAccount(getPrivateKey());\n _walletClient = createWalletClient({\n account,\n chain,\n transport: http(getRpcUrl()),\n });\n }\n return _walletClient as ReturnType<typeof createWalletClient>;\n}\n\n/**\n * Reset cached clients. Required for tests that call setNetwork()\n * after a client was already created.\n */\nexport function resetClients() {\n _publicClient = null;\n _walletClient = null;\n}\n\nexport function getAccount() {\n return privateKeyToAccount(getPrivateKey());\n}\n\n/**\n * Estimate EIP-1559 fees with a 20% buffer to avoid stuck txs on Base gas spikes.\n */\nexport async function estimateFeesWithBuffer() {\n const client = getPublicClient();\n const { maxFeePerGas, maxPriorityFeePerGas } =\n await client.estimateFeesPerGas();\n return {\n maxFeePerGas: (maxFeePerGas * 120n) / 100n,\n maxPriorityFeePerGas: (maxPriorityFeePerGas * 120n) / 100n,\n };\n}\n"],"mappings":";;;;;;;;;AAOA,SAAS,oBAAoB,oBAAoB,YAAY;AAC7D,SAAS,2BAA2B;AAKpC,IAAI,gBAAqB;AAEzB,IAAI,gBAAqB;AAKzB,SAAS,gBAA+B;AAEtC,QAAM,SAAS,WAAW;AAC1B,MAAI,OAAO,YAAY;AACrB,UAAM,IAAI,OAAO;AACjB,WAAQ,EAAE,WAAW,IAAI,IAAI,IAAI,KAAK,CAAC;AAAA,EACzC;AAGA,QAAM,MAAM,QAAQ,IAAI;AACxB,MAAI,KAAK;AACP,WAAQ,IAAI,WAAW,IAAI,IAAI,MAAM,KAAK,GAAG;AAAA,EAC/C;AAEA,QAAM,IAAI;AAAA,IACR;AAAA,EACF;AACF;AAEO,SAAS,kBAAkB;AAChC,QAAM,QAAQ,SAAS;AAEvB,MAAI,iBAAiB,cAAc,OAAO,OAAO,MAAM,IAAI;AACzD,oBAAgB;AAAA,EAClB;AACA,MAAI,CAAC,eAAe;AAClB,oBAAgB,mBAAmB;AAAA,MACjC;AAAA,MACA,WAAW,KAAK,UAAU,CAAC;AAAA,IAC7B,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAEO,SAAS,kBAAkB;AAChC,QAAM,QAAQ,SAAS;AAEvB,MAAI,iBAAiB,cAAc,OAAO,OAAO,MAAM,IAAI;AACzD,oBAAgB;AAAA,EAClB;AACA,MAAI,CAAC,eAAe;AAClB,UAAM,UAAU,oBAAoB,cAAc,CAAC;AACnD,oBAAgB,mBAAmB;AAAA,MACjC;AAAA,MACA;AAAA,MACA,WAAW,KAAK,UAAU,CAAC;AAAA,IAC7B,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAWO,SAAS,aAAa;AAC3B,SAAO,oBAAoB,cAAc,CAAC;AAC5C;AAKA,eAAsB,yBAAyB;AAC7C,QAAM,SAAS,gBAAgB;AAC/B,QAAM,EAAE,cAAc,qBAAqB,IACzC,MAAM,OAAO,mBAAmB;AAClC,SAAO;AAAA,IACL,cAAe,eAAe,OAAQ;AAAA,IACtC,sBAAuB,uBAAuB,OAAQ;AAAA,EACxD;AACF;","names":[]}
|
|
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
|