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.
Files changed (91) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-PJEG2JIJ.js → chunk-2RMXTNLT.js} +4 -4
  3. package/dist/{chunk-IOIHYOU4.js → chunk-3Q3UBMVB.js} +2 -2
  4. package/dist/{chunk-2AQO4YDI.js → chunk-AG4DWNHO.js} +3 -3
  5. package/dist/{chunk-RCJQARZF.js → chunk-B4GA3HAK.js} +2 -2
  6. package/dist/{chunk-RCJQARZF.js.map → chunk-B4GA3HAK.js.map} +1 -1
  7. package/dist/{chunk-OSUD6YZZ.js → chunk-CYEUVU3F.js} +8 -8
  8. package/dist/{chunk-GHTPYKDT.js → chunk-DA53QKTD.js} +4 -4
  9. package/dist/{chunk-YVODPFTL.js → chunk-DHCOGDJB.js} +4 -4
  10. package/dist/{chunk-AQRUD5GQ.js → chunk-F4IJQBGP.js} +4 -4
  11. package/dist/{chunk-SRVDXR6B.js → chunk-GONDQ27X.js} +5 -5
  12. package/dist/{chunk-N4DJEQAF.js → chunk-NYJCBQL5.js} +2 -2
  13. package/dist/{chunk-3EUTWC2B.js → chunk-NZYVSZNF.js} +4 -4
  14. package/dist/{chunk-W3LVZ2EN.js → chunk-SAN5PFTL.js} +102 -5
  15. package/dist/chunk-SAN5PFTL.js.map +1 -0
  16. package/dist/{chunk-JN7TMXVF.js → chunk-TU3IK7KK.js} +2 -2
  17. package/dist/{chunk-UY2TOI3B.js → chunk-U5FFVIIF.js} +74 -7
  18. package/dist/chunk-U5FFVIIF.js.map +1 -0
  19. package/dist/{chunk-ETW2ASBP.js → chunk-UAT3Q7VF.js} +68 -16
  20. package/dist/chunk-UAT3Q7VF.js.map +1 -0
  21. package/dist/chunk-UFCN7NCE.js +130 -0
  22. package/dist/chunk-UFCN7NCE.js.map +1 -0
  23. package/dist/{chunk-QRFONFRW.js → chunk-UGLTSPXQ.js} +2 -2
  24. package/dist/{chunk-IOB7URFH.js → chunk-UHEMZEGW.js} +2 -2
  25. package/dist/{chunk-OTPEH3AH.js → chunk-UIOZRILX.js} +5 -5
  26. package/dist/{chunk-U2ATFMKZ.js → chunk-WXFVJPZD.js} +2 -2
  27. package/dist/{chunk-C363JZN2.js → chunk-XBYTP4SP.js} +3 -3
  28. package/dist/{cli-7KJ4QLUU.js → cli-5WM56Y7K.js} +28 -28
  29. package/dist/{cli-7KJ4QLUU.js.map → cli-5WM56Y7K.js.map} +1 -1
  30. package/dist/{config-MSN6H4MD.js → config-JBF5BZNO.js} +7 -7
  31. package/dist/{doctor-ITUCKN6C.js → doctor-6KHBE77P.js} +15 -15
  32. package/dist/{fund-XPB4IIG5.js → fund-GSFCXEF7.js} +9 -10
  33. package/dist/{fund-XPB4IIG5.js.map → fund-GSFCXEF7.js.map} +1 -1
  34. package/dist/{hook-command-VVV2Q23L.js → hook-command-UQZ4DVDL.js} +90 -12
  35. package/dist/hook-command-UQZ4DVDL.js.map +1 -0
  36. package/dist/index.js +3 -3
  37. package/dist/{install-OSJRM2ME.js → install-TDYC22KI.js} +10 -10
  38. package/dist/{install-identity-YIWKQOUD.js → install-identity-QS4UFF27.js} +6 -6
  39. package/dist/{install-wallet-BWJO2SUC.js → install-wallet-T737X74E.js} +8 -9
  40. package/dist/{install-wallet-BWJO2SUC.js.map → install-wallet-T737X74E.js.map} +1 -1
  41. package/dist/{mcp-KE5YKPS2.js → mcp-JWOOSKLX.js} +449 -68
  42. package/dist/mcp-JWOOSKLX.js.map +1 -0
  43. package/dist/{pay-MUV2U232.js → pay-TDYQFSKY.js} +11 -12
  44. package/dist/{payments-4D27K4L2.js → payments-26NVMFR2.js} +6 -7
  45. package/dist/{payments-4D27K4L2.js.map → payments-26NVMFR2.js.map} +1 -1
  46. package/dist/{send-BXHFKDBF.js → send-4RUBQQKP.js} +8 -9
  47. package/dist/{send-BXHFKDBF.js.map → send-4RUBQQKP.js.map} +1 -1
  48. package/dist/{status-3Z3YPRSE.js → status-CEHZKHBU.js} +5 -5
  49. package/dist/{status-line-CKRMGZ3Q.js → status-line-QRAO3Y2E.js} +4 -4
  50. package/dist/{status-line-wiring-GECLIIBT.js → status-line-wiring-XKUVI5UW.js} +4 -4
  51. package/dist/tenjin-daemon.mjs +5 -2
  52. package/dist/{uninstall-BZTVWJ7W.js → uninstall-SJ6R2W2M.js} +10 -10
  53. package/dist/{update-IQQTEOI5.js → update-N2NZS3AA.js} +5 -5
  54. package/dist/{wallet-UFXQ57TZ.js → wallet-IB2EFAUP.js} +8 -9
  55. package/docs/agent-permissions.md +8 -8
  56. package/docs/safety-model.md +2 -2
  57. package/package.json +1 -1
  58. package/dist/chunk-ETW2ASBP.js.map +0 -1
  59. package/dist/chunk-QHILSA6G.js +0 -82
  60. package/dist/chunk-QHILSA6G.js.map +0 -1
  61. package/dist/chunk-UY2TOI3B.js.map +0 -1
  62. package/dist/chunk-W3LVZ2EN.js.map +0 -1
  63. package/dist/hook-command-VVV2Q23L.js.map +0 -1
  64. package/dist/mcp-KE5YKPS2.js.map +0 -1
  65. /package/dist/{chunk-PJEG2JIJ.js.map → chunk-2RMXTNLT.js.map} +0 -0
  66. /package/dist/{chunk-IOIHYOU4.js.map → chunk-3Q3UBMVB.js.map} +0 -0
  67. /package/dist/{chunk-2AQO4YDI.js.map → chunk-AG4DWNHO.js.map} +0 -0
  68. /package/dist/{chunk-OSUD6YZZ.js.map → chunk-CYEUVU3F.js.map} +0 -0
  69. /package/dist/{chunk-GHTPYKDT.js.map → chunk-DA53QKTD.js.map} +0 -0
  70. /package/dist/{chunk-YVODPFTL.js.map → chunk-DHCOGDJB.js.map} +0 -0
  71. /package/dist/{chunk-AQRUD5GQ.js.map → chunk-F4IJQBGP.js.map} +0 -0
  72. /package/dist/{chunk-SRVDXR6B.js.map → chunk-GONDQ27X.js.map} +0 -0
  73. /package/dist/{chunk-N4DJEQAF.js.map → chunk-NYJCBQL5.js.map} +0 -0
  74. /package/dist/{chunk-3EUTWC2B.js.map → chunk-NZYVSZNF.js.map} +0 -0
  75. /package/dist/{chunk-JN7TMXVF.js.map → chunk-TU3IK7KK.js.map} +0 -0
  76. /package/dist/{chunk-QRFONFRW.js.map → chunk-UGLTSPXQ.js.map} +0 -0
  77. /package/dist/{chunk-IOB7URFH.js.map → chunk-UHEMZEGW.js.map} +0 -0
  78. /package/dist/{chunk-OTPEH3AH.js.map → chunk-UIOZRILX.js.map} +0 -0
  79. /package/dist/{chunk-U2ATFMKZ.js.map → chunk-WXFVJPZD.js.map} +0 -0
  80. /package/dist/{chunk-C363JZN2.js.map → chunk-XBYTP4SP.js.map} +0 -0
  81. /package/dist/{config-MSN6H4MD.js.map → config-JBF5BZNO.js.map} +0 -0
  82. /package/dist/{doctor-ITUCKN6C.js.map → doctor-6KHBE77P.js.map} +0 -0
  83. /package/dist/{install-OSJRM2ME.js.map → install-TDYC22KI.js.map} +0 -0
  84. /package/dist/{install-identity-YIWKQOUD.js.map → install-identity-QS4UFF27.js.map} +0 -0
  85. /package/dist/{pay-MUV2U232.js.map → pay-TDYQFSKY.js.map} +0 -0
  86. /package/dist/{status-3Z3YPRSE.js.map → status-CEHZKHBU.js.map} +0 -0
  87. /package/dist/{status-line-CKRMGZ3Q.js.map → status-line-QRAO3Y2E.js.map} +0 -0
  88. /package/dist/{status-line-wiring-GECLIIBT.js.map → status-line-wiring-XKUVI5UW.js.map} +0 -0
  89. /package/dist/{uninstall-BZTVWJ7W.js.map → uninstall-SJ6R2W2M.js.map} +0 -0
  90. /package/dist/{update-IQQTEOI5.js.map → update-N2NZS3AA.js.map} +0 -0
  91. /package/dist/{wallet-UFXQ57TZ.js.map → wallet-IB2EFAUP.js.map} +0 -0
@@ -0,0 +1,130 @@
1
+ import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ OfferSpecSchema
4
+ } from "./chunk-U5FFVIIF.js";
5
+ import {
6
+ external_exports
7
+ } from "./chunk-SAN5PFTL.js";
8
+ import {
9
+ writeFileAtomic,
10
+ writeFileAtomicExclusive
11
+ } from "./chunk-JLEF5WHM.js";
12
+
13
+ // src/router/specs.ts
14
+ import { createHash } from "node:crypto";
15
+ import { constants } from "node:fs";
16
+ import { lstat, open, opendir, rm } from "node:fs/promises";
17
+ import { join } from "node:path";
18
+ var SPECS_DIR = join("progress", "specs");
19
+ var MAX_SPEC_BYTES = 128 * 1024;
20
+ var MAX_SPECS = 512;
21
+ var SPEC_TTL_MS = 15 * 6e4;
22
+ var digest = (value) => createHash("sha256").update(value).digest("hex");
23
+ function specPath(dataDir, id) {
24
+ return join(dataDir, SPECS_DIR, `${digest(id)}.json`);
25
+ }
26
+ async function storeSpecs(dataDir, specs) {
27
+ if (specs === void 0 || specs.length === 0) return;
28
+ for (const spec of specs) {
29
+ try {
30
+ await writeFileAtomic(specPath(dataDir, spec.id), JSON.stringify(spec), {
31
+ mode: 384,
32
+ dirMode: 448
33
+ });
34
+ } catch {
35
+ }
36
+ }
37
+ await pruneSpecs(dataDir, Date.now());
38
+ }
39
+ async function readSpec(dataDir, id) {
40
+ const path = specPath(dataDir, id);
41
+ const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW).catch(() => void 0);
42
+ if (file === void 0) return null;
43
+ try {
44
+ const stat = await file.stat();
45
+ if (Date.now() - stat.mtimeMs > SPEC_TTL_MS || stat.size > MAX_SPEC_BYTES) return null;
46
+ const parsed = OfferSpecSchema.safeParse(JSON.parse(await file.readFile("utf8")));
47
+ return parsed.success && parsed.data.id === id ? parsed.data : null;
48
+ } catch {
49
+ return null;
50
+ } finally {
51
+ await file.close().catch(() => void 0);
52
+ }
53
+ }
54
+ var PaymentSchema = external_exports.discriminatedUnion("state", [
55
+ external_exports.strictObject({
56
+ state: external_exports.literal("paid"),
57
+ at: external_exports.string().max(40),
58
+ amountAtomic: external_exports.string().regex(/^\d+$/),
59
+ txHash: external_exports.string().max(100).optional()
60
+ }),
61
+ external_exports.strictObject({ state: external_exports.literal("possibly_paid"), at: external_exports.string().max(40) }),
62
+ external_exports.strictObject({ state: external_exports.literal("running"), at: external_exports.string().max(40) })
63
+ ]);
64
+ function paymentPath(dataDir, id) {
65
+ return join(dataDir, SPECS_DIR, `${digest(id)}.paid.json`);
66
+ }
67
+ async function claimSpecPayment(dataDir, id, now = Date.now()) {
68
+ const path = paymentPath(dataDir, id);
69
+ try {
70
+ await writeFileAtomicExclusive(
71
+ path,
72
+ JSON.stringify({ state: "running", at: new Date(now).toISOString() }),
73
+ { mode: 384, dirMode: 448 }
74
+ );
75
+ return null;
76
+ } catch (err) {
77
+ if (err.code !== "EEXIST") return { state: "unrecorded" };
78
+ }
79
+ const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW).catch(() => void 0);
80
+ if (file === void 0) return { state: "running" };
81
+ try {
82
+ const parsed = PaymentSchema.safeParse(JSON.parse(await file.readFile("utf8")));
83
+ return parsed.success ? parsed.data : { state: "running" };
84
+ } catch {
85
+ return { state: "running" };
86
+ } finally {
87
+ await file.close().catch(() => void 0);
88
+ }
89
+ }
90
+ async function settleSpecPayment(dataDir, id, left, now = Date.now()) {
91
+ const path = paymentPath(dataDir, id);
92
+ if (!left.signed && left.amountAtomic === 0n) {
93
+ await rm(path, { force: true }).catch(() => void 0);
94
+ return;
95
+ }
96
+ const at = new Date(now).toISOString();
97
+ const record = left.amountAtomic > 0n ? {
98
+ state: "paid",
99
+ at,
100
+ amountAtomic: left.amountAtomic.toString(),
101
+ ...left.txHash !== void 0 ? { txHash: left.txHash } : {}
102
+ } : { state: "possibly_paid", at };
103
+ await writeFileAtomic(path, JSON.stringify(record), { mode: 384, dirMode: 448 }).catch(
104
+ () => void 0
105
+ );
106
+ }
107
+ async function pruneSpecs(dataDir, now) {
108
+ try {
109
+ const directory = await opendir(join(dataDir, SPECS_DIR));
110
+ let count = 0;
111
+ for await (const entry of directory) {
112
+ if (++count > MAX_SPECS) return;
113
+ if (!entry.isFile()) continue;
114
+ const path = join(dataDir, SPECS_DIR, entry.name);
115
+ const stat = await lstat(path).catch(() => void 0);
116
+ if (stat === void 0 || now - stat.mtimeMs > SPEC_TTL_MS) {
117
+ await rm(path, { force: true }).catch(() => void 0);
118
+ }
119
+ }
120
+ } catch {
121
+ }
122
+ }
123
+
124
+ export {
125
+ storeSpecs,
126
+ readSpec,
127
+ claimSpecPayment,
128
+ settleSpecPayment
129
+ };
130
+ //# sourceMappingURL=chunk-UFCN7NCE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/router/specs.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\nimport { constants } from 'node:fs';\nimport { lstat, open, opendir, rm } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { z } from 'zod';\nimport { writeFileAtomic, writeFileAtomicExclusive } from '../lib/atomic-json';\nimport { OfferSpecSchema, type OfferSpec } from './decision';\n\n/**\n * THE REQUEST SPECS AN OFFER CARRIED, kept on this machine by the offer's id. The\n * hook that shows a line stores the spec of every service the line names; the\n * `request` tool, which runs in the MCP server's own process and never sees\n * the hook, reads one back by the id the agent passes. One file per id, named\n * by the id's SHA-256, so a read is one open and needs no session.\n *\n * Best effort on the write, like every record the hooks keep: with no spec\n * stored, `request({id})` says none is kept and asks for the query its line\n * named. A spec is the server's own answer, re-parsed on the way back in, and\n * it lives as long as the server keeps the offer's id.\n */\n\nconst SPECS_DIR = join('progress', 'specs');\n/** A spec holds a service's whole input schema; far larger than any record. */\nconst MAX_SPEC_BYTES = 128 * 1024;\n/** Above this many files the directory is not scanned for pruning. */\nconst MAX_SPECS = 512;\n/** The server's decision expiry: past it, the id's outcome report and an\n * `{id, query}` fallback find no row. */\nexport const SPEC_TTL_MS = 15 * 60_000;\n\nconst digest = (value: string): string => createHash('sha256').update(value).digest('hex');\n\nfunction specPath(dataDir: string, id: string): string {\n return join(dataDir, SPECS_DIR, `${digest(id)}.json`);\n}\n\n/**\n * Store each spec under its id, and drop expired ones. Never throws. Ages are\n * file mtimes, so they are read against the real clock, never a caller's.\n */\nexport async function storeSpecs(\n dataDir: string,\n specs: readonly OfferSpec[] | undefined,\n): Promise<void> {\n if (specs === undefined || specs.length === 0) return;\n for (const spec of specs) {\n try {\n await writeFileAtomic(specPath(dataDir, spec.id), JSON.stringify(spec), {\n mode: 0o600,\n dirMode: 0o700,\n });\n } catch {\n // The tool falls back to the server for this id.\n }\n }\n await pruneSpecs(dataDir, Date.now());\n}\n\n/** The spec stored for this id, or null: none, expired, damaged or not ours. */\nexport async function readSpec(dataDir: string, id: string): Promise<OfferSpec | null> {\n const path = specPath(dataDir, id);\n // O_NOFOLLOW: the directory is the user's, and a planted symlink must not\n // turn this read into a read of something else.\n const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW).catch(() => undefined);\n if (file === undefined) return null;\n try {\n const stat = await file.stat();\n if (Date.now() - stat.mtimeMs > SPEC_TTL_MS || stat.size > MAX_SPEC_BYTES) return null;\n const parsed = OfferSpecSchema.safeParse(JSON.parse(await file.readFile('utf8')));\n return parsed.success && parsed.data.id === id ? parsed.data : null;\n } catch {\n return null;\n } finally {\n await file.close().catch(() => undefined);\n }\n}\n\n/**\n * What an earlier call with a spec's id left. `paid`: money left for it.\n * `possibly_paid`: a payment was signed and may have left, but the call ended\n * without saying how much (a spend ledger that could not be written, say).\n * `running`: a call claimed it and has not ended, or its process died, so it\n * may have paid. `unrecorded`: this call could not record its claim.\n */\nexport type EarlierPayment =\n | { state: 'paid'; at: string; amountAtomic: string; txHash?: string }\n | { state: 'possibly_paid'; at: string }\n | { state: 'running'; at?: string }\n | { state: 'unrecorded' };\n\nconst PaymentSchema = z.discriminatedUnion('state', [\n z.strictObject({\n state: z.literal('paid'),\n at: z.string().max(40),\n amountAtomic: z.string().regex(/^\\d+$/),\n txHash: z.string().max(100).optional(),\n }),\n z.strictObject({ state: z.literal('possibly_paid'), at: z.string().max(40) }),\n z.strictObject({ state: z.literal('running'), at: z.string().max(40) }),\n]);\n\nfunction paymentPath(dataDir: string, id: string): string {\n return join(dataDir, SPECS_DIR, `${digest(id)}.paid.json`);\n}\n\n/**\n * CLAIM THE ONE PAYMENT A SPEC ALLOWS, before anything is signed: an exclusive\n * create beside the spec, so a retry or a second call with the same id cannot\n * pay again. Null when the claim is this call's; otherwise what an earlier call\n * left, and this one pays nothing. A claim that cannot be written refuses too:\n * the record is the only proof a payment has not already left.\n */\nexport async function claimSpecPayment(\n dataDir: string,\n id: string,\n now: number = Date.now(),\n): Promise<EarlierPayment | null> {\n const path = paymentPath(dataDir, id);\n try {\n await writeFileAtomicExclusive(\n path,\n JSON.stringify({ state: 'running', at: new Date(now).toISOString() }),\n { mode: 0o600, dirMode: 0o700 },\n );\n return null;\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== 'EEXIST') return { state: 'unrecorded' };\n }\n const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW).catch(() => undefined);\n if (file === undefined) return { state: 'running' };\n try {\n const parsed = PaymentSchema.safeParse(JSON.parse(await file.readFile('utf8')));\n return parsed.success ? parsed.data : { state: 'running' };\n } catch {\n return { state: 'running' };\n } finally {\n await file.close().catch(() => undefined);\n }\n}\n\n/**\n * How the claimed call ended. Money that left is recorded against the id. The\n * claim is dropped ONLY when nothing was signed, so a fixed input can still\n * run: a signed payment whose amount the call never learned (it failed after\n * the authorization left) stays claimed as possibly paid, and the id never\n * signs again. A record that cannot be written leaves the claim standing,\n * which refuses too.\n */\nexport async function settleSpecPayment(\n dataDir: string,\n id: string,\n left: { amountAtomic: bigint; txHash?: string; signed: boolean },\n now: number = Date.now(),\n): Promise<void> {\n const path = paymentPath(dataDir, id);\n if (!left.signed && left.amountAtomic === 0n) {\n await rm(path, { force: true }).catch(() => undefined);\n return;\n }\n const at = new Date(now).toISOString();\n const record =\n left.amountAtomic > 0n\n ? {\n state: 'paid',\n at,\n amountAtomic: left.amountAtomic.toString(),\n ...(left.txHash !== undefined ? { txHash: left.txHash } : {}),\n }\n : { state: 'possibly_paid', at };\n await writeFileAtomic(path, JSON.stringify(record), { mode: 0o600, dirMode: 0o700 }).catch(\n () => undefined,\n );\n}\n\nasync function pruneSpecs(dataDir: string, now: number): Promise<void> {\n try {\n const directory = await opendir(join(dataDir, SPECS_DIR));\n let count = 0;\n for await (const entry of directory) {\n if (++count > MAX_SPECS) return;\n if (!entry.isFile()) continue;\n const path = join(dataDir, SPECS_DIR, entry.name);\n const stat = await lstat(path).catch(() => undefined);\n if (stat === undefined || now - stat.mtimeMs > SPEC_TTL_MS) {\n await rm(path, { force: true }).catch(() => undefined);\n }\n }\n } catch {\n // Housekeeping only.\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAC1B,SAAS,OAAO,MAAM,SAAS,UAAU;AACzC,SAAS,YAAY;AAkBrB,IAAM,YAAY,KAAK,YAAY,OAAO;AAE1C,IAAM,iBAAiB,MAAM;AAE7B,IAAM,YAAY;AAGX,IAAM,cAAc,KAAK;AAEhC,IAAM,SAAS,CAAC,UAA0B,WAAW,QAAQ,EAAE,OAAO,KAAK,EAAE,OAAO,KAAK;AAEzF,SAAS,SAAS,SAAiB,IAAoB;AACrD,SAAO,KAAK,SAAS,WAAW,GAAG,OAAO,EAAE,CAAC,OAAO;AACtD;AAMA,eAAsB,WACpB,SACA,OACe;AACf,MAAI,UAAU,UAAa,MAAM,WAAW,EAAG;AAC/C,aAAW,QAAQ,OAAO;AACxB,QAAI;AACF,YAAM,gBAAgB,SAAS,SAAS,KAAK,EAAE,GAAG,KAAK,UAAU,IAAI,GAAG;AAAA,QACtE,MAAM;AAAA,QACN,SAAS;AAAA,MACX,CAAC;AAAA,IACH,QAAQ;AAAA,IAER;AAAA,EACF;AACA,QAAM,WAAW,SAAS,KAAK,IAAI,CAAC;AACtC;AAGA,eAAsB,SAAS,SAAiB,IAAuC;AACrF,QAAM,OAAO,SAAS,SAAS,EAAE;AAGjC,QAAM,OAAO,MAAM,KAAK,MAAM,UAAU,WAAW,UA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EA,eAAe,WAAW,SAAiB,KAA4B;AACrE,MAAI;AACF,UAAM,YAAY,MAAM,QAAQ,KAAK,SAAS,SAAS,CAAC;AACxD,QAAI,QAAQ;AACZ,qBAAiB,SAAS,WAAW;AACnC,UAAI,EAAE,QAAQ,UAAW;AACzB,UAAI,CAAC,MAAM,OAAO,EAAG;AACrB,YAAM,OAAO,KAAK,SAAS,WAAW,MAAM,IAAI;AAChD,YAAM,OAAO,MAAM,MAAM,IAAI,EAAE,MAAM,MAAM,MAAS;AACpD,UAAI,SAAS,UAAa,MAAM,KAAK,UAAU,aAAa;AAC1D,cAAM,GAAG,MAAM,EAAE,OAAO,KAAK,CAAC,EAAE,MAAM,MAAM,MAAS;AAAA,MACvD;AAAA,IACF;AAAA,EACF,QAAQ;AAAA,EAER;AACF;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
2
  import {
3
3
  external_exports
4
- } from "./chunk-W3LVZ2EN.js";
4
+ } from "./chunk-SAN5PFTL.js";
5
5
  import {
6
6
  CliError
7
7
  } from "./chunk-JLEF5WHM.js";
@@ -228,4 +228,4 @@ export {
228
228
  sanitizeForTerminal,
229
229
  paint
230
230
  };
231
- //# sourceMappingURL=chunk-QRFONFRW.js.map
231
+ //# sourceMappingURL=chunk-UGLTSPXQ.js.map
@@ -11,7 +11,7 @@ import {
11
11
  isSameDeployment,
12
12
  loadRawConfig,
13
13
  resolveSettings
14
- } from "./chunk-W3LVZ2EN.js";
14
+ } from "./chunk-SAN5PFTL.js";
15
15
  import {
16
16
  CliError
17
17
  } from "./chunk-JLEF5WHM.js";
@@ -239,4 +239,4 @@ export {
239
239
  ownedCandidates,
240
240
  projectRoot
241
241
  };
242
- //# sourceMappingURL=chunk-IOB7URFH.js.map
242
+ //# sourceMappingURL=chunk-UHEMZEGW.js.map
@@ -13,14 +13,14 @@ import {
13
13
  projectRouterPath,
14
14
  readProjectRouterFile,
15
15
  routerSettings
16
- } from "./chunk-C363JZN2.js";
16
+ } from "./chunk-XBYTP4SP.js";
17
17
  import {
18
18
  hasCode
19
19
  } from "./chunk-2I4QTOLB.js";
20
20
  import {
21
21
  isTeamShelfOrigin,
22
22
  loadProjectConfig
23
- } from "./chunk-IOB7URFH.js";
23
+ } from "./chunk-UHEMZEGW.js";
24
24
  import {
25
25
  parseUsdToAtomic,
26
26
  toMoney
@@ -48,7 +48,7 @@ import {
48
48
  parseUpdateModeFlag,
49
49
  resolveSettings,
50
50
  retiredPaymentKeys
51
- } from "./chunk-W3LVZ2EN.js";
51
+ } from "./chunk-SAN5PFTL.js";
52
52
  import {
53
53
  ADAPTERS,
54
54
  MODE_GATED_RULES,
@@ -56,7 +56,7 @@ import {
56
56
  registeredHooks,
57
57
  retractModeGatedRules,
58
58
  wireFreeVerbAllowlist
59
- } from "./chunk-IOIHYOU4.js";
59
+ } from "./chunk-3Q3UBMVB.js";
60
60
  import {
61
61
  CliError,
62
62
  writeFileAtomic
@@ -923,4 +923,4 @@ export {
923
923
  persistInstallHarness,
924
924
  persistGrantDeclined
925
925
  };
926
- //# sourceMappingURL=chunk-OTPEH3AH.js.map
926
+ //# sourceMappingURL=chunk-UIOZRILX.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-2I4QTOLB.js";
5
5
  import {
6
6
  external_exports
7
- } from "./chunk-W3LVZ2EN.js";
7
+ } from "./chunk-SAN5PFTL.js";
8
8
  import {
9
9
  spendLedgerPath
10
10
  } from "./chunk-K6AXXYCG.js";
@@ -161,4 +161,4 @@ export {
161
161
  readSpendSummary,
162
162
  evaluateSpendPolicy
163
163
  };
164
- //# sourceMappingURL=chunk-U2ATFMKZ.js.map
164
+ //# sourceMappingURL=chunk-WXFVJPZD.js.map
@@ -5,12 +5,12 @@ import {
5
5
  mainWorktreeOf,
6
6
  ownedCandidates,
7
7
  projectRoot
8
- } from "./chunk-IOB7URFH.js";
8
+ } from "./chunk-UHEMZEGW.js";
9
9
  import {
10
10
  CONFIG_DEFAULTS,
11
11
  loadRawConfig,
12
12
  parseRouterLayer
13
- } from "./chunk-W3LVZ2EN.js";
13
+ } from "./chunk-SAN5PFTL.js";
14
14
  import {
15
15
  CliError
16
16
  } from "./chunk-JLEF5WHM.js";
@@ -124,4 +124,4 @@ export {
124
124
  readProjectRouterFile,
125
125
  projectRouterPath
126
126
  };
127
- //# sourceMappingURL=chunk-C363JZN2.js.map
127
+ //# sourceMappingURL=chunk-XBYTP4SP.js.map
@@ -2,28 +2,28 @@ import { createRequire as __tenjinCreateRequire } from 'node:module'; const requ
2
2
  import {
3
3
  maybeUpdate,
4
4
  readUpdateSignal
5
- } from "./chunk-3EUTWC2B.js";
5
+ } from "./chunk-NZYVSZNF.js";
6
6
  import {
7
7
  defaultIo,
8
8
  emitFailure,
9
9
  emitSuccess
10
- } from "./chunk-QRFONFRW.js";
10
+ } from "./chunk-UGLTSPXQ.js";
11
11
  import {
12
12
  noteBaseUrlFlag
13
- } from "./chunk-GHTPYKDT.js";
14
- import "./chunk-2AQO4YDI.js";
13
+ } from "./chunk-DA53QKTD.js";
14
+ import "./chunk-AG4DWNHO.js";
15
15
  import {
16
16
  PERMISSIONS_DOC_URL
17
17
  } from "./chunk-A36LQPHV.js";
18
18
  import "./chunk-2I4QTOLB.js";
19
- import "./chunk-IOB7URFH.js";
19
+ import "./chunk-UHEMZEGW.js";
20
20
  import "./chunk-O2JYBOUO.js";
21
21
  import {
22
22
  external_exports
23
- } from "./chunk-W3LVZ2EN.js";
23
+ } from "./chunk-SAN5PFTL.js";
24
24
  import {
25
25
  package_default
26
- } from "./chunk-RCJQARZF.js";
26
+ } from "./chunk-B4GA3HAK.js";
27
27
  import {
28
28
  CliError
29
29
  } from "./chunk-JLEF5WHM.js";
@@ -3513,8 +3513,8 @@ Learn more:
3513
3513
  ).action(async function() {
3514
3514
  await runCommand("install", this, async (ctx) => {
3515
3515
  const o = this.opts();
3516
- const { runRouterInstall } = await import("./install-OSJRM2ME.js");
3517
- const { statusLineMode } = await import("./status-line-wiring-GECLIIBT.js");
3516
+ const { runRouterInstall } = await import("./install-TDYC22KI.js");
3517
+ const { statusLineMode } = await import("./status-line-wiring-XKUVI5UW.js");
3518
3518
  return runRouterInstall(
3519
3519
  {
3520
3520
  ...o.project === true ? { project: true } : {},
@@ -3531,7 +3531,7 @@ Learn more:
3531
3531
  ).option("--project", "remove from this project's .claude/settings.json").action(async function() {
3532
3532
  await runCommand("uninstall", this, async (ctx) => {
3533
3533
  const o = this.opts();
3534
- const { runRouterUninstall } = await import("./uninstall-BZTVWJ7W.js");
3534
+ const { runRouterUninstall } = await import("./uninstall-SJ6R2W2M.js");
3535
3535
  return runRouterUninstall({ ...o.project === true ? { project: true } : {} }, ctx);
3536
3536
  });
3537
3537
  });
@@ -3547,7 +3547,7 @@ Examples:
3547
3547
  `
3548
3548
  ).action(async function() {
3549
3549
  await runCommand("doctor", this, async (ctx) => {
3550
- const { runRouterDoctor } = await import("./doctor-ITUCKN6C.js");
3550
+ const { runRouterDoctor } = await import("./doctor-6KHBE77P.js");
3551
3551
  return runRouterDoctor(ctx, this.opts().project === true ? { project: true } : {});
3552
3552
  });
3553
3553
  });
@@ -3555,7 +3555,7 @@ Examples:
3555
3555
  "Update tenjin-cli to the newest version npm publishes on the latest tag. It then runs `install --refresh` on the new binary, so every profile on this machine gets the skills and hook scripts of the build that just landed."
3556
3556
  ).option("--check", "report whether a newer version exists without installing it").action(async function() {
3557
3557
  await runCommand("update", this, async (ctx) => {
3558
- const { runUpdate } = await import("./update-IQQTEOI5.js");
3558
+ const { runUpdate } = await import("./update-N2NZS3AA.js");
3559
3559
  return runUpdate({ check: this.opts().check === true }, ctx);
3560
3560
  });
3561
3561
  });
@@ -3574,7 +3574,7 @@ Examples:
3574
3574
  );
3575
3575
  config.action(async function() {
3576
3576
  await runCommand("config", this, async (ctx) => {
3577
- const { runConfigList } = await import("./config-MSN6H4MD.js");
3577
+ const { runConfigList } = await import("./config-JBF5BZNO.js");
3578
3578
  return runConfigList(ctx);
3579
3579
  });
3580
3580
  });
@@ -3582,7 +3582,7 @@ Examples:
3582
3582
  "Print one effective config value by key. The effective value is what the command would use, defaults and environment overrides included."
3583
3583
  ).action(async function(key) {
3584
3584
  await runCommand("config.get", this, async (ctx) => {
3585
- const { runConfigGet } = await import("./config-MSN6H4MD.js");
3585
+ const { runConfigGet } = await import("./config-JBF5BZNO.js");
3586
3586
  return runConfigGet({ key }, ctx);
3587
3587
  });
3588
3588
  });
@@ -3594,7 +3594,7 @@ Examples:
3594
3594
  ).option("--local", "with --project, write .tenjin/config.local.json instead, which is yours").action(async function(key, value) {
3595
3595
  const o = this.opts();
3596
3596
  await runCommand("config.set", this, async (ctx) => {
3597
- const { runConfigSet } = await import("./config-MSN6H4MD.js");
3597
+ const { runConfigSet } = await import("./config-JBF5BZNO.js");
3598
3598
  return runConfigSet(
3599
3599
  { key, value, project: o.project === true, local: o.local === true },
3600
3600
  ctx
@@ -3616,7 +3616,7 @@ Examples:
3616
3616
  ).action(async function() {
3617
3617
  await runCommand("wallet.create", this, async (ctx) => {
3618
3618
  const o = this.opts();
3619
- const { runWalletCreate } = await import("./wallet-UFXQ57TZ.js");
3619
+ const { runWalletCreate } = await import("./wallet-IB2EFAUP.js");
3620
3620
  return runWalletCreate(ctx, o.replace === true ? { replace: true } : {});
3621
3621
  });
3622
3622
  });
@@ -3624,7 +3624,7 @@ Examples:
3624
3624
  "Print the active wallet address and where its key comes from. The private key is never printed, by any flag."
3625
3625
  ).action(async function() {
3626
3626
  await runCommand("wallet.show", this, async (ctx) => {
3627
- const { runWalletShow } = await import("./wallet-UFXQ57TZ.js");
3627
+ const { runWalletShow } = await import("./wallet-IB2EFAUP.js");
3628
3628
  return runWalletShow(ctx);
3629
3629
  });
3630
3630
  });
@@ -3632,7 +3632,7 @@ Examples:
3632
3632
  "Read the wallet USDC balance on Base. It is a chain read: no key is unlocked and nothing is spent."
3633
3633
  ).action(async function() {
3634
3634
  await runCommand("wallet.balance", this, async (ctx) => {
3635
- const { runWalletBalance } = await import("./wallet-UFXQ57TZ.js");
3635
+ const { runWalletBalance } = await import("./wallet-IB2EFAUP.js");
3636
3636
  return runWalletBalance(ctx);
3637
3637
  });
3638
3638
  });
@@ -3644,7 +3644,7 @@ Examples:
3644
3644
  ).action(async function(amountUsd) {
3645
3645
  await runCommand("wallet.fund", this, async (ctx) => {
3646
3646
  const o = this.opts();
3647
- const { runFund } = await import("./fund-XPB4IIG5.js");
3647
+ const { runFund } = await import("./fund-GSFCXEF7.js");
3648
3648
  return runFund(ctx, {
3649
3649
  ...amountUsd !== void 0 ? { amountUsd } : {},
3650
3650
  ...o.open === false ? { open: false } : {},
@@ -3663,7 +3663,7 @@ Examples:
3663
3663
  ).action(async function(amount, token, to) {
3664
3664
  await runCommand("wallet.send", this, async (ctx) => {
3665
3665
  const o = this.opts();
3666
- const { runSend } = await import("./send-BXHFKDBF.js");
3666
+ const { runSend } = await import("./send-4RUBQQKP.js");
3667
3667
  return runSend({ amount, token, to, ...o.yes === true ? { yes: true } : {} }, ctx);
3668
3668
  });
3669
3669
  });
@@ -3683,7 +3683,7 @@ Examples:
3683
3683
  ).action(async function(url) {
3684
3684
  await runCommand("pay", this, async (ctx) => {
3685
3685
  const o = this.opts();
3686
- const { runPay } = await import("./pay-MUV2U232.js");
3686
+ const { runPay } = await import("./pay-TDYQFSKY.js");
3687
3687
  return runPay(
3688
3688
  {
3689
3689
  url,
@@ -3719,7 +3719,7 @@ function registerRouter(reg) {
3719
3719
  ]) {
3720
3720
  addGlobalFlags2(hook.command(name)).summary(summary).action(async function() {
3721
3721
  const ctx = buildContext2(this);
3722
- const { runHookCommand } = await import("./hook-command-VVV2Q23L.js");
3722
+ const { runHookCommand } = await import("./hook-command-UQZ4DVDL.js");
3723
3723
  await runHookCommand(name, io, {
3724
3724
  dataDir: ctx.dataDir,
3725
3725
  ...ctx.flags.baseUrl !== void 0 ? { baseUrl: ctx.flags.baseUrl } : {}
@@ -3729,24 +3729,24 @@ function registerRouter(reg) {
3729
3729
  hook.command("unknown", { hidden: true, isDefault: true }).argument("[args...]").allowUnknownOption().allowExcessArguments().action(() => {
3730
3730
  });
3731
3731
  leaf2(INTEGRATION, "mcp", "run the local stdio MCP server").description(
3732
- "Run the local stdio MCP server that carries the `request` tool: one paid routing decision per lookup, then the provider call, under your local spend policy. It speaks on stdin and stdout and runs until the client disconnects, so it prints no envelope of its own."
3732
+ "Run the local stdio MCP server that carries the `request` tool: one free routing decision per lookup, then the provider call, built here from the offer's spec and your assistant's input where it has one, under your local spend policy. It speaks on stdin and stdout and runs until the client disconnects, so it prints no envelope of its own."
3733
3733
  ).action(async function() {
3734
3734
  const ctx = buildContext2(this);
3735
- const { runRouterMcpServer } = await import("./mcp-KE5YKPS2.js");
3735
+ const { runRouterMcpServer } = await import("./mcp-JWOOSKLX.js");
3736
3736
  await runRouterMcpServer({ dataDir: ctx.dataDir, flags: ctx.flags });
3737
3737
  });
3738
3738
  leaf2(INTEGRATION, "status-line", "the live footer, for Claude Code's status line").description(
3739
3739
  "Print one line naming what this session is looking up right now: the provider actually being called, its bounded parameters, and what it cost. It reads Claude Code's status event on stdin for the session identity, reads that session's own progress records, writes nothing, and prints `x402 \xB7 ready` when this session has no activity. `tenjin install` registers it; you never run it by hand."
3740
3740
  ).action(async function() {
3741
3741
  const ctx = buildContext2(this);
3742
- const { runStatusLine } = await import("./status-line-CKRMGZ3Q.js");
3742
+ const { runStatusLine } = await import("./status-line-QRAO3Y2E.js");
3743
3743
  await runStatusLine(io, { dataDir: ctx.dataDir });
3744
3744
  });
3745
3745
  leaf2(SETUP, "status", "what this machine has spent, and what is still open").description(
3746
3746
  "Report the rolling 24h spend window from spend.json: what has settled, what is reserved by a request still in flight, and the per-call and per-day caps in force."
3747
3747
  ).action(async function() {
3748
3748
  await runCommand("status", this, async (ctx) => {
3749
- const { runRouterStatus } = await import("./status-3Z3YPRSE.js");
3749
+ const { runRouterStatus } = await import("./status-CEHZKHBU.js");
3750
3750
  return runRouterStatus(ctx);
3751
3751
  });
3752
3752
  });
@@ -3757,7 +3757,7 @@ function registerRouter(reg) {
3757
3757
  "For each paid lookup whose seller never confirmed settlement and whose authorization has expired, ask USDC on Base (through the configured rpcUrl) whether it was used: used means it was charged, unused means it never can be. Nothing is signed or sent but that one read."
3758
3758
  ).action(async function() {
3759
3759
  await runCommand("payments.reconcile", this, async (ctx) => {
3760
- const { runPaymentsReconcile } = await import("./payments-4D27K4L2.js");
3760
+ const { runPaymentsReconcile } = await import("./payments-26NVMFR2.js");
3761
3761
  return runPaymentsReconcile(ctx);
3762
3762
  });
3763
3763
  });
@@ -3907,4 +3907,4 @@ export {
3907
3907
  buildProgram,
3908
3908
  main
3909
3909
  };
3910
- //# sourceMappingURL=cli-7KJ4QLUU.js.map
3910
+ //# sourceMappingURL=cli-5WM56Y7K.js.map