@tangle-network/agent-eval 0.72.0 → 0.72.4

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 (69) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/adapters/http.d.ts +1 -1
  3. package/dist/adapters/langchain.d.ts +1 -1
  4. package/dist/adapters/otel.d.ts +3 -2
  5. package/dist/agent-profile-DYRboYWu.d.ts +364 -0
  6. package/dist/analyst/index.d.ts +221 -0
  7. package/dist/analyst/index.js +371 -0
  8. package/dist/analyst/index.js.map +1 -0
  9. package/dist/analyst-t7zZS3TV.d.ts +88 -0
  10. package/dist/campaign/index.d.ts +518 -9
  11. package/dist/campaign/index.js +672 -22
  12. package/dist/campaign/index.js.map +1 -1
  13. package/dist/chunk-7W4SM7FD.js +1075 -0
  14. package/dist/chunk-7W4SM7FD.js.map +1 -0
  15. package/dist/{chunk-AIWHLG7J.js → chunk-GJJNJVIR.js} +11 -11
  16. package/dist/chunk-JHA3ZGSO.js +1496 -0
  17. package/dist/chunk-JHA3ZGSO.js.map +1 -0
  18. package/dist/{chunk-4QJN7RDX.js → chunk-JYE3WOTE.js} +55 -7
  19. package/dist/{chunk-4QJN7RDX.js.map → chunk-JYE3WOTE.js.map} +1 -1
  20. package/dist/chunk-LB2UOI5F.js +412 -0
  21. package/dist/chunk-LB2UOI5F.js.map +1 -0
  22. package/dist/{chunk-ODGETRTM.js → chunk-VUINJM5M.js} +234 -1415
  23. package/dist/chunk-VUINJM5M.js.map +1 -0
  24. package/dist/chunk-WYIHD6EB.js +1044 -0
  25. package/dist/chunk-WYIHD6EB.js.map +1 -0
  26. package/dist/{chunk-UD6EF73X.js → chunk-XPILG2CA.js} +119 -2
  27. package/dist/chunk-XPILG2CA.js.map +1 -0
  28. package/dist/contract/index.d.ts +17 -13
  29. package/dist/contract/index.js +13 -7
  30. package/dist/contract/index.js.map +1 -1
  31. package/dist/{control-DxvZeV5X.d.ts → control-BgA6BYTm.d.ts} +1 -1
  32. package/dist/control.d.ts +2 -2
  33. package/dist/{feedback-trajectory-8hKC5EOb.d.ts → feedback-trajectory-B3rErRsh.d.ts} +1 -1
  34. package/dist/harness-optimizer-EnEnQPsr.d.ts +106 -0
  35. package/dist/hosted/index.d.ts +223 -2
  36. package/dist/index.d.ts +49 -1323
  37. package/dist/index.js +353 -2496
  38. package/dist/index.js.map +1 -1
  39. package/dist/{index-BGBrVS24.d.ts → insight-report-Df3lxYXM.d.ts} +1 -221
  40. package/dist/kind-factory-DW9XWPvM.d.ts +172 -0
  41. package/dist/multi-layer-verifier-DlWCXuxL.d.ts +141 -0
  42. package/dist/openapi.json +1 -1
  43. package/dist/pareto-E-pembql.d.ts +81 -0
  44. package/dist/{provenance-C69gLUXH.d.ts → provenance-B-TFszPW.d.ts} +131 -4
  45. package/dist/redact-B40YG2M_.d.ts +45 -0
  46. package/dist/registry-DuVYiTvw.d.ts +128 -0
  47. package/dist/{researcher-WJvIpX3L.d.ts → researcher-C_KJyIGg.d.ts} +1 -141
  48. package/dist/rl.d.ts +4 -3
  49. package/dist/rl.js +4 -4
  50. package/dist/run-critic-BAIjX99r.d.ts +56 -0
  51. package/dist/{run-improvement-loop-Bzamo6GB.d.ts → run-improvement-loop-BqYH2vCR.d.ts} +25 -1
  52. package/dist/semantic-concept-judge-CV9Wlx4t.d.ts +650 -0
  53. package/dist/{store-jzKpMl16.d.ts → store-GmBE2pZZ.d.ts} +1 -1
  54. package/dist/traces.d.ts +371 -308
  55. package/dist/traces.js +43 -18
  56. package/dist/{types-CnmZ2bkP.d.ts → types-Bba0vl1V.d.ts} +1 -1
  57. package/dist/{registry-BGKyX6bw.d.ts → types-CRD68aH7.d.ts} +3 -128
  58. package/dist/wire/index.d.ts +1 -1
  59. package/dist/workflow/index.d.ts +494 -0
  60. package/dist/workflow/index.js +2177 -0
  61. package/dist/workflow/index.js.map +1 -0
  62. package/docs/design/self-improvement-roadmap.md +106 -0
  63. package/package.json +36 -12
  64. package/dist/agent-profile-DzcPHR1Z.d.ts +0 -114
  65. package/dist/chunk-ODGETRTM.js.map +0 -1
  66. package/dist/chunk-SL55X4VN.js +0 -186
  67. package/dist/chunk-SL55X4VN.js.map +0 -1
  68. package/dist/chunk-UD6EF73X.js.map +0 -1
  69. /package/dist/{chunk-AIWHLG7J.js.map → chunk-GJJNJVIR.js.map} +0 -0
package/dist/traces.d.ts CHANGED
@@ -1,319 +1,20 @@
1
1
  import { N as NotFoundError, R as ReplayError } from './errors-Dwqw-T_m.js';
2
2
  import { P as ProviderRedactor, R as RawProviderSink, d as RawProviderEvent } from './raw-provider-sink-C46HDghv.js';
3
3
  export { F as FileSystemRawProviderSink, a as FileSystemRawProviderSinkOptions, I as InMemoryRawProviderSink, b as InMemoryRawProviderSinkOptions, N as NoopRawProviderSink, c as RawProviderDirection, e as RawProviderSinkFilter, f as defaultProviderRedactor, p as providerFromBaseUrl } from './raw-provider-sink-C46HDghv.js';
4
- import { R as RunCompleteHook, a as RunCompleteHookContext } from './emitter-DEZwY14K.js';
4
+ import { a as RunCompleteHookContext, R as RunCompleteHook } from './emitter-DEZwY14K.js';
5
5
  export { S as SpanHandle, T as TraceEmitter, b as TraceEmitterOptions, l as llmSpanFromProvider } from './emitter-DEZwY14K.js';
6
6
  export { b as RunIntegrityError, R as RunIntegrityExpectations, c as RunIntegrityIssue, d as RunIntegrityIssueCode, a as RunIntegrityReport, e as assertRunCaptured, t as throwIfRunIncomplete } from './integrity-CJzrpUua.js';
7
7
  import { T as TraceStore } from './store-CKUAgsJz.js';
8
8
  export { E as EventFilter, F as FileSystemTraceStore, a as FileSystemTraceStoreOptions, I as InMemoryTraceStore, R as RunFilter, S as SpanFilter } from './store-CKUAgsJz.js';
9
9
  export { a as aggregateLlm, b as argHash, g as groupBy, j as judgeSpans, l as llmSpans, r as runFailureClass, c as runsForScenario, t as toolSpans } from './query-CqTxMwDw.js';
10
+ export { D as DEFAULT_REDACTION_RULES, b as REDACTION_VERSION, a as RedactionReport, R as RedactionRule, r as redactString, c as redactValue } from './redact-B40YG2M_.js';
10
11
  export { A as Artifact, B as BudgetLedgerEntry, h as BudgetSpec, E as EventKind, i as FAILURE_CLASSES, F as FailureClass, G as GenericSpan, J as JudgeSpan, L as LlmSpan, M as Message, d as RetrievalSpan, R as Run, g as RunLayer, b as RunOutcome, f as RunStatus, e as SandboxSpan, S as Span, j as SpanBase, c as SpanKind, k as SpanStatus, l as TRACE_SCHEMA_VERSION, T as ToolSpan, a as TraceEvent, m as isJudgeSpan, n as isLlmSpan, o as isRetrievalSpan, p as isSandboxSpan, q as isToolSpan } from './schema-m0gsnbt3.js';
11
- import { AxAIService, AxFunction } from '@ax-llm/ax';
12
- import { T as TraceAnalysisStore, f as TraceAnalystFilters, a as DatasetOverview, Q as QueryTracesPage, l as ViewTraceResult, V as ViewSpansResult, b as SearchTraceResult, S as SearchSpanResult } from './store-jzKpMl16.js';
13
- export { D as DEFAULT_TRACE_ANALYST_BUDGETS, c as SpanMatchRecord, d as TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, e as TraceAnalystByteBudgets, g as TraceAnalystSpan, h as TraceAnalystSpanKind, i as TraceAnalystSpanStatus, j as TraceAnalystTraceSummary, k as ViewTraceOversized } from './store-jzKpMl16.js';
14
-
15
- /**
16
- * `captureFetchToRawSink` wrap a `fetch` so every request / response / error
17
- * against a provider is recorded into a `RawProviderSink` as the canonical
18
- * `RawProviderEvent` triple. The one substrate copy of the fetch-capture
19
- * pattern four consumers hand-roll (legal ships two copies).
20
- *
21
- * The returned value is a plain `typeof fetch` — pass it as the `fetchImpl` to
22
- * any OpenAI-compatible backend factory. Capture is best-effort by default: a
23
- * sink write that throws does NOT take down the underlying LLM call (set
24
- * `failClosed` to change that). Uses the existing `defaultProviderRedactor` +
25
- * `providerFromBaseUrl` — no new redaction policy.
26
- */
27
-
28
- interface CaptureFetchContext {
29
- /** Logical run id stamped on every captured event. Required — without it
30
- * the raw events can't be paired with their parent `Run`. */
31
- runId: string;
32
- /** Optional logical span id (enables span-level sink filtering). */
33
- spanId?: string;
34
- /** Resolved base URL (normalised, no trailing slash). Used for the event's
35
- * `baseUrl` and for endpoint-path extraction. */
36
- baseUrl: string;
37
- /** Model id the caller intends to invoke. Stamped on every event. */
38
- model: string;
39
- /** Provider override. When omitted, `providerFromBaseUrl(baseUrl)`. */
40
- provider?: string;
41
- }
42
- interface CaptureFetchOptions {
43
- /** Override the capture-time redactor. Default `defaultProviderRedactor`. */
44
- redactor?: ProviderRedactor;
45
- /** Cap on captured response-body bytes; beyond it the body is truncated and
46
- * `body_truncated` is added to `redactedFields`. Default 2 MiB. */
47
- responseBodyByteCap?: number;
48
- /** When true, a sink-write failure propagates to the caller. Default false
49
- * — capture is best-effort so a sink failure never kills the LLM call. */
50
- failClosed?: boolean;
51
- }
52
- declare function captureFetchToRawSink(fetch: typeof globalThis.fetch, sink: RawProviderSink, ctx: CaptureFetchContext, opts?: CaptureFetchOptions): typeof globalThis.fetch;
53
-
54
- /**
55
- * OpenTelemetry JSON export — maps TraceSchema v1 to OTLP/JSON so
56
- * traces render natively in Jaeger / Honeycomb / Langfuse / Grafana.
57
- *
58
- * Wire format only. We do NOT depend on the @opentelemetry SDK — that
59
- * would drag in polyfills incompatible with Workers/Edge. Consumers
60
- * push the JSON to their collector of choice via HTTP.
61
- *
62
- * Reference: OTLP 1.3.2 (ResourceSpans / ScopeSpans / Span).
63
- */
64
-
65
- declare const OTEL_AGENT_EVAL_SCOPE: {
66
- name: string;
67
- version: string;
68
- };
69
- interface OtlpSpan {
70
- traceId: string;
71
- spanId: string;
72
- parentSpanId?: string;
73
- name: string;
74
- kind: number;
75
- startTimeUnixNano: string;
76
- endTimeUnixNano: string;
77
- attributes: Array<{
78
- key: string;
79
- value: {
80
- stringValue?: string;
81
- intValue?: string;
82
- doubleValue?: number;
83
- boolValue?: boolean;
84
- };
85
- }>;
86
- events?: Array<{
87
- timeUnixNano: string;
88
- name: string;
89
- attributes?: OtlpSpan['attributes'];
90
- }>;
91
- status?: {
92
- code: number;
93
- message?: string;
94
- };
95
- }
96
- interface OtlpResourceSpans {
97
- resource: {
98
- attributes: OtlpSpan['attributes'];
99
- };
100
- scopeSpans: Array<{
101
- scope: typeof OTEL_AGENT_EVAL_SCOPE;
102
- spans: OtlpSpan[];
103
- }>;
104
- }
105
- interface OtlpExport {
106
- resourceSpans: OtlpResourceSpans[];
107
- }
108
- /** Export a single run's spans + events in OTLP/JSON. */
109
- declare function exportRunAsOtlp(store: TraceStore, runId: string, resourceAttrs?: Record<string, string | number | boolean>): Promise<OtlpExport>;
110
-
111
- /**
112
- * OTEL span exporter — streams spans to an OTLP/HTTP collector.
113
- *
114
- * Reads OTEL_EXPORTER_OTLP_ENDPOINT + OTEL_EXPORTER_OTLP_HEADERS from env
115
- * when no explicit config is given. Batches spans and flushes periodically
116
- * or when the batch fills. No @opentelemetry SDK dependency — minimal
117
- * OTLP/JSON serializer (~120 LOC) using the existing otel.ts helpers.
118
- */
119
- interface OtelExportConfig {
120
- /** OTLP endpoint. Reads OTEL_EXPORTER_OTLP_ENDPOINT env by default. */
121
- endpoint?: string;
122
- /** OTLP headers. Reads OTEL_EXPORTER_OTLP_HEADERS env by default. */
123
- headers?: Record<string, string>;
124
- /** Batch size before flush. Default 64. */
125
- batchSize?: number;
126
- /** Flush interval ms. Default 5000. */
127
- flushIntervalMs?: number;
128
- /** Resource attributes stamped on every export. */
129
- resourceAttributes?: Record<string, string | number | boolean>;
130
- /** Service name. Default 'agent-eval'. */
131
- serviceName?: string;
132
- }
133
- interface OtelExporter {
134
- /** Called by the TraceEmitter on every span close. */
135
- exportSpan(span: ExportableSpan): void;
136
- /** Force flush pending spans. */
137
- flush(): Promise<void>;
138
- /** Shutdown cleanly — flushes remaining spans and stops the timer. */
139
- shutdown(): Promise<void>;
140
- }
141
- interface ExportableSpan {
142
- traceId: string;
143
- spanId: string;
144
- parentSpanId?: string;
145
- name: string;
146
- kind: string;
147
- startedAt: number;
148
- endedAt?: number;
149
- status?: string;
150
- error?: string;
151
- model?: string;
152
- inputTokens?: number;
153
- outputTokens?: number;
154
- costUsd?: number;
155
- attributes?: Record<string, unknown>;
156
- }
157
- /**
158
- * Create an OTEL exporter. Returns undefined when no endpoint is configured
159
- * (neither via config nor env) — callers should check before attaching.
160
- */
161
- declare function createOtelExporter(config?: OtelExportConfig): OtelExporter | undefined;
162
-
163
- /**
164
- * OTEL bridge — connects TraceEmitter span lifecycle to the OtelExporter.
165
- *
166
- * When an OtelExporter is active, every span that closes through the
167
- * TraceEmitter is also pushed to the exporter for real-time streaming to
168
- * the user's OTEL collector.
169
- *
170
- * The bridge is opt-in: attach via `otelRunCompleteHook(exporter)` as a
171
- * RunCompleteHook, or wrap the store with `createOtelTracingStore` for
172
- * real-time per-span export.
173
- */
174
-
175
- /**
176
- * Create a RunCompleteHook that exports all spans from the completed run
177
- * to the OTEL exporter, then flushes.
178
- */
179
- declare function otelRunCompleteHook(exporter: OtelExporter): RunCompleteHook;
180
- /**
181
- * Create an auto-exporting TraceStore wrapper that intercepts updateSpan
182
- * calls. When a span gets an endedAt, it's exported immediately. This
183
- * gives real-time streaming instead of batch-at-end.
184
- *
185
- * This is the preferred integration path: wrap the store before
186
- * constructing the TraceEmitter.
187
- */
188
- declare function createOtelTracingStore(inner: TraceStore, exporter: OtelExporter, traceId: string): TraceStore;
189
-
190
- /**
191
- * Redaction — remove PII / secrets from trace payloads before persist.
192
- *
193
- * Pre-persistence rules mean raw traces in storage are already scrubbed.
194
- * Unredacted variants (for debugging / post-mortems) live in a separate
195
- * storage layer with stricter access controls; this module only covers
196
- * the default scrub-then-persist path.
197
- *
198
- * Rules compose: pass an array of `RedactionRule`, each is applied in
199
- * order. Strings that match get replaced with a tagged sentinel so the
200
- * eval framework can count how many redactions happened per run
201
- * (surfaced via `redaction_applied` events).
202
- */
203
- interface RedactionRule {
204
- id: string;
205
- pattern: RegExp;
206
- /** Replacement — e.g. '[PII:email]'. Defaults to `[redacted:{id}]`. */
207
- replacement?: string;
208
- }
209
- interface RedactionReport {
210
- redactionCount: number;
211
- byRule: Record<string, number>;
212
- }
213
- /** OWASP / common-sense defaults — extend per-domain. */
214
- declare const DEFAULT_REDACTION_RULES: RedactionRule[];
215
- declare const REDACTION_VERSION = "1.0.0";
216
- /**
217
- * Redact a single string. Returns the new string and a per-rule count of
218
- * how many substitutions fired.
219
- */
220
- declare function redactString(input: string, rules?: RedactionRule[]): {
221
- output: string;
222
- report: RedactionReport;
223
- };
224
- /**
225
- * Walk a JSON-ish value applying `redactString` to every string leaf.
226
- * Arrays and plain objects are recursed; other types pass through
227
- * untouched. Circular references throw — traces should be tree-shaped.
228
- */
229
- declare function redactValue(value: unknown, rules?: RedactionRule[], report?: RedactionReport): {
230
- value: unknown;
231
- report: RedactionReport;
232
- };
233
-
234
- interface AnalyzeTracesInput {
235
- /** The user-facing question. Domain framing belongs here, not in the
236
- * actor description. */
237
- question: string;
238
- }
239
- interface AnalyzeTracesResult {
240
- /** The responder's prose answer. */
241
- answer: string;
242
- /** Bulleted findings extracted from the responder's structured output. */
243
- findings: string[];
244
- /** Per-actor-turn snapshots captured via `actorTurnCallback`. */
245
- turns: AnalyzeTracesTurnSnapshot[];
246
- /** Total turns the actor took. */
247
- turnCount: number;
248
- /** Token usage by role. */
249
- usage: TraceAnalystUsage;
250
- /** Full system + assistant + tool message log by role. */
251
- chatLog: TraceAnalystChatLog;
252
- /** Prompt version that produced this run. */
253
- actorPromptVersion: string;
254
- }
255
- interface TraceAnalystUsage {
256
- actor: TraceAnalystUsageEntry[];
257
- responder: TraceAnalystUsageEntry[];
258
- }
259
- interface TraceAnalystUsageEntry {
260
- [key: string]: unknown;
261
- }
262
- interface TraceAnalystChatLog {
263
- actor: TraceAnalystChatMessage[];
264
- responder: TraceAnalystChatMessage[];
265
- }
266
- interface TraceAnalystChatMessage {
267
- [key: string]: unknown;
268
- }
269
- interface AnalyzeTracesTurnSnapshot {
270
- turn: number;
271
- isError: boolean;
272
- /** The JS code the actor produced for this turn. */
273
- code: string;
274
- /** The formatted action-log entry the actor sees on the next turn. */
275
- output: string;
276
- /** Provider thought (when `actorOptions.showThoughts` is true and the
277
- * provider returns it). */
278
- thought?: string;
279
- }
280
- interface AnalyzeTracesOptions {
281
- /** Trace data source. Pass either an OTLP-JSONL path or a custom store. */
282
- source: string | TraceAnalysisStore;
283
- /** Caller-provided AxAIService. */
284
- ai: AxAIService;
285
- /** Model id forwarded to actor + responder. */
286
- model?: string;
287
- /** Recursion depth. 0 = no sub-agent dispatch. Default 1. */
288
- maxDepth?: number;
289
- /** Maximum actor turns. Default 12. */
290
- maxTurns?: number;
291
- /** Maximum parallel sub-agent calls in batched llmQuery. Default 2. */
292
- maxParallelSubagents?: number;
293
- /** Override the actor description. */
294
- actorDescription?: string;
295
- /** Override the subagent description. */
296
- subagentDescription?: string;
297
- /** Per-turn observability hook. */
298
- onTurn?: (turn: AnalyzeTracesTurnSnapshot) => void | Promise<void>;
299
- /** Override max runtime characters per turn. Default 6000. */
300
- maxRuntimeChars?: number;
301
- /** When set, every turn's snapshot is appended to this JSONL file
302
- * immediately. If the analyst crashes mid-loop (provider 503,
303
- * network error, validator reject) the partial reasoning is still
304
- * on disk. Replay the file with the responder afterward to recover
305
- * evidence. */
306
- progressLogPath?: string;
307
- }
308
- /**
309
- * Run the trace analyst.
310
- *
311
- * Throws:
312
- * - `TraceFileMissingError` if `source` is a path and doesn't exist.
313
- * - `AxAgentClarificationError` if the analyst asks for clarification.
314
- * - Provider errors (auth, rate limits) propagate from the AI service.
315
- */
316
- declare function analyzeTraces(input: AnalyzeTracesInput, options: AnalyzeTracesOptions): Promise<AnalyzeTracesResult>;
12
+ import { A as AnalyzeTracesOptions, b as AnalyzeTracesResult } from './analyst-t7zZS3TV.js';
13
+ export { a as AnalyzeTracesInput, c as AnalyzeTracesTurnSnapshot, d as analyzeTraces } from './analyst-t7zZS3TV.js';
14
+ import { h as TraceAnalystSpanKind, i as TraceAnalystSpanStatus, T as TraceAnalysisStore, g as TraceAnalystFilters, b as DatasetOverview, Q as QueryTracesPage, l as ViewTraceResult, V as ViewSpansResult, c as SearchTraceResult, S as SearchSpanResult } from './store-GmBE2pZZ.js';
15
+ export { D as DEFAULT_TRACE_ANALYST_BUDGETS, d as SpanMatchRecord, e as TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, f as TraceAnalystByteBudgets, a as TraceAnalystSpan, j as TraceAnalystTraceSummary, k as ViewTraceOversized } from './store-GmBE2pZZ.js';
16
+ import { b as RunSplitTag, a as RunTokenUsage, R as RunRecord } from './run-record-BgTFzO2r.js';
17
+ import { AxFunction } from '@ax-llm/ax';
317
18
 
318
19
  /**
319
20
  * Trace-analyst auto-execution hook.
@@ -440,6 +141,63 @@ declare function scoreTraceInsightReadiness(context: TraceInsightContext): Trace
440
141
  declare function defaultTraceInsightPanel(): TraceInsightPanelRole[];
441
142
  declare function buildTraceInsightPrompt(input: TraceInsightPromptInput): string;
442
143
 
144
+ /**
145
+ * OpenTelemetry JSON export — maps TraceSchema v1 to OTLP/JSON so
146
+ * traces render natively in Jaeger / Honeycomb / Langfuse / Grafana.
147
+ *
148
+ * Wire format only. We do NOT depend on the @opentelemetry SDK — that
149
+ * would drag in polyfills incompatible with Workers/Edge. Consumers
150
+ * push the JSON to their collector of choice via HTTP.
151
+ *
152
+ * Reference: OTLP 1.3.2 (ResourceSpans / ScopeSpans / Span).
153
+ */
154
+
155
+ declare const OTEL_AGENT_EVAL_SCOPE: {
156
+ name: string;
157
+ version: string;
158
+ };
159
+ interface OtlpSpan {
160
+ traceId: string;
161
+ spanId: string;
162
+ parentSpanId?: string;
163
+ name: string;
164
+ kind: number;
165
+ startTimeUnixNano: string;
166
+ endTimeUnixNano: string;
167
+ attributes: Array<{
168
+ key: string;
169
+ value: {
170
+ stringValue?: string;
171
+ intValue?: string;
172
+ doubleValue?: number;
173
+ boolValue?: boolean;
174
+ };
175
+ }>;
176
+ events?: Array<{
177
+ timeUnixNano: string;
178
+ name: string;
179
+ attributes?: OtlpSpan['attributes'];
180
+ }>;
181
+ status?: {
182
+ code: number;
183
+ message?: string;
184
+ };
185
+ }
186
+ interface OtlpResourceSpans {
187
+ resource: {
188
+ attributes: OtlpSpan['attributes'];
189
+ };
190
+ scopeSpans: Array<{
191
+ scope: typeof OTEL_AGENT_EVAL_SCOPE;
192
+ spans: OtlpSpan[];
193
+ }>;
194
+ }
195
+ interface OtlpExport {
196
+ resourceSpans: OtlpResourceSpans[];
197
+ }
198
+ /** Export a single run's spans + events in OTLP/JSON. */
199
+ declare function exportRunAsOtlp(store: TraceStore, runId: string, resourceAttrs?: Record<string, string | number | boolean>): Promise<OtlpExport>;
200
+
443
201
  /**
444
202
  * `flattenOtlpExportToNdjson` — flatten an `OtlpExport` (the shape
445
203
  * `exportRunAsOtlp` produces) into the per-line JSON the analyst's
@@ -484,6 +242,193 @@ interface FlattenOtlpOptions {
484
242
  }
485
243
  declare function flattenOtlpExportToNdjson(otlpExport: OtlpExport, opts?: FlattenOtlpOptions): OtlpFlatLine[];
486
244
 
245
+ /**
246
+ * Canonical OTLP-flat-line readers shared by every consumer of the
247
+ * OTLP-JSONL wire shape (one OTLP span per line; the form
248
+ * `flattenOtlpExportToNdjson` produces and the form AppWorld / HALO
249
+ * emit via their OpenInference OTLP exporter).
250
+ *
251
+ * `OtlpFileTraceStore` indexes spans with these; `otlpToRunRecords`
252
+ * aggregates spans into `RunRecord`s with the same readers. One parser,
253
+ * one vocabulary — a divergence between the analyst's view of a trace and
254
+ * the RunRecord projected from it is a class of bug this consolidation
255
+ * removes by construction.
256
+ *
257
+ * Vocabulary. The readers understand BOTH dialects that appear in the
258
+ * wild:
259
+ * - the substrate's own `llm.*` / `tool.*` / `span.kind` attributes
260
+ * (`flattenSpanAttributes` in `trace/otel.ts`), and
261
+ * - the OpenInference / inference-export attributes AppWorld / HALO
262
+ * emit (`openinference.span.kind`, `inference.observation_kind`,
263
+ * `inference.llm.input_tokens`, `llm.token_count.prompt`, …).
264
+ *
265
+ * Pure, no I/O.
266
+ */
267
+
268
+ /**
269
+ * The structural fields a flat OTLP-JSONL line projects to. `attributes`
270
+ * is the merged resource+span attribute map (span overrides resource);
271
+ * the named fields are the pivots every reader of a trace needs without
272
+ * paying the full attribute materialisation.
273
+ */
274
+ interface ProjectedOtlpSpan {
275
+ trace_id: string;
276
+ span_id: string;
277
+ parent_span_id: string | null;
278
+ name: string;
279
+ kind: TraceAnalystSpanKind;
280
+ start_time: string;
281
+ end_time: string;
282
+ duration_ms: number;
283
+ status: TraceAnalystSpanStatus;
284
+ status_message: string | undefined;
285
+ service_name: string | null;
286
+ agent_name: string | null;
287
+ model_name: string | null;
288
+ tool_name: string | null;
289
+ /** Merged resource + span attributes, span winning on overlap. */
290
+ attributes: Record<string, unknown>;
291
+ }
292
+ /**
293
+ * Project one parsed OTLP-JSONL object to `ProjectedOtlpSpan`, or `null`
294
+ * when the line is missing the mandatory `trace_id` + `span_id`.
295
+ */
296
+ declare function projectOtlpFlatLine(raw: Record<string, unknown>): ProjectedOtlpSpan | null;
297
+ declare function readOtlpStatus(raw: Record<string, unknown>): {
298
+ code: TraceAnalystSpanStatus;
299
+ message: string | undefined;
300
+ };
301
+ declare function inferOtlpKind(attrs: Record<string, unknown>): TraceAnalystSpanKind;
302
+ /**
303
+ * Flatten OTLP `attributes` + `resource.attributes` into a single
304
+ * dotted-key map. Span attributes override resource attributes when keys
305
+ * overlap. Nested objects/arrays are preserved as-is.
306
+ */
307
+ declare function extractOtlpAttributes(raw: Record<string, unknown>): Record<string, unknown>;
308
+ declare function stringField(raw: Record<string, unknown>, key: string): string | undefined;
309
+ declare function asString(v: unknown): string | null;
310
+ /** Read a numeric attribute, tolerating numeric strings; `null` if absent/NaN. */
311
+ declare function asNumber(v: unknown): number | null;
312
+ /** First finite numeric value across a list of candidate attribute keys. */
313
+ declare function firstNumberAttr(attrs: Record<string, unknown>, keys: readonly string[]): number | null;
314
+ /** First non-empty string value across a list of candidate attribute keys. */
315
+ declare function firstStringAttr(attrs: Record<string, unknown>, keys: readonly string[]): string | null;
316
+
317
+ /**
318
+ * `otlpToRunRecords` — fold an OTLP traces.jsonl (one OTLP span per line;
319
+ * the form AppWorld / HALO emit via their OpenInference OTLP exporter, the
320
+ * same shape `flattenOtlpExportToNdjson` produces) into validated
321
+ * `RunRecord[]` — one record per `trace_id` (one trace == one task).
322
+ *
323
+ * This is the offline ingestion primitive the AppWorld driver bench and the
324
+ * hosted Intelligence product both stand on: traces in, paper-grade rows
325
+ * out, ready for `compareDrivers` / `analyzeRuns` / the promotion gate.
326
+ *
327
+ * Aggregation per trace:
328
+ * - tokenUsage: sum LLM-span `input` / `output` (+ `cached` when present)
329
+ * across every LLM span in the trace.
330
+ * - costUsd: sum per-span LLM cost when present; else priced via
331
+ * `opts.priceUsdPerToken` from the aggregated tokens; else 0 with a
332
+ * loud `raw.cost_unpriced = 1` marker so a missing price is visible, not
333
+ * a silent zero folded into a gate.
334
+ * - failureMode: the first `STATUS_CODE_ERROR` span's normalized status
335
+ * message (carries the real failure signature, not a generic class).
336
+ * - model: the dominant LLM model in the trace (snapshot-padded to satisfy
337
+ * `validateRunRecord` when the trace's model is a bare alias).
338
+ * - outcome score: `opts.scoreForTrace` (AppWorld `world.evaluate()` →
339
+ * TGC/SGC) when supplied; else 1 when the trace had no error span, 0
340
+ * when it did — a defensible default the caller can override.
341
+ * - prompt / completion: carried into `raw` as token-count signals and,
342
+ * when the first/last LLM span exposes `input.value` / `output.value`,
343
+ * the verbatim text is preserved on the optional `promptText` /
344
+ * `completionText` of the returned `OtlpTraceRunRecord`.
345
+ *
346
+ * Fail-loud: an OTLP file with zero valid spans throws. A trace with no
347
+ * spans is impossible (a trace exists only because a span referenced it).
348
+ * `validateRunRecord` runs on every row — a malformed projection throws
349
+ * rather than silently producing a half-record.
350
+ */
351
+
352
+ interface OtlpToRunRecordsOptions {
353
+ /** Logical experiment grouping for every produced record. */
354
+ experimentId: string;
355
+ /** Candidate (variant) id — the surface these traces exercised. The
356
+ * bench passes the driver label here so `compareDrivers` can pair rows. */
357
+ candidateId: string;
358
+ /** Split assignment for every produced record. Default `'holdout'` —
359
+ * ingested traces are evidence, not the optimizer's training pool. */
360
+ splitTag?: RunSplitTag;
361
+ /** Git SHA the traces were produced from. Default `'unknown'`. */
362
+ commitSha?: string;
363
+ /** sha256 of the effective prompt surface. Default `'unknown'`. */
364
+ promptHash?: string;
365
+ /** sha256 of the effective config. Default `'unknown'`. */
366
+ configHash?: string;
367
+ /** RNG seed recorded on every row. Default 0. */
368
+ seed?: number;
369
+ /**
370
+ * Fallback model snapshot when the trace exposes no LLM model attribute
371
+ * OR exposes a bare alias `validateRunRecord` would reject. The trace's
372
+ * own model wins when it already carries a snapshot. Default
373
+ * `'unknown@otlp'` (opaque-snapshot form the validator accepts).
374
+ */
375
+ fallbackModel?: string;
376
+ /**
377
+ * USD per total token (input+output) used to price a trace when no
378
+ * per-span cost attribute is present. When unset, an unpriced trace
379
+ * records `costUsd: 0` AND `raw.cost_unpriced = 1` — the zero is flagged,
380
+ * never silent.
381
+ */
382
+ priceUsdPerToken?: number;
383
+ /**
384
+ * Score for a trace's outcome (AppWorld `world.evaluate()` → TGC/SGC, or
385
+ * any [0,1] task-success signal). Keyed by `trace_id`; falls through to
386
+ * the error-derived default (1 = no error span, 0 = had one) when the map
387
+ * has no entry or the function returns undefined.
388
+ */
389
+ scoreForTrace?: (traceId: string, span: TraceAggregate) => number | undefined;
390
+ /**
391
+ * Per-record judge metadata when an external judge produced the score.
392
+ * Keyed by `trace_id`.
393
+ */
394
+ judgeMetadataForTrace?: (traceId: string) => RunRecord['judgeMetadata'] | undefined;
395
+ }
396
+ /** A `RunRecord` plus the verbatim prompt/completion text when the trace's
397
+ * LLM spans exposed it. The text is NOT on the validated `RunRecord`
398
+ * (`outcome.raw` is numeric-only) but consumers ingesting full traces want
399
+ * it — so it rides alongside. */
400
+ interface OtlpTraceRunRecord {
401
+ record: RunRecord;
402
+ /** Verbatim first-LLM-span `input.value`, when present. */
403
+ promptText?: string;
404
+ /** Verbatim last-LLM-span `output.value`, when present. */
405
+ completionText?: string;
406
+ }
407
+ /** Per-trace rollup the score callback can inspect. */
408
+ interface TraceAggregate {
409
+ traceId: string;
410
+ spanCount: number;
411
+ llmSpanCount: number;
412
+ toolSpanCount: number;
413
+ agentSpanCount: number;
414
+ errorSpanCount: number;
415
+ tokenUsage: RunTokenUsage;
416
+ /** First error span's normalized status message, if any. */
417
+ firstErrorMessage?: string;
418
+ model: string;
419
+ startTime: string;
420
+ endTime: string;
421
+ wallMs: number;
422
+ }
423
+ /**
424
+ * Parse + aggregate an OTLP traces.jsonl string into validated
425
+ * `RunRecord[]` (one per trace). Use {@link otlpToTraceRunRecords} when you
426
+ * also want the verbatim prompt/completion text alongside each record.
427
+ */
428
+ declare function otlpToRunRecords(otlpJsonl: string, opts: OtlpToRunRecordsOptions): RunRecord[];
429
+ /** As {@link otlpToRunRecords} but returns the prompt/completion text too. */
430
+ declare function otlpToTraceRunRecords(otlpJsonl: string, opts: OtlpToRunRecordsOptions): OtlpTraceRunRecord[];
431
+
487
432
  /** Ax RLM prompt for bounded trace discovery and evidence-backed analysis. */
488
433
  declare const TRACE_ANALYST_ACTOR_DESCRIPTION = "You answer questions about an OTLP-shaped JSONL trace dataset using the trace tools provided in the `traces` namespace.\n\nDISCOVERY \u2192 NARROW \u2192 DEEP-READ protocol \u2014 follow exactly:\n\n1. ALWAYS call `traces.getDatasetOverview({})` FIRST without a regex_pattern. The result tells you total_traces, raw_jsonl_bytes, services, agents, models, and sample_trace_ids (real ids \u2014 never fabricate one).\n\n2. Use raw_jsonl_bytes to gauge how expensive raw scans will be. `filters.regex_pattern` is the one scan-heavy filter on getDatasetOverview / queryTraces / countTraces \u2014 narrow with indexed fields (has_errors, model_names, service_names, agent_names, time bounds) BEFORE adding a regex on a large dataset.\n\n3. To list more traces than the sample, call `traces.queryTraces({ filters?, limit, offset? })`. Each summary carries raw_jsonl_bytes \u2014 use it to choose between viewTrace and searchTrace BEFORE calling either.\n\n4. Per-trace inspection:\n - SMALL trace (raw_jsonl_bytes well under 150_000): call `traces.viewTrace({ trace_id })`. Returns all spans. Per-attribute payloads are head-capped at ~4KB; large `input.value` / `output.value` / `llm.input_messages` will show a `[trace-analyst truncated: N bytes]` marker.\n - LARGE trace (raw_jsonl_bytes near or above 150_000, or you saw an `oversized` response): use `traces.searchTrace({ trace_id, regex_pattern })` to get bounded SpanMatchRecords (span metadata + matched text + surrounding context). Then call `traces.viewSpans({ trace_id, span_ids: [...] })` for surgical reads (~16KB cap, 4\u00D7 higher than discovery), or `traces.searchSpan({ trace_id, span_id, regex_pattern })` for one large span. Stays bounded regardless of trace size.\n - Useful regex patterns: `STATUS_CODE_ERROR` (failures), tool names like `grep` or `view_trace`, error strings like `MaxTurnsExceeded`, model names, attribute keys.\n\n5. ONLY call viewTrace / viewSpans / searchTrace / searchSpan with trace/span ids you have already seen in sample_trace_ids, a queryTraces page, or a previous search result. Never invent ids.\n\n5a. **Result-shape contract** \u2014 searchTrace and searchSpan return `{ trace_id, hits, total_matches, has_more }`. Iterate `result.hits` (NOT result.matches). Each hit has `{ span_id, span_name, span_kind, attribute_path, matched_text, context_before, context_after, match_offset }`. viewTrace returns `{ trace_id, spans }` (or `oversized`). viewSpans returns `{ trace_id, spans, missing_span_ids, truncated_attribute_count }`. Never assume a field name \u2014 log the result shape first if unsure.\n\n6. If viewTrace returns an `oversized` summary instead of `spans`, DO NOT retry the same call. Read the summary's top_span_names, span_count, span_response_bytes_max, error_span_count to plan a follow-up: switch to searchTrace (or searchSpan for one large span), then viewSpans on a smaller, surgical span_ids set.\n\n7. If searchTrace or searchSpan returns has_more=true, REFINE the regex to be more specific rather than blindly raising max_matches.\n\n8. If a tool errors (invalid regex, range error), STOP and reconsider \u2014 don't retry with a guessed id or argument. Use the discovery tools above to recover.\n\n9. If a ~4KB-truncated payload from viewTrace / searchTrace matters for your answer, first try viewSpans on that span id (~16KB cap). If a 16KB-truncated payload from viewSpans still matters, narrow further with searchSpan against a more specific regex rather than asking for the full payload again.\n\n10. If maxDepth > 0 and the question splits into independent semantic branches, delegate well-defined subtasks to subagents using `await llmQuery(...)`. Pass narrow context and a focused query. Examples:\n\n const reviews = await llmQuery([\n { query: 'Drill into trace abc123 \u2014 what tool calls preceded the failure?', context: { trace_id: 'abc123' } },\n { query: 'Drill into trace def456 \u2014 same failure mode?', context: { trace_id: 'def456' } },\n ]);\n\nOBSERVABILITY rules:\n- Each non-final actor turn must emit at least one `console.log(...)` for evidence. Up to 3 logs per turn is fine when correlating multiple data sources (e.g. one log for findings list, one for source-file content, one for derived analysis).\n- Do NOT combine `console.log` with `final(...)` or `askClarification(...)` in the same turn \u2014 finish gathering data first, then call final on its own turn.\n- Reuse runtime variables across turns; don't recompute.\n- When done, call `await final(answer)` with the fully-formed report. The responder rewrites the answer into output fields; if you only pass a vague summary string the responder has nothing concrete to format.\n\nCRITICAL \u2014 `final()` payload contract for evidence-grounded analysis tasks:\n- Pass a STRUCTURED object as the second arg with the actual data the responder needs to format the answer. Do NOT pass abstract instructions; pass evidence.\n- Example for per-item verdict tasks:\n ```js\n await final(\"Format the per-item verdict report from the evidence below.\", {\n findings: [\n { id: 'sub-1-finding-1', claim: '...', verdict: 'TRUE-POSITIVE', evidence: 'lines 42-45 of contracts/X.sol show ...' },\n ...all items\n ],\n systemic_summary: '3 sentences I wrote based on the evidence above'\n });\n ```\n- Calling `final(\"answer\", {})` with no evidence is a failure mode \u2014 the responder will hallucinate or echo back the field names. Always include the gathered data.\n- Premature final after a single viewSpans call is INSUFFICIENT for per-finding analysis tasks. Read the requested attributes (e.g. `spans[i].attributes['redteam.finding.title']`), and for each one perform the requested cross-reference (e.g. read the source SPAN's `attributes['source.content']`).\n\nOUTPUT contract \u2014 your final answer must include:\n- A clear prose conclusion answering the user's question.\n- Trace ids and span ids cited as evidence for each claim.\n- Failure modes named in the user's domain language, with frequency and concrete examples.\n\nDo NOT invent trace ids, span ids, error messages, or model names. Every fact must be traceable to a tool result.";
489
434
  declare const TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION = "trace-analyst-actor-v5-2026-05-06";
@@ -635,6 +580,124 @@ declare function traceAnalystFunctionGroup(opts: BuildTraceAnalystToolsOpts): {
635
580
  functions: AxFunction[];
636
581
  };
637
582
 
583
+ /**
584
+ * `captureFetchToRawSink` — wrap a `fetch` so every request / response / error
585
+ * against a provider is recorded into a `RawProviderSink` as the canonical
586
+ * `RawProviderEvent` triple. The one substrate copy of the fetch-capture
587
+ * pattern four consumers hand-roll (legal ships two copies).
588
+ *
589
+ * The returned value is a plain `typeof fetch` — pass it as the `fetchImpl` to
590
+ * any OpenAI-compatible backend factory. Capture is best-effort by default: a
591
+ * sink write that throws does NOT take down the underlying LLM call (set
592
+ * `failClosed` to change that). Uses the existing `defaultProviderRedactor` +
593
+ * `providerFromBaseUrl` — no new redaction policy.
594
+ */
595
+
596
+ interface CaptureFetchContext {
597
+ /** Logical run id stamped on every captured event. Required — without it
598
+ * the raw events can't be paired with their parent `Run`. */
599
+ runId: string;
600
+ /** Optional logical span id (enables span-level sink filtering). */
601
+ spanId?: string;
602
+ /** Resolved base URL (normalised, no trailing slash). Used for the event's
603
+ * `baseUrl` and for endpoint-path extraction. */
604
+ baseUrl: string;
605
+ /** Model id the caller intends to invoke. Stamped on every event. */
606
+ model: string;
607
+ /** Provider override. When omitted, `providerFromBaseUrl(baseUrl)`. */
608
+ provider?: string;
609
+ }
610
+ interface CaptureFetchOptions {
611
+ /** Override the capture-time redactor. Default `defaultProviderRedactor`. */
612
+ redactor?: ProviderRedactor;
613
+ /** Cap on captured response-body bytes; beyond it the body is truncated and
614
+ * `body_truncated` is added to `redactedFields`. Default 2 MiB. */
615
+ responseBodyByteCap?: number;
616
+ /** When true, a sink-write failure propagates to the caller. Default false
617
+ * — capture is best-effort so a sink failure never kills the LLM call. */
618
+ failClosed?: boolean;
619
+ }
620
+ declare function captureFetchToRawSink(fetch: typeof globalThis.fetch, sink: RawProviderSink, ctx: CaptureFetchContext, opts?: CaptureFetchOptions): typeof globalThis.fetch;
621
+
622
+ /**
623
+ * OTEL span exporter — streams spans to an OTLP/HTTP collector.
624
+ *
625
+ * Reads OTEL_EXPORTER_OTLP_ENDPOINT + OTEL_EXPORTER_OTLP_HEADERS from env
626
+ * when no explicit config is given. Batches spans and flushes periodically
627
+ * or when the batch fills. No @opentelemetry SDK dependency — minimal
628
+ * OTLP/JSON serializer (~120 LOC) using the existing otel.ts helpers.
629
+ */
630
+ interface OtelExportConfig {
631
+ /** OTLP endpoint. Reads OTEL_EXPORTER_OTLP_ENDPOINT env by default. */
632
+ endpoint?: string;
633
+ /** OTLP headers. Reads OTEL_EXPORTER_OTLP_HEADERS env by default. */
634
+ headers?: Record<string, string>;
635
+ /** Batch size before flush. Default 64. */
636
+ batchSize?: number;
637
+ /** Flush interval ms. Default 5000. */
638
+ flushIntervalMs?: number;
639
+ /** Resource attributes stamped on every export. */
640
+ resourceAttributes?: Record<string, string | number | boolean>;
641
+ /** Service name. Default 'agent-eval'. */
642
+ serviceName?: string;
643
+ }
644
+ interface OtelExporter {
645
+ /** Called by the TraceEmitter on every span close. */
646
+ exportSpan(span: ExportableSpan): void;
647
+ /** Force flush pending spans. */
648
+ flush(): Promise<void>;
649
+ /** Shutdown cleanly — flushes remaining spans and stops the timer. */
650
+ shutdown(): Promise<void>;
651
+ }
652
+ interface ExportableSpan {
653
+ traceId: string;
654
+ spanId: string;
655
+ parentSpanId?: string;
656
+ name: string;
657
+ kind: string;
658
+ startedAt: number;
659
+ endedAt?: number;
660
+ status?: string;
661
+ error?: string;
662
+ model?: string;
663
+ inputTokens?: number;
664
+ outputTokens?: number;
665
+ costUsd?: number;
666
+ attributes?: Record<string, unknown>;
667
+ }
668
+ /**
669
+ * Create an OTEL exporter. Returns undefined when no endpoint is configured
670
+ * (neither via config nor env) — callers should check before attaching.
671
+ */
672
+ declare function createOtelExporter(config?: OtelExportConfig): OtelExporter | undefined;
673
+
674
+ /**
675
+ * OTEL bridge — connects TraceEmitter span lifecycle to the OtelExporter.
676
+ *
677
+ * When an OtelExporter is active, every span that closes through the
678
+ * TraceEmitter is also pushed to the exporter for real-time streaming to
679
+ * the user's OTEL collector.
680
+ *
681
+ * The bridge is opt-in: attach via `otelRunCompleteHook(exporter)` as a
682
+ * RunCompleteHook, or wrap the store with `createOtelTracingStore` for
683
+ * real-time per-span export.
684
+ */
685
+
686
+ /**
687
+ * Create a RunCompleteHook that exports all spans from the completed run
688
+ * to the OTEL exporter, then flushes.
689
+ */
690
+ declare function otelRunCompleteHook(exporter: OtelExporter): RunCompleteHook;
691
+ /**
692
+ * Create an auto-exporting TraceStore wrapper that intercepts updateSpan
693
+ * calls. When a span gets an endedAt, it's exported immediately. This
694
+ * gives real-time streaming instead of batch-at-end.
695
+ *
696
+ * This is the preferred integration path: wrap the store before
697
+ * constructing the TraceEmitter.
698
+ */
699
+ declare function createOtelTracingStore(inner: TraceStore, exporter: OtelExporter, traceId: string): TraceStore;
700
+
638
701
  /**
639
702
  * Replay-from-raw-events — turn every captured campaign run into a
640
703
  * re-runnable artifact.
@@ -754,4 +817,4 @@ declare function iterateRawCalls(sink: RawProviderSink, filter?: {
754
817
  spanId?: string;
755
818
  }): AsyncGenerator<ReplayCacheEntry>;
756
819
 
757
- export { type AnalyzeTracesInput, type AnalyzeTracesOptions, type AnalyzeTracesResult, type AnalyzeTracesTurnSnapshot, type CaptureFetchContext, type CaptureFetchOptions, DEFAULT_REDACTION_RULES, DatasetOverview, type ExportableSpan, type FlattenOtlpOptions, OTEL_AGENT_EVAL_SCOPE, type OtelExportConfig, type OtelExporter, type OtlpExport, OtlpFileTraceStore, type OtlpFileTraceStoreOptions, type OtlpFlatLine, type OtlpResourceSpans, type OtlpSpan, ProviderRedactor, QueryTracesPage, REDACTION_VERSION, RawProviderEvent, RawProviderSink, type RedactionReport, type RedactionRule, ReplayCache, type ReplayCacheEntry, ReplayCacheMissError, type ReplayCacheStats, type ReplayFetchOptions, RunCompleteHook, RunCompleteHookContext, SearchSpanResult, SearchTraceResult, SpanNotFoundError, TRACE_ANALYST_ACTOR_DESCRIPTION, TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, TRACE_ANALYST_SUBAGENT_DESCRIPTION, TraceAnalysisStore, TraceAnalystFilters, type TraceAnalystHookOptions, TraceFileMissingError, type TraceInsightContext, type TraceInsightFinding, type TraceInsightPanelRole, type TraceInsightPromptInput, type TraceInsightQualityGate, type TraceInsightQuestion, type TraceInsightReadiness, type TraceInsightSuite, type TraceInsightTask, TraceNotFoundError, TraceStore, ViewSpansResult, ViewTraceResult, analyzeTraces, buildTraceAnalystTools, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, createOtelExporter, createOtelTracingStore, createReplayFetch, defaultTraceInsightPanel, describeTraceInsightScope, domainEvidencePattern, exportRunAsOtlp, flattenOtlpExportToNdjson, inferDomainKeywords, iterateRawCalls, otelRunCompleteHook, planTraceInsightQuestions, redactString, redactValue, scoreTraceInsightReadiness, tokenizeDomainWords, traceAnalystFunctionGroup, traceAnalystOnRunComplete };
820
+ export { AnalyzeTracesOptions, AnalyzeTracesResult, type CaptureFetchContext, type CaptureFetchOptions, DatasetOverview, type ExportableSpan, type FlattenOtlpOptions, OTEL_AGENT_EVAL_SCOPE, type OtelExportConfig, type OtelExporter, type OtlpExport, OtlpFileTraceStore, type OtlpFileTraceStoreOptions, type OtlpFlatLine, type OtlpResourceSpans, type OtlpSpan, type OtlpToRunRecordsOptions, type OtlpTraceRunRecord, type ProjectedOtlpSpan, ProviderRedactor, QueryTracesPage, RawProviderEvent, RawProviderSink, ReplayCache, type ReplayCacheEntry, ReplayCacheMissError, type ReplayCacheStats, type ReplayFetchOptions, RunCompleteHook, RunCompleteHookContext, SearchSpanResult, SearchTraceResult, SpanNotFoundError, TRACE_ANALYST_ACTOR_DESCRIPTION, TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, TRACE_ANALYST_SUBAGENT_DESCRIPTION, type TraceAggregate, TraceAnalysisStore, TraceAnalystFilters, type TraceAnalystHookOptions, TraceAnalystSpanKind, TraceAnalystSpanStatus, TraceFileMissingError, type TraceInsightContext, type TraceInsightFinding, type TraceInsightPanelRole, type TraceInsightPromptInput, type TraceInsightQualityGate, type TraceInsightQuestion, type TraceInsightReadiness, type TraceInsightSuite, type TraceInsightTask, TraceNotFoundError, TraceStore, ViewSpansResult, ViewTraceResult, asNumber, asString, buildTraceAnalystTools, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, createOtelExporter, createOtelTracingStore, createReplayFetch, defaultTraceInsightPanel, describeTraceInsightScope, domainEvidencePattern, exportRunAsOtlp, extractOtlpAttributes, firstNumberAttr, firstStringAttr, flattenOtlpExportToNdjson, inferDomainKeywords, inferOtlpKind, iterateRawCalls, otelRunCompleteHook, otlpToRunRecords, otlpToTraceRunRecords, planTraceInsightQuestions, projectOtlpFlatLine, readOtlpStatus, scoreTraceInsightReadiness, stringField, tokenizeDomainWords, traceAnalystFunctionGroup, traceAnalystOnRunComplete };