@tangle-network/traces 0.23.1 → 1.0.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 (74) hide show
  1. package/README.md +61 -1078
  2. package/dist/analyst-model-call-JVUOYZ5V.js +20 -0
  3. package/dist/ask-XLS3VANY.js +39 -0
  4. package/dist/check-YF6ZHPGG.js +322 -0
  5. package/dist/chunk-3I4PJ5Q7.js +25 -0
  6. package/dist/chunk-3T62R7ON.js +5695 -0
  7. package/dist/chunk-4VKPN432.js +138 -0
  8. package/dist/chunk-6CLC7DKP.js +492 -0
  9. package/dist/chunk-7CBV5RJ2.js +535 -0
  10. package/dist/chunk-B62DOFGI.js +273 -0
  11. package/dist/chunk-CL3OQOWX.js +407 -0
  12. package/dist/chunk-DLGAKCQJ.js +782 -0
  13. package/dist/chunk-DU534HAX.js +263 -0
  14. package/dist/chunk-GLUDGUGJ.js +232 -0
  15. package/dist/chunk-J2PM5SVN.js +503 -0
  16. package/dist/chunk-M3W6TZHQ.js +381 -0
  17. package/dist/chunk-NH7HCDLB.js +759 -0
  18. package/dist/chunk-NZ5Y7UEL.js +1217 -0
  19. package/dist/chunk-O52XK7OB.js +19 -0
  20. package/dist/chunk-PYH3PL3N.js +62 -0
  21. package/dist/chunk-RZL5GAWH.js +60 -0
  22. package/dist/chunk-TR6O4S4T.js +208 -0
  23. package/dist/chunk-TW43MR5D.js +259 -0
  24. package/dist/chunk-TYLFUX42.js +228 -0
  25. package/dist/chunk-UOLRCQHC.js +120 -0
  26. package/dist/chunk-UVE5ANVV.js +3921 -0
  27. package/dist/chunk-V2OCGX57.js +53 -0
  28. package/dist/cli.js +2086 -2050
  29. package/dist/diff-ZZ6KYBPP.js +16 -0
  30. package/dist/improvement-OJQ6365E.js +25 -0
  31. package/dist/index.d.ts +1235 -4357
  32. package/dist/index.js +53 -1204
  33. package/dist/live-Y64AJ6MA.js +14 -0
  34. package/dist/mcp-ZPGTJQYQ.js +85 -0
  35. package/dist/report-JAMXRTCW.js +338 -0
  36. package/dist/run-watch-PLWTIRSV.js +649 -0
  37. package/dist/supervisor-report-RMPLLBGZ.js +29 -0
  38. package/dist/supervisor-run-context-WO6VOTGV.js +30 -0
  39. package/dist/upload-R6NMKSGQ.js +20 -0
  40. package/dist/verify-safe-C5ZXZOZ2.js +8 -0
  41. package/docs/analyze.md +76 -0
  42. package/docs/ask.md +88 -0
  43. package/docs/bundle.md +40 -0
  44. package/docs/check.md +77 -0
  45. package/docs/convert.md +44 -0
  46. package/docs/develop.md +32 -0
  47. package/docs/diff.md +38 -0
  48. package/docs/facts.md +114 -0
  49. package/docs/mcp.md +36 -0
  50. package/docs/migrate-1.0.md +33 -0
  51. package/docs/parsers.md +66 -0
  52. package/docs/release-1.0.0.md +147 -0
  53. package/docs/sdk.md +77 -0
  54. package/docs/select.md +70 -0
  55. package/docs/skills.md +46 -0
  56. package/docs/upload.md +47 -0
  57. package/docs/watch-jsonl.v1.example.jsonl +5 -0
  58. package/docs/watch.md +66 -0
  59. package/examples/README.md +9 -0
  60. package/examples/custom-analyst.ts +65 -74
  61. package/install.sh +22 -2
  62. package/package.json +8 -7
  63. package/skills/inspect-agent-traces/SKILL.md +47 -110
  64. package/dist/chunk-7DVZCCZI.js +0 -20983
  65. package/docs/replay-verify.md +0 -123
  66. package/docs/stream-findings.svg +0 -39
  67. package/docs/trace-analysts.md +0 -643
  68. package/examples/custom-backend.ts +0 -21
  69. package/examples/external-engines.ts +0 -62
  70. package/examples/improvement-config.mjs +0 -63
  71. package/examples/observe-and-alert.ts +0 -19
  72. package/examples/register-harness.ts +0 -26
  73. package/skills/build-trace-analyst/SKILL.md +0 -76
  74. package/skills/build-trace-analyst/agents/openai.yaml +0 -4
@@ -0,0 +1,20 @@
1
+ import {
2
+ ANALYST_MAX_OUTPUT_TOKENS,
3
+ UnservableModelError,
4
+ analysisEngineFromEnv,
5
+ bridgeVersion,
6
+ createAnalystModelOwner,
7
+ missingAskRequirements
8
+ } from "./chunk-GLUDGUGJ.js";
9
+ import {
10
+ DEFAULT_ANALYST_MODEL
11
+ } from "./chunk-O52XK7OB.js";
12
+ export {
13
+ ANALYST_MAX_OUTPUT_TOKENS,
14
+ DEFAULT_ANALYST_MODEL,
15
+ UnservableModelError,
16
+ analysisEngineFromEnv,
17
+ bridgeVersion,
18
+ createAnalystModelOwner,
19
+ missingAskRequirements
20
+ };
@@ -0,0 +1,39 @@
1
+ import {
2
+ createTraceQuestionCorpus,
3
+ engineCallReservationFloorUsd,
4
+ isBridgeMismatchError,
5
+ loadTraceQuestionsFile,
6
+ normalizeTraceQuestions,
7
+ renderTraceQuestionInstructions,
8
+ renderTraceQuestionPrompt,
9
+ renderTraceQuestionsReport,
10
+ runTraceQuestions,
11
+ traceCitationsInText,
12
+ writeTraceQuestionsArtifacts
13
+ } from "./chunk-NH7HCDLB.js";
14
+ import "./chunk-PYH3PL3N.js";
15
+ import {
16
+ DEFAULT_ASK_CONCURRENCY,
17
+ MAX_TRACE_QUESTION_CHARS
18
+ } from "./chunk-O52XK7OB.js";
19
+ import "./chunk-3I4PJ5Q7.js";
20
+ import "./chunk-UVE5ANVV.js";
21
+ import "./chunk-3T62R7ON.js";
22
+ import "./chunk-TR6O4S4T.js";
23
+ import "./chunk-NZ5Y7UEL.js";
24
+ import "./chunk-DU534HAX.js";
25
+ export {
26
+ DEFAULT_ASK_CONCURRENCY,
27
+ MAX_TRACE_QUESTION_CHARS,
28
+ createTraceQuestionCorpus,
29
+ engineCallReservationFloorUsd,
30
+ isBridgeMismatchError,
31
+ loadTraceQuestionsFile,
32
+ normalizeTraceQuestions,
33
+ renderTraceQuestionInstructions,
34
+ renderTraceQuestionPrompt,
35
+ renderTraceQuestionsReport,
36
+ runTraceQuestions,
37
+ traceCitationsInText,
38
+ writeTraceQuestionsArtifacts
39
+ };
@@ -0,0 +1,322 @@
1
+ import {
2
+ formatVerdict
3
+ } from "./chunk-4VKPN432.js";
4
+ import {
5
+ redactSpans
6
+ } from "./chunk-RZL5GAWH.js";
7
+ import {
8
+ parseIsoToEpochMs,
9
+ toolArgumentsFromAttributes
10
+ } from "./chunk-DU534HAX.js";
11
+
12
+ // src/check.ts
13
+ import { mkdir, readFile, writeFile } from "fs/promises";
14
+ import { join } from "path";
15
+ import {
16
+ compileTraceContractSpec,
17
+ evaluateTraceContract,
18
+ explainTraceContract,
19
+ lintTraceContractSpec
20
+ } from "@tangle-network/agent-eval";
21
+ var CONFORMANCE = "conformance";
22
+ var CHECK_EXIT = Object.freeze({
23
+ pass: 0,
24
+ fail: 1,
25
+ /** A rule or verdict could not run, the contract is malformed, or the trace is unreadable or ambiguous. */
26
+ couldNotDecide: 2
27
+ });
28
+ var AmbiguousTraceInputError = class extends Error {
29
+ name = "AmbiguousTraceInputError";
30
+ };
31
+ var ContractFileError = class extends Error {
32
+ name = "ContractFileError";
33
+ };
34
+ async function loadContract(path) {
35
+ let text;
36
+ try {
37
+ text = await readFile(path, "utf8");
38
+ } catch (error) {
39
+ throw new ContractFileError(`cannot read contract ${path}: ${errorText(error)}`);
40
+ }
41
+ let json;
42
+ try {
43
+ json = JSON.parse(text);
44
+ } catch (error) {
45
+ throw new ContractFileError(`contract ${path} is not JSON: ${errorText(error)}`);
46
+ }
47
+ try {
48
+ const findings = lintTraceContractSpec(json);
49
+ const errors = findings.filter((f) => f.level === "error");
50
+ if (errors.length > 0) {
51
+ throw new ContractFileError(
52
+ `contract ${path} contradicts itself:
53
+ ${errors.map((f) => ` ${f.path}: ${f.message} [${f.code}]`).join("\n")}`
54
+ );
55
+ }
56
+ return {
57
+ path,
58
+ contract: compileTraceContractSpec(json),
59
+ warnings: findings.map((f) => `${f.path}: ${f.message} [${f.code}]`)
60
+ };
61
+ } catch (error) {
62
+ if (error instanceof ContractFileError) throw error;
63
+ throw new ContractFileError(`contract ${path}: ${errorText(error)}`);
64
+ }
65
+ }
66
+ function contractSpansFromOtlp(spans) {
67
+ return spans.map((span) => {
68
+ const startedAt = epochMs(span.start_time);
69
+ const endedAt = epochMs(span.end_time);
70
+ const args = toolArgumentsFromAttributes(span.attributes);
71
+ const truncated = span.attributes["traces.input.truncated"] === true;
72
+ return {
73
+ spanId: span.span_id,
74
+ parentSpanId: span.parent_span_id,
75
+ name: span.name,
76
+ ...startedAt === void 0 ? {} : { startedAt },
77
+ ...endedAt === void 0 ? {} : { endedAt },
78
+ ...span.status.code === "ERROR" ? { status: "error" } : span.status.code === "OK" ? { status: "ok" } : {},
79
+ // A truncated argument capture is not the call's arguments.
80
+ ...args.argsCaptured && !truncated ? { args: args.args } : { argsCaptured: false },
81
+ attributes: span.attributes
82
+ };
83
+ });
84
+ }
85
+ function epochMs(value) {
86
+ try {
87
+ return parseIsoToEpochMs(value);
88
+ } catch {
89
+ return void 0;
90
+ }
91
+ }
92
+ function groupByTrace(spans) {
93
+ const groups = /* @__PURE__ */ new Map();
94
+ for (const span of spans) {
95
+ const list = groups.get(span.trace_id) ?? [];
96
+ list.push(span);
97
+ groups.set(span.trace_id, list);
98
+ }
99
+ return [...groups].map(([traceId, list]) => ({ traceId, spans: list }));
100
+ }
101
+ async function runCheck(contract, spans, opts = {}) {
102
+ const traces = [];
103
+ for (const group of groupByTrace(spans)) {
104
+ const verdict = evaluateTraceContract(contract, contractSpansFromOtlp(group.spans));
105
+ const check = { traceId: group.traceId, spanCount: group.spans.length, verdict };
106
+ if (verdict.status !== "pass" && opts.evidenceRoot !== void 0) {
107
+ check.evidenceDir = await writeEvidence(opts.evidenceRoot, contract, group.traceId, group.spans, verdict);
108
+ }
109
+ traces.push(check);
110
+ }
111
+ const status = traces.some((t) => t.verdict.status === "error") ? "error" : traces.every((t) => t.verdict.status === "pass") ? "pass" : "fail";
112
+ const exitCode = status === "pass" ? CHECK_EXIT.pass : status === "fail" ? CHECK_EXIT.fail : CHECK_EXIT.couldNotDecide;
113
+ return { contract: contract.name, status, exitCode, traces };
114
+ }
115
+ async function writeEvidence(root, contract, traceId, spans, verdict) {
116
+ const dir = join(root, `${safeName(contract.name)}-${safeName(traceId).slice(0, 40)}`);
117
+ await mkdir(dir, { recursive: true });
118
+ const cited = new Set(verdict.violations.map((v) => v.spanId).filter((id) => id !== void 0));
119
+ const redacted = redactSpans(spans.filter((s) => cited.has(s.span_id)));
120
+ await writeFile(join(dir, "verdict.json"), `${JSON.stringify({ traceId, verdict }, null, 2)}
121
+ `);
122
+ await writeFile(join(dir, "contract.json"), `${JSON.stringify(contract, null, 2)}
123
+ `);
124
+ await writeFile(join(dir, "explain.txt"), `${explainTraceContract(contract)}
125
+ `);
126
+ await writeFile(join(dir, "cited-spans.jsonl"), redacted.spans.map((s) => JSON.stringify(s)).join("\n") + (redacted.spans.length ? "\n" : ""));
127
+ return dir;
128
+ }
129
+ function safeName(value) {
130
+ return value.replace(/[^A-Za-z0-9._-]+/g, "_");
131
+ }
132
+ function ruleLines(verdict) {
133
+ const branchPassed = /* @__PURE__ */ new Map();
134
+ for (const e of verdict.ruleExecutions) {
135
+ if (e.alternative === void 0) continue;
136
+ branchPassed.set(e.alternative, (branchPassed.get(e.alternative) ?? true) && e.status === "pass");
137
+ }
138
+ const anyBranchPassed = [...branchPassed.values()].some(Boolean);
139
+ return verdict.ruleExecutions.map((e) => {
140
+ const rule = e.alternative ? `${e.alternative}/${e.rule}` : e.rule;
141
+ const status = e.alternative && anyBranchPassed && !branchPassed.get(e.alternative) ? "skipped" : e.status;
142
+ return {
143
+ rule,
144
+ status,
145
+ ...e.error === void 0 ? {} : { error: e.error },
146
+ details: verdict.violations.filter((x) => x.rule === rule).map((x) => x.detail)
147
+ };
148
+ });
149
+ }
150
+ function renderCheckText(report) {
151
+ const lines = [];
152
+ for (const t of report.traces) {
153
+ const v = t.verdict;
154
+ lines.push(`${v.status.toUpperCase()} contract ${report.contract} trace ${t.traceId} (${t.spanCount} spans, ${v.notes})`);
155
+ for (const r of ruleLines(v)) {
156
+ lines.push(` ${r.status.padEnd(7)} ${r.rule}${r.error ? ` ${r.error}` : ""}`);
157
+ if (r.status === "fail") for (const detail of r.details.slice(0, 5)) lines.push(` ${detail}`);
158
+ }
159
+ if (t.evidenceDir) lines.push(` evidence \u2192 ${t.evidenceDir}`);
160
+ }
161
+ return lines.join("\n");
162
+ }
163
+ function contractSuites(report) {
164
+ return report.traces.map((t) => {
165
+ const rules = ruleLines(t.verdict);
166
+ const count = (status) => rules.filter((r) => r.status === status).length;
167
+ const cases = rules.map((r) => {
168
+ const open = ` <testcase classname="${xml(report.contract)}" name="${xml(r.rule)}">`;
169
+ if (r.status === "pass") return `${open}</testcase>`;
170
+ if (r.status === "skipped") return `${open}
171
+ <skipped message="another alternative passed"/>
172
+ </testcase>`;
173
+ if (r.status === "error") {
174
+ return `${open}
175
+ <error message="${xml(r.error ?? "rule could not be evaluated")}"/>
176
+ </testcase>`;
177
+ }
178
+ return `${open}
179
+ <failure message="${xml(r.details[0] ?? "rule failed")}">${xml(r.details.join("\n"))}</failure>
180
+ </testcase>`;
181
+ });
182
+ return [
183
+ ` <testsuite name="${xml(`${report.contract} @ ${t.traceId}`)}" tests="${rules.length}" failures="${count("fail")}" errors="${count("error")}" skipped="${count("skipped")}">`,
184
+ ...cases,
185
+ " </testsuite>"
186
+ ].join("\n");
187
+ });
188
+ }
189
+ function renderGithubAnnotations(report) {
190
+ const lines = [];
191
+ for (const t of report.traces) {
192
+ for (const r of ruleLines(t.verdict)) {
193
+ if (r.status === "pass" || r.status === "skipped") continue;
194
+ const detail = r.status === "error" ? `could not be evaluated: ${r.error ?? "unknown"}` : r.details.join("\n");
195
+ lines.push(`::error title=${ghProperty(`${report.contract}: ${r.rule}`)}::${ghData(`trace ${t.traceId}: ${detail}`)}`);
196
+ }
197
+ }
198
+ return lines.join("\n");
199
+ }
200
+ function contractGate(report) {
201
+ return { gate: "contract", status: report.status === "error" ? "unknown" : report.status, report };
202
+ }
203
+ function conformanceGate(subject, validation, text) {
204
+ return { gate: "conformance", status: validation.ok ? "pass" : "fail", subject, validation, text };
205
+ }
206
+ function shareSafeGate(verdict) {
207
+ const status = verdict.status === "UNSAFE" ? "fail" : verdict.status === "UNKNOWN" ? "unknown" : "pass";
208
+ return { gate: "share-safe", status, verdict };
209
+ }
210
+ function combineGates(gates) {
211
+ const status = gates.some((gate) => gate.status === "fail") ? "fail" : gates.some((gate) => gate.status === "unknown") ? "unknown" : "pass";
212
+ const exitCode = status === "pass" ? CHECK_EXIT.pass : status === "fail" ? CHECK_EXIT.fail : CHECK_EXIT.couldNotDecide;
213
+ return { status, exitCode, gates };
214
+ }
215
+ async function writeGateEvidence(root, verdict) {
216
+ for (const gate of verdict.gates) {
217
+ if (gate.status === "pass" || gate.gate === "contract") continue;
218
+ await mkdir(root, { recursive: true });
219
+ if (gate.gate === "conformance") await writeFile(join(root, "conformance.md"), `${gate.text}
220
+ `);
221
+ else await writeFile(join(root, "share-safe.json"), `${JSON.stringify(gate.verdict, null, 2)}
222
+ `);
223
+ }
224
+ }
225
+ var CONFORMANCE_EXPLAINED = [
226
+ "conformance: whether the input can be read as a trace at all, and which analyses its spans can support.",
227
+ " fail not one entry could be read as a span (an empty export, or every line unreadable)",
228
+ " pass spans were read; each capability a field they lack costs is listed with what it empties"
229
+ ].join("\n");
230
+ function renderVerdictText(verdict) {
231
+ return verdict.gates.map((gate) => {
232
+ if (gate.gate === "contract") return renderCheckText(gate.report);
233
+ if (gate.gate === "conformance") return gate.text;
234
+ return formatVerdict(gate.verdict);
235
+ }).join("\n\n");
236
+ }
237
+ function renderVerdictJUnit(verdict) {
238
+ const suites = verdict.gates.flatMap((gate) => {
239
+ if (gate.gate === "contract") return contractSuites(gate.report);
240
+ if (gate.gate === "conformance") {
241
+ const readable = gate.validation.ok ? ' <testcase classname="conformance" name="readable"></testcase>' : ` <testcase classname="conformance" name="readable">
242
+ <failure message="not one entry could be read as a span"/>
243
+ </testcase>`;
244
+ const capabilities = gate.validation.capabilities.map((capability) => capability.available ? ` <testcase classname="conformance" name="${xml(capability.name)}"></testcase>` : ` <testcase classname="conformance" name="${xml(capability.name)}">
245
+ <skipped message="${xml(capability.reason ?? "unavailable")}"/>
246
+ </testcase>`);
247
+ const unavailable = gate.validation.capabilities.filter((capability) => !capability.available).length;
248
+ return [[
249
+ ` <testsuite name="${xml(`conformance @ ${gate.subject}`)}" tests="${capabilities.length + 1}" failures="${gate.validation.ok ? 0 : 1}" errors="0" skipped="${unavailable}">`,
250
+ readable,
251
+ ...capabilities,
252
+ " </testsuite>"
253
+ ].join("\n")];
254
+ }
255
+ const result = gate.verdict;
256
+ const findings = result.findings.map((finding) => `${finding.severity} ${finding.category}/${finding.detector} x${finding.count} at ${finding.paths.join(", ")}`);
257
+ const body = gate.status === "fail" ? `
258
+ <failure message="${xml(`${result.status}: ${findings[0] ?? ""}`)}">${xml(findings.join("\n"))}</failure>
259
+ ` : gate.status === "unknown" ? `
260
+ <error message="${xml(`UNKNOWN: ${result.unreadable[0] ?? "part of the input could not be read"}`)}">${xml(result.unreadable.join("\n"))}</error>
261
+ ` : findings.length > 0 ? `
262
+ <system-out>${xml(findings.join("\n"))}</system-out>
263
+ ` : "";
264
+ return [[
265
+ ` <testsuite name="${xml(`share-safe @ ${result.target}`)}" tests="1" failures="${gate.status === "fail" ? 1 : 0}" errors="${gate.status === "unknown" ? 1 : 0}" skipped="0">`,
266
+ ` <testcase classname="share-safe" name="${xml(result.target)}">${body}</testcase>`,
267
+ " </testsuite>"
268
+ ].join("\n")];
269
+ });
270
+ return `<?xml version="1.0" encoding="UTF-8"?>
271
+ <testsuites name="traces check">
272
+ ${suites.join("\n")}
273
+ </testsuites>
274
+ `;
275
+ }
276
+ function renderVerdictGithub(verdict) {
277
+ const lines = [];
278
+ for (const gate of verdict.gates) {
279
+ if (gate.gate === "contract") {
280
+ const annotations = renderGithubAnnotations(gate.report);
281
+ if (annotations) lines.push(annotations);
282
+ } else if (gate.gate === "conformance") {
283
+ if (!gate.validation.ok) lines.push(`::error title=${ghProperty("conformance")}::${ghData(`${gate.subject}: not one entry could be read as a span`)}`);
284
+ } else {
285
+ const result = gate.verdict;
286
+ for (const finding of result.findings) {
287
+ const kind = finding.severity === "error" ? "error" : "warning";
288
+ lines.push(`::${kind} title=${ghProperty(`share-safe: ${finding.category}/${finding.detector}`)}::${ghData(`${result.target}: x${finding.count} at ${finding.paths.join(", ")}`)}`);
289
+ }
290
+ for (const entry of result.unreadable) lines.push(`::error title=${ghProperty("share-safe: unreadable")}::${ghData(entry)}`);
291
+ }
292
+ }
293
+ return lines.join("\n");
294
+ }
295
+ function xml(value) {
296
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g, "");
297
+ }
298
+ function ghData(value) {
299
+ return value.replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A");
300
+ }
301
+ function ghProperty(value) {
302
+ return ghData(value).replace(/:/g, "%3A").replace(/,/g, "%2C");
303
+ }
304
+ function errorText(error) {
305
+ return error instanceof Error ? error.message : String(error);
306
+ }
307
+ export {
308
+ AmbiguousTraceInputError,
309
+ CHECK_EXIT,
310
+ CONFORMANCE,
311
+ CONFORMANCE_EXPLAINED,
312
+ combineGates,
313
+ conformanceGate,
314
+ contractGate,
315
+ loadContract,
316
+ renderVerdictGithub,
317
+ renderVerdictJUnit,
318
+ renderVerdictText,
319
+ runCheck,
320
+ shareSafeGate,
321
+ writeGateEvidence
322
+ };
@@ -0,0 +1,25 @@
1
+ import {
2
+ iterSerializedSpans
3
+ } from "./chunk-NZ5Y7UEL.js";
4
+
5
+ // src/analysis-store.ts
6
+ import { otlpTextToTraceAnalysisStore } from "@tangle-network/agent-eval/traces";
7
+ var DETERMINISTIC_PER_CALL_CEILING = 512 * 1024 * 1024;
8
+ function openAgenticTraceStore(spans) {
9
+ return otlpTextToTraceAnalysisStore(spans instanceof Uint8Array ? spans : exportBytes(spans));
10
+ }
11
+ function openDeterministicTraceStore(spans) {
12
+ const bytes = spans instanceof Uint8Array ? spans : exportBytes(spans);
13
+ return otlpTextToTraceAnalysisStore(bytes, { perCallByteCeiling: DETERMINISTIC_PER_CALL_CEILING });
14
+ }
15
+ function exportBytes(spans) {
16
+ const lines = [];
17
+ for (const line of iterSerializedSpans(spans)) lines.push(Buffer.from(line, "utf8"));
18
+ return Buffer.concat(lines);
19
+ }
20
+
21
+ export {
22
+ openAgenticTraceStore,
23
+ openDeterministicTraceStore,
24
+ exportBytes
25
+ };