dsh-rewind-plugin 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -11,12 +11,12 @@ Conversation rewind for DeepSeek Harness: **rewind the conversation to any earli
11
11
  A deliberately focused plugin with one job: **rewind to any user message, no matter how far back, in place** — and conveniently **restore the files it changed** along the way.
12
12
 
13
13
  - **In-place rewind, no new session** — the target message and everything after it (replies, tool calls) are withdrawn from the model context *and* the rendered transcript, and the target's text is filled back into the composer for editing and re-sending. It all happens inside the original session: no new branch, no leftover copy.
14
- - **Conversation and code rewind together** — Claude Code-aligned behavior: files edited by the write tools are tracked and restored by the same rewind, and external changes to already-tracked files are restorable too. **Partial tracking, before-write backup, store only on change**, with no git dependency.
14
+ - **Conversation and files rewind together** — Claude Code-aligned behavior: files edited by the write tools are tracked and restored by the same rewind, and external changes to already-tracked files are restorable too. **Partial tracking, before-write backup, store only on change**, with no git dependency.
15
15
  - **Safety guarantees** — the session log only ever appends rewind markers and is never deleted or rewritten; file backup and restore are hardened; tests are comprehensive, and maintenance continues across DSH upgrades. Security model: [SECURITY.md](SECURITY.md).
16
16
 
17
17
  ## Preview
18
18
 
19
- Every user message carries a **↶ rewind** button in its action row. Clicking it opens a mode-selection popover — "**rewind conversation only**" or "**rewind conversation and code**", the latter showing the file-change list for confirmation first. You can also pick and rewind conveniently via the **`/rewind` and `/undo` commands**.
19
+ Every user message carries a **↶ rewind** button in its action row. Clicking it opens a mode-selection popover — "**rewind conversation only**" or "**rewind conversation and files**", the latter showing the file-change list for confirmation first. You can also pick and rewind conveniently via the **`/rewind` and `/undo` commands**.
20
20
 
21
21
  <table>
22
22
  <tr>
@@ -24,7 +24,7 @@ Every user message carries a **↶ rewind** button in its action row. Clicking i
24
24
  <td align="center"><img src="assets/screenshots/mode-popover.png" width="440" alt="Mode-selection popover"><br><sub>Mode-selection popover</sub></td>
25
25
  </tr>
26
26
  <tr>
27
- <td align="center"><img src="assets/screenshots/impact-list.png" width="440" alt="Impact list"><br><sub>"Conversation and code" impact list</sub></td>
27
+ <td align="center"><img src="assets/screenshots/impact-list.png" width="440" alt="Impact list"><br><sub>"Conversation and files" impact list</sub></td>
28
28
  <td align="center"><img src="assets/screenshots/rewind-candidates.png" width="440" alt="/rewind candidate picker"><br><sub>/rewind candidate picker</sub></td>
29
29
  </tr>
30
30
  </table>
@@ -55,7 +55,7 @@ then install the new one.
55
55
  ## Usage
56
56
 
57
57
  1. Find the user message you want to rewind to in the conversation, or type `/rewind` (or its alias `/undo`) to open the candidate picker.
58
- 2. **Select it.** A small popover offers the two modes — "conversation only" or "conversation and code".
58
+ 2. **Select it.** A small popover offers the two modes — "conversation only" or "conversation and files".
59
59
  3. The rewind takes effect immediately: the conversation returns to how it looked at the target message, and the target message's text is filled back into the composer — edit and re-send.
60
60
 
61
61
  **Keyboard**: both the candidate picker and the mode popover support ↑↓ to move, Enter to confirm, Esc to cancel/back.
@@ -121,7 +121,7 @@ The whole design rests on two principles, simple but deliberate: **the conversat
121
121
 
122
122
  ### 1. Conversation rewind: a single "mask", not a delete
123
123
 
124
- `append-only` is a hard rule: the session log only grows and is never rewritten — the foundation of auditability and privacy. A rewind never touches history; it makes a single move: append **one "empty message" marker** to the end of the log and use it to "mask + replace" everything after the target message, so the model and the UI see only the part before it.
124
+ `append-only` is a hard rule: the session log only grows and is never rewritten — the foundation of auditability and privacy. A rewind never touches history; it makes a single move: append **one "empty message" marker** to the end of the log and use it to "mask + replace" the target message and everything after it, so the model and the UI see only what came before it.
125
125
 
126
126
  - **One and the same log** — the append happens only in the current session's log: no new session, no new branch, so no residue or copy is left behind;
127
127
  - **The marker is canonical** — the same "hide + replace" as the official `/compact`: `/compact` compresses a span of history into a summary, while `/rewind` swaps in an "empty message" marker. Because it is canonical, DSH's log replay, compaction, and resume preflight all recognize it and never mistake it for a real message;
@@ -159,14 +159,6 @@ This plugin deliberately stays lightweight and focused on one thing — "convers
159
159
  > This project and DeepSeek Harness are both in developer preview. Pin exact
160
160
  > versions in reproducible environments and review the behavior notes above.
161
161
 
162
- ## Client contract
163
-
164
- Third-party DOM plugins that need to know which transcript rows a rewind
165
- withdrew should consume the stable, locale-independent helpers exported from
166
- `dsh-rewind-plugin/client` — never parse
167
- `outcome.text`. The `data-dsh-rewind-hidden` attribute marks withdrawn rows
168
- (observational only). Details: [docs/contract/client-contract.md](docs/contract/client-contract.md).
169
-
170
162
  ## Known issues
171
163
 
172
164
  1. **Exported logs are complete** — a rewind only removes messages from the model context and the view; the exported session log (`/export`) still contains **withdrawn messages**. This plugin cannot alter exports.
@@ -178,7 +170,7 @@ withdrew should consume the stable, locale-independent helpers exported from
178
170
 
179
171
  ## Security
180
172
 
181
- This plugin only appends rewind-marker events to the session log; it never deletes or rewrites logged history. Workspace files are written only when you choose "conversation and code"; backups are stored under `<dsh home>/rewind-snapshots/`; restores draw only from those backups. It never touches your git repository, makes no network requests, and accesses no credentials. For sessions you've left inactive for a long time, a global auto-cleanup (off by default) can remove their snapshot directory in whole, leaving the active session and the chat log untouched. Full security model: [SECURITY.md](SECURITY.md).
173
+ This plugin only appends rewind-marker events to the session log; it never deletes or rewrites logged history. Workspace files are written only when you choose "conversation and files"; backups are stored under `<dsh home>/rewind-snapshots/`; restores draw only from those backups. It never touches your git repository, makes no network requests, and accesses no credentials. For sessions you've left inactive for a long time, a global auto-cleanup (off by default) can remove their snapshot directory in whole, leaving the active session and the chat log untouched. Full security model: [SECURITY.md](SECURITY.md).
182
174
 
183
175
  ## Development
184
176
 
package/README.md CHANGED
@@ -16,7 +16,7 @@ DeepSeek Harness 插件:**一键就地回退对话到任意更早的用户消
16
16
 
17
17
  ## 效果预览
18
18
 
19
- 每条用户消息的操作行都有一个 **↶ 回退** 按钮。点击后弹出模式选择浮层——「**仅回退对话**」或「**回退对话和代码**」,后者会先展示文件变更清单再确认。还可以通过 **`/rewind` 和 `/undo` 命令**便捷地选择和回退。
19
+ 每条用户消息的操作行都有一个 **↶ 回退** 按钮。点击后弹出模式选择浮层——「**仅回退对话**」或「**回退对话和文件**」,后者会先展示文件变更清单再确认。还可以通过 **`/rewind` 和 `/undo` 命令**便捷地选择和回退。
20
20
 
21
21
  <table>
22
22
  <tr>
@@ -24,7 +24,7 @@ DeepSeek Harness 插件:**一键就地回退对话到任意更早的用户消
24
24
  <td align="center"><img src="assets/screenshots/mode-popover.png" width="440" alt="模式选择浮层"><br><sub>模式选择浮层</sub></td>
25
25
  </tr>
26
26
  <tr>
27
- <td align="center"><img src="assets/screenshots/impact-list.png" width="440" alt="影响清单"><br><sub>「回退对话和代码」影响清单</sub></td>
27
+ <td align="center"><img src="assets/screenshots/impact-list.png" width="440" alt="影响清单"><br><sub>「回退对话和文件」影响清单</sub></td>
28
28
  <td align="center"><img src="assets/screenshots/rewind-candidates.png" width="440" alt="/rewind 候选面板"><br><sub>/rewind 候选面板</sub></td>
29
29
  </tr>
30
30
  </table>
@@ -52,7 +52,7 @@ dsh plugin --profile <name> add dsh-rewind-plugin@<版本>
52
52
  ## 使用
53
53
 
54
54
  1. 在对话中找到要回退的那条用户消息,或输入 `/rewind`(或其别名 `/undo`)打开候选列表选择。
55
- 2. **选中它。** 小浮层提供两种模式——「仅回退对话」或「回退对话和代码」。
55
+ 2. **选中它。** 小浮层提供两种模式——「仅回退对话」或「回退对话和文件」。
56
56
  3. 回退立即生效:对话回到目标消息当时的样子,目标消息的文本自动回填输入框——改完直接重发。
57
57
 
58
58
  **键盘操作**:候选列表与模式浮层均支持 ↑↓ 移动、Enter 确认、Esc 取消/返回。
@@ -105,7 +105,7 @@ rm <dsh home>/snapshot-cleanup-last-sweep.json
105
105
 
106
106
  ### 1. 对话回退:一次「遮蔽」,而不是「删除」
107
107
 
108
- `append-only` 是铁律:会话日志只追加、从不改写——这是可审计与信息安全的地基。回退从不动历史,它只做一步:往日志末尾追加一条 **“空消息”标记**,把目标消息之后的全部内容「遮蔽 + 替换」掉,让模型和界面都只看得到目标之前的部分。
108
+ `append-only` 是铁律:会话日志只追加、从不改写——这是可审计与信息安全的地基。回退从不动历史,它只做一步:往日志末尾追加一条 **“空消息”标记**,把目标消息及其之后的全部内容「遮蔽 + 替换」掉,让模型和界面都只看得到目标之前的部分。
109
109
 
110
110
  - **同一份日志**——只在当前会话的日志做简单追加,不新建会话、不新建分支,因此不会留下残留和副本;
111
111
  - **标记是规范的**——采用与官方 `/compact` 相同的「隐藏 + 替换」:`/compact` 把一段历史压缩成摘要,`/rewind` 则换成一条“空消息”标记。由于其规范性,DSH 的日志重放、压缩、续接检查都能正确识别它,绝不会把它误认为真实对话;
@@ -143,11 +143,6 @@ rm <dsh home>/snapshot-cleanup-last-sweep.json
143
143
  > 本项目与 DeepSeek Harness 均处于开发者预览阶段。可复现环境请 pin 精确版本,
144
144
  > 并阅读上述行为说明。
145
145
 
146
- ## 客户端契约
147
-
148
- 需要获知哪些转录行被回退撤回的第三方 DOM 插件,应使用 `dsh-rewind-plugin/client` 导出的稳定、与本地化无关的纯函数,切勿解析 `outcome.text`。`data-dsh-rewind-hidden` 属性标记被撤回的行(仅观测性)。
149
- 详见:[docs/contract/client-contract.zh.md](docs/contract/client-contract.zh.md)。
150
-
151
146
  ## 已知问题
152
147
 
153
148
  1. **导出的日志是完整内容**——回退只是把消息从模型上下文和视图中移除,`/export` 导出的会话日志包含**已撤回的消息**。本插件无法改动导出。
@@ -159,7 +154,7 @@ rm <dsh home>/snapshot-cleanup-last-sweep.json
159
154
 
160
155
  ## 安全
161
156
 
162
- 本插件只向会话日志追加回退标记事件,从不删除或改写已记录的历史。工作区文件仅在「回退对话和代码」时被改写,备份存储于 `<dsh home>/rewind-snapshots/`;还原以备份为唯一来源。不触碰你的 git 仓库,无网络请求,不访问任何凭据。对**长期不活跃**的会话,另有默认关闭的全局自动清理可整目录移除其快照,不影响活动会话与对话日志。完整安全模型:[SECURITY.md](SECURITY.md)。
157
+ 本插件只向会话日志追加回退标记事件,从不删除或改写已记录的历史。工作区文件仅在「回退对话和文件」时被改写,备份存储于 `<dsh home>/rewind-snapshots/`;还原以备份为唯一来源。不触碰你的 git 仓库,无网络请求,不访问任何凭据。对**长期不活跃**的会话,另有默认关闭的全局自动清理可整目录移除其快照,不影响活动会话与对话日志。完整安全模型:[SECURITY.md](SECURITY.md)。
163
158
 
164
159
  ## 开发
165
160