@tangle-network/traces 0.23.0 → 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.
- package/README.md +61 -1078
- package/dist/analyst-model-call-JVUOYZ5V.js +20 -0
- package/dist/ask-XLS3VANY.js +39 -0
- package/dist/check-YF6ZHPGG.js +322 -0
- package/dist/chunk-3I4PJ5Q7.js +25 -0
- package/dist/chunk-3T62R7ON.js +5695 -0
- package/dist/chunk-4VKPN432.js +138 -0
- package/dist/chunk-6CLC7DKP.js +492 -0
- package/dist/chunk-7CBV5RJ2.js +535 -0
- package/dist/chunk-B62DOFGI.js +273 -0
- package/dist/chunk-CL3OQOWX.js +407 -0
- package/dist/chunk-DLGAKCQJ.js +782 -0
- package/dist/chunk-DU534HAX.js +263 -0
- package/dist/chunk-GLUDGUGJ.js +232 -0
- package/dist/chunk-J2PM5SVN.js +503 -0
- package/dist/chunk-M3W6TZHQ.js +381 -0
- package/dist/chunk-NH7HCDLB.js +759 -0
- package/dist/chunk-NZ5Y7UEL.js +1217 -0
- package/dist/chunk-O52XK7OB.js +19 -0
- package/dist/chunk-PYH3PL3N.js +62 -0
- package/dist/chunk-RZL5GAWH.js +60 -0
- package/dist/chunk-TR6O4S4T.js +208 -0
- package/dist/chunk-TW43MR5D.js +259 -0
- package/dist/chunk-TYLFUX42.js +228 -0
- package/dist/chunk-UOLRCQHC.js +120 -0
- package/dist/chunk-UVE5ANVV.js +3921 -0
- package/dist/chunk-V2OCGX57.js +53 -0
- package/dist/cli.js +2086 -2050
- package/dist/diff-ZZ6KYBPP.js +16 -0
- package/dist/improvement-OJQ6365E.js +25 -0
- package/dist/index.d.ts +1235 -4357
- package/dist/index.js +53 -1204
- package/dist/live-Y64AJ6MA.js +14 -0
- package/dist/mcp-ZPGTJQYQ.js +85 -0
- package/dist/report-JAMXRTCW.js +338 -0
- package/dist/run-watch-PLWTIRSV.js +649 -0
- package/dist/supervisor-report-RMPLLBGZ.js +29 -0
- package/dist/supervisor-run-context-WO6VOTGV.js +30 -0
- package/dist/upload-R6NMKSGQ.js +20 -0
- package/dist/verify-safe-C5ZXZOZ2.js +8 -0
- package/docs/analyze.md +76 -0
- package/docs/ask.md +88 -0
- package/docs/bundle.md +40 -0
- package/docs/check.md +77 -0
- package/docs/convert.md +44 -0
- package/docs/develop.md +32 -0
- package/docs/diff.md +38 -0
- package/docs/facts.md +114 -0
- package/docs/mcp.md +36 -0
- package/docs/migrate-1.0.md +33 -0
- package/docs/parsers.md +66 -0
- package/docs/release-1.0.0.md +147 -0
- package/docs/sdk.md +77 -0
- package/docs/select.md +70 -0
- package/docs/skills.md +46 -0
- package/docs/upload.md +47 -0
- package/docs/watch-jsonl.v1.example.jsonl +5 -0
- package/docs/watch.md +66 -0
- package/examples/README.md +9 -0
- package/examples/custom-analyst.ts +65 -74
- package/install.sh +22 -2
- package/package.json +8 -7
- package/skills/inspect-agent-traces/SKILL.md +47 -110
- package/dist/chunk-COSWFESO.js +0 -20979
- package/docs/replay-verify.md +0 -123
- package/docs/stream-findings.svg +0 -39
- package/docs/trace-analysts.md +0 -643
- package/examples/custom-backend.ts +0 -21
- package/examples/external-engines.ts +0 -62
- package/examples/improvement-config.mjs +0 -63
- package/examples/observe-and-alert.ts +0 -19
- package/examples/register-harness.ts +0 -26
- package/skills/build-trace-analyst/SKILL.md +0 -76
- package/skills/build-trace-analyst/agents/openai.yaml +0 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ATTR,
|
|
3
|
+
SESSION_CWD_ATTR,
|
|
4
|
+
SUBAGENT_SPAWN_TASK_ATTR,
|
|
5
|
+
SUBAGENT_TASK_ATTR
|
|
6
|
+
} from "./chunk-TR6O4S4T.js";
|
|
7
|
+
import {
|
|
8
|
+
SOURCE_ATTRIBUTE_PREFIX
|
|
9
|
+
} from "./chunk-DU534HAX.js";
|
|
10
|
+
|
|
11
|
+
// src/metadata-only.ts
|
|
12
|
+
import { isContentAttribute } from "@tangle-network/agent-eval/diagnosis";
|
|
13
|
+
var PAYLOAD_DERIVED = /^(?:input|output)\.mime_type$|^traces\.(?:input|output)\.(?:bytes|sha256|truncated)$/i;
|
|
14
|
+
var WITHHELD = /* @__PURE__ */ new Set([
|
|
15
|
+
"tool.args_captured",
|
|
16
|
+
"cwd",
|
|
17
|
+
SESSION_CWD_ATTR,
|
|
18
|
+
ATTR.CWD,
|
|
19
|
+
ATTR.ENVIRONMENT_CWD,
|
|
20
|
+
ATTR.SESSION_FILE,
|
|
21
|
+
ATTR.CORRUPTION_SOURCE_PATH,
|
|
22
|
+
ATTR.SUBJECT_KEY,
|
|
23
|
+
ATTR.GIT_REPOSITORY,
|
|
24
|
+
ATTR.GIT_BRANCH,
|
|
25
|
+
ATTR.GIT_BRANCH_NAME,
|
|
26
|
+
SUBAGENT_TASK_ATTR,
|
|
27
|
+
SUBAGENT_SPAWN_TASK_ATTR
|
|
28
|
+
]);
|
|
29
|
+
function isMetadataAttribute(key, value) {
|
|
30
|
+
return !(isContentAttribute(key) || PAYLOAD_DERIVED.test(key) || WITHHELD.has(key) || key.startsWith(SOURCE_ATTRIBUTE_PREFIX) || value !== null && typeof value === "object");
|
|
31
|
+
}
|
|
32
|
+
function metadataOnly(spans) {
|
|
33
|
+
const dropped = /* @__PURE__ */ new Set();
|
|
34
|
+
const keep = (attributes) => {
|
|
35
|
+
const kept = {};
|
|
36
|
+
for (const [key, value] of Object.entries(attributes)) {
|
|
37
|
+
if (isMetadataAttribute(key, value)) kept[key] = value;
|
|
38
|
+
else dropped.add(key);
|
|
39
|
+
}
|
|
40
|
+
return kept;
|
|
41
|
+
};
|
|
42
|
+
const out = spans.map((span) => {
|
|
43
|
+
if (span.status.message) dropped.add("status.message");
|
|
44
|
+
const links = span.links?.map((link) => link.attributes ? { ...link, attributes: keep(link.attributes) } : link);
|
|
45
|
+
return { ...span, attributes: keep(span.attributes), status: { code: span.status.code }, ...links ? { links } : {} };
|
|
46
|
+
});
|
|
47
|
+
return { spans: out, dropped: [...dropped].sort() };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
isMetadataAttribute,
|
|
52
|
+
metadataOnly
|
|
53
|
+
};
|