설치
npx -y @deepseek-ai/dsh plugin --profile web add github:wang-xudong/dsh-plugin-undo이 설치 명령은 GitHub 저장소 주소에서 생성된 확인되지 않은 시작점입니다.
README
유지 관리자가 작성한 문서 스냅샷입니다.
dsh-plugin-undo
Conversation undo for DeepSeek Harness: undo the last n turns within the current session — no new session, no project file changes.
Why this plugin
Most conversation-rewind plugins use sessions.fork to copy a history prefix into a new session (the original session is kept or archived). This plugin undoes in place on the current session's surface, so:
- No fork, no new session — the session id stays the same
- No duplicate “original + new” sessions in the sidebar
- You keep chatting in the same session, and the model context is exactly the retained history
Features
/undoor/undo 1— undo the last completed turn/undo 3— undo the last 3 completed turns/undo all— undo every turn currently visible to the model
After undo:
- The model-visible history is replaced by the retained turns; undone turns leave the model context
- The raw session log stays append-only and is never rewritten
- The Web UI collapses the undone turns into a compact header
- The current session continues; no fork, no new session
Effect
Undone turns collapse in the chat view as:
↩ 第 N 轮已撤销 · 点击展开
Click the header to expand or collapse that turn in place. The /undo command card itself is hidden; the folded headers are the only visible undo feedback.
How it works
- The host derives the currently model-visible turns from
turn/start/turn/end - It takes the last n turns and appends
surfaceOp: { op: 'replace', start, end }over their surface range - The checkpoint is an empty assistant message outside any turn boundary; message derivation skips empty assistant content, so the model sees only the retained history — no undo marker, no turn numbers
- The client half reads the successful
/undocommand nodes and folds the undone turns with DOM/CSS
Install
dsh plugin --profile <profile> add file:/path/to/dsh-plugin-undo
Restart the profile:
dsh --profile <profile>
No additional configuration is required.
Usage
Type in the session input:
/undo
/undo 1
/undo 3
/undo all
The command requires the session to be idle. Stop the running turn first if the UI reports it is busy.
Build & pack
Published entry points live in lib/; source lives in src/. Build and create the distributable tarball:
npm run build
npm pack
This produces dsh-plugin-undo-<version>.tgz, which can also be installed directly:
dsh plugin --profile <profile> add file:/path/to/dsh-plugin-undo-<version>.tgz
Project layout
dsh-plugin-undo/
├── README.md
├── README_zh.md
├── cordis.patch.yml
├── package.json
├── scripts/
│ └── build.mjs
├── src/ # source
│ ├── index.js # host: /undo command and surface replacement
│ └── client.js # web: folds undone turns, hides the command card
└── lib/ # build output (generated by npm run build)
License
Limitations
- Only consecutive trailing turns can be undone; picking an arbitrary message in the middle is not supported
- Only the model-visible conversation history is rewound; project files are never touched
- The session must be idle when
/undoruns
저장소 정보
- 언어
- JavaScript
- 라이선스
- MIT
- 마지막 업데이트
- 2026. 8. 16. 오후 8:24
신중하게 설치하기
소스 코드, 권한, 수명 주기 스크립트, 의존성 및 네트워크 접근을 검토하고 신뢰하지 않는 플러그인은 격리 환경에서 테스트하세요.