observability-toolkit-hooks 0.0.0-stage → 1.0.1
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/CONFIG.md +144 -0
- package/LICENSE +95 -0
- package/README.md +201 -2
- package/dist/handlers/compact.js +38 -0
- package/dist/handlers/mcp-status.js +66 -0
- package/dist/handlers/notification.js +45 -0
- package/dist/handlers/post-tool-agent.js +157 -0
- package/dist/handlers/post-tool-changelog-sync.js +148 -0
- package/dist/handlers/post-tool-code-structure.js +116 -0
- package/dist/handlers/post-tool-edit-ledger.js +15 -0
- package/dist/handlers/post-tool-failure.js +83 -0
- package/dist/handlers/post-tool-git.js +79 -0
- package/dist/handlers/post-tool-mcp.js +105 -0
- package/dist/handlers/post-tool-outcome.js +48 -0
- package/dist/handlers/post-tool-task-state.js +74 -0
- package/dist/handlers/post-tool.js +132 -0
- package/dist/handlers/pre-tool-agent.js +192 -0
- package/dist/handlers/pre-tool.js +218 -0
- package/dist/handlers/session-end.js +39 -0
- package/dist/handlers/session-start.js +262 -0
- package/dist/handlers/stop-error-reminder.js +195 -0
- package/dist/handlers/stop-quality-evaluation.js +58 -0
- package/dist/handlers/stop-session-summary.js +62 -0
- package/dist/handlers/stop-token-metrics.js +83 -0
- package/dist/handlers/stop.js +25 -0
- package/dist/handlers/subagent.js +105 -0
- package/dist/handlers/tool-event-router.js +39 -0
- package/dist/handlers/user-prompt.js +218 -0
- package/dist/hook-runner.js +10 -0
- package/dist/hook-runner.js.map +7 -0
- package/dist/lib/agent/agent-context.js +123 -0
- package/dist/lib/agent/agent-evaluations.js +155 -0
- package/dist/lib/agent/agent-file-budget.js +65 -0
- package/dist/lib/agent/agent-sources.js +165 -0
- package/dist/lib/agent/synth-spans.js +51 -0
- package/dist/lib/core/bounded-label.js +6 -0
- package/dist/lib/core/category-rules.js +11 -0
- package/dist/lib/core/child-result.js +19 -0
- package/dist/lib/core/config-dir-recovery.js +22 -0
- package/dist/lib/core/constants.js +171 -0
- package/dist/lib/core/detached-runner.js +55 -0
- package/dist/lib/core/file-utils.js +353 -0
- package/dist/lib/core/format-utils.js +51 -0
- package/dist/lib/core/http-utils.js +74 -0
- package/dist/lib/core/http1-fetch.js +14 -0
- package/dist/lib/core/identity-key-resolver.js +149 -0
- package/dist/lib/core/jsonl-tail.js +207 -0
- package/dist/lib/core/load-envrc.js +72 -0
- package/dist/lib/core/parsers.js +43 -0
- package/dist/lib/core/regex.js +27 -0
- package/dist/lib/core/settings-env.js +31 -0
- package/dist/lib/core/shell-command.js +122 -0
- package/dist/lib/core/units.js +97 -0
- package/dist/lib/git/git-cache.js +158 -0
- package/dist/lib/git/git-commit.js +189 -0
- package/dist/lib/git/git-exec.js +30 -0
- package/dist/lib/mcp/mcp-completeness.js +40 -0
- package/dist/lib/mcp/mcp-config.js +118 -0
- package/dist/lib/mcp/mcp-failure-latch.js +22 -0
- package/dist/lib/mcp/mcp-identity-launcher.js +43 -0
- package/dist/lib/otel/attributes.js +322 -0
- package/dist/lib/otel/evaluation-attrs.js +51 -0
- package/dist/lib/otel/file-exporters.js +169 -0
- package/dist/lib/otel/host-resource.js +61 -0
- package/dist/lib/otel/otel-headers-helper.js +26 -0
- package/dist/lib/otel/otel-monitor.js +181 -0
- package/dist/lib/otel/otel.js +235 -0
- package/dist/lib/otel/otlp-headers.js +101 -0
- package/dist/lib/otel/otlp-post.js +122 -0
- package/dist/lib/otel/otlp-serialize.js +142 -0
- package/dist/lib/otel/otlp-signal.js +2 -0
- package/dist/lib/otel/remote-spans.js +142 -0
- package/dist/lib/otel/service-identity.js +10 -0
- package/dist/lib/otel/telemetry-alerts.js +43 -0
- package/dist/lib/otel/token-metrics.js +122 -0
- package/dist/lib/otel/trace-context.js +81 -0
- package/dist/lib/quality/judge-meta-eval.js +70 -0
- package/dist/lib/quality/judge-prompts.js +104 -0
- package/dist/lib/quality/judge-providers.js +193 -0
- package/dist/lib/quality/judge-transport.js +93 -0
- package/dist/lib/quality/llm-judge.js +170 -0
- package/dist/lib/quality/quality-budget.js +99 -0
- package/dist/lib/quality/quality-degradation.js +156 -0
- package/dist/lib/quality/quality-eval-handoff.js +74 -0
- package/dist/lib/quality/quality-evaluator.js +178 -0
- package/dist/lib/quality/quality-sampler.js +43 -0
- package/dist/lib/quality/quality-signals.js +150 -0
- package/dist/lib/runtime/categorizers.js +101 -0
- package/dist/lib/runtime/hook-input.js +16 -0
- package/dist/lib/runtime/hook-output.js +50 -0
- package/dist/lib/runtime/output-analyzer.js +160 -0
- package/dist/lib/runtime/run-handlers.js +32 -0
- package/dist/lib/runtime/tool-input.js +111 -0
- package/dist/lib/runtime/tool-output.js +44 -0
- package/dist/lib/runtime/unknown-tool.js +32 -0
- package/dist/lib/session/edit-ledger.js +29 -0
- package/dist/lib/session/forked-skill.js +39 -0
- package/dist/lib/session/handoffs.js +77 -0
- package/dist/lib/session/session-state.js +169 -0
- package/dist/lib/session/skill-rules.js +196 -0
- package/dist/lib/session/task-tracker.js +83 -0
- package/dist/lib/shipper/shipper-credentials.js +38 -0
- package/dist/lib/shipper/shipper-cursor.js +89 -0
- package/dist/lib/shipper/shipper-status.js +174 -0
- package/dist/lib/shipper/span-shipper.js +272 -0
- package/dist/lib/shipper/telemetry-shipper.js +39 -0
- package/dist/lib/transcript/agent-transcript-metrics.js +34 -0
- package/dist/lib/transcript/context-breakdown.js +134 -0
- package/dist/lib/transcript/context-history.js +69 -0
- package/dist/lib/transcript/context-tracker.js +226 -0
- package/dist/lib/transcript/message-count.js +49 -0
- package/dist/lib/transcript/model-ids.js +36 -0
- package/dist/lib/transcript/model-pricing.js +153 -0
- package/dist/lib/transcript/token-metrics-checkpoint.js +152 -0
- package/dist/lib/transcript/tool-call-durations.js +64 -0
- package/dist/lib/transcript/transcript-entry.js +67 -0
- package/dist/lib/transcript/transcript-fold.js +130 -0
- package/dist/lib/transcript/transcript-layout.js +39 -0
- package/dist/lib/transcript/transcript-parser.js +117 -0
- package/dist/runner/agent-context-4XTCLMLZ.js +23 -0
- package/dist/runner/agent-context-4XTCLMLZ.js.map +7 -0
- package/dist/runner/agent-file-budget-Q33ESBBE.js +68 -0
- package/dist/runner/agent-file-budget-Q33ESBBE.js.map +7 -0
- package/dist/runner/agent-transcript-metrics-W5CZZFMI.js +39 -0
- package/dist/runner/agent-transcript-metrics-W5CZZFMI.js.map +7 -0
- package/dist/runner/chunk-2NTNAJZE.js +49 -0
- package/dist/runner/chunk-2NTNAJZE.js.map +7 -0
- package/dist/runner/chunk-4KWBQTTG.js +78 -0
- package/dist/runner/chunk-4KWBQTTG.js.map +7 -0
- package/dist/runner/chunk-52RY6LQT.js +699 -0
- package/dist/runner/chunk-52RY6LQT.js.map +7 -0
- package/dist/runner/chunk-7OM5CYES.js +8695 -0
- package/dist/runner/chunk-7OM5CYES.js.map +7 -0
- package/dist/runner/chunk-7PEOKGYR.js +1568 -0
- package/dist/runner/chunk-7PEOKGYR.js.map +7 -0
- package/dist/runner/chunk-AGSGKELQ.js +126 -0
- package/dist/runner/chunk-AGSGKELQ.js.map +7 -0
- package/dist/runner/chunk-AVM7PJFW.js +12 -0
- package/dist/runner/chunk-AVM7PJFW.js.map +7 -0
- package/dist/runner/chunk-C3WHUMU5.js +178 -0
- package/dist/runner/chunk-C3WHUMU5.js.map +7 -0
- package/dist/runner/chunk-DGB4NSSD.js +157 -0
- package/dist/runner/chunk-DGB4NSSD.js.map +7 -0
- package/dist/runner/chunk-DNSTWC26.js +151 -0
- package/dist/runner/chunk-DNSTWC26.js.map +7 -0
- package/dist/runner/chunk-FDJJ3TYU.js +449 -0
- package/dist/runner/chunk-FDJJ3TYU.js.map +7 -0
- package/dist/runner/chunk-FGKYDQHZ.js +137 -0
- package/dist/runner/chunk-FGKYDQHZ.js.map +7 -0
- package/dist/runner/chunk-GG2I4TGI.js +582 -0
- package/dist/runner/chunk-GG2I4TGI.js.map +7 -0
- package/dist/runner/chunk-GNNKUMRF.js +60 -0
- package/dist/runner/chunk-GNNKUMRF.js.map +7 -0
- package/dist/runner/chunk-I7TD2QVR.js +118 -0
- package/dist/runner/chunk-I7TD2QVR.js.map +7 -0
- package/dist/runner/chunk-IJ4SLUBV.js +78 -0
- package/dist/runner/chunk-IJ4SLUBV.js.map +7 -0
- package/dist/runner/chunk-IY7AP7NA.js +32 -0
- package/dist/runner/chunk-IY7AP7NA.js.map +7 -0
- package/dist/runner/chunk-J3F3Z3EQ.js +177 -0
- package/dist/runner/chunk-J3F3Z3EQ.js.map +7 -0
- package/dist/runner/chunk-JLEO5OHU.js +104 -0
- package/dist/runner/chunk-JLEO5OHU.js.map +7 -0
- package/dist/runner/chunk-JRNNLOPR.js +168 -0
- package/dist/runner/chunk-JRNNLOPR.js.map +7 -0
- package/dist/runner/chunk-KGSA5JYP.js +82 -0
- package/dist/runner/chunk-KGSA5JYP.js.map +7 -0
- package/dist/runner/chunk-LBCZAYFR.js +125 -0
- package/dist/runner/chunk-LBCZAYFR.js.map +7 -0
- package/dist/runner/chunk-LHWRXY2G.js +41 -0
- package/dist/runner/chunk-LHWRXY2G.js.map +7 -0
- package/dist/runner/chunk-LQ2LGUYJ.js +41 -0
- package/dist/runner/chunk-LQ2LGUYJ.js.map +7 -0
- package/dist/runner/chunk-LYY6RCIE.js +158 -0
- package/dist/runner/chunk-LYY6RCIE.js.map +7 -0
- package/dist/runner/chunk-M4R4QIQH.js +41 -0
- package/dist/runner/chunk-M4R4QIQH.js.map +7 -0
- package/dist/runner/chunk-MC75VXMX.js +207 -0
- package/dist/runner/chunk-MC75VXMX.js.map +7 -0
- package/dist/runner/chunk-NKZU4RRG.js +104 -0
- package/dist/runner/chunk-NKZU4RRG.js.map +7 -0
- package/dist/runner/chunk-PJHWHJ3K.js +56 -0
- package/dist/runner/chunk-PJHWHJ3K.js.map +7 -0
- package/dist/runner/chunk-RIGVYJ2O.js +114 -0
- package/dist/runner/chunk-RIGVYJ2O.js.map +7 -0
- package/dist/runner/chunk-RWRGC7ZK.js +93 -0
- package/dist/runner/chunk-RWRGC7ZK.js.map +7 -0
- package/dist/runner/chunk-SRMAJQMV.js +54 -0
- package/dist/runner/chunk-SRMAJQMV.js.map +7 -0
- package/dist/runner/chunk-TRMFD36J.js +47 -0
- package/dist/runner/chunk-TRMFD36J.js.map +7 -0
- package/dist/runner/chunk-U4IOZYQ3.js +21 -0
- package/dist/runner/chunk-U4IOZYQ3.js.map +7 -0
- package/dist/runner/chunk-UEXDE3WP.js +83 -0
- package/dist/runner/chunk-UEXDE3WP.js.map +7 -0
- package/dist/runner/chunk-UW3GQZSM.js +50 -0
- package/dist/runner/chunk-UW3GQZSM.js.map +7 -0
- package/dist/runner/chunk-V2GSP6VR.js +46 -0
- package/dist/runner/chunk-V2GSP6VR.js.map +7 -0
- package/dist/runner/chunk-VOV4Y5VU.js +81 -0
- package/dist/runner/chunk-VOV4Y5VU.js.map +7 -0
- package/dist/runner/chunk-VT5T6OEI.js +65 -0
- package/dist/runner/chunk-VT5T6OEI.js.map +7 -0
- package/dist/runner/chunk-VUYVFWIN.js +12 -0
- package/dist/runner/chunk-VUYVFWIN.js.map +7 -0
- package/dist/runner/chunk-VVGOPPEN.js +36 -0
- package/dist/runner/chunk-VVGOPPEN.js.map +7 -0
- package/dist/runner/chunk-VXFSLM6P.js +14 -0
- package/dist/runner/chunk-VXFSLM6P.js.map +7 -0
- package/dist/runner/chunk-W3EK7JUT.js +26125 -0
- package/dist/runner/chunk-W3EK7JUT.js.map +7 -0
- package/dist/runner/chunk-WJHNCOUF.js +52 -0
- package/dist/runner/chunk-WJHNCOUF.js.map +7 -0
- package/dist/runner/chunk-WU7ANGCW.js +269 -0
- package/dist/runner/chunk-WU7ANGCW.js.map +7 -0
- package/dist/runner/chunk-X7XLMSZX.js +44 -0
- package/dist/runner/chunk-X7XLMSZX.js.map +7 -0
- package/dist/runner/chunk-XSO3B4QN.js +124 -0
- package/dist/runner/chunk-XSO3B4QN.js.map +7 -0
- package/dist/runner/chunk-YGFN3LN2.js +174 -0
- package/dist/runner/chunk-YGFN3LN2.js.map +7 -0
- package/dist/runner/chunk-YHYDBLVB.js +33 -0
- package/dist/runner/chunk-YHYDBLVB.js.map +7 -0
- package/dist/runner/compact-36NP3PKT.js +60 -0
- package/dist/runner/compact-36NP3PKT.js.map +7 -0
- package/dist/runner/getMachineId-bsd-AGENNHN6.js +42 -0
- package/dist/runner/getMachineId-bsd-AGENNHN6.js.map +7 -0
- package/dist/runner/getMachineId-bsd-I5WZGCL4.js +33 -0
- package/dist/runner/getMachineId-bsd-I5WZGCL4.js.map +7 -0
- package/dist/runner/getMachineId-bsd-ZXK225P7.js +33 -0
- package/dist/runner/getMachineId-bsd-ZXK225P7.js.map +7 -0
- package/dist/runner/getMachineId-darwin-47GDLEXL.js +42 -0
- package/dist/runner/getMachineId-darwin-47GDLEXL.js.map +7 -0
- package/dist/runner/getMachineId-darwin-5CRLMDD6.js +33 -0
- package/dist/runner/getMachineId-darwin-5CRLMDD6.js.map +7 -0
- package/dist/runner/getMachineId-darwin-ADG4I32N.js +33 -0
- package/dist/runner/getMachineId-darwin-ADG4I32N.js.map +7 -0
- package/dist/runner/getMachineId-linux-5KVS3T2M.js +27 -0
- package/dist/runner/getMachineId-linux-5KVS3T2M.js.map +7 -0
- package/dist/runner/getMachineId-linux-GDFB5GSO.js +34 -0
- package/dist/runner/getMachineId-linux-GDFB5GSO.js.map +7 -0
- package/dist/runner/getMachineId-linux-NQMWCRO3.js +27 -0
- package/dist/runner/getMachineId-linux-NQMWCRO3.js.map +7 -0
- package/dist/runner/getMachineId-unsupported-5PFIGMVX.js +18 -0
- package/dist/runner/getMachineId-unsupported-5PFIGMVX.js.map +7 -0
- package/dist/runner/getMachineId-unsupported-DW27K3ZX.js +18 -0
- package/dist/runner/getMachineId-unsupported-DW27K3ZX.js.map +7 -0
- package/dist/runner/getMachineId-unsupported-XV3FHTHD.js +25 -0
- package/dist/runner/getMachineId-unsupported-XV3FHTHD.js.map +7 -0
- package/dist/runner/getMachineId-win-5JVMW3EI.js +44 -0
- package/dist/runner/getMachineId-win-5JVMW3EI.js.map +7 -0
- package/dist/runner/getMachineId-win-SNESQF7R.js +35 -0
- package/dist/runner/getMachineId-win-SNESQF7R.js.map +7 -0
- package/dist/runner/getMachineId-win-UJYHSBM2.js +35 -0
- package/dist/runner/getMachineId-win-UJYHSBM2.js.map +7 -0
- package/dist/runner/git-commit-BA53DOJQ.js +30 -0
- package/dist/runner/git-commit-BA53DOJQ.js.map +7 -0
- package/dist/runner/hook-runner-JHH6PGKE.js +220 -0
- package/dist/runner/hook-runner-JHH6PGKE.js.map +7 -0
- package/dist/runner/judge-transport-R4TF5LEH.js +91 -0
- package/dist/runner/judge-transport-R4TF5LEH.js.map +7 -0
- package/dist/runner/mcp-status-QEUH2KGX.js +89 -0
- package/dist/runner/mcp-status-QEUH2KGX.js.map +7 -0
- package/dist/runner/notification-FKMBCSXF.js +69 -0
- package/dist/runner/notification-FKMBCSXF.js.map +7 -0
- package/dist/runner/post-tool-3MRHTBKH.js +192 -0
- package/dist/runner/post-tool-3MRHTBKH.js.map +7 -0
- package/dist/runner/post-tool-agent-BB34MNHI.js +370 -0
- package/dist/runner/post-tool-agent-BB34MNHI.js.map +7 -0
- package/dist/runner/post-tool-changelog-sync-OP2TT2I7.js +147 -0
- package/dist/runner/post-tool-changelog-sync-OP2TT2I7.js.map +7 -0
- package/dist/runner/post-tool-code-structure-LE7J2SC2.js +130 -0
- package/dist/runner/post-tool-code-structure-LE7J2SC2.js.map +7 -0
- package/dist/runner/post-tool-edit-ledger-IJMEYHKF.js +30 -0
- package/dist/runner/post-tool-edit-ledger-IJMEYHKF.js.map +7 -0
- package/dist/runner/post-tool-failure-XTH2I2Z7.js +111 -0
- package/dist/runner/post-tool-failure-XTH2I2Z7.js.map +7 -0
- package/dist/runner/post-tool-git-E46HZGZO.js +94 -0
- package/dist/runner/post-tool-git-E46HZGZO.js.map +7 -0
- package/dist/runner/post-tool-mcp-AMCDY5GH.js +144 -0
- package/dist/runner/post-tool-mcp-AMCDY5GH.js.map +7 -0
- package/dist/runner/post-tool-task-state-TLDOI33H.js +100 -0
- package/dist/runner/post-tool-task-state-TLDOI33H.js.map +7 -0
- package/dist/runner/pre-tool-SQE2FZQO.js +245 -0
- package/dist/runner/pre-tool-SQE2FZQO.js.map +7 -0
- package/dist/runner/pre-tool-agent-OZUPVFUI.js +218 -0
- package/dist/runner/pre-tool-agent-OZUPVFUI.js.map +7 -0
- package/dist/runner/quality-evaluator-XYNDKDRG.js +901 -0
- package/dist/runner/quality-evaluator-XYNDKDRG.js.map +7 -0
- package/dist/runner/session-end-3MJTDLLA.js +57 -0
- package/dist/runner/session-end-3MJTDLLA.js.map +7 -0
- package/dist/runner/session-start-5ZMCLKBS.js +352 -0
- package/dist/runner/session-start-5ZMCLKBS.js.map +7 -0
- package/dist/runner/shipper-status-MADX6SPG.js +37 -0
- package/dist/runner/shipper-status-MADX6SPG.js.map +7 -0
- package/dist/runner/span-shipper-4HQDHC47.js +3408 -0
- package/dist/runner/span-shipper-4HQDHC47.js.map +7 -0
- package/dist/runner/stop-RTKSIYJV.js +596 -0
- package/dist/runner/stop-RTKSIYJV.js.map +7 -0
- package/dist/runner/subagent-CBCG4OLZ.js +116 -0
- package/dist/runner/subagent-CBCG4OLZ.js.map +7 -0
- package/dist/runner/token-metrics-AD2RAFGM.js +31 -0
- package/dist/runner/token-metrics-AD2RAFGM.js.map +7 -0
- package/dist/runner/user-prompt-T5NZ2UJD.js +376 -0
- package/dist/runner/user-prompt-T5NZ2UJD.js.map +7 -0
- package/package.json +70 -5
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
2
|
+
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
10
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
11
|
+
}) : x)(function(x) {
|
|
12
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
13
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
14
|
+
});
|
|
15
|
+
var __esm = (fn, res, err) => function __init() {
|
|
16
|
+
if (err) throw err[0];
|
|
17
|
+
try {
|
|
18
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw err = [e], e;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
24
|
+
try {
|
|
25
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
26
|
+
} catch (e) {
|
|
27
|
+
throw mod = 0, e;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var __export = (target, all) => {
|
|
31
|
+
for (var name in all)
|
|
32
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
33
|
+
};
|
|
34
|
+
var __copyProps = (to, from, except, desc) => {
|
|
35
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
36
|
+
for (let key of __getOwnPropNames(from))
|
|
37
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
38
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
39
|
+
}
|
|
40
|
+
return to;
|
|
41
|
+
};
|
|
42
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
43
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
44
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
45
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
46
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
47
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
48
|
+
mod
|
|
49
|
+
));
|
|
50
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
__require,
|
|
54
|
+
__esm,
|
|
55
|
+
__commonJS,
|
|
56
|
+
__export,
|
|
57
|
+
__toESM,
|
|
58
|
+
__toCommonJS
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=chunk-GNNKUMRF.js.map
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
2
|
+
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
sessionStateDir
|
|
5
|
+
} from "./chunk-DNSTWC26.js";
|
|
6
|
+
import {
|
|
7
|
+
errorMessage,
|
|
8
|
+
loadJson,
|
|
9
|
+
withFileLock,
|
|
10
|
+
writeJson,
|
|
11
|
+
writeStderr
|
|
12
|
+
} from "./chunk-52RY6LQT.js";
|
|
13
|
+
import {
|
|
14
|
+
DURATION_MS
|
|
15
|
+
} from "./chunk-RWRGC7ZK.js";
|
|
16
|
+
|
|
17
|
+
// lib/agent/agent-context.ts
|
|
18
|
+
import { randomBytes } from "node:crypto";
|
|
19
|
+
import { rmSync } from "node:fs";
|
|
20
|
+
import { join } from "node:path";
|
|
21
|
+
var STORE_FILE = "pending-agents.json";
|
|
22
|
+
var LOCK_FILE = "pending-agents.lock";
|
|
23
|
+
var PENDING_AGENT_TTL_MS = DURATION_MS.THIRTY_MINUTES;
|
|
24
|
+
function readStore(sessionId) {
|
|
25
|
+
const raw = loadJson(join(sessionStateDir(sessionId), STORE_FILE));
|
|
26
|
+
return { pending: raw?.pending ?? {}, seen: raw?.seen ?? {} };
|
|
27
|
+
}
|
|
28
|
+
function writeStore(sessionId, store) {
|
|
29
|
+
writeJson(join(sessionStateDir(sessionId), STORE_FILE), store, false);
|
|
30
|
+
}
|
|
31
|
+
function mutateStore(sessionId, fn) {
|
|
32
|
+
return withFileLock(join(sessionStateDir(sessionId), LOCK_FILE), () => {
|
|
33
|
+
const store = readStore(sessionId);
|
|
34
|
+
pruneStale(store);
|
|
35
|
+
const result = fn(store);
|
|
36
|
+
writeStore(sessionId, store);
|
|
37
|
+
return result;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function pruneStale(store) {
|
|
41
|
+
const cutoff = Date.now() - PENDING_AGENT_TTL_MS;
|
|
42
|
+
for (const [name, records] of Object.entries(store.pending)) {
|
|
43
|
+
const live = records.filter((r) => r.startTimeMs >= cutoff);
|
|
44
|
+
if (live.length === 0) delete store.pending[name];
|
|
45
|
+
else if (live.length !== records.length) store.pending[name] = live;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function generateHex(bytes) {
|
|
49
|
+
return randomBytes(bytes).toString("hex");
|
|
50
|
+
}
|
|
51
|
+
function latestForegroundParent(store) {
|
|
52
|
+
let newest;
|
|
53
|
+
for (const records of Object.values(store.pending)) {
|
|
54
|
+
for (const r of records) {
|
|
55
|
+
if (r.isBackground) continue;
|
|
56
|
+
if (!newest || r.startTimeMs > newest.startTimeMs) newest = r;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return newest?.invokeSpanId;
|
|
60
|
+
}
|
|
61
|
+
function savePendingAgent(input) {
|
|
62
|
+
return mutateStore(input.sessionId, (store) => {
|
|
63
|
+
const existingCreateSpanId = store.seen[input.agentName];
|
|
64
|
+
const isFirstSeen = existingCreateSpanId === void 0;
|
|
65
|
+
const createSpanId = existingCreateSpanId ?? input.createSpanId;
|
|
66
|
+
if (isFirstSeen) store.seen[input.agentName] = createSpanId;
|
|
67
|
+
const record = {
|
|
68
|
+
...input,
|
|
69
|
+
createSpanId,
|
|
70
|
+
isFirstSeen,
|
|
71
|
+
parentAgentInvokeSpanId: latestForegroundParent(store)
|
|
72
|
+
};
|
|
73
|
+
(store.pending[input.agentName] ??= []).push(record);
|
|
74
|
+
return record;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function popPendingAgent(sessionId, agentName, toolUseId) {
|
|
78
|
+
return mutateStore(sessionId, (store) => {
|
|
79
|
+
const records = store.pending[agentName];
|
|
80
|
+
if (!records) return void 0;
|
|
81
|
+
const exact = toolUseId ? records.findIndex((r) => r.toolUseId === toolUseId) : -1;
|
|
82
|
+
const index = exact >= 0 ? exact : records.map((r) => !r.toolUseId).lastIndexOf(true);
|
|
83
|
+
if (index < 0) return void 0;
|
|
84
|
+
const [record] = records.splice(index, 1);
|
|
85
|
+
if (records.length === 0) delete store.pending[agentName];
|
|
86
|
+
return record;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function clearSession(sessionId) {
|
|
90
|
+
const dir = sessionStateDir(sessionId);
|
|
91
|
+
for (const file of [STORE_FILE, LOCK_FILE]) {
|
|
92
|
+
try {
|
|
93
|
+
rmSync(join(dir, file), { force: true, recursive: true });
|
|
94
|
+
} catch (error) {
|
|
95
|
+
writeStderr(
|
|
96
|
+
`[agent-context] failed to clear ${file} for session ${sessionId}:`,
|
|
97
|
+
errorMessage(error)
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function getAgentStateSizes(sessionId) {
|
|
103
|
+
const store = readStore(sessionId);
|
|
104
|
+
return {
|
|
105
|
+
pending: Object.values(store.pending).reduce((n, r) => n + r.length, 0),
|
|
106
|
+
seen: Object.keys(store.seen).length
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export {
|
|
111
|
+
PENDING_AGENT_TTL_MS,
|
|
112
|
+
generateHex,
|
|
113
|
+
savePendingAgent,
|
|
114
|
+
popPendingAgent,
|
|
115
|
+
clearSession,
|
|
116
|
+
getAgentStateSizes
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=chunk-I7TD2QVR.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../lib/agent/agent-context.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Cross-process state for synthesized agent spans: the pre-tool process that opens\n * an invocation and the post-tool process that closes it share no memory, so the\n * record lives in the session-state directory. On disk, not module-level Maps \u2014\n * those passed every test (vitest runs both handlers in one process) and emitted\n * zero spans in production for six months (PT2). Deliberately touched only by\n * agent events, never the builtin hot path.\n */\n\nimport { randomBytes } from 'node:crypto';\nimport { rmSync } from 'node:fs';\nimport { join } from 'node:path';\nimport type { SpanKind, SpanStatus } from '@opentelemetry/api';\nimport { loadJson, writeJson, withFileLock } from '../core/file-utils.js';\nimport { errorMessage, writeStderr } from '../core/format-utils.js';\nimport { DURATION_MS } from '../core/units.js';\nimport { sessionStateDir } from '../session/session-state.js';\n\n// \u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/** A cross-trace link back to the dispatching span (OBP6); parent-child is reserved for same-trace nesting. */\nexport interface SynthSpanLink {\n traceId: string;\n spanId: string;\n /** Defaults to SAMPLED. */\n traceFlags?: number;\n attributes?: Record<string, string | number | boolean>;\n}\n\nexport interface SynthSpan {\n name: string;\n traceId: string;\n spanId: string;\n parentSpanId?: string;\n startTimeMs: number;\n endTimeMs: number;\n attributes: Record<string, string | number | boolean>;\n links?: SynthSpanLink[];\n /** Defaults to INTERNAL (OBP6/F14). */\n kind?: SpanKind;\n /** Defaults to UNSET (HLS41). */\n status?: SpanStatus;\n}\n\nexport interface PendingAgent {\n sessionId: string;\n agentName: string;\n startTimeMs: number;\n traceId: string;\n invokeSpanId: string;\n /** Assigned on the session's first invocation of the agent and reused thereafter, so `invoke_agent` always has a real parent. */\n createSpanId: string;\n /** Gates create_agent emission. */\n isFirstSeen: boolean;\n /** A background agent's post-tool fires at launch, not completion. */\n isBackground: boolean;\n /** The dispatching call's `tool_use_id`, which the post-tool event repeats. */\n toolUseId?: string;\n /** The dispatching span, for the invoke_agent link (OBP6). */\n dispatchLink?: SynthSpanLink;\n /** The dispatching agent's invokeSpanId, when nested (\u00A712.10). */\n parentAgentInvokeSpanId?: string;\n}\n\n/** The omitted fields are resolved by the store against session state, so they are outputs of `savePendingAgent`. */\nexport type PendingAgentInput =\n Omit<PendingAgent, 'isFirstSeen' | 'createSpanId' | 'parentAgentInvokeSpanId'> &\n { /** Candidate, used only on the session's first invocation. */ createSpanId: string };\n\ninterface AgentStore {\n /** Oldest first; popped by `toolUseId`, else LIFO. */\n pending: Record<string, PendingAgent[]>;\n /** agentName \u2192 create_agent spanId. */\n seen: Record<string, string>;\n}\n\n// \u2500\u2500 Storage \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst STORE_FILE = 'pending-agents.json';\nconst LOCK_FILE = 'pending-agents.lock';\n\n/** An invocation with no post-tool event would otherwise be popped by an unrelated later one. */\nexport const PENDING_AGENT_TTL_MS = DURATION_MS.THIRTY_MINUTES;\n\nfunction readStore(sessionId: string): AgentStore {\n const raw = loadJson<Partial<AgentStore>>(join(sessionStateDir(sessionId), STORE_FILE));\n return { pending: raw?.pending ?? {}, seen: raw?.seen ?? {} };\n}\n\n/** Not `silent`: a failed write has no other symptom, and is the shape of the PT2 outage. */\nfunction writeStore(sessionId: string, store: AgentStore): void {\n writeJson(join(sessionStateDir(sessionId), STORE_FILE), store, false);\n}\n\n/** Under the lock: a background agent's pre-tool can land while another's post-tool writes, and a lost update drops an invocation silently. */\nfunction mutateStore<T>(sessionId: string, fn: (store: AgentStore) => T): T {\n return withFileLock(join(sessionStateDir(sessionId), LOCK_FILE), () => {\n const store = readStore(sessionId);\n pruneStale(store);\n const result = fn(store);\n writeStore(sessionId, store);\n return result;\n });\n}\n\nfunction pruneStale(store: AgentStore): void {\n const cutoff = Date.now() - PENDING_AGENT_TTL_MS;\n for (const [name, records] of Object.entries(store.pending)) {\n const live = records.filter((r) => r.startTimeMs >= cutoff);\n if (live.length === 0) delete store.pending[name];\n else if (live.length !== records.length) store.pending[name] = live;\n }\n}\n\n// \u2500\u2500 Helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function generateHex(bytes: number): string {\n return randomBytes(bytes).toString('hex');\n}\n\n/** The dispatching parent of an agent starting now (\u00A712.10); a background agent is not it. */\nfunction latestForegroundParent(store: AgentStore): string | undefined {\n let newest: PendingAgent | undefined;\n for (const records of Object.values(store.pending)) {\n for (const r of records) {\n if (r.isBackground) continue;\n if (!newest || r.startTimeMs > newest.startTimeMs) newest = r;\n }\n }\n return newest?.invokeSpanId;\n}\n\n// \u2500\u2500 Lifecycle \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function savePendingAgent(input: PendingAgentInput): PendingAgent {\n return mutateStore(input.sessionId, (store) => {\n const existingCreateSpanId = store.seen[input.agentName];\n const isFirstSeen = existingCreateSpanId === undefined;\n const createSpanId = existingCreateSpanId ?? input.createSpanId;\n if (isFirstSeen) store.seen[input.agentName] = createSpanId;\n\n const record: PendingAgent = {\n ...input,\n createSpanId,\n isFirstSeen,\n parentAgentInvokeSpanId: latestForegroundParent(store),\n };\n\n (store.pending[input.agentName] ??= []).push(record);\n return record;\n });\n}\n\n/**\n * The record saved under the same `toolUseId`; failing that, the newest record saved without\n * an id (the innermost of overlapping invocations). A record that carries an id goes only to\n * its own call.\n */\nexport function popPendingAgent(sessionId: string, agentName: string, toolUseId?: string): PendingAgent | undefined {\n return mutateStore(sessionId, (store) => {\n const records = store.pending[agentName];\n if (!records) return undefined;\n const exact = toolUseId ? records.findIndex((r) => r.toolUseId === toolUseId) : -1;\n const index = exact >= 0 ? exact : records.map((r) => !r.toolUseId).lastIndexOf(true);\n if (index < 0) return undefined;\n const [record] = records.splice(index, 1);\n if (records.length === 0) delete store.pending[agentName];\n return record;\n });\n}\n\n/** Reported, not swallowed: a surviving `seen` makes the next session on this id skip every `create_agent` span. */\nexport function clearSession(sessionId: string): void {\n const dir = sessionStateDir(sessionId);\n for (const file of [STORE_FILE, LOCK_FILE]) {\n try {\n rmSync(join(dir, file), { force: true, recursive: true });\n } catch (error) {\n writeStderr(\n `[agent-context] failed to clear ${file} for session ${sessionId}:`,\n errorMessage(error)\n );\n }\n }\n}\n\n/** For tests and diagnostics. */\nexport function getAgentStateSizes(sessionId: string): { pending: number; seen: number } {\n const store = readStore(sessionId);\n return {\n pending: Object.values(store.pending).reduce((n, r) => n + r.length, 0),\n seen: Object.keys(store.seen).length,\n };\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
2
|
+
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// lib/core/http-utils.ts
|
|
5
|
+
var AUTHORIZATION_HEADER = "Authorization";
|
|
6
|
+
var BEARER_SCHEME = "Bearer";
|
|
7
|
+
var CONTENT_TYPE_HEADER = "Content-Type";
|
|
8
|
+
var JSON_CONTENT_TYPE = "application/json";
|
|
9
|
+
function bearerCredential(apiKey) {
|
|
10
|
+
return `${BEARER_SCHEME} ${apiKey}`;
|
|
11
|
+
}
|
|
12
|
+
function bearerHeaders(apiKey) {
|
|
13
|
+
return { [AUTHORIZATION_HEADER]: bearerCredential(apiKey) };
|
|
14
|
+
}
|
|
15
|
+
function jsonHeaders(headers = {}) {
|
|
16
|
+
return { ...headers, [CONTENT_TYPE_HEADER]: JSON_CONTENT_TYPE };
|
|
17
|
+
}
|
|
18
|
+
var HTTP_STATUS = {
|
|
19
|
+
OK: 200,
|
|
20
|
+
MULTIPLE_CHOICES: 300,
|
|
21
|
+
UNAUTHORIZED: 401,
|
|
22
|
+
REQUEST_TIMEOUT: 408,
|
|
23
|
+
CONFLICT: 409,
|
|
24
|
+
TOO_MANY_REQUESTS: 429,
|
|
25
|
+
INTERNAL_SERVER_ERROR: 500
|
|
26
|
+
};
|
|
27
|
+
var RETRYABLE_HTTP_STATUSES = /* @__PURE__ */ new Set([
|
|
28
|
+
HTTP_STATUS.REQUEST_TIMEOUT,
|
|
29
|
+
HTTP_STATUS.CONFLICT,
|
|
30
|
+
HTTP_STATUS.TOO_MANY_REQUESTS
|
|
31
|
+
]);
|
|
32
|
+
function isRetryableHttpStatus(status) {
|
|
33
|
+
return RETRYABLE_HTTP_STATUSES.has(status) || status >= HTTP_STATUS.INTERNAL_SERVER_ERROR;
|
|
34
|
+
}
|
|
35
|
+
function isSuccessHttpStatus(status) {
|
|
36
|
+
return status >= HTTP_STATUS.OK && status < HTTP_STATUS.MULTIPLE_CHOICES;
|
|
37
|
+
}
|
|
38
|
+
function errorCode(error) {
|
|
39
|
+
const code = error?.code;
|
|
40
|
+
return typeof code === "string" ? code : void 0;
|
|
41
|
+
}
|
|
42
|
+
var MAX_CAUSE_DEPTH = 8;
|
|
43
|
+
function* errorCauseChain(error) {
|
|
44
|
+
let current = error;
|
|
45
|
+
yield current;
|
|
46
|
+
for (let depth = 0; depth < MAX_CAUSE_DEPTH; depth++) {
|
|
47
|
+
const { cause } = current;
|
|
48
|
+
if (!(cause instanceof Error)) return;
|
|
49
|
+
current = cause;
|
|
50
|
+
yield current;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
var TIMEOUT_ERROR_NAMES = /* @__PURE__ */ new Set(["TimeoutError", "AbortError"]);
|
|
54
|
+
var TIMEOUT_ERROR_CODES = /* @__PURE__ */ new Set(["UND_ERR_HEADERS_TIMEOUT", "UND_ERR_BODY_TIMEOUT", "UND_ERR_ABORTED"]);
|
|
55
|
+
function isHttpTimeoutError(error) {
|
|
56
|
+
if (!(error instanceof Error)) return false;
|
|
57
|
+
const code = errorCode(error);
|
|
58
|
+
return TIMEOUT_ERROR_NAMES.has(error.name) || code !== void 0 && TIMEOUT_ERROR_CODES.has(code);
|
|
59
|
+
}
|
|
60
|
+
async function fetchWithTimeout(url, init, timeoutMs, fetchFn = (input, requestInit) => globalThis.fetch(input, requestInit)) {
|
|
61
|
+
return fetchFn(url, { ...init, signal: AbortSignal.timeout(timeoutMs) });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
AUTHORIZATION_HEADER,
|
|
66
|
+
BEARER_SCHEME,
|
|
67
|
+
CONTENT_TYPE_HEADER,
|
|
68
|
+
bearerHeaders,
|
|
69
|
+
jsonHeaders,
|
|
70
|
+
HTTP_STATUS,
|
|
71
|
+
isRetryableHttpStatus,
|
|
72
|
+
isSuccessHttpStatus,
|
|
73
|
+
errorCode,
|
|
74
|
+
errorCauseChain,
|
|
75
|
+
isHttpTimeoutError,
|
|
76
|
+
fetchWithTimeout
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=chunk-IJ4SLUBV.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../lib/core/http-utils.ts"],
|
|
4
|
+
"sourcesContent": ["export const AUTHORIZATION_HEADER = 'Authorization';\nexport const BEARER_SCHEME = 'Bearer';\nexport const CONTENT_TYPE_HEADER = 'Content-Type';\nexport const JSON_CONTENT_TYPE = 'application/json';\n\n/** `Bearer <token>`, shared by the OTLP shipper, the judge and the MCP launcher. */\nexport function bearerCredential(apiKey: string): string {\n return `${BEARER_SCHEME} ${apiKey}`;\n}\n\nexport function bearerHeaders(apiKey: string): Record<string, string> {\n return { [AUTHORIZATION_HEADER]: bearerCredential(apiKey) };\n}\n\n/** JSON request headers; `Content-Type` last so a caller's bag cannot override it. */\nexport function jsonHeaders(headers: Record<string, string> = {}): Record<string, string> {\n return { ...headers, [CONTENT_TYPE_HEADER]: JSON_CONTENT_TYPE };\n}\n\n/** Status codes the hooks branch on by name. */\nexport const HTTP_STATUS = {\n OK: 200,\n MULTIPLE_CHOICES: 300,\n UNAUTHORIZED: 401,\n REQUEST_TIMEOUT: 408,\n CONFLICT: 409,\n TOO_MANY_REQUESTS: 429,\n INTERNAL_SERVER_ERROR: 500,\n} as const;\n\n/** Retried in place, along with every 5xx (529 is Anthropic's overloaded). */\nconst RETRYABLE_HTTP_STATUSES = new Set<number>([\n HTTP_STATUS.REQUEST_TIMEOUT,\n HTTP_STATUS.CONFLICT,\n HTTP_STATUS.TOO_MANY_REQUESTS,\n]);\n\nexport function isRetryableHttpStatus(status: number): boolean {\n return RETRYABLE_HTTP_STATUSES.has(status) || status >= HTTP_STATUS.INTERNAL_SERVER_ERROR;\n}\n\n/** 2xx, what `Response.ok` means. */\nexport function isSuccessHttpStatus(status: number): boolean {\n return status >= HTTP_STATUS.OK && status < HTTP_STATUS.MULTIPLE_CHOICES;\n}\n\n/** `error.code` when it is a string, as on Node and undici transport errors. */\nexport function errorCode(error: unknown): string | undefined {\n const code = (error as { code?: unknown } | null)?.code;\n return typeof code === 'string' ? code : undefined;\n}\n\n/** A cyclic cause chain must not loop forever in the process walking it. */\nconst MAX_CAUSE_DEPTH = 8;\n\n/** `error`, then each `Error` on its `cause` chain, at most `MAX_CAUSE_DEPTH` causes deep. */\nexport function* errorCauseChain(error: Error): Generator<Error> {\n let current: Error = error;\n yield current;\n for (let depth = 0; depth < MAX_CAUSE_DEPTH; depth++) {\n const { cause } = current as { cause?: unknown };\n if (!(cause instanceof Error)) return;\n current = cause;\n yield current;\n }\n}\n\n/** `AbortSignal.timeout` throws `TimeoutError`; `AbortError` keeps the series continuous with older spans. */\nconst TIMEOUT_ERROR_NAMES = new Set(['TimeoutError', 'AbortError']);\nconst TIMEOUT_ERROR_CODES = new Set(['UND_ERR_HEADERS_TIMEOUT', 'UND_ERR_BODY_TIMEOUT', 'UND_ERR_ABORTED']);\n\n/** A request that ran out of time or was aborted, from either `fetch` or undici's dispatcher. */\nexport function isHttpTimeoutError(error: unknown): boolean {\n if (!(error instanceof Error)) return false;\n const code = errorCode(error);\n return TIMEOUT_ERROR_NAMES.has(error.name) || (code !== undefined && TIMEOUT_ERROR_CODES.has(code));\n}\n\n/**\n * `fetch` with an `AbortSignal.timeout` deadline covering the body read too. Async so a\n * synchronous throw from `fetchFn` (or an invalid `timeoutMs`) still arrives as a rejection.\n */\nexport async function fetchWithTimeout(\n url: string,\n init: Omit<RequestInit, 'signal'>,\n timeoutMs: number,\n fetchFn: typeof globalThis.fetch = (input, requestInit) => globalThis.fetch(input, requestInit),\n): Promise<Response> {\n return fetchFn(url, { ...init, signal: AbortSignal.timeout(timeoutMs) });\n}\n"],
|
|
5
|
+
"mappings": ";;;;AAAO,IAAM,uBAAuB;AAC7B,IAAM,gBAAgB;AACtB,IAAM,sBAAsB;AAC5B,IAAM,oBAAoB;AAG1B,SAAS,iBAAiB,QAAwB;AACvD,SAAO,GAAG,aAAa,IAAI,MAAM;AACnC;AAEO,SAAS,cAAc,QAAwC;AACpE,SAAO,EAAE,CAAC,oBAAoB,GAAG,iBAAiB,MAAM,EAAE;AAC5D;AAGO,SAAS,YAAY,UAAkC,CAAC,GAA2B;AACxF,SAAO,EAAE,GAAG,SAAS,CAAC,mBAAmB,GAAG,kBAAkB;AAChE;AAGO,IAAM,cAAc;AAAA,EACzB,IAAI;AAAA,EACJ,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,uBAAuB;AACzB;AAGA,IAAM,0BAA0B,oBAAI,IAAY;AAAA,EAC9C,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AACd,CAAC;AAEM,SAAS,sBAAsB,QAAyB;AAC7D,SAAO,wBAAwB,IAAI,MAAM,KAAK,UAAU,YAAY;AACtE;AAGO,SAAS,oBAAoB,QAAyB;AAC3D,SAAO,UAAU,YAAY,MAAM,SAAS,YAAY;AAC1D;AAGO,SAAS,UAAU,OAAoC;AAC5D,QAAM,OAAQ,OAAqC;AACnD,SAAO,OAAO,SAAS,WAAW,OAAO;AAC3C;AAGA,IAAM,kBAAkB;AAGjB,UAAU,gBAAgB,OAAgC;AAC/D,MAAI,UAAiB;AACrB,QAAM;AACN,WAAS,QAAQ,GAAG,QAAQ,iBAAiB,SAAS;AACpD,UAAM,EAAE,MAAM,IAAI;AAClB,QAAI,EAAE,iBAAiB,OAAQ;AAC/B,cAAU;AACV,UAAM;AAAA,EACR;AACF;AAGA,IAAM,sBAAsB,oBAAI,IAAI,CAAC,gBAAgB,YAAY,CAAC;AAClE,IAAM,sBAAsB,oBAAI,IAAI,CAAC,2BAA2B,wBAAwB,iBAAiB,CAAC;AAGnG,SAAS,mBAAmB,OAAyB;AAC1D,MAAI,EAAE,iBAAiB,OAAQ,QAAO;AACtC,QAAM,OAAO,UAAU,KAAK;AAC5B,SAAO,oBAAoB,IAAI,MAAM,IAAI,KAAM,SAAS,UAAa,oBAAoB,IAAI,IAAI;AACnG;AAMA,eAAsB,iBACpB,KACA,MACA,WACA,UAAmC,CAAC,OAAO,gBAAgB,WAAW,MAAM,OAAO,WAAW,GAC3E;AACnB,SAAO,QAAQ,KAAK,EAAE,GAAG,MAAM,QAAQ,YAAY,QAAQ,SAAS,EAAE,CAAC;AACzE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
2
|
+
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
claimOnce,
|
|
5
|
+
sessionMarkerPath,
|
|
6
|
+
sessionStateDir,
|
|
7
|
+
sessionStateRoot
|
|
8
|
+
} from "./chunk-DNSTWC26.js";
|
|
9
|
+
import {
|
|
10
|
+
toSafeFilename
|
|
11
|
+
} from "./chunk-52RY6LQT.js";
|
|
12
|
+
|
|
13
|
+
// lib/mcp/mcp-failure-latch.ts
|
|
14
|
+
import { mkdirSync, rmSync } from "node:fs";
|
|
15
|
+
import { join } from "node:path";
|
|
16
|
+
var MCP_FAILURES_DIRNAME = "mcp-failures";
|
|
17
|
+
function failuresDir(sessionId, stateRoot) {
|
|
18
|
+
return join(sessionStateDir(sessionId, stateRoot), MCP_FAILURES_DIRNAME);
|
|
19
|
+
}
|
|
20
|
+
function claimFailureReport(sessionId, server, stateRoot = sessionStateRoot()) {
|
|
21
|
+
const marker = sessionMarkerPath(sessionId, join(MCP_FAILURES_DIRNAME, toSafeFilename(server)), stateRoot);
|
|
22
|
+
return claimOnce(marker, { mkdir: (dir) => mkdirSync(dir, { recursive: true }) });
|
|
23
|
+
}
|
|
24
|
+
function resetFailureTracking(sessionId, stateRoot = sessionStateRoot()) {
|
|
25
|
+
rmSync(failuresDir(sessionId, stateRoot), { recursive: true, force: true });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
claimFailureReport,
|
|
30
|
+
resetFailureTracking
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chunk-IY7AP7NA.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../lib/mcp/mcp-failure-latch.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Per-session latch reporting each unavailable MCP server once. On disk because\n * every hook is its own process; reset at session start so a reused id reports afresh.\n */\n\nimport { mkdirSync, rmSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { toSafeFilename } from '../core/file-utils.js';\nimport { claimOnce, sessionMarkerPath, sessionStateDir, sessionStateRoot } from '../session/session-state.js';\n\nconst MCP_FAILURES_DIRNAME = 'mcp-failures';\n\nfunction failuresDir(sessionId: string, stateRoot: string): string {\n return join(sessionStateDir(sessionId, stateRoot), MCP_FAILURES_DIRNAME);\n}\n\n/** Atomic per-session claim. `stateRoot` keeps tests out of $HOME. */\nexport function claimFailureReport(sessionId: string, server: string, stateRoot: string = sessionStateRoot()): boolean {\n const marker = sessionMarkerPath(sessionId, join(MCP_FAILURES_DIRNAME, toSafeFilename(server)), stateRoot);\n // Uncached mkdir: resetFailureTracking deletes this dir, so the memoized ensureDirExists would hit stale.\n return claimOnce(marker, { mkdir: (dir) => mkdirSync(dir, { recursive: true }) });\n}\n\n/** Called at session start so a session that reuses an id reports its failures afresh. */\nexport function resetFailureTracking(sessionId: string, stateRoot: string = sessionStateRoot()): void {\n rmSync(failuresDir(sessionId, stateRoot), { recursive: true, force: true });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAKA,SAAS,WAAW,cAAc;AAClC,SAAS,YAAY;AAIrB,IAAM,uBAAuB;AAE7B,SAAS,YAAY,WAAmB,WAA2B;AACjE,SAAO,KAAK,gBAAgB,WAAW,SAAS,GAAG,oBAAoB;AACzE;AAGO,SAAS,mBAAmB,WAAmB,QAAgB,YAAoB,iBAAiB,GAAY;AACrH,QAAM,SAAS,kBAAkB,WAAW,KAAK,sBAAsB,eAAe,MAAM,CAAC,GAAG,SAAS;AAEzG,SAAO,UAAU,QAAQ,EAAE,OAAO,CAAC,QAAQ,UAAU,KAAK,EAAE,WAAW,KAAK,CAAC,EAAE,CAAC;AAClF;AAGO,SAAS,qBAAqB,WAAmB,YAAoB,iBAAiB,GAAS;AACpG,SAAO,YAAY,WAAW,SAAS,GAAG,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAC5E;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
2
|
+
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
spawnDetachedRunner
|
|
5
|
+
} from "./chunk-UEXDE3WP.js";
|
|
6
|
+
import {
|
|
7
|
+
DOPPLER_BIN,
|
|
8
|
+
DOPPLER_CONFIGS,
|
|
9
|
+
DOPPLER_PROJECT
|
|
10
|
+
} from "./chunk-GG2I4TGI.js";
|
|
11
|
+
import {
|
|
12
|
+
qualityStateDir
|
|
13
|
+
} from "./chunk-DNSTWC26.js";
|
|
14
|
+
import {
|
|
15
|
+
EVALUATE_QUALITY_ARG,
|
|
16
|
+
FILE_LOCK,
|
|
17
|
+
loadJson,
|
|
18
|
+
tryWithFileLock,
|
|
19
|
+
utcDateStamp,
|
|
20
|
+
writeJson
|
|
21
|
+
} from "./chunk-52RY6LQT.js";
|
|
22
|
+
import {
|
|
23
|
+
isByteCount
|
|
24
|
+
} from "./chunk-RWRGC7ZK.js";
|
|
25
|
+
|
|
26
|
+
// lib/quality/quality-budget.ts
|
|
27
|
+
import { join } from "node:path";
|
|
28
|
+
var BUDGET_LOCK_OPTIONS = {
|
|
29
|
+
maxRetries: FILE_LOCK.BUDGET_MAX_RETRIES,
|
|
30
|
+
retryDelayMs: FILE_LOCK.BUDGET_RETRY_DELAY_MS,
|
|
31
|
+
staleMs: FILE_LOCK.BUDGET_STALE_MS
|
|
32
|
+
};
|
|
33
|
+
var DAILY_BUDGET_CENTS = 50;
|
|
34
|
+
var COST_PER_METRIC_CENTS = 0.75;
|
|
35
|
+
var BUDGET_FILENAME = "budget.json";
|
|
36
|
+
function getBudgetPath() {
|
|
37
|
+
return join(qualityStateDir(), BUDGET_FILENAME);
|
|
38
|
+
}
|
|
39
|
+
function loadBudget(path) {
|
|
40
|
+
const date = utcDateStamp();
|
|
41
|
+
const parsed = loadJson(path);
|
|
42
|
+
if (parsed?.date !== date) {
|
|
43
|
+
return { date, evaluationsRun: 0, estimatedCostCents: 0 };
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
date,
|
|
47
|
+
evaluationsRun: Number(parsed.evaluationsRun ?? 0),
|
|
48
|
+
estimatedCostCents: Number(parsed.estimatedCostCents ?? 0)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function saveBudget(path, state) {
|
|
52
|
+
return writeJson(path, state, false, { silent: true });
|
|
53
|
+
}
|
|
54
|
+
function hasBudget() {
|
|
55
|
+
const state = loadBudget(getBudgetPath());
|
|
56
|
+
return state.estimatedCostCents < DAILY_BUDGET_CENTS;
|
|
57
|
+
}
|
|
58
|
+
function mutateBudget(fn) {
|
|
59
|
+
try {
|
|
60
|
+
const path = getBudgetPath();
|
|
61
|
+
const outcome = tryWithFileLock(path, () => {
|
|
62
|
+
const state = loadBudget(path);
|
|
63
|
+
if (fn(state) === false) return false;
|
|
64
|
+
return saveBudget(path, state);
|
|
65
|
+
}, BUDGET_LOCK_OPTIONS);
|
|
66
|
+
return outcome.locked && outcome.value;
|
|
67
|
+
} catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function tryReserveBudget(costCents = COST_PER_METRIC_CENTS) {
|
|
72
|
+
return mutateBudget((state) => {
|
|
73
|
+
if (state.estimatedCostCents + costCents > DAILY_BUDGET_CENTS) return false;
|
|
74
|
+
state.evaluationsRun += 1;
|
|
75
|
+
state.estimatedCostCents += costCents;
|
|
76
|
+
return true;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function trueUpBudget(actualCents, reservedCents) {
|
|
80
|
+
const delta = actualCents - reservedCents;
|
|
81
|
+
if (delta === 0) return;
|
|
82
|
+
mutateBudget((state) => {
|
|
83
|
+
state.estimatedCostCents = Math.max(0, state.estimatedCostCents + delta);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function releaseBudget(costCents = COST_PER_METRIC_CENTS) {
|
|
87
|
+
mutateBudget((state) => {
|
|
88
|
+
state.evaluationsRun = Math.max(0, state.evaluationsRun - 1);
|
|
89
|
+
state.estimatedCostCents = Math.max(0, state.estimatedCostCents - costCents);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function getBudgetUsage() {
|
|
93
|
+
const state = loadBudget(getBudgetPath());
|
|
94
|
+
return {
|
|
95
|
+
evaluationsRun: state.evaluationsRun,
|
|
96
|
+
estimatedCostCents: state.estimatedCostCents,
|
|
97
|
+
budgetCents: DAILY_BUDGET_CENTS,
|
|
98
|
+
remaining: Math.max(0, DAILY_BUDGET_CENTS - state.estimatedCostCents)
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// lib/quality/quality-eval-handoff.ts
|
|
103
|
+
var QUALITY_ATTRS = {
|
|
104
|
+
EVAL_TYPE: "integritystudio.quality.eval_type",
|
|
105
|
+
CANARY: "integritystudio.quality.canary",
|
|
106
|
+
TRANSCRIPT_BYTES: "integritystudio.quality.transcript_bytes",
|
|
107
|
+
EVAL_QUEUED: "integritystudio.quality.eval_queued",
|
|
108
|
+
/** Why a sampled session produced no evaluation; set by either side of the handoff. */
|
|
109
|
+
EVAL_SKIPPED_REASON: "integritystudio.quality.eval_skipped_reason",
|
|
110
|
+
EVAL_SKIPPED_DETAIL: "integritystudio.quality.eval_skipped_detail",
|
|
111
|
+
TURNS_SAMPLED: "integritystudio.quality.turns_sampled",
|
|
112
|
+
TURNS_TOTAL: "integritystudio.quality.turns_total",
|
|
113
|
+
META_EVALS_RUN: "integritystudio.quality.meta_evals_run",
|
|
114
|
+
META_EVAL_UNAVAILABLE_REASON: "integritystudio.quality.meta_eval_unavailable_reason",
|
|
115
|
+
EVAL_DURATION_MS: "integritystudio.quality.eval_duration_ms",
|
|
116
|
+
BUDGET_USED_CENTS: "integritystudio.quality.budget_used_cents",
|
|
117
|
+
BUDGET_REMAINING_CENTS: "integritystudio.quality.budget_remaining_cents",
|
|
118
|
+
STATUS: "integritystudio.quality.status",
|
|
119
|
+
CONFIRMED: "integritystudio.quality.confirmed",
|
|
120
|
+
METRIC_NAME: "integritystudio.quality.metric_name",
|
|
121
|
+
CONSECUTIVE_BREACHES: "integritystudio.quality.consecutive_breaches",
|
|
122
|
+
DRIFT_DETECTED: "integritystudio.quality.drift_detected"
|
|
123
|
+
};
|
|
124
|
+
var QUALITY_EVAL_SKIP_REASONS = {
|
|
125
|
+
NO_TRANSCRIPT: "no_transcript",
|
|
126
|
+
NO_TURNS: "no_turns"
|
|
127
|
+
};
|
|
128
|
+
var QUALITY_EVALUATION_HOOK_TYPE = "quality-evaluation";
|
|
129
|
+
var QUALITY_EVAL_TYPE_LLM = "llm";
|
|
130
|
+
function encodeEvaluationArgs(record) {
|
|
131
|
+
return [
|
|
132
|
+
record.sessionId,
|
|
133
|
+
String(record.canary),
|
|
134
|
+
record.transcriptPath,
|
|
135
|
+
String(record.transcriptBytes)
|
|
136
|
+
];
|
|
137
|
+
}
|
|
138
|
+
function parseEvaluationArgs(args) {
|
|
139
|
+
const [sessionId, canaryStr, transcriptPath, transcriptBytesStr] = args;
|
|
140
|
+
if (typeof sessionId !== "string" || !sessionId || typeof transcriptPath !== "string" || !transcriptPath) return null;
|
|
141
|
+
const transcriptBytes = Number(transcriptBytesStr);
|
|
142
|
+
if (!isByteCount(transcriptBytes)) return null;
|
|
143
|
+
return {
|
|
144
|
+
sessionId,
|
|
145
|
+
canary: canaryStr === "true",
|
|
146
|
+
transcriptPath,
|
|
147
|
+
transcriptBytes
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function spawnQualityEvaluator(record) {
|
|
151
|
+
const dopplerPrefix = [
|
|
152
|
+
DOPPLER_BIN,
|
|
153
|
+
"run",
|
|
154
|
+
"--project",
|
|
155
|
+
DOPPLER_PROJECT,
|
|
156
|
+
"--config",
|
|
157
|
+
DOPPLER_CONFIGS.PRD,
|
|
158
|
+
"--"
|
|
159
|
+
];
|
|
160
|
+
return spawnDetachedRunner([EVALUATE_QUALITY_ARG, ...encodeEvaluationArgs(record)], dopplerPrefix);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export {
|
|
164
|
+
COST_PER_METRIC_CENTS,
|
|
165
|
+
hasBudget,
|
|
166
|
+
tryReserveBudget,
|
|
167
|
+
trueUpBudget,
|
|
168
|
+
releaseBudget,
|
|
169
|
+
getBudgetUsage,
|
|
170
|
+
QUALITY_ATTRS,
|
|
171
|
+
QUALITY_EVAL_SKIP_REASONS,
|
|
172
|
+
QUALITY_EVALUATION_HOOK_TYPE,
|
|
173
|
+
QUALITY_EVAL_TYPE_LLM,
|
|
174
|
+
parseEvaluationArgs,
|
|
175
|
+
spawnQualityEvaluator
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=chunk-J3F3Z3EQ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../lib/quality/quality-budget.ts", "../../../lib/quality/quality-eval-handoff.ts"],
|
|
4
|
+
"sourcesContent": ["/** Daily T2 evaluation budget: one UTC-date-stamped file in `qualityStateDir` that rolls over in place (HDF3). */\n\nimport { join } from 'node:path';\nimport { FILE_LOCK } from '../core/constants.js';\nimport { loadJson, removeFile, tryWithFileLock, writeJson } from '../core/file-utils.js';\nimport { utcDateStamp } from '../core/format-utils.js';\nimport { qualityStateDir } from '../session/session-state.js';\n\n/** Longer stale window than `withFileLock` defaults: a batch may hold the counter past 5 s. */\nconst BUDGET_LOCK_OPTIONS = {\n maxRetries: FILE_LOCK.BUDGET_MAX_RETRIES,\n retryDelayMs: FILE_LOCK.BUDGET_RETRY_DELAY_MS,\n staleMs: FILE_LOCK.BUDGET_STALE_MS,\n} as const;\n\nexport const DAILY_BUDGET_CENTS = 50;\n\nexport const COST_PER_METRIC_CENTS = 0.75;\n\ninterface BudgetState {\n /** UTC date the counters belong to; any other date reads as a fresh budget. */\n date: string;\n evaluationsRun: number;\n estimatedCostCents: number;\n}\n\nconst BUDGET_FILENAME = 'budget.json';\n\nfunction getBudgetPath(): string {\n return join(qualityStateDir(), BUDGET_FILENAME);\n}\n\nfunction loadBudget(path: string): BudgetState {\n const date = utcDateStamp();\n // null covers missing and malformed; another date is yesterday's spend.\n const parsed = loadJson<Partial<BudgetState>>(path);\n if (parsed?.date !== date) {\n return { date, evaluationsRun: 0, estimatedCostCents: 0 };\n }\n return {\n date,\n evaluationsRun: Number(parsed.evaluationsRun ?? 0),\n estimatedCostCents: Number(parsed.estimatedCostCents ?? 0),\n };\n}\n\nfunction saveBudget(path: string, state: BudgetState): boolean {\n return writeJson(path, state, false, { silent: true });\n}\n\n/** Snapshot check; use `tryReserveBudget` for correctness under concurrency. */\nexport function hasBudget(): boolean {\n const state = loadBudget(getBudgetPath());\n return state.estimatedCostCents < DAILY_BUDGET_CENTS;\n}\n\n/**\n * Locked read-modify-write of today's counters. The callback mutates `state`; returning `false`\n * skips the save. True only when the lock was held, the callback did not decline and the save\n * landed; a throw from the lock or the write reads as false, so every caller fails closed.\n */\nfunction mutateBudget(fn: (state: BudgetState) => boolean | undefined): boolean {\n try {\n const path = getBudgetPath();\n const outcome = tryWithFileLock(path, () => {\n const state = loadBudget(path);\n if (fn(state) === false) return false;\n return saveBudget(path, state);\n }, BUDGET_LOCK_OPTIONS);\n return outcome.locked && outcome.value;\n } catch {\n return false;\n }\n}\n\n/** Locked check-and-reserve. Fails CLOSED: a lock or write failure returns false (HRV5). */\nexport function tryReserveBudget(costCents = COST_PER_METRIC_CENTS): boolean {\n return mutateBudget(state => {\n if (state.estimatedCostCents + costCents > DAILY_BUDGET_CENTS) return false;\n state.evaluationsRun += 1;\n state.estimatedCostCents += costCents;\n return true;\n });\n}\n\n/** True-up a reservation to measured cost (OBP19). Best-effort: a lock failure leaves it off by `|actual \u2212 reserved|`. */\nexport function trueUpBudget(actualCents: number, reservedCents: number): void {\n const delta = actualCents - reservedCents;\n if (delta === 0) return;\n mutateBudget(state => {\n state.estimatedCostCents = Math.max(0, state.estimatedCostCents + delta);\n });\n}\n\n/** Return a reservation whose call never completed. Best-effort; a lock failure over-counts, the safe direction. */\nexport function releaseBudget(costCents = COST_PER_METRIC_CENTS): void {\n mutateBudget(state => {\n state.evaluationsRun = Math.max(0, state.evaluationsRun - 1);\n state.estimatedCostCents = Math.max(0, state.estimatedCostCents - costCents);\n });\n}\n\n/** @internal */\nexport function _resetBudgetState(): void {\n removeFile(getBudgetPath());\n}\n\n/** Current usage for telemetry. */\nexport function getBudgetUsage(): { evaluationsRun: number; estimatedCostCents: number; budgetCents: number; remaining: number } {\n const state = loadBudget(getBudgetPath());\n return {\n evaluationsRun: state.evaluationsRun,\n estimatedCostCents: state.estimatedCostCents,\n budgetCents: DAILY_BUDGET_CENTS,\n remaining: Math.max(0, DAILY_BUDGET_CENTS - state.estimatedCostCents),\n };\n}\n", "/**\n * Stop \u2192 detached evaluator handoff (HDF3). Stop decides, stats the transcript and spawns\n * `hook-runner evaluate-quality` with four positional args; the child does sampling, paid calls and\n * records. Nothing touches disk, so no record is scored twice.\n */\n\nimport { EVALUATE_QUALITY_ARG } from '../core/constants.js';\nimport { spawnDetachedRunner, type SpawnResult } from '../core/detached-runner.js';\nimport { DOPPLER_BIN, DOPPLER_CONFIGS, DOPPLER_PROJECT } from '../core/identity-key-resolver.js';\nimport { isByteCount } from '../core/units.js';\n\n/** Span and metric attribute keys shared by the Stop handler, the evaluator and the drift detector. */\nexport const QUALITY_ATTRS = {\n EVAL_TYPE: 'integritystudio.quality.eval_type',\n CANARY: 'integritystudio.quality.canary',\n TRANSCRIPT_BYTES: 'integritystudio.quality.transcript_bytes',\n EVAL_QUEUED: 'integritystudio.quality.eval_queued',\n /** Why a sampled session produced no evaluation; set by either side of the handoff. */\n EVAL_SKIPPED_REASON: 'integritystudio.quality.eval_skipped_reason',\n EVAL_SKIPPED_DETAIL: 'integritystudio.quality.eval_skipped_detail',\n TURNS_SAMPLED: 'integritystudio.quality.turns_sampled',\n TURNS_TOTAL: 'integritystudio.quality.turns_total',\n META_EVALS_RUN: 'integritystudio.quality.meta_evals_run',\n META_EVAL_UNAVAILABLE_REASON: 'integritystudio.quality.meta_eval_unavailable_reason',\n EVAL_DURATION_MS: 'integritystudio.quality.eval_duration_ms',\n BUDGET_USED_CENTS: 'integritystudio.quality.budget_used_cents',\n BUDGET_REMAINING_CENTS: 'integritystudio.quality.budget_remaining_cents',\n STATUS: 'integritystudio.quality.status',\n CONFIRMED: 'integritystudio.quality.confirmed',\n METRIC_NAME: 'integritystudio.quality.metric_name',\n CONSECUTIVE_BREACHES: 'integritystudio.quality.consecutive_breaches',\n DRIFT_DETECTED: 'integritystudio.quality.drift_detected',\n} as const;\n\nexport const QUALITY_EVAL_SKIP_REASONS = {\n NO_TRANSCRIPT: 'no_transcript',\n NO_TURNS: 'no_turns',\n} as const;\n\n/** `hook.type` on both the Stop-side queue span and the evaluator's span. */\nexport const QUALITY_EVALUATION_HOOK_TYPE = 'quality-evaluation';\nexport const QUALITY_EVAL_TYPE_LLM = 'llm';\n\n/** Everything the evaluator needs to draw and score the sample. */\nexport interface EvaluationHandoff {\n sessionId: string;\n canary: boolean;\n transcriptPath: string;\n /** Transcript size at Stop; the evaluator reads only that prefix. */\n transcriptBytes: number;\n}\n\n/** The four positional args; `parseEvaluationArgs` is the decoder. */\nexport function encodeEvaluationArgs(record: EvaluationHandoff): readonly string[] {\n return [\n record.sessionId,\n String(record.canary),\n record.transcriptPath,\n String(record.transcriptBytes),\n ];\n}\n\n/** Decoder for `encodeEvaluationArgs`; null when malformed. */\nexport function parseEvaluationArgs(args: readonly string[]): EvaluationHandoff | null {\n const [sessionId, canaryStr, transcriptPath, transcriptBytesStr] = args;\n if (\n typeof sessionId !== 'string' || !sessionId\n || typeof transcriptPath !== 'string' || !transcriptPath\n ) return null;\n const transcriptBytes = Number(transcriptBytesStr);\n if (!isByteCount(transcriptBytes)) return null;\n return {\n sessionId,\n canary: canaryStr === 'true',\n transcriptPath,\n transcriptBytes,\n };\n}\n\n/**\n * Start the detached evaluator under `doppler run --config prd` so judge credentials\n * are injected (HRF6). All judge keys (ANTHROPIC_API_KEY, XAI_API_KEY, OPENAI_API_KEY,\n * OPEN_AI_KEY) must be present in the prd config.\n */\nexport function spawnQualityEvaluator(record: EvaluationHandoff): SpawnResult {\n const dopplerPrefix = [\n DOPPLER_BIN, 'run', '--project', DOPPLER_PROJECT, '--config', DOPPLER_CONFIGS.PRD, '--',\n ];\n return spawnDetachedRunner([EVALUATE_QUALITY_ARG, ...encodeEvaluationArgs(record)], dopplerPrefix);\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { createRequire as __hookRunnerCreateRequire } from 'node:module';
|
|
2
|
+
const require = __hookRunnerCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
SHELL_IDENTIFIER_SOURCE
|
|
5
|
+
} from "./chunk-YHYDBLVB.js";
|
|
6
|
+
|
|
7
|
+
// lib/core/shell-command.ts
|
|
8
|
+
import { basename } from "node:path";
|
|
9
|
+
var SINGLE_QUOTE = "'";
|
|
10
|
+
var DOUBLE_QUOTE = '"';
|
|
11
|
+
var BACKSLASH = "\\";
|
|
12
|
+
var COMMAND_SUBSTITUTION_OPEN = "$(";
|
|
13
|
+
var OPTION_PREFIX = "-";
|
|
14
|
+
var SEPARATOR_CHARS = /* @__PURE__ */ new Set([";", "&", "|", "\n", "(", ")", "`"]);
|
|
15
|
+
var WORD_BREAK_CHARS = /* @__PURE__ */ new Set([" ", " ", "\r"]);
|
|
16
|
+
var ASSIGNMENT_PATTERN = new RegExp(`^${SHELL_IDENTIFIER_SOURCE}=`);
|
|
17
|
+
var PREFIX_WORDS = /* @__PURE__ */ new Set(["env", "command", "exec", "time", "nohup", "sudo", "builtin", "{", "!"]);
|
|
18
|
+
var SCRIPT_SHELLS = /* @__PURE__ */ new Set(["bash", "sh", "zsh"]);
|
|
19
|
+
var SCRIPT_FLAG_PATTERN = /^-[a-z]*c[a-z]*$/;
|
|
20
|
+
function readQuoted(command, openIndex, quote) {
|
|
21
|
+
let text = "";
|
|
22
|
+
let i = openIndex + 1;
|
|
23
|
+
while (i < command.length && command[i] !== quote) {
|
|
24
|
+
if (quote === DOUBLE_QUOTE && command[i] === BACKSLASH && i + 1 < command.length) i++;
|
|
25
|
+
text += command[i];
|
|
26
|
+
i++;
|
|
27
|
+
}
|
|
28
|
+
return { text, end: i };
|
|
29
|
+
}
|
|
30
|
+
function splitSimpleCommands(command) {
|
|
31
|
+
const commands = [];
|
|
32
|
+
let words = [];
|
|
33
|
+
let word = "";
|
|
34
|
+
let inWord = false;
|
|
35
|
+
const appendToWord = (text) => {
|
|
36
|
+
word += text;
|
|
37
|
+
inWord = true;
|
|
38
|
+
};
|
|
39
|
+
const endWord = () => {
|
|
40
|
+
if (inWord) words.push(word);
|
|
41
|
+
word = "";
|
|
42
|
+
inWord = false;
|
|
43
|
+
};
|
|
44
|
+
const endCommand = () => {
|
|
45
|
+
endWord();
|
|
46
|
+
if (words.length > 0) commands.push(words);
|
|
47
|
+
words = [];
|
|
48
|
+
};
|
|
49
|
+
for (let i = 0; i < command.length; i++) {
|
|
50
|
+
const char = command.charAt(i);
|
|
51
|
+
if (char === SINGLE_QUOTE || char === DOUBLE_QUOTE) {
|
|
52
|
+
const span = readQuoted(command, i, char);
|
|
53
|
+
appendToWord(span.text);
|
|
54
|
+
i = span.end;
|
|
55
|
+
} else if (char === BACKSLASH && i + 1 < command.length) {
|
|
56
|
+
appendToWord(command.charAt(i + 1));
|
|
57
|
+
i++;
|
|
58
|
+
} else if (command.startsWith(COMMAND_SUBSTITUTION_OPEN, i)) {
|
|
59
|
+
endCommand();
|
|
60
|
+
i++;
|
|
61
|
+
} else if (SEPARATOR_CHARS.has(char)) {
|
|
62
|
+
endCommand();
|
|
63
|
+
} else if (WORD_BREAK_CHARS.has(char)) {
|
|
64
|
+
endWord();
|
|
65
|
+
} else {
|
|
66
|
+
appendToWord(char);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
endCommand();
|
|
70
|
+
return commands;
|
|
71
|
+
}
|
|
72
|
+
function stripPrefixes(words) {
|
|
73
|
+
const start = words.findIndex((word) => !ASSIGNMENT_PATTERN.test(word) && !PREFIX_WORDS.has(word));
|
|
74
|
+
return start === -1 ? [] : words.slice(start);
|
|
75
|
+
}
|
|
76
|
+
var programOf = (argv) => basename(argv[0] ?? "");
|
|
77
|
+
var isOptionArg = (arg) => arg.startsWith(OPTION_PREFIX);
|
|
78
|
+
function commandInvocations(command) {
|
|
79
|
+
const invocations = [];
|
|
80
|
+
for (const words of splitSimpleCommands(command)) {
|
|
81
|
+
const argv = stripPrefixes(words);
|
|
82
|
+
if (argv.length === 0) continue;
|
|
83
|
+
if (!SCRIPT_SHELLS.has(programOf(argv))) {
|
|
84
|
+
invocations.push(argv);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const scriptFlag = argv.findIndex((arg) => SCRIPT_FLAG_PATTERN.test(arg));
|
|
88
|
+
const script = scriptFlag === -1 ? void 0 : argv[scriptFlag + 1];
|
|
89
|
+
if (script !== void 0) {
|
|
90
|
+
invocations.push(...commandInvocations(script));
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const scriptFile = argv.findIndex((arg, i) => i > 0 && !isOptionArg(arg));
|
|
94
|
+
invocations.push(scriptFile === -1 ? argv : argv.slice(scriptFile));
|
|
95
|
+
}
|
|
96
|
+
return invocations;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export {
|
|
100
|
+
programOf,
|
|
101
|
+
isOptionArg,
|
|
102
|
+
commandInvocations
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=chunk-JLEO5OHU.js.map
|