tenjin-cli 0.1.0-alpha.20 → 0.1.0-alpha.21
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 +17 -2
- package/dist/{chunk-3BS55ANY.js → chunk-2AQO4YDI.js} +50 -4
- package/dist/{chunk-3BS55ANY.js.map → chunk-2AQO4YDI.js.map} +1 -1
- package/dist/{chunk-HH3PDYIG.js → chunk-3EUTWC2B.js} +5 -5
- package/dist/{chunk-BTX2QE2Y.js → chunk-AQRUD5GQ.js} +2 -2
- package/dist/{chunk-CXUYCDPX.js → chunk-C363JZN2.js} +4 -4
- package/dist/{chunk-PO4HAXAW.js → chunk-ETW2ASBP.js} +52 -18
- package/dist/chunk-ETW2ASBP.js.map +1 -0
- package/dist/{chunk-RPR2C2JO.js → chunk-GHTPYKDT.js} +5 -5
- package/dist/{chunk-5KD5HRAJ.js → chunk-IOB7URFH.js} +3 -2
- package/dist/chunk-IOB7URFH.js.map +1 -0
- package/dist/{chunk-5FYKPQNX.js → chunk-IOIHYOU4.js} +3 -3
- package/dist/{chunk-LN2HISWU.js → chunk-JN7TMXVF.js} +2 -2
- package/dist/{chunk-TU7XH3JJ.js → chunk-K6AXXYCG.js} +14 -2
- package/dist/chunk-K6AXXYCG.js.map +1 -0
- package/dist/{chunk-2G2WLVHB.js → chunk-LAIZ2AQA.js} +9 -4
- package/dist/chunk-LAIZ2AQA.js.map +1 -0
- package/dist/{chunk-YREKMJPP.js → chunk-N4DJEQAF.js} +65 -6
- package/dist/chunk-N4DJEQAF.js.map +1 -0
- package/dist/{chunk-NSG5TVZQ.js → chunk-OSUD6YZZ.js} +14 -10
- package/dist/chunk-OSUD6YZZ.js.map +1 -0
- package/dist/{chunk-2E6GVIRP.js → chunk-OTPEH3AH.js} +47 -9
- package/dist/chunk-OTPEH3AH.js.map +1 -0
- package/dist/{chunk-LI44XLMB.js → chunk-PJEG2JIJ.js} +5 -5
- package/dist/{chunk-4M5FBWT5.js → chunk-QF4SSCQV.js} +10 -1
- package/dist/chunk-QF4SSCQV.js.map +1 -0
- package/dist/chunk-QHILSA6G.js +82 -0
- package/dist/chunk-QHILSA6G.js.map +1 -0
- package/dist/{chunk-72UHZRG6.js → chunk-QRFONFRW.js} +2 -2
- package/dist/{chunk-P42QX3QF.js → chunk-RCJQARZF.js} +2 -2
- package/dist/{chunk-P42QX3QF.js.map → chunk-RCJQARZF.js.map} +1 -1
- package/dist/chunk-SRVDXR6B.js +337 -0
- package/dist/chunk-SRVDXR6B.js.map +1 -0
- package/dist/{chunk-7ACHDNJA.js → chunk-U2ATFMKZ.js} +13 -4
- package/dist/chunk-U2ATFMKZ.js.map +1 -0
- package/dist/{chunk-4AS52HUG.js → chunk-UY2TOI3B.js} +70 -27
- package/dist/chunk-UY2TOI3B.js.map +1 -0
- package/dist/{chunk-CCDOV45D.js → chunk-W3LVZ2EN.js} +25 -8
- package/dist/{chunk-CCDOV45D.js.map → chunk-W3LVZ2EN.js.map} +1 -1
- package/dist/{chunk-YEBNE5NW.js → chunk-YVODPFTL.js} +5 -5
- package/dist/{cli-XJQYUOHI.js → cli-7KJ4QLUU.js} +42 -29
- package/dist/{cli-XJQYUOHI.js.map → cli-7KJ4QLUU.js.map} +1 -1
- package/dist/{config-KMJLFPSI.js → config-MSN6H4MD.js} +10 -8
- package/dist/{doctor-KMN55D7U.js → doctor-ITUCKN6C.js} +25 -16
- package/dist/{doctor-KMN55D7U.js.map → doctor-ITUCKN6C.js.map} +1 -1
- package/dist/{fund-LT6ZPGEQ.js → fund-XPB4IIG5.js} +11 -11
- package/dist/{hook-command-U5XPEHAJ.js → hook-command-VVV2Q23L.js} +293 -80
- package/dist/hook-command-VVV2Q23L.js.map +1 -0
- package/dist/index.js +4 -4
- package/dist/{install-MMNXJ5LM.js → install-OSJRM2ME.js} +13 -11
- package/dist/{install-identity-B7FVIWML.js → install-identity-YIWKQOUD.js} +7 -7
- package/dist/{install-wallet-XMVUBCHS.js → install-wallet-BWJO2SUC.js} +10 -10
- package/dist/{mcp-TUPRIPSI.js → mcp-KE5YKPS2.js} +203 -29
- package/dist/{mcp-TUPRIPSI.js.map → mcp-KE5YKPS2.js.map} +1 -1
- package/dist/{paths-LRMWNTJP.js → paths-MUXHUOCM.js} +8 -2
- package/dist/{pay-XAWW3NV3.js → pay-MUV2U232.js} +18 -16
- package/dist/payments-4D27K4L2.js +48 -0
- package/dist/payments-4D27K4L2.js.map +1 -0
- package/dist/{send-HESQYRKM.js → send-BXHFKDBF.js} +10 -10
- package/dist/{status-ANZPRZJJ.js → status-3Z3YPRSE.js} +6 -6
- package/dist/{status-line-J3TUWVRQ.js → status-line-CKRMGZ3Q.js} +7 -7
- package/dist/{status-line-wiring-HSV7DXO5.js → status-line-wiring-GECLIIBT.js} +5 -5
- package/dist/tenjin-daemon.mjs +57 -6
- package/dist/{uninstall-GUU34YKP.js → uninstall-BZTVWJ7W.js} +11 -11
- package/dist/{update-KO2NZRJ5.js → update-IQQTEOI5.js} +6 -6
- package/dist/{wallet-3URC5QPK.js → wallet-UFXQ57TZ.js} +10 -10
- package/docs/agent-permissions.md +4 -2
- package/docs/safety-model.md +2 -2
- package/package.json +1 -1
- package/dist/chunk-2E6GVIRP.js.map +0 -1
- package/dist/chunk-2G2WLVHB.js.map +0 -1
- package/dist/chunk-3KKKB2AQ.js +0 -40
- package/dist/chunk-3KKKB2AQ.js.map +0 -1
- package/dist/chunk-4AS52HUG.js.map +0 -1
- package/dist/chunk-4M5FBWT5.js.map +0 -1
- package/dist/chunk-5KD5HRAJ.js.map +0 -1
- package/dist/chunk-7ACHDNJA.js.map +0 -1
- package/dist/chunk-NSG5TVZQ.js.map +0 -1
- package/dist/chunk-PO4HAXAW.js.map +0 -1
- package/dist/chunk-TU7XH3JJ.js.map +0 -1
- package/dist/chunk-YREKMJPP.js.map +0 -1
- package/dist/hook-command-U5XPEHAJ.js.map +0 -1
- /package/dist/{chunk-HH3PDYIG.js.map → chunk-3EUTWC2B.js.map} +0 -0
- /package/dist/{chunk-BTX2QE2Y.js.map → chunk-AQRUD5GQ.js.map} +0 -0
- /package/dist/{chunk-CXUYCDPX.js.map → chunk-C363JZN2.js.map} +0 -0
- /package/dist/{chunk-RPR2C2JO.js.map → chunk-GHTPYKDT.js.map} +0 -0
- /package/dist/{chunk-5FYKPQNX.js.map → chunk-IOIHYOU4.js.map} +0 -0
- /package/dist/{chunk-LN2HISWU.js.map → chunk-JN7TMXVF.js.map} +0 -0
- /package/dist/{chunk-LI44XLMB.js.map → chunk-PJEG2JIJ.js.map} +0 -0
- /package/dist/{chunk-72UHZRG6.js.map → chunk-QRFONFRW.js.map} +0 -0
- /package/dist/{chunk-YEBNE5NW.js.map → chunk-YVODPFTL.js.map} +0 -0
- /package/dist/{config-KMJLFPSI.js.map → config-MSN6H4MD.js.map} +0 -0
- /package/dist/{fund-LT6ZPGEQ.js.map → fund-XPB4IIG5.js.map} +0 -0
- /package/dist/{install-MMNXJ5LM.js.map → install-OSJRM2ME.js.map} +0 -0
- /package/dist/{install-identity-B7FVIWML.js.map → install-identity-YIWKQOUD.js.map} +0 -0
- /package/dist/{install-wallet-XMVUBCHS.js.map → install-wallet-BWJO2SUC.js.map} +0 -0
- /package/dist/{paths-LRMWNTJP.js.map → paths-MUXHUOCM.js.map} +0 -0
- /package/dist/{pay-XAWW3NV3.js.map → pay-MUV2U232.js.map} +0 -0
- /package/dist/{send-HESQYRKM.js.map → send-BXHFKDBF.js.map} +0 -0
- /package/dist/{status-ANZPRZJJ.js.map → status-3Z3YPRSE.js.map} +0 -0
- /package/dist/{status-line-J3TUWVRQ.js.map → status-line-CKRMGZ3Q.js.map} +0 -0
- /package/dist/{status-line-wiring-HSV7DXO5.js.map → status-line-wiring-GECLIIBT.js.map} +0 -0
- /package/dist/{uninstall-GUU34YKP.js.map → uninstall-BZTVWJ7W.js.map} +0 -0
- /package/dist/{update-KO2NZRJ5.js.map → update-IQQTEOI5.js.map} +0 -0
- /package/dist/{wallet-3URC5QPK.js.map → wallet-UFXQ57TZ.js.map} +0 -0
|
@@ -2,6 +2,7 @@ import { createRequire as __tenjinCreateRequire } from 'node:module'; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
VITEST_REPORTER_FILE,
|
|
4
4
|
archivedWalletPath,
|
|
5
|
+
balanceCachePath,
|
|
5
6
|
configPath,
|
|
6
7
|
daemonBundlePath,
|
|
7
8
|
daemonLogPath,
|
|
@@ -10,10 +11,12 @@ import {
|
|
|
10
11
|
daemonTokenPath,
|
|
11
12
|
dataDir,
|
|
12
13
|
defaultDataDir,
|
|
14
|
+
downloadsDir,
|
|
13
15
|
hookHealthPath,
|
|
14
16
|
hooksDir,
|
|
15
17
|
installIdPath,
|
|
16
18
|
loopDbPath,
|
|
19
|
+
paidLedgerPath,
|
|
17
20
|
passphraseBlobPath,
|
|
18
21
|
passphraseBlobPathFor,
|
|
19
22
|
sessionPath,
|
|
@@ -22,11 +25,12 @@ import {
|
|
|
22
25
|
updateCheckPath,
|
|
23
26
|
vitestReporterPath,
|
|
24
27
|
walletPath
|
|
25
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-K6AXXYCG.js";
|
|
26
29
|
import "./chunk-ZXTAQYNA.js";
|
|
27
30
|
export {
|
|
28
31
|
VITEST_REPORTER_FILE,
|
|
29
32
|
archivedWalletPath,
|
|
33
|
+
balanceCachePath,
|
|
30
34
|
configPath,
|
|
31
35
|
daemonBundlePath,
|
|
32
36
|
daemonLogPath,
|
|
@@ -35,10 +39,12 @@ export {
|
|
|
35
39
|
daemonTokenPath,
|
|
36
40
|
dataDir,
|
|
37
41
|
defaultDataDir,
|
|
42
|
+
downloadsDir,
|
|
38
43
|
hookHealthPath,
|
|
39
44
|
hooksDir,
|
|
40
45
|
installIdPath,
|
|
41
46
|
loopDbPath,
|
|
47
|
+
paidLedgerPath,
|
|
42
48
|
passphraseBlobPath,
|
|
43
49
|
passphraseBlobPathFor,
|
|
44
50
|
sessionPath,
|
|
@@ -48,4 +54,4 @@ export {
|
|
|
48
54
|
vitestReporterPath,
|
|
49
55
|
walletPath
|
|
50
56
|
};
|
|
51
|
-
//# sourceMappingURL=paths-
|
|
57
|
+
//# sourceMappingURL=paths-MUXHUOCM.js.map
|
|
@@ -2,20 +2,21 @@ import { createRequire as __tenjinCreateRequire } from 'node:module'; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
MAX_PAID_LEG_TIMEOUT_MS,
|
|
4
4
|
paidLegTimeoutMs,
|
|
5
|
-
runPay
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
runPay,
|
|
6
|
+
settlementTx
|
|
7
|
+
} from "./chunk-ETW2ASBP.js";
|
|
8
|
+
import "./chunk-LAIZ2AQA.js";
|
|
8
9
|
import "./chunk-RGVOODF4.js";
|
|
9
10
|
import "./chunk-TTNESUPQ.js";
|
|
10
11
|
import "./chunk-HPWO4O6S.js";
|
|
11
12
|
import "./chunk-POUWHWID.js";
|
|
12
13
|
import "./chunk-XZKD7DIF.js";
|
|
13
14
|
import "./chunk-LHHMV4GU.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-AQRUD5GQ.js";
|
|
16
|
+
import "./chunk-QHILSA6G.js";
|
|
17
|
+
import "./chunk-YVODPFTL.js";
|
|
18
|
+
import "./chunk-N4DJEQAF.js";
|
|
19
|
+
import "./chunk-U2ATFMKZ.js";
|
|
19
20
|
import "./chunk-AWQPGIR6.js";
|
|
20
21
|
import "./chunk-N35E6CM2.js";
|
|
21
22
|
import "./chunk-JRGFKVAZ.js";
|
|
@@ -24,21 +25,22 @@ import "./chunk-EGELTSPU.js";
|
|
|
24
25
|
import "./chunk-KG3D7FIF.js";
|
|
25
26
|
import "./chunk-RBJPAZFI.js";
|
|
26
27
|
import "./chunk-BPMWXTFX.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-QRFONFRW.js";
|
|
28
29
|
import "./chunk-7QKHZQKW.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-2AQO4YDI.js";
|
|
30
31
|
import "./chunk-MEFB5KHA.js";
|
|
31
32
|
import "./chunk-2I4QTOLB.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-IOB7URFH.js";
|
|
33
34
|
import "./chunk-O2JYBOUO.js";
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-W3LVZ2EN.js";
|
|
36
|
+
import "./chunk-RCJQARZF.js";
|
|
36
37
|
import "./chunk-JLEF5WHM.js";
|
|
37
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-K6AXXYCG.js";
|
|
38
39
|
import "./chunk-ZXTAQYNA.js";
|
|
39
40
|
export {
|
|
40
41
|
MAX_PAID_LEG_TIMEOUT_MS,
|
|
41
42
|
paidLegTimeoutMs,
|
|
42
|
-
runPay
|
|
43
|
+
runPay,
|
|
44
|
+
settlementTx
|
|
43
45
|
};
|
|
44
|
-
//# sourceMappingURL=pay-
|
|
46
|
+
//# sourceMappingURL=pay-MUV2U232.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
reconcilePayments
|
|
4
|
+
} from "./chunk-SRVDXR6B.js";
|
|
5
|
+
import "./chunk-LAIZ2AQA.js";
|
|
6
|
+
import "./chunk-QHILSA6G.js";
|
|
7
|
+
import "./chunk-N4DJEQAF.js";
|
|
8
|
+
import "./chunk-U2ATFMKZ.js";
|
|
9
|
+
import "./chunk-7QKHZQKW.js";
|
|
10
|
+
import "./chunk-MEFB5KHA.js";
|
|
11
|
+
import "./chunk-2I4QTOLB.js";
|
|
12
|
+
import {
|
|
13
|
+
resolveContextSettings
|
|
14
|
+
} from "./chunk-IOB7URFH.js";
|
|
15
|
+
import {
|
|
16
|
+
toMoney
|
|
17
|
+
} from "./chunk-O2JYBOUO.js";
|
|
18
|
+
import "./chunk-W3LVZ2EN.js";
|
|
19
|
+
import "./chunk-JLEF5WHM.js";
|
|
20
|
+
import {
|
|
21
|
+
paidLedgerPath
|
|
22
|
+
} from "./chunk-K6AXXYCG.js";
|
|
23
|
+
import "./chunk-ZXTAQYNA.js";
|
|
24
|
+
|
|
25
|
+
// src/router/payments.ts
|
|
26
|
+
var MAX_COMMAND_CHECKS = 50;
|
|
27
|
+
async function runPaymentsReconcile(ctx, deps = {}) {
|
|
28
|
+
const settings = await resolveContextSettings(ctx);
|
|
29
|
+
const outcome = await reconcilePayments(ctx.dataDir, {
|
|
30
|
+
rpcUrl: settings.rpcUrl,
|
|
31
|
+
max: MAX_COMMAND_CHECKS,
|
|
32
|
+
// Asked for by hand: every due record, however recently it was asked about.
|
|
33
|
+
recheckMs: 0,
|
|
34
|
+
...deps.fetchImpl !== void 0 ? { fetchImpl: deps.fetchImpl } : {},
|
|
35
|
+
...deps.now !== void 0 ? { now: deps.now } : {}
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
data: { ledger: paidLedgerPath(ctx.dataDir), ...outcome },
|
|
39
|
+
humanLines: [
|
|
40
|
+
outcome.checked === 0 ? "No paid lookup is waiting on its settlement." : `Checked ${outcome.checked}: ${outcome.settled} charged, ${outcome.notCharged} not charged.` + (outcome.releasedAtomic !== "0" ? ` ${toMoney(outcome.releasedAtomic).usd} USD went back to today's limit.` : ""),
|
|
41
|
+
...outcome.unknown > 0 ? [`${outcome.unknown} still unknown: not expired yet, or the chain could not say.`] : []
|
|
42
|
+
]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
runPaymentsReconcile
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=payments-4D27K4L2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/router/payments.ts"],"sourcesContent":["import { toMoney } from '../lib/money';\nimport { paidLedgerPath } from '../lib/paths';\nimport { resolveContextSettings } from '../lib/settings';\nimport type { CommandContext, CommandResult } from '../context';\nimport { reconcilePayments } from './paid';\n\n/**\n * `tenjin payments reconcile`: settle every \"settlement unknown\" record in the\n * paid ledger that the chain can now answer for. The `request` tool runs the\n * same pass, three records at a time, before each lookup; this one asks about\n * up to {@link MAX_COMMAND_CHECKS}.\n *\n * A record found not charged also gives its amount back to the daily budget,\n * when the spend ledger still holds that payment's exposure in this window.\n */\n\nconst MAX_COMMAND_CHECKS = 50;\n\nexport interface PaymentsDeps {\n fetchImpl?: typeof fetch;\n now?: () => number;\n}\n\nexport async function runPaymentsReconcile(\n ctx: CommandContext,\n deps: PaymentsDeps = {},\n): Promise<CommandResult> {\n const settings = await resolveContextSettings(ctx);\n const outcome = await reconcilePayments(ctx.dataDir, {\n rpcUrl: settings.rpcUrl,\n max: MAX_COMMAND_CHECKS,\n // Asked for by hand: every due record, however recently it was asked about.\n recheckMs: 0,\n ...(deps.fetchImpl !== undefined ? { fetchImpl: deps.fetchImpl } : {}),\n ...(deps.now !== undefined ? { now: deps.now } : {}),\n });\n return {\n data: { ledger: paidLedgerPath(ctx.dataDir), ...outcome },\n humanLines: [\n outcome.checked === 0\n ? 'No paid lookup is waiting on its settlement.'\n : `Checked ${outcome.checked}: ${outcome.settled} charged, ${outcome.notCharged} not charged.` +\n (outcome.releasedAtomic !== '0'\n ? ` ${toMoney(outcome.releasedAtomic).usd} USD went back to today's limit.`\n : ''),\n ...(outcome.unknown > 0\n ? [`${outcome.unknown} still unknown: not expired yet, or the chain could not say.`]\n : []),\n ],\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAM,qBAAqB;AAO3B,eAAsB,qBACpB,KACA,OAAqB,CAAC,GACE;AACxB,QAAM,WAAW,MAAM,uBAAuB,GAAG;AACjD,QAAM,UAAU,MAAM,kBAAkB,IAAI,SAAS;AAAA,IACnD,QAAQ,SAAS;AAAA,IACjB,KAAK;AAAA;AAAA,IAEL,WAAW;AAAA,IACX,GAAI,KAAK,cAAc,SAAY,EAAE,WAAW,KAAK,UAAU,IAAI,CAAC;AAAA,IACpE,GAAI,KAAK,QAAQ,SAAY,EAAE,KAAK,KAAK,IAAI,IAAI,CAAC;AAAA,EACpD,CAAC;AACD,SAAO;AAAA,IACL,MAAM,EAAE,QAAQ,eAAe,IAAI,OAAO,GAAG,GAAG,QAAQ;AAAA,IACxD,YAAY;AAAA,MACV,QAAQ,YAAY,IAChB,iDACA,WAAW,QAAQ,OAAO,KAAK,QAAQ,OAAO,aAAa,QAAQ,UAAU,mBAC5E,QAAQ,mBAAmB,MACxB,IAAI,QAAQ,QAAQ,cAAc,EAAE,GAAG,qCACvC;AAAA,MACR,GAAI,QAAQ,UAAU,IAClB,CAAC,GAAG,QAAQ,OAAO,8DAA8D,IACjF,CAAC;AAAA,IACP;AAAA,EACF;AACF;","names":[]}
|
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
broadcastUsdcSend,
|
|
11
11
|
getUsdcBalance,
|
|
12
12
|
prepareUsdcSend
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-AQRUD5GQ.js";
|
|
14
|
+
import "./chunk-QHILSA6G.js";
|
|
15
15
|
import {
|
|
16
16
|
describeWallet,
|
|
17
17
|
resolveWalletProvider
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-YVODPFTL.js";
|
|
19
|
+
import "./chunk-N4DJEQAF.js";
|
|
20
|
+
import "./chunk-U2ATFMKZ.js";
|
|
21
21
|
import "./chunk-AWQPGIR6.js";
|
|
22
22
|
import "./chunk-N35E6CM2.js";
|
|
23
23
|
import "./chunk-JRGFKVAZ.js";
|
|
@@ -30,23 +30,23 @@ import {
|
|
|
30
30
|
import "./chunk-KG3D7FIF.js";
|
|
31
31
|
import "./chunk-RBJPAZFI.js";
|
|
32
32
|
import "./chunk-BPMWXTFX.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-QRFONFRW.js";
|
|
34
34
|
import "./chunk-MEFB5KHA.js";
|
|
35
35
|
import "./chunk-2I4QTOLB.js";
|
|
36
36
|
import {
|
|
37
37
|
resolveContextSettings
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-IOB7URFH.js";
|
|
39
39
|
import {
|
|
40
40
|
parseUsdToAtomic,
|
|
41
41
|
toMoney
|
|
42
42
|
} from "./chunk-O2JYBOUO.js";
|
|
43
43
|
import {
|
|
44
44
|
SEND_MAX_UNSET
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-W3LVZ2EN.js";
|
|
46
46
|
import {
|
|
47
47
|
CliError
|
|
48
48
|
} from "./chunk-JLEF5WHM.js";
|
|
49
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-K6AXXYCG.js";
|
|
50
50
|
import "./chunk-ZXTAQYNA.js";
|
|
51
51
|
|
|
52
52
|
// src/commands/send.ts
|
|
@@ -222,4 +222,4 @@ This moves funds out of the agent wallet and cannot be undone. [y/N] `;
|
|
|
222
222
|
export {
|
|
223
223
|
runSend
|
|
224
224
|
};
|
|
225
|
-
//# sourceMappingURL=send-
|
|
225
|
+
//# sourceMappingURL=send-BXHFKDBF.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-N4DJEQAF.js";
|
|
3
3
|
import {
|
|
4
4
|
readSpendSummary,
|
|
5
5
|
spentOf
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-U2ATFMKZ.js";
|
|
7
7
|
import "./chunk-MEFB5KHA.js";
|
|
8
8
|
import "./chunk-2I4QTOLB.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveContextSettings
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IOB7URFH.js";
|
|
12
12
|
import {
|
|
13
13
|
toMoney
|
|
14
14
|
} from "./chunk-O2JYBOUO.js";
|
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
RETIRED_PAYMENT_GUIDANCE,
|
|
17
17
|
loadRawConfig,
|
|
18
18
|
retiredPaymentKeys
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-W3LVZ2EN.js";
|
|
20
20
|
import "./chunk-JLEF5WHM.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-K6AXXYCG.js";
|
|
22
22
|
import "./chunk-ZXTAQYNA.js";
|
|
23
23
|
|
|
24
24
|
// src/router/status.ts
|
|
@@ -68,4 +68,4 @@ async function runRouterStatus(ctx, deps = {}) {
|
|
|
68
68
|
export {
|
|
69
69
|
runRouterStatus
|
|
70
70
|
};
|
|
71
|
-
//# sourceMappingURL=status-
|
|
71
|
+
//# sourceMappingURL=status-3Z3YPRSE.js.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
renderProgress
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QF4SSCQV.js";
|
|
5
5
|
import {
|
|
6
6
|
routerSettings
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-C363JZN2.js";
|
|
8
|
+
import "./chunk-IOB7URFH.js";
|
|
9
9
|
import "./chunk-O2JYBOUO.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-W3LVZ2EN.js";
|
|
11
11
|
import "./chunk-JLEF5WHM.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-K6AXXYCG.js";
|
|
13
13
|
import "./chunk-ZXTAQYNA.js";
|
|
14
14
|
|
|
15
15
|
// src/router/status-line.ts
|
|
16
16
|
var MAX_EVENT_BYTES = 64e3;
|
|
17
17
|
var STDIN_TIMEOUT_MS = 1e3;
|
|
18
18
|
async function statusLineMain() {
|
|
19
|
-
const { dataDir } = await import("./paths-
|
|
19
|
+
const { dataDir } = await import("./paths-MUXHUOCM.js");
|
|
20
20
|
await runStatusLine(
|
|
21
21
|
{ stdout: process.stdout, stderr: process.stderr, isTTY: false },
|
|
22
22
|
{ dataDir: dataDir(process.env) }
|
|
@@ -84,4 +84,4 @@ export {
|
|
|
84
84
|
runStatusLine,
|
|
85
85
|
statusLineMain
|
|
86
86
|
};
|
|
87
|
-
//# sourceMappingURL=status-line-
|
|
87
|
+
//# sourceMappingURL=status-line-CKRMGZ3Q.js.map
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
inspectStatusLine,
|
|
10
10
|
removeStatusLine,
|
|
11
11
|
statusLineMode
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-JN7TMXVF.js";
|
|
13
|
+
import "./chunk-IOIHYOU4.js";
|
|
14
|
+
import "./chunk-RCJQARZF.js";
|
|
15
15
|
import "./chunk-JLEF5WHM.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-K6AXXYCG.js";
|
|
17
17
|
import "./chunk-ZXTAQYNA.js";
|
|
18
18
|
export {
|
|
19
19
|
STATUS_LINE_COMMAND,
|
|
@@ -26,4 +26,4 @@ export {
|
|
|
26
26
|
removeStatusLine,
|
|
27
27
|
statusLineMode
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=status-line-wiring-
|
|
29
|
+
//# sourceMappingURL=status-line-wiring-GECLIIBT.js.map
|
package/dist/tenjin-daemon.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { readFileSync as readFileSync4, statSync as statSync4 } from "node:fs";
|
|
|
11
11
|
// package.json
|
|
12
12
|
var package_default = {
|
|
13
13
|
name: "tenjin-cli",
|
|
14
|
-
version: "0.1.0-alpha.
|
|
14
|
+
version: "0.1.0-alpha.21",
|
|
15
15
|
mcpName: "blog.tenjin/tenjin",
|
|
16
16
|
type: "module",
|
|
17
17
|
description: "x402 router for coding agents: one paid decision per lookup, a local wallet that pays each provider per call in USDC on Base.",
|
|
@@ -16234,6 +16234,35 @@ function timeoutFailure(url2, timeoutMs) {
|
|
|
16234
16234
|
message: `Request to ${url2} timed out after ${timeoutMs}ms`
|
|
16235
16235
|
};
|
|
16236
16236
|
}
|
|
16237
|
+
var MAX_BINARY_BODY_BYTES = 200 * 1024 * 1024;
|
|
16238
|
+
async function readCapped(res, max) {
|
|
16239
|
+
const declared = Number(res.headers.get("content-length") ?? "0");
|
|
16240
|
+
if (Number.isFinite(declared) && declared > max) {
|
|
16241
|
+
await res.body?.cancel().catch(() => void 0);
|
|
16242
|
+
return null;
|
|
16243
|
+
}
|
|
16244
|
+
if (res.body === null) return new Uint8Array();
|
|
16245
|
+
const reader = res.body.getReader();
|
|
16246
|
+
const chunks = [];
|
|
16247
|
+
let size = 0;
|
|
16248
|
+
for (; ; ) {
|
|
16249
|
+
const { done, value } = await reader.read();
|
|
16250
|
+
if (done) break;
|
|
16251
|
+
size += value.byteLength;
|
|
16252
|
+
if (size > max) {
|
|
16253
|
+
await reader.cancel().catch(() => void 0);
|
|
16254
|
+
return null;
|
|
16255
|
+
}
|
|
16256
|
+
chunks.push(value);
|
|
16257
|
+
}
|
|
16258
|
+
return new Uint8Array(Buffer.concat(chunks));
|
|
16259
|
+
}
|
|
16260
|
+
function isBinaryContentType(contentType) {
|
|
16261
|
+
const type = (contentType ?? "").split(";")[0].trim().toLowerCase();
|
|
16262
|
+
if (type.length === 0) return false;
|
|
16263
|
+
if (type.startsWith("text/")) return false;
|
|
16264
|
+
return !/(?:json|xml|javascript|ecmascript|yaml|x-www-form-urlencoded)/.test(type);
|
|
16265
|
+
}
|
|
16237
16266
|
function prepareRequest(url2, opts) {
|
|
16238
16267
|
try {
|
|
16239
16268
|
let body;
|
|
@@ -16307,8 +16336,24 @@ async function httpRequest(url2, opts) {
|
|
|
16307
16336
|
};
|
|
16308
16337
|
}
|
|
16309
16338
|
let text;
|
|
16339
|
+
let bytes;
|
|
16310
16340
|
try {
|
|
16311
|
-
|
|
16341
|
+
if (opts.binaryBody === true && isBinaryContentType(res.headers.get("content-type") ?? "")) {
|
|
16342
|
+
const read = await readCapped(res, opts.maxBinaryBytes ?? MAX_BINARY_BODY_BYTES);
|
|
16343
|
+
if (read === null) {
|
|
16344
|
+
return {
|
|
16345
|
+
ok: false,
|
|
16346
|
+
kind: "network",
|
|
16347
|
+
status: res.status,
|
|
16348
|
+
...requestId !== void 0 ? { requestId } : {},
|
|
16349
|
+
message: `Request to ${url2} returned a file over the ${Math.round((opts.maxBinaryBytes ?? MAX_BINARY_BODY_BYTES) / 1048576)} MB cap; it was not kept.`
|
|
16350
|
+
};
|
|
16351
|
+
}
|
|
16352
|
+
bytes = read;
|
|
16353
|
+
text = "";
|
|
16354
|
+
} else {
|
|
16355
|
+
text = await res.text();
|
|
16356
|
+
}
|
|
16312
16357
|
} catch (err) {
|
|
16313
16358
|
if (timedOut) return timeoutFailure(url2, opts.timeoutMs);
|
|
16314
16359
|
return {
|
|
@@ -16333,6 +16378,7 @@ async function httpRequest(url2, opts) {
|
|
|
16333
16378
|
header: (name) => res.headers.get(name) ?? void 0,
|
|
16334
16379
|
json: json2,
|
|
16335
16380
|
text,
|
|
16381
|
+
...bytes !== void 0 ? { bytes } : {},
|
|
16336
16382
|
...requestId !== void 0 ? { requestId } : {}
|
|
16337
16383
|
};
|
|
16338
16384
|
} finally {
|
|
@@ -16583,6 +16629,7 @@ var LoopConfigSchema = external_exports.object({
|
|
|
16583
16629
|
});
|
|
16584
16630
|
var PublicFallbackSchema = external_exports.enum(["on", "off"]);
|
|
16585
16631
|
var TeamConfigSchema = external_exports.object({ publicFallback: PublicFallbackSchema });
|
|
16632
|
+
var ExperimentalConfigSchema = external_exports.object({ bazaar: PublicFallbackSchema });
|
|
16586
16633
|
var UpdateConfigSchema = external_exports.object({
|
|
16587
16634
|
mode: UpdateModeSchema
|
|
16588
16635
|
});
|
|
@@ -16681,7 +16728,8 @@ var ConfigSchema = external_exports.object({
|
|
|
16681
16728
|
update: UpdateConfigSchema,
|
|
16682
16729
|
loop: LoopConfigSchema,
|
|
16683
16730
|
team: TeamConfigSchema,
|
|
16684
|
-
router: RouterConfigSchema
|
|
16731
|
+
router: RouterConfigSchema,
|
|
16732
|
+
experimental: ExperimentalConfigSchema
|
|
16685
16733
|
});
|
|
16686
16734
|
var RawInstallConfigSchema = InstallConfigSchema.partial().extend({
|
|
16687
16735
|
harness: RawInstallHarnessSchema.optional(),
|
|
@@ -16694,7 +16742,8 @@ var RawConfigSchema = ConfigSchema.partial().extend({
|
|
|
16694
16742
|
update: UpdateConfigSchema.partial().passthrough().optional(),
|
|
16695
16743
|
loop: LoopConfigSchema.partial().passthrough().optional(),
|
|
16696
16744
|
team: TeamConfigSchema.partial().passthrough().optional(),
|
|
16697
|
-
router: RouterLayerSchema.passthrough().optional()
|
|
16745
|
+
router: RouterLayerSchema.passthrough().optional(),
|
|
16746
|
+
experimental: ExperimentalConfigSchema.partial().passthrough().optional()
|
|
16698
16747
|
}).passthrough();
|
|
16699
16748
|
var DEFAULT_BAZAAR_REGISTRIES = [
|
|
16700
16749
|
"https://api.cdp.coinbase.com/platform/v2/x402",
|
|
@@ -16742,7 +16791,8 @@ var CONFIG_DEFAULTS = {
|
|
|
16742
16791
|
port: null
|
|
16743
16792
|
},
|
|
16744
16793
|
team: { publicFallback: "on" },
|
|
16745
|
-
router: { enabled: true, context: "session" }
|
|
16794
|
+
router: { enabled: true, context: "session" },
|
|
16795
|
+
experimental: { bazaar: "off" }
|
|
16746
16796
|
};
|
|
16747
16797
|
var NESTED_CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
16748
16798
|
"publish",
|
|
@@ -16751,7 +16801,8 @@ var NESTED_CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
16751
16801
|
"update",
|
|
16752
16802
|
"loop",
|
|
16753
16803
|
"team",
|
|
16754
|
-
"router"
|
|
16804
|
+
"router",
|
|
16805
|
+
"experimental"
|
|
16755
16806
|
]);
|
|
16756
16807
|
var CONFIG_KEYS = Object.keys(CONFIG_DEFAULTS).filter(
|
|
16757
16808
|
(key) => !NESTED_CONFIG_KEYS.has(key)
|
|
@@ -5,35 +5,35 @@ import {
|
|
|
5
5
|
mcpScope,
|
|
6
6
|
readMcpEntry,
|
|
7
7
|
routerSettingsPath
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OSUD6YZZ.js";
|
|
9
9
|
import {
|
|
10
10
|
MCP_SERVER_NAME
|
|
11
11
|
} from "./chunk-TGLKKLQG.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-QRFONFRW.js";
|
|
13
13
|
import {
|
|
14
14
|
onPath,
|
|
15
15
|
persistRouterProject
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OTPEH3AH.js";
|
|
17
17
|
import "./chunk-A36LQPHV.js";
|
|
18
18
|
import "./chunk-2QYORQBF.js";
|
|
19
19
|
import "./chunk-MEFB5KHA.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-C363JZN2.js";
|
|
21
21
|
import "./chunk-2I4QTOLB.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-IOB7URFH.js";
|
|
23
23
|
import "./chunk-O2JYBOUO.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-W3LVZ2EN.js";
|
|
25
25
|
import {
|
|
26
26
|
removeStatusLine
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-JN7TMXVF.js";
|
|
28
28
|
import {
|
|
29
29
|
inspectHooksFile,
|
|
30
30
|
pruneHooks
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-
|
|
31
|
+
} from "./chunk-IOIHYOU4.js";
|
|
32
|
+
import "./chunk-RCJQARZF.js";
|
|
33
33
|
import {
|
|
34
34
|
writeFileAtomic
|
|
35
35
|
} from "./chunk-JLEF5WHM.js";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-K6AXXYCG.js";
|
|
37
37
|
import "./chunk-ZXTAQYNA.js";
|
|
38
38
|
|
|
39
39
|
// src/router/uninstall.ts
|
|
@@ -162,4 +162,4 @@ export {
|
|
|
162
162
|
MCP_REMOVE_COMMAND,
|
|
163
163
|
runRouterUninstall
|
|
164
164
|
};
|
|
165
|
-
//# sourceMappingURL=uninstall-
|
|
165
|
+
//# sourceMappingURL=uninstall-BZTVWJ7W.js.map
|
|
@@ -5,21 +5,21 @@ import {
|
|
|
5
5
|
fetchDistTags,
|
|
6
6
|
isNewer,
|
|
7
7
|
resolveTarget
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3EUTWC2B.js";
|
|
9
9
|
import {
|
|
10
10
|
emitWriteNotice,
|
|
11
11
|
sanitizeForTerminal
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-QRFONFRW.js";
|
|
13
|
+
import "./chunk-W3LVZ2EN.js";
|
|
14
14
|
import {
|
|
15
15
|
package_default
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RCJQARZF.js";
|
|
17
17
|
import {
|
|
18
18
|
CliError
|
|
19
19
|
} from "./chunk-JLEF5WHM.js";
|
|
20
20
|
import {
|
|
21
21
|
defaultDataDir
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-K6AXXYCG.js";
|
|
23
23
|
import "./chunk-ZXTAQYNA.js";
|
|
24
24
|
|
|
25
25
|
// src/commands/update.ts
|
|
@@ -430,4 +430,4 @@ export {
|
|
|
430
430
|
spawnCapture,
|
|
431
431
|
versionFreeEntry
|
|
432
432
|
};
|
|
433
|
-
//# sourceMappingURL=update-
|
|
433
|
+
//# sourceMappingURL=update-IQQTEOI5.js.map
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
runWalletBalance,
|
|
4
4
|
runWalletCreate,
|
|
5
5
|
runWalletShow
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-PJEG2JIJ.js";
|
|
7
|
+
import "./chunk-AQRUD5GQ.js";
|
|
8
|
+
import "./chunk-QHILSA6G.js";
|
|
9
|
+
import "./chunk-YVODPFTL.js";
|
|
10
|
+
import "./chunk-N4DJEQAF.js";
|
|
11
|
+
import "./chunk-U2ATFMKZ.js";
|
|
12
12
|
import "./chunk-AWQPGIR6.js";
|
|
13
13
|
import "./chunk-N35E6CM2.js";
|
|
14
14
|
import "./chunk-JRGFKVAZ.js";
|
|
@@ -17,17 +17,17 @@ import "./chunk-EGELTSPU.js";
|
|
|
17
17
|
import "./chunk-KG3D7FIF.js";
|
|
18
18
|
import "./chunk-RBJPAZFI.js";
|
|
19
19
|
import "./chunk-BPMWXTFX.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-QRFONFRW.js";
|
|
21
21
|
import "./chunk-MEFB5KHA.js";
|
|
22
22
|
import "./chunk-2I4QTOLB.js";
|
|
23
23
|
import "./chunk-O2JYBOUO.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-W3LVZ2EN.js";
|
|
25
25
|
import "./chunk-JLEF5WHM.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-K6AXXYCG.js";
|
|
27
27
|
import "./chunk-ZXTAQYNA.js";
|
|
28
28
|
export {
|
|
29
29
|
runWalletBalance,
|
|
30
30
|
runWalletCreate,
|
|
31
31
|
runWalletShow
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=wallet-
|
|
33
|
+
//# sourceMappingURL=wallet-UFXQ57TZ.js.map
|
|
@@ -69,7 +69,7 @@ Both flags still obey the optional explicit `--max-price` cap, destination and s
|
|
|
69
69
|
|
|
70
70
|
Router calls cannot use `--ignore-warnings`. They require their offered price and retain hard checks for any supplied network, asset or recipient. The current server protocol supplies price only; this release does not claim complete endpoint/payee quote binding.
|
|
71
71
|
|
|
72
|
-
Immediately before signing a positive payment, the CLI reads the actual signer's Base USDC balance through the configured RPC. An unreadable balance gets one retry within the original deadline. Confirmed insufficient funds or two unreadable results refuse, releases the reservation and counts no spend. Hook balance reads are advisory and bounded: prompt, pre-call, after-call and subagent offers are suppressed for known insufficient funds or policy refusal. A successful balance read cannot reserve funds or guarantee settlement after concurrent transfers.
|
|
72
|
+
Immediately before signing a positive payment, the CLI reads the actual signer's Base USDC balance through the configured RPC. An unreadable balance gets one retry within the original deadline. Confirmed insufficient funds or two unreadable results refuse, releases the reservation and counts no spend. Hook balance reads are advisory and bounded: prompt, pre-call, after-call and subagent offers are suppressed for known insufficient funds or policy refusal. A hook reuses a read from the last minute (`balance.json`, the address and amount only); the payment's read never does. A successful balance read cannot reserve funds or guarantee settlement after concurrent transfers.
|
|
73
73
|
|
|
74
74
|
## Never recommended
|
|
75
75
|
|
|
@@ -88,7 +88,7 @@ Prefer the narrow rules on this page to a broad `Bash(tenjin:*)`, `Bash(tenjin w
|
|
|
88
88
|
|
|
89
89
|
## What `tenjin install` writes, in full
|
|
90
90
|
|
|
91
|
-
1.
|
|
91
|
+
1. Seven hook entries in `~/.claude/settings.json` (`--project` writes the project file instead): `UserPromptSubmit` running `tenjin hook prompt`, `PreToolUse` on `WebSearch|WebFetch` running `tenjin hook native`, `PreToolUse` on `Agent|Task` running `tenjin hook agent`, `PostToolUse` and `PostToolUseFailure` on `WebSearch|WebFetch`, both running `tenjin hook shortfall`, and `PreToolUse` and `PostToolUse` on `AskUserQuestion`, running `tenjin hook ask` and `tenjin hook answer`. All are plain command entries with a 5 second timeout, except the two `tenjin hook shortfall` entries, which get 15 seconds so a search can wait for the free docs described below. No daemon, no generated script; the one background process is that docs fetch, a single `node` process per such search that exits within 12 seconds. An install from an earlier release already has the first two; `tenjin install --refresh` (which `tenjin update` runs) adds the rest.
|
|
92
92
|
2. The `mcp__x402__request` rule in `permissions.allow`. Nothing goes into `permissions.deny`, and no hook ever approves a call, so WebSearch and WebFetch stay under your own permission rules. Before each one, when a paid lookup fits it, the hook redirects your assistant to `mcp__x402__request` in its place, as earlier releases did; a subagent is redirected only when it is known to have `mcp__x402__request` and your spend policy would pay without asking, and otherwise its call simply runs. For library documentation, which is a free lookup, it never redirects, in the main agent or a subagent: a WebSearch runs as your assistant wrote it while the hook fetches Context7 docs for the same query (up to 500 characters of it go to Tenjin's docs lookup, which asks Context7), and when docs are found they are added above the search's own results, with a line saying the web results below are there if the docs do not cover it; when none are found, or the lookup is slow or fails, the search result is left exactly as it was. One agent's identical search is not looked up again for five minutes, and the fetched docs wait in the status line's 0700 directory (item 5) only until that search reads them, ten minutes at most. A WebFetch with a free lookup simply runs. It never redirects the same call twice: once a search or URL has been redirected, your assistant's own retry of that same search or URL runs as it is, whether the redirected lookup succeeded, failed or was never called, and however many other calls ran in between, for ten minutes and separately for each agent, while every other search or URL is routed as usual. After a call that came back short (a failed call, a page that answers 401, 402, 403, 429 or 5xx, an empty page, a search with no results; never a 404 or 410, since a missing page is missing for a paid reader too), the router may offer a paid lookup.
|
|
93
93
|
3. The `x402` MCP server, through `claude mcp add x402 -s user -- tenjin mcp` when the `claude` binary is on PATH, and printed for you to run when it is not. Under `--project` it registers at project scope instead, from the project directory, so the server lands in that project's `.mcp.json` and your `~/.claude.json` is not touched; `tenjin uninstall --project` removes it from the same place. The scope's own file is read first: a registration that already launches `tenjin mcp` is left exactly as it is and nothing is spawned, an `x402` entry launching anything else is removed and re-added, and a registration file this build cannot parse is reported rather than written over.
|
|
94
94
|
4. The two automatic spend limits above, only where your config file is silent. Explicit zero, unlimited, custom registry lists and router opt-outs are preserved. Ignored `bazaarPay` and `confirm` keys are removed and reported; refresh removes retired keys without filling absent settings.
|
|
@@ -113,6 +113,8 @@ To stop the router without removing anything, `tenjin config set router.enabled
|
|
|
113
113
|
- On every prompt and every native `WebSearch` or `WebFetch`: the text of the current turn and at most six prior messages, masked by the same key, PEM, seed-phrase, and URL credential rules the publish scan uses, then bounded to 16 KiB, with harness meta rows and tool results excluded. Tool results never travel: a tool result is other people's content, and a packet carrying it would be a channel from a fetched page into a routing decision.
|
|
114
114
|
- A native call sends that same bounded turn WITH the call attached, read from this session's own transcript. That is how a restriction you stated in your own words, such as asking for native tools only, reaches the decision about a bare URL your assistant is fetching. When that call then comes back short and nothing was offered before it, it is sent once more with what the harness reported: the status code and byte count, or the error. Never the page or the results. A call that came back fine sends nothing more.
|
|
115
115
|
- When your assistant hands a task to a subagent: that task, as the current message, with the same bounded turn before it.
|
|
116
|
+
- When your assistant asks you a question (`AskUserQuestion`): the questions and their options, attached to the same bounded turn, before you see them; and after you answer, your answers as the current message. Before the question, a fitting lookup redirects it once, under the same rules as a native call, and only when your spend limits and wallet would pay it without asking you; after it, a fitting lookup is offered beside your answers.
|
|
117
|
+
- Every hook request carries this session's id, so one session is not offered the same pay-per-call service twice.
|
|
116
118
|
- With `router.context turn`, no prior messages are sent: the prompt on a prompt, your latest message on a native call, and the task on a delegation. `tenjin config set router.context turn` sets it for this machine, and `--project` for this repository.
|
|
117
119
|
- Slash commands and one-word acknowledgements are never sent at all.
|
|
118
120
|
- The packet is stored on the backend against the decision id, so the lookup your assistant sends next is decided with the context you gave. Expired packets are unreadable after 15 minutes (the route refuses an expired id) and are deleted by the next router request or the daily cleanup, whichever comes first.
|
package/docs/safety-model.md
CHANGED
|
@@ -21,13 +21,13 @@ Do not copy commands from purchased content into an allowlist, `AGENTS.md`, `CLA
|
|
|
21
21
|
|
|
22
22
|
Search, inspect, free reads, outcomes, wallet display, balance checks, doctor, and checkout-link creation are separated from purchases and transfers.
|
|
23
23
|
|
|
24
|
-
The x402 router's `request` tool and `tenjin pay` are the paying commands, and they run one gate between them: `maxAutoSpend` and `sessionBudget` as limits on automatic router spending only, mandatory consent for manual pay, and a reservation that counts a signed authorization as spent the moment it leaves. A router lookup is ONE payment, to the provider: deciding where to route costs nothing and nobody signs for it. The boundary is split on purpose: the backend binds the call and validates its arguments against the capability's own schema, and this client checks the three things only it can: the amount signed against the spend caps, the body that comes back against the success rule the decision carries, and the destination resolving to a public address. That destination check is a check, not a pin
|
|
24
|
+
The x402 router's `request` tool and `tenjin pay` are the paying commands, and they run one gate between them: `maxAutoSpend` and `sessionBudget` as limits on automatic router spending only, mandatory consent for manual pay, and a reservation that counts a signed authorization as spent the moment it leaves. A router lookup is ONE payment, to the provider: deciding where to route costs nothing and nobody signs for it. The boundary is split on purpose: the backend binds the call and validates its arguments against the capability's own schema, and this client checks the three things only it can: the amount signed against the spend caps, the body that comes back against the success rule the decision carries, and the destination resolving to a public address. That destination check is a check, not a pin, for the paid request: it resolves the name again on its own, so a host that answers publicly at check time and privately a moment later is not closed by it. The router's download of media a discovered service links to does pin: it connects to the address it validated, on every redirect hop. `--max-price` is always a hard cap on `tenjin pay`. Every automatic authorization that LEAVES the process counts against the automatic session budget until the 24 hour window rolls, even where the provider never settles it: a signed EIP-3009 authorization is a bearer instrument, so a 200 that reports no match, or a 402 that rejects the payment, is the counterparty saying it did not take the money rather than proof that it cannot. Manual exposure remains recorded in the same ledger but does not consume automatic headroom. Older records without a mode or automatic counter count conservatively as automatic. The budget is deliberately the conservative side of that, and a caller can be left with less headroom than it actually spent. The one release is proof from the chain, not the counterparty: `tenjin payments reconcile` (and the `request` tool, for up to three records beside each lookup) gives an authorization's amount back only when USDC's `authorizationState` shows it unused at a block whose timestamp is past its `validBefore`, so it can never be charged, and only inside the window that counted it, once per nonce.
|
|
25
25
|
|
|
26
26
|
The automatic daily limit is zero, a finite amount or `none`: zero blocks positive automatic payments and `none` removes that ceiling while retaining reservations and duplicate protection. Manual pay requires explicit user consent and is subject to neither automatic limit. Retired `bazaarPay` and `confirm` values are ignored after upgrade; doctor/status warn, and install/refresh remove and report them while preserving current controls and unrelated fields.
|
|
27
27
|
|
|
28
28
|
Direct third-party payments use the supported live 402 quote. Unavailable/incomplete verification and differences from an exact listing block payment unless this invocation supplies `--ignore-warnings`. Missing listings or a missing Bazaar extension require no warning or flag. Warnings remain visible and structured in JSON. This flag acknowledges registry evidence only; `--yes` confirms payment only. Manual pay requires explicit user consent regardless of configured automatic limits and must never be an autonomous workaround for router refusal. Neither flag bypasses an explicit price cap, supported challenge, destination checks or balance check. Router payments retain the offered-price ceiling and hard checks on supplied terms, with no direct-payment fallback. The current price-only protocol does not provide complete endpoint/payee quote binding.
|
|
29
29
|
|
|
30
|
-
After policy confirmation and immediately before signing, the actual signer's USDC balance must be readable and sufficient. Refusal releases the reservation and does not count spend; free and entitled delivery skips this read. The hook's bounded advisory read suppresses known unusable offers but does not authorize payment. Balances can change after a read, so settlement is not guaranteed. Once a payment authorization is transmitted, the conservative accounting described above
|
|
30
|
+
After policy confirmation and immediately before signing, the actual signer's USDC balance must be readable and sufficient. Refusal releases the reservation and does not count spend; free and entitled delivery skips this read. The hook's bounded advisory read suppresses known unusable offers but does not authorize payment. Balances can change after a read, so settlement is not guaranteed. Once a payment authorization is transmitted, the conservative accounting described above applies, with that one chain-proven release.
|
|
31
31
|
|
|
32
32
|
`tenjin wallet send` moves USDC out of the wallet. It exists as a human escape hatch, not as part of the agent flow.
|
|
33
33
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tenjin-cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.21",
|
|
4
4
|
"mcpName": "blog.tenjin/tenjin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "x402 router for coding agents: one paid decision per lookup, a local wallet that pays each provider per call in USDC on Base.",
|