| name | view-trajectory |
| description | Open a Harbor ATIF agent trajectory (.json) in the harbor-trajectory-viewer web UI to inspect the step timeline, clustered tool calls, metrics, subagents, and code diffs. Can also generate an annotations sidecar that adds one-line summaries for each tool-call cluster and translations of every message into a target language. Use when the user asks to visualize, view, open, summarize, or translate a Harbor trajectory / rollout. |
View a Harbor ATIF trajectory
@tengxiaohtx/harbor-trajectory-viewer renders a Harbor ATIF trajectory
(*.trajectory.json) as a web UI: a step Timeline (user / agent messages,
reasoning, tool calls grouped into collapsible clusters, and system /
context-management steps), and a separate Diffs tab showing every file
change as a unified or split code diff. The sidebar surfaces session metadata,
token/cost metrics, and any embedded subagent trajectories you can drill into.
The hbtv command is provided by the package. Prefer npx -y @tengxiaohtx/harbor-trajectory-viewer ….
1. Just view a trajectory
npx -y @tengxiaohtx/harbor-trajectory-viewer "<path-to>.trajectory.json"
Add --no-open for headless, -p <port> to choose a port. Run with no path to
open drag-and-drop upload mode.
Locating the file
Harbor writes ATIF trajectories (named trajectory.json or
*.trajectory.json) into a job's logs directory. To open the newest one under
the current directory:
FILE=$(ls -t **/*trajectory*.json 2>/dev/null | head -1)
npx -y @tengxiaohtx/harbor-trajectory-viewer "$FILE"
If the user names a specific file, use that directly.
2. Add summaries and/or translations (annotations)
The viewer can overlay a sidecar annotations file (<file>.hbtv.json) that
adds, per stable id:
- a one-line summary for each cluster of consecutive tool calls (shown in the
cluster header), and
- a translation of each user/agent message into a target language (shown
beneath the original text).
Workflow — you (the agent) fill in the annotations:
-
Generate the scaffold. This writes a .hbtv.json next to the trajectory
with every text unit (with its original text) and every tool-call cluster
(with the tool names) already enumerated and correctly keyed:
npx -y @tengxiaohtx/harbor-trajectory-viewer extract "<file>.json" --lang "<target language>"
Use the language the user asked for (e.g. 简体中文, English, 日本語); omit
--lang if they only want summaries.
-
Read the scaffold (<file>.json.hbtv.json). It looks like:
{
"version": 1,
"targetLang": "简体中文",
"units": [
{ "type": "text", "id": "step-1", "role": "user", "original": "…", "translation": "" },
{ "type": "cluster", "id":
Notes