hj01857655/dsh-plugins--packages-dsh-prompt-vcs ↗★ 0

dsh-prompt-vcs

记录Agent系统提示词的每次修改,支持版本对比与撤销 适合需要对Agent提示词进行版本控制、防止配置丢失的开发者。

包名
dsh-prompt-vcs
兼容性
待验证
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-prompt-vcs

dsh-prompt-vcs

npm version npm downloads CI license node GitHub stars dsh plugin

Every change to your agent's instructions is recorded with a diff, and any change can be undone.

Install

dsh plugin --profile web add dsh-prompt-vcs

Or from source:

dsh plugin --profile web add github:hj01857655/dsh-prompt-vcs

What it does

  • Watch the instruction surface. AGENTS.md, CLAUDE.md, skill files — any file that shapes how the agent behaves.
  • Snapshot on change. Unified diff + attribution (user / plugin / agent) stored in .promptvcs/history.jsonl (append-only).
  • Timeline. promptvcs log shows every change: when, what file, who changed it, how many lines were added or removed.
  • Diff. promptvcs diff shows the unified diff for a specific change — additions, deletions, and context lines.
  • Rollback. promptvcs rollback restores a file to its state before a change. The rollback itself is recorded as a new change, so the timeline stays complete.
  • File stats. Per-file change frequency and size of changes over time.
  • Panel. Timeline with inline diffs, per-file stats, and rollback button.

CLI

dsh-prompt-vcs log               # show change history
dsh-prompt-vcs diff        # show diff for a change
dsh-prompt-vcs rollback    # undo a change

Panel

A Prompt VCS page inside Settings. The host registers GET /api/prompt-vcs.panel and rebuilds the payload from the history log on every request. A headless host simply skips the route.

The panel shows:

  • Change timeline with inline unified diffs
  • Per-file change frequency
  • Attribution per change (user / plugin / agent)
  • Rollback action per change

Layout

PathRole
src/index.tsHost half — apply(ctx), exposes the promptVcs service
src/vcs.tsCore VCS logic — record, timeline, rollback, file stats
src/diff.tsUnified diff algorithm
src/store.tsAppend-only .promptvcs/history.jsonl
src/cli.ts / src/bin.tsCommand-line entry, usable without dsh
src/routes.tsPanel and rollback routes 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