observability-toolkit-hooks 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hook-runner.js +1 -1
- package/dist/lib/core/config-dir-recovery.js +2 -2
- package/dist/lib/core/constants.js +3 -1
- package/dist/lib/core/load-envrc.js +3 -4
- package/dist/runner/{agent-context-4XTCLMLZ.js → agent-context-4HKRF6ZJ.js} +4 -4
- package/dist/runner/{agent-file-budget-Q33ESBBE.js → agent-file-budget-MGYZEBEW.js} +3 -3
- package/dist/runner/{agent-transcript-metrics-W5CZZFMI.js → agent-transcript-metrics-56XNPBWS.js} +5 -5
- package/dist/runner/{chunk-UW3GQZSM.js → chunk-2PQCUHOU.js} +3 -3
- package/dist/runner/{chunk-DGB4NSSD.js → chunk-2XKE4E7E.js} +6 -6
- package/dist/runner/{chunk-LHWRXY2G.js → chunk-2YXDQERF.js} +3 -3
- package/dist/runner/{chunk-4KWBQTTG.js → chunk-34O6HVAQ.js} +2 -2
- package/dist/runner/{chunk-M4R4QIQH.js → chunk-3DZNNATE.js} +2 -2
- package/dist/runner/{chunk-XSO3B4QN.js → chunk-3IC2KNJ4.js} +3 -3
- package/dist/runner/{chunk-LYY6RCIE.js → chunk-5GJLO6EX.js} +3 -3
- package/dist/runner/{chunk-C3WHUMU5.js → chunk-67K2WTSP.js} +6 -6
- package/dist/runner/{chunk-IY7AP7NA.js → chunk-6QFGAAUD.js} +3 -3
- package/dist/runner/{chunk-AGSGKELQ.js → chunk-6RSOKWNG.js} +4 -4
- package/dist/runner/{chunk-YGFN3LN2.js → chunk-BOZSNQGU.js} +2 -2
- package/dist/runner/{chunk-WU7ANGCW.js → chunk-C3NW5R45.js} +4 -4
- package/dist/runner/{chunk-2NTNAJZE.js → chunk-D626UD7P.js} +3 -3
- package/dist/runner/{chunk-GG2I4TGI.js → chunk-E3YCQK2D.js} +12 -27
- package/dist/runner/{chunk-GG2I4TGI.js.map → chunk-E3YCQK2D.js.map} +4 -4
- package/dist/runner/{chunk-PJHWHJ3K.js → chunk-EAA5QNOB.js} +4 -4
- package/dist/runner/{chunk-MC75VXMX.js → chunk-EZL3KMMB.js} +5 -5
- package/dist/runner/{chunk-LBCZAYFR.js → chunk-H4M6YEDJ.js} +3 -3
- package/dist/runner/{chunk-VVGOPPEN.js → chunk-JJHQOX5Q.js} +3 -3
- package/dist/runner/{chunk-DNSTWC26.js → chunk-LFCMGDJC.js} +2 -2
- package/dist/runner/{chunk-KGSA5JYP.js → chunk-LK6UFBC5.js} +3 -3
- package/dist/runner/{chunk-52RY6LQT.js → chunk-N6435YLW.js} +26 -9
- package/dist/runner/chunk-N6435YLW.js.map +7 -0
- package/dist/runner/{chunk-JRNNLOPR.js → chunk-OJWQCABS.js} +4 -4
- package/dist/runner/{chunk-VOV4Y5VU.js → chunk-OWXBKC5K.js} +6 -6
- package/dist/runner/{chunk-WJHNCOUF.js → chunk-PPDN7VWX.js} +3 -3
- package/dist/runner/{chunk-7OM5CYES.js → chunk-QD52DSVB.js} +7 -9
- package/dist/runner/chunk-QD52DSVB.js.map +7 -0
- package/dist/runner/{chunk-FDJJ3TYU.js → chunk-QESRH3ED.js} +7 -7
- package/dist/runner/{chunk-UEXDE3WP.js → chunk-S2B2J6ZB.js} +5 -5
- package/dist/runner/{chunk-LQ2LGUYJ.js → chunk-SA4ZNI3N.js} +2 -2
- package/dist/runner/{chunk-I7TD2QVR.js → chunk-SGL5GFKY.js} +3 -3
- package/dist/runner/{chunk-X7XLMSZX.js → chunk-VAX5JACX.js} +2 -2
- package/dist/runner/{chunk-NKZU4RRG.js → chunk-WVVJE7ZI.js} +2 -2
- package/dist/runner/{chunk-RIGVYJ2O.js → chunk-XFKV6REH.js} +4 -4
- package/dist/runner/{chunk-TRMFD36J.js → chunk-XYINMMHR.js} +3 -3
- package/dist/runner/{chunk-J3F3Z3EQ.js → chunk-YDN63WUY.js} +5 -5
- package/dist/runner/{chunk-V2GSP6VR.js → chunk-YZDEUJOZ.js} +3 -3
- package/dist/runner/{chunk-SRMAJQMV.js → chunk-ZCZUJKZD.js} +2 -2
- package/dist/runner/{chunk-VT5T6OEI.js → chunk-ZEYUSIMT.js} +3 -3
- package/dist/runner/{chunk-FGKYDQHZ.js → chunk-ZHCBXQ5O.js} +6 -6
- package/dist/runner/{compact-36NP3PKT.js → compact-PH4S4MIT.js} +7 -7
- package/dist/runner/{git-commit-BA53DOJQ.js → git-commit-67MX3SQY.js} +7 -7
- package/dist/runner/{hook-runner-JHH6PGKE.js → hook-runner-O345UBIB.js} +25 -26
- package/dist/runner/{hook-runner-JHH6PGKE.js.map → hook-runner-O345UBIB.js.map} +1 -1
- package/dist/runner/{mcp-status-QEUH2KGX.js → mcp-status-XWMUEEAB.js} +11 -11
- package/dist/runner/{notification-FKMBCSXF.js → notification-3WY33IIL.js} +8 -8
- package/dist/runner/{post-tool-3MRHTBKH.js → post-tool-AIQSU3VH.js} +28 -28
- package/dist/runner/{post-tool-agent-BB34MNHI.js → post-tool-agent-O3U4FP2R.js} +15 -15
- package/dist/runner/{post-tool-changelog-sync-OP2TT2I7.js → post-tool-changelog-sync-EZSRRRDR.js} +9 -9
- package/dist/runner/{post-tool-code-structure-LE7J2SC2.js → post-tool-code-structure-TERICHXZ.js} +9 -9
- package/dist/runner/{post-tool-edit-ledger-IJMEYHKF.js → post-tool-edit-ledger-B7QKW2UY.js} +7 -7
- package/dist/runner/{post-tool-failure-XTH2I2Z7.js → post-tool-failure-GDKD57FZ.js} +15 -15
- package/dist/runner/{post-tool-git-E46HZGZO.js → post-tool-git-GGHJFPBQ.js} +11 -11
- package/dist/runner/{post-tool-mcp-AMCDY5GH.js → post-tool-mcp-GH7MQJHG.js} +15 -15
- package/dist/runner/{post-tool-task-state-TLDOI33H.js → post-tool-task-state-PNE63AUM.js} +10 -10
- package/dist/runner/{pre-tool-SQE2FZQO.js → pre-tool-6UBCNWIJ.js} +18 -18
- package/dist/runner/{pre-tool-agent-OZUPVFUI.js → pre-tool-agent-CBX55CM6.js} +16 -16
- package/dist/runner/{quality-evaluator-XYNDKDRG.js → quality-evaluator-SPT3LTR6.js} +19 -19
- package/dist/runner/{session-end-3MJTDLLA.js → session-end-NQ7HY5C2.js} +10 -10
- package/dist/runner/{session-start-5ZMCLKBS.js → session-start-EPMNSIX6.js} +18 -18
- package/dist/runner/{shipper-status-MADX6SPG.js → shipper-status-FLIPBYTK.js} +3 -3
- package/dist/runner/{span-shipper-4HQDHC47.js → span-shipper-H6XGJPUR.js} +7 -7
- package/dist/runner/{stop-RTKSIYJV.js → stop-3WZ3HHMG.js} +24 -24
- package/dist/runner/{subagent-CBCG4OLZ.js → subagent-GU56QFXI.js} +12 -12
- package/dist/runner/{token-metrics-AD2RAFGM.js → token-metrics-3KQXGOYX.js} +10 -10
- package/dist/runner/{user-prompt-T5NZ2UJD.js → user-prompt-RV3N24AN.js} +15 -15
- package/package.json +1 -1
- package/dist/runner/chunk-52RY6LQT.js.map +0 -7
- package/dist/runner/chunk-7OM5CYES.js.map +0 -7
- /package/dist/runner/{agent-context-4XTCLMLZ.js.map → agent-context-4HKRF6ZJ.js.map} +0 -0
- /package/dist/runner/{agent-file-budget-Q33ESBBE.js.map → agent-file-budget-MGYZEBEW.js.map} +0 -0
- /package/dist/runner/{agent-transcript-metrics-W5CZZFMI.js.map → agent-transcript-metrics-56XNPBWS.js.map} +0 -0
- /package/dist/runner/{chunk-UW3GQZSM.js.map → chunk-2PQCUHOU.js.map} +0 -0
- /package/dist/runner/{chunk-DGB4NSSD.js.map → chunk-2XKE4E7E.js.map} +0 -0
- /package/dist/runner/{chunk-LHWRXY2G.js.map → chunk-2YXDQERF.js.map} +0 -0
- /package/dist/runner/{chunk-4KWBQTTG.js.map → chunk-34O6HVAQ.js.map} +0 -0
- /package/dist/runner/{chunk-M4R4QIQH.js.map → chunk-3DZNNATE.js.map} +0 -0
- /package/dist/runner/{chunk-XSO3B4QN.js.map → chunk-3IC2KNJ4.js.map} +0 -0
- /package/dist/runner/{chunk-LYY6RCIE.js.map → chunk-5GJLO6EX.js.map} +0 -0
- /package/dist/runner/{chunk-C3WHUMU5.js.map → chunk-67K2WTSP.js.map} +0 -0
- /package/dist/runner/{chunk-IY7AP7NA.js.map → chunk-6QFGAAUD.js.map} +0 -0
- /package/dist/runner/{chunk-AGSGKELQ.js.map → chunk-6RSOKWNG.js.map} +0 -0
- /package/dist/runner/{chunk-YGFN3LN2.js.map → chunk-BOZSNQGU.js.map} +0 -0
- /package/dist/runner/{chunk-WU7ANGCW.js.map → chunk-C3NW5R45.js.map} +0 -0
- /package/dist/runner/{chunk-2NTNAJZE.js.map → chunk-D626UD7P.js.map} +0 -0
- /package/dist/runner/{chunk-PJHWHJ3K.js.map → chunk-EAA5QNOB.js.map} +0 -0
- /package/dist/runner/{chunk-MC75VXMX.js.map → chunk-EZL3KMMB.js.map} +0 -0
- /package/dist/runner/{chunk-LBCZAYFR.js.map → chunk-H4M6YEDJ.js.map} +0 -0
- /package/dist/runner/{chunk-VVGOPPEN.js.map → chunk-JJHQOX5Q.js.map} +0 -0
- /package/dist/runner/{chunk-DNSTWC26.js.map → chunk-LFCMGDJC.js.map} +0 -0
- /package/dist/runner/{chunk-KGSA5JYP.js.map → chunk-LK6UFBC5.js.map} +0 -0
- /package/dist/runner/{chunk-JRNNLOPR.js.map → chunk-OJWQCABS.js.map} +0 -0
- /package/dist/runner/{chunk-VOV4Y5VU.js.map → chunk-OWXBKC5K.js.map} +0 -0
- /package/dist/runner/{chunk-WJHNCOUF.js.map → chunk-PPDN7VWX.js.map} +0 -0
- /package/dist/runner/{chunk-FDJJ3TYU.js.map → chunk-QESRH3ED.js.map} +0 -0
- /package/dist/runner/{chunk-UEXDE3WP.js.map → chunk-S2B2J6ZB.js.map} +0 -0
- /package/dist/runner/{chunk-LQ2LGUYJ.js.map → chunk-SA4ZNI3N.js.map} +0 -0
- /package/dist/runner/{chunk-I7TD2QVR.js.map → chunk-SGL5GFKY.js.map} +0 -0
- /package/dist/runner/{chunk-X7XLMSZX.js.map → chunk-VAX5JACX.js.map} +0 -0
- /package/dist/runner/{chunk-NKZU4RRG.js.map → chunk-WVVJE7ZI.js.map} +0 -0
- /package/dist/runner/{chunk-RIGVYJ2O.js.map → chunk-XFKV6REH.js.map} +0 -0
- /package/dist/runner/{chunk-TRMFD36J.js.map → chunk-XYINMMHR.js.map} +0 -0
- /package/dist/runner/{chunk-J3F3Z3EQ.js.map → chunk-YDN63WUY.js.map} +0 -0
- /package/dist/runner/{chunk-V2GSP6VR.js.map → chunk-YZDEUJOZ.js.map} +0 -0
- /package/dist/runner/{chunk-SRMAJQMV.js.map → chunk-ZCZUJKZD.js.map} +0 -0
- /package/dist/runner/{chunk-VT5T6OEI.js.map → chunk-ZEYUSIMT.js.map} +0 -0
- /package/dist/runner/{chunk-FGKYDQHZ.js.map → chunk-ZHCBXQ5O.js.map} +0 -0
- /package/dist/runner/{compact-36NP3PKT.js.map → compact-PH4S4MIT.js.map} +0 -0
- /package/dist/runner/{git-commit-BA53DOJQ.js.map → git-commit-67MX3SQY.js.map} +0 -0
- /package/dist/runner/{mcp-status-QEUH2KGX.js.map → mcp-status-XWMUEEAB.js.map} +0 -0
- /package/dist/runner/{notification-FKMBCSXF.js.map → notification-3WY33IIL.js.map} +0 -0
- /package/dist/runner/{post-tool-3MRHTBKH.js.map → post-tool-AIQSU3VH.js.map} +0 -0
- /package/dist/runner/{post-tool-agent-BB34MNHI.js.map → post-tool-agent-O3U4FP2R.js.map} +0 -0
- /package/dist/runner/{post-tool-changelog-sync-OP2TT2I7.js.map → post-tool-changelog-sync-EZSRRRDR.js.map} +0 -0
- /package/dist/runner/{post-tool-code-structure-LE7J2SC2.js.map → post-tool-code-structure-TERICHXZ.js.map} +0 -0
- /package/dist/runner/{post-tool-edit-ledger-IJMEYHKF.js.map → post-tool-edit-ledger-B7QKW2UY.js.map} +0 -0
- /package/dist/runner/{post-tool-failure-XTH2I2Z7.js.map → post-tool-failure-GDKD57FZ.js.map} +0 -0
- /package/dist/runner/{post-tool-git-E46HZGZO.js.map → post-tool-git-GGHJFPBQ.js.map} +0 -0
- /package/dist/runner/{post-tool-mcp-AMCDY5GH.js.map → post-tool-mcp-GH7MQJHG.js.map} +0 -0
- /package/dist/runner/{post-tool-task-state-TLDOI33H.js.map → post-tool-task-state-PNE63AUM.js.map} +0 -0
- /package/dist/runner/{pre-tool-SQE2FZQO.js.map → pre-tool-6UBCNWIJ.js.map} +0 -0
- /package/dist/runner/{pre-tool-agent-OZUPVFUI.js.map → pre-tool-agent-CBX55CM6.js.map} +0 -0
- /package/dist/runner/{quality-evaluator-XYNDKDRG.js.map → quality-evaluator-SPT3LTR6.js.map} +0 -0
- /package/dist/runner/{session-end-3MJTDLLA.js.map → session-end-NQ7HY5C2.js.map} +0 -0
- /package/dist/runner/{session-start-5ZMCLKBS.js.map → session-start-EPMNSIX6.js.map} +0 -0
- /package/dist/runner/{shipper-status-MADX6SPG.js.map → shipper-status-FLIPBYTK.js.map} +0 -0
- /package/dist/runner/{span-shipper-4HQDHC47.js.map → span-shipper-H6XGJPUR.js.map} +0 -0
- /package/dist/runner/{stop-RTKSIYJV.js.map → stop-3WZ3HHMG.js.map} +0 -0
- /package/dist/runner/{subagent-CBCG4OLZ.js.map → subagent-GU56QFXI.js.map} +0 -0
- /package/dist/runner/{token-metrics-AD2RAFGM.js.map → token-metrics-3KQXGOYX.js.map} +0 -0
- /package/dist/runner/{user-prompt-T5NZ2UJD.js.map → user-prompt-RV3N24AN.js.map} +0 -0
|
@@ -2,17 +2,17 @@ import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
contextWindowForModel
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3IC2KNJ4.js";
|
|
6
6
|
import {
|
|
7
7
|
CONVERSATION_RECORD_TYPES,
|
|
8
8
|
fieldMarkers,
|
|
9
9
|
promptTokens,
|
|
10
10
|
responseUsage,
|
|
11
11
|
usageCounts
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-34O6HVAQ.js";
|
|
13
13
|
import {
|
|
14
14
|
findTranscriptPath
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SA4ZNI3N.js";
|
|
16
16
|
import {
|
|
17
17
|
CONTEXT_ATTRIBUTES,
|
|
18
18
|
SESSION_ATTRIBUTES,
|
|
@@ -20,11 +20,11 @@ import {
|
|
|
20
20
|
initTelemetry,
|
|
21
21
|
recordCounter,
|
|
22
22
|
recordMetric
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-QD52DSVB.js";
|
|
24
24
|
import {
|
|
25
25
|
resumeOffset,
|
|
26
26
|
transcriptCheckpointStore
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-LFCMGDJC.js";
|
|
28
28
|
import {
|
|
29
29
|
CLAUDE_HOME,
|
|
30
30
|
SYNTHETIC_MODEL,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
utcDateStamp,
|
|
45
45
|
withFileLock,
|
|
46
46
|
writeJsonAtomic
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-N6435YLW.js";
|
|
48
48
|
import {
|
|
49
49
|
PERCENT_PER_UNIT,
|
|
50
50
|
TENTHS_PER_UNIT,
|
|
@@ -446,4 +446,4 @@ export {
|
|
|
446
446
|
trackSessionContextFast,
|
|
447
447
|
getSessionUsage
|
|
448
448
|
};
|
|
449
|
-
//# sourceMappingURL=chunk-
|
|
449
|
+
//# sourceMappingURL=chunk-QESRH3ED.js.map
|
|
@@ -3,22 +3,22 @@ const require = __hookRunnerCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
hasOtlpAuth,
|
|
5
5
|
hasUnshippedTelemetry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OJWQCABS.js";
|
|
7
7
|
import {
|
|
8
8
|
recordShipperStatus,
|
|
9
9
|
shipPreflight
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BOZSNQGU.js";
|
|
11
11
|
import {
|
|
12
12
|
canResolveIdentityKey,
|
|
13
13
|
resolveOtlpEndpoint
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-E3YCQK2D.js";
|
|
15
15
|
import {
|
|
16
16
|
CLAUDE_HOME,
|
|
17
17
|
SHIP_TELEMETRY_ARG,
|
|
18
18
|
TELEMETRY_DIR,
|
|
19
19
|
errorSummary,
|
|
20
20
|
findUp
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-N6435YLW.js";
|
|
22
22
|
|
|
23
23
|
// lib/core/detached-runner.ts
|
|
24
24
|
import { spawn } from "node:child_process";
|
|
@@ -80,4 +80,4 @@ export {
|
|
|
80
80
|
spawnDetachedRunner,
|
|
81
81
|
spawnTelemetryShipper
|
|
82
82
|
};
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-S2B2J6ZB.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
CLAUDE_HOME,
|
|
8
8
|
readdirOrEmpty
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-N6435YLW.js";
|
|
10
10
|
|
|
11
11
|
// lib/transcript/transcript-layout.ts
|
|
12
12
|
import { existsSync } from "node:fs";
|
|
@@ -38,4 +38,4 @@ export {
|
|
|
38
38
|
subagentsDir,
|
|
39
39
|
findTranscriptPath
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
41
|
+
//# sourceMappingURL=chunk-SA4ZNI3N.js.map
|
|
@@ -2,14 +2,14 @@ import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
sessionStateDir
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LFCMGDJC.js";
|
|
6
6
|
import {
|
|
7
7
|
errorMessage,
|
|
8
8
|
loadJson,
|
|
9
9
|
withFileLock,
|
|
10
10
|
writeJson,
|
|
11
11
|
writeStderr
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-N6435YLW.js";
|
|
13
13
|
import {
|
|
14
14
|
DURATION_MS
|
|
15
15
|
} from "./chunk-RWRGC7ZK.js";
|
|
@@ -115,4 +115,4 @@ export {
|
|
|
115
115
|
clearSession,
|
|
116
116
|
getAgentStateSizes
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
118
|
+
//# sourceMappingURL=chunk-SGL5GFKY.js.map
|
|
@@ -2,7 +2,7 @@ import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
GENAI_PROVIDER_NAMES
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QD52DSVB.js";
|
|
6
6
|
|
|
7
7
|
// lib/transcript/model-ids.ts
|
|
8
8
|
var MODEL_ID_DATE_SUFFIX = /-\d{8}$/;
|
|
@@ -41,4 +41,4 @@ export {
|
|
|
41
41
|
providerOfModel,
|
|
42
42
|
matchFamily
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
44
|
+
//# sourceMappingURL=chunk-VAX5JACX.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
GIT_COMMIT_SUBCOMMAND,
|
|
8
8
|
MCP_TOOL_PREFIX,
|
|
9
9
|
PLUGIN_TOOLS
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-N6435YLW.js";
|
|
11
11
|
|
|
12
12
|
// lib/runtime/tool-input.ts
|
|
13
13
|
import { homedir } from "node:os";
|
|
@@ -101,4 +101,4 @@ export {
|
|
|
101
101
|
getWrittenText,
|
|
102
102
|
classifyToolCategory
|
|
103
103
|
};
|
|
104
|
-
//# sourceMappingURL=chunk-
|
|
104
|
+
//# sourceMappingURL=chunk-WVVJE7ZI.js.map
|
|
@@ -2,16 +2,16 @@ import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
claudeJsonPath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-E3YCQK2D.js";
|
|
6
6
|
import {
|
|
7
7
|
sessionStateDir
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LFCMGDJC.js";
|
|
9
9
|
import {
|
|
10
10
|
CLAUDE_HOME,
|
|
11
11
|
findUp,
|
|
12
12
|
loadJson,
|
|
13
13
|
writeJson
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-N6435YLW.js";
|
|
15
15
|
|
|
16
16
|
// lib/mcp/mcp-config.ts
|
|
17
17
|
import { createHash } from "node:crypto";
|
|
@@ -111,4 +111,4 @@ export {
|
|
|
111
111
|
getMcpScopeCached,
|
|
112
112
|
getProjectMismatchPatterns
|
|
113
113
|
};
|
|
114
|
-
//# sourceMappingURL=chunk-
|
|
114
|
+
//# sourceMappingURL=chunk-XFKV6REH.js.map
|
|
@@ -2,10 +2,10 @@ import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
emitToolCorrectness
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EZL3KMMB.js";
|
|
6
6
|
import {
|
|
7
7
|
UNKNOWN_ERROR_TYPE
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QD52DSVB.js";
|
|
9
9
|
import {
|
|
10
10
|
UNITS
|
|
11
11
|
} from "./chunk-RWRGC7ZK.js";
|
|
@@ -44,4 +44,4 @@ export {
|
|
|
44
44
|
outcomeSpanAttributes,
|
|
45
45
|
recordOutcome
|
|
46
46
|
};
|
|
47
|
-
//# sourceMappingURL=chunk-
|
|
47
|
+
//# sourceMappingURL=chunk-XYINMMHR.js.map
|
|
@@ -2,15 +2,15 @@ import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
spawnDetachedRunner
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-S2B2J6ZB.js";
|
|
6
6
|
import {
|
|
7
7
|
DOPPLER_BIN,
|
|
8
8
|
DOPPLER_CONFIGS,
|
|
9
9
|
DOPPLER_PROJECT
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-E3YCQK2D.js";
|
|
11
11
|
import {
|
|
12
12
|
qualityStateDir
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-LFCMGDJC.js";
|
|
14
14
|
import {
|
|
15
15
|
EVALUATE_QUALITY_ARG,
|
|
16
16
|
FILE_LOCK,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
tryWithFileLock,
|
|
19
19
|
utcDateStamp,
|
|
20
20
|
writeJson
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-N6435YLW.js";
|
|
22
22
|
import {
|
|
23
23
|
isByteCount
|
|
24
24
|
} from "./chunk-RWRGC7ZK.js";
|
|
@@ -174,4 +174,4 @@ export {
|
|
|
174
174
|
parseEvaluationArgs,
|
|
175
175
|
spawnQualityEvaluator
|
|
176
176
|
};
|
|
177
|
-
//# sourceMappingURL=chunk-
|
|
177
|
+
//# sourceMappingURL=chunk-YDN63WUY.js.map
|
|
@@ -2,11 +2,11 @@ import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
sessionStateDir
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LFCMGDJC.js";
|
|
6
6
|
import {
|
|
7
7
|
appendLine,
|
|
8
8
|
readJsonlFile
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-N6435YLW.js";
|
|
10
10
|
|
|
11
11
|
// lib/mcp/mcp-completeness.ts
|
|
12
12
|
import { join } from "node:path";
|
|
@@ -43,4 +43,4 @@ export {
|
|
|
43
43
|
loadInvocations,
|
|
44
44
|
summarizeInvocations
|
|
45
45
|
};
|
|
46
|
-
//# sourceMappingURL=chunk-
|
|
46
|
+
//# sourceMappingURL=chunk-YZDEUJOZ.js.map
|
|
@@ -3,7 +3,7 @@ const require = __hookRunnerCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
GIT_TIMEOUT_MS,
|
|
5
5
|
THRESHOLDS
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-N6435YLW.js";
|
|
7
7
|
|
|
8
8
|
// lib/core/child-result.ts
|
|
9
9
|
var MAX_BUFFER_EXCEEDED_CODE = "ERR_CHILD_PROCESS_STDIO_MAXBUFFER";
|
|
@@ -51,4 +51,4 @@ export {
|
|
|
51
51
|
git,
|
|
52
52
|
gitSync
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=chunk-
|
|
54
|
+
//# sourceMappingURL=chunk-ZCZUJKZD.js.map
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
ASSISTANT_RECORD_TYPE,
|
|
5
5
|
USER_RECORD_TYPE,
|
|
6
6
|
toBlocks
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-34O6HVAQ.js";
|
|
8
8
|
import {
|
|
9
9
|
UNKNOWN_TOOL_NAME
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-N6435YLW.js";
|
|
11
11
|
import {
|
|
12
12
|
TIME_MS
|
|
13
13
|
} from "./chunk-RWRGC7ZK.js";
|
|
@@ -62,4 +62,4 @@ export {
|
|
|
62
62
|
collectToolCalls,
|
|
63
63
|
markTurnBoundary
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
65
|
+
//# sourceMappingURL=chunk-ZEYUSIMT.js.map
|
|
@@ -2,13 +2,13 @@ import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
TOOL_ERROR_TYPE
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZEYUSIMT.js";
|
|
6
6
|
import {
|
|
7
7
|
providerOfModel
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VAX5JACX.js";
|
|
9
9
|
import {
|
|
10
10
|
inputTokensIncludingCache
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-34O6HVAQ.js";
|
|
12
12
|
import {
|
|
13
13
|
ERROR_TYPE_ATTR,
|
|
14
14
|
GENAI_AGENT_ATTRIBUTES,
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
initTelemetry,
|
|
22
22
|
recordCounter,
|
|
23
23
|
recordMetric
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-QD52DSVB.js";
|
|
25
25
|
import {
|
|
26
26
|
USER_WAIT_TOOLS
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-N6435YLW.js";
|
|
28
28
|
import {
|
|
29
29
|
UNITS
|
|
30
30
|
} from "./chunk-RWRGC7ZK.js";
|
|
@@ -134,4 +134,4 @@ export {
|
|
|
134
134
|
recordInferenceCost,
|
|
135
135
|
recordModelTotals
|
|
136
136
|
};
|
|
137
|
-
//# sourceMappingURL=chunk-
|
|
137
|
+
//# sourceMappingURL=chunk-ZHCBXQ5O.js.map
|
|
@@ -5,19 +5,19 @@ import {
|
|
|
5
5
|
} from "./chunk-VXFSLM6P.js";
|
|
6
6
|
import {
|
|
7
7
|
instrumentHook
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-C3NW5R45.js";
|
|
9
9
|
import {
|
|
10
10
|
COMPACTION_ATTRIBUTES,
|
|
11
11
|
COMPACTION_TRIGGERS,
|
|
12
12
|
CONTEXT_METRICS,
|
|
13
13
|
HOOK_NAMES,
|
|
14
14
|
HOOK_TYPE_ATTR
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-QD52DSVB.js";
|
|
16
|
+
import "./chunk-E3YCQK2D.js";
|
|
17
|
+
import "./chunk-ZCZUJKZD.js";
|
|
18
18
|
import "./chunk-YHYDBLVB.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-LFCMGDJC.js";
|
|
20
|
+
import "./chunk-N6435YLW.js";
|
|
21
21
|
import {
|
|
22
22
|
UNITS
|
|
23
23
|
} from "./chunk-RWRGC7ZK.js";
|
|
@@ -57,4 +57,4 @@ export {
|
|
|
57
57
|
handlePostCompact,
|
|
58
58
|
handlePreCompact
|
|
59
59
|
};
|
|
60
|
-
//# sourceMappingURL=compact-
|
|
60
|
+
//# sourceMappingURL=compact-PH4S4MIT.js.map
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
isGitCommitCommand,
|
|
9
9
|
recordCommitHeadSnapshot,
|
|
10
10
|
resolveCommitEvent
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-67K2WTSP.js";
|
|
12
12
|
import "./chunk-JLEO5OHU.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-3DZNNATE.js";
|
|
14
|
+
import "./chunk-WVVJE7ZI.js";
|
|
15
|
+
import "./chunk-ZCZUJKZD.js";
|
|
16
16
|
import "./chunk-YHYDBLVB.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-LFCMGDJC.js";
|
|
18
|
+
import "./chunk-N6435YLW.js";
|
|
19
19
|
import "./chunk-RWRGC7ZK.js";
|
|
20
20
|
import "./chunk-GNNKUMRF.js";
|
|
21
21
|
export {
|
|
@@ -27,4 +27,4 @@ export {
|
|
|
27
27
|
recordCommitHeadSnapshot,
|
|
28
28
|
resolveCommitEvent
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=git-commit-
|
|
30
|
+
//# sourceMappingURL=git-commit-67MX3SQY.js.map
|
|
@@ -3,25 +3,23 @@ import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
|
3
3
|
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
lazy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2PQCUHOU.js";
|
|
7
7
|
import {
|
|
8
8
|
flushAdditionalContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-D626UD7P.js";
|
|
10
10
|
import {
|
|
11
11
|
setHookTrigger,
|
|
12
12
|
setSessionId
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-C3NW5R45.js";
|
|
14
14
|
import {
|
|
15
15
|
shutdownTelemetry
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
} from "./chunk-GG2I4TGI.js";
|
|
20
|
-
import "./chunk-SRMAJQMV.js";
|
|
16
|
+
} from "./chunk-QD52DSVB.js";
|
|
17
|
+
import "./chunk-E3YCQK2D.js";
|
|
18
|
+
import "./chunk-ZCZUJKZD.js";
|
|
21
19
|
import {
|
|
22
20
|
TRANSCRIPT_SESSION_ID_PATTERN
|
|
23
21
|
} from "./chunk-YHYDBLVB.js";
|
|
24
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-LFCMGDJC.js";
|
|
25
23
|
import {
|
|
26
24
|
CLAUDE_HOME,
|
|
27
25
|
DETACHED_EXIT,
|
|
@@ -30,11 +28,12 @@ import {
|
|
|
30
28
|
HOOK_EXIT,
|
|
31
29
|
INPUT_PREVIEW_CHARS,
|
|
32
30
|
SHIP_TELEMETRY_ARG,
|
|
31
|
+
configDirFromTranscriptPath,
|
|
33
32
|
errorMessage,
|
|
34
33
|
isJsonObject,
|
|
35
34
|
truncate,
|
|
36
35
|
writeStderr
|
|
37
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-N6435YLW.js";
|
|
38
37
|
import "./chunk-RWRGC7ZK.js";
|
|
39
38
|
import "./chunk-7PEOKGYR.js";
|
|
40
39
|
import "./chunk-GNNKUMRF.js";
|
|
@@ -60,25 +59,25 @@ function requireField(input, field) {
|
|
|
60
59
|
}
|
|
61
60
|
var toolEvent = (handler) => async (input, subType) => handler({ ...input, tool_name: requireField(input, "tool_name") }, subType);
|
|
62
61
|
var HOOK_HANDLERS = {
|
|
63
|
-
"session-start": lazy(async () => (await import("./session-start-
|
|
64
|
-
"pre-tool": toolEvent(lazy(async () => (await import("./pre-tool-
|
|
65
|
-
"post-tool": toolEvent(lazy(async () => (await import("./post-tool-
|
|
66
|
-
"stop": lazy(async () => (await import("./stop-
|
|
67
|
-
"user-prompt": lazy(async () => (await import("./user-prompt-
|
|
68
|
-
"notification": lazy(async () => (await import("./notification-
|
|
69
|
-
"subagent-start": lazy(async () => (await import("./subagent-
|
|
70
|
-
"subagent-stop": lazy(async () => (await import("./subagent-
|
|
71
|
-
"post-tool-failure": toolEvent(lazy(async () => (await import("./post-tool-failure-
|
|
72
|
-
"pre-compact": lazy(async () => (await import("./compact-
|
|
73
|
-
"post-compact": lazy(async () => (await import("./compact-
|
|
74
|
-
"session-end": lazy(async () => (await import("./session-end-
|
|
62
|
+
"session-start": lazy(async () => (await import("./session-start-EPMNSIX6.js")).handleSessionStart),
|
|
63
|
+
"pre-tool": toolEvent(lazy(async () => (await import("./pre-tool-6UBCNWIJ.js")).handlePreTool)),
|
|
64
|
+
"post-tool": toolEvent(lazy(async () => (await import("./post-tool-AIQSU3VH.js")).handlePostTool)),
|
|
65
|
+
"stop": lazy(async () => (await import("./stop-3WZ3HHMG.js")).handleStop),
|
|
66
|
+
"user-prompt": lazy(async () => (await import("./user-prompt-RV3N24AN.js")).handleUserPrompt),
|
|
67
|
+
"notification": lazy(async () => (await import("./notification-3WY33IIL.js")).handleNotification),
|
|
68
|
+
"subagent-start": lazy(async () => (await import("./subagent-GU56QFXI.js")).handleSubagentStart),
|
|
69
|
+
"subagent-stop": lazy(async () => (await import("./subagent-GU56QFXI.js")).handleSubagentStop),
|
|
70
|
+
"post-tool-failure": toolEvent(lazy(async () => (await import("./post-tool-failure-GDKD57FZ.js")).handlePostToolFailure)),
|
|
71
|
+
"pre-compact": lazy(async () => (await import("./compact-PH4S4MIT.js")).handlePreCompact),
|
|
72
|
+
"post-compact": lazy(async () => (await import("./compact-PH4S4MIT.js")).handlePostCompact),
|
|
73
|
+
"session-end": lazy(async () => (await import("./session-end-NQ7HY5C2.js")).handleSessionEnd)
|
|
75
74
|
};
|
|
76
75
|
async function runShipTelemetry() {
|
|
77
76
|
try {
|
|
78
|
-
const { shipTelemetryWithAccountKeys } = await import("./span-shipper-
|
|
77
|
+
const { shipTelemetryWithAccountKeys } = await import("./span-shipper-H6XGJPUR.js");
|
|
79
78
|
await shipTelemetryWithAccountKeys();
|
|
80
79
|
} catch (error) {
|
|
81
|
-
const { recordShipperStatus, shipperErrorDetail } = await import("./shipper-status-
|
|
80
|
+
const { recordShipperStatus, shipperErrorDetail } = await import("./shipper-status-FLIPBYTK.js");
|
|
82
81
|
recordShipperStatus({ outcome: "crashed", detail: shipperErrorDetail(error) });
|
|
83
82
|
}
|
|
84
83
|
return DETACHED_EXIT.OK;
|
|
@@ -89,7 +88,7 @@ var DETACHED_MODES = {
|
|
|
89
88
|
// Detached T2 quality evaluator (HDF3): spawned by the Stop hook for a sampled session
|
|
90
89
|
// with the four evaluation fields as positional arguments, so paid judge calls run outside any hook ceiling.
|
|
91
90
|
[EVALUATE_QUALITY_ARG]: async (args) => {
|
|
92
|
-
const { runEvaluationHandoff } = await import("./quality-evaluator-
|
|
91
|
+
const { runEvaluationHandoff } = await import("./quality-evaluator-SPT3LTR6.js");
|
|
93
92
|
return exitCodeForSuccess(await runEvaluationHandoff(args));
|
|
94
93
|
}
|
|
95
94
|
};
|
|
@@ -217,4 +216,4 @@ export {
|
|
|
217
216
|
main,
|
|
218
217
|
runDetachedMode
|
|
219
218
|
};
|
|
220
|
-
//# sourceMappingURL=hook-runner-
|
|
219
|
+
//# sourceMappingURL=hook-runner-O345UBIB.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../hook-runner.ts"],
|
|
4
4
|
"sourcesContent": ["#!/usr/bin/env node\n/**\n * Single entry point for all Claude Code hooks to avoid tsx startup overhead.\n *\n * Hook events are the keys of `HOOK_HANDLERS` and read their payload from stdin.\n * Non-event modes (no stdin) are the keys of `DETACHED_MODES`.\n *\n * Output channel is decided by the event, not the handler: writePlainContext() reaches Claude\n * only on SessionStart/UserPromptSubmit/UserPromptExpansion; everywhere else use\n * addAdditionalContext(), flushed once below. See hooks/README.md \u00A7 Output Channels.\n */\n\nimport { readFileSync } from 'node:fs';\nimport { configDirFromTranscriptPath } from './lib/core/config-dir-recovery.js';\nimport { HOOK_EXIT, DETACHED_EXIT, SHIP_TELEMETRY_ARG, EVALUATE_QUALITY_ARG, CLAUDE_HOME, INPUT_PREVIEW_CHARS, FIRST_CLI_ARG_INDEX, type HookType } from './lib/core/constants.js';\nimport { isJsonObject } from './lib/core/file-utils.js';\nimport { errorMessage, truncate, writeStderr } from './lib/core/format-utils.js';\nimport { TRANSCRIPT_SESSION_ID_PATTERN } from './lib/core/regex.js';\nimport { setHookTrigger, setSessionId, shutdownTelemetry } from './lib/otel/otel-monitor.js';\nimport type { HookInput, NormalizedHookInput, NormalizedToolHookInput } from './lib/runtime/hook-input.js';\nimport { flushAdditionalContext } from './lib/runtime/hook-output.js';\nimport { lazy } from './lib/runtime/run-handlers.js';\n\n\ntype HookHandler = (input: NormalizedHookInput, subType?: string) => Promise<void>;\ntype ToolHookHandler = (input: NormalizedToolHookInput, subType?: string) => Promise<void>;\n\nconst HOOK_TYPE_ARG_INDEX = FIRST_CLI_ARG_INDEX;\nconst ARGS_AFTER_TYPE_INDEX = HOOK_TYPE_ARG_INDEX + 1;\n\ntype RequiredHookField = keyof NormalizedToolHookInput & (\n 'session_id' | 'transcript_path' | 'cwd' | 'hook_event_name' | 'tool_name');\n\n/** Claude Code sends these fields on every event, or every tool event (CCH4); a payload without one is refused, not patched. */\nexport class MissingHookFieldError extends Error {\n constructor(readonly field: RequiredHookField) {\n super(`stdin payload is missing required field \"${field}\"`);\n this.name = 'MissingHookFieldError';\n }\n}\n\nfunction requireField(input: HookInput, field: RequiredHookField): string {\n const value = input[field];\n if (!value) {\n throw new MissingHookFieldError(field);\n }\n return value;\n}\n\n/** Tool events also carry `tool_name`; refused before the handler runs, like the every-event fields. */\nconst toolEvent = (handler: ToolHookHandler): HookHandler =>\n async (input, subType) => handler({ ...input, tool_name: requireField(input, 'tool_name') }, subType);\n\n/** `Record<HookType, \u2026>` makes a missing row a compile error. Exported for the registration guard test. */\nexport const HOOK_HANDLERS: Record<HookType, HookHandler> = {\n 'session-start': lazy(async () => (await import('./handlers/session-start.js')).handleSessionStart),\n 'pre-tool': toolEvent(lazy(async () => (await import('./handlers/pre-tool.js')).handlePreTool)),\n 'post-tool': toolEvent(lazy(async () => (await import('./handlers/post-tool.js')).handlePostTool)),\n 'stop': lazy(async () => (await import('./handlers/stop.js')).handleStop),\n 'user-prompt': lazy(async () => (await import('./handlers/user-prompt.js')).handleUserPrompt),\n 'notification': lazy(async () => (await import('./handlers/notification.js')).handleNotification),\n 'subagent-start': lazy(async () => (await import('./handlers/subagent.js')).handleSubagentStart),\n 'subagent-stop': lazy(async () => (await import('./handlers/subagent.js')).handleSubagentStop),\n 'post-tool-failure': toolEvent(lazy(async () => (await import('./handlers/post-tool-failure.js')).handlePostToolFailure)),\n 'pre-compact': lazy(async () => (await import('./handlers/compact.js')).handlePreCompact),\n 'post-compact': lazy(async () => (await import('./handlers/compact.js')).handlePostCompact),\n 'session-end': lazy(async () => (await import('./handlers/session-end.js')).handleSessionEnd),\n};\n\n/**\n * Detached telemetry shipper (spawned by the stop hook, no stdin, no OTEL SDK\n * init \u2014 the whole point is a process that exits promptly).\n */\nasync function runShipTelemetry(): Promise<number> {\n try {\n const { shipTelemetryWithAccountKeys } = await import('./lib/shipper/span-shipper.js');\n await shipTelemetryWithAccountKeys();\n } catch (error) {\n // Runs with `stdio: 'ignore'`, so record a failure before `shipTelemetryWithAccountKeys` is reached;\n // imported lazily so this still loads when the span-shipper graph is what broke.\n const { recordShipperStatus, shipperErrorDetail } = await import('./lib/shipper/shipper-status.js');\n recordShipperStatus({ outcome: 'crashed', detail: shipperErrorDetail(error) });\n }\n return DETACHED_EXIT.OK;\n}\n\nconst exitCodeForSuccess = (succeeded: boolean): number =>\n succeeded ? DETACHED_EXIT.OK : DETACHED_EXIT.FAILED;\n\ntype DetachedMode = (args: string[]) => Promise<number>;\n\n/**\n * The first CLI argument names the mode, the rest are its arguments, there is no stdin, and\n * the result is the exit code. Each mode imports lazily and owns its own telemetry shutdown.\n * Exported for the registration test.\n */\nexport const DETACHED_MODES: Record<string, DetachedMode> = {\n [SHIP_TELEMETRY_ARG]: runShipTelemetry,\n\n // Detached T2 quality evaluator (HDF3): spawned by the Stop hook for a sampled session\n // with the four evaluation fields as positional arguments, so paid judge calls run outside any hook ceiling.\n [EVALUATE_QUALITY_ARG]: async (args) => {\n const { runEvaluationHandoff } = await import('./lib/quality/quality-evaluator.js');\n return exitCodeForSuccess(await runEvaluationHandoff(args));\n },\n};\n\n/**\n * A detached mode blocks no Claude action, so a crash exits non-zero for the launchd\n * log instead of reaching the L1 handler's exit 0. Exported for the exit-code test.\n */\nexport async function runDetachedMode(mode: DetachedMode, args: string[]): Promise<number> {\n try {\n return await mode(args);\n } catch (error) {\n writeStderr('[hook-runner] Detached mode crashed:', errorMessage(error));\n return DETACHED_EXIT.FAILED;\n }\n}\n\nfunction printUsage(): void {\n writeStderr(`Usage: hook-runner <hook-type> [sub-type]`);\n writeStderr(`Valid types: ${[...Object.keys(HOOK_HANDLERS), ...Object.keys(DETACHED_MODES)].join(', ')}`);\n}\n\nfunction detachedModeFor(hookTypeArg: string | undefined): DetachedMode | undefined {\n return hookTypeArg && Object.hasOwn(DETACHED_MODES, hookTypeArg) ? DETACHED_MODES[hookTypeArg] : undefined;\n}\n\n/**\n * Checked against the dispatch table, not HOOK_EVENT_NAMES: a type registered in\n * settings.json without a handler row is rejected here instead of dying silently (CCH5).\n */\nfunction hookTypeFor(hookTypeArg: string | undefined): HookType | undefined {\n return hookTypeArg && Object.hasOwn(HOOK_HANDLERS, hookTypeArg) ? (hookTypeArg as HookType) : undefined;\n}\n\nfunction readStdin(): string {\n try {\n return readFileSync(0, 'utf-8');\n } catch {\n return '';\n }\n}\n\nfunction reportMalformedInput(reason: string, input: string): undefined {\n const preview = truncate(input, INPUT_PREVIEW_CHARS);\n writeStderr(`[hook-runner] ${reason} | input preview: ${JSON.stringify(preview)}`);\n return undefined;\n}\n\n/** Every `HookInput` field is optional, so any JSON object is one; `normalizeHookInput` checks the fields every event carries. */\nfunction isHookInput(value: unknown): value is HookInput {\n return isJsonObject(value);\n}\n\n/** Undefined means the stdin payload was unusable and has been reported. */\nfunction parseHookInput(input: string): HookInput | undefined {\n if (!input.trim()) {\n return {};\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(input);\n } catch (error) {\n return reportMalformedInput(`Failed to parse stdin JSON: ${errorMessage(error)}`, input);\n }\n return isHookInput(parsed) ? parsed : reportMalformedInput('stdin JSON is not an object', input);\n}\n\n/**\n * Falls back to the transcript filename when session_id is absent: Claude Code\n * writes the transcript to ~/.claude/projects/{slug}/{session-uuid}.jsonl.\n */\nfunction resolveSessionId(hookInput: HookInput): string | undefined {\n return hookInput.session_id || hookInput.transcript_path?.match(TRANSCRIPT_SESSION_ID_PATTERN)?.[1];\n}\n\n/** Throws `MissingHookFieldError` for a field Claude Code always sends that this payload lacks, so handlers need no guard of their own. */\nfunction normalizeHookInput(hookInput: HookInput): NormalizedHookInput {\n const withSessionId: HookInput = { ...hookInput, session_id: resolveSessionId(hookInput) };\n return {\n ...withSessionId,\n session_id: requireField(withSessionId, 'session_id'),\n transcript_path: requireField(withSessionId, 'transcript_path'),\n cwd: requireField(withSessionId, 'cwd'),\n hook_event_name: requireField(withSessionId, 'hook_event_name'),\n };\n}\n\n/**\n * Undefined means the payload lacked a field every event carries and has been reported.\n * Refusal is fail-open: the runner then exits OK, so a Stop payload without a session id\n * skips the build check instead of blocking on it.\n */\nfunction normalizeOrReport(parsedInput: HookInput, rawInput: string): NormalizedHookInput | undefined {\n try {\n return normalizeHookInput(parsedInput);\n } catch (error) {\n return reportMalformedInput(errorMessage(error), rawInput);\n }\n}\n\n// HRF13: CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 strips CLAUDE_CONFIG_DIR; recover it from\n// transcript_path before any handler reads process.env.CLAUDE_CONFIG_DIR.\nfunction recoverConfigDir(hookInput: HookInput): void {\n if (!process.env.CLAUDE_CONFIG_DIR && hookInput.transcript_path) {\n const recovered = configDirFromTranscriptPath(hookInput.transcript_path, CLAUDE_HOME);\n if (recovered) {\n process.env.CLAUDE_CONFIG_DIR = recovered;\n }\n }\n}\n\nasync function runHandler(hookType: HookType, hookInput: NormalizedHookInput, subType: string | undefined): Promise<boolean> {\n try {\n await HOOK_HANDLERS[hookType](hookInput, subType);\n return true;\n } catch (error) {\n writeStderr(`Hook error (${hookType}):`, errorMessage(error));\n return false;\n }\n}\n\nexport async function main(): Promise<void> {\n // L1: exit 0 so hook failures never block Claude. Registered inside main() so a test\n // import does not install a process.exit handler in the runner process.\n process.on('unhandledRejection', (reason) => {\n writeStderr('[hook-runner] Unhandled rejection:', errorMessage(reason));\n process.exit(HOOK_EXIT.OK);\n });\n\n const hookTypeArg = process.argv[HOOK_TYPE_ARG_INDEX];\n const subType = process.argv[ARGS_AFTER_TYPE_INDEX];\n\n const detachedMode = detachedModeFor(hookTypeArg);\n if (detachedMode) {\n process.exit(await runDetachedMode(detachedMode, process.argv.slice(ARGS_AFTER_TYPE_INDEX)));\n }\n\n const hookType = hookTypeFor(hookTypeArg);\n if (!hookType) {\n // Non-zero: an unknown type is a settings.json mistake that should surface in the debug log.\n printUsage();\n process.exit(HOOK_EXIT.NONBLOCKING_ERROR);\n }\n\n const rawInput = readStdin();\n const parsedInput = parseHookInput(rawInput);\n const hookInput = parsedInput && normalizeOrReport(parsedInput, rawInput);\n if (!hookInput) {\n // Zero: bad stdin is Claude Code's payload, not a misconfiguration, so the hook stays quiet (L1).\n process.exit(HOOK_EXIT.OK);\n }\n\n setSessionId(hookInput.session_id);\n // HTR38: one hook.trigger for every span this process emits and for the event name\n // flushAdditionalContext/recordUnknownTool read back.\n setHookTrigger(hookInput.hook_event_name);\n recoverConfigDir(hookInput);\n\n const handlerCompleted = await runHandler(hookType, hookInput, subType);\n\n // Flushed even after a throw: context queued by an earlier handler should still be heard.\n flushAdditionalContext();\n // Awaited so metrics, which reach disk only at meter shutdown, are written before\n // the failure exit below; on success the process ends once the same shutdown settles.\n await shutdownTelemetry();\n if (!handlerCompleted) {\n process.exit(HOOK_EXIT.OK);\n }\n}\n\n// import.meta.main, not an argv[1] comparison: a symlinked path still matches, and a test\n// importing HOOK_HANDLERS does not run main(), read stdin or process.exit (CCH5). The bundled\n// dist/hook-runner.js loads this module as a chunk, where import.meta.main is false, and calls\n// main() from runner-entry.ts instead.\nif (import.meta.main) {\n void main();\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAAS,oBAAoB;AAe7B,IAAM,sBAAsB;AAC5B,IAAM,wBAAwB,sBAAsB;AAM7C,IAAM,wBAAN,cAAoC,MAAM;AAAA,EAC/C,YAAqB,OAA0B;AAC7C,UAAM,4CAA4C,KAAK,GAAG;AAD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erCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
getAllMcpServers
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XFKV6REH.js";
|
|
6
6
|
import {
|
|
7
7
|
boundedScanText
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5GJLO6EX.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveOutputText
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3DZNNATE.js";
|
|
12
12
|
import {
|
|
13
13
|
claimFailureReport
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6QFGAAUD.js";
|
|
15
15
|
import {
|
|
16
16
|
instrumentHook
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-C3NW5R45.js";
|
|
18
18
|
import {
|
|
19
19
|
HOOK_NAMES,
|
|
20
20
|
HOOK_TYPE_ATTR
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-QD52DSVB.js";
|
|
22
|
+
import "./chunk-E3YCQK2D.js";
|
|
23
|
+
import "./chunk-ZCZUJKZD.js";
|
|
24
24
|
import "./chunk-YHYDBLVB.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-LFCMGDJC.js";
|
|
26
|
+
import "./chunk-N6435YLW.js";
|
|
27
27
|
import {
|
|
28
28
|
UNITS
|
|
29
29
|
} from "./chunk-RWRGC7ZK.js";
|
|
@@ -86,4 +86,4 @@ async function handleMcpStatus(input) {
|
|
|
86
86
|
export {
|
|
87
87
|
handleMcpStatus
|
|
88
88
|
};
|
|
89
|
-
//# sourceMappingURL=mcp-status-
|
|
89
|
+
//# sourceMappingURL=mcp-status-XWMUEEAB.js.map
|
|
@@ -2,24 +2,24 @@ import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
classifyNotification
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-H4M6YEDJ.js";
|
|
6
6
|
import "./chunk-VXFSLM6P.js";
|
|
7
7
|
import {
|
|
8
8
|
instrumentHook
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-C3NW5R45.js";
|
|
10
10
|
import {
|
|
11
11
|
GENAI_TOOL_NAME_ATTR,
|
|
12
12
|
HOOK_NAMES,
|
|
13
13
|
HOOK_TYPE_ATTR
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-QD52DSVB.js";
|
|
15
|
+
import "./chunk-E3YCQK2D.js";
|
|
16
|
+
import "./chunk-ZCZUJKZD.js";
|
|
17
17
|
import "./chunk-YHYDBLVB.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-LFCMGDJC.js";
|
|
19
19
|
import {
|
|
20
20
|
THRESHOLDS,
|
|
21
21
|
UNKNOWN_TOOL_NAME
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-N6435YLW.js";
|
|
23
23
|
import {
|
|
24
24
|
UNITS
|
|
25
25
|
} from "./chunk-RWRGC7ZK.js";
|
|
@@ -66,4 +66,4 @@ async function handleNotification(input) {
|
|
|
66
66
|
export {
|
|
67
67
|
handleNotification
|
|
68
68
|
};
|
|
69
|
-
//# sourceMappingURL=notification-
|
|
69
|
+
//# sourceMappingURL=notification-3WY33IIL.js.map
|