@tangle-network/agent-eval 0.117.0 → 0.118.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 (143) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/analyst/index.d.ts +2772 -21
  3. package/dist/analyst/index.js +7 -6
  4. package/dist/analyst/index.js.map +1 -1
  5. package/dist/belief-state/index.d.ts +706 -10
  6. package/dist/belief-state/index.js +2 -1
  7. package/dist/belief-state/index.js.map +1 -1
  8. package/dist/benchmarks/index.d.ts +958 -14
  9. package/dist/benchmarks/index.js +12 -10
  10. package/dist/builder-eval/index.d.ts +449 -4
  11. package/dist/builder-eval/index.js +4 -3
  12. package/dist/builder-eval/index.js.map +1 -1
  13. package/dist/campaign/index.d.ts +4276 -74
  14. package/dist/campaign/index.js +12 -10
  15. package/dist/{chunk-VF3XSYTI.js → chunk-33JA4TFA.js} +6 -6
  16. package/dist/{chunk-4JLWXDYA.js → chunk-3EHHMC6E.js} +2 -2
  17. package/dist/{chunk-CCZIVI3F.js → chunk-BFW56GTT.js} +2 -2
  18. package/dist/{chunk-YZPO4UHR.js → chunk-DP3BBMYJ.js} +100 -143
  19. package/dist/chunk-DP3BBMYJ.js.map +1 -0
  20. package/dist/{chunk-E4BUPP7Z.js → chunk-HKUCJ437.js} +38 -66
  21. package/dist/chunk-HKUCJ437.js.map +1 -0
  22. package/dist/{chunk-HZHNRYHK.js → chunk-K6N6XJJX.js} +2 -2
  23. package/dist/chunk-KSDQVPLR.js +286 -0
  24. package/dist/chunk-KSDQVPLR.js.map +1 -0
  25. package/dist/chunk-MA6HLL3S.js +65 -0
  26. package/dist/chunk-MA6HLL3S.js.map +1 -0
  27. package/dist/{chunk-MGEHEHSN.js → chunk-OIIMMLRB.js} +11 -11
  28. package/dist/{chunk-DXZRATT5.js → chunk-OYZAPX5G.js} +3 -3
  29. package/dist/chunk-PXE2VKMX.js +140 -0
  30. package/dist/chunk-PXE2VKMX.js.map +1 -0
  31. package/dist/{chunk-ZUXV7UWZ.js → chunk-Q442S5AS.js} +73 -19
  32. package/dist/{chunk-ZUXV7UWZ.js.map → chunk-Q442S5AS.js.map} +1 -1
  33. package/dist/{chunk-ODVOOEWQ.js → chunk-QBRSJK47.js} +2 -2
  34. package/dist/{chunk-S2F4J57L.js → chunk-QKEGNI5B.js} +77 -32
  35. package/dist/chunk-QKEGNI5B.js.map +1 -0
  36. package/dist/{chunk-5UF54T55.js → chunk-S3UZOQ5Y.js} +34 -7
  37. package/dist/chunk-S3UZOQ5Y.js.map +1 -0
  38. package/dist/{chunk-FQNLDL4D.js → chunk-SVH2ANFD.js} +136 -4
  39. package/dist/chunk-SVH2ANFD.js.map +1 -0
  40. package/dist/{chunk-GQCZRZ7L.js → chunk-U5CHZ5M3.js} +9 -9
  41. package/dist/{chunk-TVVP3ZZQ.js → chunk-VQMK5FMP.js} +2 -1
  42. package/dist/{chunk-TVVP3ZZQ.js.map → chunk-VQMK5FMP.js.map} +1 -1
  43. package/dist/chunk-WDHBCA3M.js +31 -0
  44. package/dist/chunk-WDHBCA3M.js.map +1 -0
  45. package/dist/{chunk-HQPHZGL6.js → chunk-YLMUS4MM.js} +9 -9
  46. package/dist/{chunk-LQUTGLOZ.js → chunk-ZET2UAYW.js} +15 -65
  47. package/dist/chunk-ZET2UAYW.js.map +1 -0
  48. package/dist/contract/index.d.ts +4012 -38
  49. package/dist/contract/index.js +56 -29
  50. package/dist/contract/index.js.map +1 -1
  51. package/dist/control.d.ts +1013 -9
  52. package/dist/control.js +4 -3
  53. package/dist/fuzz.d.ts +194 -4
  54. package/dist/fuzz.js +3 -3
  55. package/dist/hosted/index.d.ts +498 -17
  56. package/dist/index.d.ts +10982 -1286
  57. package/dist/index.js +97 -80
  58. package/dist/index.js.map +1 -1
  59. package/dist/matrix/index.d.ts +139 -4
  60. package/dist/meta-eval/index.d.ts +862 -15
  61. package/dist/meta-eval/index.js +2 -1
  62. package/dist/meta-eval/index.js.map +1 -1
  63. package/dist/multishot/index.d.ts +214 -14
  64. package/dist/openapi.json +1 -1
  65. package/dist/pipelines/index.d.ts +392 -7
  66. package/dist/pipelines/index.js +5 -3
  67. package/dist/pipelines/index.js.map +1 -1
  68. package/dist/reporting.d.ts +1277 -17
  69. package/dist/rl.d.ts +2359 -28
  70. package/dist/rl.js +6 -5
  71. package/dist/rl.js.map +1 -1
  72. package/dist/storyboard/index.d.ts +86 -1
  73. package/dist/trace-attributes.d.ts +16 -0
  74. package/dist/trace-attributes.js +32 -0
  75. package/dist/trace-attributes.js.map +1 -0
  76. package/dist/traces.d.ts +1970 -697
  77. package/dist/traces.js +49 -32
  78. package/dist/wire/index.d.ts +655 -9
  79. package/docs/insight-report.md +44 -0
  80. package/package.json +9 -3
  81. package/dist/adversarial-B7loGVVX.d.ts +0 -19
  82. package/dist/analyst-C8HHvfJp.d.ts +0 -88
  83. package/dist/analyze-runs--2x39HZ7.d.ts +0 -81
  84. package/dist/baseline-DKq3gJpP.d.ts +0 -141
  85. package/dist/calibration-C8MTS7cw.d.ts +0 -101
  86. package/dist/chunk-5UF54T55.js.map +0 -1
  87. package/dist/chunk-E4BUPP7Z.js.map +0 -1
  88. package/dist/chunk-FQNLDL4D.js.map +0 -1
  89. package/dist/chunk-LQUTGLOZ.js.map +0 -1
  90. package/dist/chunk-S2F4J57L.js.map +0 -1
  91. package/dist/chunk-YZPO4UHR.js.map +0 -1
  92. package/dist/code-agent-session-CjZsVd19.d.ts +0 -87
  93. package/dist/control-6vuGfmDH.d.ts +0 -258
  94. package/dist/cost-ledger-DWy3XdJc.d.ts +0 -183
  95. package/dist/dataset-NENEzRgk.d.ts +0 -115
  96. package/dist/default-registry-DaK8b3fv.d.ts +0 -155
  97. package/dist/emitter-CjD7vUwv.d.ts +0 -122
  98. package/dist/errors-oeQrLqXC.d.ts +0 -74
  99. package/dist/failure-cluster-DOAcSJ87.d.ts +0 -76
  100. package/dist/feedback-trajectory-BUnM58xL.d.ts +0 -348
  101. package/dist/gepa-eESocoDi.d.ts +0 -642
  102. package/dist/index-PdX4VnPA.d.ts +0 -423
  103. package/dist/insight-report-DY4nDW9Q.d.ts +0 -310
  104. package/dist/integrity-DqlBiLyK.d.ts +0 -81
  105. package/dist/judge-calibration-7C-IDmKr.d.ts +0 -145
  106. package/dist/kind-factory-ClZmO25A.d.ts +0 -171
  107. package/dist/llm-client-qoDd18Qz.d.ts +0 -289
  108. package/dist/multi-layer-verifier-BsqKuLyN.d.ts +0 -150
  109. package/dist/off-policy-DiwuKKg7.d.ts +0 -132
  110. package/dist/outcome-store-rnXLEqSn.d.ts +0 -63
  111. package/dist/policy-edit-wG9uFEFm.d.ts +0 -455
  112. package/dist/pre-registration-BWQhJ3vz.d.ts +0 -761
  113. package/dist/provenance-DpjwyseI.d.ts +0 -541
  114. package/dist/query-CF7PG61p.d.ts +0 -35
  115. package/dist/raw-provider-sink-C46HDghv.d.ts +0 -132
  116. package/dist/release-report-C8G2i5Xi.d.ts +0 -236
  117. package/dist/researcher-C8XyxQsu.d.ts +0 -387
  118. package/dist/rubric-predictive-validity-p49lLVrE.d.ts +0 -105
  119. package/dist/run-record-BDH49H2E.d.ts +0 -360
  120. package/dist/runtime-trajectory-DGBIUt4B.d.ts +0 -49
  121. package/dist/schema-B3Q3l9Z_.d.ts +0 -201
  122. package/dist/semantic-concept-judge-CXnPEJbf.d.ts +0 -723
  123. package/dist/sequential-5iSVfzl2.d.ts +0 -139
  124. package/dist/series-convergence-D5OWMBg6.d.ts +0 -33
  125. package/dist/statistics-KUnG73jH.d.ts +0 -494
  126. package/dist/storage-DrX3v_5B.d.ts +0 -50
  127. package/dist/store-C1YxJDEK.d.ts +0 -248
  128. package/dist/store-DGqD0Pyo.d.ts +0 -116
  129. package/dist/summary-report-C5bKFfm-.d.ts +0 -445
  130. package/dist/test-graded-scenario-B0ybnPY7.d.ts +0 -166
  131. package/dist/types-BSw1rOUB.d.ts +0 -634
  132. package/dist/types-BUxNaJ8c.d.ts +0 -108
  133. package/dist/types-BkfcQnxV.d.ts +0 -313
  134. package/dist/verdict-C9MlYujm.d.ts +0 -35
  135. /package/dist/{chunk-VF3XSYTI.js.map → chunk-33JA4TFA.js.map} +0 -0
  136. /package/dist/{chunk-4JLWXDYA.js.map → chunk-3EHHMC6E.js.map} +0 -0
  137. /package/dist/{chunk-CCZIVI3F.js.map → chunk-BFW56GTT.js.map} +0 -0
  138. /package/dist/{chunk-HZHNRYHK.js.map → chunk-K6N6XJJX.js.map} +0 -0
  139. /package/dist/{chunk-MGEHEHSN.js.map → chunk-OIIMMLRB.js.map} +0 -0
  140. /package/dist/{chunk-DXZRATT5.js.map → chunk-OYZAPX5G.js.map} +0 -0
  141. /package/dist/{chunk-ODVOOEWQ.js.map → chunk-QBRSJK47.js.map} +0 -0
  142. /package/dist/{chunk-GQCZRZ7L.js.map → chunk-U5CHZ5M3.js.map} +0 -0
  143. /package/dist/{chunk-HQPHZGL6.js.map → chunk-YLMUS4MM.js.map} +0 -0
@@ -1,50 +0,0 @@
1
- import { C as CostLedger } from './cost-ledger-DWy3XdJc.js';
2
-
3
- /**
4
- * `CampaignStorage` — the filesystem seam `runCampaign` writes through
5
- * (run/cell dirs, the resumability cache, per-cell artifacts, trace spans).
6
- *
7
- * The default (`fsCampaignStorage`) is the Node filesystem — identical
8
- * behavior to the inline `node:fs` calls it replaces, so existing CLI
9
- * consumers are unaffected. `inMemoryCampaignStorage` keeps everything in a
10
- * `Map`, so the substrate runs in environments WITHOUT a filesystem
11
- * (Cloudflare Workers, Deno Deploy, other edge runtimes) — the campaign
12
- * still produces its `CampaignResult` (cells + aggregates) in memory;
13
- * artifacts/traces simply aren't persisted to disk.
14
- *
15
- * Paths are opaque keys to the in-memory adapter — it does not parse them,
16
- * so the same `join(...)`-built paths work unchanged across both adapters.
17
- */
18
- interface CampaignStorage {
19
- /** Ensure a directory exists (recursive). No-op for in-memory. */
20
- ensureDir(dir: string): void;
21
- /** Does this path exist (as a written file or an ensured dir)? */
22
- exists(path: string): boolean;
23
- /** Read a UTF-8 file; `undefined` when missing or unreadable. */
24
- read(path: string): string | undefined;
25
- /** Write a file (string or bytes). Parent dir is assumed ensured. */
26
- write(path: string, content: string | Uint8Array): void;
27
- /** Append only when the current UTF-8 byte length matches `expectedBytes`.
28
- * Returns the new length, or undefined when another writer won. */
29
- append?(path: string, content: string, expectedBytes: number): number | undefined;
30
- }
31
- /** Node-filesystem storage — the default. Lazily requires `node:fs` so the
32
- * module imports cleanly in non-Node runtimes (where the caller passes
33
- * `inMemoryCampaignStorage` instead and never constructs this).
34
- *
35
- * `createRequire(import.meta.url)` is the ESM-native lazy require — a bare
36
- * `require` is a ReferenceError under `"type": "module"`, which is exactly
37
- * the shape this package publishes. */
38
- declare function fsCampaignStorage(): CampaignStorage;
39
- /** In-memory storage for filesystem-less runtimes. Artifacts + trace spans
40
- * live in a `Map` for the duration of the run; the `CampaignResult` is
41
- * fully populated, but nothing is persisted to disk. */
42
- declare function inMemoryCampaignStorage(): CampaignStorage;
43
- /** Open the durable spend account stored beside a logical run. */
44
- declare function createRunCostLedger(input: {
45
- storage: CampaignStorage;
46
- runDir: string;
47
- costCeilingUsd?: number;
48
- }): CostLedger;
49
-
50
- export { type CampaignStorage as C, createRunCostLedger as c, fsCampaignStorage as f, inMemoryCampaignStorage as i };
@@ -1,248 +0,0 @@
1
- /**
2
- * Shared types for the trace-analyst module.
3
- *
4
- * Wire format. The store interface speaks `OtlpSpanLike` rows — one JSONL
5
- * line per span, OTLP-shaped. We do NOT depend on a specific tracing
6
- * vendor at the type level. Adapter
7
- * layers map upstream shapes onto this interface.
8
- *
9
- * Design constraint. Every read operation that can return arbitrary
10
- * payload must carry a byte budget so the agent's tool result stays
11
- * bounded regardless of input trace size. Oversized responses
12
- * substitute a deterministic summary instead of bytes — see
13
- * `ViewTraceOversized`.
14
- */
15
- /** OTLP span kind (subset we actually use). */
16
- type TraceAnalystSpanKind = 'AGENT' | 'LLM' | 'TOOL' | 'CHAIN' | 'GUARDRAIL' | 'SPAN' | 'UNKNOWN';
17
- type TraceAnalystSpanStatus = 'OK' | 'ERROR' | 'UNSET';
18
- /** Subset of OTLP span fields the analyst exposes to the agent. The
19
- * store's job is to project upstream's full span shape down to this
20
- * view — the analyst never sees vendor extensions directly. */
21
- interface TraceAnalystSpan {
22
- trace_id: string;
23
- span_id: string;
24
- parent_span_id: string | null;
25
- name: string;
26
- kind: TraceAnalystSpanKind;
27
- start_time: string;
28
- end_time: string;
29
- duration_ms: number;
30
- status: TraceAnalystSpanStatus;
31
- status_message?: string;
32
- service_name: string | null;
33
- agent_name: string | null;
34
- model_name: string | null;
35
- tool_name: string | null;
36
- /** Raw JSON-serialisable attribute map. May contain large strings;
37
- * callers must respect the per-attribute byte cap. */
38
- attributes: Record<string, unknown>;
39
- }
40
- interface TraceAnalystTraceSummary {
41
- trace_id: string;
42
- service_name: string | null;
43
- agent_name: string | null;
44
- span_count: number;
45
- has_errors: boolean;
46
- start_time: string;
47
- end_time: string;
48
- duration_ms: number;
49
- raw_jsonl_bytes: number;
50
- models: string[];
51
- tools: string[];
52
- }
53
- interface TraceAnalystFilters {
54
- /** Restrict to traces that contain at least one error span. */
55
- has_errors?: boolean;
56
- /** Match if any span's `service.name` is in this list. */
57
- service_names?: string[];
58
- /** Match if any span's `agent.name` is in this list. */
59
- agent_names?: string[];
60
- /** Match if any LLM span's `llm.model_name` is in this list. */
61
- model_names?: string[];
62
- /** Match if any tool span's `tool.name` is in this list. */
63
- tool_names?: string[];
64
- /** ISO-8601 lower bound on the trace's earliest start time. */
65
- start_time_after?: string;
66
- /** ISO-8601 upper bound on the trace's earliest start time. */
67
- start_time_before?: string;
68
- /** Single regex applied to raw JSONL bytes for the trace. Opt-in;
69
- * expensive on large datasets. Use the indexed filters above first. */
70
- regex_pattern?: string;
71
- }
72
- /** One distinct error signature across the dataset — the deterministic unit of
73
- * failure coverage. Signatures normalize volatile tokens (digits, hex/uuids,
74
- * paths, durations) out of the span `status_message` so semantically identical
75
- * failures collapse into one cluster. An analyst that accounts for every
76
- * cluster has, by construction, covered every distinct failure mode. */
77
- interface ErrorCluster {
78
- /** Normalized status_message — the cluster key. */
79
- signature: string;
80
- /** A verbatim, un-normalized exemplar message (for exact-string citation). */
81
- status_message_sample: string;
82
- /** The span name that most often carries this signature, if any. */
83
- span_name: string | null;
84
- /** The tool that most often carries this signature, if any. */
85
- tool_name: string | null;
86
- trace_count: number;
87
- span_count: number;
88
- /** trace_count / total error traces in the matched set (0..1). */
89
- prevalence: number;
90
- /** Real trace ids carrying this signature (capped), passable to view/search. */
91
- exemplar_trace_ids: string[];
92
- /** Real span ids carrying this signature (capped). */
93
- exemplar_span_ids: string[];
94
- }
95
- interface DatasetOverview {
96
- total_traces: number;
97
- raw_jsonl_bytes: number;
98
- services: string[];
99
- agents: string[];
100
- models: string[];
101
- tool_names: string[];
102
- /** Up to 20 real trace ids the agent may pass to view/search tools. */
103
- sample_trace_ids: string[];
104
- errors: {
105
- trace_count: number;
106
- span_count: number;
107
- };
108
- /** The COMPLETE deterministic error-signature population, sorted by
109
- * trace_count desc. This is the failure-coverage checklist: an analysis is
110
- * complete only when every cluster here is accounted for. Empty when the
111
- * matched set has no error spans. */
112
- error_clusters: ErrorCluster[];
113
- time_range: {
114
- earliest: string;
115
- latest: string;
116
- } | null;
117
- }
118
- interface QueryTracesPage {
119
- traces: TraceAnalystTraceSummary[];
120
- total: number;
121
- has_more: boolean;
122
- }
123
- /** Full-trace view. When the response would exceed the per-call byte
124
- * budget, `oversized` is populated INSTEAD of `spans` so the agent
125
- * knows to switch to `searchTrace` / `viewSpans`. */
126
- interface ViewTraceResult {
127
- trace_id: string;
128
- spans?: TraceAnalystSpan[];
129
- oversized?: ViewTraceOversized;
130
- }
131
- interface ViewTraceOversized {
132
- span_count: number;
133
- /** Names with their counts, sorted desc. Capped at 20 entries. */
134
- top_span_names: Array<[string, number]>;
135
- /** Largest single span body (bytes after attribute-cap projection). */
136
- span_response_bytes_max: number;
137
- error_span_count: number;
138
- }
139
- interface ViewSpansResult {
140
- trace_id: string;
141
- spans: TraceAnalystSpan[];
142
- /** Number of requested span ids that were not found in the trace. */
143
- missing_span_ids: string[];
144
- /** Number of attribute fields truncated to fit the per-attribute cap. */
145
- truncated_attribute_count: number;
146
- }
147
- interface SpanMatchRecord {
148
- trace_id: string;
149
- span_id: string;
150
- span_name: string;
151
- span_kind: TraceAnalystSpanKind;
152
- /** JSON pointer-style path to the matched value, e.g.
153
- * `attributes."llm.input_messages"[2].content`. */
154
- attribute_path: string;
155
- matched_text: string;
156
- context_before: string;
157
- context_after: string;
158
- match_offset: number;
159
- }
160
- interface SearchTraceResult {
161
- trace_id: string;
162
- hits: SpanMatchRecord[];
163
- total_matches: number;
164
- has_more: boolean;
165
- }
166
- interface SearchSpanResult {
167
- trace_id: string;
168
- span_id: string;
169
- hits: SpanMatchRecord[];
170
- total_matches: number;
171
- has_more: boolean;
172
- }
173
- /** Tunable byte budgets for bounded RLM tool output. */
174
- interface TraceAnalystByteBudgets {
175
- /** Max bytes any single tool response may emit. Hard ceiling enforced
176
- * by the store; oversized → summary. Default 150_000. */
177
- perCallByteCeiling: number;
178
- /** Per-attribute string truncation cap on `viewTrace` (discovery scan).
179
- * Default 4096. */
180
- perAttributeViewBudget: number;
181
- /** Per-attribute string truncation cap on `viewSpans` (surgical reads).
182
- * Default 16384. */
183
- perAttributeSpanBudget: number;
184
- /** Per-attribute cap on a single match record's `matched_text` and
185
- * context window. Default 1024. */
186
- perMatchTextBudget: number;
187
- }
188
- declare const DEFAULT_TRACE_ANALYST_BUDGETS: TraceAnalystByteBudgets;
189
- /** Marker substituted in place of truncated string payloads. Callers
190
- * parsing tool output can detect it deterministically. */
191
- declare const TRACE_ANALYST_TRUNCATION_MARKER_PREFIX = "[trace-analyst truncated:";
192
-
193
- /**
194
- * `TraceAnalysisStore` — read-side interface the trace-analyst calls
195
- * through. Six operations, all bounded:
196
- *
197
- * - `getOverview(filters?)` — dataset rollup + sample trace ids.
198
- * - `queryTraces(filters?, limit, offset)` — paginated summaries.
199
- * - `countTraces(filters?)` — cheap count without materialisation.
200
- * - `viewTrace(trace_id, perAttrCap)` — full span list, oversized → summary.
201
- * - `viewSpans(trace_id, span_ids, perAttrCap)` — surgical span fetch.
202
- * - `searchTrace(trace_id, regex, max_matches)` — bounded regex hits.
203
- * - `searchSpan(trace_id, span_id, regex, max_matches)` — single-span search.
204
- *
205
- * Multiple implementations ship in the core (`OtlpFileTraceStore`).
206
- * Downstream callers can supply their own — e.g. a DuckDB-backed
207
- * adapter or an in-memory adapter for tests — by implementing this
208
- * interface.
209
- *
210
- * Filters compose with AND semantics. Empty/undefined fields impose
211
- * no constraint. `regex_pattern` is the only opt-in raw-bytes scan —
212
- * implementations may skip it via `count`/`overview` when not set.
213
- */
214
-
215
- interface TraceAnalysisStore {
216
- getOverview(filters?: TraceAnalystFilters): Promise<DatasetOverview>;
217
- queryTraces(opts: {
218
- filters?: TraceAnalystFilters;
219
- limit: number;
220
- offset?: number;
221
- }): Promise<QueryTracesPage>;
222
- countTraces(filters?: TraceAnalystFilters): Promise<number>;
223
- viewTrace(opts: {
224
- trace_id: string;
225
- /** Override per-attribute byte cap. Defaults to discovery budget. */
226
- per_attribute_byte_cap?: number;
227
- }): Promise<ViewTraceResult>;
228
- viewSpans(opts: {
229
- trace_id: string;
230
- span_ids: readonly string[];
231
- /** Override per-attribute byte cap. Defaults to surgical budget. */
232
- per_attribute_byte_cap?: number;
233
- }): Promise<ViewSpansResult>;
234
- searchTrace(opts: {
235
- trace_id: string;
236
- regex_pattern: string;
237
- /** Hard cap on matches returned. Default 50. */
238
- max_matches?: number;
239
- }): Promise<SearchTraceResult>;
240
- searchSpan(opts: {
241
- trace_id: string;
242
- span_id: string;
243
- regex_pattern: string;
244
- max_matches?: number;
245
- }): Promise<SearchSpanResult>;
246
- }
247
-
248
- export { DEFAULT_TRACE_ANALYST_BUDGETS as D, type ErrorCluster as E, type QueryTracesPage as Q, type SearchSpanResult as S, type TraceAnalysisStore as T, type ViewSpansResult as V, type TraceAnalystSpan as a, type DatasetOverview as b, type SearchTraceResult as c, type SpanMatchRecord as d, TRACE_ANALYST_TRUNCATION_MARKER_PREFIX as e, type TraceAnalystByteBudgets as f, type TraceAnalystFilters as g, type TraceAnalystSpanKind as h, type TraceAnalystSpanStatus as i, type TraceAnalystTraceSummary as j, type ViewTraceOversized as k, type ViewTraceResult as l };
@@ -1,116 +0,0 @@
1
- import { R as Run, S as Span, e as TraceEvent, A as Artifact, B as BudgetLedgerEntry, f as RunStatus, g as RunLayer, b as SpanKind, E as EventKind } from './schema-B3Q3l9Z_.js';
2
-
3
- interface RunFilter {
4
- scenarioId?: string;
5
- variantId?: string;
6
- status?: RunStatus;
7
- since?: number;
8
- until?: number;
9
- tag?: {
10
- key: string;
11
- value: string;
12
- };
13
- parentRunId?: string;
14
- projectId?: string;
15
- chatId?: string;
16
- layer?: RunLayer;
17
- }
18
- interface SpanFilter {
19
- runId?: string;
20
- parentSpanId?: string;
21
- kind?: SpanKind;
22
- name?: string;
23
- toolName?: string;
24
- judgeId?: string;
25
- since?: number;
26
- until?: number;
27
- }
28
- interface EventFilter {
29
- runId?: string;
30
- spanId?: string;
31
- kind?: EventKind;
32
- since?: number;
33
- until?: number;
34
- }
35
- interface TraceStore {
36
- appendRun(run: Run): Promise<void>;
37
- updateRun(runId: string, patch: Partial<Run>): Promise<void>;
38
- appendSpan(span: Span): Promise<void>;
39
- updateSpan(spanId: string, patch: Partial<Span>): Promise<void>;
40
- appendEvent(event: TraceEvent): Promise<void>;
41
- appendArtifact(artifact: Artifact): Promise<void>;
42
- appendBudgetEntry(entry: BudgetLedgerEntry): Promise<void>;
43
- getRun(runId: string): Promise<Run | undefined>;
44
- listRuns(filter?: RunFilter): Promise<Run[]>;
45
- spans(filter?: SpanFilter): Promise<Span[]>;
46
- events(filter?: EventFilter): Promise<TraceEvent[]>;
47
- budget(runId: string): Promise<BudgetLedgerEntry[]>;
48
- artifacts(runId: string): Promise<Artifact[]>;
49
- }
50
- declare class InMemoryTraceStore implements TraceStore {
51
- private runs;
52
- private allSpans;
53
- private allEvents;
54
- private allArtifacts;
55
- private allBudget;
56
- appendRun(run: Run): Promise<void>;
57
- updateRun(runId: string, patch: Partial<Run>): Promise<void>;
58
- appendSpan(span: Span): Promise<void>;
59
- updateSpan(spanId: string, patch: Partial<Span>): Promise<void>;
60
- appendEvent(event: TraceEvent): Promise<void>;
61
- appendArtifact(artifact: Artifact): Promise<void>;
62
- appendBudgetEntry(entry: BudgetLedgerEntry): Promise<void>;
63
- getRun(runId: string): Promise<Run | undefined>;
64
- listRuns(filter?: RunFilter): Promise<Run[]>;
65
- spans(filter?: SpanFilter): Promise<Span[]>;
66
- events(filter?: EventFilter): Promise<TraceEvent[]>;
67
- budget(runId: string): Promise<BudgetLedgerEntry[]>;
68
- artifacts(runId: string): Promise<Artifact[]>;
69
- }
70
- interface FileSystemTraceStoreOptions {
71
- dir: string;
72
- /** Roll over NDJSON files when they exceed this size in bytes. Default 32 MB. */
73
- maxBytes?: number;
74
- }
75
- declare class FileSystemTraceStore implements TraceStore {
76
- private dir;
77
- private maxBytes;
78
- /** Lazy in-memory index for queries — populated on first read. */
79
- private index?;
80
- /** Memoized index build — concurrent first reads share one build, and an
81
- * append racing an in-flight load awaits this so its row isn't lost. */
82
- private indexPromise?;
83
- /** Strictly-increasing rollover stamp. Date.now() alone collides when two
84
- * rollovers land in the same millisecond, overwriting a rolled file. */
85
- private lastRolloverStamp;
86
- /**
87
- * Per-file append serialization. stat → conditional-rename → appendFile is a
88
- * read-modify-write on the active file; without a lock two concurrent appends
89
- * to the same `name` can both pass the size check (exceeding maxBytes) or one
90
- * can append to a file the other just renamed away. Each entry chains the
91
- * next append behind the prior one for that file.
92
- */
93
- private appendLocks;
94
- constructor(options: FileSystemTraceStoreOptions);
95
- private ensureDir;
96
- private append;
97
- private appendLocked;
98
- private insertInto;
99
- private load;
100
- private buildIndex;
101
- appendRun(run: Run): Promise<void>;
102
- updateRun(runId: string, patch: Partial<Run>): Promise<void>;
103
- appendSpan(span: Span): Promise<void>;
104
- updateSpan(spanId: string, patch: Partial<Span>): Promise<void>;
105
- appendEvent(event: TraceEvent): Promise<void>;
106
- appendArtifact(artifact: Artifact): Promise<void>;
107
- appendBudgetEntry(entry: BudgetLedgerEntry): Promise<void>;
108
- getRun(runId: string): Promise<Run | undefined>;
109
- listRuns(filter?: RunFilter): Promise<Run[]>;
110
- spans(filter?: SpanFilter): Promise<Span[]>;
111
- events(filter?: EventFilter): Promise<TraceEvent[]>;
112
- budget(runId: string): Promise<BudgetLedgerEntry[]>;
113
- artifacts(runId: string): Promise<Artifact[]>;
114
- }
115
-
116
- export { type EventFilter as E, FileSystemTraceStore as F, InMemoryTraceStore as I, type RunFilter as R, type SpanFilter as S, type TraceStore as T, type FileSystemTraceStoreOptions as a };