@tangle-network/agent-eval 0.218.1 → 0.219.0
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/CHANGELOG.md +21 -0
- package/dist/adapters/http.d.ts +3 -3
- package/dist/adapters/http.d.ts.map +1 -1
- package/dist/adapters/http.js +1 -0
- package/dist/adapters/http.js.map +1 -1
- package/dist/{agent-profile-DTt8uGP9.d.ts → agent-profile-D01Io2Xw.d.ts} +4 -4
- package/dist/{agent-profile-DTt8uGP9.d.ts.map → agent-profile-D01Io2Xw.d.ts.map} +1 -1
- package/dist/analyst/index.d.ts +13 -13
- package/dist/analyst/index.d.ts.map +1 -1
- package/dist/analyst/index.js +8 -8
- package/dist/analyst/index.js.map +1 -1
- package/dist/{analyze-runs-DjlZOVXx.d.ts → analyze-runs-BWAHBDAw.d.ts} +4 -4
- package/dist/{analyze-runs-DjlZOVXx.d.ts.map → analyze-runs-BWAHBDAw.d.ts.map} +1 -1
- package/dist/{benchmark-command-BupdHRyf.js → benchmark-command-BzmMTnvC.js} +10 -10
- package/dist/{benchmark-command-BupdHRyf.js.map → benchmark-command-BzmMTnvC.js.map} +1 -1
- package/dist/benchmarks/index.d.ts +5 -5
- package/dist/benchmarks/index.js +3 -3
- package/dist/benchmarks/index.js.map +1 -1
- package/dist/campaign/index.d.ts +8 -8
- package/dist/campaign/index.js +8 -8
- package/dist/{campaign-CGvUTnmc.js → campaign-BVPC6ODQ.js} +149 -10
- package/dist/campaign-BVPC6ODQ.js.map +1 -0
- package/dist/campaign-evidence-DunzcJGv.js.map +1 -1
- package/dist/{chat-client-B2pXlPdx.js → chat-client-CMQ8_h4J.js} +2 -2
- package/dist/{chat-client-B2pXlPdx.js.map → chat-client-CMQ8_h4J.js.map} +1 -1
- package/dist/{chat-json-call-Dm9c-b41.js → chat-json-call-BrZKn0L3.js} +2 -2
- package/dist/{chat-json-call-Dm9c-b41.js.map → chat-json-call-BrZKn0L3.js.map} +1 -1
- package/dist/cli.js +8 -8
- package/dist/{completion-verifier-DbLVf3i8.js → completion-verifier-Cigap8CG.js} +4 -4
- package/dist/{completion-verifier-DbLVf3i8.js.map → completion-verifier-Cigap8CG.js.map} +1 -1
- package/dist/contract/index.d.ts +11 -11
- package/dist/contract/index.js +7 -7
- package/dist/{cost-ledger-D0352Z4d.js → cost-ledger-BGZB6yY2.js} +75 -2
- package/dist/cost-ledger-BGZB6yY2.js.map +1 -0
- package/dist/{cost-ledger-Jk62OBfF.d.ts → cost-ledger-C1W3ICmP.d.ts} +26 -2
- package/dist/cost-ledger-C1W3ICmP.d.ts.map +1 -0
- package/dist/{default-registry-BJ-Pq6yL.js → default-registry-BrKmT01n.js} +3 -3
- package/dist/{default-registry-BJ-Pq6yL.js.map → default-registry-BrKmT01n.js.map} +1 -1
- package/dist/{default-registry-DXgLmoDI.d.ts → default-registry-Cwg_QN3d.d.ts} +6 -6
- package/dist/{default-registry-DXgLmoDI.d.ts.map → default-registry-Cwg_QN3d.d.ts.map} +1 -1
- package/dist/{define-agent-eval-BlH10zEw.d.ts → define-agent-eval-C2nFhHPu.d.ts} +8 -8
- package/dist/{define-agent-eval-BlH10zEw.d.ts.map → define-agent-eval-C2nFhHPu.d.ts.map} +1 -1
- package/dist/{define-agent-eval-BGdFKlrc.js → define-agent-eval-UQY3VbJ2.js} +4 -4
- package/dist/{define-agent-eval-BGdFKlrc.js.map → define-agent-eval-UQY3VbJ2.js.map} +1 -1
- package/dist/diagnosis/index.d.ts +2 -2
- package/dist/{dspy-rlm-engine-CSMwudLO.js → dspy-rlm-engine-Bn_Mt_LW.js} +3 -3
- package/dist/{dspy-rlm-engine-CSMwudLO.js.map → dspy-rlm-engine-Bn_Mt_LW.js.map} +1 -1
- package/dist/{engine-BvZ0R-36.d.ts → engine-BpGGw6cd.d.ts} +3 -3
- package/dist/{engine-BvZ0R-36.d.ts.map → engine-BpGGw6cd.d.ts.map} +1 -1
- package/dist/{evaluation-BOZ38vOH.d.ts → evaluation-CBdQt_kr.d.ts} +4 -4
- package/dist/{evaluation-BOZ38vOH.d.ts.map → evaluation-CBdQt_kr.d.ts.map} +1 -1
- package/dist/evaluation.d.ts +1 -1
- package/dist/evaluation.js +1 -1
- package/dist/{exact-types-CflbJ9f3.d.ts → exact-types-BYFmYq44.d.ts} +2 -2
- package/dist/{exact-types-CflbJ9f3.d.ts.map → exact-types-BYFmYq44.d.ts.map} +1 -1
- package/dist/experiment/index.d.ts +24 -1
- package/dist/experiment/index.d.ts.map +1 -1
- package/dist/experiment/index.js.map +1 -1
- package/dist/{external-optimizer-process-C3Wm7Vhn.js → external-optimizer-process-wOLfzsCC.js} +2 -2
- package/dist/{external-optimizer-process-C3Wm7Vhn.js.map → external-optimizer-process-wOLfzsCC.js.map} +1 -1
- package/dist/{external-optimizer-subprocess-B5gdLRZv.js → external-optimizer-subprocess-D670Oxf2.js} +3 -3
- package/dist/{external-optimizer-subprocess-B5gdLRZv.js.map → external-optimizer-subprocess-D670Oxf2.js.map} +1 -1
- package/dist/{feedback-trajectory-BWmhRBGu.d.ts → feedback-trajectory-DhB9WzYg.d.ts} +3 -3
- package/dist/{feedback-trajectory-BWmhRBGu.d.ts.map → feedback-trajectory-DhB9WzYg.d.ts.map} +1 -1
- package/dist/{findings-store-BtTzPL0d.js → findings-store-CvNo712L.js} +5 -5
- package/dist/{findings-store-BtTzPL0d.js.map → findings-store-CvNo712L.js.map} +1 -1
- package/dist/fuzz.d.ts +1 -1
- package/dist/fuzz.js +1 -1
- package/dist/hosted/index.js +1 -1
- package/dist/{index-CX-GAUpw.d.ts → index-CHxwfW5g.d.ts} +2 -2
- package/dist/{index-CX-GAUpw.d.ts.map → index-CHxwfW5g.d.ts.map} +1 -1
- package/dist/{index-BLGqZ81N.d.ts → index-CVFStrQD.d.ts} +8 -8
- package/dist/{index-BLGqZ81N.d.ts.map → index-CVFStrQD.d.ts.map} +1 -1
- package/dist/{index-CiRwLv2R.d.ts → index-D7fmC-1K.d.ts} +3 -4
- package/dist/index-D7fmC-1K.d.ts.map +1 -0
- package/dist/{index-DbMOXYnP.d.ts → index-DAXfpVf7.d.ts} +10 -10
- package/dist/{index-DbMOXYnP.d.ts.map → index-DAXfpVf7.d.ts.map} +1 -1
- package/dist/{index-B16FNdW5.d.ts → index-Q6DvdcwI.d.ts} +37 -11
- package/dist/index-Q6DvdcwI.d.ts.map +1 -0
- package/dist/index.d.ts +26 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/{integrity-_qgZLA5p.d.ts → integrity-CCwvezWS.d.ts} +2 -2
- package/dist/{integrity-_qgZLA5p.d.ts.map → integrity-CCwvezWS.d.ts.map} +1 -1
- package/dist/judge-gate-Co5tuh57.js.map +1 -1
- package/dist/{judge-gate-DsL0yFcb.d.ts → judge-gate-Dc_mXQsL.d.ts} +2 -2
- package/dist/judge-gate-Dc_mXQsL.d.ts.map +1 -0
- package/dist/{kind-factory-Gy4fXixd.js → kind-factory-BhxbtUsQ.js} +2 -2
- package/dist/{kind-factory-Gy4fXixd.js.map → kind-factory-BhxbtUsQ.js.map} +1 -1
- package/dist/{llm-client-_Y6ic-tf.js → llm-client-DXuOTseU.js} +2 -2
- package/dist/{llm-client-_Y6ic-tf.js.map → llm-client-DXuOTseU.js.map} +1 -1
- package/dist/{llm-judge-Djxh-Uhs.js → llm-judge-Cc8vDJh_.js} +9 -8
- package/dist/llm-judge-Cc8vDJh_.js.map +1 -0
- package/dist/matrix/index.d.ts +2 -2
- package/dist/{matrix-CCSBna4q.d.ts → matrix-Cf-AGxGh.d.ts} +4 -4
- package/dist/{matrix-CCSBna4q.d.ts.map → matrix-Cf-AGxGh.d.ts.map} +1 -1
- package/dist/meta-eval/index.d.ts +2 -2
- package/dist/{mint-BRZXuwRi.d.ts → mint-CkzpVPdz.d.ts} +3 -3
- package/dist/{mint-BRZXuwRi.d.ts.map → mint-CkzpVPdz.d.ts.map} +1 -1
- package/dist/multishot/golden/index.d.ts +1 -1
- package/dist/multishot/index.d.ts +2 -2
- package/dist/multishot/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/dist/{pareto-CTv8vozZ.js → pareto-BiBnQXAE.js} +304 -210
- package/dist/pareto-BiBnQXAE.js.map +1 -0
- package/dist/pipelines/index.d.ts.map +1 -1
- package/dist/pipelines/index.js.map +1 -1
- package/dist/{prime-protocol-BWG2DQIk.d.ts → prime-protocol-CckHBxGu.d.ts} +3 -3
- package/dist/{prime-protocol-BWG2DQIk.d.ts.map → prime-protocol-CckHBxGu.d.ts.map} +1 -1
- package/dist/{promotion-gate-CxEHRsZW.d.ts → promotion-gate-CkVZHagC.d.ts} +3 -3
- package/dist/{promotion-gate-CxEHRsZW.d.ts.map → promotion-gate-CkVZHagC.d.ts.map} +1 -1
- package/dist/{proposal-findings-n-5WBbEx.js → proposal-findings-E1aSC_cU.js} +2 -2
- package/dist/{proposal-findings-n-5WBbEx.js.map → proposal-findings-E1aSC_cU.js.map} +1 -1
- package/dist/{registry-ssNoHzwD.d.ts → registry-B_yG-1jh.d.ts} +5 -5
- package/dist/{registry-ssNoHzwD.d.ts.map → registry-B_yG-1jh.d.ts.map} +1 -1
- package/dist/render-Cs34y0iX.js.map +1 -1
- package/dist/reporting.d.ts +3 -3
- package/dist/{researcher-GU1tV4dn.d.ts → researcher-H0p44OYC.d.ts} +5 -5
- package/dist/{researcher-GU1tV4dn.d.ts.map → researcher-H0p44OYC.d.ts.map} +1 -1
- package/dist/{reward-DrZ71vnf.d.ts → reward-BeUgVVC_.d.ts} +2 -2
- package/dist/{reward-DrZ71vnf.d.ts.map → reward-BeUgVVC_.d.ts.map} +1 -1
- package/dist/{reward-hacking-E52wq86n.d.ts → reward-hacking-WTxUbtbb.d.ts} +2 -2
- package/dist/{reward-hacking-E52wq86n.d.ts.map → reward-hacking-WTxUbtbb.d.ts.map} +1 -1
- package/dist/rl.d.ts +8 -8
- package/dist/rollout/index.d.ts +3 -3
- package/dist/rollout-Dd1ucT_M.js.map +1 -1
- package/dist/{rubric-predictive-validity-DiwT8PbL.d.ts → rubric-predictive-validity-noY7uE03.d.ts} +2 -2
- package/dist/{rubric-predictive-validity-DiwT8PbL.d.ts.map → rubric-predictive-validity-noY7uE03.d.ts.map} +1 -1
- package/dist/{run-record-CaxbLq6Y.d.ts → run-record-C3awiXPf.d.ts} +2 -2
- package/dist/{run-record-CaxbLq6Y.d.ts.map → run-record-C3awiXPf.d.ts.map} +1 -1
- package/dist/schema-CvhfLjtZ.js.map +1 -1
- package/dist/search/index.d.ts +2 -2
- package/dist/search/index.js +2 -2
- package/dist/{search-kernel-p9JB3SmL.d.ts → search-kernel-Dloxd6gs.d.ts} +4 -4
- package/dist/{search-kernel-p9JB3SmL.d.ts.map → search-kernel-Dloxd6gs.d.ts.map} +1 -1
- package/dist/{search-ledger-ClpN4I3e.js → search-ledger-CZRqtFbW.js} +249 -242
- package/dist/search-ledger-CZRqtFbW.js.map +1 -0
- package/dist/{search-shipper-Bg2HW3Uv.js → search-shipper-Dn3NLsuH.js} +2 -2
- package/dist/{search-shipper-Bg2HW3Uv.js.map → search-shipper-Dn3NLsuH.js.map} +1 -1
- package/dist/{search-summary-CrBuvVnf.js → search-summary-D4bwYnAE.js} +2 -2
- package/dist/{search-summary-CrBuvVnf.js.map → search-summary-D4bwYnAE.js.map} +1 -1
- package/dist/{server-C6M0qR8h.js → server-8TS8XCvg.js} +3 -3
- package/dist/{server-C6M0qR8h.js.map → server-8TS8XCvg.js.map} +1 -1
- package/dist/{skillopt-optimization-method-5dlex7MJ.js → skillopt-optimization-method-DLKqdhcR.js} +106 -61
- package/dist/skillopt-optimization-method-DLKqdhcR.js.map +1 -0
- package/dist/{statistical-heldout-BHfLZHrm.d.ts → statistical-heldout-3z3I-kJN.d.ts} +3 -3
- package/dist/{statistical-heldout-BHfLZHrm.d.ts.map → statistical-heldout-3z3I-kJN.d.ts.map} +1 -1
- package/dist/{store-otlp-BteDAbHK.js → store-otlp-dyWE3wAG.js} +2 -2
- package/dist/{store-otlp-BteDAbHK.js.map → store-otlp-dyWE3wAG.js.map} +1 -1
- package/dist/{store-tool-spans-D5l_OfTJ.js → store-tool-spans-DIUgZbzu.js} +3 -3
- package/dist/{store-tool-spans-D5l_OfTJ.js.map → store-tool-spans-DIUgZbzu.js.map} +1 -1
- package/dist/{store-tool-spans-DZS0HWVf.d.ts → store-tool-spans-DPwXHQkH.d.ts} +7 -7
- package/dist/{store-tool-spans-DZS0HWVf.d.ts.map → store-tool-spans-DPwXHQkH.d.ts.map} +1 -1
- package/dist/{summary-report-CkbRcSuu.d.ts → summary-report-C8V49Jt3.d.ts} +3 -3
- package/dist/{summary-report-CkbRcSuu.d.ts.map → summary-report-C8V49Jt3.d.ts.map} +1 -1
- package/dist/{systemone-BMzDJb1i.d.ts → systemone-DVA7t76V.d.ts} +6 -6
- package/dist/{systemone-BMzDJb1i.d.ts.map → systemone-DVA7t76V.d.ts.map} +1 -1
- package/dist/{systemone-review-CwE6JGIp.d.ts → systemone-review-CUBMuTLi.d.ts} +2 -2
- package/dist/{systemone-review-CwE6JGIp.d.ts.map → systemone-review-CUBMuTLi.d.ts.map} +1 -1
- package/dist/systemone.d.ts +3 -3
- package/dist/{tool-groups-DyNz2JZ_.d.ts → tool-groups-LISbBWCg.d.ts} +3 -3
- package/dist/tool-groups-LISbBWCg.d.ts.map +1 -0
- package/dist/{trace-questions-xxwgsuMi.d.ts → trace-questions-C42fYEE4.d.ts} +4 -4
- package/dist/{trace-questions-xxwgsuMi.d.ts.map → trace-questions-C42fYEE4.d.ts.map} +1 -1
- package/dist/trace-repair/index.d.ts +3 -3
- package/dist/traces.d.ts +6 -6
- package/dist/traces.js +3 -3
- package/dist/trajectory-replay/index.js +24 -3
- package/dist/trajectory-replay/index.js.map +1 -1
- package/dist/{tree-B5e1uAeL.js → tree-DSqwJpL9.js} +3 -3
- package/dist/{tree-B5e1uAeL.js.map → tree-DSqwJpL9.js.map} +1 -1
- package/dist/{types-CW8ewATZ.d.ts → types-8yQzNm8u.d.ts} +4 -4
- package/dist/{types-CW8ewATZ.d.ts.map → types-8yQzNm8u.d.ts.map} +1 -1
- package/dist/{types-DtkO1G9L.d.ts → types-CHfn1zg5.d.ts} +69 -71
- package/dist/types-CHfn1zg5.d.ts.map +1 -0
- package/dist/{types-BKCzzmit.d.ts → types-D8GXK9Z5.d.ts} +3 -3
- package/dist/{types-BKCzzmit.d.ts.map → types-D8GXK9Z5.d.ts.map} +1 -1
- package/dist/{types-D-mgRzlh.d.ts → types-eMhdacVp.d.ts} +2 -2
- package/dist/{types-D-mgRzlh.d.ts.map → types-eMhdacVp.d.ts.map} +1 -1
- package/dist/wire/index.d.ts +3 -3
- package/dist/wire/index.js +1 -1
- package/docs/campaign-proposers.md +16 -0
- package/docs/concepts.md +31 -0
- package/docs/public-api.md +76 -75
- package/package.json +2 -5
- package/dist/campaign-CGvUTnmc.js.map +0 -1
- package/dist/cost-ledger-D0352Z4d.js.map +0 -1
- package/dist/cost-ledger-Jk62OBfF.d.ts.map +0 -1
- package/dist/index-B16FNdW5.d.ts.map +0 -1
- package/dist/index-CiRwLv2R.d.ts.map +0 -1
- package/dist/judge-gate-DsL0yFcb.d.ts.map +0 -1
- package/dist/llm-judge-Djxh-Uhs.js.map +0 -1
- package/dist/pareto-CTv8vozZ.js.map +0 -1
- package/dist/search-ledger-ClpN4I3e.js.map +0 -1
- package/dist/skillopt-optimization-method-5dlex7MJ.js.map +0 -1
- package/dist/tool-groups-DyNz2JZ_.d.ts.map +0 -1
- package/dist/types-DtkO1G9L.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,27 @@ All notable changes to `@tangle-network/agent-eval` and its sibling `agent-eval-
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [0.219.0] — 2026-10-22
|
|
8
|
+
|
|
9
|
+
- docs(census): refresh consumer evidence with restored imports
|
|
10
|
+
- fix(census): parse consumer blobs with their source paths
|
|
11
|
+
- fix(census): retain evidence when consumer refs are unavailable
|
|
12
|
+
- feat(campaign): preserve matrix cost units and GEPA visual objectives
|
|
13
|
+
- feat(campaign): preserve matrix cost units and GEPA visual objectives
|
|
14
|
+
- feat(campaign): preserve matrix cost units and GEPA visual objectives
|
|
15
|
+
- feat(campaign): preserve matrix cost units and GEPA visual objectives
|
|
16
|
+
- Delete the agent-eval src code nothing calls (steer-firewall.ts, classifyReissue, inMemorySentinelSt (#1059)
|
|
17
|
+
- Un-export container.ts's dead `run` re-export of promisify(execFile): dup_exports 4 to 3 this fire ( (#1058)
|
|
18
|
+
- Delete the one-shot TB-Repair corpus assay (benchmarks/trace-repair/tools/assay-tbench-corpus.mjs) w (#1057)
|
|
19
|
+
- chore: lockfile and dependency-lock pin after merging main
|
|
20
|
+
- docs: regenerate the public API census
|
|
21
|
+
- chore: lockfile and analyst dependency-lock pin for the removed devDependencies
|
|
22
|
+
- refactor(campaign): split SearchKernel's lanes, node progress, artifact cache, proposal slot and completion queue into collaborators
|
|
23
|
+
- refactor: move SearchState's indexes and spend bookkeeping into collaborators
|
|
24
|
+
- chore: drop three devDependencies nothing imports (phoenix-evals, autoevals, yaml)
|
|
25
|
+
- refactor: bring prepareGepaRun, assertComparisonControls and renderBatchReport under 150 lines
|
|
26
|
+
- feat(campaign): preserve matrix cost units and GEPA visual objectives
|
|
27
|
+
|
|
7
28
|
## [0.218.1] — 2026-10-22
|
|
8
29
|
|
|
9
30
|
- fix(deps): agent-core ^0.13.1, so a packed consumer of agent-eval and agent-runtime loads one agent-core (#1054)
|
package/dist/adapters/http.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { R as Scenario, d as DispatchContext, f as DispatchFn } from "../types-
|
|
3
|
-
import "../index-
|
|
1
|
+
import { d as CostReceipt } from "../cost-ledger-C1W3ICmP.js";
|
|
2
|
+
import { R as Scenario, d as DispatchContext, f as DispatchFn } from "../types-CHfn1zg5.js";
|
|
3
|
+
import "../index-DAXfpVf7.js";
|
|
4
4
|
//#region src/adapters/http.d.ts
|
|
5
5
|
export interface HttpDispatchOptions<TScenario extends Scenario, _TArtifact> {
|
|
6
6
|
/** Static endpoint URL. Mutually exclusive with `resolveUrl`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","names":["Dispatch"],"sources":["../../src/adapters/http.ts"],"mappings":";;;;iBA2DiB,oBAAoB,kBAAkB,UAAU;;EAE/D;;;;;;EAMA,cAAc;IAAS,UAAU;IAAW;IAAoB;;;EAEhE,gCAAgC;;EAEhC,UAAU;;EAEV;;;;;;;EAOA;;EAEA,mBAAmB;;iBAGJ,wBAAwB,kBAAkB;EACzD,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,yBAAyB;EACxC,UAAU;;;;;;;;EAQV,WAAW;;;;;;;;;;;wBAkBG,aAAa,kBAAkB,UAAU,WACvD,MAAM,oBAAoB,WAAW,aACpCA,WAAS,WAAW;
|
|
1
|
+
{"version":3,"file":"http.d.ts","names":["Dispatch"],"sources":["../../src/adapters/http.ts"],"mappings":";;;;iBA2DiB,oBAAoB,kBAAkB,UAAU;;EAE/D;;;;;;EAMA,cAAc;IAAS,UAAU;IAAW;IAAoB;;;EAEhE,gCAAgC;;EAEhC,UAAU;;EAEV;;;;;;;EAOA;;EAEA,mBAAmB;;iBAGJ,wBAAwB,kBAAkB;EACzD,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,yBAAyB;EACxC,UAAU;;;;;;;;EAQV,WAAW;;;;;;;;;;;wBAkBG,aAAa,kBAAkB,UAAU,WACvD,MAAM,oBAAoB,WAAW,aACpCA,WAAS,WAAW;iBAiKN,yBAAyB,kBAAkB,UAAU;;EAEpE,UAAUA,WAAS,WAAW;;EAE9B;;EAEA;;;;EAIA;;EAEA;;;;;;;;EAQA,kBACE,KAAK,wBAAwB,YAC7B,QAAQ,gBACL,QAAQ;;EAEb;;EAEA,aAAa;IACX;IACA;IACA;IACA;;;iBAIa;;EAEf;;EAEA,aAAa;;;;;;;;;;;;;;;;;;;;wBAqBO,kBAAkB,kBAAkB,UAAU,WAClE,MAAM,yBAAyB,WAAW,aACzC,QAAQ"}
|
package/dist/adapters/http.js
CHANGED
|
@@ -115,6 +115,7 @@ function parseErrorReceipts(text) {
|
|
|
115
115
|
async function replayReceipt(cost, receipt) {
|
|
116
116
|
const knownCostUsd = receipt.costUnknown ? void 0 : receipt.costUsd;
|
|
117
117
|
const observed = () => ({
|
|
118
|
+
...receipt.costBreakdown ? { costBreakdown: receipt.costBreakdown } : {},
|
|
118
119
|
model: receipt.model,
|
|
119
120
|
inputTokens: receipt.inputTokens,
|
|
120
121
|
outputTokens: receipt.outputTokens,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","names":[],"sources":["../../src/adapters/http.ts"],"sourcesContent":["/**\n * # `@tangle-network/agent-eval/adapters/http` — distributed Dispatch over HTTP.\n *\n * Decouples coordinator and worker. The coordinator (running\n * `runImprovementLoop` or `runCampaign`) can live anywhere — your VPC, a dev\n * laptop, a cron VM. The workers (running the actual agent) can live anywhere else — different\n * regions, different clouds, different boxes — as long as they speak HTTP.\n *\n * Both sides:\n *\n * - **`httpDispatch({ url | resolveUrl, ... })`** — client. Returns a\n * `Dispatch` that POSTs `{ scenario, ctx }` to a worker URL and parses\n * the artifact back. AbortSignal-aware, one attempt by default,\n * bounded timeout per call. Explicit retries require worker-owned replay.\n * - **`runDispatchServer({ dispatch, port, ... })`** — server. Wraps your\n * local `Dispatch` as an HTTP endpoint. Handles auth, JSON parsing,\n * error mapping, and cancellation when the client aborts.\n *\n * # Cost receipts cross the wire too\n *\n * A worker dispatch pays for its own model calls through its own\n * `ctx.cost` (wired by `contextFactory`) — a different `CostLedger` than the\n * coordinator's. `runDispatchServer` records every receipt that dispatch\n * settles and returns them alongside the artifact; `httpDispatch` replays\n * each one into the coordinator's `ctx.cost`, the same paid-call path a\n * local dispatch uses. A remote cell's spend therefore reaches the\n * coordinator's `CostLedger` — its summary, its cost ceiling, its\n * `CampaignCellResult.costUsd` — exactly like an in-process cell's does.\n * The worker must authorize and bound spend before executing; importing its\n * receipts cannot retroactively enforce the coordinator's ceiling.\n * Paid work requires a real `contextFactory` cost meter. An empty receipt\n * list does not establish free execution: the host must require usage evidence\n * and reconcile the worker ledger when a client disconnects before delivery.\n *\n * # Topology examples\n *\n * **Single-worker:** coordinator on box A, worker on box B. Set\n * `httpDispatch({ url: 'https://box-b/dispatch' })`.\n *\n * **Multi-region:** N workers across regions. Use `httpDispatch({ resolveUrl })`\n * with a function that picks the URL per cell from `ctx.placement`. Combined\n * with `cellPlacement` on `RunCampaignOptions`, the substrate fans cells\n * across geographies in parallel.\n *\n * **Coordinator-as-a-service:** coordinator runs as a long-lived process or service\n * (holds optimization state across generations); workers are stateless\n * HTTP services that can scale horizontally per cell.\n */\n\nimport type { CampaignCostMeter, Dispatch, DispatchContext, Scenario } from '../contract'\nimport type { CostReceipt, CostReceiptInput } from '../cost-ledger'\n\n// ── Client ───────────────────────────────────────────────────────────\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- TArtifact is unused\n// in this options interface but kept as a parameter so callers can write\n// `HttpDispatchOptions<MyScenario, MyArtifact>` symmetrically with\n// `Dispatch<MyScenario, MyArtifact>`. Marking it unused at the position\n// where it bites.\nexport interface HttpDispatchOptions<TScenario extends Scenario, _TArtifact> {\n /** Static endpoint URL. Mutually exclusive with `resolveUrl`. */\n url?: string\n /**\n * Dynamic per-cell URL resolver. Receives the scenario + the substrate\n * placement key (from `RunCampaignOptions.cellPlacement`) and returns the\n * worker URL to invoke. Mutually exclusive with `url`.\n */\n resolveUrl?: (input: { scenario: TScenario; placement?: string; cellId: string }) => string\n /** Bearer token or static auth string set as `Authorization`. */\n auth?: string | (() => string | Promise<string>)\n /** Extra headers merged into every request. */\n headers?: Record<string, string>\n /** Per-call timeout in ms. Default 5 minutes. */\n timeoutMs?: number\n /**\n * Additional transport attempts. Default 0: a lost response does not prove\n * the worker did no work. Set a positive value only when the worker durably\n * deduplicates this runAttemptId/cellId and its external effects.\n * 4xx (except 408/429), decoding and receipt-settlement failures are terminal.\n */\n retries?: number\n /** Optional fetch override (auth wrappers, custom agent, mocks). */\n fetchImpl?: typeof fetch\n}\n\nexport interface HttpDispatchRequestBody<TScenario extends Scenario> {\n scenario: TScenario\n cellId: string\n runAttemptId: string\n rep: number\n generation?: number\n seed: number\n placement?: string\n cycleId?: string\n}\n\nexport interface HttpDispatchResponseBody<TArtifact> {\n artifact: TArtifact\n /**\n * Every paid-call receipt the worker's `ctx.cost` settled while producing\n * this artifact, in settlement order. Absent or empty when the worker\n * recorded no paid calls (no `contextFactory`, or a dispatch that pays\n * through some other channel entirely). `httpDispatch` replays each one\n * into the coordinator's own `ctx.cost`.\n */\n receipts?: CostReceipt[]\n}\n\nfunction resolveAuth(auth: HttpDispatchOptions<Scenario, unknown>['auth']): Promise<string | null> {\n if (!auth) return Promise.resolve(null)\n if (typeof auth === 'string') return Promise.resolve(auth)\n return Promise.resolve(auth())\n}\n\n/**\n * Wrap a remote HTTP endpoint as a `Dispatch`. The remote side should run\n * `runDispatchServer` (or any service that speaks the same wire shape).\n *\n * Cancellation: the substrate's per-cell `AbortSignal` is forwarded; the\n * server's `runDispatchServer` translates the resulting `AbortError` into\n * a 499 (client-closed) so the client doesn't retry. The server is a transport,\n * not a durable deduplication owner; its default Dispatch may have side effects.\n */\nexport function httpDispatch<TScenario extends Scenario, TArtifact>(\n opts: HttpDispatchOptions<TScenario, TArtifact>,\n): Dispatch<TScenario, TArtifact> {\n if (!opts.url && !opts.resolveUrl) {\n throw new Error('httpDispatch: pass exactly one of `url` or `resolveUrl`.')\n }\n if (opts.url && opts.resolveUrl) {\n throw new Error('httpDispatch: pass exactly one of `url` or `resolveUrl`, not both.')\n }\n const timeoutMs = opts.timeoutMs ?? 5 * 60 * 1000\n const maxRetries = opts.retries ?? 0\n if (!Number.isSafeInteger(maxRetries) || maxRetries < 0)\n throw new Error('httpDispatch: retries must be a non-negative safe integer.')\n const f: typeof fetch = opts.fetchImpl ?? ((...args) => fetch(...args))\n\n return async (scenario, ctx) => {\n ctx.signal.throwIfAborted()\n const url =\n opts.url ?? opts.resolveUrl!({ scenario, placement: ctx.placement, cellId: ctx.cellId })\n const body: HttpDispatchRequestBody<TScenario> = {\n scenario,\n cellId: ctx.cellId,\n runAttemptId: ctx.runAttemptId,\n rep: ctx.rep,\n generation: ctx.generation,\n seed: ctx.seed,\n placement: ctx.placement,\n cycleId: ctx.cycleId,\n }\n\n const encodedBody = JSON.stringify(body)\n const authValue = await resolveAuth(opts.auth)\n for (let attempt = 0; ; attempt++) {\n ctx.signal.throwIfAborted()\n const combinedSignal = AbortSignal.any([ctx.signal, AbortSignal.timeout(timeoutMs)])\n let res: Response\n // Only a fetch failure can enter this catch. Parsing, receipt settlement\n // and deliberate HTTP refusals must never repeat remote execution.\n try {\n res = await f(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...(authValue\n ? {\n Authorization: authValue.startsWith('Bearer ')\n ? authValue\n : `Bearer ${authValue}`,\n }\n : {}),\n ...opts.headers,\n },\n body: encodedBody,\n signal: combinedSignal,\n })\n } catch (err) {\n if (ctx.signal.aborted || attempt >= maxRetries) throw err\n await sleep(2 ** attempt * 200 + Math.random() * 200, ctx.signal)\n continue\n }\n\n if (res.ok) {\n const parsed = (await res.json()) as HttpDispatchResponseBody<TArtifact>\n for (const receipt of parsed?.receipts ?? []) await replayReceipt(ctx.cost, receipt)\n if (!parsed || typeof parsed !== 'object' || !Object.hasOwn(parsed, 'artifact'))\n throw new Error('httpDispatch: response is missing its artifact.')\n return parsed.artifact\n }\n\n const text = await res.text()\n // Partial spend is still spend. Account for it before surfacing the\n // failure, outside the transport retry catch.\n const receipts = parseErrorReceipts(text)\n for (const receipt of receipts) await replayReceipt(ctx.cost, receipt)\n const retryable = res.status >= 500 || res.status === 408 || res.status === 429\n if (!retryable || receipts.length > 0 || attempt >= maxRetries)\n throw new Error(`httpDispatch ${url} failed (${res.status}): ${text.slice(0, 500)}`)\n await sleep(2 ** attempt * 200 + Math.random() * 200, ctx.signal)\n }\n }\n}\n\nfunction sleep(ms: number, signal: AbortSignal): Promise<void> {\n signal.throwIfAborted()\n return new Promise((resolve, reject) => {\n const onAbort = () => {\n clearTimeout(timer)\n reject(signal.reason)\n }\n const timer = setTimeout(() => {\n signal.removeEventListener('abort', onAbort)\n resolve()\n }, ms)\n signal.addEventListener('abort', onAbort, { once: true })\n })\n}\n\n/** Best-effort receipts from a non-2xx `runDispatchServer` body. Any shape\n * that isn't `{ error, receipts? }` JSON (plain-text 401/404/413 bodies,\n * a non-`runDispatchServer` peer) yields none — never itself a reason to\n * fail the request. */\nfunction parseErrorReceipts(text: string): CostReceipt[] {\n try {\n const parsed = JSON.parse(text) as { receipts?: CostReceipt[] }\n return Array.isArray(parsed.receipts) ? parsed.receipts : []\n } catch {\n return []\n }\n}\n\n/**\n * Re-enter one already-settled remote receipt through `runPaidCall` — the\n * only path `CampaignCostMeter` admits. `execute` does no new work (the\n * spend already happened on the worker); it only replays the worker's\n * outcome so the coordinator's ledger records the same receipt (a settled\n * failure included, so its `error` and cost — a failed call can still burn\n * tokens — are never dropped on the floor). Faithfully replaying a remote\n * failure still returns `succeeded: false` from `runPaidCall`: that's not\n * ours to raise. Only a `receipt`-less failure is — it means `runPaidCall`\n * refused to admit the call at all (a duplicate `callId`, an unknown-cost\n * receipt under a capped coordinator ledger, a breached cost ceiling), so\n * the remote spend could not be accounted for.\n */\nasync function replayReceipt(cost: CampaignCostMeter, receipt: CostReceipt): Promise<void> {\n const knownCostUsd = receipt.costUnknown ? undefined : receipt.costUsd\n const observed = (): CostReceiptInput => ({\n model: receipt.model,\n inputTokens: receipt.inputTokens,\n outputTokens: receipt.outputTokens,\n ...(receipt.reasoningTokens === undefined ? {} : { reasoningTokens: receipt.reasoningTokens }),\n ...(receipt.cachedTokens === undefined ? {} : { cachedTokens: receipt.cachedTokens }),\n ...(receipt.cacheWriteTokens === undefined\n ? {}\n : { cacheWriteTokens: receipt.cacheWriteTokens }),\n ...(receipt.usageUnknown ? { usageUnknown: true as const } : {}),\n ...(knownCostUsd === undefined\n ? { costUnknown: true as const }\n : { actualCostUsd: knownCostUsd }),\n })\n const result = await cost.runPaidCall({\n callId: receipt.callId,\n channel: receipt.channel,\n actor: receipt.actor,\n model: receipt.model,\n maximumCharge:\n knownCostUsd === undefined ? undefined : { externallyEnforcedMaximumUsd: knownCostUsd },\n // No `signal`: the call already happened remotely. Aborting the replay\n // would not undo the spend, only hide it from the ledger.\n execute: async () => {\n if (receipt.error) throw new Error(receipt.error)\n return null\n },\n receipt: observed,\n receiptFromError: observed,\n })\n if (!result.succeeded && !result.receipt) {\n throw result.error\n }\n}\n\n// ── Server ───────────────────────────────────────────────────────────\n\nexport interface RunDispatchServerOptions<TScenario extends Scenario, TArtifact> {\n /** The Dispatch this server exposes — what runs when a request lands. */\n dispatch: Dispatch<TScenario, TArtifact>\n /** TCP port to bind. */\n port: number\n /** Optional bind host; defaults to 0.0.0.0. */\n host?: string\n /** Required for any non-test deployment: the bearer token clients must\n * send. The substrate refuses to start without auth unless `auth: false`\n * is set explicitly (intended ONLY for closed-network/internal testing). */\n auth: string | false\n /** Path the server listens on. Default `/dispatch`. */\n path?: string\n /**\n * Per-request handler that wraps `dispatch` with whatever context the\n * worker side needs to construct a `DispatchContext` — typically the\n * trace writer, artifact writer, and cost meter. The substrate provides\n * synthetic-but-typed defaults if not supplied; production deployments\n * should wire real ones (e.g. ship traces to your OTel collector).\n */\n contextFactory?: (\n req: HttpDispatchRequestBody<TScenario>,\n signal: AbortSignal,\n ) => Promise<DispatchContext>\n /** Optional max payload size for the request body (bytes). Default 10 MB. */\n maxBodyBytes?: number\n /** Hook for observability — called on every successful or failed turn. */\n onRequest?: (event: {\n cellId: string\n durationMs: number\n success: boolean\n error?: unknown\n }) => void\n}\n\nexport interface DispatchServerHandle {\n /** The actual bound port (useful when `port: 0` requests an ephemeral port). */\n port: number\n /** Stop accepting new connections and drain existing ones. */\n close: () => Promise<void>\n}\n\n/**\n * Start an HTTP server exposing a local `Dispatch` over the wire. Pair with\n * `httpDispatch` on the driver side.\n *\n * Wire shape:\n *\n * POST /dispatch\n * Authorization: Bearer <token>\n * Body: HttpDispatchRequestBody\n * 200 OK: HttpDispatchResponseBody\n * 401: missing/invalid auth\n * 408: per-request timeout exceeded\n * 499: client aborted before completion\n * 500: dispatch threw\n *\n * The server is `node:http`-based to keep the runtime dependency surface\n * minimal — works in plain Node, sandbox, or any container.\n */\nexport async function runDispatchServer<TScenario extends Scenario, TArtifact>(\n opts: RunDispatchServerOptions<TScenario, TArtifact>,\n): Promise<DispatchServerHandle> {\n if (opts.auth === undefined) {\n throw new Error(\n \"runDispatchServer: 'auth' is required (pass a bearer-token string, or `auth: false` explicitly for a closed-network test deployment).\",\n )\n }\n const path = opts.path ?? '/dispatch'\n const maxBytes = opts.maxBodyBytes ?? 10 * 1024 * 1024\n const expectedAuth =\n typeof opts.auth === 'string' ? `Bearer ${opts.auth.replace(/^Bearer\\s+/, '')}` : null\n\n // Lazy-import node:http so the file is usable from non-Node bundlers\n // that import the client side only (e.g. an edge driver shipping\n // httpDispatch alone). Server side is opt-in by calling this function.\n const { createServer } = await import('node:http')\n\n const server = createServer(async (req, res) => {\n const start = Date.now()\n let cellId = 'unknown'\n let success = false\n let errCaught: unknown\n // Hoisted so a dispatch that throws AFTER paying for some of its work\n // still reports that spend in the error response — a partial spend is\n // still spend, and it must reach the coordinator's ledger exactly like\n // a locally-dispatched cell's failure accounting does.\n const receipts: CostReceipt[] = []\n\n try {\n if (req.method !== 'POST' || req.url?.split('?')[0] !== path) {\n res.statusCode = 404\n res.end('not found')\n return\n }\n if (expectedAuth) {\n const got = req.headers.authorization\n if (got !== expectedAuth) {\n res.statusCode = 401\n res.end('unauthorized')\n return\n }\n }\n\n // Read body up to maxBytes\n const chunks: Buffer[] = []\n let totalBytes = 0\n const aborter = new AbortController()\n // The request stream's 'close' fires when the BODY completes, so it\n // cannot signal disconnection. The response stream's 'close' fires\n // once per exchange: with `writableEnded` still false it means the\n // client went away before the dispatch answered.\n res.on('close', () => {\n if (!res.writableEnded) aborter.abort()\n })\n\n for await (const chunk of req) {\n const buf = chunk as Buffer\n totalBytes += buf.length\n if (totalBytes > maxBytes) {\n res.statusCode = 413\n res.end('payload too large')\n return\n }\n chunks.push(buf)\n }\n\n const body = JSON.parse(\n Buffer.concat(chunks).toString('utf8'),\n ) as HttpDispatchRequestBody<TScenario>\n if (typeof body.runAttemptId !== 'string' || body.runAttemptId.trim().length === 0) {\n throw new Error('runDispatchServer: request runAttemptId is required')\n }\n cellId = body.cellId\n\n const ctx: DispatchContext = opts.contextFactory\n ? await opts.contextFactory(body, aborter.signal)\n : {\n cellId: body.cellId,\n runAttemptId: body.runAttemptId,\n rep: body.rep,\n generation: body.generation,\n seed: body.seed,\n signal: aborter.signal,\n placement: body.placement,\n cycleId: body.cycleId,\n trace: NOOP_TRACE,\n artifacts: NOOP_ARTIFACTS,\n cost: UNCONFIGURED_COST,\n }\n if (ctx.runAttemptId !== body.runAttemptId) {\n throw new Error('runDispatchServer: contextFactory must preserve request runAttemptId')\n }\n\n // Record every receipt this dispatch settles on ITS OWN `ctx.cost` (the\n // worker's ledger, not the coordinator's) so the response can carry\n // them back. `httpDispatch` replays each one into the coordinator's\n // ledger — see the module doc.\n const recordingCost: CampaignCostMeter = {\n async runPaidCall(input) {\n const result = await ctx.cost.runPaidCall(input)\n if (result.receipt) receipts.push(result.receipt)\n return result\n },\n }\n\n const artifact = await opts.dispatch(body.scenario, { ...ctx, cost: recordingCost })\n const responseBody: HttpDispatchResponseBody<TArtifact> = {\n artifact,\n ...(receipts.length ? { receipts } : {}),\n }\n\n res.statusCode = 200\n res.setHeader('content-type', 'application/json')\n res.end(JSON.stringify(responseBody))\n success = true\n } catch (err) {\n errCaught = err\n // Cancellation does not erase work that was already charged. A client\n // that can still read this response receives the same complete receipts.\n res.statusCode = (err as Error)?.name === 'AbortError' ? 499 : 500\n res.setHeader('content-type', 'application/json')\n res.end(\n JSON.stringify({\n error: err instanceof Error ? err.message : String(err),\n ...(receipts.length ? { receipts } : {}),\n }),\n )\n } finally {\n opts.onRequest?.({\n cellId,\n durationMs: Date.now() - start,\n success,\n error: errCaught,\n })\n }\n })\n\n await new Promise<void>((resolve, reject) => {\n server.once('error', reject)\n server.listen(opts.port, opts.host ?? '0.0.0.0', () => resolve())\n })\n\n const addr = server.address()\n const boundPort = typeof addr === 'object' && addr ? addr.port : opts.port\n\n return {\n port: boundPort,\n close: () =>\n new Promise<void>((resolve, reject) => {\n server.close((err) => (err ? reject(err) : resolve()))\n }),\n }\n}\n\n// ── Defaults for deterministic work; paid work needs a real context ──\n\nconst NOOP_TRACE = {\n span: () => ({\n end: () => {},\n setAttribute: () => {},\n setStatus: () => {},\n recordException: () => {},\n addEvent: () => {},\n }),\n} as unknown as DispatchContext['trace']\n\nconst NOOP_ARTIFACTS = {\n write: async () => undefined,\n read: async () => undefined,\n list: async () => [],\n} as unknown as DispatchContext['artifacts']\n\nconst UNCONFIGURED_COST: CampaignCostMeter = {\n async runPaidCall() {\n throw new Error('runDispatchServer: paid work requires a contextFactory cost meter.')\n },\n}\n"],"mappings":";AA4GA,SAAS,YAAY,MAA8E;CACjG,IAAI,CAAC,MAAM,OAAO,QAAQ,QAAQ,IAAI;CACtC,IAAI,OAAO,SAAS,UAAU,OAAO,QAAQ,QAAQ,IAAI;CACzD,OAAO,QAAQ,QAAQ,KAAK,CAAC;AAC/B;;;;;;;;;;AAWA,SAAgB,aACd,MACgC;CAChC,IAAI,CAAC,KAAK,OAAO,CAAC,KAAK,YACrB,MAAM,IAAI,MAAM,0DAA0D;CAE5E,IAAI,KAAK,OAAO,KAAK,YACnB,MAAM,IAAI,MAAM,oEAAoE;CAEtF,MAAM,YAAY,KAAK,aAAa;CACpC,MAAM,aAAa,KAAK,WAAW;CACnC,IAAI,CAAC,OAAO,cAAc,UAAU,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
{"version":3,"file":"http.js","names":[],"sources":["../../src/adapters/http.ts"],"sourcesContent":["/**\n * # `@tangle-network/agent-eval/adapters/http` — distributed Dispatch over HTTP.\n *\n * Decouples coordinator and worker. The coordinator (running\n * `runImprovementLoop` or `runCampaign`) can live anywhere — your VPC, a dev\n * laptop, a cron VM. The workers (running the actual agent) can live anywhere else — different\n * regions, different clouds, different boxes — as long as they speak HTTP.\n *\n * Both sides:\n *\n * - **`httpDispatch({ url | resolveUrl, ... })`** — client. Returns a\n * `Dispatch` that POSTs `{ scenario, ctx }` to a worker URL and parses\n * the artifact back. AbortSignal-aware, one attempt by default,\n * bounded timeout per call. Explicit retries require worker-owned replay.\n * - **`runDispatchServer({ dispatch, port, ... })`** — server. Wraps your\n * local `Dispatch` as an HTTP endpoint. Handles auth, JSON parsing,\n * error mapping, and cancellation when the client aborts.\n *\n * # Cost receipts cross the wire too\n *\n * A worker dispatch pays for its own model calls through its own\n * `ctx.cost` (wired by `contextFactory`) — a different `CostLedger` than the\n * coordinator's. `runDispatchServer` records every receipt that dispatch\n * settles and returns them alongside the artifact; `httpDispatch` replays\n * each one into the coordinator's `ctx.cost`, the same paid-call path a\n * local dispatch uses. A remote cell's spend therefore reaches the\n * coordinator's `CostLedger` — its summary, its cost ceiling, its\n * `CampaignCellResult.costUsd` — exactly like an in-process cell's does.\n * The worker must authorize and bound spend before executing; importing its\n * receipts cannot retroactively enforce the coordinator's ceiling.\n * Paid work requires a real `contextFactory` cost meter. An empty receipt\n * list does not establish free execution: the host must require usage evidence\n * and reconcile the worker ledger when a client disconnects before delivery.\n *\n * # Topology examples\n *\n * **Single-worker:** coordinator on box A, worker on box B. Set\n * `httpDispatch({ url: 'https://box-b/dispatch' })`.\n *\n * **Multi-region:** N workers across regions. Use `httpDispatch({ resolveUrl })`\n * with a function that picks the URL per cell from `ctx.placement`. Combined\n * with `cellPlacement` on `RunCampaignOptions`, the substrate fans cells\n * across geographies in parallel.\n *\n * **Coordinator-as-a-service:** coordinator runs as a long-lived process or service\n * (holds optimization state across generations); workers are stateless\n * HTTP services that can scale horizontally per cell.\n */\n\nimport type { CampaignCostMeter, Dispatch, DispatchContext, Scenario } from '../contract'\nimport type { CostReceipt, CostReceiptInput } from '../cost-ledger'\n\n// ── Client ───────────────────────────────────────────────────────────\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- TArtifact is unused\n// in this options interface but kept as a parameter so callers can write\n// `HttpDispatchOptions<MyScenario, MyArtifact>` symmetrically with\n// `Dispatch<MyScenario, MyArtifact>`. Marking it unused at the position\n// where it bites.\nexport interface HttpDispatchOptions<TScenario extends Scenario, _TArtifact> {\n /** Static endpoint URL. Mutually exclusive with `resolveUrl`. */\n url?: string\n /**\n * Dynamic per-cell URL resolver. Receives the scenario + the substrate\n * placement key (from `RunCampaignOptions.cellPlacement`) and returns the\n * worker URL to invoke. Mutually exclusive with `url`.\n */\n resolveUrl?: (input: { scenario: TScenario; placement?: string; cellId: string }) => string\n /** Bearer token or static auth string set as `Authorization`. */\n auth?: string | (() => string | Promise<string>)\n /** Extra headers merged into every request. */\n headers?: Record<string, string>\n /** Per-call timeout in ms. Default 5 minutes. */\n timeoutMs?: number\n /**\n * Additional transport attempts. Default 0: a lost response does not prove\n * the worker did no work. Set a positive value only when the worker durably\n * deduplicates this runAttemptId/cellId and its external effects.\n * 4xx (except 408/429), decoding and receipt-settlement failures are terminal.\n */\n retries?: number\n /** Optional fetch override (auth wrappers, custom agent, mocks). */\n fetchImpl?: typeof fetch\n}\n\nexport interface HttpDispatchRequestBody<TScenario extends Scenario> {\n scenario: TScenario\n cellId: string\n runAttemptId: string\n rep: number\n generation?: number\n seed: number\n placement?: string\n cycleId?: string\n}\n\nexport interface HttpDispatchResponseBody<TArtifact> {\n artifact: TArtifact\n /**\n * Every paid-call receipt the worker's `ctx.cost` settled while producing\n * this artifact, in settlement order. Absent or empty when the worker\n * recorded no paid calls (no `contextFactory`, or a dispatch that pays\n * through some other channel entirely). `httpDispatch` replays each one\n * into the coordinator's own `ctx.cost`.\n */\n receipts?: CostReceipt[]\n}\n\nfunction resolveAuth(auth: HttpDispatchOptions<Scenario, unknown>['auth']): Promise<string | null> {\n if (!auth) return Promise.resolve(null)\n if (typeof auth === 'string') return Promise.resolve(auth)\n return Promise.resolve(auth())\n}\n\n/**\n * Wrap a remote HTTP endpoint as a `Dispatch`. The remote side should run\n * `runDispatchServer` (or any service that speaks the same wire shape).\n *\n * Cancellation: the substrate's per-cell `AbortSignal` is forwarded; the\n * server's `runDispatchServer` translates the resulting `AbortError` into\n * a 499 (client-closed) so the client doesn't retry. The server is a transport,\n * not a durable deduplication owner; its default Dispatch may have side effects.\n */\nexport function httpDispatch<TScenario extends Scenario, TArtifact>(\n opts: HttpDispatchOptions<TScenario, TArtifact>,\n): Dispatch<TScenario, TArtifact> {\n if (!opts.url && !opts.resolveUrl) {\n throw new Error('httpDispatch: pass exactly one of `url` or `resolveUrl`.')\n }\n if (opts.url && opts.resolveUrl) {\n throw new Error('httpDispatch: pass exactly one of `url` or `resolveUrl`, not both.')\n }\n const timeoutMs = opts.timeoutMs ?? 5 * 60 * 1000\n const maxRetries = opts.retries ?? 0\n if (!Number.isSafeInteger(maxRetries) || maxRetries < 0)\n throw new Error('httpDispatch: retries must be a non-negative safe integer.')\n const f: typeof fetch = opts.fetchImpl ?? ((...args) => fetch(...args))\n\n return async (scenario, ctx) => {\n ctx.signal.throwIfAborted()\n const url =\n opts.url ?? opts.resolveUrl!({ scenario, placement: ctx.placement, cellId: ctx.cellId })\n const body: HttpDispatchRequestBody<TScenario> = {\n scenario,\n cellId: ctx.cellId,\n runAttemptId: ctx.runAttemptId,\n rep: ctx.rep,\n generation: ctx.generation,\n seed: ctx.seed,\n placement: ctx.placement,\n cycleId: ctx.cycleId,\n }\n\n const encodedBody = JSON.stringify(body)\n const authValue = await resolveAuth(opts.auth)\n for (let attempt = 0; ; attempt++) {\n ctx.signal.throwIfAborted()\n const combinedSignal = AbortSignal.any([ctx.signal, AbortSignal.timeout(timeoutMs)])\n let res: Response\n // Only a fetch failure can enter this catch. Parsing, receipt settlement\n // and deliberate HTTP refusals must never repeat remote execution.\n try {\n res = await f(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...(authValue\n ? {\n Authorization: authValue.startsWith('Bearer ')\n ? authValue\n : `Bearer ${authValue}`,\n }\n : {}),\n ...opts.headers,\n },\n body: encodedBody,\n signal: combinedSignal,\n })\n } catch (err) {\n if (ctx.signal.aborted || attempt >= maxRetries) throw err\n await sleep(2 ** attempt * 200 + Math.random() * 200, ctx.signal)\n continue\n }\n\n if (res.ok) {\n const parsed = (await res.json()) as HttpDispatchResponseBody<TArtifact>\n for (const receipt of parsed?.receipts ?? []) await replayReceipt(ctx.cost, receipt)\n if (!parsed || typeof parsed !== 'object' || !Object.hasOwn(parsed, 'artifact'))\n throw new Error('httpDispatch: response is missing its artifact.')\n return parsed.artifact\n }\n\n const text = await res.text()\n // Partial spend is still spend. Account for it before surfacing the\n // failure, outside the transport retry catch.\n const receipts = parseErrorReceipts(text)\n for (const receipt of receipts) await replayReceipt(ctx.cost, receipt)\n const retryable = res.status >= 500 || res.status === 408 || res.status === 429\n if (!retryable || receipts.length > 0 || attempt >= maxRetries)\n throw new Error(`httpDispatch ${url} failed (${res.status}): ${text.slice(0, 500)}`)\n await sleep(2 ** attempt * 200 + Math.random() * 200, ctx.signal)\n }\n }\n}\n\nfunction sleep(ms: number, signal: AbortSignal): Promise<void> {\n signal.throwIfAborted()\n return new Promise((resolve, reject) => {\n const onAbort = () => {\n clearTimeout(timer)\n reject(signal.reason)\n }\n const timer = setTimeout(() => {\n signal.removeEventListener('abort', onAbort)\n resolve()\n }, ms)\n signal.addEventListener('abort', onAbort, { once: true })\n })\n}\n\n/** Best-effort receipts from a non-2xx `runDispatchServer` body. Any shape\n * that isn't `{ error, receipts? }` JSON (plain-text 401/404/413 bodies,\n * a non-`runDispatchServer` peer) yields none — never itself a reason to\n * fail the request. */\nfunction parseErrorReceipts(text: string): CostReceipt[] {\n try {\n const parsed = JSON.parse(text) as { receipts?: CostReceipt[] }\n return Array.isArray(parsed.receipts) ? parsed.receipts : []\n } catch {\n return []\n }\n}\n\n/**\n * Re-enter one already-settled remote receipt through `runPaidCall` — the\n * only path `CampaignCostMeter` admits. `execute` does no new work (the\n * spend already happened on the worker); it only replays the worker's\n * outcome so the coordinator's ledger records the same receipt (a settled\n * failure included, so its `error` and cost — a failed call can still burn\n * tokens — are never dropped on the floor). Faithfully replaying a remote\n * failure still returns `succeeded: false` from `runPaidCall`: that's not\n * ours to raise. Only a `receipt`-less failure is — it means `runPaidCall`\n * refused to admit the call at all (a duplicate `callId`, an unknown-cost\n * receipt under a capped coordinator ledger, a breached cost ceiling), so\n * the remote spend could not be accounted for.\n */\nasync function replayReceipt(cost: CampaignCostMeter, receipt: CostReceipt): Promise<void> {\n const knownCostUsd = receipt.costUnknown ? undefined : receipt.costUsd\n const observed = (): CostReceiptInput => ({\n ...(receipt.costBreakdown ? { costBreakdown: receipt.costBreakdown } : {}),\n model: receipt.model,\n inputTokens: receipt.inputTokens,\n outputTokens: receipt.outputTokens,\n ...(receipt.reasoningTokens === undefined ? {} : { reasoningTokens: receipt.reasoningTokens }),\n ...(receipt.cachedTokens === undefined ? {} : { cachedTokens: receipt.cachedTokens }),\n ...(receipt.cacheWriteTokens === undefined\n ? {}\n : { cacheWriteTokens: receipt.cacheWriteTokens }),\n ...(receipt.usageUnknown ? { usageUnknown: true as const } : {}),\n ...(knownCostUsd === undefined\n ? { costUnknown: true as const }\n : { actualCostUsd: knownCostUsd }),\n })\n const result = await cost.runPaidCall({\n callId: receipt.callId,\n channel: receipt.channel,\n actor: receipt.actor,\n model: receipt.model,\n maximumCharge:\n knownCostUsd === undefined ? undefined : { externallyEnforcedMaximumUsd: knownCostUsd },\n // No `signal`: the call already happened remotely. Aborting the replay\n // would not undo the spend, only hide it from the ledger.\n execute: async () => {\n if (receipt.error) throw new Error(receipt.error)\n return null\n },\n receipt: observed,\n receiptFromError: observed,\n })\n if (!result.succeeded && !result.receipt) {\n throw result.error\n }\n}\n\n// ── Server ───────────────────────────────────────────────────────────\n\nexport interface RunDispatchServerOptions<TScenario extends Scenario, TArtifact> {\n /** The Dispatch this server exposes — what runs when a request lands. */\n dispatch: Dispatch<TScenario, TArtifact>\n /** TCP port to bind. */\n port: number\n /** Optional bind host; defaults to 0.0.0.0. */\n host?: string\n /** Required for any non-test deployment: the bearer token clients must\n * send. The substrate refuses to start without auth unless `auth: false`\n * is set explicitly (intended ONLY for closed-network/internal testing). */\n auth: string | false\n /** Path the server listens on. Default `/dispatch`. */\n path?: string\n /**\n * Per-request handler that wraps `dispatch` with whatever context the\n * worker side needs to construct a `DispatchContext` — typically the\n * trace writer, artifact writer, and cost meter. The substrate provides\n * synthetic-but-typed defaults if not supplied; production deployments\n * should wire real ones (e.g. ship traces to your OTel collector).\n */\n contextFactory?: (\n req: HttpDispatchRequestBody<TScenario>,\n signal: AbortSignal,\n ) => Promise<DispatchContext>\n /** Optional max payload size for the request body (bytes). Default 10 MB. */\n maxBodyBytes?: number\n /** Hook for observability — called on every successful or failed turn. */\n onRequest?: (event: {\n cellId: string\n durationMs: number\n success: boolean\n error?: unknown\n }) => void\n}\n\nexport interface DispatchServerHandle {\n /** The actual bound port (useful when `port: 0` requests an ephemeral port). */\n port: number\n /** Stop accepting new connections and drain existing ones. */\n close: () => Promise<void>\n}\n\n/**\n * Start an HTTP server exposing a local `Dispatch` over the wire. Pair with\n * `httpDispatch` on the driver side.\n *\n * Wire shape:\n *\n * POST /dispatch\n * Authorization: Bearer <token>\n * Body: HttpDispatchRequestBody\n * 200 OK: HttpDispatchResponseBody\n * 401: missing/invalid auth\n * 408: per-request timeout exceeded\n * 499: client aborted before completion\n * 500: dispatch threw\n *\n * The server is `node:http`-based to keep the runtime dependency surface\n * minimal — works in plain Node, sandbox, or any container.\n */\nexport async function runDispatchServer<TScenario extends Scenario, TArtifact>(\n opts: RunDispatchServerOptions<TScenario, TArtifact>,\n): Promise<DispatchServerHandle> {\n if (opts.auth === undefined) {\n throw new Error(\n \"runDispatchServer: 'auth' is required (pass a bearer-token string, or `auth: false` explicitly for a closed-network test deployment).\",\n )\n }\n const path = opts.path ?? '/dispatch'\n const maxBytes = opts.maxBodyBytes ?? 10 * 1024 * 1024\n const expectedAuth =\n typeof opts.auth === 'string' ? `Bearer ${opts.auth.replace(/^Bearer\\s+/, '')}` : null\n\n // Lazy-import node:http so the file is usable from non-Node bundlers\n // that import the client side only (e.g. an edge driver shipping\n // httpDispatch alone). Server side is opt-in by calling this function.\n const { createServer } = await import('node:http')\n\n const server = createServer(async (req, res) => {\n const start = Date.now()\n let cellId = 'unknown'\n let success = false\n let errCaught: unknown\n // Hoisted so a dispatch that throws AFTER paying for some of its work\n // still reports that spend in the error response — a partial spend is\n // still spend, and it must reach the coordinator's ledger exactly like\n // a locally-dispatched cell's failure accounting does.\n const receipts: CostReceipt[] = []\n\n try {\n if (req.method !== 'POST' || req.url?.split('?')[0] !== path) {\n res.statusCode = 404\n res.end('not found')\n return\n }\n if (expectedAuth) {\n const got = req.headers.authorization\n if (got !== expectedAuth) {\n res.statusCode = 401\n res.end('unauthorized')\n return\n }\n }\n\n // Read body up to maxBytes\n const chunks: Buffer[] = []\n let totalBytes = 0\n const aborter = new AbortController()\n // The request stream's 'close' fires when the BODY completes, so it\n // cannot signal disconnection. The response stream's 'close' fires\n // once per exchange: with `writableEnded` still false it means the\n // client went away before the dispatch answered.\n res.on('close', () => {\n if (!res.writableEnded) aborter.abort()\n })\n\n for await (const chunk of req) {\n const buf = chunk as Buffer\n totalBytes += buf.length\n if (totalBytes > maxBytes) {\n res.statusCode = 413\n res.end('payload too large')\n return\n }\n chunks.push(buf)\n }\n\n const body = JSON.parse(\n Buffer.concat(chunks).toString('utf8'),\n ) as HttpDispatchRequestBody<TScenario>\n if (typeof body.runAttemptId !== 'string' || body.runAttemptId.trim().length === 0) {\n throw new Error('runDispatchServer: request runAttemptId is required')\n }\n cellId = body.cellId\n\n const ctx: DispatchContext = opts.contextFactory\n ? await opts.contextFactory(body, aborter.signal)\n : {\n cellId: body.cellId,\n runAttemptId: body.runAttemptId,\n rep: body.rep,\n generation: body.generation,\n seed: body.seed,\n signal: aborter.signal,\n placement: body.placement,\n cycleId: body.cycleId,\n trace: NOOP_TRACE,\n artifacts: NOOP_ARTIFACTS,\n cost: UNCONFIGURED_COST,\n }\n if (ctx.runAttemptId !== body.runAttemptId) {\n throw new Error('runDispatchServer: contextFactory must preserve request runAttemptId')\n }\n\n // Record every receipt this dispatch settles on ITS OWN `ctx.cost` (the\n // worker's ledger, not the coordinator's) so the response can carry\n // them back. `httpDispatch` replays each one into the coordinator's\n // ledger — see the module doc.\n const recordingCost: CampaignCostMeter = {\n async runPaidCall(input) {\n const result = await ctx.cost.runPaidCall(input)\n if (result.receipt) receipts.push(result.receipt)\n return result\n },\n }\n\n const artifact = await opts.dispatch(body.scenario, { ...ctx, cost: recordingCost })\n const responseBody: HttpDispatchResponseBody<TArtifact> = {\n artifact,\n ...(receipts.length ? { receipts } : {}),\n }\n\n res.statusCode = 200\n res.setHeader('content-type', 'application/json')\n res.end(JSON.stringify(responseBody))\n success = true\n } catch (err) {\n errCaught = err\n // Cancellation does not erase work that was already charged. A client\n // that can still read this response receives the same complete receipts.\n res.statusCode = (err as Error)?.name === 'AbortError' ? 499 : 500\n res.setHeader('content-type', 'application/json')\n res.end(\n JSON.stringify({\n error: err instanceof Error ? err.message : String(err),\n ...(receipts.length ? { receipts } : {}),\n }),\n )\n } finally {\n opts.onRequest?.({\n cellId,\n durationMs: Date.now() - start,\n success,\n error: errCaught,\n })\n }\n })\n\n await new Promise<void>((resolve, reject) => {\n server.once('error', reject)\n server.listen(opts.port, opts.host ?? '0.0.0.0', () => resolve())\n })\n\n const addr = server.address()\n const boundPort = typeof addr === 'object' && addr ? addr.port : opts.port\n\n return {\n port: boundPort,\n close: () =>\n new Promise<void>((resolve, reject) => {\n server.close((err) => (err ? reject(err) : resolve()))\n }),\n }\n}\n\n// ── Defaults for deterministic work; paid work needs a real context ──\n\nconst NOOP_TRACE = {\n span: () => ({\n end: () => {},\n setAttribute: () => {},\n setStatus: () => {},\n recordException: () => {},\n addEvent: () => {},\n }),\n} as unknown as DispatchContext['trace']\n\nconst NOOP_ARTIFACTS = {\n write: async () => undefined,\n read: async () => undefined,\n list: async () => [],\n} as unknown as DispatchContext['artifacts']\n\nconst UNCONFIGURED_COST: CampaignCostMeter = {\n async runPaidCall() {\n throw new Error('runDispatchServer: paid work requires a contextFactory cost meter.')\n },\n}\n"],"mappings":";AA4GA,SAAS,YAAY,MAA8E;CACjG,IAAI,CAAC,MAAM,OAAO,QAAQ,QAAQ,IAAI;CACtC,IAAI,OAAO,SAAS,UAAU,OAAO,QAAQ,QAAQ,IAAI;CACzD,OAAO,QAAQ,QAAQ,KAAK,CAAC;AAC/B;;;;;;;;;;AAWA,SAAgB,aACd,MACgC;CAChC,IAAI,CAAC,KAAK,OAAO,CAAC,KAAK,YACrB,MAAM,IAAI,MAAM,0DAA0D;CAE5E,IAAI,KAAK,OAAO,KAAK,YACnB,MAAM,IAAI,MAAM,oEAAoE;CAEtF,MAAM,YAAY,KAAK,aAAa;CACpC,MAAM,aAAa,KAAK,WAAW;CACnC,IAAI,CAAC,OAAO,cAAc,UAAU,KAAK,aAAa,GACpD,MAAM,IAAI,MAAM,4DAA4D;CAC9E,MAAM,IAAkB,KAAK,eAAe,GAAG,SAAS,MAAM,GAAG,IAAI;CAErE,OAAO,OAAO,UAAU,QAAQ;EAC9B,IAAI,OAAO,eAAe;EAC1B,MAAM,MACJ,KAAK,OAAO,KAAK,WAAY;GAAE;GAAU,WAAW,IAAI;GAAW,QAAQ,IAAI;EAAO,CAAC;EACzF,MAAM,OAA2C;GAC/C;GACA,QAAQ,IAAI;GACZ,cAAc,IAAI;GAClB,KAAK,IAAI;GACT,YAAY,IAAI;GAChB,MAAM,IAAI;GACV,WAAW,IAAI;GACf,SAAS,IAAI;EACf;EAEA,M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O,GAAG;IACtD,GAAI,SAAS,SAAS,EAAE,SAAS,IAAI,CAAC;GACxC,CAAC,CACH;EACF,UAAU;GACR,KAAK,YAAY;IACf;IACA,YAAY,KAAK,IAAI,IAAI;IACzB;IACA,OAAO;GACT,CAAC;EACH;CACF,CAAC;CAED,MAAM,IAAI,SAAe,SAAS,WAAW;EAC3C,OAAO,KAAK,SAAS,MAAM;EAC3B,OAAO,OAAO,KAAK,MAAM,KAAK,QAAQ,iBAAiB,QAAQ,CAAC;CAClE,CAAC;CAED,MAAM,OAAO,OAAO,QAAQ;CAG5B,OAAO;EACL,MAHgB,OAAO,SAAS,YAAY,OAAO,KAAK,OAAO,KAAK;EAIpE,aACE,IAAI,SAAe,SAAS,WAAW;GACrC,OAAO,OAAO,QAAS,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAE;EACvD,CAAC;CACL;AACF;AAIA,MAAM,aAAa,EACjB,aAAa;CACX,WAAW,CAAC;CACZ,oBAAoB,CAAC;CACrB,iBAAiB,CAAC;CAClB,uBAAuB,CAAC;CACxB,gBAAgB,CAAC;AACnB,GACF;AAEA,MAAM,iBAAiB;CACrB,OAAO,YAAY,KAAA;CACnB,MAAM,YAAY,KAAA;CAClB,MAAM,YAAY,CAAC;AACrB;AAEA,MAAM,oBAAuC,EAC3C,MAAM,cAAc;CAClB,MAAM,IAAI,MAAM,oEAAoE;AACtF,EACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { W as TraceAnalysisStore, i as AnalystFinding, m as EvidenceRef, p as AnalystUsageReceipt } from "./types-
|
|
3
|
-
import { C as ChatResponse, S as ChatRequest } from "./types-
|
|
1
|
+
import { f as CostReceiptInput, m as CustomTokenPricing } from "./cost-ledger-C1W3ICmP.js";
|
|
2
|
+
import { W as TraceAnalysisStore, i as AnalystFinding, m as EvidenceRef, p as AnalystUsageReceipt } from "./types-8yQzNm8u.js";
|
|
3
|
+
import { C as ChatResponse, S as ChatRequest } from "./types-eMhdacVp.js";
|
|
4
4
|
import { AgentProfile, AgentProfile as AgentProfile$1, HarnessType, HarnessType as HarnessType$1 } from "@tangle-network/agent-interface";
|
|
5
5
|
//#region src/campaign/external-optimizer-contracts.d.ts
|
|
6
6
|
interface ExternalOptimizerProcessLimits {
|
|
@@ -472,4 +472,4 @@ declare function agentProfileId(profile: AgentProfile): string;
|
|
|
472
472
|
declare function agentProfileHash(profile: AgentProfile): string;
|
|
473
473
|
//#endregion
|
|
474
474
|
export { traceStoreEvidenceResolver as A, ExternalOptimizerModelCallRequest as B, AnalystEvidenceResolutionError as C, AnalystLatencyDistribution as D, AnalystIssueExpectation as E, ExternalOptimizerEndpointFormat as F, ExternalOptimizerRunnerCommand as G, ExternalOptimizerModelExecutionObservation as H, ExternalOptimizerEvaluationObservation as I, ExternalTextEvaluationRequest as J, ExternalOptimizerWireCounts as K, ExternalOptimizerEvaluationRefusalReason as L, DEFAULT_EXTERNAL_OPTIMIZER_PROCESS_LIMITS as M, ExternalOptimizerCallbackLimits as N, RunAnalystBenchmarkOptions as O, ExternalOptimizerChatRequest as P, ExternalOptimizerModelBudget as R, AnalystEvidenceResolution as S, AnalystFindingScore as T, ExternalOptimizerProcessLimits as U, ExternalOptimizerModelCallResult as V, ExternalOptimizerResumeMode as W, AnalystBenchmarkProvenance as _, ProfileAxisSpec as a, AnalystBenchmarkSummary as b, expandProfileAxes as c, AnalystBenchmarkDatasetRef as d, AnalystBenchmarkDescriptor as f, AnalystBenchmarkOutput as g, AnalystBenchmarkObservation as h, HarnessType$1 as i, DEFAULT_EXTERNAL_OPTIMIZER_CALLBACK_LIMITS as j, runAnalystBenchmark as k, harnessAxisOf as l, AnalystBenchmarkLabelState as m, CODING_HARNESSES as n, agentProfileHash as o, AnalystBenchmarkError as p, ExternalTextCandidate as q, HARNESS_NATIVE_MODEL as r, agentProfileId as s, AgentProfile$1 as t, AnalystBenchmarkCase as u, AnalystBenchmarkResult as v, AnalystEvidenceResolver as w, AnalystEvidenceExpectation as x, AnalystBenchmarkRunner as y, ExternalOptimizerModelCall as z };
|
|
475
|
-
//# sourceMappingURL=agent-profile-
|
|
475
|
+
//# sourceMappingURL=agent-profile-D01Io2Xw.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-profile-
|
|
1
|
+
{"version":3,"file":"agent-profile-D01Io2Xw.d.ts","names":["_$___cost_ledger0.CostReceiptInput"],"sources":["../src/campaign/external-optimizer-contracts.ts","../src/analyst/benchmark.ts","../src/agent-profile.ts"],"mappings":";;;;;UAciB;;EAEf;;EAEA;;EAEA;;cAGW,2CAA2C,SAAS;UAOhD;;EAEf;;EAEA;;cAGW,4CAA4C,SAAS;UAMjD;EACf;EACA;EACA,MAAM,OAAO;;EAEb,SAAS,QAAQ;;KAGP;KAEA,iCAAiC;UAE5B;EACf,WAAW;EACX;;KAqDG,aAAa,KAAK,eAAc,6BACjC,IACA,0BAA0B,gBACf,aAAa,OACtB,+BACc,WAAW,IAAI,aAAa,EAAE,SAC1C;;KAGI,+BAA+B,aACzC,KAAK;EAA0B;;KAGrB;;UAMK;;WAEN;;WAEA,SAAS;;WAET,iBAAiB;WACjB,QAAQ;;;KAIP;WAEG;;WAEA,UAAU;;;;;;;WAOV,SAPUA;;WASV;;WAGA;;WAEA;;WAEA,SATkCA;;WAWlC;;;;;;;;;;;;KAaH,8BACV,SAAS,sCACN,QAAQ;;KAGD;WAEG;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAGA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;KAGH;;;;;;KAUA;WAEG;WACA;WACA,WAAW;WACX;;WAGA;WACA;WACA,WAAW;WACX;WACA;;WAEA;WACA;;WAGA;WACA;WACA,QAAQ;WACR,YAAY;WACZ;WACA;;UAGE;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;EAUA;;;;;;EAMA,UAAU;;EAEV;;;UAIe;;EAEf;;EAEA;;;;UCpQe;EACf;EACA,OAAO;;UAGQ;EACf;EACA;EACA;EACA;EACA,oBAAoB;EACpB;;EAEA,4BAA4B;;KAGlB;UAEK,qBAAqB;EACpC;;EAEA;;EAEA,YAAY;EACZ,OAAO;EACP,yBAAyB;;EAEzB,2BAA2B;EAC3B;EACA,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;EACA,mBAAmB;EACnB;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;EACA;;UAGe;EACf,UAAU;EACV;EACA;;UAGe;EACf;EACA;EACA,oBAAoB;EACpB,QAAQ;;EAER;;KAGU,wBAAwB,qBAAqB;EACvD;EACA,WAAW;EACX,UAAU;EACV,SAAS;gBACK;;;;;iBAMA,2BAA2B,QACzC,WAAW,OAAO,WAAW,qBAC5B,wBAAwB;UAoBV;EACf,mBAAmB;EACnB,QAAQ;EACR,WAAW;;;;;EAKX;;EAEA,QAAQ;;UAGO;EACf;EACA;EACA;EACA;;UAGe,uBAAuB;EACtC;EACA,QACE,OAAO,QACP;IAAW;IAAgB;IAAoB,SAAS;MACvD,yBAAyB,QAAQ;;UAGrB;EACf;EACA;EACA;EACA,YAAY;EACZ;EACA;EACA;EACA;EACA,mBAAmB;EACnB,OAAO;EACP,qBAAqB;EACrB;EACA,eAAe;EACf,QAAQ;EACR,iBAAiB;EACjB,QAAQ;;UAGO;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;EACA,WAAW;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA,UAAU;EACV;EACA,cAAc;EACd,WAAW;;UAGI,mCAAmC;EAClD;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,YAAY;EACZ,cAAc;EACd,WAAW;;UAGI,2BAA2B;EAC1C,gBAAgB,qBAAqB;EACrC,kBAAkB,uBAAuB;EACzC;EACA;EACA;EACA,kBAAkB,wBAAwB;EAC1C,YAAY;;EAEZ,+BAA+B;EAC/B,iBAAiB,aAAa,uCAAuC;EACrE,SAAS;;iBAGW,oBAAoB,QACxC,SAAS,2BAA2B,UACnC,QAAQ;;;;;;;;;;cCnQE,2BAA2B;UAOvB;;;EAGf,MAAM;;EAEN,qBAAqB;;;EAGrB;;;;;;EAMA;;;;;;;cAQW;;;;;;;;;;;;;;;;;;;iBAoBG,kBAAkB,MAAM,kBAAkB;;;;;;;;iBAwD1C,cACd,SAAS,KAAK;EACX,SAAS;EAAa;;;;;;;;;iBAiBX,eAAe,SAAS;;;;;;;;;;;iBAmDxB,iBAAiB,SAAS"}
|
package/dist/analyst/index.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as FindingReaderLabel, C as FINDING_LAYERS, D as FindingMeasure, E as FindingLayer, F as lineageRoots, I as parseAnalystFinding, L as readFindingScope, M as FindingScopeReading, N as ProposalFindingSchema, O as FindingMethod, P as independentUnitCount, S as makeProposalFinding, T as FindingEvidenceUnit, W as TraceAnalysisStore, _ as ExecutionProbeRequest, a as AnalystFindingSchemaVersion, b as computeFindingId, c as AnalystRunEvent, d as AnalystRunSummary, f as AnalystSeverity, g as ExecutionProbeOutcome, h as ExecutionProbe, i as AnalystFinding, j as FindingScope, k as FindingParseOutcome, l as AnalystRunInputs, m as EvidenceRef, n as AnalystContext, o as AnalystInputKind, p as AnalystUsageReceipt, r as AnalystCost, s as AnalystRequirements, t as Analyst, tt as TraceAnalystSpan, u as AnalystRunResult, v as ProposalFinding, w as FindingCalibration, x as makeFinding, y as ProposalFindingOrigin } from "../types-
|
|
3
|
-
import { A as createChatClient, C as ChatResponse, D as MockTransportOpts, E as CustomTransportOpts, O as OpenAiCompatibleTransportOpts, S as ChatRequest, T as CreateChatClientOpts, b as ChatCallOpts, k as SandboxSdkTransportOpts, w as ChatTransport, x as ChatClient } from "../types-
|
|
1
|
+
import { m as CustomTokenPricing, o as CostLedgerHandle } from "../cost-ledger-C1W3ICmP.js";
|
|
2
|
+
import { A as FindingReaderLabel, C as FINDING_LAYERS, D as FindingMeasure, E as FindingLayer, F as lineageRoots, I as parseAnalystFinding, L as readFindingScope, M as FindingScopeReading, N as ProposalFindingSchema, O as FindingMethod, P as independentUnitCount, S as makeProposalFinding, T as FindingEvidenceUnit, W as TraceAnalysisStore, _ as ExecutionProbeRequest, a as AnalystFindingSchemaVersion, b as computeFindingId, c as AnalystRunEvent, d as AnalystRunSummary, f as AnalystSeverity, g as ExecutionProbeOutcome, h as ExecutionProbe, i as AnalystFinding, j as FindingScope, k as FindingParseOutcome, l as AnalystRunInputs, m as EvidenceRef, n as AnalystContext, o as AnalystInputKind, p as AnalystUsageReceipt, r as AnalystCost, s as AnalystRequirements, t as Analyst, tt as TraceAnalystSpan, u as AnalystRunResult, v as ProposalFinding, w as FindingCalibration, x as makeFinding, y as ProposalFindingOrigin } from "../types-8yQzNm8u.js";
|
|
3
|
+
import { A as createChatClient, C as ChatResponse, D as MockTransportOpts, E as CustomTransportOpts, O as OpenAiCompatibleTransportOpts, S as ChatRequest, T as CreateChatClientOpts, b as ChatCallOpts, k as SandboxSdkTransportOpts, w as ChatTransport, x as ChatClient } from "../types-eMhdacVp.js";
|
|
4
4
|
import { r as LedgerHash } from "../canonical-CFpojCN5.js";
|
|
5
|
-
import { A as traceStoreEvidenceResolver, C as AnalystEvidenceResolutionError, D as AnalystLatencyDistribution, E as AnalystIssueExpectation, G as ExternalOptimizerRunnerCommand, H as ExternalOptimizerModelExecutionObservation, O as RunAnalystBenchmarkOptions, S as AnalystEvidenceResolution, T as AnalystFindingScore, _ as AnalystBenchmarkProvenance, b as AnalystBenchmarkSummary, d as AnalystBenchmarkDatasetRef, f as AnalystBenchmarkDescriptor, g as AnalystBenchmarkOutput, h as AnalystBenchmarkObservation, k as runAnalystBenchmark, m as AnalystBenchmarkLabelState, p as AnalystBenchmarkError, t as AgentProfile, u as AnalystBenchmarkCase, v as AnalystBenchmarkResult, w as AnalystEvidenceResolver, x as AnalystEvidenceExpectation, y as AnalystBenchmarkRunner, z as ExternalOptimizerModelCall } from "../agent-profile-
|
|
6
|
-
import { a as ExactAnalystRunPolicySnapshot, c as ExactAnalystSnapshot, d as ExactExecutionComponentSnapshot, i as ExactAnalystRunEvent, l as ExactCapableAnalyst, n as ExactAnalystExecutionPlanSnapshot, o as ExactAnalystRunResult, r as ExactAnalystRunCompletion, s as ExactAnalystRunSummary, t as ExactAnalystBudgetSnapshot, u as ExactExecutionComponentIdentity } from "../exact-types-
|
|
7
|
-
import { a as createTraceAnalyst, c as behavioralAnalyst, i as TraceAnalystDefinition, n as buildDefaultAnalystRegistry, o as runTraceAnalyst, r as CreateTraceAnalystOptions, s as BehavioralAnalystOptions, t as DefaultAnalystRegistryOptions } from "../default-registry-
|
|
8
|
-
import { a as RAW_FINDING_SCHEMA_PROMPT, c as RawAnalystFindingSchema, i as TraceAnalystLimits, l as evidenceRefsFromRawFinding, n as TraceAnalysisEngineRequest, o as RawAnalystEvidence, r as TraceAnalysisEngineResult, s as RawAnalystFinding, t as TraceAnalysisEngine, u as parseRawFinding } from "../engine-
|
|
9
|
-
import { n as buildTraceToolsForGroup, t as TraceToolGroupName } from "../tool-groups-
|
|
10
|
-
import { a as BudgetPolicy, c as RegistryRunOpts, i as AnalystRegistryOptions, n as ExactAnalystRunExecutionError, o as ExactAnalystBudgetPolicy, r as AnalystHooks, s as ExactRegistryRunOpts, t as AnalystRegistry } from "../registry-
|
|
11
|
-
import { A as SemanticConceptJudgeOptions, C as createDspyRlmTraceEngine, S as DspyRlmTraceEngineOptions, T as createChatTraceEngine, _ as FindingSubjectKind, a as FAILURE_MODE_KIND_SPEC, b as parseFindingSubject, c as emitControlIntegrityFindings, d as FindingsStore, f as PersistedFinding, g as FindingSubject, h as FINDING_SUBJECT_SYNTAX, i as IMPROVEMENT_KIND_SPEC, l as DiffPolicy, m as FINDING_SUBJECT_KINDS, n as KNOWLEDGE_POISONING_KIND_SPEC, o as CONTROL_INTEGRITY_ANALYST, p as diffFindings, r as KNOWLEDGE_GAP_KIND_SPEC, s as ControlIntegrityAnalyst, t as DEFAULT_TRACE_ANALYST_KINDS, u as FindingsDiff, v as KIND_EXPECTED_SUBJECTS, w as ChatTraceEngineOptions, x as renderFindingSubject, y as findingSubjectGrammarPromptFor } from "../index-
|
|
12
|
-
import { C as runPrimeExchange, D as ReplyRowDecoded, E as ReplyEnvelope, O as ReplyRowRejection, S as projectPrimeTrajectory, T as ReplyContract, _ as buildPrimePrompt, a as PrimeProjectionOutcome, b as normalizePrimeUsage, c as PrimeProtocolIdentity, d as PrimeRepairPromptSpec, f as PrimeRepairState, g as analystUsageReceiptFromPrimeUsage, h as PrimeTurnRecord, i as PrimeProjectionDelivery, l as PrimeRawUsage, m as PrimeRowDecoded, n as PrimeExchangeOutcome, o as PrimeProjectionSource, p as PrimeReplyContract, r as PrimeFailure, s as PrimePromptSpec, t as PrimeExchangeOptions, u as PrimeRejectedRow, v as buildPrimeRepairPrompt, w as DecodedReply, x as primeProtocolSha256, y as mergePrimeRawUsage } from "../prime-protocol-
|
|
5
|
+
import { A as traceStoreEvidenceResolver, C as AnalystEvidenceResolutionError, D as AnalystLatencyDistribution, E as AnalystIssueExpectation, G as ExternalOptimizerRunnerCommand, H as ExternalOptimizerModelExecutionObservation, O as RunAnalystBenchmarkOptions, S as AnalystEvidenceResolution, T as AnalystFindingScore, _ as AnalystBenchmarkProvenance, b as AnalystBenchmarkSummary, d as AnalystBenchmarkDatasetRef, f as AnalystBenchmarkDescriptor, g as AnalystBenchmarkOutput, h as AnalystBenchmarkObservation, k as runAnalystBenchmark, m as AnalystBenchmarkLabelState, p as AnalystBenchmarkError, t as AgentProfile, u as AnalystBenchmarkCase, v as AnalystBenchmarkResult, w as AnalystEvidenceResolver, x as AnalystEvidenceExpectation, y as AnalystBenchmarkRunner, z as ExternalOptimizerModelCall } from "../agent-profile-D01Io2Xw.js";
|
|
6
|
+
import { a as ExactAnalystRunPolicySnapshot, c as ExactAnalystSnapshot, d as ExactExecutionComponentSnapshot, i as ExactAnalystRunEvent, l as ExactCapableAnalyst, n as ExactAnalystExecutionPlanSnapshot, o as ExactAnalystRunResult, r as ExactAnalystRunCompletion, s as ExactAnalystRunSummary, t as ExactAnalystBudgetSnapshot, u as ExactExecutionComponentIdentity } from "../exact-types-BYFmYq44.js";
|
|
7
|
+
import { a as createTraceAnalyst, c as behavioralAnalyst, i as TraceAnalystDefinition, n as buildDefaultAnalystRegistry, o as runTraceAnalyst, r as CreateTraceAnalystOptions, s as BehavioralAnalystOptions, t as DefaultAnalystRegistryOptions } from "../default-registry-Cwg_QN3d.js";
|
|
8
|
+
import { a as RAW_FINDING_SCHEMA_PROMPT, c as RawAnalystFindingSchema, i as TraceAnalystLimits, l as evidenceRefsFromRawFinding, n as TraceAnalysisEngineRequest, o as RawAnalystEvidence, r as TraceAnalysisEngineResult, s as RawAnalystFinding, t as TraceAnalysisEngine, u as parseRawFinding } from "../engine-BpGGw6cd.js";
|
|
9
|
+
import { n as buildTraceToolsForGroup, t as TraceToolGroupName } from "../tool-groups-LISbBWCg.js";
|
|
10
|
+
import { a as BudgetPolicy, c as RegistryRunOpts, i as AnalystRegistryOptions, n as ExactAnalystRunExecutionError, o as ExactAnalystBudgetPolicy, r as AnalystHooks, s as ExactRegistryRunOpts, t as AnalystRegistry } from "../registry-B_yG-1jh.js";
|
|
11
|
+
import { A as SemanticConceptJudgeOptions, C as createDspyRlmTraceEngine, S as DspyRlmTraceEngineOptions, T as createChatTraceEngine, _ as FindingSubjectKind, a as FAILURE_MODE_KIND_SPEC, b as parseFindingSubject, c as emitControlIntegrityFindings, d as FindingsStore, f as PersistedFinding, g as FindingSubject, h as FINDING_SUBJECT_SYNTAX, i as IMPROVEMENT_KIND_SPEC, l as DiffPolicy, m as FINDING_SUBJECT_KINDS, n as KNOWLEDGE_POISONING_KIND_SPEC, o as CONTROL_INTEGRITY_ANALYST, p as diffFindings, r as KNOWLEDGE_GAP_KIND_SPEC, s as ControlIntegrityAnalyst, t as DEFAULT_TRACE_ANALYST_KINDS, u as FindingsDiff, v as KIND_EXPECTED_SUBJECTS, w as ChatTraceEngineOptions, x as renderFindingSubject, y as findingSubjectGrammarPromptFor } from "../index-CVFStrQD.js";
|
|
12
|
+
import { C as runPrimeExchange, D as ReplyRowDecoded, E as ReplyEnvelope, O as ReplyRowRejection, S as projectPrimeTrajectory, T as ReplyContract, _ as buildPrimePrompt, a as PrimeProjectionOutcome, b as normalizePrimeUsage, c as PrimeProtocolIdentity, d as PrimeRepairPromptSpec, f as PrimeRepairState, g as analystUsageReceiptFromPrimeUsage, h as PrimeTurnRecord, i as PrimeProjectionDelivery, l as PrimeRawUsage, m as PrimeRowDecoded, n as PrimeExchangeOutcome, o as PrimeProjectionSource, p as PrimeReplyContract, r as PrimeFailure, s as PrimePromptSpec, t as PrimeExchangeOptions, u as PrimeRejectedRow, v as buildPrimeRepairPrompt, w as DecodedReply, x as primeProtocolSha256, y as mergePrimeRawUsage } from "../prime-protocol-CckHBxGu.js";
|
|
13
13
|
import { i as nodeHttpPrimeBridgeTransport, n as PrimeBridgeTransportRequest, r as PrimeBridgeTransportResult, t as PrimeBridgeTransport } from "../prime-bridge-transport-6feEglLf.js";
|
|
14
14
|
import { h as SystemOneState } from "../systemone-protocol-DKoi1NdK.js";
|
|
15
|
-
import { r as SystemOneEvaluatorOptions } from "../systemone-
|
|
15
|
+
import { r as SystemOneEvaluatorOptions } from "../systemone-DVA7t76V.js";
|
|
16
16
|
import { b as SupervisorRunSources } from "../types-CmXY0PQf.js";
|
|
17
|
-
import { a as askTraceQuestions, i as VerifiedTraceFinding, n as TraceQuestionOutcome, r as TraceQuestionSpec, t as AskTraceQuestionsOptions } from "../trace-questions-
|
|
17
|
+
import { a as askTraceQuestions, i as VerifiedTraceFinding, n as TraceQuestionOutcome, r as TraceQuestionSpec, t as AskTraceQuestionsOptions } from "../trace-questions-C42fYEE4.js";
|
|
18
18
|
import { z } from "zod";
|
|
19
19
|
//#region src/analyst/adapters.d.ts
|
|
20
20
|
interface SemanticConceptJudgeAdapterOpts {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/analyst/adapters.ts","../../src/analyst/benchmark-agentrx-calibration.ts","../../src/analyst/benchmark-dataset-types.ts","../../src/analyst/benchmark-dataset-agentrx.ts","../../src/analyst/benchmark-dataset-codetrace.ts","../../src/analyst/benchmark-verification-outcome.ts","../../src/analyst/benchmark-verification-artifacts.ts","../../src/analyst/benchmark-public-types.ts","../../src/analyst/benchmark-public-adapters.ts","../../src/analyst/benchmark-public-data.ts","../../src/analyst/definition.ts","../../src/analyst/benchmark-public-prompt.ts","../../src/analyst/benchmark-public-model.ts","../../src/analyst/benchmark-public-rlm.ts","../../src/analyst/benchmark-runner-prime.ts","../../src/analyst/benchmark-comparison.ts","../../src/analyst/benchmark-public-calibration.ts","../../src/analyst/benchmark-command-artifact.ts","../../src/analyst/benchmark-command-result.ts","../../src/analyst/benchmark-command.ts","../../src/analyst/benchmark-implementation.ts","../../src/analyst/bind.ts","../../src/analyst/define.ts","../../src/analyst/domain-taxonomy.ts","../../src/analyst/failure-modes.ts","../../src/analyst/findings-ledger.ts","../../src/analyst/kinds/skill-usage.ts","../../src/analyst/parse-tolerant.ts","../../src/analyst/promote.ts","../../src/analyst/proposal-findings.ts","../../src/analyst/rollup.ts","../../src/analyst/team-shape.ts"],"mappings":";;;;;;;;;;;;;;;;;;;UA+BiB;EACf;EACA;;EAEA,SAAS,KAAK;;EAEd;;;;qBClCW;UAEI;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA,SAAS;;;;KC9BC;UAEK;EACf,YAAY;EACZ;EACA;EACA;EACA;EACA;;UAGe;EACf,eAAe;EACf,mBAAmB;EACnB;IAAe,YAAY;IAAY;;EACvC,wBAAwB;EACxB;EACA;EACA;;UAGe;EACf,UAAU;EACV;EACA;EACA;EACA;;UAGe;EACf,UAAU;EACV,mBAAmB;EACnB;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA,iBAAiB;;KAGP,0CAEC,sCACA,iCACA;UAEI;EACf;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA,oCAAoC;;UAGrB;EACf,eAAe;EACf,WAAW,sBAAsB;;KAGvB;UAEK;;;;;EAKf,WAAW;;UAGI,kCACP,yBACN;UAEa,oCAAoC;EACnD;;EAEA;;UAGe,yCAAyC;EACxD;EACA;EACA;EACA;;UAGe,2CACP,kCACN;;;wBCtGY,qBAAqB,QACnC,KAAK,YACL,OAAO,QACP,UAAS,8BACR,qBAAqB;;wBAsGR,6BACd,mBAAmB,YACnB,iBACA,UAAS,mCACR;;;wBC9Ga,mBAAmB,QACjC,KAAK,mBACL,OAAO,QACP,UAAS,4BACR,qBAAqB;;wBAwFR,gCACd,2BACA,aAAa,uBACb,UAAS,qCACR;;;KCjHS;UAEK;EACf;EACA;EACA,QAAQ;;UAGO;EACf,QAAQ;EACR;EAKA;IAAe;IAAe;;EAC9B,SAAS;EACT;EACA;EACA;EACA;;UAGe;EACf;EACA;;;;KCdU;UAEK;EACf,MAAM;EACN;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,SAAS;EACT;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,cAAc;EACd,UAAU,OAAO;;UAGF;EACf,UAAU;EACV,SAAS;EACT,OAAO,MAAM;IAA6B;;;;;KChChC;;;;;;;;UASK;;WAEN;;WAEA;;;UAIM;EACf,MAAM;EACN;EACA,kBAAkB,aAA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ACA;EACA;;UAGe;EACf;EACA;EACA,SAAS;;;;UCjBM;EACf;EACA;EACA;IACE,SAAS;IACT;IACA;IACA;IACA;IACA,YAAY;MAAQ;MAAiB;MAAsB;;IAC3D,uBAAuB;IACvB,0BAA0B;IAC1B;MACE;MACA;MACA;MACA,QAAQ;;IAEV;MACE;MACA;;MAEA;MACA;;MAEA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,UAAU;MACV;QACE;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;MAEF;QACE;QACA;QACA;;MAEF;MACA;MACA;;MAEA;MACA;MACA;;;EAGJ,QAAQ;EACR,aAAa;EACb,uBAAuB;EACvB,qBAAqB;;UAGN;EACf;EACA;EACA;EACA;IACE;IACA;IACA;;;UAIa;EACf;IACE,SAAS;IACT;IACA;IACA;MACE;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,SAAS;MACT;QACE;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;MAEF;QACE;QACA;QACA;;;IAGJ;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;EAEF;IACE;IACA;IACA;IACA,YAAY;MAAQ;MAAiB;MAAsB;;IAC3D;IACA;;;UAIa;EACf;EACA;EACA;EACA;EACA,UAAU;;UAGK;EACf;EACA;EACA;EACA;IACE;IACA;IACA;IACA;;IAEA;;EAEF;EACA;IACE;IACA;IACA;;EAEF;IACE;IACA;IACA;IACA;IACA;IACA;;;UAIa;EACf;EACA;EACA;EACA,aAAa;EACb;;qBAGW;qBACA;qBACA;qBACA;;;wBC5KS,6BACpB,eACC,QAAQ;;;UCuEM;EACf,uBACE,SAAS,+BACT,QAAQ,wCACL,uBAAuB;EAC5B,2BACE,mBACA;IACE;IACA,aAAa,SAAS,OAAO;QAE5B,QAAQ;;;;;;;;;KAUV;;UAGK;EACR;EACA;;UAGe;EACf,SAAS;EACT,SAAS;EACT;EACA;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;EACA;EACA;EACA;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O,iBAAiB;;;;;;wBAqa1C,oBAAoB,QAAQ"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/analyst/adapters.ts","../../src/analyst/benchmark-agentrx-calibration.ts","../../src/analyst/benchmark-dataset-types.ts","../../src/analyst/benchmark-dataset-agentrx.ts","../../src/analyst/benchmark-dataset-codetrace.ts","../../src/analyst/benchmark-verification-outcome.ts","../../src/analyst/benchmark-verification-artifacts.ts","../../src/analyst/benchmark-public-types.ts","../../src/analyst/benchmark-public-adapters.ts","../../src/analyst/benchmark-public-data.ts","../../src/analyst/definition.ts","../../src/analyst/benchmark-public-prompt.ts","../../src/analyst/benchmark-public-model.ts","../../src/analyst/benchmark-public-rlm.ts","../../src/analyst/benchmark-runner-prime.ts","../../src/analyst/benchmark-comparison.ts","../../src/analyst/benchmark-public-calibration.ts","../../src/analyst/benchmark-command-artifact.ts","../../src/analyst/benchmark-command-result.ts","../../src/analyst/benchmark-command.ts","../../src/analyst/benchmark-implementation.ts","../../src/analyst/bind.ts","../../src/analyst/define.ts","../../src/analyst/domain-taxonomy.ts","../../src/analyst/failure-modes.ts","../../src/analyst/findings-ledger.ts","../../src/analyst/kinds/skill-usage.ts","../../src/analyst/parse-tolerant.ts","../../src/analyst/promote.ts","../../src/analyst/proposal-findings.ts","../../src/analyst/rollup.ts","../../src/analyst/team-shape.ts"],"mappings":";;;;;;;;;;;;;;;;;;;UA+BiB;EACf;EACA;;EAEA,SAAS,KAAK;;EAEd;;;;qBClCW;UAEI;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA,SAAS;;;;KC9BC;UAEK;EACf,YAAY;EACZ;EACA;EACA;EACA;EACA;;UAGe;EACf,eAAe;EACf,mBAAmB;EACnB;IAAe,YAAY;IAAY;;EACvC,wBAAwB;EACxB;EACA;EACA;;UAGe;EACf,UAAU;EACV;EACA;E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B;IAC1B;MACE;MACA;MACA;MACA,QAAQ;;IAEV;MACE;MACA;;MAEA;MACA;;MAEA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,UAAU;MACV;QACE;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;MAEF;QACE;QACA;QACA;;MAEF;MACA;MACA;;MAEA;MACA;MACA;;;EAGJ,QAAQ;EACR,aAAa;EACb,uBAAuB;EACvB,qBAAqB;;UAGN;EACf;EACA;EACA;EACA;IACE;IACA;IACA;;;UAIa;EACf;IACE,SAAS;IACT;IACA;IACA;MACE;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,SAAS;MACT;QACE;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;MAEF;QACE;QACA;QACA;;;IAGJ;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;EAEF;IACE;IACA;IACA;IACA,YAAY;MAAQ;MAAiB;MAAsB;;IAC3D;IACA;;;UAIa;EACf;EACA;EACA;EACA;EACA,UAAU;;UAGK;EACf;EACA;EACA;EACA;IACE;IACA;IACA;IACA;;IAEA;;EAEF;EACA;IACE;IACA;IACA;;EAEF;IACE;IACA;IACA;IACA;IACA;IACA;;;UAIa;EACf;EACA;EACA;EACA,aAAa;EACb;;qBAGW;qBACA;qBACA;qBACA;;;wBC5KS,6BACpB,eACC,QAAQ;;;UCuEM;EACf,uBACE,SAAS,+BACT,QAAQ,wCACL,uBAAuB;EAC5B,2BACE,mBACA;IACE;IACA,aAAa,SAAS,OAAO;QAE5B,QAAQ;;;;;;;;;KAUV;;UAGK;EACR;EACA;;UAGe;EACf,SAAS;EACT,SAAS;EACT;EACA;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;EACA;EACA;EACA;;EAEA;EACA;EACA;;EAEA;;EAEA,QAAQ;EACR;EACA;;wBAKoB,2BACpB,yBACA,MAAK,OAAO,YACZ,eAAc,sCACb;;;qBCxIU;qBAGA;qBAGA;;;;KCGD;;WAGG;WACA;WACA;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2
|
import { t as FileLedgerJournal } from "../journal-C7om8Gum.js";
|
|
3
3
|
import { r as merkleRoot } from "../ledger-core-CAxUdDk0.js";
|
|
4
|
-
import { A as spanningWindow, C as UNKNOWN_LINEAGE, D as mostSevere, E as mergeEvidenceUnits, O as parseAnalystFinding, S as ProposalFindingSchema, T as lineageRoots, b as AnalystFindingSchema, k as readFindingScope, w as independentUnitCount, x as FINDING_LAYERS } from "../external-optimizer-subprocess-
|
|
4
|
+
import { A as spanningWindow, C as UNKNOWN_LINEAGE, D as mostSevere, E as mergeEvidenceUnits, O as parseAnalystFinding, S as ProposalFindingSchema, T as lineageRoots, b as AnalystFindingSchema, k as readFindingScope, w as independentUnitCount, x as FINDING_LAYERS } from "../external-optimizer-subprocess-D670Oxf2.js";
|
|
5
5
|
import { a as makeProposalFinding, i as makeFinding, r as computeFindingId } from "../types-DqFMNTgK.js";
|
|
6
|
-
import { t as assertProposalFindings } from "../proposal-findings-
|
|
7
|
-
import { A as RawAnalystFindingSchema, B as parseFindingSubject, F as stripCodeFences, I as FINDING_SUBJECT_KINDS, L as FINDING_SUBJECT_SYNTAX, M as parseRawFinding, N as parseTraceSpanEvidenceUri, R as KIND_EXPECTED_SUBJECTS, V as renderFindingSubject, j as evidenceRefsFromRawFinding, k as RAW_FINDING_SCHEMA_PROMPT, n as runTraceAnalyst, r as buildTraceToolsForGroup, t as createTraceAnalyst, z as findingSubjectGrammarPromptFor } from "../kind-factory-
|
|
8
|
-
import { a as KNOWLEDGE_POISONING_KIND_SPEC, c as FAILURE_MODE_KIND_SPEC, d as emitControlIntegrityFindings, f as behavioralAnalyst, i as DEFAULT_TRACE_ANALYST_KINDS, l as CONTROL_INTEGRITY_ANALYST, n as AnalystRegistry, o as KNOWLEDGE_GAP_KIND_SPEC, r as ExactAnalystRunExecutionError, s as IMPROVEMENT_KIND_SPEC, t as buildDefaultAnalystRegistry, u as ControlIntegrityAnalyst } from "../default-registry-
|
|
9
|
-
import { t as createDspyRlmTraceEngine } from "../dspy-rlm-engine-
|
|
10
|
-
import { n as diffFindings, r as createChatTraceEngine, t as FindingsStore } from "../findings-store-
|
|
11
|
-
import { t as createChatClient } from "../chat-client-
|
|
6
|
+
import { t as assertProposalFindings } from "../proposal-findings-E1aSC_cU.js";
|
|
7
|
+
import { A as RawAnalystFindingSchema, B as parseFindingSubject, F as stripCodeFences, I as FINDING_SUBJECT_KINDS, L as FINDING_SUBJECT_SYNTAX, M as parseRawFinding, N as parseTraceSpanEvidenceUri, R as KIND_EXPECTED_SUBJECTS, V as renderFindingSubject, j as evidenceRefsFromRawFinding, k as RAW_FINDING_SCHEMA_PROMPT, n as runTraceAnalyst, r as buildTraceToolsForGroup, t as createTraceAnalyst, z as findingSubjectGrammarPromptFor } from "../kind-factory-BhxbtUsQ.js";
|
|
8
|
+
import { a as KNOWLEDGE_POISONING_KIND_SPEC, c as FAILURE_MODE_KIND_SPEC, d as emitControlIntegrityFindings, f as behavioralAnalyst, i as DEFAULT_TRACE_ANALYST_KINDS, l as CONTROL_INTEGRITY_ANALYST, n as AnalystRegistry, o as KNOWLEDGE_GAP_KIND_SPEC, r as ExactAnalystRunExecutionError, s as IMPROVEMENT_KIND_SPEC, t as buildDefaultAnalystRegistry, u as ControlIntegrityAnalyst } from "../default-registry-BrKmT01n.js";
|
|
9
|
+
import { t as createDspyRlmTraceEngine } from "../dspy-rlm-engine-Bn_Mt_LW.js";
|
|
10
|
+
import { n as diffFindings, r as createChatTraceEngine, t as FindingsStore } from "../findings-store-CvNo712L.js";
|
|
11
|
+
import { t as createChatClient } from "../chat-client-CMQ8_h4J.js";
|
|
12
12
|
import { systemOneAnalyst } from "../systemone.js";
|
|
13
|
-
import { A as agentRxBenchmarkCase, C as ANALYST_BENCHMARK_COST_LEDGER_FILE, D as AGENT_RX_UPSTREAM_REVISION, E as ANALYST_BENCHMARK_OBSERVATIONS_FILE, M as normalizeAgentRxCategory, N as runAnalystBenchmark, O as codeTraceBenchCase, P as traceStoreEvidenceResolver, S as ANALYST_BENCHMARK_IMPLEMENTATION_FILES, T as ANALYST_BENCHMARK_MANIFEST_FILE, _ as readAnalystBenchmarkArtifact, a as runInlineAnalystDefinition, b as ANALYST_BENCHMARK_EVIDENCE_DEPENDENCY_LOCK_SHA256, c as publicRlmAnalystDefinition, d as publicDirectAnalystDefinition, f as runChunkedAnalystDefinition, g as expandCodeTraceFailureBlocks, h as analystDefinitionProtocolSha256, i as primeCodeTraceAnalystDefinition, j as agentRxPredictionsToFindings, k as codeTracerPredictionsToFindings, l as runReplVariableAnalystDefinition, m as analystDefinitionAsymmetries, n as createPrimeBenchmarkRunner, o as loadPublicBenchmarkRows, p as AnalystExpressivenessError, r as primeAnalystProtocolSha256, s as createPublicBenchmarkRlmRunner, t as runAnalystBenchmarkCommand, u as createPublicBenchmarkDirectRunner, v as CODE_TRACE_BENCH_ANALYST_PROMPT, w as ANALYST_BENCHMARK_LOCAL_RECEIPT_FILE, x as ANALYST_BENCHMARK_EVIDENCE_IMPLEMENTATION_SHA256, y as publicBenchmarkProtocolSha256 } from "../benchmark-command-
|
|
13
|
+
import { A as agentRxBenchmarkCase, C as ANALYST_BENCHMARK_COST_LEDGER_FILE, D as AGENT_RX_UPSTREAM_REVISION, E as ANALYST_BENCHMARK_OBSERVATIONS_FILE, M as normalizeAgentRxCategory, N as runAnalystBenchmark, O as codeTraceBenchCase, P as traceStoreEvidenceResolver, S as ANALYST_BENCHMARK_IMPLEMENTATION_FILES, T as ANALYST_BENCHMARK_MANIFEST_FILE, _ as readAnalystBenchmarkArtifact, a as runInlineAnalystDefinition, b as ANALYST_BENCHMARK_EVIDENCE_DEPENDENCY_LOCK_SHA256, c as publicRlmAnalystDefinition, d as publicDirectAnalystDefinition, f as runChunkedAnalystDefinition, g as expandCodeTraceFailureBlocks, h as analystDefinitionProtocolSha256, i as primeCodeTraceAnalystDefinition, j as agentRxPredictionsToFindings, k as codeTracerPredictionsToFindings, l as runReplVariableAnalystDefinition, m as analystDefinitionAsymmetries, n as createPrimeBenchmarkRunner, o as loadPublicBenchmarkRows, p as AnalystExpressivenessError, r as primeAnalystProtocolSha256, s as createPublicBenchmarkRlmRunner, t as runAnalystBenchmarkCommand, u as createPublicBenchmarkDirectRunner, v as CODE_TRACE_BENCH_ANALYST_PROMPT, w as ANALYST_BENCHMARK_LOCAL_RECEIPT_FILE, x as ANALYST_BENCHMARK_EVIDENCE_IMPLEMENTATION_SHA256, y as publicBenchmarkProtocolSha256 } from "../benchmark-command-BzmMTnvC.js";
|
|
14
14
|
import { a as normalizePrimeUsage, c as runPrimeExchange, i as mergePrimeRawUsage, n as buildPrimePrompt, o as primeProtocolSha256, r as buildPrimeRepairPrompt, s as projectPrimeTrajectory, t as analystUsageReceiptFromPrimeUsage } from "../prime-protocol-BFgGrEMP.js";
|
|
15
15
|
import { t as nodeHttpPrimeBridgeTransport } from "../prime-bridge-transport-Z3cpKGoV.js";
|
|
16
16
|
import { t as clusterBootstrapMean } from "../cluster-bootstrap-DEwwhl0C.js";
|