Drop a trajectory JSON file and get a readable, collapsible, color-coded HTML trace.
No install, no build step — pure HTML/CSS/JS. Works on GitHub Pages.
-
Serve locally (required for ES modules) or deploy to GitHub Pages:
python3 -m http.server 8765 # open http://localhost:8765 -
Drag and drop a trajectory JSON file, or click Choose JSON file.
-
Expand/collapse steps and sub-events, search logs, and copy input/output blocks.
Try the bundled example: http://localhost:8765/?example=1
Run parser smoke tests:
node test/smoke.mjsAPEX trajectory_messages JSON with top-level fields:
{
"task_id": "...",
"trajectory_id": "...",
"reached_finish": false,
"final_reasoning": "...",
"trajectory_messages": [ ... ],
"trajectory_output": { "usage_metrics": { "call_log": [...] } }
}Two variants are auto-detected:
| Variant | How it appears |
|---|---|
| tb2 (terminal harness) | Analysis / Plan reasoning + terminal output per step |
| gdpval (Stirrup harness) | Structured tool_calls with JSON input and shell output |
The viewer normalizes both into a Studio-style UI with color-coded event types:
step— step startreasoning— model analysis/plan texttool_call— tool input (blue) and output (purple)llm_retry_summary— warning/retry messagesother— system/user context
examples/008.json— single-step tb2 trajectory (reasoning only)
For larger examples, use files from the APEX dataset:
tb2_failing_trajectories/032.json— 54 steps with terminal outputgdpval_trajectories/008.json— 100 steps with structured tool calls
- Push this repo to GitHub.
- Go to Settings → Pages.
- Set source to
mainbranch,/ (root). - Visit
https://<username>.github.io/trajectory-viewer/.
trajectory-viewer/
├── index.html # Entry point + drag-and-drop UI
├── lib/
│ ├── parser.js # JSON → normalized event tree
│ ├── render.js # Event tree → DOM
│ └── styles.css # Layout and color-coded pills
└── examples/
└── 008.json # Sample trajectory
- CLI batch renderer
- Native Studio log export format
- Server-side upload or authentication
- Timing/duration columns (not present in APEX JSON)
MIT