tenjin-cli 0.1.0-alpha.21 → 0.1.0-alpha.22
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/README.md +1 -1
- package/dist/{chunk-PJEG2JIJ.js → chunk-2RMXTNLT.js} +4 -4
- package/dist/{chunk-IOIHYOU4.js → chunk-3Q3UBMVB.js} +2 -2
- package/dist/{chunk-2AQO4YDI.js → chunk-AG4DWNHO.js} +3 -3
- package/dist/{chunk-RCJQARZF.js → chunk-B4GA3HAK.js} +2 -2
- package/dist/{chunk-RCJQARZF.js.map → chunk-B4GA3HAK.js.map} +1 -1
- package/dist/{chunk-OSUD6YZZ.js → chunk-CYEUVU3F.js} +8 -8
- package/dist/{chunk-GHTPYKDT.js → chunk-DA53QKTD.js} +4 -4
- package/dist/{chunk-YVODPFTL.js → chunk-DHCOGDJB.js} +4 -4
- package/dist/{chunk-AQRUD5GQ.js → chunk-F4IJQBGP.js} +4 -4
- package/dist/{chunk-SRVDXR6B.js → chunk-GONDQ27X.js} +5 -5
- package/dist/{chunk-N4DJEQAF.js → chunk-NYJCBQL5.js} +2 -2
- package/dist/{chunk-3EUTWC2B.js → chunk-NZYVSZNF.js} +4 -4
- package/dist/{chunk-W3LVZ2EN.js → chunk-SAN5PFTL.js} +102 -5
- package/dist/chunk-SAN5PFTL.js.map +1 -0
- package/dist/{chunk-JN7TMXVF.js → chunk-TU3IK7KK.js} +2 -2
- package/dist/{chunk-UY2TOI3B.js → chunk-U5FFVIIF.js} +74 -7
- package/dist/chunk-U5FFVIIF.js.map +1 -0
- package/dist/{chunk-ETW2ASBP.js → chunk-UAT3Q7VF.js} +68 -16
- package/dist/chunk-UAT3Q7VF.js.map +1 -0
- package/dist/chunk-UFCN7NCE.js +130 -0
- package/dist/chunk-UFCN7NCE.js.map +1 -0
- package/dist/{chunk-QRFONFRW.js → chunk-UGLTSPXQ.js} +2 -2
- package/dist/{chunk-IOB7URFH.js → chunk-UHEMZEGW.js} +2 -2
- package/dist/{chunk-OTPEH3AH.js → chunk-UIOZRILX.js} +5 -5
- package/dist/{chunk-U2ATFMKZ.js → chunk-WXFVJPZD.js} +2 -2
- package/dist/{chunk-C363JZN2.js → chunk-XBYTP4SP.js} +3 -3
- package/dist/{cli-7KJ4QLUU.js → cli-5WM56Y7K.js} +28 -28
- package/dist/{cli-7KJ4QLUU.js.map → cli-5WM56Y7K.js.map} +1 -1
- package/dist/{config-MSN6H4MD.js → config-JBF5BZNO.js} +7 -7
- package/dist/{doctor-ITUCKN6C.js → doctor-6KHBE77P.js} +15 -15
- package/dist/{fund-XPB4IIG5.js → fund-GSFCXEF7.js} +9 -10
- package/dist/{fund-XPB4IIG5.js.map → fund-GSFCXEF7.js.map} +1 -1
- package/dist/{hook-command-VVV2Q23L.js → hook-command-UQZ4DVDL.js} +90 -12
- package/dist/hook-command-UQZ4DVDL.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/{install-OSJRM2ME.js → install-TDYC22KI.js} +10 -10
- package/dist/{install-identity-YIWKQOUD.js → install-identity-QS4UFF27.js} +6 -6
- package/dist/{install-wallet-BWJO2SUC.js → install-wallet-T737X74E.js} +8 -9
- package/dist/{install-wallet-BWJO2SUC.js.map → install-wallet-T737X74E.js.map} +1 -1
- package/dist/{mcp-KE5YKPS2.js → mcp-JWOOSKLX.js} +449 -68
- package/dist/mcp-JWOOSKLX.js.map +1 -0
- package/dist/{pay-MUV2U232.js → pay-TDYQFSKY.js} +11 -12
- package/dist/{payments-4D27K4L2.js → payments-26NVMFR2.js} +6 -7
- package/dist/{payments-4D27K4L2.js.map → payments-26NVMFR2.js.map} +1 -1
- package/dist/{send-BXHFKDBF.js → send-4RUBQQKP.js} +8 -9
- package/dist/{send-BXHFKDBF.js.map → send-4RUBQQKP.js.map} +1 -1
- package/dist/{status-3Z3YPRSE.js → status-CEHZKHBU.js} +5 -5
- package/dist/{status-line-CKRMGZ3Q.js → status-line-QRAO3Y2E.js} +4 -4
- package/dist/{status-line-wiring-GECLIIBT.js → status-line-wiring-XKUVI5UW.js} +4 -4
- package/dist/tenjin-daemon.mjs +5 -2
- package/dist/{uninstall-BZTVWJ7W.js → uninstall-SJ6R2W2M.js} +10 -10
- package/dist/{update-IQQTEOI5.js → update-N2NZS3AA.js} +5 -5
- package/dist/{wallet-UFXQ57TZ.js → wallet-IB2EFAUP.js} +8 -9
- package/docs/agent-permissions.md +8 -8
- package/docs/safety-model.md +2 -2
- package/package.json +1 -1
- package/dist/chunk-ETW2ASBP.js.map +0 -1
- package/dist/chunk-QHILSA6G.js +0 -82
- package/dist/chunk-QHILSA6G.js.map +0 -1
- package/dist/chunk-UY2TOI3B.js.map +0 -1
- package/dist/chunk-W3LVZ2EN.js.map +0 -1
- package/dist/hook-command-VVV2Q23L.js.map +0 -1
- package/dist/mcp-KE5YKPS2.js.map +0 -1
- /package/dist/{chunk-PJEG2JIJ.js.map → chunk-2RMXTNLT.js.map} +0 -0
- /package/dist/{chunk-IOIHYOU4.js.map → chunk-3Q3UBMVB.js.map} +0 -0
- /package/dist/{chunk-2AQO4YDI.js.map → chunk-AG4DWNHO.js.map} +0 -0
- /package/dist/{chunk-OSUD6YZZ.js.map → chunk-CYEUVU3F.js.map} +0 -0
- /package/dist/{chunk-GHTPYKDT.js.map → chunk-DA53QKTD.js.map} +0 -0
- /package/dist/{chunk-YVODPFTL.js.map → chunk-DHCOGDJB.js.map} +0 -0
- /package/dist/{chunk-AQRUD5GQ.js.map → chunk-F4IJQBGP.js.map} +0 -0
- /package/dist/{chunk-SRVDXR6B.js.map → chunk-GONDQ27X.js.map} +0 -0
- /package/dist/{chunk-N4DJEQAF.js.map → chunk-NYJCBQL5.js.map} +0 -0
- /package/dist/{chunk-3EUTWC2B.js.map → chunk-NZYVSZNF.js.map} +0 -0
- /package/dist/{chunk-JN7TMXVF.js.map → chunk-TU3IK7KK.js.map} +0 -0
- /package/dist/{chunk-QRFONFRW.js.map → chunk-UGLTSPXQ.js.map} +0 -0
- /package/dist/{chunk-IOB7URFH.js.map → chunk-UHEMZEGW.js.map} +0 -0
- /package/dist/{chunk-OTPEH3AH.js.map → chunk-UIOZRILX.js.map} +0 -0
- /package/dist/{chunk-U2ATFMKZ.js.map → chunk-WXFVJPZD.js.map} +0 -0
- /package/dist/{chunk-C363JZN2.js.map → chunk-XBYTP4SP.js.map} +0 -0
- /package/dist/{config-MSN6H4MD.js.map → config-JBF5BZNO.js.map} +0 -0
- /package/dist/{doctor-ITUCKN6C.js.map → doctor-6KHBE77P.js.map} +0 -0
- /package/dist/{install-OSJRM2ME.js.map → install-TDYC22KI.js.map} +0 -0
- /package/dist/{install-identity-YIWKQOUD.js.map → install-identity-QS4UFF27.js.map} +0 -0
- /package/dist/{pay-MUV2U232.js.map → pay-TDYQFSKY.js.map} +0 -0
- /package/dist/{status-3Z3YPRSE.js.map → status-CEHZKHBU.js.map} +0 -0
- /package/dist/{status-line-CKRMGZ3Q.js.map → status-line-QRAO3Y2E.js.map} +0 -0
- /package/dist/{status-line-wiring-GECLIIBT.js.map → status-line-wiring-XKUVI5UW.js.map} +0 -0
- /package/dist/{uninstall-BZTVWJ7W.js.map → uninstall-SJ6R2W2M.js.map} +0 -0
- /package/dist/{update-IQQTEOI5.js.map → update-N2NZS3AA.js.map} +0 -0
- /package/dist/{wallet-UFXQ57TZ.js.map → wallet-IB2EFAUP.js.map} +0 -0
package/README.md
CHANGED
|
@@ -114,7 +114,7 @@ flowchart LR
|
|
|
114
114
|
|
|
115
115
|
The Tenjin router hooks into Claude Code at your prompt, before each web search or page fetch, when your agent hands work to a subagent, and around a question your agent asks you. At each point it asks Jev, a decision model from [TypeSafe](https://typesafe.ai), whether a tool in the catalog fits. When none does, Jev may pick one third-party service from a short list matching the step (the Tenjin list, plus the open Bazaar if you turned it on), or none. Either way Jev only chooses from a list, so it never writes a call or an instruction for your agent; a third-party listing's description is the seller's own, and your agent judges it.
|
|
116
116
|
|
|
117
|
-
When one fits, your agent sees a one-line suggestion with the tool and its price, and calls it through Tenjin's `x402` MCP server. Tenjin pays the provider from your wallet, within your limits, and hands back the result. Your status line shows the call as it happens:
|
|
117
|
+
When one fits, your agent sees a one-line suggestion with the tool and its price, and calls it through Tenjin's `x402` MCP server: the offer's id alone shows the tool's inputs, an example and what it returns, and the id with the agent's input runs it. Tenjin builds the call, pays the provider from your wallet, within your limits, and hands back the result. Your status line shows the call as it happens:
|
|
118
118
|
|
|
119
119
|
```text
|
|
120
120
|
x402 · request: calling pro-api.coinmarketcap.com/x402/v3/cryptocurrency/quotes/latest · {"query":{"symbol":"BTC,ETH"}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
getUsdcBalance
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-F4IJQBGP.js";
|
|
5
5
|
import {
|
|
6
6
|
commitLocalWallet,
|
|
7
7
|
createLocalWallet,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
verifyAndPreserveOutgoingWallet,
|
|
15
15
|
walletExistsError,
|
|
16
16
|
walletFileExists
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DHCOGDJB.js";
|
|
18
18
|
import {
|
|
19
19
|
LockTimeoutError,
|
|
20
20
|
withFileLock
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
import {
|
|
26
26
|
loadRawConfig,
|
|
27
27
|
resolveSettings
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-SAN5PFTL.js";
|
|
29
29
|
import {
|
|
30
30
|
CliError
|
|
31
31
|
} from "./chunk-JLEF5WHM.js";
|
|
@@ -239,4 +239,4 @@ export {
|
|
|
239
239
|
runWalletShow,
|
|
240
240
|
runWalletBalance
|
|
241
241
|
};
|
|
242
|
-
//# sourceMappingURL=chunk-
|
|
242
|
+
//# sourceMappingURL=chunk-2RMXTNLT.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
package_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-B4GA3HAK.js";
|
|
5
5
|
import {
|
|
6
6
|
CliError,
|
|
7
7
|
HARNESSES,
|
|
@@ -1781,4 +1781,4 @@ export {
|
|
|
1781
1781
|
registeredHooks,
|
|
1782
1782
|
writeHooks
|
|
1783
1783
|
};
|
|
1784
|
-
//# sourceMappingURL=chunk-
|
|
1784
|
+
//# sourceMappingURL=chunk-3Q3UBMVB.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
PRODUCTION_ORIGIN
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SAN5PFTL.js";
|
|
5
5
|
import {
|
|
6
6
|
package_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-B4GA3HAK.js";
|
|
8
8
|
import {
|
|
9
9
|
CliError
|
|
10
10
|
} from "./chunk-JLEF5WHM.js";
|
|
@@ -288,4 +288,4 @@ export {
|
|
|
288
288
|
httpRequest,
|
|
289
289
|
fetchFailureToCliError
|
|
290
290
|
};
|
|
291
|
-
//# sourceMappingURL=chunk-
|
|
291
|
+
//# sourceMappingURL=chunk-AG4DWNHO.js.map
|
|
@@ -3,7 +3,7 @@ import { createRequire as __tenjinCreateRequire } from 'node:module'; const requ
|
|
|
3
3
|
// package.json
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "tenjin-cli",
|
|
6
|
-
version: "0.1.0-alpha.
|
|
6
|
+
version: "0.1.0-alpha.22",
|
|
7
7
|
mcpName: "blog.tenjin/tenjin",
|
|
8
8
|
type: "module",
|
|
9
9
|
description: "x402 router for coding agents: one paid decision per lookup, a local wallet that pays each provider per call in USDC on Base.",
|
|
@@ -80,4 +80,4 @@ var package_default = {
|
|
|
80
80
|
export {
|
|
81
81
|
package_default
|
|
82
82
|
};
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-B4GA3HAK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"tenjin-cli\",\n \"version\": \"0.1.0-alpha.
|
|
1
|
+
{"version":3,"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"tenjin-cli\",\n \"version\": \"0.1.0-alpha.22\",\n \"mcpName\": \"blog.tenjin/tenjin\",\n \"type\": \"module\",\n \"description\": \"x402 router for coding agents: one paid decision per lookup, a local wallet that pays each provider per call in USDC on Base.\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/BackTrackCo/tenjin-agent.git\"\n },\n \"homepage\": \"https://tenjin.blog/agents\",\n \"bugs\": \"https://github.com/BackTrackCo/tenjin-agent/issues\",\n \"keywords\": [\n \"x402\",\n \"usdc\",\n \"base\",\n \"ai-agents\",\n \"agent-payments\",\n \"mcp\",\n \"knowledge-marketplace\",\n \"micropayments\",\n \"claude\",\n \"codex\",\n \"cli\"\n ],\n \"bin\": {\n \"tenjin\": \"dist/index.js\"\n },\n \"engines\": {\n \"node\": \">=24\"\n },\n \"files\": [\n \"dist\",\n \"docs\",\n \"NOTICE.md\"\n ],\n \"packageManager\": \"pnpm@11.11.0\",\n \"scripts\": {\n \"build\": \"rm -rf dist && tsup\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc --noEmit\",\n \"lint\": \"eslint .\",\n \"format\": \"prettier --write .\",\n \"format:check\": \"prettier --check .\",\n \"check\": \"pnpm run build && pnpm run test\",\n \"sync:skill\": \"node scripts/sync-skill.mjs\",\n \"pack-smoke\": \"bash scripts/pack-smoke.sh\",\n \"changeset\": \"changeset\",\n \"prepublishOnly\": \"pnpm run build\",\n \"githooks\": \"git config core.hooksPath .githooks\"\n },\n \"devDependencies\": {\n \"@changesets/cli\": \"^2.31.1\",\n \"@clack/prompts\": \"^1.7.0\",\n \"@eslint/js\": \"^10\",\n \"@modelcontextprotocol/sdk\": \"1.29.0\",\n \"@types/node\": \"^25\",\n \"@x402/core\": \"2.17.0\",\n \"@x402/evm\": \"2.17.0\",\n \"@x402/extensions\": \"2.17.0\",\n \"ajv\": \"^8.20.0\",\n \"ajv-formats\": \"^3.0.1\",\n \"commander\": \"^14.0.1\",\n \"eslint\": \"^10\",\n \"eslint-config-prettier\": \"^10\",\n \"ox\": \"0.14.30\",\n \"prettier\": \"^3\",\n \"tsup\": \"^8.5.0\",\n \"typescript\": \"^6\",\n \"typescript-eslint\": \"^8\",\n \"viem\": \"^2.53.1\",\n \"vitest\": \"^4.1.9\",\n \"zod\": \"^4.4.3\"\n }\n}\n"],"mappings":";;;AAAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,SAAW;AAAA,EACX,MAAQ;AAAA,EACR,aAAe;AAAA,EACf,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,UAAY;AAAA,EACZ,MAAQ;AAAA,EACR,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,KAAO;AAAA,IACL,QAAU;AAAA,EACZ;AAAA,EACA,SAAW;AAAA,IACT,MAAQ;AAAA,EACV;AAAA,EACA,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,gBAAkB;AAAA,EAClB,SAAW;AAAA,IACT,OAAS;AAAA,IACT,MAAQ;AAAA,IACR,WAAa;AAAA,IACb,MAAQ;AAAA,IACR,QAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,OAAS;AAAA,IACT,cAAc;AAAA,IACd,cAAc;AAAA,IACd,WAAa;AAAA,IACb,gBAAkB;AAAA,IAClB,UAAY;AAAA,EACd;AAAA,EACA,iBAAmB;AAAA,IACjB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,cAAc;AAAA,IACd,6BAA6B;AAAA,IAC7B,eAAe;AAAA,IACf,cAAc;AAAA,IACd,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,KAAO;AAAA,IACP,eAAe;AAAA,IACf,WAAa;AAAA,IACb,QAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B,IAAM;AAAA,IACN,UAAY;AAAA,IACZ,MAAQ;AAAA,IACR,YAAc;AAAA,IACd,qBAAqB;AAAA,IACrB,MAAQ;AAAA,IACR,QAAU;AAAA,IACV,KAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-TGLKKLQG.js";
|
|
6
6
|
import {
|
|
7
7
|
paint
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UGLTSPXQ.js";
|
|
9
9
|
import {
|
|
10
10
|
RETIRED_SKILL_NAMES,
|
|
11
11
|
onPath,
|
|
@@ -13,22 +13,22 @@ import {
|
|
|
13
13
|
readSkillFile,
|
|
14
14
|
skillFrontmatterName,
|
|
15
15
|
skillsDirsFor
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UIOZRILX.js";
|
|
17
17
|
import {
|
|
18
18
|
hasCode
|
|
19
19
|
} from "./chunk-2I4QTOLB.js";
|
|
20
20
|
import {
|
|
21
21
|
resolveContextSettings
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-UHEMZEGW.js";
|
|
23
23
|
import {
|
|
24
24
|
toMoney
|
|
25
25
|
} from "./chunk-O2JYBOUO.js";
|
|
26
26
|
import {
|
|
27
27
|
loadRawConfig
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-SAN5PFTL.js";
|
|
29
29
|
import {
|
|
30
30
|
ensureStatusLine
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-TU3IK7KK.js";
|
|
32
32
|
import {
|
|
33
33
|
appendAllowlistRules,
|
|
34
34
|
claudeAdapter,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
inspectHooksFile,
|
|
37
37
|
ownsHookEntry,
|
|
38
38
|
writeHooks
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-3Q3UBMVB.js";
|
|
40
40
|
import {
|
|
41
41
|
CliError
|
|
42
42
|
} from "./chunk-JLEF5WHM.js";
|
|
@@ -224,7 +224,7 @@ async function runRouterInstall(args, ctx, deps = {}) {
|
|
|
224
224
|
]
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
-
const { resolveWallet } = await import("./install-wallet-
|
|
227
|
+
const { resolveWallet } = await import("./install-wallet-T737X74E.js");
|
|
228
228
|
const wallet = await resolveWallet(ctx, deps, args.noWallet === true ? "flag" : void 0, false);
|
|
229
229
|
const effective = await resolveContextSettings(ctx);
|
|
230
230
|
const data = {
|
|
@@ -448,4 +448,4 @@ export {
|
|
|
448
448
|
readMcpEntry,
|
|
449
449
|
statusLineProblems
|
|
450
450
|
};
|
|
451
|
-
//# sourceMappingURL=chunk-
|
|
451
|
+
//# sourceMappingURL=chunk-CYEUVU3F.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
setTenjinIdentity
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AG4DWNHO.js";
|
|
5
5
|
import {
|
|
6
6
|
hasCode
|
|
7
7
|
} from "./chunk-2I4QTOLB.js";
|
|
8
8
|
import {
|
|
9
9
|
isTeamModeConfig
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UHEMZEGW.js";
|
|
11
11
|
import {
|
|
12
12
|
knownDeploymentOrigins,
|
|
13
13
|
loadRawConfig,
|
|
14
14
|
resolveSettings
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SAN5PFTL.js";
|
|
16
16
|
import {
|
|
17
17
|
writeFileAtomicExclusive
|
|
18
18
|
} from "./chunk-JLEF5WHM.js";
|
|
@@ -109,4 +109,4 @@ export {
|
|
|
109
109
|
enableCliIdentity,
|
|
110
110
|
enableDaemonIdentity
|
|
111
111
|
};
|
|
112
|
-
//# sourceMappingURL=chunk-
|
|
112
|
+
//# sourceMappingURL=chunk-DA53QKTD.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
createLocalSpendAuthorizer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NYJCBQL5.js";
|
|
5
5
|
import {
|
|
6
6
|
hashAuthorization,
|
|
7
7
|
hashMessage,
|
|
@@ -45,13 +45,13 @@ import {
|
|
|
45
45
|
} from "./chunk-BPMWXTFX.js";
|
|
46
46
|
import {
|
|
47
47
|
emitNotice
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-UGLTSPXQ.js";
|
|
49
49
|
import {
|
|
50
50
|
hasCode
|
|
51
51
|
} from "./chunk-2I4QTOLB.js";
|
|
52
52
|
import {
|
|
53
53
|
external_exports
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-SAN5PFTL.js";
|
|
55
55
|
import {
|
|
56
56
|
CliError,
|
|
57
57
|
fsyncDir,
|
|
@@ -1678,4 +1678,4 @@ export {
|
|
|
1678
1678
|
@noble/ciphers/esm/utils.js:
|
|
1679
1679
|
(*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *)
|
|
1680
1680
|
*/
|
|
1681
|
-
//# sourceMappingURL=chunk-
|
|
1681
|
+
//# sourceMappingURL=chunk-DHCOGDJB.js.map
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
USDC_ADDRESS
|
|
4
|
-
} from "./chunk-QHILSA6G.js";
|
|
5
2
|
import {
|
|
6
3
|
createPublicClient,
|
|
7
4
|
defineBlock,
|
|
@@ -28,6 +25,9 @@ import {
|
|
|
28
25
|
isAddress,
|
|
29
26
|
toHex
|
|
30
27
|
} from "./chunk-EGELTSPU.js";
|
|
28
|
+
import {
|
|
29
|
+
USDC_ADDRESS
|
|
30
|
+
} from "./chunk-SAN5PFTL.js";
|
|
31
31
|
|
|
32
32
|
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/op-stack/contracts.js
|
|
33
33
|
var contracts = {
|
|
@@ -318,4 +318,4 @@ export {
|
|
|
318
318
|
prepareUsdcSend,
|
|
319
319
|
broadcastUsdcSend
|
|
320
320
|
};
|
|
321
|
-
//# sourceMappingURL=chunk-
|
|
321
|
+
//# sourceMappingURL=chunk-F4IJQBGP.js.map
|
|
@@ -2,12 +2,9 @@ import { createRequire as __tenjinCreateRequire } from 'node:module'; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
resolvePublicDestination
|
|
4
4
|
} from "./chunk-LAIZ2AQA.js";
|
|
5
|
-
import {
|
|
6
|
-
USDC_ADDRESS
|
|
7
|
-
} from "./chunk-QHILSA6G.js";
|
|
8
5
|
import {
|
|
9
6
|
releaseUnchargedExposure
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NYJCBQL5.js";
|
|
11
8
|
import {
|
|
12
9
|
mask
|
|
13
10
|
} from "./chunk-7QKHZQKW.js";
|
|
@@ -17,6 +14,9 @@ import {
|
|
|
17
14
|
import {
|
|
18
15
|
hasCode
|
|
19
16
|
} from "./chunk-2I4QTOLB.js";
|
|
17
|
+
import {
|
|
18
|
+
USDC_ADDRESS
|
|
19
|
+
} from "./chunk-SAN5PFTL.js";
|
|
20
20
|
import {
|
|
21
21
|
writeFileAtomic
|
|
22
22
|
} from "./chunk-JLEF5WHM.js";
|
|
@@ -334,4 +334,4 @@ export {
|
|
|
334
334
|
writeAll,
|
|
335
335
|
createUniqueFile
|
|
336
336
|
};
|
|
337
|
-
//# sourceMappingURL=chunk-
|
|
337
|
+
//# sourceMappingURL=chunk-GONDQ27X.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
evaluateSpendPolicy,
|
|
7
7
|
readLedger,
|
|
8
8
|
spentOf
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WXFVJPZD.js";
|
|
10
10
|
import {
|
|
11
11
|
withFileLock
|
|
12
12
|
} from "./chunk-MEFB5KHA.js";
|
|
@@ -187,4 +187,4 @@ export {
|
|
|
187
187
|
createLocalSpendAuthorizer,
|
|
188
188
|
releaseUnchargedExposure
|
|
189
189
|
};
|
|
190
|
-
//# sourceMappingURL=chunk-
|
|
190
|
+
//# sourceMappingURL=chunk-NYJCBQL5.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
emitNotice
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UGLTSPXQ.js";
|
|
5
5
|
import {
|
|
6
6
|
external_exports,
|
|
7
7
|
loadConfig
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SAN5PFTL.js";
|
|
9
9
|
import {
|
|
10
10
|
package_default
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-B4GA3HAK.js";
|
|
12
12
|
import {
|
|
13
13
|
writeFileAtomic
|
|
14
14
|
} from "./chunk-JLEF5WHM.js";
|
|
@@ -191,4 +191,4 @@ export {
|
|
|
191
191
|
fetchDistTags,
|
|
192
192
|
isNewer
|
|
193
193
|
};
|
|
194
|
-
//# sourceMappingURL=chunk-
|
|
194
|
+
//# sourceMappingURL=chunk-NZYVSZNF.js.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
CliError,
|
|
4
|
-
HARNESSES
|
|
4
|
+
HARNESSES,
|
|
5
|
+
writeFileAtomic
|
|
5
6
|
} from "./chunk-JLEF5WHM.js";
|
|
6
7
|
import {
|
|
8
|
+
balanceCachePath,
|
|
7
9
|
configPath
|
|
8
10
|
} from "./chunk-K6AXXYCG.js";
|
|
9
11
|
import {
|
|
@@ -14539,8 +14541,100 @@ function knownDeploymentOrigins() {
|
|
|
14539
14541
|
return [...KNOWN_DEPLOYMENT_ORIGINS];
|
|
14540
14542
|
}
|
|
14541
14543
|
|
|
14542
|
-
// src/lib/
|
|
14544
|
+
// src/lib/usdc-balance.ts
|
|
14543
14545
|
import { readFile } from "node:fs/promises";
|
|
14546
|
+
var USDC_ADDRESS = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
14547
|
+
var BALANCE_OF_SELECTOR = "0x70a08231";
|
|
14548
|
+
var ADDRESS_RE = /^0x[0-9a-fA-F]{40}$/;
|
|
14549
|
+
var WORD_RE = /^0x[0-9a-fA-F]{64}$/;
|
|
14550
|
+
async function readUsdcBalance(address, rpcUrl, opts) {
|
|
14551
|
+
if (!ADDRESS_RE.test(address) || opts.timeoutMs <= 0) return null;
|
|
14552
|
+
try {
|
|
14553
|
+
const res = await (opts.fetchImpl ?? fetch)(rpcUrl, {
|
|
14554
|
+
method: "POST",
|
|
14555
|
+
headers: { "content-type": "application/json" },
|
|
14556
|
+
body: JSON.stringify({
|
|
14557
|
+
jsonrpc: "2.0",
|
|
14558
|
+
id: 1,
|
|
14559
|
+
method: "eth_call",
|
|
14560
|
+
params: [
|
|
14561
|
+
{
|
|
14562
|
+
to: USDC_ADDRESS,
|
|
14563
|
+
data: `${BALANCE_OF_SELECTOR}${address.slice(2).toLowerCase().padStart(64, "0")}`
|
|
14564
|
+
},
|
|
14565
|
+
"latest"
|
|
14566
|
+
]
|
|
14567
|
+
}),
|
|
14568
|
+
signal: AbortSignal.timeout(opts.timeoutMs)
|
|
14569
|
+
});
|
|
14570
|
+
if (!res.ok) return null;
|
|
14571
|
+
const result = (await res.json())?.result;
|
|
14572
|
+
return typeof result === "string" && WORD_RE.test(result) ? BigInt(result) : null;
|
|
14573
|
+
} catch {
|
|
14574
|
+
return null;
|
|
14575
|
+
}
|
|
14576
|
+
}
|
|
14577
|
+
var DEFAULT_RPC_URL = "https://mainnet.base.org";
|
|
14578
|
+
var FALLBACK_RPC_URLS = [
|
|
14579
|
+
"https://base-rpc.publicnode.com",
|
|
14580
|
+
"https://base.drpc.org"
|
|
14581
|
+
];
|
|
14582
|
+
async function readUsdcBalanceWithFallback(address, rpcUrl, opts) {
|
|
14583
|
+
const urls = sameUrl(rpcUrl, DEFAULT_RPC_URL) ? [rpcUrl, ...FALLBACK_RPC_URLS] : [rpcUrl];
|
|
14584
|
+
const deadline = Date.now() + opts.timeoutMs;
|
|
14585
|
+
for (const [index, url2] of urls.entries()) {
|
|
14586
|
+
const left = deadline - Date.now();
|
|
14587
|
+
if (left <= 0) return null;
|
|
14588
|
+
const timeoutMs = index === urls.length - 1 ? left : Math.ceil(left / 2);
|
|
14589
|
+
const balance = await readUsdcBalance(address, url2, { ...opts, timeoutMs });
|
|
14590
|
+
if (balance !== null) return balance;
|
|
14591
|
+
}
|
|
14592
|
+
return null;
|
|
14593
|
+
}
|
|
14594
|
+
function sameUrl(a, b) {
|
|
14595
|
+
try {
|
|
14596
|
+
return new URL(a).href === new URL(b).href;
|
|
14597
|
+
} catch {
|
|
14598
|
+
return a === b;
|
|
14599
|
+
}
|
|
14600
|
+
}
|
|
14601
|
+
var LAST_KNOWN_BALANCE_MS = 6e4;
|
|
14602
|
+
function rememberingBalanceReader(dataDir, opts = {}) {
|
|
14603
|
+
const read = opts.read ?? readUsdcBalanceWithFallback;
|
|
14604
|
+
const now = opts.now ?? Date.now;
|
|
14605
|
+
const path = balanceCachePath(dataDir);
|
|
14606
|
+
return async (address, rpcUrl, readOpts) => {
|
|
14607
|
+
const remembered = await recallBalance(path, address, now());
|
|
14608
|
+
if (remembered !== null) return remembered;
|
|
14609
|
+
const live = await read(address, rpcUrl, readOpts);
|
|
14610
|
+
if (live === null) return null;
|
|
14611
|
+
const record2 = {
|
|
14612
|
+
version: 1,
|
|
14613
|
+
address: address.toLowerCase(),
|
|
14614
|
+
atomic: live.toString(),
|
|
14615
|
+
at: now()
|
|
14616
|
+
};
|
|
14617
|
+
try {
|
|
14618
|
+
await writeFileAtomic(path, JSON.stringify(record2), { mode: 384, dirMode: 448 });
|
|
14619
|
+
} catch {
|
|
14620
|
+
}
|
|
14621
|
+
return live;
|
|
14622
|
+
};
|
|
14623
|
+
}
|
|
14624
|
+
async function recallBalance(path, address, now) {
|
|
14625
|
+
try {
|
|
14626
|
+
const row = JSON.parse(await readFile(path, "utf8"));
|
|
14627
|
+
if (row?.version !== 1 || row.address !== address.toLowerCase() || typeof row.atomic !== "string" || !/^\d{1,40}$/.test(row.atomic) || typeof row.at !== "number" || now - row.at < 0 || now - row.at > LAST_KNOWN_BALANCE_MS) {
|
|
14628
|
+
return null;
|
|
14629
|
+
}
|
|
14630
|
+
return BigInt(row.atomic);
|
|
14631
|
+
} catch {
|
|
14632
|
+
return null;
|
|
14633
|
+
}
|
|
14634
|
+
}
|
|
14635
|
+
|
|
14636
|
+
// src/lib/config.ts
|
|
14637
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
14544
14638
|
var atomicString = external_exports.string().regex(/^\d+$/, "expected an atomic USDC integer string");
|
|
14545
14639
|
var PublishModeSchema = external_exports.enum(["review", "auto", "full-auto"]);
|
|
14546
14640
|
var AckServerWarningsSchema = external_exports.enum(["mode", "on", "off"]);
|
|
@@ -14773,7 +14867,7 @@ var CONFIG_DEFAULTS = {
|
|
|
14773
14867
|
publicShelfUrl: PRODUCTION_ORIGIN,
|
|
14774
14868
|
// Empty = public mode. Setting it is the whole of "turn on team mode".
|
|
14775
14869
|
shelfBypassSecret: "",
|
|
14776
|
-
rpcUrl:
|
|
14870
|
+
rpcUrl: DEFAULT_RPC_URL,
|
|
14777
14871
|
evalCohort: false,
|
|
14778
14872
|
bazaarRegistries: DEFAULT_BAZAAR_REGISTRIES,
|
|
14779
14873
|
publish: { mode: "review", defaultPrice: "100000", ackServerWarnings: "mode" },
|
|
@@ -14842,7 +14936,7 @@ async function loadRawConfig(dir) {
|
|
|
14842
14936
|
const path = configPath(dir);
|
|
14843
14937
|
let raw;
|
|
14844
14938
|
try {
|
|
14845
|
-
raw = await
|
|
14939
|
+
raw = await readFile2(path, "utf8");
|
|
14846
14940
|
} catch (err) {
|
|
14847
14941
|
if (isNotFound(err)) return {};
|
|
14848
14942
|
throw new CliError("CONFIG_INVALID", `Could not read config at ${path}`, {
|
|
@@ -15076,6 +15170,9 @@ export {
|
|
|
15076
15170
|
PRODUCTION_ORIGIN,
|
|
15077
15171
|
isSameDeployment,
|
|
15078
15172
|
knownDeploymentOrigins,
|
|
15173
|
+
USDC_ADDRESS,
|
|
15174
|
+
readUsdcBalanceWithFallback,
|
|
15175
|
+
rememberingBalanceReader,
|
|
15079
15176
|
PublishModeSchema,
|
|
15080
15177
|
parseAckServerWarnings,
|
|
15081
15178
|
ROUTER_CONTEXTS,
|
|
@@ -15101,4 +15198,4 @@ export {
|
|
|
15101
15198
|
resolveSettings,
|
|
15102
15199
|
resolveExperimentalBazaar
|
|
15103
15200
|
};
|
|
15104
|
-
//# sourceMappingURL=chunk-
|
|
15201
|
+
//# sourceMappingURL=chunk-SAN5PFTL.js.map
|