@tangle-network/traces 0.17.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-SGQOMHZP.js → chunk-TCTZ7DUY.js} +123 -48
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1025,8 +1025,8 @@ var OTLP_WRITE_CHUNK_CHARS = 4 * 1024 * 1024;
|
|
|
1025
1025
|
async function writeOtlpFile(spans, outPath) {
|
|
1026
1026
|
const { mkdtemp: mkdtemp8, open: open2 } = await import("fs/promises");
|
|
1027
1027
|
const { tmpdir: tmpdir8 } = await import("os");
|
|
1028
|
-
const { join:
|
|
1029
|
-
const path = outPath ??
|
|
1028
|
+
const { join: join36 } = await import("path");
|
|
1029
|
+
const path = outPath ?? join36(await mkdtemp8(join36(tmpdir8(), "traces-")), "spans.otlp.jsonl");
|
|
1030
1030
|
const handle = await open2(path, "w");
|
|
1031
1031
|
try {
|
|
1032
1032
|
let chunk = "";
|
|
@@ -3985,9 +3985,9 @@ function itemCountsJson(counts) {
|
|
|
3985
3985
|
}
|
|
3986
3986
|
function placeInnerSpans(pending, windows) {
|
|
3987
3987
|
return pending.map((entry) => {
|
|
3988
|
-
const { parent, join:
|
|
3988
|
+
const { parent, join: join36 } = joinItem(windows, entry.startMs, entry.endMs);
|
|
3989
3989
|
if (parent) entry.span.parent_span_id = parent.span_id;
|
|
3990
|
-
entry.span.attributes["traces.codex.item_join"] =
|
|
3990
|
+
entry.span.attributes["traces.codex.item_join"] = join36;
|
|
3991
3991
|
return entry.span;
|
|
3992
3992
|
});
|
|
3993
3993
|
}
|
|
@@ -15311,6 +15311,7 @@ function assertPositiveInteger(name, value) {
|
|
|
15311
15311
|
import { createHash as createHash14 } from "crypto";
|
|
15312
15312
|
import { request as httpRequest } from "http";
|
|
15313
15313
|
import { request as httpsRequest } from "https";
|
|
15314
|
+
import { join as join25 } from "path";
|
|
15314
15315
|
var DEFAULT_BRIDGE_URL = "http://localhost:4181";
|
|
15315
15316
|
var DEFAULT_MODEL = "prime/zai/glm-5.2";
|
|
15316
15317
|
var DEFAULT_TIMEOUT_MS = 12e5;
|
|
@@ -15326,9 +15327,9 @@ async function fileDelivery(otlpPath, perAttributeCharCap, signal) {
|
|
|
15326
15327
|
signal?.throwIfAborted();
|
|
15327
15328
|
const { copyFile: copyFile2, mkdtemp: mkdtemp8, stat: stat19 } = await import("fs/promises");
|
|
15328
15329
|
const { tmpdir: tmpdir8 } = await import("os");
|
|
15329
|
-
const { join:
|
|
15330
|
-
const cwd = await mkdtemp8(
|
|
15331
|
-
await copyFile2(otlpPath,
|
|
15330
|
+
const { join: join36 } = await import("path");
|
|
15331
|
+
const cwd = await mkdtemp8(join36(tmpdir8(), "traces-prime-"));
|
|
15332
|
+
await copyFile2(otlpPath, join36(cwd, TRAJECTORY_FILE_NAME));
|
|
15332
15333
|
const artifactBytes = (await stat19(otlpPath)).size;
|
|
15333
15334
|
return { mode: "file-cwd", perAttributeCharCap, renderedChars: artifactBytes, cwd, fileName: TRAJECTORY_FILE_NAME };
|
|
15334
15335
|
}
|
|
@@ -15482,9 +15483,15 @@ var FILE_DELIVERY_CONTRACT_LINES = [
|
|
|
15482
15483
|
"Do NOT include a rationale field. Keep every string SHORT \u2014 long strings get corrupted in transport and void your work.",
|
|
15483
15484
|
`Report at most ${MAX_FINDINGS} findings; a finding cites 1..${MAX_SPAN_IDS_PER_FINDING} span_ids, each copied VERBATIM from a span in ${TRAJECTORY_FILE_NAME}.`,
|
|
15484
15485
|
'"findings" is [] only for a clean trajectory.',
|
|
15486
|
+
`PAYLOAD CHANNEL \u2014 do this BEFORE your final message: WRITE the complete JSON object (same schema as`,
|
|
15487
|
+
"the reply contract) to a file named findings.json in your working directory, using your tools (python",
|
|
15488
|
+
"or shell). One assistant message has an output-token cap and a cut reply is discarded unread;",
|
|
15489
|
+
"findings.json is the durable channel a large result must travel on. Write it first, incrementally if",
|
|
15490
|
+
"it is long, THEN send your final message: the fenced ```json block when it is short enough to fit,",
|
|
15491
|
+
"otherwise ONE line only \u2014 `findings written to findings.json`.",
|
|
15485
15492
|
"FINAL MESSAGE RULE: after your REPL work is done, send ONE last message that contains NOTHING BUT the",
|
|
15486
|
-
"fenced ```json block above \u2014 no preamble, no summary, no code identifiers
|
|
15487
|
-
"message is prose or a partial block is discarded unread."
|
|
15493
|
+
"fenced ```json block (or the one-line pointer above) \u2014 no preamble, no summary, no code identifiers",
|
|
15494
|
+
"around it. A reply whose last message is prose or a partial block is discarded unread."
|
|
15488
15495
|
];
|
|
15489
15496
|
function buildPrompt(question, projection) {
|
|
15490
15497
|
if (projection.delivery.mode === "file-cwd") {
|
|
@@ -15521,7 +15528,7 @@ function buildRepairPrompt(parseDefect, previousReply, finishReason) {
|
|
|
15521
15528
|
' "severity": "critical"|"high"|"medium"|"low"|"info", "area": string (max 40 chars),',
|
|
15522
15529
|
' "claim": string (max 200 chars), "action": string (optional, max 200 chars), "confidence": number 0..1}',
|
|
15523
15530
|
"No rationale field. Keep every string SHORT.",
|
|
15524
|
-
truncated ? "Your previous reply was cut off by the output limit
|
|
15531
|
+
truncated ? "Your previous reply was cut off by the output limit. Write the corrected JSON to a file named findings.json in your working directory with your tools (at most 3 findings \u2014 your strongest \u2014 with terse strings, claim and action under 120 chars each), then reply with ONE line: findings written to findings.json." : "Preserve the span ids and verdicts of your previous reply exactly; shorten prose freely.",
|
|
15525
15532
|
"",
|
|
15526
15533
|
"PREVIOUS REPLY:",
|
|
15527
15534
|
previousReply
|
|
@@ -15556,6 +15563,59 @@ function parseDefectOf(parsed) {
|
|
|
15556
15563
|
if (!Array.isArray(parsed.findings)) return 'JSON has no "findings" array';
|
|
15557
15564
|
return null;
|
|
15558
15565
|
}
|
|
15566
|
+
var FINDINGS_FILE_MAX_BYTES = 256 * 1024;
|
|
15567
|
+
var FINDINGS_FILE_NAME = "findings.json";
|
|
15568
|
+
async function readFindingsFile2(cwd, signal) {
|
|
15569
|
+
signal?.throwIfAborted();
|
|
15570
|
+
const path = join25(cwd, FINDINGS_FILE_NAME);
|
|
15571
|
+
let raw;
|
|
15572
|
+
const { readFile: readFile20, stat: stat19 } = await import("fs/promises");
|
|
15573
|
+
try {
|
|
15574
|
+
const size = (await stat19(path)).size;
|
|
15575
|
+
if (size > FINDINGS_FILE_MAX_BYTES) {
|
|
15576
|
+
return { parsed: null, receipt: `${FINDINGS_FILE_NAME} is ${size} bytes (cap ${FINDINGS_FILE_MAX_BYTES}); refused` };
|
|
15577
|
+
}
|
|
15578
|
+
raw = await readFile20(path, "utf8");
|
|
15579
|
+
} catch {
|
|
15580
|
+
return void 0;
|
|
15581
|
+
}
|
|
15582
|
+
const direct = extractJsonObject(raw);
|
|
15583
|
+
if (direct !== null && parseDefectOf(direct) === null) {
|
|
15584
|
+
return { parsed: direct, receipt: `${FINDINGS_FILE_NAME} read (${raw.length} chars)` };
|
|
15585
|
+
}
|
|
15586
|
+
const rows = [];
|
|
15587
|
+
let droppedLines = 0;
|
|
15588
|
+
let answer = null;
|
|
15589
|
+
for (const [index, line] of raw.split("\n").entries()) {
|
|
15590
|
+
const trimmed = line.trim();
|
|
15591
|
+
if (trimmed.length === 0) continue;
|
|
15592
|
+
const row = extractJsonObject(trimmed);
|
|
15593
|
+
if (row === null) {
|
|
15594
|
+
droppedLines += 1;
|
|
15595
|
+
continue;
|
|
15596
|
+
}
|
|
15597
|
+
if (typeof row.answer === "string" && !Array.isArray(row.findings)) {
|
|
15598
|
+
if (answer === null) answer = row.answer;
|
|
15599
|
+
continue;
|
|
15600
|
+
}
|
|
15601
|
+
if (Array.isArray(row.findings)) {
|
|
15602
|
+
rows.push(...row.findings);
|
|
15603
|
+
if (answer === null && typeof row.answer === "string") answer = row.answer;
|
|
15604
|
+
continue;
|
|
15605
|
+
}
|
|
15606
|
+
rows.push(row);
|
|
15607
|
+
}
|
|
15608
|
+
if (rows.length === 0) {
|
|
15609
|
+
return {
|
|
15610
|
+
parsed: null,
|
|
15611
|
+
receipt: `${FINDINGS_FILE_NAME} unreadable (no parseable object${droppedLines > 0 ? `, ${droppedLines} malformed line(s) dropped` : ""})`
|
|
15612
|
+
};
|
|
15613
|
+
}
|
|
15614
|
+
return {
|
|
15615
|
+
parsed: { ...answer !== null ? { answer } : {}, findings: rows },
|
|
15616
|
+
receipt: `${FINDINGS_FILE_NAME} read as JSONL (${rows.length} row(s)${droppedLines > 0 ? `, ${droppedLines} malformed line(s) dropped` : ""})`
|
|
15617
|
+
};
|
|
15618
|
+
}
|
|
15559
15619
|
function findingRowDefect(row, spanTraces) {
|
|
15560
15620
|
if (!row || typeof row !== "object" || Array.isArray(row)) return "row is not an object";
|
|
15561
15621
|
const record2 = row;
|
|
@@ -15779,11 +15839,25 @@ function primeAnalyzer(opts = {}) {
|
|
|
15779
15839
|
parsed = extractJsonObject(repairReply.content);
|
|
15780
15840
|
parseDefect = parseDefectOf(parsed);
|
|
15781
15841
|
}
|
|
15842
|
+
let channel = "reply";
|
|
15843
|
+
let channelReceipt = "";
|
|
15782
15844
|
if (parseDefect !== null) {
|
|
15783
|
-
|
|
15784
|
-
|
|
15785
|
-
|
|
15786
|
-
|
|
15845
|
+
const deliveryCwd2 = projection.delivery.mode === "file-cwd" ? projection.delivery.cwd : void 0;
|
|
15846
|
+
const file = deliveryCwd2 !== void 0 ? await readFindingsFile2(deliveryCwd2, analyzeOpts.signal).catch(() => void 0) : void 0;
|
|
15847
|
+
if (file?.parsed !== null && file !== void 0) {
|
|
15848
|
+
parsed = file.parsed;
|
|
15849
|
+
parseDefect = parseDefectOf(parsed);
|
|
15850
|
+
if (parseDefect === null) {
|
|
15851
|
+
channel = FINDINGS_FILE_NAME;
|
|
15852
|
+
channelReceipt = file.receipt;
|
|
15853
|
+
}
|
|
15854
|
+
}
|
|
15855
|
+
if (parseDefect !== null) {
|
|
15856
|
+
return failure(
|
|
15857
|
+
reply.content,
|
|
15858
|
+
`${parseDefect} in prime reply${repairAttempted ? " even after the bounded repair turn" : ""}` + (file === void 0 ? "; no findings.json in the run directory" : `; ${file.receipt}`) + `; ${renderUsage(usage)}`
|
|
15859
|
+
);
|
|
15860
|
+
}
|
|
15787
15861
|
}
|
|
15788
15862
|
const rows = parsed.findings.slice(0, MAX_FINDINGS);
|
|
15789
15863
|
const overflow = parsed.findings.length - rows.length;
|
|
@@ -15804,6 +15878,7 @@ function primeAnalyzer(opts = {}) {
|
|
|
15804
15878
|
`findings: ${findings.length} mapped, ${rejected.length} rejected` + (overflow > 0 ? `, ${overflow} over the ${MAX_FINDINGS}-finding cap dropped` : ""),
|
|
15805
15879
|
...rejected,
|
|
15806
15880
|
deliveryLine,
|
|
15881
|
+
...channel !== "reply" ? [`reply channel: ${channel} \u2014 ${channelReceipt}; the chat reply was unparseable, the payload file carried the result`] : [],
|
|
15807
15882
|
`repair: ${repairAttempted ? "attempted (succeeded)" : "not needed"}`,
|
|
15808
15883
|
renderUsage(usage),
|
|
15809
15884
|
...findings.length === 0 ? ["zero findings \u2014 an honest null, not a failure"] : []
|
|
@@ -15908,7 +15983,7 @@ async function applyRedactor(spans, redactor) {
|
|
|
15908
15983
|
import { createHash as createHash15 } from "crypto";
|
|
15909
15984
|
import { mkdtemp as mkdtemp6, readFile as readFile12, writeFile as writeFile8 } from "fs/promises";
|
|
15910
15985
|
import { tmpdir as tmpdir6 } from "os";
|
|
15911
|
-
import { join as
|
|
15986
|
+
import { join as join26 } from "path";
|
|
15912
15987
|
import {
|
|
15913
15988
|
firstNumberAttr as firstNumberAttr2,
|
|
15914
15989
|
LLM_CACHED_TOKEN_ATTR_KEYS,
|
|
@@ -16579,7 +16654,7 @@ async function exportTraceEvidenceFile(inputPath, opts = {}) {
|
|
|
16579
16654
|
}
|
|
16580
16655
|
async function writeTraceEvidenceExportFile(inputPath, outPath, opts = {}) {
|
|
16581
16656
|
const result = await exportTraceEvidenceFile(inputPath, opts);
|
|
16582
|
-
const path = outPath ??
|
|
16657
|
+
const path = outPath ?? join26(await mkdtemp6(join26(tmpdir6(), "traces-export-")), "spans.openinference.jsonl");
|
|
16583
16658
|
await writeFile8(path, serializeSpans(result.spans), "utf8");
|
|
16584
16659
|
return { ...result, path };
|
|
16585
16660
|
}
|
|
@@ -16587,7 +16662,7 @@ async function writeTraceEvidenceExportFile(inputPath, outPath, opts = {}) {
|
|
|
16587
16662
|
// src/inspect.ts
|
|
16588
16663
|
import { mkdtemp as mkdtemp7, readFile as readFile13, writeFile as writeFile9 } from "fs/promises";
|
|
16589
16664
|
import { tmpdir as tmpdir7 } from "os";
|
|
16590
|
-
import { basename as basename14, join as
|
|
16665
|
+
import { basename as basename14, join as join27 } from "path";
|
|
16591
16666
|
var severityRank2 = {
|
|
16592
16667
|
high: 0,
|
|
16593
16668
|
medium: 1,
|
|
@@ -16876,7 +16951,7 @@ async function readSessionIndexFile(path) {
|
|
|
16876
16951
|
return parsed;
|
|
16877
16952
|
}
|
|
16878
16953
|
async function writeInspectionReportFile(report, outPath) {
|
|
16879
|
-
const path = outPath ??
|
|
16954
|
+
const path = outPath ?? join27(await mkdtemp7(join27(tmpdir7(), "traces-inspect-")), "inspection-report.md");
|
|
16880
16955
|
await writeFile9(path, renderInspectionReport(report), "utf8");
|
|
16881
16956
|
return path;
|
|
16882
16957
|
}
|
|
@@ -17310,7 +17385,7 @@ async function streamSessions(opts) {
|
|
|
17310
17385
|
|
|
17311
17386
|
// src/supervisor-run-context.ts
|
|
17312
17387
|
import { readFile as readFile14, stat as stat16 } from "fs/promises";
|
|
17313
|
-
import { basename as basename15, join as
|
|
17388
|
+
import { basename as basename15, join as join28 } from "path";
|
|
17314
17389
|
import { materializeTreeView } from "@tangle-network/agent-runtime/kernel";
|
|
17315
17390
|
import {
|
|
17316
17391
|
readRuntimeSupervisorRun
|
|
@@ -17472,14 +17547,14 @@ function parseInstant(v) {
|
|
|
17472
17547
|
}
|
|
17473
17548
|
async function readFileRunContext(runDir, opts = {}) {
|
|
17474
17549
|
const sources = await readRuntimeSupervisorRun(runDir);
|
|
17475
|
-
const coordination = readCoordinationLog(await readMaybe(
|
|
17550
|
+
const coordination = readCoordinationLog(await readMaybe(join28(runDir, COORDINATION_LOG_FILE)));
|
|
17476
17551
|
return {
|
|
17477
17552
|
...sources,
|
|
17478
17553
|
instanceId: opts.instanceId !== void 0 ? opts.instanceId : sources.instanceId,
|
|
17479
17554
|
arm: opts.arm !== void 0 ? opts.arm : basename15(runDir),
|
|
17480
17555
|
workers: sources.workers !== null && coordination.present ? workerSources(sources.workers, coordination) : sources.workers,
|
|
17481
17556
|
...sources.journal !== null ? {
|
|
17482
|
-
rootTranscriptRef:
|
|
17557
|
+
rootTranscriptRef: join28(runDir, SPAWN_JOURNAL_FILE),
|
|
17483
17558
|
traceCommand: `traces watch ${runDir}`
|
|
17484
17559
|
} : {}
|
|
17485
17560
|
};
|
|
@@ -17488,7 +17563,7 @@ function fileRunContextSupervisorRunReader(runDir, opts = {}) {
|
|
|
17488
17563
|
return { runRef: runDir, read: () => readFileRunContext(runDir, opts) };
|
|
17489
17564
|
}
|
|
17490
17565
|
async function isFileRunContextDir(runDir) {
|
|
17491
|
-
return stat16(
|
|
17566
|
+
return stat16(join28(runDir, SPAWN_JOURNAL_FILE)).then((s) => s.isFile()).catch(() => false);
|
|
17492
17567
|
}
|
|
17493
17568
|
function parseJsonObject(text2) {
|
|
17494
17569
|
if (text2 === null) return null;
|
|
@@ -17554,9 +17629,9 @@ function mergeRolls(a, b) {
|
|
|
17554
17629
|
};
|
|
17555
17630
|
}
|
|
17556
17631
|
async function readRunContextSnapshot(runDir) {
|
|
17557
|
-
const journal = readRunContextJournal(await readMaybe(
|
|
17558
|
-
const coordination = readCoordinationLog(await readMaybe(
|
|
17559
|
-
const resultText = await readMaybe(
|
|
17632
|
+
const journal = readRunContextJournal(await readMaybe(join28(runDir, SPAWN_JOURNAL_FILE)));
|
|
17633
|
+
const coordination = readCoordinationLog(await readMaybe(join28(runDir, COORDINATION_LOG_FILE)));
|
|
17634
|
+
const resultText = await readMaybe(join28(runDir, RESULT_FILE));
|
|
17560
17635
|
const result = parseResult(resultText);
|
|
17561
17636
|
const view = safeTreeView(journal.events);
|
|
17562
17637
|
const nodes = view === null ? [] : orderNodes(view, journal);
|
|
@@ -17739,7 +17814,7 @@ function wrap(text2, indent) {
|
|
|
17739
17814
|
|
|
17740
17815
|
// src/run-span-tree.ts
|
|
17741
17816
|
import { readdir as readdir18 } from "fs/promises";
|
|
17742
|
-
import { join as
|
|
17817
|
+
import { join as join29 } from "path";
|
|
17743
17818
|
import {
|
|
17744
17819
|
firstNumberAttr as firstNumberAttr3,
|
|
17745
17820
|
LLM_COST_ATTR_KEYS as LLM_COST_ATTR_KEYS2,
|
|
@@ -18014,7 +18089,7 @@ async function findSpanSourceFiles(dir) {
|
|
|
18014
18089
|
const found = [];
|
|
18015
18090
|
const entries = await readdir18(dir, { withFileTypes: true }).catch(() => []);
|
|
18016
18091
|
for (const entry of entries) {
|
|
18017
|
-
const child =
|
|
18092
|
+
const child = join29(dir, entry.name);
|
|
18018
18093
|
if (entry.isFile()) {
|
|
18019
18094
|
if (SPAN_FILE_PATTERN.test(entry.name)) found.push(child);
|
|
18020
18095
|
continue;
|
|
@@ -18022,7 +18097,7 @@ async function findSpanSourceFiles(dir) {
|
|
|
18022
18097
|
if (!entry.isDirectory()) continue;
|
|
18023
18098
|
const nested = await readdir18(child, { withFileTypes: true }).catch(() => []);
|
|
18024
18099
|
for (const inner of nested) {
|
|
18025
|
-
if (inner.isFile() && SPAN_FILE_PATTERN.test(inner.name)) found.push(
|
|
18100
|
+
if (inner.isFile() && SPAN_FILE_PATTERN.test(inner.name)) found.push(join29(child, inner.name));
|
|
18026
18101
|
}
|
|
18027
18102
|
}
|
|
18028
18103
|
return found.sort();
|
|
@@ -18030,7 +18105,7 @@ async function findSpanSourceFiles(dir) {
|
|
|
18030
18105
|
|
|
18031
18106
|
// src/supervisor-run-watch.ts
|
|
18032
18107
|
import { readdir as readdir19 } from "fs/promises";
|
|
18033
|
-
import { join as
|
|
18108
|
+
import { join as join30 } from "path";
|
|
18034
18109
|
function budget(node) {
|
|
18035
18110
|
const parts = [`${int(node.budget.maxIterations)}it`, `${int(node.budget.maxTokens)}tok`];
|
|
18036
18111
|
if (node.budget.maxUsd !== void 0) parts.push(`$${node.budget.maxUsd.toFixed(2)}`);
|
|
@@ -18174,7 +18249,7 @@ async function resolveRunContextDir(dir) {
|
|
|
18174
18249
|
const candidates = [];
|
|
18175
18250
|
for (const entry of entries) {
|
|
18176
18251
|
if (!entry.isDirectory()) continue;
|
|
18177
|
-
const child =
|
|
18252
|
+
const child = join30(dir, entry.name);
|
|
18178
18253
|
if (await isFileRunContextDir(child)) candidates.push(child);
|
|
18179
18254
|
}
|
|
18180
18255
|
if (candidates.length === 1) return candidates[0];
|
|
@@ -18510,7 +18585,7 @@ function parseJsonAnswer(text2) {
|
|
|
18510
18585
|
|
|
18511
18586
|
// src/ask.ts
|
|
18512
18587
|
import { mkdir as mkdir6, readFile as readFile15, writeFile as writeFile10 } from "fs/promises";
|
|
18513
|
-
import { join as
|
|
18588
|
+
import { join as join31, resolve as resolve11 } from "path";
|
|
18514
18589
|
import { performance } from "perf_hooks";
|
|
18515
18590
|
import { CostCeilingReachedError, CostLedger } from "@tangle-network/agent-eval";
|
|
18516
18591
|
import {
|
|
@@ -19065,8 +19140,8 @@ async function writeTraceQuestionsArtifacts(result, outDir) {
|
|
|
19065
19140
|
await mkdir6(directory, { recursive: true });
|
|
19066
19141
|
const paths = {
|
|
19067
19142
|
directory,
|
|
19068
|
-
result:
|
|
19069
|
-
report:
|
|
19143
|
+
result: join31(directory, "answers.json"),
|
|
19144
|
+
report: join31(directory, "report.md"),
|
|
19070
19145
|
traces: result.otlpPath
|
|
19071
19146
|
};
|
|
19072
19147
|
const { report, ...machine } = result;
|
|
@@ -19130,7 +19205,7 @@ async function watchSessions(opts) {
|
|
|
19130
19205
|
// src/bundle-view.ts
|
|
19131
19206
|
import { createHash as createHash17 } from "crypto";
|
|
19132
19207
|
import { mkdir as mkdir7, readdir as readdir20, readFile as readFile16, writeFile as writeFile11 } from "fs/promises";
|
|
19133
|
-
import { dirname as dirname11, join as
|
|
19208
|
+
import { dirname as dirname11, join as join32, resolve as resolve12 } from "path";
|
|
19134
19209
|
var EVIDENCE_ONLY_ALLOW_LIST = [
|
|
19135
19210
|
{
|
|
19136
19211
|
path: "derived/session-index.json",
|
|
@@ -19254,7 +19329,7 @@ async function findSessionTextLeaks(opts) {
|
|
|
19254
19329
|
const index = /* @__PURE__ */ new Map();
|
|
19255
19330
|
const carried = [];
|
|
19256
19331
|
for (const path of opts.carriedPaths) {
|
|
19257
|
-
const signatures = sessionTextSignatures(await readFile16(
|
|
19332
|
+
const signatures = sessionTextSignatures(await readFile16(join32(opts.viewDir, path), "utf8"));
|
|
19258
19333
|
carried.push({ path, signatures: signatures.size });
|
|
19259
19334
|
for (const signature of signatures) if (!index.has(signature)) index.set(signature, path);
|
|
19260
19335
|
}
|
|
@@ -19262,7 +19337,7 @@ async function findSessionTextLeaks(opts) {
|
|
|
19262
19337
|
const comparedSources = [];
|
|
19263
19338
|
let sourceSignatures = 0;
|
|
19264
19339
|
for (const sourcePath of opts.excludedPaths) {
|
|
19265
|
-
const signatures = sessionTextSignatures(await readFile16(
|
|
19340
|
+
const signatures = sessionTextSignatures(await readFile16(join32(opts.sourceDir, sourcePath), "utf8"));
|
|
19266
19341
|
comparedSources.push(sourcePath);
|
|
19267
19342
|
sourceSignatures += signatures.size;
|
|
19268
19343
|
for (const signature of signatures) {
|
|
@@ -19321,17 +19396,17 @@ async function projectSessionBundle(opts) {
|
|
|
19321
19396
|
const candidates = [];
|
|
19322
19397
|
for (const path of await listSessionBundleFiles(sourceDir)) {
|
|
19323
19398
|
if (path === "manifest.json") continue;
|
|
19324
|
-
const bytes2 = await readFile16(
|
|
19399
|
+
const bytes2 = await readFile16(join32(sourceDir, path));
|
|
19325
19400
|
const sha2562 = createHash17("sha256").update(bytes2).digest("hex");
|
|
19326
19401
|
const recorded = sourceHashes.get(path);
|
|
19327
19402
|
if (!recorded) {
|
|
19328
19403
|
throw new Error(
|
|
19329
|
-
`${
|
|
19404
|
+
`${join32(sourceDir, path)} is not listed in the bundle manifest \u2014 the bundle changed after assembly and cannot be projected; re-run \`traces bundle\``
|
|
19330
19405
|
);
|
|
19331
19406
|
}
|
|
19332
19407
|
if (recorded.sha256 !== sha2562) {
|
|
19333
19408
|
throw new Error(
|
|
19334
|
-
`${
|
|
19409
|
+
`${join32(sourceDir, path)} does not match its manifest hash (${recorded.sha256} recorded, ${sha2562} on disk) \u2014 the bundle changed after assembly and cannot be projected; re-run \`traces bundle\``
|
|
19335
19410
|
);
|
|
19336
19411
|
}
|
|
19337
19412
|
const verdict = classifyEvidenceOnlyPath(path);
|
|
@@ -19367,7 +19442,7 @@ async function projectSessionBundle(opts) {
|
|
|
19367
19442
|
});
|
|
19368
19443
|
continue;
|
|
19369
19444
|
}
|
|
19370
|
-
const target =
|
|
19445
|
+
const target = join32(outDir, candidate.path);
|
|
19371
19446
|
await mkdir7(dirname11(target), { recursive: true });
|
|
19372
19447
|
await writeFile11(target, candidate.bytes);
|
|
19373
19448
|
carriedPaths.push(candidate.path);
|
|
@@ -19384,7 +19459,7 @@ async function projectSessionBundle(opts) {
|
|
|
19384
19459
|
})),
|
|
19385
19460
|
matches: 0
|
|
19386
19461
|
};
|
|
19387
|
-
const sourceManifestBytes = await readFile16(
|
|
19462
|
+
const sourceManifestBytes = await readFile16(join32(sourceDir, "manifest.json"));
|
|
19388
19463
|
const manifest = {
|
|
19389
19464
|
schemaVersion: 2,
|
|
19390
19465
|
kind: "traces.session_bundle",
|
|
@@ -19572,11 +19647,11 @@ function renderRunDiff(report) {
|
|
|
19572
19647
|
// src/upload-state.ts
|
|
19573
19648
|
import { mkdir as mkdir8, readFile as readFile17, writeFile as writeFile12 } from "fs/promises";
|
|
19574
19649
|
import { homedir as homedir12 } from "os";
|
|
19575
|
-
import { dirname as dirname12, join as
|
|
19650
|
+
import { dirname as dirname12, join as join33 } from "path";
|
|
19576
19651
|
import { contentHash } from "@tangle-network/agent-eval";
|
|
19577
19652
|
function stateFile() {
|
|
19578
|
-
const base = process.env.XDG_STATE_HOME ??
|
|
19579
|
-
return
|
|
19653
|
+
const base = process.env.XDG_STATE_HOME ?? join33(homedir12(), ".local", "state");
|
|
19654
|
+
return join33(base, "tangle-traces", "uploaded.json");
|
|
19580
19655
|
}
|
|
19581
19656
|
function uploadKey(harness, sessionId) {
|
|
19582
19657
|
return `${harness}:${sessionId}`;
|
|
@@ -19608,7 +19683,7 @@ function alreadyUploaded(state, harness, sessionId, hash2) {
|
|
|
19608
19683
|
import { readFile as readFile18 } from "fs/promises";
|
|
19609
19684
|
import { createRequire as createRequire2 } from "module";
|
|
19610
19685
|
import { hostname as hostname2 } from "os";
|
|
19611
|
-
import { basename as basename16, join as
|
|
19686
|
+
import { basename as basename16, join as join34 } from "path";
|
|
19612
19687
|
import { hostedClientFromEnv } from "@tangle-network/agent-eval/hosted";
|
|
19613
19688
|
import { assessShareSafety as assessShareSafety2, REDACTION_VERSION, redact as redact2, shareAllowed } from "@tangle-network/agent-eval/traces";
|
|
19614
19689
|
var require2 = createRequire2(import.meta.url);
|
|
@@ -19632,7 +19707,7 @@ async function planUpload(opts = {}) {
|
|
|
19632
19707
|
async function gitBranch(cwd) {
|
|
19633
19708
|
if (!cwd) return void 0;
|
|
19634
19709
|
try {
|
|
19635
|
-
const head = await readFile18(
|
|
19710
|
+
const head = await readFile18(join34(cwd, ".git", "HEAD"), "utf8");
|
|
19636
19711
|
const m = head.match(/^ref:\s*refs\/heads\/(.+)$/m);
|
|
19637
19712
|
return m?.[1]?.trim();
|
|
19638
19713
|
} catch {
|
|
@@ -19808,7 +19883,7 @@ async function executeUpload(plan, opts = {}) {
|
|
|
19808
19883
|
|
|
19809
19884
|
// src/verify-safe.ts
|
|
19810
19885
|
import { lstat as lstat4, readdir as readdir21, readFile as readFile19 } from "fs/promises";
|
|
19811
|
-
import { basename as basename17, extname, join as
|
|
19886
|
+
import { basename as basename17, extname, join as join35, relative as relative7 } from "path";
|
|
19812
19887
|
import {
|
|
19813
19888
|
assessShareSafety as assessShareSafety3,
|
|
19814
19889
|
combineVerdicts as combineVerdicts2
|
|
@@ -19869,7 +19944,7 @@ async function listFiles(target, unreadable) {
|
|
|
19869
19944
|
const out = [];
|
|
19870
19945
|
const walk = async (dir) => {
|
|
19871
19946
|
for (const entry of (await readdir21(dir, { withFileTypes: true })).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
19872
|
-
const path =
|
|
19947
|
+
const path = join35(dir, entry.name);
|
|
19873
19948
|
if (entry.isDirectory()) await walk(path);
|
|
19874
19949
|
else if (entry.isFile()) out.push(path);
|
|
19875
19950
|
else unreadable.push(`${relative7(target, path)}: not a regular file`);
|
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -4139,6 +4139,12 @@ interface PrimeAnalyzerOptions {
|
|
|
4139
4139
|
repair?: boolean;
|
|
4140
4140
|
transport?: PrimeTransport;
|
|
4141
4141
|
}
|
|
4142
|
+
interface FindingsFileOutcome {
|
|
4143
|
+
parsed: Record<string, unknown> | null;
|
|
4144
|
+
/** Human-readable receipt for the output: what the file was and what
|
|
4145
|
+
* happened to it. Present whenever a file was found. */
|
|
4146
|
+
receipt: string;
|
|
4147
|
+
}
|
|
4142
4148
|
/** Default transport: plain node:http/https, NOT fetch — undici's fixed 300s
|
|
4143
4149
|
* headers timeout kills prime calls that legitimately run longer; the
|
|
4144
4150
|
* analyzer's AbortSignal is the only deadline. */
|
|
@@ -4934,4 +4940,4 @@ interface ExecuteOptions {
|
|
|
4934
4940
|
/** Send the final, new outbound items (or write their dry-run OTLP). */
|
|
4935
4941
|
declare function executeUpload(plan: UploadPlan, opts?: ExecuteOptions): Promise<UploadResult>;
|
|
4936
4942
|
|
|
4937
|
-
export { ACTOR_ATTR, ATTR, type Actor, type AdoptionOptions, type AdoptionReport, AmpAdapter, type AnalysisEngineFromEnvOptions, type AnalyzeOptions, type AnalyzeResult, type AnswerSchema, type AssembleSessionBundleOptions, BLOBS_DIR, type BuildPolicyEvidenceOptions, type BuildSessionIndexOptions, type BuildTraceFindingPacketOptions, CHANGED_FILE_LIST_CAP, CITATION_NORMALIZATION_VERSION, CONTENT_CAP, COORDINATION_LOG_FILE, CORRECTIVE_REACTIONS, type ChangedFileFact, type ChatTrajectory, type ChatTrajectoryMessage, type ChatTrajectoryOptions, ClaudeAdapter, type CodeTraceBenchFileRef, type CodeTraceBenchImportOptions, type CodeTraceBenchImportReceipt, type CodeTraceBenchImportResult, type CodeTraceBenchImportedTrace, type CodeTraceBenchStep, CodexAdapter, CodexExecAdapter, CodexExecStreamError, CodexTaskScopeError, type CollectOptions, type CollectPolicyEvidenceOptions, type CollectSessionIndexOptions, type CollectSessionSelectionOptions, type CollectSessionWorkflowOptions, type CompactionMeasurement, type ConformanceRenderOptions, type ContentFootprint, type CoordinationLog, type CoordinationQuestion, type CoordinationSteer, CopilotAdapter, type CorruptionMode, type CoveredMeasurement, DEFAULT_ANALYST_MODEL, DEFAULT_ASK_CONCURRENCY, DEFAULT_HARNESS, DEFAULT_SANDBOX_BASE_URL, EMPTY_SPAN_RUN_SNAPSHOT, EXPORT_RULE, EmptySessionError, type EvidenceOnlyVerdict, type ExcludedTurnFact, type ExecuteOptions, type ExportRule, type ExternalAnalysisKind, type ExternalAnalysisPayload, type ExternalAnalysisResult, type ExternalAnalyzer, type ExternalAnalyzerOptions, type ExternalDiscoveryCandidate, FACT_LIST_CAP, FACT_TEXT_CAP, FactoryAdapter, type FailureFollowUp, type FailureFollowUpReport, type FileRunContextReaderOptions, type FinalMessageFact, type FindSessionTextLeaksOptions, type FindingRejectionCounts, type FindingRejectionReasons, type FindingRejectionTally, type FollowUpKind, ForgeAdapter, GeminiAdapter, type HaloAnalyzerOptions, type HaloReasoningEffort, type HarnessTraceAdapter, type HodoscopeAnalyzerOptions, type HodoscopeInput, type HodoscopeMessage, type HodoscopeSourceMapEntry, type HodoscopeTrajectory, INGEST_SOURCE_CLI, INHERITED_SOURCE_ATTR, INHERITED_SPANS_OMITTED_ATTR, INHERITED_SPAN_ATTR, INHERITED_SPAN_COUNT_ATTR, type InheritedSpanSource, type InspectSessionIndexOptions, JsonSourceError, type JsonlCorruptionReceipt, JsonlParseError, type JsonlReadOptions, type LiveBatchOptions, type LocateOptions, type LoopConvergence, type LoopConvergenceReport, type LoopIteration, type LoopTrend, type LoopTrendBasis, MAX_SHELL_DEPTH, MAX_TRACE_QUESTION_CHARS, type ObservedLoop, type ObserverOptions, OpencodeAdapter, type OtlpIngestIssue, type OtlpIngestIssueKind, type OtlpInput, type OtlpInputFile, type OtlpRowConversion, type OtlpSpan, type OtlpSpanKind, type OtlpSpanLink, type OtlpStatusCode, POLICY_EVIDENCE_NOTE, PREPARED_CONTEXT_BYTE_CEILING, type ParentTaskResolution, type ParseOptions, PartialUploadError, PiAdapter, type PiAdapterOptions, type PipelineOptions, type PipelineReport, type PlanOptions, type PolicyEvidenceLoopSummary, type PolicyEvidenceRecord, type PolicyEvidenceToolSummary, type PrimeAnalyzerOptions, type PrimeTransport, type PrimeTransportRequest, type PrimeTransportResponse, type ProjectSessionBundleOptions, type ProjectSessionBundleResult, type PullRequestFact, type PullRequestFacts, type PullRequestReading, QwenAdapter, REACTIONS, RESULT_FILE, RULE, type Reaction, type ReactionReport, type ReactionSessionReport, type RedactSpansOptions, type Redactor, type RefusedSession, type RepoAttrs, type RepoResolution, type RepoResolutionSource, type ResolvedOtlpInput, type RunContextJournal, type RunContextNode, type RunContextResult, type RunContextSnapshot, type RunDiffOptions, type RunDiffReport, type RunDiffSide, type RunResult, type RunWatchSnapshot, type RunWatchTarget, type RuntimeTrace, SESSION_FACTS_MEASUREMENT_VERSION, SESSION_FACTS_VERSION_SUFFIX, SESSION_TOKEN_TOTAL_ATTR, SOURCE_ATTRIBUTE_PREFIX, SPAN_SYNTHESIZED_ATTR, SPAWN_JOURNAL_FILE, STATUS_MARK, SYNTHESIZED_SOURCE_ATTR, SYNTHESIZED_SPAN_ATTR, type SandboxReplayBackendOptions, type ScanOptions, type ScannedSession, type SessionBatch, type SessionBundleAbsence, type SessionBundleCarriedSignatures, type SessionBundleExclusion, type SessionBundleExclusionRule, type SessionBundleFile, type SessionBundleIssue, type SessionBundleIssueKind, type SessionBundleLeakCheck, type SessionBundleLedgerSlice, type SessionBundleManifest, type SessionBundleProjection, type SessionBundleResult, type SessionBundleSliceRule, type SessionBundleVerification, type SessionBundleView, type SessionCorruptionReceipt, type SessionEnvironment, type SessionFact, type SessionFacts, type SessionFactsOptions, type SessionFactsReport, type SessionIdentityConflict, type SessionIdentityIndex, type SessionIntegrity, type SessionMeasurements, type SessionRef, type SessionRelationship, type SessionRole, type SessionSeedGroup, type SessionSelection, type SessionSelectionRow, type SessionSourceFile, type SessionTextLeak, type SessionTextLeakReport, type SessionTurnFact, type SessionWorkflow, SessionWorkflowError, type SessionWorkflowErrorCode, type SessionWorkflowIssue, type SessionWorkflowSession, type SessionWorkflowSummary, type SkippedAnalysis, type SkippedInputFile, type SourceRecordReference, type SpanInput, type SpanNodeStatus, type SpanRedaction, type SpanRunNode, type SpanRunSnapshot, type SpanStructure, type SpawnedChildResolution, type SpendRoll, type SteeringChainReport, type SteeringEdge, type SubagentSpawnFact, TRACE_QUESTION_PREVIEW_HEAD_CHARS, type ToolMeasurement, type TraceAgenticRoute, type TraceAgenticRouteReason, type TraceAgenticRouteReasonCode, type TraceContextIndex, type TraceContextRoot, type TraceEvidenceExportOptions, type TraceEvidenceExportResult, type TraceEvidenceFormatOption, type TraceEvidenceInputFormat, type TraceEvidenceRow, type TraceExecutionOptions, type TraceFindingPacket, type TraceImprovementArtifacts, type TraceImprovementOptions, type TraceImprovementResult, type TraceIndexedFile, type TraceInspectionArea, type TraceInspectionFinding, type TraceInspectionReport, type TraceInspectionSeverity, type TraceInvestigationOptions, type TraceInvestigationResult, type TraceLiveAction, type TraceLiveActionKind, type TraceLiveAnalysisContext, type TraceLiveAnalyst, type TraceLiveBatch, type TraceLiveEvidence, type TraceLiveFinding, type TraceLiveLoop, type TraceLiveSeverity, type TraceQuestion, type TraceQuestionAnswer, type TraceQuestionCitation, type TraceQuestionFailureKind, type TraceQuestionTrace, type TraceQuestionsArtifacts, type TraceQuestionsOptions, type TraceQuestionsResult, type TraceQuestionsTotals, type TraceSessionIndex, type TraceSessionIndexRow, type TraceStoreInvestigationOptions, type TraceStoreInvestigationResult, type TraceStreamEvent, type TraceStreamOptions, type TraceStreamReplayOptions, type TraceStreamSession, type TracesConfig, type TriggerPair, type TurnActorCount, type UnavailableCapabilities, type UploadBackend, type UploadIdentity, type UploadItem, type UploadPlan, type UploadRecord, type UploadResult, type UploadState, type UserPromptInput, type VerifySafeOptions, type VerifySafeResult, type WatchRunTargetOptions, ZERO_ROLL, type ZaiChatCallerOptions, addSpend, alreadyUploaded, analysisEngineFromEnv, analyzeAdoption, analyzeLiveBatch, analyzeLoopConvergence, analyzeReactions, analyzeSpans, analyzeSteeringChain, answerSchemaErrors, applyRedactor, assembleSessionBundle, assertAnswerSchema, assertSandboxReachable, assessSpans, buildPolicyEvidenceRecord, buildSessionFactsReport, buildSessionIndex, buildSessionIndexFromRows, buildSpanRunTree, buildTraceFindingPacket, capText, chatTrajectoryToSpans, classifyEvidenceOnlyPath, classifyFailureFollowUps, classifyLiveActions, classifyReaction, claudeActor, codexActor, collectPolicyEvidence, collectSessionIndex, collectSessionSelection, collectSessionWorkflow, collectSessions, commandAnalyzer, commandRedactor, commandTextFromInput, computeAdoption, computeSessionFacts, conformanceOfSpans, connectors, countSkillRunsJsonl, createBundleSourceReader, createFindingRejectionTally, cwdMatchesSelection, cwdMatchesSelectionResolved, defaultTraceLiveAnalysts, describeSessionRelationship, diffRuns, engineCallReservationFloorUsd, environmentAttributes, environmentFromSpanAttributes, equivalentGitCwds, executeUpload, exportTraceEvidenceFile, exportTraceEvidenceRows, exportTraceEvidenceText, externalFailureMessage, fileRunContextSupervisorRunReader, fileSha256, findContextRoot, findSessionTextLeaks, findSpanSourceFiles, findingRejection, findingRejectionDetail, forEachTreeNode, formatFindingRejections, formatVerdict, haloAnalyzer, hashSessionBundleFiles, hodoscopeAnalyzer, httpJsonTransport, importCodeTraceBench, incompleteInputsNote, indexSessionIdsByTrace, inferRole, inferSpanKind, inspectSessionIndex, int, isBridgeMismatchError, isChatTrajectory, isChatTrajectoryMessage, isFileRunContextDir, isInheritedSpan, isSynthesizedSpan, iterSerializedSpans, knownHarnesses, listAdapters, listSessionBundleFiles, loadState, loadTraceQuestionsFile, loadTracesConfig, locateSessions, looksLikeAgentPrompt, mergeRolls, mergeTracesConfig, ms, normalizeAnalystCitations, normalizeRemote, normalizeTraceQuestions, otlpRowToSpan, outboundHash, parseIsoToEpochMs, parseJsonAnswer, parseSession, parseSince, planTraceAgenticRoute, planUpload, primeAnalyzer, projectSessionBundle, readCoordinationLog, readFileRunContext, readJsonFile, readJsonl, readOtlpInput, readPullRequests, readRunContextJournal, readRunContextSnapshot, readRunSide, readRunWatchSnapshot, readSessionBundleManifest, readSessionIndexFile, readSpanRunSnapshot, recordSessionCorruption, redactSpans, renderConformance, renderInspectionReport, renderRunContextSnapshot, renderRunDiff, renderRunWatchSnapshot, renderSessionFacts, renderSessionFactsContext, renderSpanRunSnapshot, renderTraceQuestionInstructions, renderTraceQuestionPrompt, renderTraceQuestionsReport, renderValidation, resolveAdapter, resolveOtlpInputFiles, resolveRepoAttrs, resolveRunContextDir, resolveRunWatchTarget, resolveSessionRepoAttrs, runCommand, runExternalAnalyzers, runPipelines, runTotals, runTraceImprovement, runTraceInvestigation, runTraceQuestions, runTraceStoreInvestigation, sandboxReplayBackend, saveReport, saveState, scanSessions, selectAdapters, serializeInspectionReport, serializePolicyEvidence, serializeSessionIndex, serializeSpans, serializeTraceStreamEvent, sessionFactsContext, sessionHash, sessionIdFromAttributes, sessionIntegrityAttributes, sessionTextSignatures, shellCommands, skippedAnalyses, span, spanRunTotals, stampEnvironmentAttrs, stampRepoAttrs, stampSessionIdentity, stampSessionIntegrity, stampSpanWorkdirRepoAttrs, streamSessions, summarizeOtlpExecution, summarizeSpanExecution, summarizeSpanStructure, takeJsonl, textIsSynthetic, toOpenInferenceSpan, toRuntimeStore, toTraceSpanEvents, tokens, totalAgenticFailureMessage, totalFindingRejections, traceAgenticKinds, traceCitationsInText, traceStreamEventsFromSpans, unavailableCapabilities, uploadKey, usd, userPromptSpan, validateOtlpSpans, validationExitCode, verdictExitCode, verifyFindingsInSandbox, verifySafe, verifySessionBundle, watchRunTarget, watchSessions, withSessionFactsContext, wrap, writeHodoscopeInput, writeInspectionReportFile, writeOtlpFile, writePolicyEvidenceFile, writeSessionBundleManifest, writeSessionIndexFile, writeTraceEvidenceExportFile, writeTraceImprovementArtifacts, writeTraceQuestionsArtifacts, zaiChatCaller, zeroPricedCost };
|
|
4943
|
+
export { ACTOR_ATTR, ATTR, type Actor, type AdoptionOptions, type AdoptionReport, AmpAdapter, type AnalysisEngineFromEnvOptions, type AnalyzeOptions, type AnalyzeResult, type AnswerSchema, type AssembleSessionBundleOptions, BLOBS_DIR, type BuildPolicyEvidenceOptions, type BuildSessionIndexOptions, type BuildTraceFindingPacketOptions, CHANGED_FILE_LIST_CAP, CITATION_NORMALIZATION_VERSION, CONTENT_CAP, COORDINATION_LOG_FILE, CORRECTIVE_REACTIONS, type ChangedFileFact, type ChatTrajectory, type ChatTrajectoryMessage, type ChatTrajectoryOptions, ClaudeAdapter, type CodeTraceBenchFileRef, type CodeTraceBenchImportOptions, type CodeTraceBenchImportReceipt, type CodeTraceBenchImportResult, type CodeTraceBenchImportedTrace, type CodeTraceBenchStep, CodexAdapter, CodexExecAdapter, CodexExecStreamError, CodexTaskScopeError, type CollectOptions, type CollectPolicyEvidenceOptions, type CollectSessionIndexOptions, type CollectSessionSelectionOptions, type CollectSessionWorkflowOptions, type CompactionMeasurement, type ConformanceRenderOptions, type ContentFootprint, type CoordinationLog, type CoordinationQuestion, type CoordinationSteer, CopilotAdapter, type CorruptionMode, type CoveredMeasurement, DEFAULT_ANALYST_MODEL, DEFAULT_ASK_CONCURRENCY, DEFAULT_HARNESS, DEFAULT_SANDBOX_BASE_URL, EMPTY_SPAN_RUN_SNAPSHOT, EXPORT_RULE, EmptySessionError, type EvidenceOnlyVerdict, type ExcludedTurnFact, type ExecuteOptions, type ExportRule, type ExternalAnalysisKind, type ExternalAnalysisPayload, type ExternalAnalysisResult, type ExternalAnalyzer, type ExternalAnalyzerOptions, type ExternalDiscoveryCandidate, FACT_LIST_CAP, FACT_TEXT_CAP, FactoryAdapter, type FailureFollowUp, type FailureFollowUpReport, type FileRunContextReaderOptions, type FinalMessageFact, type FindSessionTextLeaksOptions, type FindingRejectionCounts, type FindingRejectionReasons, type FindingRejectionTally, type FindingsFileOutcome, type FollowUpKind, ForgeAdapter, GeminiAdapter, type HaloAnalyzerOptions, type HaloReasoningEffort, type HarnessTraceAdapter, type HodoscopeAnalyzerOptions, type HodoscopeInput, type HodoscopeMessage, type HodoscopeSourceMapEntry, type HodoscopeTrajectory, INGEST_SOURCE_CLI, INHERITED_SOURCE_ATTR, INHERITED_SPANS_OMITTED_ATTR, INHERITED_SPAN_ATTR, INHERITED_SPAN_COUNT_ATTR, type InheritedSpanSource, type InspectSessionIndexOptions, JsonSourceError, type JsonlCorruptionReceipt, JsonlParseError, type JsonlReadOptions, type LiveBatchOptions, type LocateOptions, type LoopConvergence, type LoopConvergenceReport, type LoopIteration, type LoopTrend, type LoopTrendBasis, MAX_SHELL_DEPTH, MAX_TRACE_QUESTION_CHARS, type ObservedLoop, type ObserverOptions, OpencodeAdapter, type OtlpIngestIssue, type OtlpIngestIssueKind, type OtlpInput, type OtlpInputFile, type OtlpRowConversion, type OtlpSpan, type OtlpSpanKind, type OtlpSpanLink, type OtlpStatusCode, POLICY_EVIDENCE_NOTE, PREPARED_CONTEXT_BYTE_CEILING, type ParentTaskResolution, type ParseOptions, PartialUploadError, PiAdapter, type PiAdapterOptions, type PipelineOptions, type PipelineReport, type PlanOptions, type PolicyEvidenceLoopSummary, type PolicyEvidenceRecord, type PolicyEvidenceToolSummary, type PrimeAnalyzerOptions, type PrimeTransport, type PrimeTransportRequest, type PrimeTransportResponse, type ProjectSessionBundleOptions, type ProjectSessionBundleResult, type PullRequestFact, type PullRequestFacts, type PullRequestReading, QwenAdapter, REACTIONS, RESULT_FILE, RULE, type Reaction, type ReactionReport, type ReactionSessionReport, type RedactSpansOptions, type Redactor, type RefusedSession, type RepoAttrs, type RepoResolution, type RepoResolutionSource, type ResolvedOtlpInput, type RunContextJournal, type RunContextNode, type RunContextResult, type RunContextSnapshot, type RunDiffOptions, type RunDiffReport, type RunDiffSide, type RunResult, type RunWatchSnapshot, type RunWatchTarget, type RuntimeTrace, SESSION_FACTS_MEASUREMENT_VERSION, SESSION_FACTS_VERSION_SUFFIX, SESSION_TOKEN_TOTAL_ATTR, SOURCE_ATTRIBUTE_PREFIX, SPAN_SYNTHESIZED_ATTR, SPAWN_JOURNAL_FILE, STATUS_MARK, SYNTHESIZED_SOURCE_ATTR, SYNTHESIZED_SPAN_ATTR, type SandboxReplayBackendOptions, type ScanOptions, type ScannedSession, type SessionBatch, type SessionBundleAbsence, type SessionBundleCarriedSignatures, type SessionBundleExclusion, type SessionBundleExclusionRule, type SessionBundleFile, type SessionBundleIssue, type SessionBundleIssueKind, type SessionBundleLeakCheck, type SessionBundleLedgerSlice, type SessionBundleManifest, type SessionBundleProjection, type SessionBundleResult, type SessionBundleSliceRule, type SessionBundleVerification, type SessionBundleView, type SessionCorruptionReceipt, type SessionEnvironment, type SessionFact, type SessionFacts, type SessionFactsOptions, type SessionFactsReport, type SessionIdentityConflict, type SessionIdentityIndex, type SessionIntegrity, type SessionMeasurements, type SessionRef, type SessionRelationship, type SessionRole, type SessionSeedGroup, type SessionSelection, type SessionSelectionRow, type SessionSourceFile, type SessionTextLeak, type SessionTextLeakReport, type SessionTurnFact, type SessionWorkflow, SessionWorkflowError, type SessionWorkflowErrorCode, type SessionWorkflowIssue, type SessionWorkflowSession, type SessionWorkflowSummary, type SkippedAnalysis, type SkippedInputFile, type SourceRecordReference, type SpanInput, type SpanNodeStatus, type SpanRedaction, type SpanRunNode, type SpanRunSnapshot, type SpanStructure, type SpawnedChildResolution, type SpendRoll, type SteeringChainReport, type SteeringEdge, type SubagentSpawnFact, TRACE_QUESTION_PREVIEW_HEAD_CHARS, type ToolMeasurement, type TraceAgenticRoute, type TraceAgenticRouteReason, type TraceAgenticRouteReasonCode, type TraceContextIndex, type TraceContextRoot, type TraceEvidenceExportOptions, type TraceEvidenceExportResult, type TraceEvidenceFormatOption, type TraceEvidenceInputFormat, type TraceEvidenceRow, type TraceExecutionOptions, type TraceFindingPacket, type TraceImprovementArtifacts, type TraceImprovementOptions, type TraceImprovementResult, type TraceIndexedFile, type TraceInspectionArea, type TraceInspectionFinding, type TraceInspectionReport, type TraceInspectionSeverity, type TraceInvestigationOptions, type TraceInvestigationResult, type TraceLiveAction, type TraceLiveActionKind, type TraceLiveAnalysisContext, type TraceLiveAnalyst, type TraceLiveBatch, type TraceLiveEvidence, type TraceLiveFinding, type TraceLiveLoop, type TraceLiveSeverity, type TraceQuestion, type TraceQuestionAnswer, type TraceQuestionCitation, type TraceQuestionFailureKind, type TraceQuestionTrace, type TraceQuestionsArtifacts, type TraceQuestionsOptions, type TraceQuestionsResult, type TraceQuestionsTotals, type TraceSessionIndex, type TraceSessionIndexRow, type TraceStoreInvestigationOptions, type TraceStoreInvestigationResult, type TraceStreamEvent, type TraceStreamOptions, type TraceStreamReplayOptions, type TraceStreamSession, type TracesConfig, type TriggerPair, type TurnActorCount, type UnavailableCapabilities, type UploadBackend, type UploadIdentity, type UploadItem, type UploadPlan, type UploadRecord, type UploadResult, type UploadState, type UserPromptInput, type VerifySafeOptions, type VerifySafeResult, type WatchRunTargetOptions, ZERO_ROLL, type ZaiChatCallerOptions, addSpend, alreadyUploaded, analysisEngineFromEnv, analyzeAdoption, analyzeLiveBatch, analyzeLoopConvergence, analyzeReactions, analyzeSpans, analyzeSteeringChain, answerSchemaErrors, applyRedactor, assembleSessionBundle, assertAnswerSchema, assertSandboxReachable, assessSpans, buildPolicyEvidenceRecord, buildSessionFactsReport, buildSessionIndex, buildSessionIndexFromRows, buildSpanRunTree, buildTraceFindingPacket, capText, chatTrajectoryToSpans, classifyEvidenceOnlyPath, classifyFailureFollowUps, classifyLiveActions, classifyReaction, claudeActor, codexActor, collectPolicyEvidence, collectSessionIndex, collectSessionSelection, collectSessionWorkflow, collectSessions, commandAnalyzer, commandRedactor, commandTextFromInput, computeAdoption, computeSessionFacts, conformanceOfSpans, connectors, countSkillRunsJsonl, createBundleSourceReader, createFindingRejectionTally, cwdMatchesSelection, cwdMatchesSelectionResolved, defaultTraceLiveAnalysts, describeSessionRelationship, diffRuns, engineCallReservationFloorUsd, environmentAttributes, environmentFromSpanAttributes, equivalentGitCwds, executeUpload, exportTraceEvidenceFile, exportTraceEvidenceRows, exportTraceEvidenceText, externalFailureMessage, fileRunContextSupervisorRunReader, fileSha256, findContextRoot, findSessionTextLeaks, findSpanSourceFiles, findingRejection, findingRejectionDetail, forEachTreeNode, formatFindingRejections, formatVerdict, haloAnalyzer, hashSessionBundleFiles, hodoscopeAnalyzer, httpJsonTransport, importCodeTraceBench, incompleteInputsNote, indexSessionIdsByTrace, inferRole, inferSpanKind, inspectSessionIndex, int, isBridgeMismatchError, isChatTrajectory, isChatTrajectoryMessage, isFileRunContextDir, isInheritedSpan, isSynthesizedSpan, iterSerializedSpans, knownHarnesses, listAdapters, listSessionBundleFiles, loadState, loadTraceQuestionsFile, loadTracesConfig, locateSessions, looksLikeAgentPrompt, mergeRolls, mergeTracesConfig, ms, normalizeAnalystCitations, normalizeRemote, normalizeTraceQuestions, otlpRowToSpan, outboundHash, parseIsoToEpochMs, parseJsonAnswer, parseSession, parseSince, planTraceAgenticRoute, planUpload, primeAnalyzer, projectSessionBundle, readCoordinationLog, readFileRunContext, readJsonFile, readJsonl, readOtlpInput, readPullRequests, readRunContextJournal, readRunContextSnapshot, readRunSide, readRunWatchSnapshot, readSessionBundleManifest, readSessionIndexFile, readSpanRunSnapshot, recordSessionCorruption, redactSpans, renderConformance, renderInspectionReport, renderRunContextSnapshot, renderRunDiff, renderRunWatchSnapshot, renderSessionFacts, renderSessionFactsContext, renderSpanRunSnapshot, renderTraceQuestionInstructions, renderTraceQuestionPrompt, renderTraceQuestionsReport, renderValidation, resolveAdapter, resolveOtlpInputFiles, resolveRepoAttrs, resolveRunContextDir, resolveRunWatchTarget, resolveSessionRepoAttrs, runCommand, runExternalAnalyzers, runPipelines, runTotals, runTraceImprovement, runTraceInvestigation, runTraceQuestions, runTraceStoreInvestigation, sandboxReplayBackend, saveReport, saveState, scanSessions, selectAdapters, serializeInspectionReport, serializePolicyEvidence, serializeSessionIndex, serializeSpans, serializeTraceStreamEvent, sessionFactsContext, sessionHash, sessionIdFromAttributes, sessionIntegrityAttributes, sessionTextSignatures, shellCommands, skippedAnalyses, span, spanRunTotals, stampEnvironmentAttrs, stampRepoAttrs, stampSessionIdentity, stampSessionIntegrity, stampSpanWorkdirRepoAttrs, streamSessions, summarizeOtlpExecution, summarizeSpanExecution, summarizeSpanStructure, takeJsonl, textIsSynthetic, toOpenInferenceSpan, toRuntimeStore, toTraceSpanEvents, tokens, totalAgenticFailureMessage, totalFindingRejections, traceAgenticKinds, traceCitationsInText, traceStreamEventsFromSpans, unavailableCapabilities, uploadKey, usd, userPromptSpan, validateOtlpSpans, validationExitCode, verdictExitCode, verifyFindingsInSandbox, verifySafe, verifySessionBundle, watchRunTarget, watchSessions, withSessionFactsContext, wrap, writeHodoscopeInput, writeInspectionReportFile, writeOtlpFile, writePolicyEvidenceFile, writeSessionBundleManifest, writeSessionIndexFile, writeTraceEvidenceExportFile, writeTraceImprovementArtifacts, writeTraceQuestionsArtifacts, zaiChatCaller, zeroPricedCost };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/traces",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Point it at your coding-agent session traces (Claude Code, Codex, OpenCode, Gemini, Pi, …) and get failure-mode + efficiency findings. CLI + SDK over the @tangle-network/agent-eval analyst suite — observe live sessions, run your own analysts, redact, and upload to the Tangle Intelligence Platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|