@tangle-network/agent-eval 0.145.10 → 0.145.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/analyst/index.d.ts +2 -2
  3. package/dist/analyst/index.js +3 -3
  4. package/dist/{benchmark-command-BDHW2AUg.js → benchmark-command-JSjVoAxT.js} +7 -7
  5. package/dist/{benchmark-command-BDHW2AUg.js.map → benchmark-command-JSjVoAxT.js.map} +1 -1
  6. package/dist/benchmarks/index.js +3 -3
  7. package/dist/campaign/index.js +5 -5
  8. package/dist/{campaign-B3GJpJ4h.js → campaign-Ct6r9oNe.js} +7 -7
  9. package/dist/{campaign-B3GJpJ4h.js.map → campaign-Ct6r9oNe.js.map} +1 -1
  10. package/dist/cli.js +1 -1
  11. package/dist/contract/index.d.ts.map +1 -1
  12. package/dist/contract/index.js +121 -22
  13. package/dist/contract/index.js.map +1 -1
  14. package/dist/{define-agent-eval-cSMEFzVu.js → define-agent-eval-BXusiVTQ.js} +3 -3
  15. package/dist/{define-agent-eval-cSMEFzVu.js.map → define-agent-eval-BXusiVTQ.js.map} +1 -1
  16. package/dist/{dspy-rlm-engine-BZ2aMZEd.js → dspy-rlm-engine-CqwhQQBw.js} +2 -2
  17. package/dist/{dspy-rlm-engine-BZ2aMZEd.js.map → dspy-rlm-engine-CqwhQQBw.js.map} +1 -1
  18. package/dist/exec-y-DCLqK7.js +204 -0
  19. package/dist/exec-y-DCLqK7.js.map +1 -0
  20. package/dist/{external-optimizer-process-BRE56woM.js → external-optimizer-process-D-9iX64j.js} +3 -3
  21. package/dist/{external-optimizer-process-BRE56woM.js.map → external-optimizer-process-D-9iX64j.js.map} +1 -1
  22. package/dist/{external-optimizer-subprocess-BhKYK0Jv.js → external-optimizer-subprocess-x5AbhAYX.js} +2 -2
  23. package/dist/{external-optimizer-subprocess-BhKYK0Jv.js.map → external-optimizer-subprocess-x5AbhAYX.js.map} +1 -1
  24. package/dist/index.js +5 -5
  25. package/dist/ledger-core/index.js +1 -1
  26. package/dist/{ledger-core-BmZt19oQ.js → ledger-core-DTae9rv_.js} +3 -2
  27. package/dist/ledger-core-DTae9rv_.js.map +1 -0
  28. package/dist/{llm-judge-DhiJqSjB.js → llm-judge-DqAkIQA1.js} +6 -5
  29. package/dist/{llm-judge-DhiJqSjB.js.map → llm-judge-DqAkIQA1.js.map} +1 -1
  30. package/dist/openapi.json +1 -1
  31. package/dist/{produced-state-BNyyud4g.js → produced-state-B9skdU8u.js} +2 -2
  32. package/dist/{produced-state-BNyyud4g.js.map → produced-state-B9skdU8u.js.map} +1 -1
  33. package/dist/{semantic-concept-judge-BiJxScqe.js → semantic-concept-judge-C6M-qOeb.js} +2 -2
  34. package/dist/{semantic-concept-judge-BiJxScqe.js.map → semantic-concept-judge-C6M-qOeb.js.map} +1 -1
  35. package/dist/{skillopt-optimization-method-C6JSfYxT.js → skillopt-optimization-method-CcWZBaSz.js} +4 -4
  36. package/dist/{skillopt-optimization-method-C6JSfYxT.js.map → skillopt-optimization-method-CcWZBaSz.js.map} +1 -1
  37. package/dist/steps-AmkT-GIM.d.ts +216 -0
  38. package/dist/steps-AmkT-GIM.d.ts.map +1 -0
  39. package/dist/trace-repair/index.d.ts +1 -21
  40. package/dist/trace-repair/index.d.ts.map +1 -1
  41. package/dist/trace-repair/index.js +10 -19
  42. package/dist/trace-repair/index.js.map +1 -1
  43. package/dist/trajectory-replay/index.d.ts +2 -2
  44. package/dist/trajectory-replay/index.js +2 -2
  45. package/docs/trace-repair-admission.md +134 -0
  46. package/docs/trajectory-replay.md +21 -1
  47. package/package.json +3 -3
  48. package/dist/exec-BLtYZdWo.js +0 -49
  49. package/dist/exec-BLtYZdWo.js.map +0 -1
  50. package/dist/ledger-core-BmZt19oQ.js.map +0 -1
  51. package/dist/steps-BArUxhna.d.ts +0 -51
  52. package/dist/steps-BArUxhna.d.ts.map +0 -1
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { o as runRolloutReleaseCli } from "./hf-dataset-XggBupCr.js";
3
- import { n as runAnalystBenchmarkCommand } from "./benchmark-command-BDHW2AUg.js";
3
+ import { n as runAnalystBenchmarkCommand } from "./benchmark-command-JSjVoAxT.js";
4
4
  import { a as runRpcBatch, o as runRpcOnce, p as handleVersion, r as startServerAsync, s as buildOpenApi } from "./server-ulsOdrTI.js";
5
5
  import { writeFileSync } from "node:fs";
6
6
  //#region src/cli-config.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/contract/measured-comparison.ts","../../src/contract/profile-measured-comparison.ts","../../src/contract/intake/run-record-dir.ts","../../src/contract/eval-reporting-suite.ts","../../src/contract/diff.ts","../../src/contract/intake/agent-trace.ts","../../src/contract/intake/code-agent-observation.ts","../../src/contract/intake/code-agent-session.ts","../../src/contract/intake/feedback-table.ts","../../src/contract/intake/otel-spans.ts"],"mappings":";;;;;;;;;;;;;;;;UAiCiB;EACf,QAAQ,gCAAgC;EACxC;EACA;;UAGe;EACf,YAAY;EACZ;EACA,QAAQ;EACR,MAAM;EACN,eAAe;EACf;EACA,SAAS;;UAGM;EACf,YAAY;EACZ,QAAQ,OAAO,oCAAoC,QAAQ;;EAE3D;;EAEA,aAAa;EACb,SAAS;;UAGM;EACf,cAAc;EACd;IACE;IACA,MAAM;;;UAIO;EACf,YAAY;EACZ,cAAc;EACd;IACE;IACA,MAAM;;EAER,aAAa;EACb;EACA,YAAY;EACZ;EACA,WAAW;;;UAII,kBAAkB;EACjC;EACA,UAAU;EACV,WAAW;;;UAII,yBAAyB;EACxC,MAAM,KAAK;EACX,WAAW,KAAK;IAAkB;IAAc;;EAChD,QAAQ,KAAK;EACb,eAAe,KAAK,OAAO;EAC3B,UAAU,KAAK;EACf,UAAU,KAAK;EACf,OAAO,KAAK;;UAGG,kCAAkC;EACjD,uBAAuB,kBAAkB;EACzC,QAAQ;EACR,SAAS,yBAAyB;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ACA;EACA,YAAY;;;;;;;iBAeE,wBACd,SAAS,iCACR;;;UCrCc;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;;UAGe;EACf,MAAM;EACN,aAAa;EACb,SAAS;EACT,cAAc;;UAGC;EACf;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;EACA;EACA;EACA;EACA;EACA;;;EAGA,iBAAiB;;;EAGjB,YAAY;;iBAGE,oBAAoB,gBAAgB;iBAepC,iBACd,SAAS,gCACR;iBAIa,sBACd,SAAS,gCACR;iBAIa,oBACd,SAAS,gCACR;iBAIa,oBACd,SAAS,gCACR;iBAIa,cACd,SAAS,gCACR;cAIU,2BAAkB;;;UCpJd;;;EAGf;;EAEA;;;EAGA;;;EAGA,WAAW;;UAGI;EACf;;;EAGA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;EAGA,WAAW;;;EAGX,SAAS;;UAGM;;EAEf,SAAS;;;EAGT,OAAO;;;;EAIP;IAAU;IAAa;;;;;EAIvB;;UAGe;EACf,MAAM;;;EAGN,aAAa;IAAQ;IAAe;IAAe;;;iBAGrC,kBAAkB,MAAM,2BAA2B;;;UCvBlD;EACf,OAAO;;EAEP,eAAe;;EAEf;;;;;;EAMA,eAAe,eAAe,gBAAgB;;iBAGhC,cAAc,MAAM,uBAAuB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/contract/measured-comparison.ts","../../src/contract/profile-measured-comparison.ts","../../src/contract/intake/run-record-dir.ts","../../src/contract/eval-reporting-suite.ts","../../src/contract/diff.ts","../../src/contract/intake/agent-trace.ts","../../src/contract/intake/code-agent-observation.ts","../../src/contract/intake/code-agent-session.ts","../../src/contract/intake/feedback-table.ts","../../src/contract/intake/otel-spans.ts"],"mappings":";;;;;;;;;;;;;;;;UAiCiB;EACf,QAAQ,gCAAgC;EACxC;EACA;;UAGe;EACf,YAAY;EACZ;EACA,QAAQ;EACR,MAAM;EACN,eAAe;EACf;EACA,SAAS;;UAGM;EACf,YAAY;EACZ,QAAQ,OAAO,oCAAoC,QAAQ;;EAE3D;;EAEA,aAAa;EACb,SAAS;;UAGM;EACf,cAAc;EACd;IACE;IACA,MAAM;;;UAIO;EACf,YAAY;EACZ,cAAc;EACd;IACE;IACA,MAAM;;EAER,aAAa;EACb;EACA,YAAY;EACZ;EACA,WAAW;;;UAII,kBAAkB;EACjC;EACA,UAAU;EACV,WAAW;;;UAII,yBAAyB;EACxC,MAAM,KAAK;EACX,WAAW,KAAK;IAAkB;IAAc;;EAChD,QAAQ,KAAK;EACb,eAAe,KAAK,OAAO;EAC3B,UAAU,KAAK;EACf,UAAU,KAAK;EACf,OAAO,KAAK;;UAGG,kCAAkC;EACjD,uBAAuB,kBAAkB;EACzC,QAAQ;EACR,SAAS,yBAAyB;;EAElC;;EAEA,kBAAkB;;EAElB,kBAAkB;;;KAIR,8BAA8B,KACxC;EAGA,iBAAiB;EACjB,WAAW;EACX;;;iBAIc,2BACd,UAAU,sCACT;;iBAQa,4BACd,SAAS,qCACR;;iBAiBa,wBACd,UAAU,mCACT;iBAQa,0BAA0B,iBAAiB;;iBAarC,uBACpB,SAAS,gCACR,QAAQ;;;;;;;;iBAkEK,2BAA2B,MACzC,SAAS,kCAAkC,QAC1C;;iBA8Ya,0CACd,SAAS,oCACR;;iBAuEa,oCACd,iBACC;iBAkHa,6BAA6B,iBAAiB;iBAM9C,oCACd,iBACC;iBAkBa,8BAA8B;;;;;;;;;;UC7zB7B;EACf,aAAa;EACb,QAAQ,gCAAgC;EACxC;EACA;;UAGe;EACf,YAAY;EACZ;EAC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iBAoDC,gBACd,QAAQ,2BACR,OAAO,4BACN;;;;;;iBAqEa,SAAS,QAAQ,cAAc,OAAO,eAAe;;;;;;;iBAsCrD,wBAAwB,KAAK,eAAe;;;KC1OhD;UAEK;EACf,MAAM;;EAEN;;UAGe;EACf;EACA;EACA;;;EAGA,cAAc;;UAGC;EACf;EACA,cAAc;EACd,QAAQ;;UAGO;EACf;EACA,eAAe;;UAGA;EACf;EACA;EACA;EACA;IAAQ;IAAc;;EACtB;IAAS;IAAe;;EACxB,OAAO;;;;UAOQ;EACf;;EAEA;;EAEA;EACA;EACA;;EAEA;;EAEA;;KAGU,kBAAkB,YAAY;;;;;;iBAW1B,gBAAgB,SAAS,qBAAqB;UAmE7C;;;;EAIf,SAAS,YAAY;;;EAGrB,cAAc;;;;;;;;iBASA,8BACd,MAAM,aACN,OAAO,kBACN;;;KCjLS;KAEA;KAEA;KAEA;KASA;UAEK;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA,MAAM;EACN,SAAS;EACT;EACA,QAAQ;EACR;EACA;EACA,UAAU;;UAGK;EACf,QAAQ;EACR;EACA;EACA;IACE,QAAQ;IACR;;EAEF,SAAS;;UAGM;EACf,QAAQ;EACR;EACA;EACA,YAAY;;;;;;;iBAeE,wBACd,SAAS,iCACR;;;UCnCc;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;;UAGe;EACf,MAAM;EACN,aAAa;EACb,SAAS;EACT,cAAc;;UAGC;EACf;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;EACA;EACA;EACA;EACA;EACA;;;EAGA,iBAAiB;;;EAGjB,YAAY;;iBAGE,oBAAoB,gBAAgB;iBAepC,iBACd,SAAS,gCACR;iBAIa,sBACd,SAAS,gCACR;iBAIa,oBACd,SAAS,gCACR;iBAIa,oBACd,SAAS,gCACR;iBAIa,cACd,SAAS,gCACR;cAIU,2BAAkB;;;UCtJd;;;EAGf;;EAEA;;;EAGA;;;EAGA,WAAW;;UAGI;EACf;;;EAGA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;EAGA,WAAW;;;EAGX,SAAS;;UAGM;;EAEf,SAAS;;;EAGT,OAAO;;;;EAIP;IAAU;IAAa;;;;;EAIvB;;UAGe;EACf,MAAM;;;EAGN,aAAa;IAAQ;IAAe;IAAe;;;iBAGrC,kBAAkB,MAAM,2BAA2B;;;UCvBlD;EACf,OAAO;;EAEP,eAAe;;EAEf;;;;;;EAMA,eAAe,eAAe,gBAAgB;;iBAGhC,cAAc,MAAM,uBAAuB"}
@@ -1,12 +1,12 @@
1
1
  import { s as ValidationError } from "../errors-Dngq5h35.js";
2
2
  import { r as pairedBootstrap } from "../paired-tests-BHIhYVdu.js";
3
- import { a as summarizeExecution, i as analyzeRuns, n as SelfImproveRunError, r as selfImprove, t as defineAgentEval } from "../define-agent-eval-cSMEFzVu.js";
3
+ import { a as summarizeExecution, i as analyzeRuns, n as SelfImproveRunError, r as selfImprove, t as defineAgentEval } from "../define-agent-eval-BXusiVTQ.js";
4
4
  import { a as parseRunRecordSafe } from "../run-record-D2lDdSAz.js";
5
- import { G as runEval, K as runCampaign, f as runImprovementLoop, nt as campaignSplitDigest, t as llmJudge, x as compareOptimizationMethods, z as defaultProductionGate } from "../llm-judge-DhiJqSjB.js";
5
+ import { G as runEval, K as runCampaign, f as runImprovementLoop, nt as campaignSplitDigest, t as llmJudge, x as compareOptimizationMethods, z as defaultProductionGate } from "../llm-judge-DqAkIQA1.js";
6
6
  import { i as isModelPriced, n as estimateCost } from "../metrics-Cl0L1KUy.js";
7
7
  import { i as CostLedger } from "../cost-ledger-BSe92yAV.js";
8
- import { d as mapConcurrentRange } from "../ledger-core-BmZt19oQ.js";
9
- import { S as inMemoryCampaignStorage, x as fsCampaignStorage } from "../external-optimizer-subprocess-BhKYK0Jv.js";
8
+ import { d as mapConcurrentRange } from "../ledger-core-DTae9rv_.js";
9
+ import { S as inMemoryCampaignStorage, x as fsCampaignStorage } from "../external-optimizer-subprocess-x5AbhAYX.js";
10
10
  import { a as heldoutSignificance, s as decidePairedPromotion } from "../power-preflight-DEw-uC7q.js";
11
11
  import { r as makeProposalFinding } from "../types-BI4fT3HN.js";
12
12
  import { $ as classifyOtlpSpanRole, et as isOtlpModelCall } from "../kind-factory-CPmSd58s.js";
@@ -15,7 +15,7 @@ import { LLM_MODEL_ATTR_KEYS, SPAN_KIND_ATTR_KEYS } from "../trace-attributes.js
15
15
  import { t as extractUsage } from "../extract-usage-BrQ8mCLX.js";
16
16
  import { n as InMemoryOutcomeStore, t as FileSystemOutcomeStore } from "../outcome-store-ChBKlTd_.js";
17
17
  import { i as summarizeTraceErrors, n as recordAggregateMeasurements, r as summarizeExecutionMeasurements, t as readTaskFailureLabels } from "../task-failure-attributes-CpQ4y5RD.js";
18
- import { a as externalTextOptimizationMethod, c as REFERENCE_EQUIVALENCE_INPUT_LIMITS, d as runReferenceEquivalenceJudge, i as composeGate, l as REFERENCE_EQUIVALENCE_JUDGE_VERSION, n as gepaOptimizationMethod, r as heldOutGate, t as skillOptOptimizationMethod, u as createReferenceEquivalenceJudge } from "../skillopt-optimization-method-C6JSfYxT.js";
18
+ import { a as externalTextOptimizationMethod, c as REFERENCE_EQUIVALENCE_INPUT_LIMITS, d as runReferenceEquivalenceJudge, i as composeGate, l as REFERENCE_EQUIVALENCE_JUDGE_VERSION, n as gepaOptimizationMethod, r as heldOutGate, t as skillOptOptimizationMethod, u as createReferenceEquivalenceJudge } from "../skillopt-optimization-method-CcWZBaSz.js";
19
19
  import { n as paretoPolicy, r as paretoSignificanceGate, t as buildEvidenceVector } from "../promotion-policy-xzA40Evo.js";
20
20
  import { createHash } from "node:crypto";
21
21
  import { agentCandidateBenchmarkSuiteSchema, agentCandidateBenchmarkTaskSchema, agentCandidateBundleSchema, agentCandidateEvaluationPolicySchema, agentCandidateExperimentSchema, agentImprovementMeasuredComparisonSchema, agentProfileImprovementExperimentSchema, agentProfileImprovementMeasuredComparisonSchema, agentProfileImprovementRunCellSchema, agentProfileImprovementRunReceiptSchema, agentProfileImprovementSuiteInputsSchema, agentProfileImprovementSuiteSchema, agentProfileImprovementTaskSchema, candidateExecutionEvidenceSchema, canonicalCandidateDigest, canonicalCandidateJson, numbersApproximatelyEqual, omitTopLevelDigest } from "@tangle-network/agent-interface";
@@ -1558,6 +1558,7 @@ function projectionFor(source, entries) {
1558
1558
  function codexProjection(entries) {
1559
1559
  const actions = [];
1560
1560
  const calls = /* @__PURE__ */ new Map();
1561
+ const transcriptStream = hasCodexTranscriptStream(entries);
1561
1562
  let finalText = null;
1562
1563
  let terminal = "unknown";
1563
1564
  let explicitTerminal = false;
@@ -1566,8 +1567,9 @@ function codexProjection(entries) {
1566
1567
  const payload = record$1(entry.payload) ?? {};
1567
1568
  const payloadType = stringField$1(payload, "type");
1568
1569
  const timestampMs = timestamp(entry.timestamp);
1569
- const item = record$1(entry.item);
1570
- if (entryType === "item.started" && item) {
1570
+ const itemEvent = admittedCodexItem(entry, transcriptStream);
1571
+ const item = itemEvent?.item ?? null;
1572
+ if (itemEvent?.eventType === "item.started" && item) {
1571
1573
  const itemType = stringField$1(item, "type");
1572
1574
  if (isCodexActionItem(itemType)) {
1573
1575
  const id = stringField$1(item, "id") ?? `item-${actions.length}`;
@@ -1580,7 +1582,7 @@ function codexProjection(entries) {
1580
1582
  status: "started",
1581
1583
  timestampMs,
1582
1584
  metadata: compactMetadata({
1583
- sourceEventType: entryType,
1585
+ sourceEventType: itemEvent.eventType,
1584
1586
  itemType
1585
1587
  })
1586
1588
  });
@@ -1588,7 +1590,7 @@ function codexProjection(entries) {
1588
1590
  actions.push(action);
1589
1591
  }
1590
1592
  }
1591
- if (entryType === "item.completed" && item) {
1593
+ if (itemEvent?.eventType === "item.completed" && item) {
1592
1594
  const itemType = stringField$1(item, "type");
1593
1595
  if (itemType === "agent_message" || itemType === "message") finalText = nonEmpty(stringField$1(item, "text")) ?? finalText;
1594
1596
  if (isCodexActionItem(itemType)) {
@@ -1606,7 +1608,7 @@ function codexProjection(entries) {
1606
1608
  status,
1607
1609
  timestampMs,
1608
1610
  metadata: compactMetadata({
1609
- sourceEventType: entryType,
1611
+ sourceEventType: itemEvent.eventType,
1610
1612
  itemType
1611
1613
  })
1612
1614
  });
@@ -1986,6 +1988,79 @@ function completeClaudeTools(content, calls) {
1986
1988
  if (action) action.status = part.is_error === true ? "failed" : "completed";
1987
1989
  }
1988
1990
  }
1991
+ /**
1992
+ * Codex writes the same session items on two transports. The app-server stream
1993
+ * of `codex exec --json` puts an item at the top level under `item.started` or
1994
+ * `item.completed` and names its type in snake_case. A rollout file under
1995
+ * `~/.codex/sessions` wraps the same item in an `event_msg` entry under
1996
+ * `payload.item_started` or `payload.item_completed` and names its type in
1997
+ * PascalCase. Read both here so one branch serves both transports.
1998
+ */
1999
+ function codexItemEvent(entry) {
2000
+ const entryType = stringField$1(entry, "type");
2001
+ if (entryType === "item.started" || entryType === "item.completed") {
2002
+ const item = record$1(entry.item);
2003
+ return item ? {
2004
+ eventType: entryType,
2005
+ item
2006
+ } : null;
2007
+ }
2008
+ if (entryType !== "event_msg") return null;
2009
+ const payload = record$1(entry.payload);
2010
+ const payloadType = payload ? stringField$1(payload, "type") : void 0;
2011
+ if (payloadType !== "item_started" && payloadType !== "item_completed") return null;
2012
+ const item = record$1(payload?.item);
2013
+ if (!item) return null;
2014
+ const itemType = codexItemType(stringField$1(item, "type"));
2015
+ return {
2016
+ eventType: payloadType === "item_started" ? "item.started" : "item.completed",
2017
+ item: itemType === void 0 ? item : {
2018
+ ...item,
2019
+ type: itemType
2020
+ }
2021
+ };
2022
+ }
2023
+ /**
2024
+ * A rollout item type differs from its app-server name by case alone, except
2025
+ * `CollabAgentToolCall`, which the app-server calls `collab_tool_call`. Convert
2026
+ * the case mechanically so a new item type still arrives under a stable name.
2027
+ */
2028
+ function codexItemType(itemType) {
2029
+ if (itemType === void 0 || !/^[A-Z]/.test(itemType)) return itemType;
2030
+ if (itemType === "CollabAgentToolCall") return "collab_tool_call";
2031
+ return itemType.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase();
2032
+ }
2033
+ function hasCodexTranscriptStream(entries) {
2034
+ return entries.some((entry) => stringField$1(entry, "type") === "response_item");
2035
+ }
2036
+ /**
2037
+ * A rollout file records each turn twice: `response_item` holds the model
2038
+ * transcript and the item stream holds the execution record. The app-server
2039
+ * transport sends no `response_item` entry at all. So `response_item` keeps the
2040
+ * tool call, reasoning, and assistant message accounting wherever it is
2041
+ * present, and the item stream adds only the facts a `response_item` cannot
2042
+ * express. Counting both streams together doubles the totals: a 186-file
2043
+ * rollout corpus holds 58,752 `Reasoning` items against 58,893 `reasoning`
2044
+ * response items, and 49,694 `CommandExecution` items against 52,183 response
2045
+ * item tool calls.
2046
+ *
2047
+ * A collaboration or subagent item states no fact of its own here. Its id is
2048
+ * either the id of a response item that the same file already reports, or the
2049
+ * id of a command that ran inside the sandbox, which the enclosing response
2050
+ * item already counts. Over the same corpus, all 320 collaboration items and
2051
+ * all 523 subagent items that match a response item resolve to an action that
2052
+ * `surfaceForTool` already marks `subagent`, and the 1,434 that match nothing
2053
+ * would each add a second action for one operation.
2054
+ */
2055
+ function isCodexExecutionOnlyItem(itemType) {
2056
+ return itemType === "file_change" || itemType === "user_message" || itemType === "context_compaction";
2057
+ }
2058
+ function admittedCodexItem(entry, transcriptStream) {
2059
+ const event = codexItemEvent(entry);
2060
+ if (!event) return null;
2061
+ if (!transcriptStream) return event;
2062
+ return isCodexExecutionOnlyItem(stringField$1(event.item, "type")) ? event : null;
2063
+ }
1989
2064
  function isCodexActionItem(itemType) {
1990
2065
  return itemType === "command_execution" || itemType === "mcp_tool_call" || itemType === "collab_tool_call" || itemType === "web_search" || itemType === "file_change";
1991
2066
  }
@@ -2058,13 +2133,25 @@ function actionFor(input) {
2058
2133
  function surfaceForTool(name) {
2059
2134
  const normalized = name.toLowerCase();
2060
2135
  if (normalized.startsWith("mcp__") || normalized.includes("mcp_tool")) return "mcp";
2061
- if (normalized === "task" || normalized === "agent" || normalized.includes("subagent") || normalized.includes("spawn_agent") || normalized.includes("collab") || normalized.startsWith("multi_agent")) return "subagent";
2136
+ if (normalized === "task" || normalized === "agent" || normalized.includes("subagent") || normalized.includes("spawn_agent") || normalized.includes("collab") || normalized.startsWith("multi_agent") || isCodexCollaborationTool(normalized)) return "subagent";
2062
2137
  if (normalized === "skill" || normalized.includes("skill")) return "skill";
2063
2138
  if (normalized.includes("hook")) return "hook";
2064
2139
  if (normalized.includes("web_search") || normalized.includes("webfetch") || normalized === "web") return "web";
2065
2140
  if (normalized === "edit" || normalized === "write" || normalized.includes("patch") || normalized.includes("file_change")) return "code";
2066
2141
  return "tool";
2067
2142
  }
2143
+ /**
2144
+ * Codex serves its subagent tools from the `collaboration` and `multi_agent_v1`
2145
+ * namespaces. The namespace does not reach this function, so the tool name must
2146
+ * carry the decision. Codex names every lifecycle verb `<verb>_agent` or
2147
+ * `<verb>_agents`, and adds three message verbs that do not use that suffix.
2148
+ * A namespaced name such as `collaboration.wait_agent` keeps the verb last, so
2149
+ * only the final segment is tested.
2150
+ */
2151
+ function isCodexCollaborationTool(normalized) {
2152
+ const verb = normalized.slice(normalized.lastIndexOf(".") + 1);
2153
+ return /^[a-z_]+_agents?$/.test(verb) || verb === "send_message" || verb === "send_input" || verb === "followup_task";
2154
+ }
2068
2155
  function statusFrom(value) {
2069
2156
  const status = (stringField$1(value, "status") ?? "").toLowerCase();
2070
2157
  if (status === "completed" || status === "success" || status === "succeeded") return "completed";
@@ -2332,6 +2419,7 @@ function metricsFor(source, entries) {
2332
2419
  function codexMetrics(entries) {
2333
2420
  const metrics = emptyMetrics(entries.length);
2334
2421
  const startedToolIds = /* @__PURE__ */ new Set();
2422
+ const transcriptStream = hasCodexTranscriptStream(entries);
2335
2423
  let startedAt;
2336
2424
  let completedAt;
2337
2425
  for (const entry of entries) {
@@ -2350,8 +2438,8 @@ function codexMetrics(entries) {
2350
2438
  }
2351
2439
  if (entryType === "turn.failed") metrics.turnsAborted += 1;
2352
2440
  if (entryType === "error") metrics.unclassifiedErrors += 1;
2353
- const item = record(entry.item);
2354
- if (item && (entryType === "item.started" || entryType === "item.completed")) addCodexExecItem(metrics, startedToolIds, entryType, item);
2441
+ const itemEvent = admittedCodexItem(entry, transcriptStream);
2442
+ if (itemEvent) addCodexExecItem(metrics, startedToolIds, itemEvent.eventType, itemEvent.item, transcriptStream);
2355
2443
  if (entryType === "response_item") {
2356
2444
  if (payloadType === "function_call" || payloadType === "custom_tool_call") metrics.toolCalls += 1;
2357
2445
  if (payloadType === "function_call_output" || payloadType === "custom_tool_call_output") metrics.toolOutputs += 1;
@@ -2396,10 +2484,10 @@ function codexMetrics(entries) {
2396
2484
  metrics.processScore = codexProcessScore(metrics);
2397
2485
  return metrics;
2398
2486
  }
2399
- function addCodexExecItem(metrics, startedToolIds, eventType, item) {
2487
+ function addCodexExecItem(metrics, startedToolIds, eventType, item, transcriptStream) {
2400
2488
  const itemType = stringField(item, "type");
2401
2489
  const itemId = stringField(item, "id");
2402
- const isTool = itemType === "command_execution" || itemType === "mcp_tool_call" || itemType === "collab_tool_call" || itemType === "web_search";
2490
+ const isTool = !transcriptStream && (itemType === "command_execution" || itemType === "mcp_tool_call" || itemType === "collab_tool_call" || itemType === "web_search");
2403
2491
  if (eventType === "item.started" && isTool) {
2404
2492
  metrics.toolCalls += 1;
2405
2493
  if (itemId) startedToolIds.add(itemId);
@@ -2410,7 +2498,9 @@ function addCodexExecItem(metrics, startedToolIds, eventType, item) {
2410
2498
  }
2411
2499
  if (eventType !== "item.completed") return;
2412
2500
  if (itemType === "agent_message" || itemType === "message") metrics.assistantMessages += 1;
2501
+ if (itemType === "user_message") metrics.userMessages += 1;
2413
2502
  if (itemType === "reasoning") metrics.reasoningItems += 1;
2503
+ if (itemType === "context_compaction") metrics.contextCompactions += 1;
2414
2504
  if (itemType === "file_change") {
2415
2505
  metrics.patchAttempts += 1;
2416
2506
  const status = stringField(item, "status");
@@ -2838,10 +2928,24 @@ function cwdFromEntries(entries) {
2838
2928
  if (cwd) return cwd;
2839
2929
  }
2840
2930
  }
2931
+ /** Join the `text` of every part in a `[{ type: 'text', text }]` content list. */
2932
+ function textFromContentParts(content) {
2933
+ if (!Array.isArray(content)) return void 0;
2934
+ const text = content.map((part) => {
2935
+ const obj = record(part);
2936
+ return obj ? stringField(obj, "text") : void 0;
2937
+ }).filter((part) => part !== void 0).join("\n");
2938
+ return text.length > 0 ? text : void 0;
2939
+ }
2841
2940
  function firstUserText(entries) {
2842
2941
  for (const entry of entries) {
2843
2942
  const payload = record(entry.payload);
2844
2943
  if ((payload ? stringField(payload, "type") : void 0) === "user_message") return stringField(payload, "message");
2944
+ const itemEvent = payload ? admittedCodexItem(entry, false) : null;
2945
+ if (itemEvent && stringField(itemEvent.item, "type") === "user_message") {
2946
+ const text = textFromContentParts(itemEvent.item.content);
2947
+ if (text) return text;
2948
+ }
2845
2949
  if (stringField(entry, "role") === "user") {
2846
2950
  const content = entry.content;
2847
2951
  if (typeof content === "string") return content;
@@ -2853,13 +2957,8 @@ function firstUserText(entries) {
2853
2957
  if (message && stringField(message, "role") === "user") {
2854
2958
  const content = message.content;
2855
2959
  if (typeof content === "string") return content;
2856
- if (Array.isArray(content)) {
2857
- const text = content.map((part) => {
2858
- const obj = record(part);
2859
- return obj ? stringField(obj, "text") : void 0;
2860
- }).filter((part) => part !== void 0).join("\n");
2861
- if (text) return text;
2862
- }
2960
+ const text = textFromContentParts(content);
2961
+ if (text) return text;
2863
2962
  }
2864
2963
  }
2865
2964
  }