@tangle-network/traces 0.8.26 → 0.8.27

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.
@@ -22,9 +22,12 @@ function skillNameOf(input) {
22
22
  return typeof v === "string" && v.length > 0 ? v : "?";
23
23
  }
24
24
  function subagentTypeOf(input) {
25
- const v = input.subagent_type;
25
+ const v = input.subagent_type ?? input.agent_type ?? input.type ?? input.name;
26
26
  return typeof v === "string" && v.length > 0 ? v : "?";
27
27
  }
28
+ function isSpawnAgentTool(name) {
29
+ return name === "spawn_agent" || name.endsWith("__spawn_agent");
30
+ }
28
31
  function countSkillRunsJsonl(raw) {
29
32
  const out = {};
30
33
  for (const line of raw.split("\n")) {
@@ -73,6 +76,8 @@ async function analyzeAdoption(spans, opts = {}) {
73
76
  const sessionsWithSubagent = /* @__PURE__ */ new Set();
74
77
  const skillInvocations = {};
75
78
  const subagentSpawns = {};
79
+ const canonicalSubagentSessions = /* @__PURE__ */ new Set();
80
+ const fallbackSubagents = /* @__PURE__ */ new Map();
76
81
  for (const s of spans) {
77
82
  sessions.add(s.trace_id);
78
83
  const tn = toolName(s);
@@ -84,6 +89,18 @@ async function analyzeAdoption(spans, opts = {}) {
84
89
  const type = subagentTypeOf(parseInput(s));
85
90
  subagentSpawns[type] = (subagentSpawns[type] ?? 0) + 1;
86
91
  sessionsWithSubagent.add(s.trace_id);
92
+ canonicalSubagentSessions.add(s.trace_id);
93
+ } else if (tn && isSpawnAgentTool(tn)) {
94
+ const types = fallbackSubagents.get(s.trace_id) ?? [];
95
+ types.push(subagentTypeOf(parseInput(s)));
96
+ fallbackSubagents.set(s.trace_id, types);
97
+ }
98
+ }
99
+ for (const [traceId, types] of fallbackSubagents) {
100
+ if (canonicalSubagentSessions.has(traceId)) continue;
101
+ sessionsWithSubagent.add(traceId);
102
+ for (const type of types) {
103
+ subagentSpawns[type] = (subagentSpawns[type] ?? 0) + 1;
87
104
  }
88
105
  }
89
106
  const { counts: loopDispatchedRuns, filesRead } = await readLoopRuns(opts.cwds ?? []);
@@ -471,6 +488,10 @@ var INJECT_MARKERS = [
471
488
  // not a person. (Observed in Claude Code task/loop sessions.)
472
489
  "<task-notification>",
473
490
  "<task-prompt>",
491
+ // Prefix match: Codex adds attributes such as source="goal" to this tag.
492
+ "<codex_internal_context",
493
+ "<subagent_notification>",
494
+ "# AGENTS.md instructions for ",
474
495
  "<local-command-stdout>",
475
496
  "This session is being continued from a previous conversation",
476
497
  // Slash-command skill bodies are expanded into a user turn (no <command-name>
package/dist/cli.js CHANGED
@@ -44,7 +44,7 @@ import {
44
44
  writePolicyEvidenceFile,
45
45
  writeSessionIndexFile,
46
46
  writeTraceEvidenceExportFile
47
- } from "./chunk-6N2KVDOU.js";
47
+ } from "./chunk-EZDMNNW4.js";
48
48
 
49
49
  // src/cli.ts
50
50
  import { readFileSync } from "fs";
package/dist/index.js CHANGED
@@ -99,7 +99,7 @@ import {
99
99
  writeSessionIndexFile,
100
100
  writeTraceEvidenceExportFile,
101
101
  writeTraceImprovementArtifacts
102
- } from "./chunk-6N2KVDOU.js";
102
+ } from "./chunk-EZDMNNW4.js";
103
103
 
104
104
  // src/collect.ts
105
105
  async function collectSessions(opts = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/traces",
3
- "version": "0.8.26",
3
+ "version": "0.8.27",
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",