@tangle-network/traces 0.23.0 → 0.23.1

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.
@@ -5971,7 +5971,7 @@ var OpencodeAdapter = class {
5971
5971
  // src/adapters/harness-sessions.ts
5972
5972
  import { homedir as homedir8 } from "os";
5973
5973
  import { open, stat as stat8 } from "fs/promises";
5974
- import { join as join10 } from "path";
5974
+ import { basename as basename6, dirname as dirname4, join as join10 } from "path";
5975
5975
  import {
5976
5976
  claudeCodeRefForFile,
5977
5977
  codexRefForFile,
@@ -6337,12 +6337,16 @@ var HarnessSessionsAdapter = class {
6337
6337
  const toolByCallId = new Map(spans.filter((item) => item.attributes["openinference.span.kind"] === "TOOL").map((item) => [item.attributes["gen_ai.tool.call.id"], item]));
6338
6338
  let childSpanCount = 0;
6339
6339
  const childIds = new Set(session.children.map((child) => child.nativeSessionId));
6340
+ const readIds = /* @__PURE__ */ new Set();
6340
6341
  for (const path of childPaths) {
6341
6342
  const childRef = claudeCodeRefForFile(path, session.nativeSessionId);
6342
- const child = await this.reader.read(childRef, { signal: options.signal, corruption: options.corruptionMode });
6343
- childIds.add(child.nativeSessionId);
6343
+ const read = await this.reader.read(childRef, { signal: options.signal, corruption: options.corruptionMode });
6344
+ const repeated = readIds.has(read.nativeSessionId);
6345
+ readIds.add(read.nativeSessionId);
6346
+ const child = repeated ? { ...read, nativeSessionId: `${read.nativeSessionId}@${basename6(dirname4(path))}` } : read;
6347
+ childIds.add(read.nativeSessionId);
6344
6348
  if (!child.startedAt) continue;
6345
- const binding = session.children.find((item) => item.nativeSessionId === child.nativeSessionId);
6349
+ const binding = repeated ? void 0 : session.children.find((item) => item.nativeSessionId === child.nativeSessionId);
6346
6350
  const parent = binding?.toolCallId ? toolByCallId.get(binding.toolCallId) : void 0;
6347
6351
  const projected = toOtlpSpans(child).map(asTracesSpan);
6348
6352
  stampNativeProvenance(child, projected);
@@ -6390,7 +6394,7 @@ var SHARED_SESSION_ADAPTERS = [
6390
6394
  // src/adapters/qwen.ts
6391
6395
  import { readdir as readdir10, stat as stat9 } from "fs/promises";
6392
6396
  import { homedir as homedir9 } from "os";
6393
- import { basename as basename6, join as join11 } from "path";
6397
+ import { basename as basename7, join as join11 } from "path";
6394
6398
  var SERVICE7 = "qwen";
6395
6399
  function textOf6(parts) {
6396
6400
  if (!parts) return "";
@@ -6433,7 +6437,7 @@ var QwenAdapter = class {
6433
6437
  throw error;
6434
6438
  }
6435
6439
  if (opts.sinceMs && st.mtimeMs < opts.sinceMs) continue;
6436
- refs.push({ harness: this.harness, sessionId: basename6(f, ".jsonl"), path, cwd: null, mtimeMs: st.mtimeMs });
6440
+ refs.push({ harness: this.harness, sessionId: basename7(f, ".jsonl"), path, cwd: null, mtimeMs: st.mtimeMs });
6437
6441
  }
6438
6442
  }
6439
6443
  return refs.sort((a, b) => b.mtimeMs - a.mtimeMs);
@@ -6588,7 +6592,7 @@ function selectAdapters(opts) {
6588
6592
 
6589
6593
  // src/repo.ts
6590
6594
  import { realpath as realpath2, stat as stat10 } from "fs/promises";
6591
- import { dirname as dirname4, isAbsolute as isAbsolute3, join as join12, normalize, parse as parsePath } from "path";
6595
+ import { dirname as dirname5, isAbsolute as isAbsolute3, join as join12, normalize, parse as parsePath } from "path";
6592
6596
  function normalizeRemote(url) {
6593
6597
  const raw = url.trim();
6594
6598
  if (!raw) return null;
@@ -6720,8 +6724,8 @@ async function nearestExistingDir(path) {
6720
6724
  for (; ; ) {
6721
6725
  const s = await pathStat(cur);
6722
6726
  if (s?.isDirectory()) return cur;
6723
- if (s?.isFile()) return dirname4(cur);
6724
- const parent = dirname4(cur);
6727
+ if (s?.isFile()) return dirname5(cur);
6728
+ const parent = dirname5(cur);
6725
6729
  if (parent === cur) return null;
6726
6730
  cur = parent;
6727
6731
  }
@@ -6730,7 +6734,7 @@ async function findGitRoot(path) {
6730
6734
  let cur = await nearestExistingDir(path);
6731
6735
  while (cur) {
6732
6736
  if (await pathStat(join12(cur, ".git"))) return cur;
6733
- const parent = dirname4(cur);
6737
+ const parent = dirname5(cur);
6734
6738
  if (parent === cur) return null;
6735
6739
  cur = parent;
6736
6740
  }
@@ -6841,7 +6845,7 @@ function extractAbsolutePaths(spans) {
6841
6845
  async function resolveRepoAttrs(cwd) {
6842
6846
  if (!cwd) return {};
6843
6847
  const attrs = { [ATTR.CWD]: cwd };
6844
- const basename15 = (() => {
6848
+ const basename16 = (() => {
6845
6849
  const trimmed = cwd.replace(/\/+$/g, "");
6846
6850
  const idx = trimmed.lastIndexOf("/");
6847
6851
  const name = idx === -1 ? trimmed : trimmed.slice(idx + 1);
@@ -6863,7 +6867,7 @@ async function resolveRepoAttrs(cwd) {
6863
6867
  if (commit) attrs[ATTR.GIT_COMMIT] = commit;
6864
6868
  } catch {
6865
6869
  }
6866
- attrs[ATTR.SUBJECT_KEY] = basename15;
6870
+ attrs[ATTR.SUBJECT_KEY] = basename16;
6867
6871
  return attrs;
6868
6872
  }
6869
6873
  async function repoCandidateForPath(path) {
@@ -8067,7 +8071,7 @@ var COMMAND_PREFIXES = /* @__PURE__ */ new Set([
8067
8071
  var ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/;
8068
8072
  var MAX_SHELL_DEPTH = 4;
8069
8073
  var MAX_WORDS = 2e4;
8070
- function basename7(word) {
8074
+ function basename8(word) {
8071
8075
  const cut = word.lastIndexOf("/");
8072
8076
  return cut === -1 ? word : word.slice(cut + 1);
8073
8077
  }
@@ -8166,7 +8170,7 @@ var ShellScanner = class {
8166
8170
  let start = 0;
8167
8171
  while (start < words.length) {
8168
8172
  const word = words[start];
8169
- if (ASSIGNMENT.test(word) || COMMAND_PREFIXES.has(basename7(word))) start += 1;
8173
+ if (ASSIGNMENT.test(word) || COMMAND_PREFIXES.has(basename8(word))) start += 1;
8170
8174
  else break;
8171
8175
  }
8172
8176
  return start === 0 || start >= words.length ? words : words.slice(start);
@@ -8307,7 +8311,7 @@ function shellCommands(script, depth = 0) {
8307
8311
  const out = [];
8308
8312
  for (const words of commands) {
8309
8313
  out.push(words);
8310
- const name = basename7(words[0] ?? "");
8314
+ const name = basename8(words[0] ?? "");
8311
8315
  if (!SHELLS.has(name) || depth >= MAX_SHELL_DEPTH) continue;
8312
8316
  for (let index = 1; index < words.length; index += 1) {
8313
8317
  const word = words[index];
@@ -8335,7 +8339,7 @@ function commandTextFromInput(input) {
8335
8339
  if (!Array.isArray(value) || value.length === 0) return void 0;
8336
8340
  const words = value.filter((entry) => typeof entry === "string");
8337
8341
  if (words.length !== value.length) return void 0;
8338
- const head = basename7(words[0] ?? "");
8342
+ const head = basename8(words[0] ?? "");
8339
8343
  if (SHELLS.has(head)) {
8340
8344
  const flag = words.findIndex((word, position) => position > 0 && /^-[a-z]*c$/.test(word));
8341
8345
  if (flag !== -1 && words[flag + 1] !== void 0) return words[flag + 1];
@@ -8397,7 +8401,7 @@ function stringAttribute2(span2, key) {
8397
8401
  const value = span2.attributes[key];
8398
8402
  return typeof value === "string" ? value : null;
8399
8403
  }
8400
- function basename8(word) {
8404
+ function basename9(word) {
8401
8405
  const cut = word.lastIndexOf("/");
8402
8406
  return cut === -1 ? word : word.slice(cut + 1);
8403
8407
  }
@@ -8480,7 +8484,7 @@ function numbersInLine(line) {
8480
8484
  function inferHeadBranch(commands, upTo, output) {
8481
8485
  for (let index = upTo - 1; index >= 0; index -= 1) {
8482
8486
  const words = commands[index];
8483
- if (basename8(words[0] ?? "") !== "git" || words.length < 2) continue;
8487
+ if (basename9(words[0] ?? "") !== "git" || words.length < 2) continue;
8484
8488
  const sub = words[1];
8485
8489
  const rest = words.slice(2);
8486
8490
  if (sub === "push") {
@@ -8555,7 +8559,7 @@ function eventsFromRecord(record2, recordIndex) {
8555
8559
  let createIndex = 0;
8556
8560
  for (let index = 0; index < commands.length; index += 1) {
8557
8561
  const words = commands[index];
8558
- if (words.length < 3 || !GH_NAMES.has(basename8(words[0])) || words[1] !== "pr") continue;
8562
+ if (words.length < 3 || !GH_NAMES.has(basename9(words[0])) || words[1] !== "pr") continue;
8559
8563
  const action = words[2];
8560
8564
  if (action === "create") {
8561
8565
  const printedNumber = printed[createIndex] ?? null;
@@ -9672,17 +9676,17 @@ import { isUtf8 as isUtf82 } from "buffer";
9672
9676
  import { createHash as createHash10 } from "crypto";
9673
9677
  import { constants } from "fs";
9674
9678
  import { lstat as lstat2, open as open2, realpath as realpath3 } from "fs/promises";
9675
- import { dirname as dirname8, isAbsolute as isAbsolute4, join as join18, relative as relative5, resolve as resolve6, sep as sep2 } from "path";
9679
+ import { dirname as dirname9, isAbsolute as isAbsolute4, join as join18, relative as relative5, resolve as resolve6, sep as sep2 } from "path";
9676
9680
 
9677
9681
  // src/bundle.ts
9678
9682
  import { createHash as createHash9 } from "crypto";
9679
9683
  import { copyFile, cp, lstat, mkdir as mkdir2, readdir as readdir13, readFile as readFile7, stat as stat12, writeFile as writeFile5 } from "fs/promises";
9680
- import { dirname as dirname7, join as join17, relative as relative4, resolve as resolve5, sep } from "path";
9684
+ import { dirname as dirname8, join as join17, relative as relative4, resolve as resolve5, sep } from "path";
9681
9685
 
9682
9686
  // src/improvement.ts
9683
9687
  import { access, mkdir, mkdtemp as mkdtemp2, writeFile as writeFile3 } from "fs/promises";
9684
9688
  import { tmpdir as tmpdir3 } from "os";
9685
- import { dirname as dirname5, join as join15, resolve as resolve4 } from "path";
9689
+ import { dirname as dirname6, join as join15, resolve as resolve4 } from "path";
9686
9690
  import { pathToFileURL } from "url";
9687
9691
  import {
9688
9692
  AnalystRegistry,
@@ -12011,14 +12015,14 @@ async function runTraceImprovement(opts) {
12011
12015
  };
12012
12016
  }
12013
12017
  async function saveReport(path, report) {
12014
- await mkdir(dirname5(resolve4(path)), { recursive: true });
12018
+ await mkdir(dirname6(resolve4(path)), { recursive: true });
12015
12019
  await writeFile3(path, report, "utf8");
12016
12020
  }
12017
12021
 
12018
12022
  // src/session-index.ts
12019
12023
  import { mkdtemp as mkdtemp3, readdir as readdir12, readFile as readFile6, stat as stat11, writeFile as writeFile4 } from "fs/promises";
12020
12024
  import { tmpdir as tmpdir4 } from "os";
12021
- import { dirname as dirname6, join as join16 } from "path";
12025
+ import { dirname as dirname7, join as join16 } from "path";
12022
12026
  function indexRow(record2) {
12023
12027
  return {
12024
12028
  session: record2.session,
@@ -12089,13 +12093,13 @@ async function findContextRoot(cwd) {
12089
12093
  let current = cwd;
12090
12094
  const s = await pathStat2(current);
12091
12095
  if (!s) return null;
12092
- if (!s.isDirectory()) current = dirname6(current);
12096
+ if (!s.isDirectory()) current = dirname7(current);
12093
12097
  for (; ; ) {
12094
12098
  if (await pathStat2(join16(current, ".git")) || await dirExists(join16(current, ".evolve")) || await fileExists(join16(current, "AGENTS.md")) || await fileExists(join16(current, "CLAUDE.md"))) {
12095
12099
  return current;
12096
12100
  }
12097
- const parent = dirname6(current);
12098
- if (parent === current) return s.isDirectory() ? cwd : dirname6(cwd);
12101
+ const parent = dirname7(current);
12102
+ if (parent === current) return s.isDirectory() ? cwd : dirname7(cwd);
12099
12103
  current = parent;
12100
12104
  }
12101
12105
  }
@@ -12929,7 +12933,7 @@ async function assembleSessionBundle(opts) {
12929
12933
  const subagentRelative = relative4(subagentsSource, file.path);
12930
12934
  const path = resolve5(file.path) === resolve5(ref.path) ? bundlePath("session", "transcript.jsonl") : !subagentRelative.startsWith("..") && !subagentRelative.startsWith(sep) ? bundlePath("session", "subagents", subagentRelative) : bundlePath("session", "sources", `${sourceId}.jsonl`);
12931
12935
  const target = join17(outDir, path);
12932
- await mkdir2(dirname7(target), { recursive: true });
12936
+ await mkdir2(dirname8(target), { recursive: true });
12933
12937
  await copyFile(file.path, target);
12934
12938
  if (await fileSha256(target, opts.signal) !== file.sha256) {
12935
12939
  throw new Error(`session source changed while retaining bundle evidence: ${file.path}`);
@@ -13373,7 +13377,7 @@ async function assertOutsideSourceBundle(directory, outputPath) {
13373
13377
  break;
13374
13378
  } catch (error) {
13375
13379
  if (error.code !== "ENOENT") throw error;
13376
- const parent = dirname8(ancestor);
13380
+ const parent = dirname9(ancestor);
13377
13381
  if (parent === ancestor) throw error;
13378
13382
  ancestor = parent;
13379
13383
  }
@@ -13639,7 +13643,7 @@ import {
13639
13643
  readFile as readFile10,
13640
13644
  rm as rm2
13641
13645
  } from "fs/promises";
13642
- import { basename as basename10, dirname as dirname10, join as join21, resolve as resolve8 } from "path";
13646
+ import { basename as basename11, dirname as dirname11, join as join21, resolve as resolve8 } from "path";
13643
13647
 
13644
13648
  // src/codetracebench-files.ts
13645
13649
  import { createHash as createHash12, randomUUID } from "crypto";
@@ -13657,13 +13661,13 @@ import {
13657
13661
  writeFile as writeFile6
13658
13662
  } from "fs/promises";
13659
13663
  import { hostname } from "os";
13660
- import { basename as basename9, dirname as dirname9, isAbsolute as isAbsolute5, join as join19, relative as relative6, resolve as resolve7, sep as sep3 } from "path";
13664
+ import { basename as basename10, dirname as dirname10, isAbsolute as isAbsolute5, join as join19, relative as relative6, resolve as resolve7, sep as sep3 } from "path";
13661
13665
  async function claimImportLock(input) {
13662
13666
  const claimId = randomUUID();
13663
13667
  const path = `${input.outputDirectory}.lock`;
13664
13668
  const temporary = join19(
13665
- dirname9(path),
13666
- `.${basename9(path)}.${claimId}.tmp`
13669
+ dirname10(path),
13670
+ `.${basename10(path)}.${claimId}.tmp`
13667
13671
  );
13668
13672
  const metadata = {
13669
13673
  kind: "traces.codetracebench-import-lock",
@@ -13824,8 +13828,8 @@ async function assertPathMissing(path) {
13824
13828
  async function atomicWriteFile(path, content, signal) {
13825
13829
  signal.throwIfAborted();
13826
13830
  const temporary = join19(
13827
- dirname9(path),
13828
- `.${basename9(path)}.${randomUUID()}.tmp`
13831
+ dirname10(path),
13832
+ `.${basename10(path)}.${randomUUID()}.tmp`
13829
13833
  );
13830
13834
  try {
13831
13835
  await writeFile6(temporary, content, {
@@ -14158,12 +14162,12 @@ async function importCodeTraceBench(options) {
14158
14162
  const rowsPath = resolve8(options.rowsPath);
14159
14163
  const trajectoryPath = resolve8(options.trajectoryDir);
14160
14164
  const outputDirectory = resolve8(options.outDir);
14161
- const outputBase = basename10(outputDirectory);
14162
- if (!outputBase || outputDirectory === dirname10(outputDirectory)) {
14165
+ const outputBase = basename11(outputDirectory);
14166
+ if (!outputBase || outputDirectory === dirname11(outputDirectory)) {
14163
14167
  throw new Error("CodeTraceBench output directory must not be a filesystem root");
14164
14168
  }
14165
14169
  options.signal?.throwIfAborted();
14166
- await mkdir4(dirname10(outputDirectory), { recursive: true });
14170
+ await mkdir4(dirname11(outputDirectory), { recursive: true });
14167
14171
  const lock = await claimImportLock({
14168
14172
  rowsPath,
14169
14173
  trajectoryDirectory: trajectoryPath,
@@ -14202,7 +14206,7 @@ async function runCodeTraceBenchImport(input) {
14202
14206
  const rows = parseRows(rowsBytes.toString("utf8"), rowsPath);
14203
14207
  const sourceRows = validateRows(rows, rowsPath);
14204
14208
  const stagingDirectory = await mkdtemp4(
14205
- join21(dirname10(outputDirectory), `.${outputBase}.tmp-`)
14209
+ join21(dirname11(outputDirectory), `.${outputBase}.tmp-`)
14206
14210
  );
14207
14211
  const stop = new AbortController();
14208
14212
  const signal = outerSignal ? AbortSignal.any([outerSignal, stop.signal]) : stop.signal;
@@ -14262,10 +14266,10 @@ async function runCodeTraceBenchImport(input) {
14262
14266
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
14263
14267
  input: {
14264
14268
  revision,
14265
- rowsFile: basename10(rowsPath),
14269
+ rowsFile: basename11(rowsPath),
14266
14270
  rowsSha256,
14267
14271
  rowsBytes: rowsBytes.byteLength,
14268
- trajectoryDirectory: basename10(trajectoryDirectory),
14272
+ trajectoryDirectory: basename11(trajectoryDirectory),
14269
14273
  sha256: inputSha256
14270
14274
  },
14271
14275
  settings: {
@@ -16771,7 +16775,7 @@ async function writeTraceEvidenceExportFile(inputPath, outPath, opts = {}) {
16771
16775
  // src/inspect.ts
16772
16776
  import { mkdtemp as mkdtemp7, readFile as readFile13, writeFile as writeFile9 } from "fs/promises";
16773
16777
  import { tmpdir as tmpdir7 } from "os";
16774
- import { basename as basename11, join as join25 } from "path";
16778
+ import { basename as basename12, join as join25 } from "path";
16775
16779
  var severityRank2 = {
16776
16780
  high: 0,
16777
16781
  medium: 1,
@@ -16954,7 +16958,7 @@ function addContextFindings(index, findings) {
16954
16958
  refs: invalidJsonlFiles.slice(0, 5).map((file) => file.path)
16955
16959
  });
16956
16960
  }
16957
- const skillRunFiles = files.filter((file) => basename11(file.path) === "skill-runs.jsonl" && (file.jsonl?.rows ?? 0) > 0).map((file) => {
16961
+ const skillRunFiles = files.filter((file) => basename12(file.path) === "skill-runs.jsonl" && (file.jsonl?.rows ?? 0) > 0).map((file) => {
16958
16962
  const rows = file.jsonl?.rows ?? 0;
16959
16963
  const keys = file.jsonl?.keys ?? {};
16960
16964
  const linkKeyCounts = {
@@ -17494,7 +17498,7 @@ async function streamSessions(opts) {
17494
17498
 
17495
17499
  // src/supervisor-run-context.ts
17496
17500
  import { readFile as readFile14, stat as stat14 } from "fs/promises";
17497
- import { basename as basename12, join as join26 } from "path";
17501
+ import { basename as basename13, join as join26 } from "path";
17498
17502
  import { materializeTreeView } from "@tangle-network/agent-runtime/kernel";
17499
17503
  import {
17500
17504
  readRuntimeSupervisorRun
@@ -17667,7 +17671,7 @@ async function readFileRunContext(runDir, opts = {}) {
17667
17671
  return {
17668
17672
  ...sources,
17669
17673
  instanceId: opts.instanceId !== void 0 ? opts.instanceId : sources.instanceId,
17670
- arm: opts.arm !== void 0 ? opts.arm : basename12(runDir),
17674
+ arm: opts.arm !== void 0 ? opts.arm : basename13(runDir),
17671
17675
  workers: sources.workers !== null && coordination.present ? workerSources(sources.workers, coordination) : sources.workers,
17672
17676
  ...sources.journal !== null ? {
17673
17677
  rootTranscriptRef: join26(runDir, SPAWN_JOURNAL_FILE),
@@ -19329,7 +19333,7 @@ async function watchSessions(opts) {
19329
19333
  // src/bundle-view.ts
19330
19334
  import { createHash as createHash17 } from "crypto";
19331
19335
  import { mkdir as mkdir7, readdir as readdir17, readFile as readFile16, writeFile as writeFile11 } from "fs/promises";
19332
- import { dirname as dirname11, join as join30, resolve as resolve11 } from "path";
19336
+ import { dirname as dirname12, join as join30, resolve as resolve11 } from "path";
19333
19337
  var EVIDENCE_ONLY_ALLOW_LIST = [
19334
19338
  {
19335
19339
  path: "derived/session-index.json",
@@ -19567,7 +19571,7 @@ async function projectSessionBundle(opts) {
19567
19571
  continue;
19568
19572
  }
19569
19573
  const target = join30(outDir, candidate.path);
19570
- await mkdir7(dirname11(target), { recursive: true });
19574
+ await mkdir7(dirname12(target), { recursive: true });
19571
19575
  await writeFile11(target, candidate.bytes);
19572
19576
  carriedPaths.push(candidate.path);
19573
19577
  carries.set(candidate.path, candidate.carries);
@@ -19771,7 +19775,7 @@ function renderRunDiff(report) {
19771
19775
  // src/upload-state.ts
19772
19776
  import { mkdir as mkdir8, readFile as readFile17, writeFile as writeFile12 } from "fs/promises";
19773
19777
  import { homedir as homedir10 } from "os";
19774
- import { dirname as dirname12, join as join31 } from "path";
19778
+ import { dirname as dirname13, join as join31 } from "path";
19775
19779
  import { contentHash } from "@tangle-network/agent-eval";
19776
19780
  function stateFile() {
19777
19781
  const base = process.env.XDG_STATE_HOME ?? join31(homedir10(), ".local", "state");
@@ -19795,7 +19799,7 @@ async function loadState() {
19795
19799
  }
19796
19800
  async function saveState(state) {
19797
19801
  const f = stateFile();
19798
- await mkdir8(dirname12(f), { recursive: true });
19802
+ await mkdir8(dirname13(f), { recursive: true });
19799
19803
  await writeFile12(f, `${JSON.stringify(state, null, 2)}
19800
19804
  `, "utf8");
19801
19805
  }
@@ -19807,7 +19811,7 @@ function alreadyUploaded(state, harness, sessionId, hash2) {
19807
19811
  import { readFile as readFile18 } from "fs/promises";
19808
19812
  import { createRequire as createRequire2 } from "module";
19809
19813
  import { hostname as hostname2 } from "os";
19810
- import { basename as basename13, join as join32 } from "path";
19814
+ import { basename as basename14, join as join32 } from "path";
19811
19815
  import { hostedClientFromEnv } from "@tangle-network/agent-eval/hosted";
19812
19816
  import { assessShareSafety as assessShareSafety2, REDACTION_VERSION, redact as redact2, shareAllowed } from "@tangle-network/agent-eval/traces";
19813
19817
  var require2 = createRequire2(import.meta.url);
@@ -19841,7 +19845,7 @@ async function gitBranch(cwd) {
19841
19845
  async function sessionMeta(item) {
19842
19846
  const meta = {
19843
19847
  [ATTR.HARNESS]: item.ref.harness,
19844
- [ATTR.SESSION_FILE]: basename13(item.ref.path),
19848
+ [ATTR.SESSION_FILE]: basename14(item.ref.path),
19845
19849
  [ATTR.HOST]: hostname2(),
19846
19850
  [ATTR.UPLOADER]: `tangle-traces@${TRACES_VERSION}`,
19847
19851
  [ATTR.REDACTION_VERSION]: REDACTION_VERSION,
@@ -20007,7 +20011,7 @@ async function executeUpload(plan, opts = {}) {
20007
20011
 
20008
20012
  // src/verify-safe.ts
20009
20013
  import { lstat as lstat4, readdir as readdir18, readFile as readFile19 } from "fs/promises";
20010
- import { basename as basename14, extname, join as join33, relative as relative7 } from "path";
20014
+ import { basename as basename15, extname, join as join33, relative as relative7 } from "path";
20011
20015
  import {
20012
20016
  assessShareSafety as assessShareSafety3,
20013
20017
  combineVerdicts as combineVerdicts2
@@ -20020,7 +20024,7 @@ async function verifySafe(target, options = {}) {
20020
20024
  const unreadable = [];
20021
20025
  const files = await listFiles(target, unreadable);
20022
20026
  for (const file of files) {
20023
- const label2 = relative7(target, file) || basename14(file);
20027
+ const label2 = relative7(target, file) || basename15(file);
20024
20028
  let bytes2;
20025
20029
  try {
20026
20030
  bytes2 = await readFile19(file);
@@ -20122,7 +20126,7 @@ function formatVerdict(result) {
20122
20126
  // src/skill-usage.ts
20123
20127
  import { mkdir as mkdir9, open as open3, readdir as readdir19, readFile as readFile20, rename as rename3, stat as stat17, writeFile as writeFile13 } from "fs/promises";
20124
20128
  import { homedir as homedir11 } from "os";
20125
- import { dirname as dirname13, join as join34 } from "path";
20129
+ import { dirname as dirname14, join as join34 } from "path";
20126
20130
  import { STORES } from "@tangle-network/harness-sessions/catalog";
20127
20131
  var CHUNK_BYTES = 8 * 1024 * 1024;
20128
20132
  var NEWLINE = 10;
@@ -20207,7 +20211,7 @@ var SkillUsageStore = class _SkillUsageStore {
20207
20211
  files: this.files,
20208
20212
  events: this.list().map((e) => [e.harness, e.kind, e.skill, e.root, e.ts, e.session, e.id])
20209
20213
  };
20210
- await mkdir9(dirname13(this.path), { recursive: true });
20214
+ await mkdir9(dirname14(this.path), { recursive: true });
20211
20215
  const temporary = `${this.path}.${process.pid}.tmp`;
20212
20216
  await writeFile13(temporary, JSON.stringify(body));
20213
20217
  await rename3(temporary, this.path);
@@ -20486,7 +20490,7 @@ function skillName(value) {
20486
20490
  }
20487
20491
  function rootOf(baseDirectoryText) {
20488
20492
  const directory = baseDirectoryText.slice(BASE_DIRECTORY.length).split("\n", 1)[0].trim();
20489
- return dirname13(directory);
20493
+ return dirname14(directory);
20490
20494
  }
20491
20495
  function sessionFromPath(path) {
20492
20496
  return SESSION_UUID.exec(path)?.[1] ?? path;
package/dist/cli.js CHANGED
@@ -92,7 +92,7 @@ import {
92
92
  writeSessionIndexFile,
93
93
  writeTraceEvidenceExportFile,
94
94
  writeTraceQuestionsArtifacts
95
- } from "./chunk-COSWFESO.js";
95
+ } from "./chunk-7DVZCCZI.js";
96
96
 
97
97
  // src/cli.ts
98
98
  import { readFileSync } from "fs";
package/dist/index.js CHANGED
@@ -287,7 +287,7 @@ import {
287
287
  writeTraceQuestionsArtifacts,
288
288
  zaiChatCaller,
289
289
  zeroPricedCost
290
- } from "./chunk-COSWFESO.js";
290
+ } from "./chunk-7DVZCCZI.js";
291
291
 
292
292
  // src/adapters/factory.ts
293
293
  import { readdir, stat } from "fs/promises";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/traces",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "description": "Point it at your coding-agent session traces (Claude Code, Codex, OpenCode, Gemini, Pi, \u2026) and get failure-mode + efficiency findings. CLI + SDK over the @tangle-network/agent-eval analyst suite \u2014 observe live sessions, run your own analysts, redact, and upload to the Tangle Intelligence Platform.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -65,7 +65,7 @@
65
65
  "@tangle-network/agent-interface": "5.2.0",
66
66
  "@tangle-network/agent-runtime": "0.318.0",
67
67
  "@tangle-network/agent-trace-contract": "2.0.0",
68
- "@tangle-network/harness-sessions": "0.1.2",
68
+ "@tangle-network/harness-sessions": "0.1.3",
69
69
  "@tangle-network/sandbox": "0.60.49"
70
70
  },
71
71
  "devDependencies": {