@tangle-network/traces 0.1.0 → 0.2.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/README.md +64 -3
- package/dist/chunk-HPBKRTTP.js +1924 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +128 -1639
- package/dist/index.d.ts +657 -0
- package/dist/index.js +126 -0
- package/package.json +13 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AmpAdapter,
|
|
3
|
+
CODING_REDACTION_RULES,
|
|
4
|
+
ClaudeAdapter,
|
|
5
|
+
CodexAdapter,
|
|
6
|
+
CopilotAdapter,
|
|
7
|
+
FactoryAdapter,
|
|
8
|
+
ForgeAdapter,
|
|
9
|
+
GeminiAdapter,
|
|
10
|
+
OpencodeAdapter,
|
|
11
|
+
PiAdapter,
|
|
12
|
+
QwenAdapter,
|
|
13
|
+
TRACES_REDACTION_RULES,
|
|
14
|
+
alreadyUploaded,
|
|
15
|
+
analyzeSpans,
|
|
16
|
+
executeUpload,
|
|
17
|
+
knownHarnesses,
|
|
18
|
+
listAdapters,
|
|
19
|
+
loadState,
|
|
20
|
+
planUpload,
|
|
21
|
+
redactSpans,
|
|
22
|
+
resolveAdapter,
|
|
23
|
+
runPipelines,
|
|
24
|
+
saveState,
|
|
25
|
+
serializeSpans,
|
|
26
|
+
sessionHash,
|
|
27
|
+
span,
|
|
28
|
+
toRuntimeStore,
|
|
29
|
+
toTraceSpanEvents,
|
|
30
|
+
uploadKey,
|
|
31
|
+
watchSessions,
|
|
32
|
+
writeOtlp,
|
|
33
|
+
writeOtlpFile
|
|
34
|
+
} from "./chunk-HPBKRTTP.js";
|
|
35
|
+
|
|
36
|
+
// src/collect.ts
|
|
37
|
+
function adaptersFor(opts) {
|
|
38
|
+
if (opts.adapters && opts.adapters.length > 0) return opts.adapters;
|
|
39
|
+
if (opts.all || !opts.harnesses || opts.harnesses.length === 0) return [...listAdapters()];
|
|
40
|
+
const out = [];
|
|
41
|
+
for (const h of opts.harnesses) {
|
|
42
|
+
const a = resolveAdapter(h);
|
|
43
|
+
if (a && !out.includes(a)) out.push(a);
|
|
44
|
+
}
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
47
|
+
async function collectSessions(opts = {}) {
|
|
48
|
+
const out = [];
|
|
49
|
+
for (const adapter of adaptersFor(opts)) {
|
|
50
|
+
let refs;
|
|
51
|
+
try {
|
|
52
|
+
refs = await adapter.locate({ cwd: opts.cwd, sinceMs: opts.sinceMs });
|
|
53
|
+
} catch {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (opts.last && opts.last > 0) refs = refs.slice(0, opts.last);
|
|
57
|
+
for (const ref of refs) {
|
|
58
|
+
let spans;
|
|
59
|
+
try {
|
|
60
|
+
spans = await adapter.parse(ref);
|
|
61
|
+
} catch {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (spans.length === 0) continue;
|
|
65
|
+
if (opts.redact === false) {
|
|
66
|
+
out.push({ ref, spans });
|
|
67
|
+
} else {
|
|
68
|
+
const r = redactSpans(spans);
|
|
69
|
+
out.push({ ref, spans: r.spans, redaction: r.report });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return out;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// src/index.ts
|
|
77
|
+
import {
|
|
78
|
+
AnalystRegistry,
|
|
79
|
+
buildDefaultAnalystRegistry,
|
|
80
|
+
makeFinding
|
|
81
|
+
} from "@tangle-network/agent-eval/analyst";
|
|
82
|
+
import { createHostedClient, hostedClientFromEnv } from "@tangle-network/agent-eval/hosted";
|
|
83
|
+
import { DEFAULT_REDACTION_RULES, redactString, redactValue } from "@tangle-network/agent-eval/traces";
|
|
84
|
+
export {
|
|
85
|
+
AmpAdapter,
|
|
86
|
+
AnalystRegistry,
|
|
87
|
+
CODING_REDACTION_RULES,
|
|
88
|
+
ClaudeAdapter,
|
|
89
|
+
CodexAdapter,
|
|
90
|
+
CopilotAdapter,
|
|
91
|
+
DEFAULT_REDACTION_RULES,
|
|
92
|
+
FactoryAdapter,
|
|
93
|
+
ForgeAdapter,
|
|
94
|
+
GeminiAdapter,
|
|
95
|
+
OpencodeAdapter,
|
|
96
|
+
PiAdapter,
|
|
97
|
+
QwenAdapter,
|
|
98
|
+
TRACES_REDACTION_RULES,
|
|
99
|
+
alreadyUploaded,
|
|
100
|
+
analyzeSpans,
|
|
101
|
+
buildDefaultAnalystRegistry,
|
|
102
|
+
collectSessions,
|
|
103
|
+
createHostedClient,
|
|
104
|
+
executeUpload,
|
|
105
|
+
hostedClientFromEnv,
|
|
106
|
+
knownHarnesses,
|
|
107
|
+
listAdapters,
|
|
108
|
+
loadState,
|
|
109
|
+
makeFinding,
|
|
110
|
+
planUpload,
|
|
111
|
+
redactSpans,
|
|
112
|
+
redactString,
|
|
113
|
+
redactValue,
|
|
114
|
+
resolveAdapter,
|
|
115
|
+
runPipelines,
|
|
116
|
+
saveState,
|
|
117
|
+
serializeSpans,
|
|
118
|
+
sessionHash,
|
|
119
|
+
span,
|
|
120
|
+
toRuntimeStore,
|
|
121
|
+
toTraceSpanEvents,
|
|
122
|
+
uploadKey,
|
|
123
|
+
watchSessions,
|
|
124
|
+
writeOtlp,
|
|
125
|
+
writeOtlpFile
|
|
126
|
+
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/traces",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Point it at your coding-agent session traces (Claude Code, Codex, OpenCode, Gemini, Pi, …) and get failure-mode + efficiency findings.
|
|
3
|
+
"version": "0.2.0",
|
|
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",
|
|
7
|
+
"packageManager": "pnpm@10.33.4",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
7
17
|
"bin": {
|
|
8
18
|
"traces": "dist/cli.js"
|
|
9
19
|
},
|
|
@@ -16,7 +26,7 @@
|
|
|
16
26
|
},
|
|
17
27
|
"scripts": {
|
|
18
28
|
"dev": "tsx src/cli.ts",
|
|
19
|
-
"build": "tsup src/cli.ts --format esm --target node22 --clean",
|
|
29
|
+
"build": "tsup src/index.ts src/cli.ts --format esm --target node22 --clean --dts",
|
|
20
30
|
"test": "vitest run",
|
|
21
31
|
"test:watch": "vitest",
|
|
22
32
|
"typecheck": "tsc --noEmit",
|