@tangle-network/agent-eval 0.136.0 → 0.138.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 +86 -1
- package/README.md +37 -2
- package/dist/{agent-profile-cell-OhuTee9n.js → agent-profile-cell-CbfBm2g6.js} +2 -2
- package/dist/{agent-profile-cell-OhuTee9n.js.map → agent-profile-cell-CbfBm2g6.js.map} +1 -1
- package/dist/{agent-profile-cell-CCm3l2v2.d.ts → agent-profile-cell-Cw0PVwDr.d.ts} +2 -2
- package/dist/{agent-profile-cell-CCm3l2v2.d.ts.map → agent-profile-cell-Cw0PVwDr.d.ts.map} +1 -1
- package/dist/analyst/index.d.ts +574 -18
- package/dist/analyst/index.d.ts.map +1 -1
- package/dist/analyst/index.js +25 -5
- package/dist/analyst/index.js.map +1 -1
- package/dist/{analyze-runs-jjCmF8pU.js → analyze-runs-BScZvqMV.js} +6 -6
- package/dist/{analyze-runs-jjCmF8pU.js.map → analyze-runs-BScZvqMV.js.map} +1 -1
- package/dist/{analyze-runs-Cda5Xkj1.d.ts → analyze-runs-CPYxfPWT.d.ts} +6 -6
- package/dist/{analyze-runs-Cda5Xkj1.d.ts.map → analyze-runs-CPYxfPWT.d.ts.map} +1 -1
- package/dist/{baseline-BUeFcgrn.js → baseline-C-GocmIW.js} +2 -2
- package/dist/{baseline-BUeFcgrn.js.map → baseline-C-GocmIW.js.map} +1 -1
- package/dist/benchmark-D8dkki-J.js +554 -0
- package/dist/benchmark-D8dkki-J.js.map +1 -0
- package/dist/benchmark-DlQgU_XI.d.ts +236 -0
- package/dist/benchmark-DlQgU_XI.d.ts.map +1 -0
- package/dist/benchmark-command-CMqVqReF.js +4332 -0
- package/dist/benchmark-command-CMqVqReF.js.map +1 -0
- package/dist/benchmarks/index.d.ts +1 -1
- package/dist/benchmarks/index.js +1 -1
- package/dist/{benchmarks-Dfgm9ts5.js → benchmarks-BJ_xK5rQ.js} +4 -3
- package/dist/{benchmarks-Dfgm9ts5.js.map → benchmarks-BJ_xK5rQ.js.map} +1 -1
- package/dist/builder-eval/index.js +2 -2
- package/dist/campaign/index.d.ts +6 -6
- package/dist/campaign/index.js +4 -4
- package/dist/{campaign-Dz8uQnhC.js → campaign-BIBS-NHV.js} +219 -78
- package/dist/campaign-BIBS-NHV.js.map +1 -0
- package/dist/cli.js +9 -2
- package/dist/cli.js.map +1 -1
- package/dist/client-BwPKohkJ.d.ts +202 -0
- package/dist/client-BwPKohkJ.d.ts.map +1 -0
- package/dist/completion-verifier-B4-IMYcS.d.ts +240 -0
- package/dist/completion-verifier-B4-IMYcS.d.ts.map +1 -0
- package/dist/contract/index.d.ts +10 -9
- package/dist/contract/index.d.ts.map +1 -1
- package/dist/contract/index.js +13 -13
- package/dist/control.d.ts +2 -2
- package/dist/control.js +1 -1
- package/dist/{cost-ledger-fGS_u_O1.d.ts → cost-ledger-B1D3COAc.d.ts} +6 -5
- package/dist/{cost-ledger-fGS_u_O1.d.ts.map → cost-ledger-B1D3COAc.d.ts.map} +1 -1
- package/dist/{cost-ledger-DHAjwNj7.js → cost-ledger-CHDLA0Ss.js} +91 -46
- package/dist/cost-ledger-CHDLA0Ss.js.map +1 -0
- package/dist/{dataset-BvtnC8Dc.d.ts → dataset-v_Y5902-.d.ts} +2 -2
- package/dist/{dataset-BvtnC8Dc.d.ts.map → dataset-v_Y5902-.d.ts.map} +1 -1
- package/dist/{default-registry-Brxr728w.d.ts → default-registry-PUhIVRWz.d.ts} +77 -138
- package/dist/default-registry-PUhIVRWz.d.ts.map +1 -0
- package/dist/{default-registry-CHmdy2An.js → default-registry-lp5R0lve.js} +1617 -291
- package/dist/default-registry-lp5R0lve.js.map +1 -0
- package/dist/{errors-8YnH8WlF.js → errors-D-LKuDhb.js} +8 -2
- package/dist/errors-D-LKuDhb.js.map +1 -0
- package/dist/{errors-CEk209JS.d.ts → errors-DkfjIDvD.d.ts} +9 -3
- package/dist/errors-DkfjIDvD.d.ts.map +1 -0
- package/dist/{eval-campaign-Cc8WZJ6b.js → eval-campaign-9MozgKL7.js} +6 -6
- package/dist/{eval-campaign-Cc8WZJ6b.js.map → eval-campaign-9MozgKL7.js.map} +1 -1
- package/dist/exact-types-Dpw2LeHA.d.ts +234 -0
- package/dist/exact-types-Dpw2LeHA.d.ts.map +1 -0
- package/dist/{extract-usage-DIQpN-ww.js → extract-usage-CS391dOE.js} +3 -3
- package/dist/{extract-usage-DIQpN-ww.js.map → extract-usage-CS391dOE.js.map} +1 -1
- package/dist/{feedback-trajectory-CVaeREXV.d.ts → feedback-trajectory-CoNep7rl.d.ts} +91 -3
- package/dist/feedback-trajectory-CoNep7rl.d.ts.map +1 -0
- package/dist/fuzz.d.ts +1 -1
- package/dist/fuzz.js +2 -2
- package/dist/hosted/index.d.ts +3 -2
- package/dist/hosted/index.d.ts.map +1 -1
- package/dist/{index-AbhwHp0V.d.ts → index-B2-IxCMB.d.ts} +2 -2
- package/dist/{index-AbhwHp0V.d.ts.map → index-B2-IxCMB.d.ts.map} +1 -1
- package/dist/index-BipJlj-C.d.ts +316 -0
- package/dist/index-BipJlj-C.d.ts.map +1 -0
- package/dist/{index-CQsJcqch.d.ts → index-CjVYlVBK.d.ts} +5 -5
- package/dist/{index-CQsJcqch.d.ts.map → index-CjVYlVBK.d.ts.map} +1 -1
- package/dist/{index-B4Fjfo5U.d.ts → index-D0cxAdaV.d.ts} +89 -317
- package/dist/index-D0cxAdaV.d.ts.map +1 -0
- package/dist/{index-DuhJaaiH.d.ts → index-DEb46kc6.d.ts} +2 -2
- package/dist/index-DEb46kc6.d.ts.map +1 -0
- package/dist/{index-C2fkZhv_.d.ts → index-sMN_hI4E.d.ts} +3 -3
- package/dist/{index-C2fkZhv_.d.ts.map → index-sMN_hI4E.d.ts.map} +1 -1
- package/dist/index.d.ts +30 -70
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +175 -35
- package/dist/index.js.map +1 -1
- package/dist/{client-DcvgkaZi.d.ts → insight-report-CXd8VBDR.d.ts} +5 -203
- package/dist/insight-report-CXd8VBDR.d.ts.map +1 -0
- package/dist/{integrity-rmVhXWA7.d.ts → integrity-B-MLFz0I.d.ts} +3 -3
- package/dist/{integrity-rmVhXWA7.d.ts.map → integrity-B-MLFz0I.d.ts.map} +1 -1
- package/dist/integrity-CCXTftiL.js +1360 -0
- package/dist/integrity-CCXTftiL.js.map +1 -0
- package/dist/{integrity-BzRbCHzi.js → integrity-fdt8XPAv.js} +2 -2
- package/dist/{integrity-BzRbCHzi.js.map → integrity-fdt8XPAv.js.map} +1 -1
- package/dist/ledger-core/index.d.ts +1 -1
- package/dist/ledger-core/index.js +1 -1
- package/dist/{ledger-core-DAKFKRzi.js → ledger-core-C0Yx1I14.js} +303 -110
- package/dist/ledger-core-C0Yx1I14.js.map +1 -0
- package/dist/{llm-client-DHx8pzyJ.js → llm-client-Cj3c7PEm.js} +6 -6
- package/dist/llm-client-Cj3c7PEm.js.map +1 -0
- package/dist/meta-eval/index.d.ts +2 -2
- package/dist/meta-eval/index.js +3 -3
- package/dist/{mint-DyRUc9k6.js → mint-Ctwk079K.js} +4 -4
- package/dist/{mint-DyRUc9k6.js.map → mint-Ctwk079K.js.map} +1 -1
- package/dist/multishot/index.d.ts +2 -2
- package/dist/openapi.json +1 -1
- package/dist/{paired-arms-BbFKrAU-.js → paired-arms-iZ08VFMN.js} +3 -3
- package/dist/{paired-arms-BbFKrAU-.js.map → paired-arms-iZ08VFMN.js.map} +1 -1
- package/dist/pipelines/index.js +2 -2
- package/dist/profile-cell.d.ts +1 -1
- package/dist/profile-cell.js +1 -1
- package/dist/{proposal-findings-DCawte-y.js → proposal-findings-2GIUo1et.js} +2 -68
- package/dist/proposal-findings-2GIUo1et.js.map +1 -0
- package/dist/{propose-review-control-SQ-n9-We.js → propose-review-control-DLXz4FCX.js} +2 -2
- package/dist/{propose-review-control-SQ-n9-We.js.map → propose-review-control-DLXz4FCX.js.map} +1 -1
- package/dist/registry-C4yJTza7.d.ts +178 -0
- package/dist/registry-C4yJTza7.d.ts.map +1 -0
- package/dist/{release-report-DooPguBc.js → release-report-B5XPBvAU.js} +4 -4
- package/dist/{release-report-DooPguBc.js.map → release-report-B5XPBvAU.js.map} +1 -1
- package/dist/{release-report-DpBxGGI1.d.ts → release-report-CoyvyLBs.d.ts} +4 -4
- package/dist/{release-report-DpBxGGI1.d.ts.map → release-report-CoyvyLBs.d.ts.map} +1 -1
- package/dist/{replay-C6wRg47C.js → replay-Cb-4Vf0k.js} +249 -8
- package/dist/replay-Cb-4Vf0k.js.map +1 -0
- package/dist/{replay-BRfMIs81.d.ts → replay-DbIYwso6.d.ts} +227 -52
- package/dist/replay-DbIYwso6.d.ts.map +1 -0
- package/dist/reporting.d.ts +4 -4
- package/dist/reporting.js +4 -4
- package/dist/{researcher-Doo95b50.d.ts → researcher-BCeOEjtR.d.ts} +6 -7
- package/dist/researcher-BCeOEjtR.d.ts.map +1 -0
- package/dist/{reward-hacking-a-kYs0-i.js → reward-hacking-GyN0kMd8.js} +3 -3
- package/dist/{reward-hacking-a-kYs0-i.js.map → reward-hacking-GyN0kMd8.js.map} +1 -1
- package/dist/{reward-hacking-D-QqXvg-.d.ts → reward-hacking-sE2l_NV6.d.ts} +2 -2
- package/dist/{reward-hacking-D-QqXvg-.d.ts.map → reward-hacking-sE2l_NV6.d.ts.map} +1 -1
- package/dist/rl.d.ts +6 -6
- package/dist/rl.js +9 -9
- package/dist/rollout/index.d.ts +1 -1
- package/dist/rollout/index.js +3 -3
- package/dist/{rollout-DLSUIWLu.js → rollout-DQFl0UXA.js} +2 -2
- package/dist/{rollout-DLSUIWLu.js.map → rollout-DQFl0UXA.js.map} +1 -1
- package/dist/{rubric-predictive-validity-BJf-8ejY.js → rubric-predictive-validity-BRR632r1.js} +2 -2
- package/dist/{rubric-predictive-validity-BJf-8ejY.js.map → rubric-predictive-validity-BRR632r1.js.map} +1 -1
- package/dist/{rubric-predictive-validity-C1dCLcvb.d.ts → rubric-predictive-validity-w2klGv1u.d.ts} +2 -2
- package/dist/{rubric-predictive-validity-C1dCLcvb.d.ts.map → rubric-predictive-validity-w2klGv1u.d.ts.map} +1 -1
- package/dist/{run-evidence-DokQtX0-.d.ts → run-evidence-CbE0A8Xg.d.ts} +3 -3
- package/dist/{run-evidence-DokQtX0-.d.ts.map → run-evidence-CbE0A8Xg.d.ts.map} +1 -1
- package/dist/{run-record-DcObtIGh.d.ts → run-record-DwHMk1Ai.d.ts} +4 -4
- package/dist/{run-record-DcObtIGh.d.ts.map → run-record-DwHMk1Ai.d.ts.map} +1 -1
- package/dist/{run-record-BIwU2wdV.js → run-record-vRgqWmJw.js} +3 -3
- package/dist/{run-record-BIwU2wdV.js.map → run-record-vRgqWmJw.js.map} +1 -1
- package/dist/{semantic-concept-judge-Btozx3Vc.js → semantic-concept-judge-DYXDPZW0.js} +12 -6
- package/dist/semantic-concept-judge-DYXDPZW0.js.map +1 -0
- package/dist/{server-Bz3WQJs6.js → server-DLEvyW2z.js} +3 -3
- package/dist/{server-Bz3WQJs6.js.map → server-DLEvyW2z.js.map} +1 -1
- package/dist/single-run-lock-D_bS5xhj.js +318 -0
- package/dist/single-run-lock-D_bS5xhj.js.map +1 -0
- package/dist/{skill-usage-BDQVPIG1.d.ts → skill-usage-Bv3G4VkA.d.ts} +36 -48
- package/dist/skill-usage-Bv3G4VkA.d.ts.map +1 -0
- package/dist/{skillopt-optimization-method-0UmPD6aP.js → skillopt-optimization-method-CjKMZy0d.js} +10 -185
- package/dist/skillopt-optimization-method-CjKMZy0d.js.map +1 -0
- package/dist/{skillopt-optimization-method-CwSYkv35.d.ts → skillopt-optimization-method-CzfnA8O-.d.ts} +11 -12
- package/dist/skillopt-optimization-method-CzfnA8O-.d.ts.map +1 -0
- package/dist/{statistics-CnGCLLqc.js → statistics-ByxzSiOM.js} +2 -2
- package/dist/{statistics-CnGCLLqc.js.map → statistics-ByxzSiOM.js.map} +1 -1
- package/dist/{statistics-CKOqre5S.d.ts → statistics-mf70aXKp.d.ts} +2 -2
- package/dist/{statistics-CKOqre5S.d.ts.map → statistics-mf70aXKp.d.ts.map} +1 -1
- package/dist/store-otlp-BenKynPE.js +1688 -0
- package/dist/store-otlp-BenKynPE.js.map +1 -0
- package/dist/{summary-report-BEk8OFLs.js → summary-report-9A5y7EsK.js} +4 -4
- package/dist/{summary-report-BEk8OFLs.js.map → summary-report-9A5y7EsK.js.map} +1 -1
- package/dist/{summary-report-CPMINBqs.d.ts → summary-report-BKinV4yD.d.ts} +3 -3
- package/dist/{summary-report-CPMINBqs.d.ts.map → summary-report-BKinV4yD.d.ts.map} +1 -1
- package/dist/supervisor-run/index.d.ts +3 -2
- package/dist/supervisor-run/index.js +3 -2
- package/dist/{supervisor-run-Dr5HnTup.js → supervisor-run-B2EWUmQY.js} +28 -454
- package/dist/supervisor-run-B2EWUmQY.js.map +1 -0
- package/dist/{test-graded-scenario-BsqWLmPt.js → test-graded-scenario-JHcKQNpq.js} +2 -2
- package/dist/{test-graded-scenario-BsqWLmPt.js.map → test-graded-scenario-JHcKQNpq.js.map} +1 -1
- package/dist/tools-DZGdROtG.js +255 -0
- package/dist/tools-DZGdROtG.js.map +1 -0
- package/dist/traces.d.ts +6 -7
- package/dist/traces.js +6 -6
- package/dist/types-5q2T25iW.d.ts +804 -0
- package/dist/types-5q2T25iW.d.ts.map +1 -0
- package/dist/{types-DVjczBM9.d.ts → types-BtJhn8v6.d.ts} +260 -6
- package/dist/types-BtJhn8v6.d.ts.map +1 -0
- package/dist/{index-CyC1BTmn.d.ts → types-Dea6tiVI.d.ts} +16 -238
- package/dist/types-Dea6tiVI.d.ts.map +1 -0
- package/dist/{types-DiWLru6Z.d.ts → types-zFYez3PK.d.ts} +5 -5
- package/dist/{types-DiWLru6Z.d.ts.map → types-zFYez3PK.d.ts.map} +1 -1
- package/dist/wire/index.d.ts +3 -3
- package/dist/wire/index.js +1 -1
- package/docs/feedback-trajectories.md +100 -1
- package/docs/trace-analysis.md +494 -58
- package/package.json +9 -3
- package/dist/analyst-BkTS3C58.d.ts +0 -89
- package/dist/analyst-BkTS3C58.d.ts.map +0 -1
- package/dist/analyst-j5je5J7c.js +0 -152
- package/dist/analyst-j5je5J7c.js.map +0 -1
- package/dist/campaign-Dz8uQnhC.js.map +0 -1
- package/dist/client-DcvgkaZi.d.ts.map +0 -1
- package/dist/concurrency-MUjT7VjM.js +0 -109
- package/dist/concurrency-MUjT7VjM.js.map +0 -1
- package/dist/cost-ledger-DHAjwNj7.js.map +0 -1
- package/dist/default-registry-Brxr728w.d.ts.map +0 -1
- package/dist/default-registry-CHmdy2An.js.map +0 -1
- package/dist/errors-8YnH8WlF.js.map +0 -1
- package/dist/errors-CEk209JS.d.ts.map +0 -1
- package/dist/feedback-trajectory-CVaeREXV.d.ts.map +0 -1
- package/dist/index-B4Fjfo5U.d.ts.map +0 -1
- package/dist/index-CyC1BTmn.d.ts.map +0 -1
- package/dist/index-DuhJaaiH.d.ts.map +0 -1
- package/dist/ledger-core-DAKFKRzi.js.map +0 -1
- package/dist/llm-client-BiK4HW0u.d.ts +0 -290
- package/dist/llm-client-BiK4HW0u.d.ts.map +0 -1
- package/dist/llm-client-DHx8pzyJ.js.map +0 -1
- package/dist/proposal-findings-DCawte-y.js.map +0 -1
- package/dist/raw-provider-sink-BU29Sh8h.d.ts +0 -134
- package/dist/raw-provider-sink-BU29Sh8h.d.ts.map +0 -1
- package/dist/replay-BRfMIs81.d.ts.map +0 -1
- package/dist/replay-C6wRg47C.js.map +0 -1
- package/dist/researcher-Doo95b50.d.ts.map +0 -1
- package/dist/semantic-concept-judge-Btozx3Vc.js.map +0 -1
- package/dist/skill-usage-BDQVPIG1.d.ts.map +0 -1
- package/dist/skillopt-optimization-method-0UmPD6aP.js.map +0 -1
- package/dist/skillopt-optimization-method-CwSYkv35.d.ts.map +0 -1
- package/dist/store-CxJry_cs.d.ts +0 -229
- package/dist/store-CxJry_cs.d.ts.map +0 -1
- package/dist/supervisor-run-Dr5HnTup.js.map +0 -1
- package/dist/tools-D8yTtNSN.js +0 -1190
- package/dist/tools-D8yTtNSN.js.map +0 -1
- package/dist/types-Cc3qbqzj.d.ts +0 -387
- package/dist/types-Cc3qbqzj.d.ts.map +0 -1
- package/dist/types-DVjczBM9.d.ts.map +0 -1
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { _ as TraceFileMissingError, a as createBoundedTraceAnalysisStore, c as traceStoreInputSchemas, d as TRACE_ANALYSIS_LIMITS, o as parseTraceInput, s as toTraceJsonSchema } from "./store-otlp-BenKynPE.js";
|
|
2
|
+
import { AxJSRuntime, agent } from "@ax-llm/ax";
|
|
3
|
+
//#region src/trace-analyst/loop.ts
|
|
4
|
+
const TRACE_ANALYSIS_TOOL_INSTRUCTION = `Gather the evidence needed for the report with the trace tools.
|
|
5
|
+
When the evidence is sufficient, call final(task, evidence) and let the response stage produce the declared report and findings fields.`;
|
|
6
|
+
const TRACE_ANALYSIS_CONTEXT_INSTRUCTION = `The complete bounded trace data is available as inputs.context.
|
|
7
|
+
Inspect it in the runtime, then call respond(task, evidence) and let the response stage produce the declared report and findings fields.`;
|
|
8
|
+
const TRACE_ANALYSIS_RESPONDER_INSTRUCTION = `Use only evidence produced by the analysis stage.
|
|
9
|
+
Do not invent trace ids, span ids, steps, tool results, or final verification outcomes.`;
|
|
10
|
+
var TraceAnalysisTurnLimitError = class extends Error {
|
|
11
|
+
analystId;
|
|
12
|
+
stage;
|
|
13
|
+
maxTurns;
|
|
14
|
+
constructor(analystId, stage, maxTurns) {
|
|
15
|
+
super(`Trace analyst '${analystId}' reached maxTurns=${maxTurns} in the ${stage} stage without explicit completion`);
|
|
16
|
+
this.name = "TraceAnalysisTurnLimitError";
|
|
17
|
+
this.analystId = analystId;
|
|
18
|
+
this.stage = stage;
|
|
19
|
+
this.maxTurns = maxTurns;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
async function runTraceAnalysisLoop(options) {
|
|
23
|
+
validateLoopLimits(options);
|
|
24
|
+
let turnCount = 0;
|
|
25
|
+
const completedStages = /* @__PURE__ */ new Set();
|
|
26
|
+
const onTurn = async (turn) => {
|
|
27
|
+
if (turn.stage === "executor") turnCount = Math.max(turnCount, turn.turn);
|
|
28
|
+
if (isExplicitCompletionTurn(turn)) completedStages.add(turn.stage);
|
|
29
|
+
await options.onTurn?.(turn);
|
|
30
|
+
if (turn.turn >= options.maxTurns && !completedStages.has(turn.stage)) throw new TraceAnalysisTurnLimitError(options.id, turn.stage, options.maxTurns);
|
|
31
|
+
};
|
|
32
|
+
const hasPreparedContext = options.context !== void 0;
|
|
33
|
+
const config = {
|
|
34
|
+
agentIdentity: {
|
|
35
|
+
name: options.id,
|
|
36
|
+
description: options.description
|
|
37
|
+
},
|
|
38
|
+
contextFields: hasPreparedContext ? ["context"] : [],
|
|
39
|
+
runtime: new AxJSRuntime({
|
|
40
|
+
permissions: [],
|
|
41
|
+
blockDynamicImport: true,
|
|
42
|
+
allowedModules: [],
|
|
43
|
+
freezeIntrinsics: true,
|
|
44
|
+
blockShadowRealm: true,
|
|
45
|
+
preventGlobalThisExtensions: false
|
|
46
|
+
}),
|
|
47
|
+
maxSubAgentCalls: options.maxSubqueries,
|
|
48
|
+
maxTurns: options.maxTurns,
|
|
49
|
+
maxRuntimeChars: options.maxRuntimeChars,
|
|
50
|
+
maxBatchedLlmQueryConcurrency: options.maxParallelSubqueries,
|
|
51
|
+
promptLevel: "detailed",
|
|
52
|
+
contextPolicy: {
|
|
53
|
+
preset: "full",
|
|
54
|
+
budget: "balanced"
|
|
55
|
+
},
|
|
56
|
+
directResponse: hasPreparedContext && options.tools.length === 0 ? "auto" : "off",
|
|
57
|
+
functions: options.tools,
|
|
58
|
+
executorOptions: {
|
|
59
|
+
description: `${options.prompt.trim()}\n\n${hasPreparedContext ? TRACE_ANALYSIS_CONTEXT_INSTRUCTION : TRACE_ANALYSIS_TOOL_INSTRUCTION}`,
|
|
60
|
+
...options.model ? { model: options.model } : {},
|
|
61
|
+
showThoughts: false,
|
|
62
|
+
thinkingTokenBudget: "none"
|
|
63
|
+
},
|
|
64
|
+
responderOptions: {
|
|
65
|
+
description: `${TRACE_ANALYSIS_RESPONDER_INSTRUCTION}\n\n${options.prompt.trim()}`,
|
|
66
|
+
...options.model ? { model: options.model } : {},
|
|
67
|
+
showThoughts: false,
|
|
68
|
+
thinkingTokenBudget: "none"
|
|
69
|
+
},
|
|
70
|
+
actorTurnCallback: onTurn,
|
|
71
|
+
bubbleErrors: [TraceFileMissingError]
|
|
72
|
+
};
|
|
73
|
+
const analyst = hasPreparedContext ? options.findingType === "string" ? agent("context:string, question:string -> report:string, findings:string[]", config) : agent("context:string, question:string -> report:string, findings:json[]", config) : options.findingType === "string" ? agent("question:string -> report:string, findings:string[]", config) : agent("question:string -> report:string, findings:json[]", config);
|
|
74
|
+
const output = hasPreparedContext ? await analyst.forward(options.ai, {
|
|
75
|
+
context: options.context,
|
|
76
|
+
question: options.question
|
|
77
|
+
}, options.signal ? { abortSignal: options.signal } : void 0) : await analyst.forward(options.ai, { question: options.question }, options.signal ? { abortSignal: options.signal } : void 0);
|
|
78
|
+
assertStageDidNotExhaust(options.id, "distiller", options.maxTurns, analyst.distiller?.getState()?.actionLogEntries);
|
|
79
|
+
assertStageDidNotExhaust(options.id, "executor", options.maxTurns, analyst.executor?.getState()?.actionLogEntries);
|
|
80
|
+
const completed = options.findingType === "string" ? readTraceAnalysisOutput(output, "string") : readTraceAnalysisOutput(output, "object");
|
|
81
|
+
const usage = analyst.getUsage();
|
|
82
|
+
const chatLog = splitChatLog(analyst.getChatLog());
|
|
83
|
+
return {
|
|
84
|
+
...completed,
|
|
85
|
+
usage: {
|
|
86
|
+
actor: usage.actor,
|
|
87
|
+
responder: usage.responder
|
|
88
|
+
},
|
|
89
|
+
chatLog,
|
|
90
|
+
turnCount
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function isExplicitCompletionTurn(turn) {
|
|
94
|
+
return !turn.isError && isExplicitCompletionCode(turn.code);
|
|
95
|
+
}
|
|
96
|
+
function isExplicitCompletionCode(code) {
|
|
97
|
+
const executable = trimLeadingComments(code);
|
|
98
|
+
return /^(?:await\s+)?(?:final|respond|askClarification)\s*\(/.test(executable);
|
|
99
|
+
}
|
|
100
|
+
function assertStageDidNotExhaust(analystId, stage, maxTurns, entries) {
|
|
101
|
+
if (!entries || entries.length < maxTurns) return;
|
|
102
|
+
const last = entries.at(-1);
|
|
103
|
+
if (last && !last.tags.includes("error") && isExplicitCompletionCode(last.code)) return;
|
|
104
|
+
throw new TraceAnalysisTurnLimitError(analystId, stage, maxTurns);
|
|
105
|
+
}
|
|
106
|
+
function trimLeadingComments(code) {
|
|
107
|
+
let remaining = code.trimStart();
|
|
108
|
+
while (remaining.startsWith("//") || remaining.startsWith("/*")) {
|
|
109
|
+
if (remaining.startsWith("//")) {
|
|
110
|
+
const lineEnd = remaining.indexOf("\n");
|
|
111
|
+
if (lineEnd === -1) return "";
|
|
112
|
+
remaining = remaining.slice(lineEnd + 1).trimStart();
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
const commentEnd = remaining.indexOf("*/", 2);
|
|
116
|
+
if (commentEnd === -1) return "";
|
|
117
|
+
remaining = remaining.slice(commentEnd + 2).trimStart();
|
|
118
|
+
}
|
|
119
|
+
return remaining;
|
|
120
|
+
}
|
|
121
|
+
function splitChatLog(entries) {
|
|
122
|
+
const actor = [];
|
|
123
|
+
const responder = [];
|
|
124
|
+
for (const entry of entries) {
|
|
125
|
+
const name = entry && typeof entry === "object" && "name" in entry ? entry.name : void 0;
|
|
126
|
+
if (typeof name === "string" && (name === "responder" || name.endsWith(".responder"))) responder.push(entry);
|
|
127
|
+
else actor.push(entry);
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
actor,
|
|
131
|
+
responder
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function readTraceAnalysisOutput(value, findingType) {
|
|
135
|
+
if (!value || typeof value !== "object") throw new Error("Trace analyst response must contain report and findings");
|
|
136
|
+
const { report, findings } = value;
|
|
137
|
+
if (typeof report !== "string" || !Array.isArray(findings)) throw new Error("Trace analyst response must contain report and findings");
|
|
138
|
+
if (findingType === "string") {
|
|
139
|
+
if (findings.some((finding) => typeof finding !== "string")) throw new Error("Trace analyst response must contain string findings");
|
|
140
|
+
return {
|
|
141
|
+
report,
|
|
142
|
+
findings
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
report,
|
|
147
|
+
findings
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function validateLoopLimits(options) {
|
|
151
|
+
if (!Number.isSafeInteger(options.maxSubqueries) || options.maxSubqueries < 0) throw new TypeError("maxSubqueries must be a non-negative integer");
|
|
152
|
+
if (!Number.isSafeInteger(options.maxParallelSubqueries) || options.maxParallelSubqueries < 1) throw new TypeError("maxParallelSubqueries must be a positive integer");
|
|
153
|
+
}
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region src/trace-analyst/tools.ts
|
|
156
|
+
const TRACE_ANALYST_TOOL_NAMESPACE = "traces";
|
|
157
|
+
/** Bind all seven trace reads without exposing an agent framework type. */
|
|
158
|
+
function buildTraceAnalysisToolDescriptors(options) {
|
|
159
|
+
const store = createBoundedTraceAnalysisStore(options.store, { budgets: options.budgets });
|
|
160
|
+
return [
|
|
161
|
+
{
|
|
162
|
+
namespace: TRACE_ANALYST_TOOL_NAMESPACE,
|
|
163
|
+
name: "getDatasetOverview",
|
|
164
|
+
description: "Dataset rollup: total traces, raw_jsonl_bytes, services, agents, models, tools, and sample_trace_ids. Always call this first without a regex_pattern.",
|
|
165
|
+
parameters: toTraceJsonSchema(traceStoreInputSchemas.getOverview),
|
|
166
|
+
handler: async (args, context) => {
|
|
167
|
+
const { filters } = parseTraceInput("getDatasetOverview", traceStoreInputSchemas.getOverview, args ?? {});
|
|
168
|
+
return store.getOverview(filters, context);
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
namespace: TRACE_ANALYST_TOOL_NAMESPACE,
|
|
173
|
+
name: "queryTraces",
|
|
174
|
+
description: `Paginated trace summaries, at most ${TRACE_ANALYSIS_LIMITS.queryTraces} per call. Each summary carries raw_jsonl_bytes; narrow with indexed filters before regex_pattern.`,
|
|
175
|
+
parameters: toTraceJsonSchema(traceStoreInputSchemas.queryTraces),
|
|
176
|
+
handler: async (args, context) => {
|
|
177
|
+
const input = parseTraceInput("queryTraces", traceStoreInputSchemas.queryTraces, args);
|
|
178
|
+
return store.queryTraces(input, context);
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
namespace: TRACE_ANALYST_TOOL_NAMESPACE,
|
|
183
|
+
name: "countTraces",
|
|
184
|
+
description: "Count traces matching filters. Use as a cheap pre-flight before a regex_pattern scan.",
|
|
185
|
+
parameters: toTraceJsonSchema(traceStoreInputSchemas.countTraces),
|
|
186
|
+
handler: async (args, context) => {
|
|
187
|
+
const { filters } = parseTraceInput("countTraces", traceStoreInputSchemas.countTraces, args ?? {});
|
|
188
|
+
return store.countTraces(filters, context);
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
namespace: TRACE_ANALYST_TOOL_NAMESPACE,
|
|
193
|
+
name: "viewTrace",
|
|
194
|
+
description: "Return all spans for one trace with bounded attributes. Oversized responses carry an oversized summary instead of spans; continue with searchTrace or viewSpans.",
|
|
195
|
+
parameters: toTraceJsonSchema(traceStoreInputSchemas.viewTrace.omit({ per_attribute_byte_cap: true })),
|
|
196
|
+
handler: async (args, context) => {
|
|
197
|
+
const input = parseTraceInput("viewTrace", traceStoreInputSchemas.viewTrace.omit({ per_attribute_byte_cap: true }), args);
|
|
198
|
+
return store.viewTrace(input, context);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
namespace: TRACE_ANALYST_TOOL_NAMESPACE,
|
|
203
|
+
name: "viewSpans",
|
|
204
|
+
description: `Read 1..${TRACE_ANALYSIS_LIMITS.viewSpans} specific spans. Every requested id is accounted for in spans, missing_span_ids, or omitted_span_ids; retry omitted ids.`,
|
|
205
|
+
parameters: toTraceJsonSchema(traceStoreInputSchemas.viewSpans.omit({ per_attribute_byte_cap: true })),
|
|
206
|
+
handler: async (args, context) => {
|
|
207
|
+
const input = parseTraceInput("viewSpans", traceStoreInputSchemas.viewSpans.omit({ per_attribute_byte_cap: true }), args);
|
|
208
|
+
return store.viewSpans(input, context);
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
namespace: TRACE_ANALYST_TOOL_NAMESPACE,
|
|
213
|
+
name: "searchTrace",
|
|
214
|
+
description: `Regex search across one trace, bounded to ${TRACE_ANALYSIS_LIMITS.searchMatches} hits. When has_more is true, refine the regex instead of treating the result as complete.`,
|
|
215
|
+
parameters: toTraceJsonSchema(traceStoreInputSchemas.searchTrace),
|
|
216
|
+
handler: async (args, context) => {
|
|
217
|
+
const input = parseTraceInput("searchTrace", traceStoreInputSchemas.searchTrace, args);
|
|
218
|
+
return store.searchTrace(input, context);
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
namespace: TRACE_ANALYST_TOOL_NAMESPACE,
|
|
223
|
+
name: "searchSpan",
|
|
224
|
+
description: `Regex search inside one span, bounded to ${TRACE_ANALYSIS_LIMITS.searchMatches} hits. Use after viewSpans omits or truncates a large span payload.`,
|
|
225
|
+
parameters: toTraceJsonSchema(traceStoreInputSchemas.searchSpan),
|
|
226
|
+
handler: async (args, context) => {
|
|
227
|
+
const input = parseTraceInput("searchSpan", traceStoreInputSchemas.searchSpan, args);
|
|
228
|
+
return store.searchSpan(input, context);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
];
|
|
232
|
+
}
|
|
233
|
+
/** Adapt the canonical descriptors into Ax functions used by the built-in analyst. */
|
|
234
|
+
function buildTraceAnalystTools(options) {
|
|
235
|
+
return buildTraceAnalysisToolDescriptors(options).map((descriptor) => ({
|
|
236
|
+
namespace: descriptor.namespace,
|
|
237
|
+
name: descriptor.name,
|
|
238
|
+
description: descriptor.description,
|
|
239
|
+
parameters: descriptor.parameters,
|
|
240
|
+
func: (args, extra) => descriptor.handler(args, extra?.abortSignal ? { signal: extra.abortSignal } : void 0)
|
|
241
|
+
}));
|
|
242
|
+
}
|
|
243
|
+
function traceAnalystFunctionGroup(options) {
|
|
244
|
+
return {
|
|
245
|
+
namespace: TRACE_ANALYST_TOOL_NAMESPACE,
|
|
246
|
+
title: "Trace Analysis",
|
|
247
|
+
selectionCriteria: "Use for any inspection of OTLP-shaped trace data.",
|
|
248
|
+
description: "Discovery, narrowing, and bounded deep reads over a JSONL trace dataset. Always call getDatasetOverview first.",
|
|
249
|
+
functions: buildTraceAnalystTools(options)
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
//#endregion
|
|
253
|
+
export { runTraceAnalysisLoop as a, traceAnalystFunctionGroup as i, buildTraceAnalysisToolDescriptors as n, buildTraceAnalystTools as r, TRACE_ANALYST_TOOL_NAMESPACE as t };
|
|
254
|
+
|
|
255
|
+
//# sourceMappingURL=tools-DZGdROtG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools-DZGdROtG.js","names":[],"sources":["../src/trace-analyst/loop.ts","../src/trace-analyst/tools.ts"],"sourcesContent":["import {\n type AxAgentActorTurnCallback,\n type AxAIService,\n type AxFunction,\n AxJSRuntime,\n agent,\n} from '@ax-llm/ax'\nimport { TraceFileMissingError } from './store-otlp'\n\nconst TRACE_ANALYSIS_TOOL_INSTRUCTION = `Gather the evidence needed for the report with the trace tools.\nWhen the evidence is sufficient, call final(task, evidence) and let the response stage produce the declared report and findings fields.`\n\nconst TRACE_ANALYSIS_CONTEXT_INSTRUCTION = `The complete bounded trace data is available as inputs.context.\nInspect it in the runtime, then call respond(task, evidence) and let the response stage produce the declared report and findings fields.`\n\nconst TRACE_ANALYSIS_RESPONDER_INSTRUCTION = `Use only evidence produced by the analysis stage.\nDo not invent trace ids, span ids, steps, tool results, or final verification outcomes.`\n\nexport interface TraceAnalysisLoopResult<TFinding> {\n report: string\n findings: TFinding[]\n usage: {\n actor: readonly unknown[]\n responder: readonly unknown[]\n }\n chatLog: {\n actor: readonly unknown[]\n responder: readonly unknown[]\n }\n turnCount: number\n}\n\nexport class TraceAnalysisTurnLimitError extends Error {\n readonly analystId: string\n readonly stage: 'distiller' | 'executor'\n readonly maxTurns: number\n\n constructor(analystId: string, stage: 'distiller' | 'executor', maxTurns: number) {\n super(\n `Trace analyst '${analystId}' reached maxTurns=${maxTurns} in the ${stage} stage without explicit completion`,\n )\n this.name = 'TraceAnalysisTurnLimitError'\n this.analystId = analystId\n this.stage = stage\n this.maxTurns = maxTurns\n }\n}\n\ninterface TraceAnalysisLoopOptions {\n id: string\n description: string\n prompt: string\n question: string\n context?: string\n ai: AxAIService\n model?: string\n tools: readonly AxFunction[]\n maxSubqueries: number\n maxParallelSubqueries: number\n maxTurns: number\n maxRuntimeChars: number\n signal?: AbortSignal\n onTurn?: AxAgentActorTurnCallback\n}\n\nexport function runTraceAnalysisLoop(\n options: TraceAnalysisLoopOptions & { findingType: 'string' },\n): Promise<TraceAnalysisLoopResult<string>>\nexport function runTraceAnalysisLoop(\n options: TraceAnalysisLoopOptions & { findingType: 'object' },\n): Promise<TraceAnalysisLoopResult<unknown>>\nexport async function runTraceAnalysisLoop(\n options: TraceAnalysisLoopOptions & { findingType: 'string' | 'object' },\n): Promise<TraceAnalysisLoopResult<unknown>> {\n validateLoopLimits(options)\n\n let turnCount = 0\n const completedStages = new Set<'distiller' | 'executor'>()\n const onTurn: AxAgentActorTurnCallback = async (turn) => {\n if (turn.stage === 'executor') turnCount = Math.max(turnCount, turn.turn)\n if (isExplicitCompletionTurn(turn)) completedStages.add(turn.stage)\n await options.onTurn?.(turn)\n if (turn.turn >= options.maxTurns && !completedStages.has(turn.stage)) {\n throw new TraceAnalysisTurnLimitError(options.id, turn.stage, options.maxTurns)\n }\n }\n const hasPreparedContext = options.context !== undefined\n const config = {\n agentIdentity: { name: options.id, description: options.description },\n contextFields: hasPreparedContext ? (['context'] as const) : ([] as const),\n runtime: new AxJSRuntime({\n permissions: [],\n blockDynamicImport: true,\n allowedModules: [],\n freezeIntrinsics: true,\n blockShadowRealm: true,\n preventGlobalThisExtensions: false,\n }),\n maxSubAgentCalls: options.maxSubqueries,\n maxTurns: options.maxTurns,\n maxRuntimeChars: options.maxRuntimeChars,\n maxBatchedLlmQueryConcurrency: options.maxParallelSubqueries,\n promptLevel: 'detailed' as const,\n contextPolicy: { preset: 'full' as const, budget: 'balanced' as const },\n directResponse:\n hasPreparedContext && options.tools.length === 0 ? ('auto' as const) : ('off' as const),\n functions: options.tools,\n executorOptions: {\n description: `${options.prompt.trim()}\\n\\n${\n hasPreparedContext ? TRACE_ANALYSIS_CONTEXT_INSTRUCTION : TRACE_ANALYSIS_TOOL_INSTRUCTION\n }`,\n ...(options.model ? { model: options.model } : {}),\n showThoughts: false,\n thinkingTokenBudget: 'none' as const,\n },\n responderOptions: {\n description: `${TRACE_ANALYSIS_RESPONDER_INSTRUCTION}\\n\\n${options.prompt.trim()}`,\n ...(options.model ? { model: options.model } : {}),\n showThoughts: false,\n thinkingTokenBudget: 'none' as const,\n },\n actorTurnCallback: onTurn,\n bubbleErrors: [TraceFileMissingError],\n }\n const analyst = hasPreparedContext\n ? options.findingType === 'string'\n ? agent('context:string, question:string -> report:string, findings:string[]', config)\n : agent('context:string, question:string -> report:string, findings:json[]', config)\n : options.findingType === 'string'\n ? agent('question:string -> report:string, findings:string[]', config)\n : agent('question:string -> report:string, findings:json[]', config)\n\n const output = hasPreparedContext\n ? await analyst.forward(\n options.ai,\n { context: options.context!, question: options.question } as never,\n options.signal ? { abortSignal: options.signal } : undefined,\n )\n : await analyst.forward(\n options.ai,\n { question: options.question },\n options.signal ? { abortSignal: options.signal } : undefined,\n )\n assertStageDidNotExhaust(\n options.id,\n 'distiller',\n options.maxTurns,\n analyst.distiller?.getState()?.actionLogEntries,\n )\n assertStageDidNotExhaust(\n options.id,\n 'executor',\n options.maxTurns,\n analyst.executor?.getState()?.actionLogEntries,\n )\n const completed =\n options.findingType === 'string'\n ? readTraceAnalysisOutput(output, 'string')\n : readTraceAnalysisOutput(output, 'object')\n const usage = analyst.getUsage()\n const chatLog = splitChatLog(analyst.getChatLog())\n\n return {\n ...completed,\n usage: {\n actor: usage.actor,\n responder: usage.responder,\n },\n chatLog,\n turnCount,\n }\n}\n\nfunction isExplicitCompletionTurn(turn: Parameters<AxAgentActorTurnCallback>[0]): boolean {\n return !turn.isError && isExplicitCompletionCode(turn.code)\n}\n\nfunction isExplicitCompletionCode(code: string): boolean {\n const executable = trimLeadingComments(code)\n return /^(?:await\\s+)?(?:final|respond|askClarification)\\s*\\(/.test(executable)\n}\n\nfunction assertStageDidNotExhaust(\n analystId: string,\n stage: 'distiller' | 'executor',\n maxTurns: number,\n entries:\n | readonly {\n code: string\n tags: readonly string[]\n }[]\n | undefined,\n): void {\n if (!entries || entries.length < maxTurns) return\n const last = entries.at(-1)\n if (last && !last.tags.includes('error') && isExplicitCompletionCode(last.code)) return\n throw new TraceAnalysisTurnLimitError(analystId, stage, maxTurns)\n}\n\nfunction trimLeadingComments(code: string): string {\n let remaining = code.trimStart()\n while (remaining.startsWith('//') || remaining.startsWith('/*')) {\n if (remaining.startsWith('//')) {\n const lineEnd = remaining.indexOf('\\n')\n if (lineEnd === -1) return ''\n remaining = remaining.slice(lineEnd + 1).trimStart()\n continue\n }\n const commentEnd = remaining.indexOf('*/', 2)\n if (commentEnd === -1) return ''\n remaining = remaining.slice(commentEnd + 2).trimStart()\n }\n return remaining\n}\n\nfunction splitChatLog(entries: readonly unknown[]): {\n actor: readonly unknown[]\n responder: readonly unknown[]\n} {\n const actor: unknown[] = []\n const responder: unknown[] = []\n for (const entry of entries) {\n const name =\n entry && typeof entry === 'object' && 'name' in entry\n ? (entry as { name?: unknown }).name\n : undefined\n if (typeof name === 'string' && (name === 'responder' || name.endsWith('.responder'))) {\n responder.push(entry)\n } else {\n actor.push(entry)\n }\n }\n return { actor, responder }\n}\n\ninterface CompletedTraceAnalysis<TFinding> {\n report: string\n findings: TFinding[]\n}\n\nexport function readTraceAnalysisOutput(\n value: unknown,\n findingType: 'string',\n): CompletedTraceAnalysis<string>\nexport function readTraceAnalysisOutput(\n value: unknown,\n findingType: 'object',\n): CompletedTraceAnalysis<unknown>\nexport function readTraceAnalysisOutput(\n value: unknown,\n findingType: 'string' | 'object',\n): CompletedTraceAnalysis<unknown> {\n if (!value || typeof value !== 'object') {\n throw new Error('Trace analyst response must contain report and findings')\n }\n const { report, findings } = value as { report?: unknown; findings?: unknown }\n if (typeof report !== 'string' || !Array.isArray(findings)) {\n throw new Error('Trace analyst response must contain report and findings')\n }\n if (findingType === 'string') {\n if (findings.some((finding) => typeof finding !== 'string')) {\n throw new Error('Trace analyst response must contain string findings')\n }\n return { report, findings: findings as string[] }\n }\n return { report, findings }\n}\n\nfunction validateLoopLimits(options: TraceAnalysisLoopOptions): void {\n if (!Number.isSafeInteger(options.maxSubqueries) || options.maxSubqueries < 0) {\n throw new TypeError('maxSubqueries must be a non-negative integer')\n }\n if (!Number.isSafeInteger(options.maxParallelSubqueries) || options.maxParallelSubqueries < 1) {\n throw new TypeError('maxParallelSubqueries must be a positive integer')\n }\n}\n","/**\n * Canonical transport-neutral trace tools plus the Ax adapter used by the\n * built-in analyst. Schemas and handlers originate here; provider adapters\n * only translate descriptor fields and cancellation context.\n */\n\nimport type { AxFunction } from '@ax-llm/ax'\n\nimport type { EvalToolDef } from '../eval-tools'\nimport {\n type BoundedTraceAnalysisStoreOptions,\n createBoundedTraceAnalysisStore,\n TRACE_ANALYSIS_LIMITS,\n type TraceAnalysisStore,\n} from './store'\nimport { parseTraceInput, toTraceJsonSchema, traceStoreInputSchemas } from './store-schemas'\n\nexport const TRACE_ANALYST_TOOL_NAMESPACE = 'traces' as const\n\nexport interface BuildTraceAnalysisToolsOptions extends BoundedTraceAnalysisStoreOptions {\n store: TraceAnalysisStore\n}\n\nexport interface TraceAnalysisToolDescriptor extends EvalToolDef {\n namespace: typeof TRACE_ANALYST_TOOL_NAMESPACE\n}\n\n/** Bind all seven trace reads without exposing an agent framework type. */\nexport function buildTraceAnalysisToolDescriptors(\n options: BuildTraceAnalysisToolsOptions,\n): TraceAnalysisToolDescriptor[] {\n const store = createBoundedTraceAnalysisStore(options.store, { budgets: options.budgets })\n\n return [\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'getDatasetOverview',\n description:\n 'Dataset rollup: total traces, raw_jsonl_bytes, services, agents, models, tools, ' +\n 'and sample_trace_ids. Always call this first without a regex_pattern.',\n parameters: toTraceJsonSchema(traceStoreInputSchemas.getOverview),\n handler: async (args, context) => {\n const { filters } = parseTraceInput(\n 'getDatasetOverview',\n traceStoreInputSchemas.getOverview,\n args ?? {},\n )\n return store.getOverview(filters, context)\n },\n },\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'queryTraces',\n description:\n `Paginated trace summaries, at most ${TRACE_ANALYSIS_LIMITS.queryTraces} per call. ` +\n 'Each summary carries raw_jsonl_bytes; narrow with indexed filters before regex_pattern.',\n parameters: toTraceJsonSchema(traceStoreInputSchemas.queryTraces),\n handler: async (args, context) => {\n const input = parseTraceInput('queryTraces', traceStoreInputSchemas.queryTraces, args)\n return store.queryTraces(input, context)\n },\n },\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'countTraces',\n description:\n 'Count traces matching filters. Use as a cheap pre-flight before a regex_pattern scan.',\n parameters: toTraceJsonSchema(traceStoreInputSchemas.countTraces),\n handler: async (args, context) => {\n const { filters } = parseTraceInput(\n 'countTraces',\n traceStoreInputSchemas.countTraces,\n args ?? {},\n )\n return store.countTraces(filters, context)\n },\n },\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'viewTrace',\n description:\n 'Return all spans for one trace with bounded attributes. Oversized responses carry ' +\n 'an oversized summary instead of spans; continue with searchTrace or viewSpans.',\n parameters: toTraceJsonSchema(\n traceStoreInputSchemas.viewTrace.omit({\n per_attribute_byte_cap: true,\n }),\n ),\n handler: async (args, context) => {\n const input = parseTraceInput(\n 'viewTrace',\n traceStoreInputSchemas.viewTrace.omit({ per_attribute_byte_cap: true }),\n args,\n )\n return store.viewTrace(input, context)\n },\n },\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'viewSpans',\n description:\n `Read 1..${TRACE_ANALYSIS_LIMITS.viewSpans} specific spans. Every requested id is ` +\n 'accounted for in spans, missing_span_ids, or omitted_span_ids; retry omitted ids.',\n parameters: toTraceJsonSchema(\n traceStoreInputSchemas.viewSpans.omit({\n per_attribute_byte_cap: true,\n }),\n ),\n handler: async (args, context) => {\n const input = parseTraceInput(\n 'viewSpans',\n traceStoreInputSchemas.viewSpans.omit({ per_attribute_byte_cap: true }),\n args,\n )\n return store.viewSpans(input, context)\n },\n },\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'searchTrace',\n description:\n `Regex search across one trace, bounded to ${TRACE_ANALYSIS_LIMITS.searchMatches} hits. ` +\n 'When has_more is true, refine the regex instead of treating the result as complete.',\n parameters: toTraceJsonSchema(traceStoreInputSchemas.searchTrace),\n handler: async (args, context) => {\n const input = parseTraceInput('searchTrace', traceStoreInputSchemas.searchTrace, args)\n return store.searchTrace(input, context)\n },\n },\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'searchSpan',\n description:\n `Regex search inside one span, bounded to ${TRACE_ANALYSIS_LIMITS.searchMatches} hits. ` +\n 'Use after viewSpans omits or truncates a large span payload.',\n parameters: toTraceJsonSchema(traceStoreInputSchemas.searchSpan),\n handler: async (args, context) => {\n const input = parseTraceInput('searchSpan', traceStoreInputSchemas.searchSpan, args)\n return store.searchSpan(input, context)\n },\n },\n ]\n}\n\n/** Adapt the canonical descriptors into Ax functions used by the built-in analyst. */\nexport function buildTraceAnalystTools(options: BuildTraceAnalysisToolsOptions): AxFunction[] {\n return buildTraceAnalysisToolDescriptors(options).map((descriptor) => ({\n namespace: descriptor.namespace,\n name: descriptor.name,\n description: descriptor.description,\n parameters: descriptor.parameters as AxFunction['parameters'],\n func: (args, extra) =>\n descriptor.handler(args, extra?.abortSignal ? { signal: extra.abortSignal } : undefined),\n }))\n}\n\nexport function traceAnalystFunctionGroup(options: BuildTraceAnalysisToolsOptions): {\n namespace: string\n title: string\n selectionCriteria: string\n description: string\n functions: AxFunction[]\n} {\n return {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n title: 'Trace Analysis',\n selectionCriteria: 'Use for any inspection of OTLP-shaped trace data.',\n description:\n 'Discovery, narrowing, and bounded deep reads over a JSONL trace dataset. ' +\n 'Always call getDatasetOverview first.',\n functions: buildTraceAnalystTools(options),\n }\n}\n"],"mappings":"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"}
|
package/dist/traces.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { C as TraceEvent, D as isSandboxSpan, E as isRetrievalSpan, O as isToolSpan, S as ToolSpan, T as isLlmSpan, _ as Span, a as FAILURE_CLASSES, b as SpanStatus, c as JudgeSpan, d as RetrievalSpan, f as Run, g as SandboxSpan, h as RunStatus, i as EventKind, l as LlmSpan, m as RunOutcome, n as BudgetLedgerEntry, o as FailureClass, p as RunLayer, r as BudgetSpec, s as GenericSpan, t as Artifact, u as Message, v as SpanBase, w as isJudgeSpan, x as TRACE_SCHEMA_VERSION, y as SpanKind } from "./schema-BtVldJ3T.js";
|
|
2
|
-
import { a as ExtractedUsage, c as extractUsageFromResponse, i as ExtractUsageFromSseOptions, l as extractUsageFromSse, n as CaptureFetchOptions, o as SseUsageMode, r as captureFetchToRawSink, s as extractUsage, t as CaptureFetchContext } from "./index-
|
|
3
|
-
import {
|
|
2
|
+
import { a as ExtractedUsage, c as extractUsageFromResponse, i as ExtractUsageFromSseOptions, l as extractUsageFromSse, n as CaptureFetchOptions, o as SseUsageMode, r as captureFetchToRawSink, s as extractUsage, t as CaptureFetchContext } from "./index-sMN_hI4E.js";
|
|
3
|
+
import { _t as RawProviderSink, bt as providerFromBaseUrl, dt as InMemoryRawProviderSink, ft as InMemoryRawProviderSinkOptions, gt as RawProviderEvent, ht as RawProviderDirection, lt as FileSystemRawProviderSink, mt as ProviderRedactor, pt as NoopRawProviderSink, ut as FileSystemRawProviderSinkOptions, vt as RawProviderSinkFilter, yt as defaultProviderRedactor } from "./types-5q2T25iW.js";
|
|
4
4
|
import { a as RunFilter, i as InMemoryTraceStore, n as FileSystemTraceStore, o as SpanFilter, r as FileSystemTraceStoreOptions, s as TraceStore, t as EventFilter } from "./store-CT9YIIve.js";
|
|
5
5
|
import { a as TraceEmitterOptions, i as TraceEmitter, n as RunCompleteHookContext, o as llmSpanFromProvider, r as SpanHandle, t as RunCompleteHook } from "./emitter-DGQGoLyj.js";
|
|
6
|
-
import { a as RunIntegrityReport, i as RunIntegrityIssueCode, n as RunIntegrityExpectations, o as assertRunCaptured, r as RunIntegrityIssue, s as throwIfRunIncomplete, t as RunIntegrityError } from "./integrity-
|
|
7
|
-
import { $ as
|
|
6
|
+
import { a as RunIntegrityReport, i as RunIntegrityIssueCode, n as RunIntegrityExpectations, o as assertRunCaptured, r as RunIntegrityIssue, s as throwIfRunIncomplete, t as RunIntegrityError } from "./integrity-B-MLFz0I.js";
|
|
7
|
+
import { $ as buildTraceInsightContext, A as otlpRowsToTraceRunRecords, At as RedactionReport, B as stringField, Bt as OtlpSpanRole, C as otlpTextToTraceAnalysisStore, Ct as createBoundedTraceAnalysisStore, D as OtlpTraceRunRecord, Dt as convertTraceStoresToOtlp, E as OtlpToRunRecordsOptions, Et as TracesToOtlpResult, F as extractOtlpAttributes, Ft as otelRunCompleteHook, G as TraceInsightFinding, Gt as isOtlpModelCall, H as flattenOtlpExportToNdjson, Ht as ToolSpanOtlpInput, I as firstStringAttr, It as ExportableSpan, J as TraceInsightQualityGate, Jt as OtlpExport, K as TraceInsightPanelRole, Kt as traceSpanKindToOpenInferenceKind, L as inferOtlpKind, Lt as OtelExportConfig, M as otlpToTraceRunRecords, Mt as redactString, N as ProjectedOtlpSpan, Nt as redactValue, O as TraceAggregate, Ot as DEFAULT_REDACTION_RULES, P as asString, Pt as createOtelTracingStore, Q as TraceInsightTask, R as projectOtlpFlatLine, Rt as OtelExporter, S as ToolSpansToTraceAnalysisStoreOptions, St as analyzeTraces, T as TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, Tt as TraceStoreToOtlpOptions, U as OtlpFlatLine, Ut as applyToolSpanOtlpAttributes, V as FlattenOtlpOptions, Vt as OtlpSpanRoleInput, W as TraceInsightContext, Wt as classifyOtlpSpanRole, X as TraceInsightReadiness, Xt as OtlpSpan, Y as TraceInsightQuestion, Yt as OtlpResourceSpans, Z as TraceInsightSuite, Zt as exportRunAsOtlp, _t as TraceNotFoundError, a as ReplayFetchOptions, at as planTraceInsightQuestions, b as OtlpFileTraceStore, bt as AnalyzeTracesResult, c as BuildTraceAnalysisToolsOptions, ct as TraceAnalystHookOptions, d as buildTraceAnalysisToolDescriptors, dt as TraceAnalysisLimitError, et as buildTraceInsightPrompt, f as buildTraceAnalystTools, ft as TraceAnalysisStoreContractError, gt as TraceFileTooLargeError, ht as TraceFileMissingError, i as ReplayCacheStats, it as inferDomainKeywords, j as otlpToRunRecords, jt as RedactionRule, k as otlpRowsToRunRecords, kt as REDACTION_VERSION, l as TRACE_ANALYST_TOOL_NAMESPACE, lt as traceAnalystOnRunComplete, mt as TraceFileMalformedError, n as ReplayCacheEntry, nt as describeTraceInsightScope, o as createReplayFetch, ot as scoreTraceInsightReadiness, p as traceAnalystFunctionGroup, pt as TraceAnalysisValidationError, q as TraceInsightPromptInput, qt as OTEL_AGENT_EVAL_SCOPE, r as ReplayCacheMissError, rt as domainEvidencePattern, s as iterateRawCalls, st as tokenizeDomainWords, t as ReplayCache, tt as defaultTraceInsightPanel, u as TraceAnalysisToolDescriptor, ut as SpanNotFoundError, v as ToolTraceMissingError, vt as AnalyzeTracesInput, w as TRACE_ANALYST_ACTOR_DESCRIPTION, wt as TraceStoreSource, x as OtlpFileTraceStoreOptions, xt as AnalyzeTracesTurnSnapshot, y as toolSpansToTraceAnalysisStore, yt as AnalyzeTracesOptions, z as readOtlpStatus, zt as createOtelExporter } from "./replay-DbIYwso6.js";
|
|
8
8
|
import { C as TOOL_LATENCY_MS, D as asNumber, E as applyLlmSpanOtlpAttributes, O as contextInputTokens, S as TOOL_ARGS_CAPTURED, T as TOOL_NAME_ATTR_KEYS, _ as LlmSpanOtlpInput, a as LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, b as RUN_COST_ATTR_KEYS, c as LLM_COST_USD, d as LLM_MODEL_ATTR_KEYS, f as LLM_MODEL_NAME, g as LLM_REASONING_TOKEN_ATTR_KEYS, h as LLM_REASONING_TOKENS, i as LLM_CACHE_WRITE_TOKENS, k as firstNumberAttr, l as LLM_INPUT_TOKENS, m as LLM_OUTPUT_TOKEN_ATTR_KEYS, n as LLM_CACHED_TOKENS, o as LLM_CONTEXT_TOKENS, p as LLM_OUTPUT_TOKENS, r as LLM_CACHED_TOKEN_ATTR_KEYS, s as LLM_COST_ATTR_KEYS, t as INPUT_VALUE, u as LLM_INPUT_TOKEN_ATTR_KEYS, v as OPENINFERENCE_SPAN_KIND, w as TOOL_NAME, x as SPAN_KIND_ATTR_KEYS, y as OUTPUT_VALUE } from "./attribute-vocabulary-DLJ6303h.js";
|
|
9
9
|
import { a as judgeSpans, c as runsForScenario, i as hasCapturedToolArgs, l as toolSpans, n as argHash, o as llmSpans, r as groupBy, s as runFailureClass, t as aggregateLlm } from "./query-CJ_DX8vl.js";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
export { type AnalyzeTracesInput, type AnalyzeTracesOptions, type AnalyzeTracesResult, type AnalyzeTracesTurnSnapshot, Artifact, BudgetLedgerEntry, BudgetSpec, CaptureFetchContext, CaptureFetchOptions, DEFAULT_REDACTION_RULES, DEFAULT_TRACE_ANALYST_BUDGETS, type DatasetOverview, type ErrorCluster, EventFilter, EventKind, ExportableSpan, ExtractUsageFromSseOptions, ExtractedUsage, FAILURE_CLASSES, FailureClass, FileSystemRawProviderSink, FileSystemRawProviderSinkOptions, FileSystemTraceStore, FileSystemTraceStoreOptions, type FlattenOtlpOptions, GenericSpan, INPUT_VALUE, InMemoryRawProviderSink, InMemoryRawProviderSinkOptions, InMemoryTraceStore, JudgeSpan, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, LlmSpan, LlmSpanOtlpInput, Message, NoopRawProviderSink, OPENINFERENCE_SPAN_KIND, OTEL_AGENT_EVAL_SCOPE, OUTPUT_VALUE, OtelExportConfig, OtelExporter, OtlpExport, OtlpFileTraceStore, type OtlpFileTraceStoreOptions, type OtlpFlatLine, OtlpResourceSpans, OtlpSpan, OtlpSpanRole, OtlpSpanRoleInput, type OtlpToRunRecordsOptions, type OtlpTraceRunRecord, type ProjectedOtlpSpan, ProviderRedactor, type QueryTracesPage, REDACTION_VERSION, RUN_COST_ATTR_KEYS, RawProviderDirection, RawProviderEvent, RawProviderSink, RawProviderSinkFilter, RedactionReport, RedactionRule, ReplayCache, ReplayCacheEntry, ReplayCacheMissError, ReplayCacheStats, ReplayFetchOptions, RetrievalSpan, Run, RunCompleteHook, RunCompleteHookContext, RunFilter, RunIntegrityError, RunIntegrityExpectations, RunIntegrityIssue, RunIntegrityIssueCode, RunIntegrityReport, RunLayer, RunOutcome, RunStatus, SPAN_KIND_ATTR_KEYS, SandboxSpan, type SearchSpanResult, type SearchTraceResult, Span, SpanBase, SpanFilter, SpanHandle, SpanKind, type SpanMatchRecord, SpanNotFoundError, SpanStatus, SseUsageMode, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, TRACE_ANALYST_ACTOR_DESCRIPTION, TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, TRACE_SCHEMA_VERSION, ToolSpan, ToolSpanOtlpInput, type ToolSpansToTraceAnalysisStoreOptions, ToolTraceMissingError, type TraceAggregate, type TraceAnalysisStore, type TraceAnalystByteBudgets, type TraceAnalystFilters, type TraceAnalystHookOptions, type TraceAnalystSpan, type TraceAnalystSpanKind, type TraceAnalystSpanStatus, type TraceAnalystTraceSummary, TraceEmitter, TraceEmitterOptions, TraceEvent, TraceFileMissingError, type TraceInsightContext, type TraceInsightFinding, type TraceInsightPanelRole, type TraceInsightPromptInput, type TraceInsightQualityGate, type TraceInsightQuestion, type TraceInsightReadiness, type TraceInsightSuite, type TraceInsightTask, TraceNotFoundError, TraceStore, TraceStoreSource, TraceStoreToOtlpOptions, TracesToOtlpResult, type ViewSpansResult, type ViewTraceOversized, type ViewTraceResult, aggregateLlm, analyzeTraces, applyLlmSpanOtlpAttributes, applyToolSpanOtlpAttributes, argHash, asNumber, asString, assertRunCaptured, buildTraceAnalystTools, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, classifyOtlpSpanRole, contextInputTokens, convertTraceStoresToOtlp, createOtelExporter, createOtelTracingStore, createReplayFetch, defaultProviderRedactor, defaultTraceInsightPanel, describeTraceInsightScope, domainEvidencePattern, exportRunAsOtlp, extractOtlpAttributes, extractUsage, extractUsageFromResponse, extractUsageFromSse, firstNumberAttr, firstStringAttr, flattenOtlpExportToNdjson, groupBy, hasCapturedToolArgs, inferDomainKeywords, inferOtlpKind, isJudgeSpan, isLlmSpan, isOtlpModelCall, isRetrievalSpan, isSandboxSpan, isToolSpan, iterateRawCalls, judgeSpans, llmSpanFromProvider, llmSpans, otelRunCompleteHook, otlpRowsToRunRecords, otlpRowsToTraceRunRecords, otlpToRunRecords, otlpToTraceRunRecords, planTraceInsightQuestions, projectOtlpFlatLine, providerFromBaseUrl, readOtlpStatus, redactString, redactValue, runFailureClass, runsForScenario, scoreTraceInsightReadiness, stringField, throwIfRunIncomplete, tokenizeDomainWords, toolSpans, toolSpansToTraceAnalysisStore, traceAnalystFunctionGroup, traceAnalystOnRunComplete, traceSpanKindToOpenInferenceKind };
|
|
10
|
+
import { A as TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, C as DEFAULT_TRACE_ANALYST_BUDGETS, D as SearchSpanResult, E as QueryTracesPage, F as TraceAnalystSpanStatus, I as TraceAnalystTraceSummary, L as ViewSpansResult, M as TraceAnalystFilters, N as TraceAnalystSpan, O as SearchTraceResult, P as TraceAnalystSpanKind, R as ViewTraceOversized, S as TraceAnalysisStoreContext, T as ErrorCluster, b as TRACE_ANALYSIS_LIMITS, j as TraceAnalystByteBudgets, k as SpanMatchRecord, w as DatasetOverview, x as TraceAnalysisStore, y as BoundedTraceAnalysisStoreOptions, z as ViewTraceResult } from "./types-BtJhn8v6.js";
|
|
11
|
+
export { type AnalyzeTracesInput, type AnalyzeTracesOptions, type AnalyzeTracesResult, type AnalyzeTracesTurnSnapshot, Artifact, type BoundedTraceAnalysisStoreOptions, BudgetLedgerEntry, BudgetSpec, type BuildTraceAnalysisToolsOptions, CaptureFetchContext, CaptureFetchOptions, DEFAULT_REDACTION_RULES, DEFAULT_TRACE_ANALYST_BUDGETS, type DatasetOverview, type ErrorCluster, EventFilter, EventKind, ExportableSpan, ExtractUsageFromSseOptions, ExtractedUsage, FAILURE_CLASSES, FailureClass, FileSystemRawProviderSink, FileSystemRawProviderSinkOptions, FileSystemTraceStore, FileSystemTraceStoreOptions, type FlattenOtlpOptions, GenericSpan, INPUT_VALUE, InMemoryRawProviderSink, InMemoryRawProviderSinkOptions, InMemoryTraceStore, JudgeSpan, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, LlmSpan, LlmSpanOtlpInput, Message, NoopRawProviderSink, OPENINFERENCE_SPAN_KIND, OTEL_AGENT_EVAL_SCOPE, OUTPUT_VALUE, OtelExportConfig, OtelExporter, OtlpExport, OtlpFileTraceStore, type OtlpFileTraceStoreOptions, type OtlpFlatLine, OtlpResourceSpans, OtlpSpan, OtlpSpanRole, OtlpSpanRoleInput, type OtlpToRunRecordsOptions, type OtlpTraceRunRecord, type ProjectedOtlpSpan, ProviderRedactor, type QueryTracesPage, REDACTION_VERSION, RUN_COST_ATTR_KEYS, RawProviderDirection, RawProviderEvent, RawProviderSink, RawProviderSinkFilter, RedactionReport, RedactionRule, ReplayCache, ReplayCacheEntry, ReplayCacheMissError, ReplayCacheStats, ReplayFetchOptions, RetrievalSpan, Run, RunCompleteHook, RunCompleteHookContext, RunFilter, RunIntegrityError, RunIntegrityExpectations, RunIntegrityIssue, RunIntegrityIssueCode, RunIntegrityReport, RunLayer, RunOutcome, RunStatus, SPAN_KIND_ATTR_KEYS, SandboxSpan, type SearchSpanResult, type SearchTraceResult, Span, SpanBase, SpanFilter, SpanHandle, SpanKind, type SpanMatchRecord, SpanNotFoundError, SpanStatus, SseUsageMode, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, TRACE_ANALYSIS_LIMITS, TRACE_ANALYST_ACTOR_DESCRIPTION, TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, TRACE_ANALYST_TOOL_NAMESPACE, TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, TRACE_SCHEMA_VERSION, ToolSpan, ToolSpanOtlpInput, type ToolSpansToTraceAnalysisStoreOptions, ToolTraceMissingError, type TraceAggregate, TraceAnalysisLimitError, type TraceAnalysisStore, type TraceAnalysisStoreContext, TraceAnalysisStoreContractError, type TraceAnalysisToolDescriptor, TraceAnalysisValidationError, type TraceAnalystByteBudgets, type TraceAnalystFilters, type TraceAnalystHookOptions, type TraceAnalystSpan, type TraceAnalystSpanKind, type TraceAnalystSpanStatus, type TraceAnalystTraceSummary, TraceEmitter, TraceEmitterOptions, TraceEvent, TraceFileMalformedError, TraceFileMissingError, TraceFileTooLargeError, type TraceInsightContext, type TraceInsightFinding, type TraceInsightPanelRole, type TraceInsightPromptInput, type TraceInsightQualityGate, type TraceInsightQuestion, type TraceInsightReadiness, type TraceInsightSuite, type TraceInsightTask, TraceNotFoundError, TraceStore, TraceStoreSource, TraceStoreToOtlpOptions, TracesToOtlpResult, type ViewSpansResult, type ViewTraceOversized, type ViewTraceResult, aggregateLlm, analyzeTraces, applyLlmSpanOtlpAttributes, applyToolSpanOtlpAttributes, argHash, asNumber, asString, assertRunCaptured, buildTraceAnalysisToolDescriptors, buildTraceAnalystTools, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, classifyOtlpSpanRole, contextInputTokens, convertTraceStoresToOtlp, createBoundedTraceAnalysisStore, createOtelExporter, createOtelTracingStore, createReplayFetch, defaultProviderRedactor, defaultTraceInsightPanel, describeTraceInsightScope, domainEvidencePattern, exportRunAsOtlp, extractOtlpAttributes, extractUsage, extractUsageFromResponse, extractUsageFromSse, firstNumberAttr, firstStringAttr, flattenOtlpExportToNdjson, groupBy, hasCapturedToolArgs, inferDomainKeywords, inferOtlpKind, isJudgeSpan, isLlmSpan, isOtlpModelCall, isRetrievalSpan, isSandboxSpan, isToolSpan, iterateRawCalls, judgeSpans, llmSpanFromProvider, llmSpans, otelRunCompleteHook, otlpRowsToRunRecords, otlpRowsToTraceRunRecords, otlpTextToTraceAnalysisStore, otlpToRunRecords, otlpToTraceRunRecords, planTraceInsightQuestions, projectOtlpFlatLine, providerFromBaseUrl, readOtlpStatus, redactString, redactValue, runFailureClass, runsForScenario, scoreTraceInsightReadiness, stringField, throwIfRunIncomplete, tokenizeDomainWords, toolSpans, toolSpansToTraceAnalysisStore, traceAnalystFunctionGroup, traceAnalystOnRunComplete, traceSpanKindToOpenInferenceKind };
|
package/dist/traces.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { a as providerFromBaseUrl, i as defaultProviderRedactor, n as InMemoryRawProviderSink, r as NoopRawProviderSink, t as FileSystemRawProviderSink } from "./raw-provider-sink-BQd7mzyT.js";
|
|
2
2
|
import { INPUT_VALUE, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, OPENINFERENCE_SPAN_KIND, OUTPUT_VALUE, RUN_COST_ATTR_KEYS, SPAN_KIND_ATTR_KEYS, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, applyLlmSpanOtlpAttributes, asNumber, contextInputTokens, firstNumberAttr } from "./trace-attributes.js";
|
|
3
|
-
import { C as
|
|
3
|
+
import { A as classifyOtlpSpanRole, C as firstStringAttr, E as readOtlpStatus, M as traceSpanKindToOpenInferenceKind, O as stringField, S as extractOtlpAttributes, T as projectOtlpFlatLine, _ as TraceFileMissingError, a as createBoundedTraceAnalysisStore, b as asString, d as TRACE_ANALYSIS_LIMITS, f as SpanNotFoundError, g as TraceFileMalformedError, h as TraceAnalysisValidationError, i as otlpTextToTraceAnalysisStore, j as isOtlpModelCall, k as applyToolSpanOtlpAttributes, l as DEFAULT_TRACE_ANALYST_BUDGETS, m as TraceAnalysisStoreContractError, n as OtlpFileTraceStore, p as TraceAnalysisLimitError, u as TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, v as TraceFileTooLargeError, w as inferOtlpKind, y as TraceNotFoundError } from "./store-otlp-BenKynPE.js";
|
|
4
|
+
import { i as traceAnalystFunctionGroup, n as buildTraceAnalysisToolDescriptors, r as buildTraceAnalystTools, t as TRACE_ANALYST_TOOL_NAMESPACE } from "./tools-DZGdROtG.js";
|
|
4
5
|
import { n as llmSpanFromProvider, t as TraceEmitter } from "./emitter-CPBAhxum.js";
|
|
5
6
|
import { a as isRetrievalSpan, i as isLlmSpan, n as TRACE_SCHEMA_VERSION, o as isSandboxSpan, r as isJudgeSpan, s as isToolSpan, t as FAILURE_CLASSES } from "./schema-CRhEY1SO.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { n as extractUsageFromResponse, r as extractUsageFromSse, t as extractUsage } from "./extract-usage-DIQpN-ww.js";
|
|
7
|
+
import { A as TRACE_ANALYST_ACTOR_DESCRIPTION, C as domainEvidencePattern, D as tokenizeDomainWords, E as scoreTraceInsightReadiness, O as traceAnalystOnRunComplete, S as describeTraceInsightScope, T as planTraceInsightQuestions, _ as otlpToTraceRunRecords, a as convertTraceStoresToOtlp, b as buildTraceInsightPrompt, c as otelRunCompleteHook, d as captureFetchToRawSink, f as ToolTraceMissingError, g as otlpToRunRecords, h as otlpRowsToTraceRunRecords, i as iterateRawCalls, j as TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, k as analyzeTraces, l as OTEL_AGENT_EVAL_SCOPE, m as otlpRowsToRunRecords, n as ReplayCacheMissError, o as createOtelExporter, p as toolSpansToTraceAnalysisStore, r as createReplayFetch, s as createOtelTracingStore, t as ReplayCache, u as exportRunAsOtlp, v as flattenOtlpExportToNdjson, w as inferDomainKeywords, x as defaultTraceInsightPanel, y as buildTraceInsightContext } from "./replay-Cb-4Vf0k.js";
|
|
8
|
+
import { n as extractUsageFromResponse, r as extractUsageFromSse, t as extractUsage } from "./extract-usage-CS391dOE.js";
|
|
9
9
|
import { a as judgeSpans, c as runsForScenario, i as hasCapturedToolArgs, l as toolSpans, n as argHash, o as llmSpans, r as groupBy, s as runFailureClass, t as aggregateLlm } from "./query-Di7eEQ79.js";
|
|
10
|
-
import { a as InMemoryTraceStore, i as FileSystemTraceStore, n as assertRunCaptured, r as throwIfRunIncomplete, t as RunIntegrityError } from "./integrity-
|
|
10
|
+
import { a as InMemoryTraceStore, i as FileSystemTraceStore, n as assertRunCaptured, r as throwIfRunIncomplete, t as RunIntegrityError } from "./integrity-fdt8XPAv.js";
|
|
11
11
|
import { i as redactValue, n as REDACTION_VERSION, r as redactString, t as DEFAULT_REDACTION_RULES } from "./redact-7Aq1ukl-.js";
|
|
12
|
-
export { DEFAULT_REDACTION_RULES, DEFAULT_TRACE_ANALYST_BUDGETS, FAILURE_CLASSES, FileSystemRawProviderSink, FileSystemTraceStore, INPUT_VALUE, InMemoryRawProviderSink, InMemoryTraceStore, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, NoopRawProviderSink, OPENINFERENCE_SPAN_KIND, OTEL_AGENT_EVAL_SCOPE, OUTPUT_VALUE, OtlpFileTraceStore, REDACTION_VERSION, RUN_COST_ATTR_KEYS, ReplayCache, ReplayCacheMissError, RunIntegrityError, SPAN_KIND_ATTR_KEYS, SpanNotFoundError, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, TRACE_ANALYST_ACTOR_DESCRIPTION, TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, TRACE_SCHEMA_VERSION, ToolTraceMissingError, TraceEmitter, TraceFileMissingError, TraceNotFoundError, aggregateLlm, analyzeTraces, applyLlmSpanOtlpAttributes, applyToolSpanOtlpAttributes, argHash, asNumber, asString, assertRunCaptured, buildTraceAnalystTools, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, classifyOtlpSpanRole, contextInputTokens, convertTraceStoresToOtlp, createOtelExporter, createOtelTracingStore, createReplayFetch, defaultProviderRedactor, defaultTraceInsightPanel, describeTraceInsightScope, domainEvidencePattern, exportRunAsOtlp, extractOtlpAttributes, extractUsage, extractUsageFromResponse, extractUsageFromSse, firstNumberAttr, firstStringAttr, flattenOtlpExportToNdjson, groupBy, hasCapturedToolArgs, inferDomainKeywords, inferOtlpKind, isJudgeSpan, isLlmSpan, isOtlpModelCall, isRetrievalSpan, isSandboxSpan, isToolSpan, iterateRawCalls, judgeSpans, llmSpanFromProvider, llmSpans, otelRunCompleteHook, otlpRowsToRunRecords, otlpRowsToTraceRunRecords, otlpToRunRecords, otlpToTraceRunRecords, planTraceInsightQuestions, projectOtlpFlatLine, providerFromBaseUrl, readOtlpStatus, redactString, redactValue, runFailureClass, runsForScenario, scoreTraceInsightReadiness, stringField, throwIfRunIncomplete, tokenizeDomainWords, toolSpans, toolSpansToTraceAnalysisStore, traceAnalystFunctionGroup, traceAnalystOnRunComplete, traceSpanKindToOpenInferenceKind };
|
|
12
|
+
export { DEFAULT_REDACTION_RULES, DEFAULT_TRACE_ANALYST_BUDGETS, FAILURE_CLASSES, FileSystemRawProviderSink, FileSystemTraceStore, INPUT_VALUE, InMemoryRawProviderSink, InMemoryTraceStore, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, NoopRawProviderSink, OPENINFERENCE_SPAN_KIND, OTEL_AGENT_EVAL_SCOPE, OUTPUT_VALUE, OtlpFileTraceStore, REDACTION_VERSION, RUN_COST_ATTR_KEYS, ReplayCache, ReplayCacheMissError, RunIntegrityError, SPAN_KIND_ATTR_KEYS, SpanNotFoundError, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, TRACE_ANALYSIS_LIMITS, TRACE_ANALYST_ACTOR_DESCRIPTION, TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, TRACE_ANALYST_TOOL_NAMESPACE, TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, TRACE_SCHEMA_VERSION, ToolTraceMissingError, TraceAnalysisLimitError, TraceAnalysisStoreContractError, TraceAnalysisValidationError, TraceEmitter, TraceFileMalformedError, TraceFileMissingError, TraceFileTooLargeError, TraceNotFoundError, aggregateLlm, analyzeTraces, applyLlmSpanOtlpAttributes, applyToolSpanOtlpAttributes, argHash, asNumber, asString, assertRunCaptured, buildTraceAnalysisToolDescriptors, buildTraceAnalystTools, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, classifyOtlpSpanRole, contextInputTokens, convertTraceStoresToOtlp, createBoundedTraceAnalysisStore, createOtelExporter, createOtelTracingStore, createReplayFetch, defaultProviderRedactor, defaultTraceInsightPanel, describeTraceInsightScope, domainEvidencePattern, exportRunAsOtlp, extractOtlpAttributes, extractUsage, extractUsageFromResponse, extractUsageFromSse, firstNumberAttr, firstStringAttr, flattenOtlpExportToNdjson, groupBy, hasCapturedToolArgs, inferDomainKeywords, inferOtlpKind, isJudgeSpan, isLlmSpan, isOtlpModelCall, isRetrievalSpan, isSandboxSpan, isToolSpan, iterateRawCalls, judgeSpans, llmSpanFromProvider, llmSpans, otelRunCompleteHook, otlpRowsToRunRecords, otlpRowsToTraceRunRecords, otlpTextToTraceAnalysisStore, otlpToRunRecords, otlpToTraceRunRecords, planTraceInsightQuestions, projectOtlpFlatLine, providerFromBaseUrl, readOtlpStatus, redactString, redactValue, runFailureClass, runsForScenario, scoreTraceInsightReadiness, stringField, throwIfRunIncomplete, tokenizeDomainWords, toolSpans, toolSpansToTraceAnalysisStore, traceAnalystFunctionGroup, traceAnalystOnRunComplete, traceSpanKindToOpenInferenceKind };
|