@m4trix/trace-viewer 0.15.0 → 0.17.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 (28) hide show
  1. package/README.md +30 -0
  2. package/dist/cli.js +1862 -21
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/assets/{anthropic-Cvv_bLk5.js → anthropic-DUwMYY1S.js} +3 -3
  5. package/dist/client/assets/{bedrock-60CwtBlB.js → bedrock-BIja-RWN.js} +1 -1
  6. package/dist/client/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  7. package/dist/client/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  8. package/dist/client/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  9. package/dist/client/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  10. package/dist/client/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  11. package/dist/client/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  12. package/dist/client/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  13. package/dist/client/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  14. package/dist/client/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  15. package/dist/client/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  16. package/dist/client/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  17. package/dist/client/assets/index-Cl5VyaKo.js +274 -0
  18. package/dist/client/assets/index-DVz5tq4u.css +1 -0
  19. package/dist/client/assets/{node.browser-BHILlKa5.js → node.browser-C_s9kvmM.js} +1 -1
  20. package/dist/client/assets/{node.browser-PMfGv8gB.js → node.browser-DWucOsQl.js} +1 -1
  21. package/dist/client/assets/{openai-eLYIA_xR.js → openai-mbLa3c0B.js} +1 -1
  22. package/dist/client/index.html +2 -2
  23. package/dist/index.d.ts +222 -4
  24. package/dist/index.js +1833 -5
  25. package/dist/index.js.map +1 -1
  26. package/package.json +5 -1
  27. package/dist/client/assets/index-BF4yi1Kg.js +0 -149
  28. package/dist/client/assets/index-BZmH_c-_.css +0 -1
package/README.md CHANGED
@@ -23,6 +23,33 @@ pnpm --filter @m4trix/trace-viewer exec m4trix-trace-viewer --adapter fs --path
23
23
 
24
24
  Then open **http://127.0.0.1:4319** in a browser.
25
25
 
26
+ ## MCP server for coding agents
27
+
28
+ `m4trix-trace-viewer mcp` serves the same trace store as a local [MCP](https://modelcontextprotocol.io)
29
+ server over stdio, so coding agents can inspect, search and compare traces. It accepts the same
30
+ `--adapter` / `--path` flags. Pass an absolute `--path`, because agents may launch it from another directory.
31
+
32
+ ```bash
33
+ claude mcp add m4trix-traces -- npx m4trix-trace-viewer mcp --path "$PWD/tmp/tracing-example"
34
+ ```
35
+
36
+ | Tool | Purpose |
37
+ | --- | --- |
38
+ | `list_traces` | Newest-first traces filtered by status, project, name, metadata, time range, latency |
39
+ | `get_trace` | Run tree outline (LangGraph plumbing hidden by default, errors never hidden) |
40
+ | `find_runs` | Runs by type, name, status, error text, latency, tokens, metadata across traces |
41
+ | `get_run` | One run: ancestry, timing, full error, children, payload previews |
42
+ | `get_payload` | Payload as outline or JSON, narrowed by JSONPath, paged with `offset` |
43
+ | `load_trace_payloads` | Load trace payloads into the in-memory search index |
44
+ | `search_payloads` | Text/regex search; identical values grouped at the run where they first appeared |
45
+ | `analyze_trace` | Root-cause errors, unfinished/orphan runs, critical path, token hotspots, loops, swallowed errors |
46
+ | `get_conversation` | Chat transcript (OpenAI, Anthropic, LangChain shapes) of a run |
47
+ | `compare` | Diff two runs' payloads, or align two traces run by run |
48
+ | `annotate` | Write a trace/run annotation (the tool tells agents to ask the user first) |
49
+
50
+ Trace ids accept `latest` or a unique prefix; run ids accept a unique prefix. Payload strings that
51
+ contain JSON are decoded, so paths and search reach into serialized tool arguments.
52
+
26
53
  ## Trace profiles and the AI payload mapper
27
54
 
28
55
  Profiles control how the run detail panel renders payloads. **Raw** and **LangGraph** are built in;
@@ -61,6 +88,9 @@ const traceViewerApi = createFsTraceViewerApi('./tmp/tracing-example');
61
88
  startTraceViewerServer({ traceViewerApi, port: 4319 });
62
89
  ```
63
90
 
91
+ `createTraceMcpServer({ traceViewerApi })` returns an `McpServer` you can connect to any MCP
92
+ transport; `startTraceMcpStdioServer` does that for stdio.
93
+
64
94
  ## tRPC procedures
65
95
 
66
96
  - `traces.list` — `TraceViewerApi.listTraces`