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 peer 범위
~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

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