flow2dream/dsh-msg-rewind 预览 preview

flow2dream/dsh-msg-rewind

这是一个关于dsh的插件。

项目介绍Project Overview

dsh-msg-rewind 是面向 DeepSeek Harness Web 的对话回退插件,通过 /undo 回退整轮对话,或用 /rewind 从历史列表选择回退点,同时在用户消息气泡上提供 ⤺ 悬浮按钮实现可视化回退。它会同时截断模型上下文与聊天记录,并重写持久化的 JSONL 压缩文件,使回退在重启后仍然生效。适用于在长会话中误发指令或想切换思路的场景。需注意系统注入消息不会被识别为用户轮次,因此不能作为回退目标。

dsh-msg-rewind is a DeepSeek Harness Web plugin that rewinds chat sessions through slash commands and a visual control. The /undo command reverts the previous full turn, while /rewind opens a chronological picker of past user messages or accepts a sequence number to jump directly to a target. Hovering any user message bubble surfaces a ⤺ icon that triggers an inline rewind. Both the model context and visible transcript are truncated, and the session's JSONL+zstd artifact is rewritten so the cut persists across restarts. System injections such as runtime-context snapshots are not treated as user turns, so they cannot serve as rewind targets.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile web add @flow2dream/dsh-msg-rewind@0.1.2

flow2dream/dsh-msg-rewind 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-msg-rewind

English | 中文

Conversation rewind commands for DeepSeek Harness web.

  • /undo — roll the chat back one full turn (drop the last real user message and everything after it)
  • /rewind — pick a past user message from a dialog and cut the conversation back to it
  • Visual rewind — hover a user message bubble in the chat and click the ⤺ undo button to rewind to that point

Both the model context and the visible transcript are truncated, and the durable JSONL artifact is rewritten so the cut survives a restart.

Screenshots

rewind

rewind dialog

rewind logo

undo

Real screenshots from dsh web.

Features

Capability Detail
/undo Reverts the previous turn: deletes the last real user message and all events after it
/rewind (bare) Opens a dialog listing every user message (chronological, most recent preselected); pick one to rewind there
/rewind <seq> Directly rewinds to the given message seq
Visual rewind Hover any user bubble → click the undo icon (shown with time + copy) to rewind to that message
Durable Rewrites the session's JSONL+zstd artifact; the cut survives a restart
Clean UI No "command completed" noise cards after a rewind

Requirements

  • DeepSeek Harness web (dsh web)
  • Node ^22.19.0 || >=24.0.0

Install

Via npm (recommended)

dsh plugin --profile web add @flow2dream/dsh-msg-rewind@0.1.2

Then restart the web profile:

dsh web

Via GitHub

dsh plugin --profile web add dsh-msg-rewind@github:flow2dream/dsh-msg-rewind

Then restart the web profile:

dsh web

Manual

Add the dependency and bundle to your web profile:

// ~/.dsh/profiles/web/package.json
{
  "dependencies": {
    "@flow2dream/dsh-msg-rewind": "0.1.2"
  },
  "dsh": {
    "profile": {
      "bundles": ["@flow2dream/dsh-msg-rewind"]
    }
  }
}

Then install and restart the web profile:

cd ~/.dsh/profiles/web
pnpm install
dsh web

Usage

In any conversation:

  • Type /undo — the chat rolls back one turn.
  • Type /rewind — a dialog opens with every user message; the most recent one is preselected. Arrow keys navigate, Enter rewinds.
  • Hover a user message bubble — a small undo icon appears next to the copy button; click it to rewind to that message.

The rewind target is the real user message (system injections such as runtime-context and skill-catalog snapshots are never treated as user turns).

How it works

  • Host (lib/index.js) registers the /undo and /rewind commands. A rewind drains the persistence coordinator, splices the live session log, resets every derived cache, rewrites the JSONL artifact, resets the agent's request-header anchor, and broadcasts session/rewind.
  • Browser (lib/client.js) listens for session/rewind, resyncs the target session's window from the host, and injects the hover undo button into user bubbles.
  • The session/rewind event is allowlisted in dsh-api-remotes's forwarded events.

Development

# from your web profile
npm install /path/to/dsh-msg-rewind

Source lives in lib/:

  • lib/index.js — host half (commands + truncation)
  • lib/client.js — browser half (resync + visual rewind)

License

MIT

上一个 Prev dsh-origin-plugin 下一个 Next dsh-catgirl-plugin