@tangle-network/traces 0.23.1 → 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.
Files changed (74) hide show
  1. package/README.md +61 -1078
  2. package/dist/analyst-model-call-JVUOYZ5V.js +20 -0
  3. package/dist/ask-XLS3VANY.js +39 -0
  4. package/dist/check-YF6ZHPGG.js +322 -0
  5. package/dist/chunk-3I4PJ5Q7.js +25 -0
  6. package/dist/chunk-3T62R7ON.js +5695 -0
  7. package/dist/chunk-4VKPN432.js +138 -0
  8. package/dist/chunk-6CLC7DKP.js +492 -0
  9. package/dist/chunk-7CBV5RJ2.js +535 -0
  10. package/dist/chunk-B62DOFGI.js +273 -0
  11. package/dist/chunk-CL3OQOWX.js +407 -0
  12. package/dist/chunk-DLGAKCQJ.js +782 -0
  13. package/dist/chunk-DU534HAX.js +263 -0
  14. package/dist/chunk-GLUDGUGJ.js +232 -0
  15. package/dist/chunk-J2PM5SVN.js +503 -0
  16. package/dist/chunk-M3W6TZHQ.js +381 -0
  17. package/dist/chunk-NH7HCDLB.js +759 -0
  18. package/dist/chunk-NZ5Y7UEL.js +1217 -0
  19. package/dist/chunk-O52XK7OB.js +19 -0
  20. package/dist/chunk-PYH3PL3N.js +62 -0
  21. package/dist/chunk-RZL5GAWH.js +60 -0
  22. package/dist/chunk-TR6O4S4T.js +208 -0
  23. package/dist/chunk-TW43MR5D.js +259 -0
  24. package/dist/chunk-TYLFUX42.js +228 -0
  25. package/dist/chunk-UOLRCQHC.js +120 -0
  26. package/dist/chunk-UVE5ANVV.js +3921 -0
  27. package/dist/chunk-V2OCGX57.js +53 -0
  28. package/dist/cli.js +2086 -2050
  29. package/dist/diff-ZZ6KYBPP.js +16 -0
  30. package/dist/improvement-OJQ6365E.js +25 -0
  31. package/dist/index.d.ts +1235 -4357
  32. package/dist/index.js +53 -1204
  33. package/dist/live-Y64AJ6MA.js +14 -0
  34. package/dist/mcp-ZPGTJQYQ.js +85 -0
  35. package/dist/report-JAMXRTCW.js +338 -0
  36. package/dist/run-watch-PLWTIRSV.js +649 -0
  37. package/dist/supervisor-report-RMPLLBGZ.js +29 -0
  38. package/dist/supervisor-run-context-WO6VOTGV.js +30 -0
  39. package/dist/upload-R6NMKSGQ.js +20 -0
  40. package/dist/verify-safe-C5ZXZOZ2.js +8 -0
  41. package/docs/analyze.md +76 -0
  42. package/docs/ask.md +88 -0
  43. package/docs/bundle.md +40 -0
  44. package/docs/check.md +77 -0
  45. package/docs/convert.md +44 -0
  46. package/docs/develop.md +32 -0
  47. package/docs/diff.md +38 -0
  48. package/docs/facts.md +114 -0
  49. package/docs/mcp.md +36 -0
  50. package/docs/migrate-1.0.md +33 -0
  51. package/docs/parsers.md +66 -0
  52. package/docs/release-1.0.0.md +147 -0
  53. package/docs/sdk.md +77 -0
  54. package/docs/select.md +70 -0
  55. package/docs/skills.md +46 -0
  56. package/docs/upload.md +47 -0
  57. package/docs/watch-jsonl.v1.example.jsonl +5 -0
  58. package/docs/watch.md +66 -0
  59. package/examples/README.md +9 -0
  60. package/examples/custom-analyst.ts +65 -74
  61. package/install.sh +22 -2
  62. package/package.json +8 -7
  63. package/skills/inspect-agent-traces/SKILL.md +47 -110
  64. package/dist/chunk-7DVZCCZI.js +0 -20983
  65. package/docs/replay-verify.md +0 -123
  66. package/docs/stream-findings.svg +0 -39
  67. package/docs/trace-analysts.md +0 -643
  68. package/examples/custom-backend.ts +0 -21
  69. package/examples/external-engines.ts +0 -62
  70. package/examples/improvement-config.mjs +0 -63
  71. package/examples/observe-and-alert.ts +0 -19
  72. package/examples/register-harness.ts +0 -26
  73. package/skills/build-trace-analyst/SKILL.md +0 -76
  74. 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
+ };