@tangle-network/agent-eval 0.20.11 → 0.21.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +137 -170
  3. package/dist/benchmarks/index.d.ts +2 -1
  4. package/dist/{chunk-JAOLXRIA.js → chunk-3GN6U53I.js} +205 -4
  5. package/dist/chunk-3GN6U53I.js.map +1 -0
  6. package/dist/chunk-3IX6QTB7.js +1349 -0
  7. package/dist/chunk-3IX6QTB7.js.map +1 -0
  8. package/dist/chunk-5IIQKMD5.js +236 -0
  9. package/dist/chunk-5IIQKMD5.js.map +1 -0
  10. package/dist/chunk-ARZ6BEV6.js +1310 -0
  11. package/dist/chunk-ARZ6BEV6.js.map +1 -0
  12. package/dist/chunk-HRZELXCR.js +1354 -0
  13. package/dist/chunk-HRZELXCR.js.map +1 -0
  14. package/dist/chunk-KRR4VMH7.js +423 -0
  15. package/dist/chunk-KRR4VMH7.js.map +1 -0
  16. package/dist/chunk-SNUHRBDL.js +154 -0
  17. package/dist/chunk-SNUHRBDL.js.map +1 -0
  18. package/dist/chunk-WOK2RTWG.js +1920 -0
  19. package/dist/chunk-WOK2RTWG.js.map +1 -0
  20. package/dist/{chunk-LSR4IAYN.js → chunk-WOPGKVN4.js} +2 -2
  21. package/dist/chunk-YUFXO3TU.js +148 -0
  22. package/dist/chunk-YUFXO3TU.js.map +1 -0
  23. package/dist/cli.js +3 -2
  24. package/dist/cli.js.map +1 -1
  25. package/dist/control-cxwMOAsy.d.ts +259 -0
  26. package/dist/control.d.ts +6 -0
  27. package/dist/control.js +30 -0
  28. package/dist/control.js.map +1 -0
  29. package/dist/dataset-B9qvlm_o.d.ts +112 -0
  30. package/dist/emitter-B2XqDKFU.d.ts +121 -0
  31. package/dist/feedback-trajectory-CB0A32o3.d.ts +346 -0
  32. package/dist/{index-1PZOtZFr.d.ts → index-c5saLbKD.d.ts} +2 -133
  33. package/dist/index.d.ts +178 -2945
  34. package/dist/index.js +1066 -6185
  35. package/dist/index.js.map +1 -1
  36. package/dist/multi-shot-optimization-Bvtz294B.d.ts +598 -0
  37. package/dist/openapi.json +1 -1
  38. package/dist/optimization.d.ts +146 -0
  39. package/dist/optimization.js +60 -0
  40. package/dist/optimization.js.map +1 -0
  41. package/dist/reporting-Da2ihlcM.d.ts +672 -0
  42. package/dist/reporting.d.ts +5 -0
  43. package/dist/reporting.js +36 -0
  44. package/dist/reporting.js.map +1 -0
  45. package/dist/run-record-CX_jcAyr.d.ts +134 -0
  46. package/dist/store-u47QaJ9G.d.ts +297 -0
  47. package/dist/traces.d.ts +914 -0
  48. package/dist/traces.js +120 -0
  49. package/dist/traces.js.map +1 -0
  50. package/dist/wire/index.js +3 -2
  51. package/docs/concepts.md +16 -11
  52. package/docs/feature-guide.md +10 -17
  53. package/docs/integration-launch-gates.md +77 -0
  54. package/docs/product-eval-adoption.md +27 -0
  55. package/docs/research-report-methodology.md +155 -0
  56. package/docs/trace-analysis.md +75 -0
  57. package/package.json +30 -12
  58. package/dist/chunk-JAOLXRIA.js.map +0 -1
  59. /package/dist/{chunk-LSR4IAYN.js.map → chunk-WOPGKVN4.js.map} +0 -0
@@ -0,0 +1,36 @@
1
+ import {
2
+ RESEARCH_REPORT_HARD_PAIR_FLOOR,
3
+ assertReleaseConfidence,
4
+ bootstrapCi,
5
+ evaluateReleaseConfidence,
6
+ gainHistogram,
7
+ judgeReplayGate,
8
+ paretoChart,
9
+ releaseTraceEvidenceFromMultiShotTrials,
10
+ renderReleaseReport,
11
+ researchReport,
12
+ summaryTable
13
+ } from "./chunk-3IX6QTB7.js";
14
+ import {
15
+ bhAdjust,
16
+ pairedBootstrap,
17
+ pairedWilcoxon
18
+ } from "./chunk-KRR4VMH7.js";
19
+ import "./chunk-PZ5AY32C.js";
20
+ export {
21
+ RESEARCH_REPORT_HARD_PAIR_FLOOR,
22
+ assertReleaseConfidence,
23
+ bhAdjust,
24
+ bootstrapCi,
25
+ evaluateReleaseConfidence,
26
+ gainHistogram,
27
+ judgeReplayGate,
28
+ pairedBootstrap,
29
+ pairedWilcoxon,
30
+ paretoChart,
31
+ releaseTraceEvidenceFromMultiShotTrials,
32
+ renderReleaseReport,
33
+ researchReport,
34
+ summaryTable
35
+ };
36
+ //# sourceMappingURL=reporting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Paper-grade RunRecord schema + runtime validator.
3
+ *
4
+ * Every run that participates in a promotion gate, paper table, or
5
+ * researcher loop SHOULD be recorded as a `RunRecord`. The mandatory
6
+ * fields are exactly those the paper "Two Loops, Three Roles" requires
7
+ * for reproducibility: who/what/when/cost/seed/hash, plus the search vs
8
+ * holdout split tag and either a `searchScore` or a `holdoutScore`.
9
+ *
10
+ * This is intentionally NOT a replacement for the rich `Run` /
11
+ * `ProposeReviewReport` / `ScenarioResult` types already in the
12
+ * package. Those are runtime structures with full provenance. A
13
+ * `RunRecord` is the analysis-time projection — the JSON-friendly
14
+ * row you'd put in a parquet file or paste into a notebook.
15
+ *
16
+ * Validate at the boundary:
17
+ *
18
+ * const rec = validateRunRecord(rawJson) // throws on missing
19
+ * const ok = isRunRecord(rawJson) // boolean check
20
+ * const rec = parseRunRecordSafe(rawJson) // { ok, value | error }
21
+ *
22
+ * The validator runs in pure TS — zod is intentionally NOT a
23
+ * dependency. Round-trip tested in `tests/run-record.test.ts`.
24
+ */
25
+ /** Search/dev/holdout split tag. 'search' is the paper-grade alias for the
26
+ * combined train+test pool that the optimizer is allowed to read. */
27
+ type RunSplitTag = 'search' | 'dev' | 'holdout';
28
+ interface RunTokenUsage {
29
+ input: number;
30
+ output: number;
31
+ cached?: number;
32
+ }
33
+ interface RunJudgeMetadata {
34
+ model: string;
35
+ promptVersion: string;
36
+ /** [0,1] confidence the judge declared. Constant judge confidence
37
+ * across many runs is a fallback signal (see `canary.ts`). */
38
+ confidence: number;
39
+ /** True if the judge degraded to a fallback path (rules-only,
40
+ * prior-call cache, etc.). The canary uses this to alert. */
41
+ fallback: boolean;
42
+ }
43
+ interface RunOutcome {
44
+ /** Score on the search/optimization split. Optional because a
45
+ * holdout-only evaluation only fills `holdoutScore`. */
46
+ searchScore?: number;
47
+ /** Score on the held-out split. Optional because a search-only run
48
+ * only fills `searchScore`. At least one must be present. */
49
+ holdoutScore?: number;
50
+ /** Bag of any other metric the run produced — judge dimensions,
51
+ * pass/fail counters, latency stats, etc. Numeric only — keeps
52
+ * reporters honest. */
53
+ raw: Record<string, number>;
54
+ }
55
+ /**
56
+ * Mandatory paper-grade fields for a single evaluation run. Optional
57
+ * fields are extension points; mandatory fields throw if missing.
58
+ *
59
+ * Hash discipline:
60
+ * - `promptHash` is the sha256 of the EFFECTIVE prompt sent to the
61
+ * model (after any steering bundle merge).
62
+ * - `configHash` is the sha256 of the effective run config (model,
63
+ * temperature, tools, judges, splits). The pair (promptHash,
64
+ * configHash) uniquely identifies an experimental cell.
65
+ *
66
+ * Model snapshot discipline:
67
+ * - `model` MUST encode a snapshot version. Bare aliases like
68
+ * `claude-sonnet-4` or `gpt-4o` are banned — they remap silently.
69
+ * Use `claude-sonnet-4-6@2025-04-15` or `gpt-4o-2024-11-20`.
70
+ */
71
+ interface RunRecord {
72
+ /** UUID for the run. */
73
+ runId: string;
74
+ /** Logical experiment grouping (a treatment vs a baseline within
75
+ * the same sweep should share `experimentId`). */
76
+ experimentId: string;
77
+ /** Stable identifier for the candidate (variant) being run. The
78
+ * promotion gate compares two `candidateId`s on matched items. */
79
+ candidateId: string;
80
+ /** RNG seed for the run. Always recorded — silent re-seeding is
81
+ * the most common cause of non-reproducible numbers. */
82
+ seed: number;
83
+ /** Model identifier WITH snapshot version. */
84
+ model: string;
85
+ /** sha256 of the effective prompt (post-steering). */
86
+ promptHash: string;
87
+ /** sha256 of the effective config. */
88
+ configHash: string;
89
+ /** Git SHA the harness was run from. */
90
+ commitSha: string;
91
+ /** End-to-end wall-clock duration in milliseconds. */
92
+ wallMs: number;
93
+ /** Time spent queued before execution started, if known. */
94
+ queueMs?: number;
95
+ /** Total USD cost. Mandatory — runs without a cost number are
96
+ * unbounded by definition and must not be admitted into the gate. */
97
+ costUsd: number;
98
+ /** Token usage breakdown. */
99
+ tokenUsage: RunTokenUsage;
100
+ /** Judge-side metadata, if a judge was used. */
101
+ judgeMetadata?: RunJudgeMetadata;
102
+ /** Per-split scores + raw bag. */
103
+ outcome: RunOutcome;
104
+ /** Categorical failure tag, when the run failed and the harness
105
+ * classified it. Free-form string; standard tags live in
106
+ * `failure-taxonomy.ts`. */
107
+ failureMode?: string;
108
+ /** Which split this run was drawn from. */
109
+ splitTag: RunSplitTag;
110
+ }
111
+ declare class RunRecordValidationError extends Error {
112
+ readonly path: string;
113
+ constructor(message: string, path?: string);
114
+ }
115
+ /**
116
+ * Strict validator. Throws `RunRecordValidationError` on the first
117
+ * missing or wrongly-typed field. Returns the input cast to
118
+ * `RunRecord` on success — the validator does not coerce.
119
+ */
120
+ declare function validateRunRecord(input: unknown): RunRecord;
121
+ /** Boolean validator — convenience for filtering arrays. */
122
+ declare function isRunRecord(input: unknown): input is RunRecord;
123
+ /** Non-throwing validator — returns a discriminated union. */
124
+ declare function parseRunRecordSafe(input: unknown): {
125
+ ok: true;
126
+ value: RunRecord;
127
+ } | {
128
+ ok: false;
129
+ error: RunRecordValidationError;
130
+ };
131
+ /** Round-trip helper — `JSON.parse(JSON.stringify(record))` then validate. */
132
+ declare function roundTripRunRecord(record: RunRecord): RunRecord;
133
+
134
+ export { type RunSplitTag as R, type RunRecord as a, type RunJudgeMetadata as b, type RunOutcome as c, RunRecordValidationError as d, type RunTokenUsage as e, isRunRecord as i, parseRunRecordSafe as p, roundTripRunRecord as r, validateRunRecord as v };
@@ -0,0 +1,297 @@
1
+ /**
2
+ * TraceSchema v1 — the canonical data model for agent-eval.
3
+ *
4
+ * Every score, every failure class, every pipeline in the framework is
5
+ * a view over this data. Shape it once, live with it.
6
+ *
7
+ * Wire-compatible with OpenTelemetry span semantics (see trace/otel.ts)
8
+ * but extended with agent-specific span kinds (llm, tool, retrieval,
9
+ * judge, sandbox) and first-class BudgetLedger / Artifact / JudgeVerdict
10
+ * entities that OTEL leaves as free-form attributes.
11
+ */
12
+ declare const TRACE_SCHEMA_VERSION = "1.0.0";
13
+ type RunStatus = 'running' | 'completed' | 'failed' | 'aborted';
14
+ interface BudgetSpec {
15
+ tokens?: number;
16
+ wallMs?: number;
17
+ calls?: number;
18
+ usd?: number;
19
+ }
20
+ interface RunOutcome {
21
+ score?: number;
22
+ pass?: boolean;
23
+ failureClass?: FailureClass;
24
+ notes?: string;
25
+ }
26
+ /**
27
+ * Layer — optional classification in a nested build workflow.
28
+ * `builder`: the meta-agent editing a project (e.g. agent-builder Forge chat).
29
+ * `app-build`: sandbox harness that compiled + tested the generated scaffold.
30
+ * `app-runtime`: a run of the generated agent against a domain scenario.
31
+ * `meta`: any meta-eval (judge replay, correlation analysis).
32
+ */
33
+ type RunLayer = 'builder' | 'app-build' | 'app-runtime' | 'meta' | 'custom';
34
+ interface Run {
35
+ runId: string;
36
+ /**
37
+ * Stable identifier of the scenario being executed.
38
+ *
39
+ * Always populated on the persisted Run — but `TraceEmitter.startRun` accepts
40
+ * input WITHOUT this field, substituting a sensible default
41
+ * (`run.layer ?? run.tags?.['kind'] ?? 'runtime'`) when the caller has no
42
+ * curated scenario to anchor to (runtime / operator / meta-eval runs). This
43
+ * keeps the persisted shape unambiguous for downstream filters + aggregations
44
+ * while removing the boilerplate of inventing placeholder ids at the call site.
45
+ */
46
+ scenarioId: string;
47
+ variantId?: string;
48
+ datasetVersion?: string;
49
+ /** Git SHA of agent code at run time. */
50
+ codeSha?: string;
51
+ /** Hash of the prompt template + any system prompt. */
52
+ promptSha?: string;
53
+ /** Model id + date + system-prompt hash, concatenated. */
54
+ modelFingerprint?: string;
55
+ seed?: number;
56
+ /** Arbitrary environment markers (shell, docker version, tz). */
57
+ envFingerprint?: Record<string, string>;
58
+ /** Version of the redaction rules applied to this run. */
59
+ redactionVersion?: string;
60
+ /** Parent run in a nested build workflow. A builder run's children are
61
+ * app-build runs; those children are app-runtime runs. */
62
+ parentRunId?: string;
63
+ /** Stable project identifier — groups runs across chats + sessions. */
64
+ projectId?: string;
65
+ /** Chat/conversation identifier within a project. */
66
+ chatId?: string;
67
+ /** Layer classification — hint for aggregation; not enforced. */
68
+ layer?: RunLayer;
69
+ startedAt: number;
70
+ endedAt?: number;
71
+ status: RunStatus;
72
+ outcome?: RunOutcome;
73
+ budget?: BudgetSpec;
74
+ /** Free-form labels for downstream grouping. */
75
+ tags?: Record<string, string>;
76
+ }
77
+ type SpanKind = 'agent' | 'llm' | 'tool' | 'retrieval' | 'judge' | 'sandbox' | 'custom';
78
+ type SpanStatus = 'ok' | 'error';
79
+ interface SpanBase {
80
+ spanId: string;
81
+ parentSpanId?: string;
82
+ runId: string;
83
+ kind: SpanKind;
84
+ name: string;
85
+ startedAt: number;
86
+ endedAt?: number;
87
+ status?: SpanStatus;
88
+ error?: string;
89
+ /** Anything not covered by typed fields. Kept deliberately free-form. */
90
+ attributes?: Record<string, unknown>;
91
+ }
92
+ interface Message {
93
+ role: 'system' | 'user' | 'assistant' | 'tool';
94
+ content: string;
95
+ tokens?: number;
96
+ /** Multi-modal content descriptors; blobs themselves live in Artifacts. */
97
+ images?: Array<{
98
+ artifactId?: string;
99
+ url?: string;
100
+ mime?: string;
101
+ }>;
102
+ }
103
+ interface LlmSpan extends SpanBase {
104
+ kind: 'llm';
105
+ model: string;
106
+ messages: Message[];
107
+ output?: string;
108
+ inputTokens?: number;
109
+ outputTokens?: number;
110
+ cachedTokens?: number;
111
+ reasoningTokens?: number;
112
+ costUsd?: number;
113
+ finishReason?: string;
114
+ }
115
+ interface ToolSpan extends SpanBase {
116
+ kind: 'tool';
117
+ toolName: string;
118
+ args: unknown;
119
+ result?: unknown;
120
+ latencyMs?: number;
121
+ }
122
+ interface RetrievalSpan extends SpanBase {
123
+ kind: 'retrieval';
124
+ query: string;
125
+ hits: Array<{
126
+ docId: string;
127
+ score: number;
128
+ content?: string;
129
+ }>;
130
+ }
131
+ interface JudgeSpan extends SpanBase {
132
+ kind: 'judge';
133
+ judgeId: string;
134
+ /** Span this judgment applies to. */
135
+ targetSpanId: string;
136
+ dimension: string;
137
+ /** Numeric score (free-range; interpretation up to the judge). */
138
+ score: number;
139
+ rationale?: string;
140
+ evidence?: string;
141
+ }
142
+ interface SandboxSpan extends SpanBase {
143
+ kind: 'sandbox';
144
+ image?: string;
145
+ command?: string;
146
+ exitCode?: number;
147
+ testsTotal?: number;
148
+ testsPassed?: number;
149
+ stdoutHash?: string;
150
+ stderrHash?: string;
151
+ /** Duration in ms; the harness fills this explicitly (endedAt - startedAt may miss setup). */
152
+ wallMs?: number;
153
+ }
154
+ interface GenericSpan extends SpanBase {
155
+ kind: 'agent' | 'custom';
156
+ }
157
+ type Span = LlmSpan | ToolSpan | RetrievalSpan | JudgeSpan | SandboxSpan | GenericSpan;
158
+ type EventKind = 'log' | 'error' | 'budget_decrement' | 'budget_breach' | 'state_mutation' | 'policy_violation' | 'redaction_applied' | 'custom';
159
+ interface TraceEvent {
160
+ eventId: string;
161
+ runId: string;
162
+ spanId?: string;
163
+ kind: EventKind;
164
+ timestamp: number;
165
+ payload: Record<string, unknown>;
166
+ }
167
+ interface BudgetLedgerEntry {
168
+ runId: string;
169
+ dimension: keyof BudgetSpec;
170
+ limit: number;
171
+ consumed: number;
172
+ remaining: number;
173
+ timestamp: number;
174
+ breached: boolean;
175
+ /** Span that triggered this entry, if any. */
176
+ spanId?: string;
177
+ }
178
+ interface Artifact {
179
+ artifactId: string;
180
+ runId: string;
181
+ spanId?: string;
182
+ contentType: string;
183
+ sizeBytes: number;
184
+ /** sha256 in hex. */
185
+ hash: string;
186
+ /** External storage URL (R2, S3, filesystem path). */
187
+ storageUrl?: string;
188
+ /** Inline content for small blobs — keep under ~64KB. */
189
+ inlineContent?: string;
190
+ }
191
+ type FailureClass = 'success' | 'reasoning_error' | 'tool_selection_error' | 'tool_argument_error' | 'tool_recovery_failure' | 'hallucination' | 'instruction_following' | 'safety_refusal_miss' | 'policy_violation' | 'budget_exceeded' | 'format_drift' | 'permission_escalation' | 'pii_leak' | 'cost_overrun' | 'timeout' | 'sandbox_failure' | 'missing_user_data' | 'missing_domain_data' | 'missing_codebase_context' | 'missing_runtime_context' | 'missing_credentials' | 'missing_integration_connection' | 'missing_integration_scope' | 'integration_approval_required' | 'integration_auth_expired' | 'integration_provider_failure' | 'bad_integration_manifest' | 'unsafe_integration_write_denied' | 'stale_external_data' | 'bad_retrieval' | 'insufficient_evidence' | 'contradictory_evidence' | 'ambiguous_user_intent' | 'knowledge_readiness_blocked' | 'unknown';
192
+ declare const FAILURE_CLASSES: readonly FailureClass[];
193
+ declare function isLlmSpan(s: Span): s is LlmSpan;
194
+ declare function isToolSpan(s: Span): s is ToolSpan;
195
+ declare function isRetrievalSpan(s: Span): s is RetrievalSpan;
196
+ declare function isJudgeSpan(s: Span): s is JudgeSpan;
197
+ declare function isSandboxSpan(s: Span): s is SandboxSpan;
198
+
199
+ interface RunFilter {
200
+ scenarioId?: string;
201
+ variantId?: string;
202
+ status?: RunStatus;
203
+ since?: number;
204
+ until?: number;
205
+ tag?: {
206
+ key: string;
207
+ value: string;
208
+ };
209
+ parentRunId?: string;
210
+ projectId?: string;
211
+ chatId?: string;
212
+ layer?: RunLayer;
213
+ }
214
+ interface SpanFilter {
215
+ runId?: string;
216
+ parentSpanId?: string;
217
+ kind?: SpanKind;
218
+ name?: string;
219
+ toolName?: string;
220
+ judgeId?: string;
221
+ since?: number;
222
+ until?: number;
223
+ }
224
+ interface EventFilter {
225
+ runId?: string;
226
+ spanId?: string;
227
+ kind?: EventKind;
228
+ since?: number;
229
+ until?: number;
230
+ }
231
+ interface TraceStore {
232
+ appendRun(run: Run): Promise<void>;
233
+ updateRun(runId: string, patch: Partial<Run>): Promise<void>;
234
+ appendSpan(span: Span): Promise<void>;
235
+ updateSpan(spanId: string, patch: Partial<Span>): Promise<void>;
236
+ appendEvent(event: TraceEvent): Promise<void>;
237
+ appendArtifact(artifact: Artifact): Promise<void>;
238
+ appendBudgetEntry(entry: BudgetLedgerEntry): Promise<void>;
239
+ getRun(runId: string): Promise<Run | undefined>;
240
+ listRuns(filter?: RunFilter): Promise<Run[]>;
241
+ spans(filter?: SpanFilter): Promise<Span[]>;
242
+ events(filter?: EventFilter): Promise<TraceEvent[]>;
243
+ budget(runId: string): Promise<BudgetLedgerEntry[]>;
244
+ artifacts(runId: string): Promise<Artifact[]>;
245
+ }
246
+ declare class InMemoryTraceStore implements TraceStore {
247
+ private runs;
248
+ private allSpans;
249
+ private allEvents;
250
+ private allArtifacts;
251
+ private allBudget;
252
+ appendRun(run: Run): Promise<void>;
253
+ updateRun(runId: string, patch: Partial<Run>): Promise<void>;
254
+ appendSpan(span: Span): Promise<void>;
255
+ updateSpan(spanId: string, patch: Partial<Span>): Promise<void>;
256
+ appendEvent(event: TraceEvent): Promise<void>;
257
+ appendArtifact(artifact: Artifact): Promise<void>;
258
+ appendBudgetEntry(entry: BudgetLedgerEntry): Promise<void>;
259
+ getRun(runId: string): Promise<Run | undefined>;
260
+ listRuns(filter?: RunFilter): Promise<Run[]>;
261
+ spans(filter?: SpanFilter): Promise<Span[]>;
262
+ events(filter?: EventFilter): Promise<TraceEvent[]>;
263
+ budget(runId: string): Promise<BudgetLedgerEntry[]>;
264
+ artifacts(runId: string): Promise<Artifact[]>;
265
+ }
266
+ interface FileSystemTraceStoreOptions {
267
+ dir: string;
268
+ /** Roll over NDJSON files when they exceed this size in bytes. Default 32 MB. */
269
+ maxBytes?: number;
270
+ }
271
+ declare class FileSystemTraceStore implements TraceStore {
272
+ private dir;
273
+ private maxBytes;
274
+ /** Lazy in-memory index for queries — populated on first read. */
275
+ private index?;
276
+ private loaded;
277
+ constructor(options: FileSystemTraceStoreOptions);
278
+ private ensureDir;
279
+ private append;
280
+ private insertInto;
281
+ private load;
282
+ appendRun(run: Run): Promise<void>;
283
+ updateRun(runId: string, patch: Partial<Run>): Promise<void>;
284
+ appendSpan(span: Span): Promise<void>;
285
+ updateSpan(spanId: string, patch: Partial<Span>): Promise<void>;
286
+ appendEvent(event: TraceEvent): Promise<void>;
287
+ appendArtifact(artifact: Artifact): Promise<void>;
288
+ appendBudgetEntry(entry: BudgetLedgerEntry): Promise<void>;
289
+ getRun(runId: string): Promise<Run | undefined>;
290
+ listRuns(filter?: RunFilter): Promise<Run[]>;
291
+ spans(filter?: SpanFilter): Promise<Span[]>;
292
+ events(filter?: EventFilter): Promise<TraceEvent[]>;
293
+ budget(runId: string): Promise<BudgetLedgerEntry[]>;
294
+ artifacts(runId: string): Promise<Artifact[]>;
295
+ }
296
+
297
+ export { type Artifact as A, type BudgetLedgerEntry as B, type EventKind as E, type FailureClass as F, type GenericSpan as G, InMemoryTraceStore as I, type JudgeSpan as J, type LlmSpan as L, type Message as M, type RunOutcome as R, type Span as S, type TraceStore as T, type Run as a, type SpanKind as b, type ToolSpan as c, type RetrievalSpan as d, type SandboxSpan as e, type TraceEvent as f, type BudgetSpec as g, type RunFilter as h, type EventFilter as i, FAILURE_CLASSES as j, FileSystemTraceStore as k, type FileSystemTraceStoreOptions as l, type RunLayer as m, type RunStatus as n, type SpanBase as o, type SpanFilter as p, type SpanStatus as q, TRACE_SCHEMA_VERSION as r, isJudgeSpan as s, isLlmSpan as t, isRetrievalSpan as u, isSandboxSpan as v, isToolSpan as w };