Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trajectory Viewer

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.

Quick start

  1. Serve locally (required for ES modules) or deploy to GitHub Pages:

    python3 -m http.server 8765
    # open http://localhost:8765
  2. Drag and drop a trajectory JSON file, or click Choose JSON file.

  3. 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.mjs

Supported format

APEX 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 start
  • reasoning — model analysis/plan text
  • tool_call — tool input (blue) and output (purple)
  • llm_retry_summary — warning/retry messages
  • other — system/user context

Example files

For larger examples, use files from the APEX dataset:

  • tb2_failing_trajectories/032.json — 54 steps with terminal output
  • gdpval_trajectories/008.json — 100 steps with structured tool calls

GitHub Pages deploy

  1. Push this repo to GitHub.
  2. Go to Settings → Pages.
  3. Set source to main branch, / (root).
  4. Visit https://<username>.github.io/trajectory-viewer/.

Project structure

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

Out of scope (v1)

  • CLI batch renderer
  • Native Studio log export format
  • Server-side upload or authentication
  • Timing/duration columns (not present in APEX JSON)

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages