hj01857655/dsh-plugins--packages-dsh-step-trace ↗★ 0

dsh-step-trace

Record every step the agent took, and walk through it forwards and backwards to find where it went wrong. 适合需要调试Agent行为、分析AI思考和工具调用链路的开发者。

パッケージ
dsh-step-trace
互換性
未検証
Cordis ピア範囲
~4.0.4
バージョン
0.6.1
ライセンス
MIT
最終更新
2026/10/16

同名パッケージの別リポジトリ

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:hj01857655/dsh-plugins#5a7f8533f4dcd4f85ec3ebd7e9fa0a071445bf65&path:packages/dsh-step-trace

ドキュメント

README 全文を読む ↗

dsh-step-trace

npm version npm downloads CI license node GitHub stars dsh plugin

Record every step the agent took, and walk through it forwards and backwards to find where it went wrong.

Install

dsh plugin --profile web add dsh-step-trace

Or from source:

dsh plugin --profile web add github:hj01857655/dsh-step-trace

What it does

  • Record. Every model response and tool call is stored as a trace step in .replay/.jsonl (append-only, one file per session).
  • Step through. Inspect the full input and output at each step, forward and backward. Each step carries a timestamp and duration, so you can see where time was spent.
  • Branch. Fork a new session from any step — "what if the agent had done X instead?"
  • Divergence detection. Given two sessions for the same task, find the first step where they diverge — useful for understanding why a retry gave a different result.
  • Session stats. Total steps, total duration, average step latency, and the slowest step per session.
  • Panel. Session list with step-through viewer, timeline visualization, and divergence comparator.

CLI

dsh-step-trace list              # list recorded sessions
dsh-step-trace trace         # show all steps in a session
dsh-step-trace step       # inspect step N
dsh-step-trace diverge     # find where two sessions diverge

Panel

A Step trace page inside Settings. The host registers GET /api/step-trace.panel and rebuilds the payload from the replay files on every request. A headless host simply skips the route.

The panel shows:

  • Session list sorted by recency, with step count and total duration
  • Step-through viewer with full input/output per step
  • Timeline visualization showing step durations
  • Divergence view comparing two sessions side by side

Layout

PathRole
src/index.tsHost half — apply(ctx), exposes the stepTrace service
src/replay.tsCore replay logic — record, list, step-through, diverge
src/store.tsAppend-only .replay/.jsonl files
src/cli.ts / src/bin.tsCommand-line entry, usable without dsh
src/routes.tsPanel route on the host's web connection
src/client/view.tsxBrowser half — pure rendering
src/client/index.tsxBrowser half — fetch and settings registration
src/client/locales.tszh / en dictionaries

Develop

npm ci
npm run typecheck
npm run build
npm test

License

MIT