tenjin-cli 0.1.0-alpha.30 → 0.1.0-alpha.31
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 +65 -116
- package/dist/{_esm-CE7KNONL.js → _esm-MEXZI5DL.js} +4 -4
- package/dist/{alive-3J3CHOQP.js → alive-J64H46HI.js} +14 -4
- package/dist/{chunk-O2FRQ2L2.js → chunk-27EPWVOY.js} +4 -64
- package/dist/chunk-27EPWVOY.js.map +1 -0
- package/dist/{chunk-OSYTBCUC.js → chunk-2XLC3AEX.js} +16 -14
- package/dist/{chunk-OSYTBCUC.js.map → chunk-2XLC3AEX.js.map} +1 -1
- package/dist/chunk-3623BLPV.js +184 -0
- package/dist/chunk-3623BLPV.js.map +1 -0
- package/dist/chunk-3UCIG4TG.js +65 -0
- package/dist/chunk-3UCIG4TG.js.map +1 -0
- package/dist/{chunk-PAYV4XUA.js → chunk-4ZZO6ULA.js} +2 -2
- package/dist/{chunk-VUFAK2LW.js → chunk-5C32RLTA.js} +2 -2
- package/dist/{chunk-VUFAK2LW.js.map → chunk-5C32RLTA.js.map} +1 -1
- package/dist/{chunk-YHKXNYTB.js → chunk-5K5W4S66.js} +2 -2
- package/dist/{chunk-3O2BQIF6.js → chunk-5MARFNSB.js} +273 -482
- package/dist/chunk-5MARFNSB.js.map +1 -0
- package/dist/{chunk-HPWO4O6S.js → chunk-6E5R45ZO.js} +2 -2
- package/dist/{chunk-JMM6YE7J.js → chunk-77TCKDEC.js} +125 -312
- package/dist/chunk-77TCKDEC.js.map +1 -0
- package/dist/{chunk-LFZJM56J.js → chunk-7Q5FDF65.js} +2 -2
- package/dist/chunk-7WEQQJLG.js +68 -0
- package/dist/chunk-7WEQQJLG.js.map +1 -0
- package/dist/{chunk-AWFUPKTM.js → chunk-7WU4OPLP.js} +12 -6
- package/dist/{chunk-AWFUPKTM.js.map → chunk-7WU4OPLP.js.map} +1 -1
- package/dist/{chunk-AEG2PXBP.js → chunk-7ZRL2LBQ.js} +3 -3
- package/dist/{chunk-IOODYAXL.js → chunk-AGZ7PJKY.js} +6 -4
- package/dist/{chunk-IOODYAXL.js.map → chunk-AGZ7PJKY.js.map} +1 -1
- package/dist/{chunk-VFMQTSXG.js → chunk-B7HUUJOK.js} +3 -3
- package/dist/{chunk-EL56RW2J.js → chunk-BL3332HQ.js} +7 -7
- package/dist/{chunk-5LJCEMFD.js → chunk-D65GNPS3.js} +35 -27
- package/dist/{chunk-5LJCEMFD.js.map → chunk-D65GNPS3.js.map} +1 -1
- package/dist/{chunk-P7LABKCW.js → chunk-DOQGNFHM.js} +33 -2
- package/dist/{chunk-P7LABKCW.js.map → chunk-DOQGNFHM.js.map} +1 -1
- package/dist/{chunk-OK2TDZQU.js → chunk-FW75G2W4.js} +7 -5
- package/dist/chunk-FW75G2W4.js.map +1 -0
- package/dist/chunk-GA7JETVM.js +150 -0
- package/dist/chunk-GA7JETVM.js.map +1 -0
- package/dist/{chunk-6W5GYG3W.js → chunk-I3EQFHCD.js} +48 -1
- package/dist/chunk-I3EQFHCD.js.map +1 -0
- package/dist/{chunk-EBVIKMCH.js → chunk-JKKAIPTU.js} +2 -2
- package/dist/{chunk-N35E6CM2.js → chunk-K3I7C2MO.js} +6 -6
- package/dist/{chunk-KYFZTGMC.js → chunk-K72RURN3.js} +5 -3
- package/dist/{chunk-KYFZTGMC.js.map → chunk-K72RURN3.js.map} +1 -1
- package/dist/{chunk-RAULEAZ6.js → chunk-KXQ4UIP7.js} +3 -3
- package/dist/{chunk-VZGAONSJ.js → chunk-KXVP2VKA.js} +5 -5
- package/dist/chunk-LEFIX6RS.js +100 -0
- package/dist/chunk-LEFIX6RS.js.map +1 -0
- package/dist/{chunk-TTBKWWTV.js → chunk-MNXS2U45.js} +246 -83
- package/dist/chunk-MNXS2U45.js.map +1 -0
- package/dist/{chunk-AWQPGIR6.js → chunk-NEFNKLBE.js} +5 -5
- package/dist/chunk-OHRR5OYM.js +63 -0
- package/dist/chunk-OHRR5OYM.js.map +1 -0
- package/dist/{chunk-U6YQ6FRI.js → chunk-P4NH7OUK.js} +31 -11
- package/dist/chunk-P4NH7OUK.js.map +1 -0
- package/dist/chunk-QSCPK4F5.js +145 -0
- package/dist/chunk-QSCPK4F5.js.map +1 -0
- package/dist/chunk-QXP3Z3JN.js +131 -0
- package/dist/chunk-QXP3Z3JN.js.map +1 -0
- package/dist/{chunk-YFQOA5AU.js → chunk-R5LCN54M.js} +4 -4
- package/dist/{chunk-KHE6L6TD.js → chunk-UKY4CHNC.js} +92 -10
- package/dist/chunk-UKY4CHNC.js.map +1 -0
- package/dist/{chunk-QUVVWYJW.js → chunk-UQUOVWBG.js} +8 -6
- package/dist/{chunk-QUVVWYJW.js.map → chunk-UQUOVWBG.js.map} +1 -1
- package/dist/{chunk-HE2MS4QO.js → chunk-V6BSF6OC.js} +17 -13
- package/dist/{chunk-HE2MS4QO.js.map → chunk-V6BSF6OC.js.map} +1 -1
- package/dist/{chunk-WVUSXNIE.js → chunk-WJXLQXJY.js} +6 -2
- package/dist/{chunk-WVUSXNIE.js.map → chunk-WJXLQXJY.js.map} +1 -1
- package/dist/{chunk-NZIP4PA2.js → chunk-WK7F3B2E.js} +2 -2
- package/dist/chunk-XQJXNMSB.js +23 -0
- package/dist/chunk-XQJXNMSB.js.map +1 -0
- package/dist/chunk-Y527D4TV.js +56 -0
- package/dist/chunk-Y527D4TV.js.map +1 -0
- package/dist/{chunk-SPAVAYSW.js → chunk-YFPY4ONH.js} +6 -4
- package/dist/{chunk-SPAVAYSW.js.map → chunk-YFPY4ONH.js.map} +1 -1
- package/dist/{chunk-WO5BJNIB.js → chunk-YVFXE7RR.js} +9 -129
- package/dist/chunk-YVFXE7RR.js.map +1 -0
- package/dist/clack-EZ7TDWQU.js +19 -0
- package/dist/claude-cli-2YKABJJZ.js +31 -0
- package/dist/{cli-O5SN7ZJ4.js → cli-D5OE3URZ.js} +128 -56
- package/dist/{cli-O5SN7ZJ4.js.map → cli-D5OE3URZ.js.map} +1 -1
- package/dist/codex-event-PPNVRRDH.js +16 -0
- package/dist/codex-host-2RJOJW2B.js +28 -0
- package/dist/codex-install-UUZ6QMBQ.js +221 -0
- package/dist/codex-install-UUZ6QMBQ.js.map +1 -0
- package/dist/{config-OJQI27LT.js → config-ZD4OB2DO.js} +18 -12
- package/dist/{doctor-IQQJHGGM.js → doctor-KBR34Q4B.js} +48 -37
- package/dist/doctor-KBR34Q4B.js.map +1 -0
- package/dist/{fund-WEV6DMTD.js → fund-5ITKQGYF.js} +38 -31
- package/dist/{fund-WEV6DMTD.js.map → fund-5ITKQGYF.js.map} +1 -1
- package/dist/hook-command-4TYCHHRL.js +39 -0
- package/dist/hosts/claude/.claude-plugin/marketplace.json +2 -2
- package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +3 -2
- package/dist/hosts/claude/tenjin/hooks/hooks.json +4 -1
- package/dist/hosts/claude/tenjin/hooks/register.tsx +589 -0
- package/dist/hosts/claude/tenjin/types/index.d.ts +41 -0
- package/dist/hosts/codex/.agents/plugins/marketplace.json +20 -0
- package/dist/hosts/codex/tenjin/.codex-plugin/plugin.json +16 -0
- package/dist/hosts/codex/tenjin/.mcp.json +12 -0
- package/dist/hosts/codex/tenjin/hooks/hooks.json +52 -0
- package/dist/hosts-FWZOV26H.js +216 -0
- package/dist/hosts-FWZOV26H.js.map +1 -0
- package/dist/index.js +5 -5
- package/dist/{install-TUCRF32I.js → install-XWGE4Q7L.js} +38 -21
- package/dist/{install-identity-WHPNMNMQ.js → install-identity-K7EJIQFP.js} +11 -7
- package/dist/{install-wallet-MA27FTQ5.js → install-wallet-XQ6XFZV4.js} +27 -23
- package/dist/{install-wallet-MA27FTQ5.js.map → install-wallet-XQ6XFZV4.js.map} +1 -1
- package/dist/{mcp-QML7ZMPH.js → mcp-3LIJSSJB.js} +184 -58
- package/dist/mcp-3LIJSSJB.js.map +1 -0
- package/dist/{package-LGKYOEPV.js → package-ZKQFDWLE.js} +2 -2
- package/dist/{pay-2C2UBBXJ.js → pay-WHBERZ3W.js} +27 -23
- package/dist/{payments-C44QUFXU.js → payments-KVICEKD2.js} +14 -10
- package/dist/{payments-C44QUFXU.js.map → payments-KVICEKD2.js.map} +1 -1
- package/dist/plugin-registration-5TIA564H.js +54 -0
- package/dist/plugin-registration-5TIA564H.js.map +1 -0
- package/dist/{send-KVJX4XIR.js → send-7G7Y7DLN.js} +25 -19
- package/dist/{send-KVJX4XIR.js.map → send-7G7Y7DLN.js.map} +1 -1
- package/dist/{status-S7C3WMSH.js → status-OF7RH5HM.js} +26 -21
- package/dist/{status-S7C3WMSH.js.map → status-OF7RH5HM.js.map} +1 -1
- package/dist/{status-line-YR2T5HC4.js → status-line-XOUE6MPL.js} +10 -6
- package/dist/{status-line-YR2T5HC4.js.map → status-line-XOUE6MPL.js.map} +1 -1
- package/dist/{uninstall-HY6LKIIT.js → uninstall-JXUAFNDB.js} +30 -21
- package/dist/{uninstall-HY6LKIIT.js.map → uninstall-JXUAFNDB.js.map} +1 -1
- package/dist/update-ZKUERSO2.js +44 -0
- package/dist/update-ZKUERSO2.js.map +1 -0
- package/dist/{usdc-JK4RRFFQ.js → usdc-OGOGEHV2.js} +7 -6
- package/dist/usdc-OGOGEHV2.js.map +1 -0
- package/dist/{viemAdapter-By13KInL-X2VY6CY3.js → viemAdapter-By13KInL-S3DA7DFW.js} +2 -2
- package/dist/viemAdapter-By13KInL-S3DA7DFW.js.map +1 -0
- package/dist/{wallet-PD2IMZDU.js → wallet-2HA6W4R4.js} +24 -20
- package/dist/wallet-2HA6W4R4.js.map +1 -0
- package/docs/agent-permissions.md +21 -5
- package/package.json +1 -1
- package/dist/chunk-3O2BQIF6.js.map +0 -1
- package/dist/chunk-6W5GYG3W.js.map +0 -1
- package/dist/chunk-JMM6YE7J.js.map +0 -1
- package/dist/chunk-KHE6L6TD.js.map +0 -1
- package/dist/chunk-O2FRQ2L2.js.map +0 -1
- package/dist/chunk-OK2TDZQU.js.map +0 -1
- package/dist/chunk-TTBKWWTV.js.map +0 -1
- package/dist/chunk-U6YQ6FRI.js.map +0 -1
- package/dist/chunk-WO5BJNIB.js.map +0 -1
- package/dist/doctor-IQQJHGGM.js.map +0 -1
- package/dist/hook-command-D2P3ILRV.js +0 -32
- package/dist/mcp-QML7ZMPH.js.map +0 -1
- package/dist/update-OJV22LR3.js +0 -36
- /package/dist/{_esm-CE7KNONL.js.map → _esm-MEXZI5DL.js.map} +0 -0
- /package/dist/{alive-3J3CHOQP.js.map → alive-J64H46HI.js.map} +0 -0
- /package/dist/{chunk-PAYV4XUA.js.map → chunk-4ZZO6ULA.js.map} +0 -0
- /package/dist/{chunk-YHKXNYTB.js.map → chunk-5K5W4S66.js.map} +0 -0
- /package/dist/{chunk-HPWO4O6S.js.map → chunk-6E5R45ZO.js.map} +0 -0
- /package/dist/{chunk-LFZJM56J.js.map → chunk-7Q5FDF65.js.map} +0 -0
- /package/dist/{chunk-AEG2PXBP.js.map → chunk-7ZRL2LBQ.js.map} +0 -0
- /package/dist/{chunk-VFMQTSXG.js.map → chunk-B7HUUJOK.js.map} +0 -0
- /package/dist/{chunk-EL56RW2J.js.map → chunk-BL3332HQ.js.map} +0 -0
- /package/dist/{chunk-EBVIKMCH.js.map → chunk-JKKAIPTU.js.map} +0 -0
- /package/dist/{chunk-N35E6CM2.js.map → chunk-K3I7C2MO.js.map} +0 -0
- /package/dist/{chunk-RAULEAZ6.js.map → chunk-KXQ4UIP7.js.map} +0 -0
- /package/dist/{chunk-VZGAONSJ.js.map → chunk-KXVP2VKA.js.map} +0 -0
- /package/dist/{chunk-AWQPGIR6.js.map → chunk-NEFNKLBE.js.map} +0 -0
- /package/dist/{chunk-YFQOA5AU.js.map → chunk-R5LCN54M.js.map} +0 -0
- /package/dist/{chunk-NZIP4PA2.js.map → chunk-WK7F3B2E.js.map} +0 -0
- /package/dist/{config-OJQI27LT.js.map → clack-EZ7TDWQU.js.map} +0 -0
- /package/dist/{hook-command-D2P3ILRV.js.map → claude-cli-2YKABJJZ.js.map} +0 -0
- /package/dist/{install-TUCRF32I.js.map → codex-event-PPNVRRDH.js.map} +0 -0
- /package/dist/{install-identity-WHPNMNMQ.js.map → codex-host-2RJOJW2B.js.map} +0 -0
- /package/dist/{package-LGKYOEPV.js.map → config-ZD4OB2DO.js.map} +0 -0
- /package/dist/{pay-2C2UBBXJ.js.map → hook-command-4TYCHHRL.js.map} +0 -0
- /package/dist/{update-OJV22LR3.js.map → install-XWGE4Q7L.js.map} +0 -0
- /package/dist/{usdc-JK4RRFFQ.js.map → install-identity-K7EJIQFP.js.map} +0 -0
- /package/dist/{viemAdapter-By13KInL-X2VY6CY3.js.map → package-ZKQFDWLE.js.map} +0 -0
- /package/dist/{wallet-PD2IMZDU.js.map → pay-WHBERZ3W.js.map} +0 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
AGENT_ID_RE
|
|
4
|
+
} from "./chunk-XKESD27X.js";
|
|
5
|
+
|
|
6
|
+
// src/hooks/constants.ts
|
|
7
|
+
var HARNESS_MS = 5e3;
|
|
8
|
+
var MAX_BODY_BYTES = 4 * 1024 * 1024;
|
|
9
|
+
var LOG_TRUNCATE_BYTES = 5 * 1024 * 1024;
|
|
10
|
+
var CONTEXT_MAX = 1e4;
|
|
11
|
+
|
|
12
|
+
// src/adapters/error-markers.ts
|
|
13
|
+
var ERROR_MARKERS = [
|
|
14
|
+
// Test-runner verdicts. Uppercase only, and a whole word.
|
|
15
|
+
/\bFAIL\b/,
|
|
16
|
+
/AssertionError/,
|
|
17
|
+
/\b[1-9]\d* (?:failed|failing|errors?)\b/i,
|
|
18
|
+
// `Error:`, `TypeError:`, `ReferenceError:`, `ModuleNotFoundError:` — the
|
|
19
|
+
// JS and Python convention of naming the class before the colon — and the
|
|
20
|
+
// lowercase `error:` that rustc, gcc, clang, esbuild and git open a
|
|
21
|
+
// diagnostic line with. Line-start only: "an error: occurred" mid-sentence
|
|
22
|
+
// is prose.
|
|
23
|
+
/^[ \t]*(?:\w*Error|error):/m,
|
|
24
|
+
/Traceback \(most recent call last\)/,
|
|
25
|
+
/ModuleNotFoundError|ImportError:/,
|
|
26
|
+
/Cannot find module/i,
|
|
27
|
+
// A code the shell or a runner states outright. Never zero.
|
|
28
|
+
/exit code [1-9]\d*/i,
|
|
29
|
+
// libuv/POSIX codes: unambiguous, and the common real failures.
|
|
30
|
+
/\b(?:ENOENT|EADDRINUSE|ECONNREFUSED|EACCES|EPERM)\b/,
|
|
31
|
+
// Toolchain-specific prefixes: npm, pnpm, tsc, cargo, go, git.
|
|
32
|
+
/^[ \t]*npm ERR!/m,
|
|
33
|
+
/ERR_PNPM_/,
|
|
34
|
+
/error TS\d+:/,
|
|
35
|
+
/^[ \t]*error\[E\d+\]/m,
|
|
36
|
+
/^[ \t]*panic:/m,
|
|
37
|
+
/^[ \t]*fatal:/m,
|
|
38
|
+
/Unhandled(?:PromiseRejection|Rejection)/,
|
|
39
|
+
/segmentation fault/i
|
|
40
|
+
];
|
|
41
|
+
function hasErrorMarker(text) {
|
|
42
|
+
return ERROR_MARKERS.some((re) => re.test(text));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/adapters/codex-wire.ts
|
|
46
|
+
var NATIVE_TO_EVENT = {
|
|
47
|
+
SessionStart: "session.start",
|
|
48
|
+
UserPromptSubmit: "prompt",
|
|
49
|
+
PreToolUse: "tool.before",
|
|
50
|
+
PostToolUse: "tool.after",
|
|
51
|
+
SubagentStart: "agent.start",
|
|
52
|
+
SubagentStop: "agent.stop",
|
|
53
|
+
Stop: "turn.end"
|
|
54
|
+
};
|
|
55
|
+
var SHELL_TOOL = "Bash";
|
|
56
|
+
var PATCH_TOOL = "apply_patch";
|
|
57
|
+
var BLOCK_EVENTS = /* @__PURE__ */ new Set(["turn.end", "agent.stop"]);
|
|
58
|
+
function isRecord(v) {
|
|
59
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
60
|
+
}
|
|
61
|
+
function str(v) {
|
|
62
|
+
return typeof v === "string" ? v : void 0;
|
|
63
|
+
}
|
|
64
|
+
var PATCH_PATH_RE = /^\*\*\* (?:Add File|Update File|Delete File|Move to): (.+)$/;
|
|
65
|
+
function patchPaths(patch) {
|
|
66
|
+
const out = [];
|
|
67
|
+
for (const line of patch.split("\n")) {
|
|
68
|
+
const m = PATCH_PATH_RE.exec(line.trimEnd());
|
|
69
|
+
const path = m?.[1]?.trim();
|
|
70
|
+
if (path !== void 0 && path.length > 0 && !out.includes(path)) out.push(path);
|
|
71
|
+
}
|
|
72
|
+
return out;
|
|
73
|
+
}
|
|
74
|
+
function canonicalTool(name, input) {
|
|
75
|
+
if (name === SHELL_TOOL) return { name, kind: "shell", command: str(input.command) ?? "" };
|
|
76
|
+
if (name === PATCH_TOOL)
|
|
77
|
+
return { name, kind: "edit", paths: patchPaths(str(input.command) ?? "") };
|
|
78
|
+
if (name === "webrun") {
|
|
79
|
+
const queries = input.search_query;
|
|
80
|
+
if (Object.keys(input).every((key) => key === "search_query" || key === "response_length") && Array.isArray(queries) && queries.length === 1 && isRecord(queries[0]) && Object.keys(queries[0]).every((key) => key === "q") && typeof queries[0].q === "string" && queries[0].q.trim().length > 0) {
|
|
81
|
+
return { name, kind: "web", query: queries[0].q };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return { name, kind: "other" };
|
|
85
|
+
}
|
|
86
|
+
var HTTP_URL_RE = /^https?:\/\//i;
|
|
87
|
+
var plainSearch = (v) => isRecord(v) && Object.keys(v).every((key) => key === "q") && typeof v.q === "string" && v.q.trim().length > 0;
|
|
88
|
+
var urlOpen = (v) => isRecord(v) && typeof v.ref_id === "string" && HTTP_URL_RE.test(v.ref_id.trim());
|
|
89
|
+
function splitWebrun(input) {
|
|
90
|
+
const searches = Array.isArray(input.search_query) ? input.search_query : [];
|
|
91
|
+
const opens = Array.isArray(input.open) ? input.open : [];
|
|
92
|
+
const s = searches.findIndex(plainSearch);
|
|
93
|
+
const o = s === -1 ? opens.findIndex((v) => urlOpen(v) && Object.keys(v).every((k) => k === "ref_id")) : -1;
|
|
94
|
+
if (s === -1 && o === -1) return null;
|
|
95
|
+
const key = s !== -1 ? "search_query" : "open";
|
|
96
|
+
const index = s !== -1 ? s : o;
|
|
97
|
+
const entry = s !== -1 ? { tool: "WebSearch", query: searches[s].q } : { tool: "WebFetch", url: opens[o].ref_id.trim() };
|
|
98
|
+
const rest = { ...input };
|
|
99
|
+
const left = (s !== -1 ? searches : opens).filter((_, i) => i !== index);
|
|
100
|
+
if (left.length === 0) delete rest[key];
|
|
101
|
+
else rest[key] = left;
|
|
102
|
+
const others = [
|
|
103
|
+
...searches.flatMap(
|
|
104
|
+
(v, i) => key === "search_query" && i === index ? [] : isRecord(v) && typeof v.q === "string" && v.q.trim().length > 0 ? [{ tool: "WebSearch", query: v.q }] : []
|
|
105
|
+
),
|
|
106
|
+
...opens.flatMap(
|
|
107
|
+
(v, i) => key === "open" && i === index || !urlOpen(v) ? [] : [{ tool: "WebFetch", url: v.ref_id.trim() }]
|
|
108
|
+
)
|
|
109
|
+
];
|
|
110
|
+
const operations = Object.keys(rest).filter((k) => k !== "response_length");
|
|
111
|
+
return { entry, rest: operations.length === 0 ? null : rest, targets: [entry, ...others] };
|
|
112
|
+
}
|
|
113
|
+
function decode(raw) {
|
|
114
|
+
if (!isRecord(raw)) return null;
|
|
115
|
+
const native = str(raw.hook_event_name);
|
|
116
|
+
if (native === void 0) return null;
|
|
117
|
+
const event = NATIVE_TO_EVENT[native];
|
|
118
|
+
if (event === void 0) return null;
|
|
119
|
+
const session = str(raw.session_id);
|
|
120
|
+
if (session === void 0 || session.length === 0) return null;
|
|
121
|
+
const input = {
|
|
122
|
+
harness: "codex",
|
|
123
|
+
event,
|
|
124
|
+
native: { event: native },
|
|
125
|
+
session,
|
|
126
|
+
cwd: str(raw.cwd) ?? "",
|
|
127
|
+
raw
|
|
128
|
+
};
|
|
129
|
+
if (raw.agent_id !== void 0 && raw.agent_id !== null) {
|
|
130
|
+
const id = raw.agent_id;
|
|
131
|
+
if (typeof id !== "string" || !AGENT_ID_RE.test(id)) return null;
|
|
132
|
+
input.agent = id;
|
|
133
|
+
}
|
|
134
|
+
const turn = str(raw.turn_id);
|
|
135
|
+
if (turn !== void 0) input.turn = turn;
|
|
136
|
+
const prompt = str(raw.prompt);
|
|
137
|
+
if (prompt !== void 0) input.prompt = prompt;
|
|
138
|
+
const agentType = str(raw.agent_type);
|
|
139
|
+
if (agentType !== void 0) input.agentType = agentType;
|
|
140
|
+
const lastMessage = str(raw.last_assistant_message);
|
|
141
|
+
if (lastMessage !== void 0) input.lastMessage = lastMessage;
|
|
142
|
+
if (typeof raw.stop_hook_active === "boolean") input.stopFuse = raw.stop_hook_active;
|
|
143
|
+
const source = str(raw.source);
|
|
144
|
+
if (source !== void 0) input.source = source;
|
|
145
|
+
const path = str(raw.transcript_path);
|
|
146
|
+
const agentPath = str(raw.agent_transcript_path);
|
|
147
|
+
if (path !== void 0 || agentPath !== void 0) {
|
|
148
|
+
input.transcript = {};
|
|
149
|
+
if (path !== void 0) input.transcript.path = path;
|
|
150
|
+
if (agentPath !== void 0) input.transcript.agentPath = agentPath;
|
|
151
|
+
}
|
|
152
|
+
if (event === "tool.before" || event === "tool.after") {
|
|
153
|
+
const name = str(raw.tool_name) ?? "";
|
|
154
|
+
const tool = canonicalTool(name, isRecord(raw.tool_input) ? raw.tool_input : {});
|
|
155
|
+
const callId = str(raw.tool_use_id);
|
|
156
|
+
if (callId !== void 0) tool.callId = callId;
|
|
157
|
+
if (event === "tool.after") {
|
|
158
|
+
const blocks = Array.isArray(raw.tool_response) ? raw.tool_response : void 0;
|
|
159
|
+
const text = str(raw.tool_response) ?? (blocks?.every((b) => isRecord(b) && b.type === "input_text" && typeof b.text === "string") ? blocks.map((b) => String(b.text)).join("\n") : void 0);
|
|
160
|
+
if (text !== void 0) tool.result = { text };
|
|
161
|
+
if (tool.kind === "shell" && text !== void 0 && hasErrorMarker(text)) tool.ok = false;
|
|
162
|
+
}
|
|
163
|
+
input.tool = tool;
|
|
164
|
+
}
|
|
165
|
+
return input;
|
|
166
|
+
}
|
|
167
|
+
function encode(emit, input) {
|
|
168
|
+
if (emit === null || emit.context === void 0 || emit.context.length === 0) return null;
|
|
169
|
+
const text = emit.context.slice(0, CONTEXT_MAX);
|
|
170
|
+
if (BLOCK_EVENTS.has(input.event)) return { decision: "block", reason: text };
|
|
171
|
+
return { hookSpecificOutput: { hookEventName: input.native.event, additionalContext: text } };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export {
|
|
175
|
+
HARNESS_MS,
|
|
176
|
+
CONTEXT_MAX,
|
|
177
|
+
hasErrorMarker,
|
|
178
|
+
SHELL_TOOL,
|
|
179
|
+
PATCH_TOOL,
|
|
180
|
+
splitWebrun,
|
|
181
|
+
decode,
|
|
182
|
+
encode
|
|
183
|
+
};
|
|
184
|
+
//# sourceMappingURL=chunk-3623BLPV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/constants.ts","../src/adapters/error-markers.ts","../src/adapters/codex-wire.ts"],"sourcesContent":["/**\n * THE KERNEL'S bounds: every number the lifecycle, the store, the daemon and the\n * shim use that is not one of the two config knobs (`loop.human_wait_ms`,\n * `loop.tool_wait_ms`), each with the reason it is a constant\n * (tenjin-notes loop-redesign/02-redesign.md §7).\n *\n * AN ARM's own bounds are not here and must not be moved here: they are evidence\n * about one arm's input — a prompt's junk rules, the head a skipped row stores,\n * the shelf's own query bound — and each is only readable next to the code and\n * the measurement that justifies it. They live in `hooks/question.ts`,\n * `hooks/text.ts`, `hooks/legs/shelf.ts` and the arm files, and every one\n * carries its reason there the way these do here.\n */\n\n/** Left on every fetch so the response can be encoded and flushed before the\n * fire's own deadline lands. */\nexport const RESERVE_MS = 150;\n\n/** The gap between a fire's deadline and the harness's own kill: encode, socket\n * write, and the harness's parse. */\nexport const SLACK_MS = 500;\n\n/**\n * The harness timeout `install` stamps on every entry, in ms. A backstop only:\n * the fire's own deadline (2500 or 4000) always lands first, and a hung daemon\n * costs a session this much per fire, never a stuck turn. Derived:\n * `tool_wait_ms + SLACK_MS = 4500 -> 5 s`.\n */\nexport const HARNESS_MS = 5000;\n\n/**\n * How long the shim polls `/health` after spawning a daemon. A minimal daemon\n * measured 75 to 120 ms cold on this laptop (03-decisions.md, \"Measured\"); the\n * smoke test re-measures the real bundle against this number.\n */\nexport const SPAWN_MS = 500;\n\n/** The shim's `GET /health` budget. Loopback answers in 1 to 2 ms; anything\n * slower is a daemon mid-exit or a foreign listener. */\nexport const HEALTH_MS = 200;\n\n/**\n * After a spawn that never became healthy, no shim spawns again for this long.\n * A corrupt `loop.db` or a half-written bundle must not cost every prompt a\n * spawn plus `SPAWN_MS`. The record is the mtime of an empty `daemon.spawn`\n * file; `tenjin doctor` reads it (PR E).\n */\nexport const SPAWN_BACKOFF_MS = 60_000;\n\n/** Ledger rows older than this are deleted at the daemon's idle exit. Matches\n * Claude Code's own transcript sweep default. */\nexport const RETENTION_DAYS = 30;\n\n/** And past this many `fires` rows the oldest go regardless of age: a bound for\n * a team on default-on, not for one laptop. */\nexport const FIRES_ROW_CAP = 50_000;\n\n/** Retention runs in batches of this many rows: node 24's `node:sqlite` lacks\n * `DELETE ... LIMIT`, so it is `WHERE id IN (SELECT ... LIMIT n)` looped. */\nexport const RETENTION_BATCH = 500;\n\n/** Retention at idle exit stops after this long so a successor daemon is never\n * refused the port for longer than a shim will wait. */\nexport const RETENTION_MAX_MS = 5000;\n\n/** A request handler whose synchronous span exceeds this logs a warning: the\n * daemon serves every session on the machine from one loop. */\nexport const IDLE_SYNC_WARN_MS = 20;\n\n/** Largest hook body the daemon reads. A `tool_response` or\n * `last_assistant_message` past this is 413 and a log line. */\nexport const MAX_BODY_BYTES = 4 * 1024 * 1024;\n\n/** `daemon.log` is truncated at daemon start once it passes this. No rotation:\n * the idle exit bounds a log's lifetime already. */\nexport const LOG_TRUNCATE_BYTES = 5 * 1024 * 1024;\n\n/** After the idle timer fires this much later than armed, the laptop slept:\n * re-arm for {@link SLEEP_REARM_MS} instead of exiting under a resumed turn. */\nexport const SLEEP_GRACE_MS = 60_000;\nexport const SLEEP_REARM_MS = 120_000;\n\n/** The daemon's `busy_timeout`: the CLI writes `loop.db` rarely and briefly, so\n * a busy wait this long only ever happens at a CLI write's tail. */\nexport const DAEMON_BUSY_TIMEOUT_MS = 2000;\n\n/** `server.requestTimeout` and `headersTimeout` for the daemon's listener. */\nexport const REQUEST_TIMEOUT_MS = 10_000;\nexport const HEADERS_TIMEOUT_MS = 5000;\n\n/** The derived port range: `30000 + hash % 2000` sits below Linux's default\n * ephemeral range (32768+) and below macOS/Windows's (49152+), so a transient\n * outbound socket can never squat it. */\nexport const PORT_BASE = 30_000;\nexport const PORT_SPAN = 2000;\n\n/** Claude Code caps `additionalContext` here; both encoders slice their context to it. */\nexport const CONTEXT_MAX = 10_000;\n\n/** How long `tenjin daemon stop` waits after SIGTERM before SIGKILL. */\nexport const STOP_GRACE_MS = 3000;\n","/**\n * What a Bash `PostToolUse` has to print to count as a failure\n * (13-pr-d-local-arms.md, decision 9). Claude Code raises `PostToolUseFailure`\n * only when the tool itself fails; a command that exits non-zero inside a pipe,\n * or a runner that prints its verdict and exits zero, arrives as a plain\n * `PostToolUse`. So the adapter scans stdout and stderr for a marker a real\n * toolchain emits, and `decode` sets `tool.ok` from it — the arm never reads\n * text to decide.\n *\n * Case-sensitive where the case IS the signal: `FAIL` is a vitest/jest/pytest\n * verdict, `fail` and `failed` are prose. The anchored patterns carry `m` so\n * they work on a whole stdout blob, and leading indentation is allowed because\n * runners indent their own output.\n */\nexport const ERROR_MARKERS: readonly RegExp[] = [\n // Test-runner verdicts. Uppercase only, and a whole word.\n /\\bFAIL\\b/,\n /AssertionError/,\n /\\b[1-9]\\d* (?:failed|failing|errors?)\\b/i,\n // `Error:`, `TypeError:`, `ReferenceError:`, `ModuleNotFoundError:` — the\n // JS and Python convention of naming the class before the colon — and the\n // lowercase `error:` that rustc, gcc, clang, esbuild and git open a\n // diagnostic line with. Line-start only: \"an error: occurred\" mid-sentence\n // is prose.\n /^[ \\t]*(?:\\w*Error|error):/m,\n /Traceback \\(most recent call last\\)/,\n /ModuleNotFoundError|ImportError:/,\n /Cannot find module/i,\n // A code the shell or a runner states outright. Never zero.\n /exit code [1-9]\\d*/i,\n // libuv/POSIX codes: unambiguous, and the common real failures.\n /\\b(?:ENOENT|EADDRINUSE|ECONNREFUSED|EACCES|EPERM)\\b/,\n // Toolchain-specific prefixes: npm, pnpm, tsc, cargo, go, git.\n /^[ \\t]*npm ERR!/m,\n /ERR_PNPM_/,\n /error TS\\d+:/,\n /^[ \\t]*error\\[E\\d+\\]/m,\n /^[ \\t]*panic:/m,\n /^[ \\t]*fatal:/m,\n /Unhandled(?:PromiseRejection|Rejection)/,\n /segmentation fault/i,\n];\n\n/** Whether `text` carries any marker above. The whole output, no bound: the\n * body is already bounded by the daemon's request cap and each pattern is one\n * linear scan. */\nexport function hasErrorMarker(text: string): boolean {\n return ERROR_MARKERS.some((re) => re.test(text));\n}\n","import { AGENT_ID_RE } from '../lib/grade';\nimport { CONTEXT_MAX } from '../hooks/constants';\nimport { hasErrorMarker } from './error-markers';\nimport type { Emit, Event, HookInput, HookTool } from './types';\n\n/**\n * Codex CLI as a harness. Every mapping here is backed by a payload the\n * installed `codex-cli 0.153.4` sent (`fixtures/codex/README.md`, captured\n * 2026-09-08); the schema source is openai/codex at `rust-v0.153.4`.\n *\n * What is NOT mapped, on purpose: the spawn tool (`collaborationspawn_agent`)\n * carries its task as opaque ciphertext, so there is no work order to look up\n * and no dispatch handoff; a shell PostToolUse carries no exit status, so a\n * failure is known only from an error marker and success is never known; the\n * web tool (`webrun`) maps to `web` only as one plain search, while the router\n * reads any `webrun` call through {@link splitWebrun}.\n * Other web operations stay `other`; unknown versions are reported by doctor,\n * not used to disable otherwise valid web events.\n */\n\nconst NATIVE_TO_EVENT: Record<string, Event> = {\n SessionStart: 'session.start',\n UserPromptSubmit: 'prompt',\n PreToolUse: 'tool.before',\n PostToolUse: 'tool.after',\n SubagentStart: 'agent.start',\n SubagentStop: 'agent.stop',\n Stop: 'turn.end',\n};\n\n/** The hook-facing tool names, spelled once for the decoder and the matchers. */\nexport const SHELL_TOOL = 'Bash';\nexport const PATCH_TOOL = 'apply_patch';\n\n/** The events whose only continuation is `decision: block`: their response\n * schema has no `hookSpecificOutput` at all (schema.rs, StopCommandOutputWire). */\nconst BLOCK_EVENTS: ReadonlySet<Event> = new Set<Event>(['turn.end', 'agent.stop']);\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === 'object' && v !== null && !Array.isArray(v);\n}\n\nfunction str(v: unknown): string | undefined {\n return typeof v === 'string' ? v : undefined;\n}\n\n/** `*** Add File: p`, `*** Update File: p`, `*** Delete File: p`, `*** Move to: q`. */\nconst PATCH_PATH_RE = /^\\*\\*\\* (?:Add File|Update File|Delete File|Move to): (.+)$/;\n\n/**\n * Every path an apply_patch names, in order, once each. The patch grammar is\n * the tool's own (apply-patch/src/parser.rs); a rename names both its source\n * and its target, because both were attempted work.\n */\nexport function patchPaths(patch: string): string[] {\n const out: string[] = [];\n for (const line of patch.split('\\n')) {\n const m = PATCH_PATH_RE.exec(line.trimEnd());\n const path = m?.[1]?.trim();\n if (path !== undefined && path.length > 0 && !out.includes(path)) out.push(path);\n }\n return out;\n}\n\nfunction canonicalTool(name: string, input: Record<string, unknown>): HookTool {\n if (name === SHELL_TOOL) return { name, kind: 'shell', command: str(input.command) ?? '' };\n if (name === PATCH_TOOL)\n return { name, kind: 'edit', paths: patchPaths(str(input.command) ?? '') };\n if (name === 'webrun') {\n const queries = input.search_query;\n // One complete, unfiltered operation only. Never deny a batch after\n // replacing its first member, or discard another operation/filter.\n if (\n Object.keys(input).every((key) => key === 'search_query' || key === 'response_length') &&\n Array.isArray(queries) &&\n queries.length === 1 &&\n isRecord(queries[0]) &&\n Object.keys(queries[0]).every((key) => key === 'q') &&\n typeof queries[0].q === 'string' &&\n queries[0].q.trim().length > 0\n ) {\n return { name, kind: 'web', query: queries[0].q };\n }\n }\n return { name, kind: 'other' };\n}\n\n/** One search or one page open, as the router weighs it. */\nexport type WebrunEntry = { tool: 'WebSearch'; query: string } | { tool: 'WebFetch'; url: string };\n\n/**\n * A `webrun` call as the router reads it: the one entry it weighs, the exact\n * rest of the call, and every search and URL in it.\n */\nexport interface WebrunSplit {\n entry: WebrunEntry;\n /** The input without the entry, filters and all; null when no operation remains. */\n rest: Record<string, unknown> | null;\n /** Every search and URL in the call, the entry first. */\n targets: WebrunEntry[];\n}\n\nconst HTTP_URL_RE = /^https?:\\/\\//i;\n\nconst plainSearch = (v: unknown): v is { q: string } =>\n isRecord(v) &&\n Object.keys(v).every((key) => key === 'q') &&\n typeof v.q === 'string' &&\n v.q.trim().length > 0;\n\nconst urlOpen = (v: unknown): v is { ref_id: string } =>\n isRecord(v) && typeof v.ref_id === 'string' && HTTP_URL_RE.test(v.ref_id.trim());\n\n/**\n * Pure. The entry is the first search that is only `q`, else the first open of\n * an http(s) URL with no `lineno`; null when the call holds neither. The rest\n * is the input minus that one entry, so entry plus rest is the whole call.\n */\nexport function splitWebrun(input: Record<string, unknown>): WebrunSplit | null {\n const searches = Array.isArray(input.search_query) ? (input.search_query as unknown[]) : [];\n const opens = Array.isArray(input.open) ? (input.open as unknown[]) : [];\n const s = searches.findIndex(plainSearch);\n const o =\n s === -1\n ? opens.findIndex((v) => urlOpen(v) && Object.keys(v as object).every((k) => k === 'ref_id'))\n : -1;\n if (s === -1 && o === -1) return null;\n const key = s !== -1 ? 'search_query' : 'open';\n const index = s !== -1 ? s : o;\n const entry: WebrunEntry =\n s !== -1\n ? { tool: 'WebSearch', query: (searches[s] as { q: string }).q }\n : { tool: 'WebFetch', url: (opens[o] as { ref_id: string }).ref_id.trim() };\n const rest: Record<string, unknown> = { ...input };\n const left = (s !== -1 ? searches : opens).filter((_, i) => i !== index);\n if (left.length === 0) delete rest[key];\n else rest[key] = left;\n const others: WebrunEntry[] = [\n ...searches.flatMap((v, i): WebrunEntry[] =>\n key === 'search_query' && i === index\n ? []\n : isRecord(v) && typeof v.q === 'string' && v.q.trim().length > 0\n ? [{ tool: 'WebSearch', query: v.q }]\n : [],\n ),\n ...opens.flatMap((v, i): WebrunEntry[] =>\n (key === 'open' && i === index) || !urlOpen(v)\n ? []\n : [{ tool: 'WebFetch', url: v.ref_id.trim() }],\n ),\n ];\n const operations = Object.keys(rest).filter((k) => k !== 'response_length');\n return { entry, rest: operations.length === 0 ? null : rest, targets: [entry, ...others] };\n}\n\n/**\n * Pure. Returns null for an unknown event, a missing session, or an `agent_id`\n * that is present but fails `AGENT_ID_RE`, exactly as the Claude adapter does:\n * a child this build cannot name is dropped rather than filed under the lead.\n */\nexport function decode(raw: unknown): HookInput | null {\n if (!isRecord(raw)) return null;\n const native = str(raw.hook_event_name);\n if (native === undefined) return null;\n const event = NATIVE_TO_EVENT[native];\n if (event === undefined) return null;\n const session = str(raw.session_id);\n if (session === undefined || session.length === 0) return null;\n\n const input: HookInput = {\n harness: 'codex',\n event,\n native: { event: native },\n session,\n cwd: str(raw.cwd) ?? '',\n raw,\n };\n if (raw.agent_id !== undefined && raw.agent_id !== null) {\n const id = raw.agent_id;\n if (typeof id !== 'string' || !AGENT_ID_RE.test(id)) return null;\n input.agent = id;\n }\n const turn = str(raw.turn_id);\n if (turn !== undefined) input.turn = turn;\n const prompt = str(raw.prompt);\n if (prompt !== undefined) input.prompt = prompt;\n const agentType = str(raw.agent_type);\n if (agentType !== undefined) input.agentType = agentType;\n const lastMessage = str(raw.last_assistant_message);\n if (lastMessage !== undefined) input.lastMessage = lastMessage;\n if (typeof raw.stop_hook_active === 'boolean') input.stopFuse = raw.stop_hook_active;\n const source = str(raw.source);\n if (source !== undefined) input.source = source;\n const path = str(raw.transcript_path);\n const agentPath = str(raw.agent_transcript_path);\n if (path !== undefined || agentPath !== undefined) {\n input.transcript = {};\n if (path !== undefined) input.transcript.path = path;\n if (agentPath !== undefined) input.transcript.agentPath = agentPath;\n }\n\n if (event === 'tool.before' || event === 'tool.after') {\n const name = str(raw.tool_name) ?? '';\n const tool = canonicalTool(name, isRecord(raw.tool_input) ? raw.tool_input : {});\n const callId = str(raw.tool_use_id);\n if (callId !== undefined) tool.callId = callId;\n if (event === 'tool.after') {\n // The response is the output text and nothing else: no exit status, on\n // a nonzero exit as much as on a clean one (PostToolUse-silent-exit).\n // So a marker is the only failure evidence, and its absence is unknown.\n const blocks = Array.isArray(raw.tool_response) ? raw.tool_response : undefined;\n const text =\n str(raw.tool_response) ??\n (blocks?.every((b) => isRecord(b) && b.type === 'input_text' && typeof b.text === 'string')\n ? blocks.map((b) => String((b as Record<string, unknown>).text)).join('\\n')\n : undefined);\n if (text !== undefined) tool.result = { text };\n if (tool.kind === 'shell' && text !== undefined && hasErrorMarker(text)) tool.ok = false;\n }\n input.tool = tool;\n }\n return input;\n}\n\n/**\n * Pure. `null` when there is nothing to say (the daemon answers 204).\n *\n * Two envelopes, because Codex has two: context beside the turn on prompt,\n * tool and start events, and on Stop/SubagentStop only `decision: block` with\n * the words as the `reason`, which the captured sessions show continues the\n * turn and trips `stop_hook_active` on the next stop. Both wire structs deny\n * unknown fields, so nothing else rides along.\n */\nexport function encode(emit: Emit | null, input: HookInput): unknown {\n if (emit === null || emit.context === undefined || emit.context.length === 0) return null;\n const text = emit.context.slice(0, CONTEXT_MAX);\n if (BLOCK_EVENTS.has(input.event)) return { decision: 'block', reason: text };\n return { hookSpecificOutput: { hookEventName: input.native.event, additionalContext: text } };\n}\n"],"mappings":";;;;;;AA4BO,IAAM,aAAa;AA2CnB,IAAM,iBAAiB,IAAI,OAAO;AAIlC,IAAM,qBAAqB,IAAI,OAAO;AAsBtC,IAAM,cAAc;;;ACnFpB,IAAM,gBAAmC;AAAA;AAAA,EAE9C;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AA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AAC/E,UAAM,SAAS,IAAI,IAAI,WAAW;AAClC,QAAI,WAAW,OAAW,MAAK,SAAS;AACxC,QAAI,UAAU,cAAc;AAI1B,YAAM,SAAS,MAAM,QAAQ,IAAI,aAAa,IAAI,IAAI,gBAAgB;AACtE,YAAM,OACJ,IAAI,IAAI,aAAa,MACpB,QAAQ,MAAM,CAAC,MAAM,SAAS,CAAC,KAAK,EAAE,SAAS,gBAAgB,OAAO,EAAE,SAAS,QAAQ,IACtF,OAAO,IAAI,CAAC,MAAM,OAAQ,EAA8B,IAAI,CAAC,EAAE,KAAK,IAAI,IACxE;AACN,UAAI,SAAS,OAAW,MAAK,SAAS,EAAE,KAAK;AAC7C,UAAI,KAAK,SAAS,WAAW,SAAS,UAAa,eAAe,IAAI,EAAG,MAAK,KAAK;AAAA,IACrF;AACA,UAAM,OAAO;AAAA,EACf;AACA,SAAO;AACT;AAWO,SAAS,OAAO,MAAmB,OAA2B;AACnE,MAAI,SAAS,QAAQ,KAAK,YAAY,UAAa,KAAK,QAAQ,WAAW,EAAG,QAAO;AACrF,QAAM,OAAO,KAAK,QAAQ,MAAM,GAAG,WAAW;AAC9C,MAAI,aAAa,IAAI,MAAM,KAAK,EAAG,QAAO,EAAE,UAAU,SAAS,QAAQ,KAAK;AAC5E,SAAO,EAAE,oBAAoB,EAAE,eAAe,MAAM,OAAO,OAAO,mBAAmB,KAAK,EAAE;AAC9F;","names":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/lib/errors.ts
|
|
4
|
+
var EXIT_BY_CODE = {
|
|
5
|
+
NODE_UNSUPPORTED: 1,
|
|
6
|
+
USAGE: 2,
|
|
7
|
+
CONFIG_INVALID: 2,
|
|
8
|
+
WALLET_EXISTS: 3,
|
|
9
|
+
WALLET_MISSING: 1,
|
|
10
|
+
WALLET_INVALID_KEY: 1,
|
|
11
|
+
PROVIDER_ERROR: 1,
|
|
12
|
+
RPC_ERROR: 1,
|
|
13
|
+
API_UNREACHABLE: 1,
|
|
14
|
+
CONTRACT_MISMATCH: 1,
|
|
15
|
+
REFUSED: 3,
|
|
16
|
+
NETWORK_ERROR: 1,
|
|
17
|
+
INTERNAL: 1,
|
|
18
|
+
NOT_IMPLEMENTED: 1,
|
|
19
|
+
POLICY_REFUSED: 3,
|
|
20
|
+
PAYMENT_FAILED: 4,
|
|
21
|
+
RESOURCE_NOT_FOUND: 1,
|
|
22
|
+
SEARCH_NOT_FOUND: 1,
|
|
23
|
+
RATE_LIMITED: 1,
|
|
24
|
+
// A publish awaiting confirmation or hard-blocked is understood-but-refused (3),
|
|
25
|
+
// the same posture as POLICY_REFUSED; a write that failed after approval is a
|
|
26
|
+
// settlement-class failure (4), like PAYMENT_FAILED.
|
|
27
|
+
NEEDS_CONFIRMATION: 3,
|
|
28
|
+
PUBLISH_BLOCKED: 3,
|
|
29
|
+
PUBLISH_FAILED: 4,
|
|
30
|
+
// A send that reverted or stalled AFTER the human approved it and it was
|
|
31
|
+
// broadcast: the post-decision failure class (4), like PAYMENT_FAILED.
|
|
32
|
+
SEND_FAILED: 4,
|
|
33
|
+
// A delete the operator confirmed and the server then refused: same class.
|
|
34
|
+
DELETE_FAILED: 4,
|
|
35
|
+
UPDATE_FAILED: 1,
|
|
36
|
+
// Refused BEFORE any signature existed: the Bazaar lane's fail-closed check.
|
|
37
|
+
REGISTRY_MISMATCH: 3,
|
|
38
|
+
// The seller's 402 challenge does not fit this process's header limit, so the
|
|
39
|
+
// terms could not be read and nothing was sent. Understood and refused (3),
|
|
40
|
+
// not a transport failure: the connection was fine and a retry changes
|
|
41
|
+
// nothing without an operator raising `--max-http-header-size`.
|
|
42
|
+
CHALLENGE_TOO_LARGE: 3
|
|
43
|
+
};
|
|
44
|
+
function exitCodeFor(code) {
|
|
45
|
+
return EXIT_BY_CODE[code];
|
|
46
|
+
}
|
|
47
|
+
var CliError = class extends Error {
|
|
48
|
+
code;
|
|
49
|
+
exitCode;
|
|
50
|
+
fix;
|
|
51
|
+
details;
|
|
52
|
+
constructor(code, message, opts = {}) {
|
|
53
|
+
super(message, opts.cause !== void 0 ? { cause: opts.cause } : void 0);
|
|
54
|
+
this.name = "CliError";
|
|
55
|
+
this.code = code;
|
|
56
|
+
this.exitCode = opts.exitCode ?? exitCodeFor(code);
|
|
57
|
+
this.fix = opts.fix;
|
|
58
|
+
this.details = opts.details;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export {
|
|
63
|
+
CliError
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=chunk-3UCIG4TG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/errors.ts"],"sourcesContent":["import type { ErrorCode } from '../schemas';\n\n/**\n * The process exit code is API (spec 10): 0 success, 1 runtime/network, 2 usage,\n * 3 understood-but-refused (policy refusal, publish confirmation/hard-block), 4 a\n * failure AFTER an approved spend or write (a settlement that failed, a publish\n * that failed post-consent).\n */\nexport type ExitCode = 1 | 2 | 3 | 4;\n\nexport interface CliErrorOptions {\n /** A copy-pasteable command or one-line remediation. */\n fix?: string;\n /** Structured detail for machine consumers; serialized into the envelope. */\n details?: unknown;\n /** Override the default exit code for this error's code. */\n exitCode?: ExitCode;\n /** Underlying cause, preserved on the Error but never serialized. */\n cause?: unknown;\n}\n\n/**\n * Default code -> exit-code mapping. USAGE/CONFIG_INVALID are malformed\n * invocations (2); WALLET_EXISTS/REFUSED are understood-but-refused (3);\n * everything else is a runtime/network failure (1). A CliError may override its\n * own exit code, but the table is the default every caller relies on.\n */\nconst EXIT_BY_CODE: Record<ErrorCode, ExitCode> = {\n NODE_UNSUPPORTED: 1,\n USAGE: 2,\n CONFIG_INVALID: 2,\n WALLET_EXISTS: 3,\n WALLET_MISSING: 1,\n WALLET_INVALID_KEY: 1,\n PROVIDER_ERROR: 1,\n RPC_ERROR: 1,\n API_UNREACHABLE: 1,\n CONTRACT_MISMATCH: 1,\n REFUSED: 3,\n NETWORK_ERROR: 1,\n INTERNAL: 1,\n NOT_IMPLEMENTED: 1,\n POLICY_REFUSED: 3,\n PAYMENT_FAILED: 4,\n RESOURCE_NOT_FOUND: 1,\n SEARCH_NOT_FOUND: 1,\n RATE_LIMITED: 1,\n // A publish awaiting confirmation or hard-blocked is understood-but-refused (3),\n // the same posture as POLICY_REFUSED; a write that failed after approval is a\n // settlement-class failure (4), like PAYMENT_FAILED.\n NEEDS_CONFIRMATION: 3,\n PUBLISH_BLOCKED: 3,\n PUBLISH_FAILED: 4,\n // A send that reverted or stalled AFTER the human approved it and it was\n // broadcast: the post-decision failure class (4), like PAYMENT_FAILED.\n SEND_FAILED: 4,\n // A delete the operator confirmed and the server then refused: same class.\n DELETE_FAILED: 4,\n UPDATE_FAILED: 1,\n // Refused BEFORE any signature existed: the Bazaar lane's fail-closed check.\n REGISTRY_MISMATCH: 3,\n // The seller's 402 challenge does not fit this process's header limit, so the\n // terms could not be read and nothing was sent. Understood and refused (3),\n // not a transport failure: the connection was fine and a retry changes\n // nothing without an operator raising `--max-http-header-size`.\n CHALLENGE_TOO_LARGE: 3,\n};\n\nexport function exitCodeFor(code: ErrorCode): ExitCode {\n return EXIT_BY_CODE[code];\n}\n\n/**\n * The one error type commands throw. It carries the machine `code`, the resolved\n * `exitCode`, and an optional `fix`/`details` that flow straight into the failure\n * envelope. Commands throw it; the CLI dispatcher catches, serializes, and exits.\n */\nexport class CliError extends Error {\n readonly code: ErrorCode;\n readonly exitCode: ExitCode;\n readonly fix?: string;\n readonly details?: unknown;\n\n constructor(code: ErrorCode, message: string, opts: CliErrorOptions = {}) {\n super(message, opts.cause !== undefined ? { cause: opts.cause } : undefined);\n this.name = 'CliError';\n this.code = code;\n this.exitCode = opts.exitCode ?? exitCodeFor(code);\n this.fix = opts.fix;\n this.details = opts.details;\n }\n}\n"],"mappings":";;;AA2BA,IAAM,eAA4C;AAAA,EAChD,kBAAkB;AAAA,EAClB,OAAO;AAAA,EACP,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,eAAe;AAAA,EACf,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,cAAc;AAAA;AAAA;AAAA;AAAA,EAId,oBAAoB;AAAA,EACpB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA;AAAA;AAAA,EAGhB,aAAa;AAAA;AAAA,EAEb,eAAe;AAAA,EACf,eAAe;AAAA;AAAA,EAEf,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKnB,qBAAqB;AACvB;AAEO,SAAS,YAAY,MAA2B;AACrD,SAAO,aAAa,IAAI;AAC1B;AAOO,IAAM,WAAN,cAAuB,MAAM;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,MAAiB,SAAiB,OAAwB,CAAC,GAAG;AACxE,UAAM,SAAS,KAAK,UAAU,SAAY,EAAE,OAAO,KAAK,MAAM,IAAI,MAAS;AAC3E,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,WAAW,KAAK,YAAY,YAAY,IAAI;AACjD,SAAK,MAAM,KAAK;AAChB,SAAK,UAAU,KAAK;AAAA,EACtB;AACF;","names":[]}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-2I4QTOLB.js";
|
|
8
8
|
import {
|
|
9
9
|
formatUsdDisplay
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Y527D4TV.js";
|
|
11
11
|
|
|
12
12
|
// src/router/fee.ts
|
|
13
13
|
import { createHash } from "node:crypto";
|
|
@@ -148,4 +148,4 @@ export {
|
|
|
148
148
|
usd,
|
|
149
149
|
firstNoticeFor
|
|
150
150
|
};
|
|
151
|
-
//# sourceMappingURL=chunk-
|
|
151
|
+
//# sourceMappingURL=chunk-4ZZO6ULA.js.map
|
|
@@ -2,7 +2,7 @@ import { createRequire as __tenjinCreateRequire } from 'node:module'; const requ
|
|
|
2
2
|
|
|
3
3
|
// package.json
|
|
4
4
|
var name = "tenjin-cli";
|
|
5
|
-
var version = "0.1.0-alpha.
|
|
5
|
+
var version = "0.1.0-alpha.31";
|
|
6
6
|
var type = "module";
|
|
7
7
|
var description = "The tool router for coding agents. Tenjin picks the right tool when your agent needs one, and one wallet pays for every call.";
|
|
8
8
|
var repository = {
|
|
@@ -112,4 +112,4 @@ export {
|
|
|
112
112
|
devDependencies,
|
|
113
113
|
package_default
|
|
114
114
|
};
|
|
115
|
-
//# sourceMappingURL=chunk-
|
|
115
|
+
//# sourceMappingURL=chunk-5C32RLTA.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.31\",\n \"type\": \"module\",\n \"description\": \"The tool router for coding agents. Tenjin picks the right tool when your agent needs one, and one wallet pays for every call.\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/BackTrackCo/tenjin-agent.git\"\n },\n \"homepage\": \"https://tenjin.sh/agents\",\n \"bugs\": \"https://github.com/BackTrackCo/tenjin-agent/issues\",\n \"keywords\": [\n \"claude-code\",\n \"coding-agents\",\n \"tool-router\",\n \"ai-agents\",\n \"agent-tools\",\n \"mcp\",\n \"x402\",\n \"usdc\",\n \"base\",\n \"micropayments\",\n \"agent-payments\",\n \"claude\",\n \"codex\",\n \"cli\"\n ],\n \"bin\": {\n \"tenjin\": \"dist/index.js\"\n },\n \"engines\": {\n \"node\": \">=22.0.0\"\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\": \"^3.0.3\",\n \"@clack/prompts\": \"^1.7.0\",\n \"@eslint/js\": \"^10\",\n \"@modelcontextprotocol/sdk\": \"1.32.0\",\n \"@types/node\": \"^22.20.5\",\n \"@x402/core\": \"2.28.0\",\n \"@x402/evm\": \"2.28.0\",\n \"@x402/extensions\": \"2.28.0\",\n \"@x402/fetch\": \"2.28.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 \"lean-qr\": \"^2.7.4\",\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":";;;AACE,WAAQ;AACR,cAAW;AACX,WAAQ;AACR,kBAAe;AACf,iBAAc;AAAA,EACZ,MAAQ;AAAA,EACR,KAAO;AACT;AACA,eAAY;AACZ,WAAQ;AACR,eAAY;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACA,UAAO;AAAA,EACL,QAAU;AACZ;AACA,cAAW;AAAA,EACT,MAAQ;AACV;AACA,YAAS;AAAA,EACP;AAAA,EACA;AAAA,EACA;AACF;AACA,qBAAkB;AAClB,cAAW;AAAA,EACT,OAAS;AAAA,EACT,MAAQ;AAAA,EACR,WAAa;AAAA,EACb,MAAQ;AAAA,EACR,QAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,OAAS;AAAA,EACT,cAAc;AAAA,EACd,cAAc;AAAA,EACd,WAAa;AAAA,EACb,gBAAkB;AAAA,EAClB,UAAY;AACd;AACA,sBAAmB;AAAA,EACjB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,6BAA6B;AAAA,EAC7B,eAAe;AAAA,EACf,cAAc;AAAA,EACd,aAAa;AAAA,EACb,oBAAoB;AAAA,EACpB,eAAe;AAAA,EACf,KAAO;AAAA,EACP,eAAe;AAAA,EACf,WAAa;AAAA,EACb,QAAU;AAAA,EACV,0BAA0B;AAAA,EAC1B,WAAW;AAAA,EACX,IAAM;AAAA,EACN,UAAY;AAAA,EACZ,MAAQ;AAAA,EACR,YAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,MAAQ;AAAA,EACR,QAAU;AAAA,EACV,KAAO;AACT;AA7EF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EAgBA;AAAA,EAGA;AAAA,EAGA;AAAA,EAKA;AAAA,EACA;AAAA,EAcA;AAyBF;","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
|
normalizeChannelId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7Q5FDF65.js";
|
|
5
5
|
|
|
6
6
|
// node_modules/.pnpm/@x402+evm@2.28.0_typescript@6.0.3/node_modules/@x402/evm/dist/esm/chunk-3632HGL3.mjs
|
|
7
7
|
import { mkdir, readFile, rename, unlink, writeFile } from "fs/promises";
|
|
@@ -102,4 +102,4 @@ var FileClientChannelStorage = class {
|
|
|
102
102
|
export {
|
|
103
103
|
FileClientChannelStorage
|
|
104
104
|
};
|
|
105
|
-
//# sourceMappingURL=chunk-
|
|
105
|
+
//# sourceMappingURL=chunk-5K5W4S66.js.map
|