dsh-rewind-plugin 0.13.0-alpha.2 → 0.14.0-beta.1
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 +18 -12
- package/README.md +15 -11
- package/SECURITY.md +3 -3
- package/assets/icon.svg +27 -0
- package/assets/screenshots/cleanup-setting.png +0 -0
- package/docs/architecture.md +5 -5
- package/docs/compat/audit.md +68 -37
- package/docs/contract/client-contract.md +3 -1
- package/docs/format.md +8 -7
- package/docs/harness-reference.md +1 -1
- package/docs/release/release.md +5 -0
- package/docs/release/release.zh.md +4 -0
- package/docs/snapshot-auto-cleanup.md +3 -1
- package/docs/snapshot-auto-cleanup.zh.md +4 -2
- package/lib/client.js +177 -384
- package/lib/index.js +70 -35
- package/lib/types/client/hidden.d.ts +5 -0
- package/lib/types/client/index.d.ts +6 -1
- package/lib/types/client/portals.d.ts +56 -2
- package/lib/types/client/settings-card.d.ts +89 -177
- package/lib/types/client/styles.d.ts +1 -1
- package/lib/types/index.d.ts +42 -3
- package/lib/types/locales.d.ts +25 -8
- package/lib/types/marker.d.ts +39 -0
- package/lib/types/rewind.d.ts +4 -22
- package/lib/types/snapshot-cleanup.d.ts +39 -38
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +65 -57
package/README.en.md
CHANGED
|
@@ -10,10 +10,9 @@ Conversation rewind for DeepSeek Harness: **rewind the conversation to any earli
|
|
|
10
10
|
|
|
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
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **A complete test system** — unit, probe, and end-to-end host verification, covering compatibility probing, log replay, resume, cross-restart and other scenarios; maintained continuously as the harness evolves to ensure feature stability.
|
|
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.
|
|
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).
|
|
17
16
|
|
|
18
17
|
## Preview
|
|
19
18
|
|
|
@@ -30,17 +29,25 @@ Every user message carries a **↶ rewind** button in its action row. Clicking i
|
|
|
30
29
|
</tr>
|
|
31
30
|
</table>
|
|
32
31
|
|
|
33
|
-
## Install
|
|
32
|
+
## Install and update
|
|
34
33
|
|
|
35
34
|
Check your local DSH version, then find the matching plugin version in
|
|
36
35
|
[Releases](https://github.com/SiriLee/dsh-rewind/releases).
|
|
37
36
|
|
|
37
|
+
**Command line**:
|
|
38
|
+
|
|
38
39
|
```sh
|
|
39
40
|
dsh plugin --profile web add dsh-rewind-plugin@<version>
|
|
40
41
|
```
|
|
41
42
|
|
|
43
|
+
**Graphical interface**: the **Plugins** page in the sidebar → **Add plugin** → enter `dsh-rewind-plugin@<version>` → install → restart DSH and refresh the browser.
|
|
44
|
+
|
|
42
45
|
> ⚠️ The npm name `dsh-rewind` belongs to another author's package — install with `dsh-rewind-plugin`.
|
|
43
46
|
|
|
47
|
+
**Updating**: the command line overwrites the installed version directly; the
|
|
48
|
+
graphical interface rejects a re-install, so uninstall the old version first,
|
|
49
|
+
then install the new one.
|
|
50
|
+
|
|
44
51
|
## Usage
|
|
45
52
|
|
|
46
53
|
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.
|
|
@@ -69,12 +76,12 @@ unaffected) and the plugin rebuilds them automatically.
|
|
|
69
76
|
|
|
70
77
|
A **global auto-cleanup** (off by default) removes the snapshot directories of
|
|
71
78
|
long-inactive sessions, leaving the active session and chat log untouched. Configure
|
|
72
|
-
and review it
|
|
73
|
-
|
|
79
|
+
and review it on the **Plugins** page, in this plugin's configuration card (the
|
|
80
|
+
auto-cleanup switch and the idle-day cutoff), or use the
|
|
74
81
|
`/snapshot-auto-cleanup` command to **view, configure, and run** it. See:
|
|
75
82
|
[Snapshot cleanup](docs/snapshot-auto-cleanup.md).
|
|
76
83
|
|
|
77
|
-
<img src="assets/screenshots/cleanup-setting.png" alt="
|
|
84
|
+
<img src="assets/screenshots/cleanup-setting.png" alt="Plugin configuration card: auto cleanup and idle time (days)" width="600">
|
|
78
85
|
|
|
79
86
|
## Uninstall
|
|
80
87
|
|
|
@@ -87,8 +94,8 @@ rm -rf <dsh home>/rewind-snapshots
|
|
|
87
94
|
rm <dsh home>/snapshot-cleanup-last-sweep.json
|
|
88
95
|
```
|
|
89
96
|
|
|
90
|
-
The plugin's auto-cleanup settings live in the
|
|
91
|
-
|
|
97
|
+
The plugin's auto-cleanup settings live in the current Profile's plugin
|
|
98
|
+
configuration. To remove them completely, delete this plugin entry's configuration.
|
|
92
99
|
|
|
93
100
|
## Why it stands out
|
|
94
101
|
|
|
@@ -158,8 +165,7 @@ withdrew should consume the stable, locale-independent helpers exported from
|
|
|
158
165
|
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.
|
|
159
166
|
2. **Lightweight file rewind has a cost** — in specific cases not all changes can be rewound. Consistent with Claude Code. See: [File-rewind tracking boundary](docs/compat/tracking-boundary.md).
|
|
160
167
|
3. **The turn-rail shows rewound turns** — the right-side rail added in DSH `v0.1.2` keeps ticks for withdrawn messages, and hovering shows the withdrawn text. Only a display difference; no functional impact.
|
|
161
|
-
4. **
|
|
162
|
-
5. **Old rewind markers are no longer compatible** — DSH `v0.1.3` rejects the rewind markers from the old plugin (≤ 0.8.0). The new version resolves this and provides an in-session update. See the [update guide](docs/rewind-fix.md).
|
|
168
|
+
4. **Old rewind markers are no longer compatible** — DSH `v0.1.3` rejects the rewind markers from the old plugin (≤ 0.8.0). Later versions resolve this and provide an in-session update. See the [update guide](docs/rewind-fix.md).
|
|
163
169
|
|
|
164
170
|
> [!NOTE]
|
|
165
171
|
> Browser diagnostics are available; see [Browser diagnostics](docs/compat/diagnostics.md).
|
package/README.md
CHANGED
|
@@ -10,14 +10,13 @@ DeepSeek Harness 插件:**一键就地回退对话到任意更早的用户消
|
|
|
10
10
|
|
|
11
11
|
刻意聚焦、保持极简,只做一件事:**就地回退到任意远的用户消息**,还能**顺手还原改过的文件**。
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
- **完备测试系统**——单元、探针、端到端主机验证,覆盖兼容性探测、日志重放、续接、跨重启等场景;随 harness 升级持续维护,确保功能稳定。
|
|
13
|
+
- **就地消息回退**——目标消息及其之后的内容同时从**模型上下文**和**渲染对话**中撤回,目标消息文本自动回填输入框。始终在原会话内完成,不新建分支、不残留副本。
|
|
14
|
+
- **轻量备份还原**——对齐 Claude Code:追踪写类工具编辑过的文件,回退时一并还原,已跟踪文件的外部变更也能还原。**局部追踪、写前备份、不变不存**,不依赖 git。
|
|
15
|
+
- **安全保障**——会话日志仅追加回退标记,从不删改;文件备份与还原经安全加固;**完备测试**,随 DSH 升级长期维护。安全模型:[SECURITY.md](SECURITY.md)。
|
|
17
16
|
|
|
18
17
|
## 效果预览
|
|
19
18
|
|
|
20
|
-
每条用户消息的操作行都有一个 **↶ 回退** 按钮。点击后弹出模式选择浮层——「**仅回退对话**」或「**回退对话和代码**」,后者会先展示文件变更清单再确认。还可以通过 **`/rewind`
|
|
19
|
+
每条用户消息的操作行都有一个 **↶ 回退** 按钮。点击后弹出模式选择浮层——「**仅回退对话**」或「**回退对话和代码**」,后者会先展示文件变更清单再确认。还可以通过 **`/rewind` 命令**和**键盘操作**便捷地选择和回退。
|
|
21
20
|
|
|
22
21
|
<table>
|
|
23
22
|
<tr>
|
|
@@ -30,16 +29,22 @@ DeepSeek Harness 插件:**一键就地回退对话到任意更早的用户消
|
|
|
30
29
|
</tr>
|
|
31
30
|
</table>
|
|
32
31
|
|
|
33
|
-
##
|
|
32
|
+
## 安装与更新
|
|
34
33
|
|
|
35
34
|
确认本机 DSH 版本后,在 [Release](https://github.com/SiriLee/dsh-rewind/releases) 找到适配的插件版本。
|
|
36
35
|
|
|
36
|
+
**命令行**:
|
|
37
|
+
|
|
37
38
|
```sh
|
|
38
39
|
dsh plugin --profile web add dsh-rewind-plugin@<版本>
|
|
39
40
|
```
|
|
40
41
|
|
|
42
|
+
**图形界面**:侧栏「插件」页 →「添加插件」→ 填 `dsh-rewind-plugin@<版本>` → 安装 → 重启 DSH 并刷新浏览器。
|
|
43
|
+
|
|
41
44
|
> ⚠️ npm 上的 `dsh-rewind` 属于其他作者,请用 `dsh-rewind-plugin` 安装。
|
|
42
45
|
|
|
46
|
+
**更新**:命令行可直接覆盖安装;图形界面会拒绝重复安装,需先卸载旧版本,再装新版本。
|
|
47
|
+
|
|
43
48
|
## 使用
|
|
44
49
|
|
|
45
50
|
1. 在对话中找到要回退的那条用户消息,或输入 `/rewind`(或其别名 `/undo`)打开候选列表选择。
|
|
@@ -62,9 +67,9 @@ dsh plugin --profile web add dsh-rewind-plugin@<版本>
|
|
|
62
67
|
|
|
63
68
|
快照(写前备份)存储于 `<dsh home>/rewind-snapshots/`(默认 `~/.dsh/rewind-snapshots/`)。插件对**同一会话**的快照做内容去重并保留最近 100 组锚点;**手动删除该目录**仅清除文件备份(对话回退不受影响),插件会自动重建。
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
另提供**全局自动清理**(默认关闭):把长期不活跃的会话快照整目录移除,不影响活动会话与对话日志。可在**插件**页本插件的配置卡片查看与配置(自动清理开关、失活天数),也可用 `/snapshot-auto-cleanup` 命令查看、设置和运行。详见:[快照自动清理](docs/snapshot-auto-cleanup.zh.md)。
|
|
66
71
|
|
|
67
|
-
<img src="assets/screenshots/cleanup-setting.png" alt="
|
|
72
|
+
<img src="assets/screenshots/cleanup-setting.png" alt="插件配置卡片:自动清理与不活跃时间(天)" width="600">
|
|
68
73
|
|
|
69
74
|
## 卸载
|
|
70
75
|
|
|
@@ -77,7 +82,7 @@ rm -rf <dsh home>/rewind-snapshots
|
|
|
77
82
|
rm <dsh home>/snapshot-cleanup-last-sweep.json
|
|
78
83
|
```
|
|
79
84
|
|
|
80
|
-
|
|
85
|
+
插件的自动清理设置保存在当前 Profile 的插件配置中。如需彻底清理,可手动删除对应条目。
|
|
81
86
|
|
|
82
87
|
## 本插件的优势
|
|
83
88
|
|
|
@@ -144,8 +149,7 @@ rm <dsh home>/snapshot-cleanup-last-sweep.json
|
|
|
144
149
|
1. **导出的日志是完整内容**——回退只是把消息从模型上下文和视图中移除,`/export` 导出的会话日志包含**已撤回的消息**。本插件无法改动导出。
|
|
145
150
|
2. **轻量文件回退存在代价**——特定情况可能无法回退所有修改。行为与 Claude Code 一致。详见:[文件回退的追踪边界](docs/compat/tracking-boundary.zh.md)。
|
|
146
151
|
3. **导轨显示已回退轮次**——DSH `v0.1.2` 新增右侧导轨,为已撤回消息保留刻度,悬浮显示已撤回正文。仅显示差异,无功能影响。
|
|
147
|
-
4.
|
|
148
|
-
5. **旧回退标记不再兼容**——DSH `v0.1.3` 拒绝旧版插件(≤ 0.8.0)的回退标记。新版本已解决,并提供会话更新功能。详见:[更新指南](docs/rewind-fix.zh.md)。
|
|
152
|
+
4. **旧回退标记不再兼容**——DSH `v0.1.3` 拒绝旧版插件(≤ 0.8.0)的回退标记。后续版本已解决,并提供会话更新功能。详见:[更新指南](docs/rewind-fix.zh.md)。
|
|
149
153
|
|
|
150
154
|
> [!NOTE]
|
|
151
155
|
> 本插件提供浏览器端诊断输出;详见 [浏览器诊断](docs/compat/diagnostics.zh.md)。
|
package/SECURITY.md
CHANGED
|
@@ -128,9 +128,9 @@ transcript.
|
|
|
128
128
|
bounded by the cap plus the number of unresolved journals (the exact cap is
|
|
129
129
|
pinned in `docs/format.md`). Across sessions, the opt-in `pruneStale` sweep
|
|
130
130
|
removes whole **long-inactive** session directories (measured by the newest
|
|
131
|
-
member being idle past `
|
|
132
|
-
skips dot-prefixed temp files, and never
|
|
133
|
-
(`keepActiveId`).
|
|
131
|
+
member being idle past the configured `autoCleanupMaxAgeDays`); it uses
|
|
132
|
+
`lstat` (no symlink following), skips dot-prefixed temp files, and never
|
|
133
|
+
targets the active session (`keepActiveId`).
|
|
134
134
|
|
|
135
135
|
## Crash safety
|
|
136
136
|
|
package/assets/icon.svg
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<svg width="32" height="32" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<!-- Layout follows the terminal card glyph (packages/client/ui-sidebar-terminal):
|
|
3
|
+
a rounded tile inset from the canvas (28/36 here, 22/28 there) with a
|
|
4
|
+
white round-capped prompt. The fill follows the Subagent plugin artwork
|
|
5
|
+
(packages/client/ui-primitives/src/plugin-artwork.tsx), whose blue square
|
|
6
|
+
carries the same vertical light-to-dark gradient: #69B9FF at the top,
|
|
7
|
+
#324DE2 at the bottom.
|
|
8
|
+
The rewind mark is the in-app back-arrow (src/client/styles.ts, 16-unit
|
|
9
|
+
grid) scaled 1.4x. Its ink box including the 0.75 stroke reaches
|
|
10
|
+
(1.75,1.75)-(14.25,12.75) on that grid, so the translate lands its centre
|
|
11
|
+
on the tile centre (18,18), and the ink spans 62.5% of the tile width —
|
|
12
|
+
the terminal glyph's own ratio.
|
|
13
|
+
The drawing is 36 viewBox units but renders at 32 px, i.e. a uniform
|
|
14
|
+
shrink inside the card's and row's fixed frames; no inner coordinate
|
|
15
|
+
changes, so the mark cannot shift. -->
|
|
16
|
+
<rect x="4" y="4" width="28" height="28" rx="8" fill="url(#rewind_blue)" />
|
|
17
|
+
<g transform="translate(6.8 7.85) scale(1.4)" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
18
|
+
<path d="M6.5 2.5 2.5 6.5l4 4" />
|
|
19
|
+
<path d="M2.5 6.5h7a4 4 0 0 1 4 4v1.5" />
|
|
20
|
+
</g>
|
|
21
|
+
<defs>
|
|
22
|
+
<linearGradient id="rewind_blue" x1="18" y1="4" x2="18" y2="32" gradientUnits="userSpaceOnUse">
|
|
23
|
+
<stop stop-color="#69B9FF" />
|
|
24
|
+
<stop offset="1" stop-color="#324DE2" />
|
|
25
|
+
</linearGradient>
|
|
26
|
+
</defs>
|
|
27
|
+
</svg>
|
|
Binary file
|
package/docs/architecture.md
CHANGED
|
@@ -134,11 +134,11 @@ pruneStale cross-session auto-cleanup (default off): whole
|
|
|
134
134
|
|
|
135
135
|
## Compatibility strategy
|
|
136
136
|
|
|
137
|
-
- **Peer ranges as one tuple per DSH line
|
|
138
|
-
|
|
139
|
-
tuple
|
|
140
|
-
`scripts/check-dsh-version.mjs`
|
|
141
|
-
`docs/release/release.md`.
|
|
137
|
+
- **Peer ranges as one tuple per DSH line**: npm's prerelease rules require the
|
|
138
|
+
peer range to share the host's `[major, minor, patch]` tuple, so a new DSH
|
|
139
|
+
tuple replaces the peer tuple (the single-line model) and `package.json` is
|
|
140
|
+
the only place the current tuple is written down; `scripts/check-dsh-version.mjs`
|
|
141
|
+
flags when a new tuple arrives. See `docs/release/release.md`.
|
|
142
142
|
- **Test-driven investigation**: `tests/compat-invariants.test.ts` /
|
|
143
143
|
`compat-interop.test.ts` / `compat-gaps.test.ts` probe harness behavior and pin findings in
|
|
144
144
|
`docs/compat/audit.md`; `scripts/verify-host.mjs` runs a real end-to-end
|
package/docs/compat/audit.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
> compatibility invariants. A probe failure is a finding; it enters the
|
|
8
8
|
> fix/pin/record loop.
|
|
9
9
|
>
|
|
10
|
-
> Targeted version: npm `@deepseek-ai/*@0.1.
|
|
10
|
+
> Targeted version: npm `@deepseek-ai/*@0.1.7-rc.1`, declared by the peers as `^0.1.7-rc.1`.
|
|
11
11
|
> Source reference: the upstream [github.com/deepseek-ai/deepseek-harness](https://github.com/deepseek-ai/deepseek-harness).
|
|
12
12
|
>
|
|
13
13
|
> Version alignment: `peerDependencies` use one tuple per DSH line
|
|
@@ -16,8 +16,11 @@
|
|
|
16
16
|
> replaces the peer tuple (single-line model). The range is conservative — it
|
|
17
17
|
> declares only what was verified, so a release already inside it changes
|
|
18
18
|
> nothing — unless it changes interfaces inside the tuple: `0.1.6-alpha.2`
|
|
19
|
-
> removed the client session-ownership and queue-mirror APIs,
|
|
20
|
-
> moved
|
|
19
|
+
> removed the client session-ownership and queue-mirror APIs, and
|
|
20
|
+
> `0.1.7-alpha.1` moved the session writer to format v4 (producer-owned message
|
|
21
|
+
> sources, tool-role results, `developer/message`) and replaced the settings
|
|
22
|
+
> namespace registry with each entry's volatile `Config`, so the peer floor and
|
|
23
|
+
> both plugin seams moved with them. Signal: `npm view @deepseek-ai/dsh dist-tags`;
|
|
21
24
|
> flow: `scripts/check-dsh-version.mjs` (it reads the `latest` dist-tag only; a
|
|
22
25
|
> prerelease published under another tag is a manual pre-release check).
|
|
23
26
|
>
|
|
@@ -35,7 +38,7 @@ legacy branch).
|
|
|
35
38
|
| Host session log | `session.snapshotEvents()` |
|
|
36
39
|
| Client chat snapshot | `uiConversation` `chat` view (`chatSnapshotOf`) |
|
|
37
40
|
| Client composer refill | `conversation.input.setDraft` facade |
|
|
38
|
-
| Client settings card |
|
|
41
|
+
| Client settings card | entry form via `ctx.configForms.get(entryId)` (`plugins.bundle.config`) |
|
|
39
42
|
| Client seat-button DOM | structural locate of the copy-`<button>` container (`actionsContainerOf`) |
|
|
40
43
|
|
|
41
44
|
## Definition of "fully compatible" (invariants)
|
|
@@ -62,28 +65,30 @@ legacy branch).
|
|
|
62
65
|
- **rewind across a compact checkpoint**: `RewindError('not-on-surface')` refuses cleanly, no crash.
|
|
63
66
|
- **plan-mode**: the marker is a turn-less `user/message` (no phantom turn); a rewind never touches the log-only `plan/mode` state (plan mode stays active; the user leaves it with `/plan off`) and the log stays replayable (`compat-invariants` I1/I3 marker + `plan/mode` probe, `verify-host`).
|
|
64
67
|
- **agent-loop cancellation**: `finally` guarantees step/turn closure; the rewind force-stop path leaves no dangling frame.
|
|
65
|
-
- **settings-card registration**: the
|
|
68
|
+
- **settings-card registration (`0.1.7-alpha.1`)**: `settingsScope` is gone with the namespace registry. The card declares `configForms` as a module-level inject (the web profile always composes `ui-settings`), stages through the harness's own `SettingsFormModel` + `SettingsForm`, and registers into `plugins.bundle.config` keyed by the bundle package name; it reads the entry's form snapshot and writes through its revision-fenced `mutate`, and disposes the model's subscription with the fiber.
|
|
66
69
|
- **client session ownership (`0.1.6-alpha.2`)**: `SessionListState.current` / `currentAddress` are gone; main-view ownership is read from the row's `retainedBy.mainView` label — what `ui-workspace` retains the open session with. Pin: `tests/client-refill.test.ts`.
|
|
67
70
|
- **client pending input (`0.1.6-alpha.2`)**: `SessionSnapshot.queue` and the host `queue-mirror` are gone; pending steering rows come from the session's own `inbox` projection, and only USER-sourced `next-step` rows are retractable (the removed mapping was `source.kind === 'user' ? 'steering' : 'context'`). Pins: `tests/pending.test.ts`, `tests/client-retract.test.ts`.
|
|
68
71
|
- **client settings slot (`0.1.6-alpha.2`)**: `settings.plugin.item` is gone; the configuration form registers into `plugins.bundle.config`, keyed by the bundle package name. Pin: `tests/client-contract.test.ts`.
|
|
72
|
+
- **client settings form (`0.1.7-alpha.1`)**: the same release retired the `settingsScope` bind (namespace registry) in favour of the shared per-entry form; the card now reads that form's snapshot and stages edits through `mutate`. Pin: `tests/client-settings-card.test.ts` (staged plan, refusal, and the fiber releasing the model's subscription), `tests/client-lifecycle.test.ts`.
|
|
69
73
|
|
|
70
74
|
- **`agent/created` lifecycle guard**: the session-format reconcile runs on the alpha line's `agent/created` (fire-and-forget); pin: `verify-host` 4e dispatches it.
|
|
71
75
|
- **marker vs `/compact`**: the checkpoint shape is unchanged on this line — a `user/message` replace (`surfaceOp {replace, startSeq, endSeq}` + `sourceEventSeqs`); `assistant/message` still cannot carry `sourceEventSeqs`.
|
|
72
76
|
- **`image/offload` projection**: the alpha line's first `SessionMessageProjection` changes derived content without touching surface node membership; candidate listing and target resolution tolerate it. Pin: `tests/image-offload-projection.test.ts`.
|
|
73
77
|
- **session-cwd**: the fs tools no longer canonicalize a parent-traversing cwd, so `src/session-cwd.ts` returns `header.cwd` verbatim. Pin: `tests/session-cwd.test.ts`.
|
|
78
|
+
- **startup admission (`0.1.7-rc.1`)**: the new gate reads the manifest's own `@deepseek-ai/dsh-*` peers and requires each to satisfy the runtime with `includePrerelease`; it runs for a profile bundle and again for every row its patch inserts, and a denial skips the bundle or disables the row. This plugin's declarations all satisfy `0.1.7-rc.1`, so it is admitted with no exemption — a skipped bundle on a later line is a peer mismatch, not a load failure.
|
|
74
79
|
|
|
75
80
|
## Known behavior boundaries (deterministic differences, non-crash, documented)
|
|
76
81
|
|
|
77
82
|
- **session-stats / session-telemetry fold the full log**: post-rewind stats do **not** rewind — `turns`/`steps`/`llmMs` still include withdrawn content; the `user/message` marker is folded as a present user turn (it adds no step). This is the intended "fold the full log" semantics, pinned by probe.
|
|
78
83
|
- **token-meter usage anchor stays stable** (G3): the `user/message` marker carries no usage, but because it is not an `assistant/message`, the baseline anchor does not drop to a heuristic estimate — it stays `usage` across a rewind. Pinned by `compat-gaps` G3.
|
|
79
|
-
- **marker content is the constant `(empty message)` placeholder**: never empty, because the session log is immutable but the model serving a session may change later — a strict OpenAI-compatible gateway rejects an empty user message (HTTP 400, Issue #21). The marker is a small visible user turn in derived history. Pin: `verify-host` (`marker is a user/message with the dsh-rewind
|
|
80
|
-
- **marker shape (
|
|
84
|
+
- **marker content is the constant `(empty message)` placeholder**: never empty, because the session log is immutable but the model serving a session may change later — a strict OpenAI-compatible gateway rejects an empty user message (HTTP 400, Issue #21). The marker is a small visible user turn in derived history. Pin: `verify-host` (`marker is a user/message with the dsh-rewind producer source and the (empty message) placeholder`).
|
|
85
|
+
- **marker shape (v4)**: the replace `surfaceOp` is `{ op: 'replace', startSeq, endSeq }` (renamed from `start`/`end` in session-format v3); the dsh-rewind source is the single producer-owned kind `{ kind: 'dsh-rewind' }`, declared by merging `MessageSourceMap` (v4 removed the catch-all `plugin` kind and rejects it on write). Two older shapes stay readable, because a stored marker is immutable: the released v3 wrapper `{ kind: 'plugin', plugin: 'dsh-rewind' }`, and the `plugin:dsh-rewind` form the v3→v4 conversion gives a producer its rename table does not know. The `user/message` + `sourceEventSeqs` shape and the `(empty message)` content are unchanged.
|
|
81
86
|
- **Withdrawn content stays searchable/exportable**: session-query full-text and `/export` read the raw log; a rewind cuts only the surface, so withdrawn messages remain (declared in the README).
|
|
82
87
|
- **Session title auto-regeneration**: the title derives from the surface, so an automatically-derived title may change after a rewind.
|
|
83
88
|
- **Files written but uncommitted in a cancelled turn**: a `both` rewind cannot restore them (tool side-effect timing; same as Claude Code).
|
|
84
89
|
- **Attachment files left after a message is shadowed**: attachment storage is not cleaned with the surface (`dsh-attachment-local` not installed, not automatically verified).
|
|
85
90
|
- **Rewind leaves plan mode untouched**: `/plan text` is two independent actions (enter plan mode + steer the message). Rewinding the message undoes only the message — the log-only `plan/mode` state stays active, and the user leaves plan mode with `/plan off`, which still commits after a rewind (the marker creates no open turn). Pin: `verify-host` plan checks (`plan rewind leaves plan mode active`, `/plan off after rewind turns plan mode off`), `tests/hidden.test.ts` `messageTextAt`.
|
|
86
|
-
- **Bundle card metadata is not
|
|
91
|
+
- **Bundle card metadata is declared by the plugin, not by the manager (`0.1.7-alpha.1`)**: the manager still titles a bundle with `shortName(pkg.name)` and its raw `package.json` description when nothing else is declared, but it now reads plugin-owned resources first — `locale/<lang>.json` (`meta.title`/`meta.description`) through the package exports map, and an `icon` file relative to the manifest. This plugin declares both, so its card shows an icon and copy that follows the active language; only the fallback description remains mixed-language. Pin: `tests/package-layout.test.ts` (icon path/media/size and both dictionaries).
|
|
87
92
|
|
|
88
93
|
- **Synchronous Session history reads are deprecated** on this line (`snapshotEvents` / `eventAt` / `ownEvents`): existing calls may remain, new calls are prohibited. The plugin keeps its existing reads (turn anchor + candidate listing); the migration path is a `ctx.sessionProjections` projection unit or the async paged history read this line has not shipped yet — not a plugin-side index. Not migrated in this release.
|
|
89
94
|
|
|
@@ -91,39 +96,36 @@ legacy branch).
|
|
|
91
96
|
|
|
92
97
|
The plugin treats these as harness-side defects it does not compensate for. Each entry records the harness issue, its current status, and the plugin's stance, so a future maintainer does not "fix the wrong direction."
|
|
93
98
|
|
|
94
|
-
### RU-I18N
|
|
99
|
+
### RU-I18N (resolved on the 0.1.7 line): host command copy follows the user's language
|
|
95
100
|
|
|
96
|
-
- **
|
|
97
|
-
`ctx.inject(['settings'])` callback that
|
|
98
|
-
**once, with no retry** (`src/index.ts`)
|
|
99
|
-
|
|
101
|
+
- **History (0.1.2–0.1.6 lines)**: the plugin resolved `activeLocale` in an
|
|
102
|
+
`ctx.inject(['settings'])` callback that read `settings.get('locale').preference`
|
|
103
|
+
**once, with no retry** (`src/index.ts`), while `dsh-client-locale`'s host half registered that
|
|
104
|
+
`locale` settings section through its own `ctx.inject(['settings'])`
|
|
100
105
|
(`packages/client/locale/src/index.ts`). Both callbacks wait only on `settings` and are
|
|
101
|
-
independent of each other, so cordis
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- **
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
third-party description, this plugin's included, passes through verbatim.)
|
|
119
|
-
- **Client-side command-description i18n is first-party-only**: DSH also localizes host command
|
|
106
|
+
independent of each other, so cordis made **no ordering guarantee** between the section
|
|
107
|
+
registration and the plugin's read. The plugin's own command descriptors were registered
|
|
108
|
+
**synchronously** in the same `apply`, i.e. before that microtask ran, so their `description`
|
|
109
|
+
strings were baked in the neutral English default — the defect reported as #28 — while the
|
|
110
|
+
runtime output, evaluated later at command execution from the then-updated `activeLocale`, did
|
|
111
|
+
follow the stored preference. A preference changed *after* the mount reached the output only on
|
|
112
|
+
the next mount, because the read was one-shot.
|
|
113
|
+
- **Resolution (0.1.7)**: the section is gone — the locale host half now only calls
|
|
114
|
+
`settings.configure({ auto: false })`, and the preference lives in the `locale` entry's own
|
|
115
|
+
Config. The plugin reads that same value through the settings service's descriptor read
|
|
116
|
+
(`readHostLocale` in `src/index.ts` calls `settings.describe({ redactSecrets: true })`, the route
|
|
117
|
+
the settings UI and the client's own locale runtime take): at mount, which is what the
|
|
118
|
+
once-registered command descriptions carry, and again before each command renders, so the output
|
|
119
|
+
follows a language switch without a remount (the descriptors keep the mount-time language until
|
|
120
|
+
the plugin remounts). The read is best-effort: a missing method, a missing entry, or a
|
|
121
|
+
throwing read stays on the neutral English default.
|
|
122
|
+
- **Client-side command-description i18n is still first-party-only**: DSH localizes host command
|
|
120
123
|
descriptions through the client `locale` binding (`ui-commands`), but the description keys come
|
|
121
124
|
from a **closed allowlist** (`HOST_FACES`: compact, export, feedback, goal,
|
|
122
125
|
permission, plan). A command outside that set — every third-party plugin — is passed through
|
|
123
126
|
verbatim, never translated (`builtinRowFace` only rewrites a description that equals the
|
|
124
|
-
first-party English copy)
|
|
125
|
-
|
|
126
|
-
runtime copy above.
|
|
127
|
+
first-party English copy), and no host command *output* is localized by the harness for anyone.
|
|
128
|
+
This plugin's host dictionary is what carries both, in the language read above.
|
|
127
129
|
|
|
128
130
|
### R-OPENSTEP (rewind part resolved): an unclosed `step` in the log breaks token-meter replay; the rewind no longer compounds it
|
|
129
131
|
|
|
@@ -161,6 +163,34 @@ new turn at `phase.turn + 1` (`agent.ts:277-283`) **without closing the leftover
|
|
|
161
163
|
- **Automatic compaction silently stays disabled** (the `agent/pre-step` hook catches and warns; the conversation continues).
|
|
162
164
|
- **rewind's role (resolved)**: the v2 `user/message` rewind marker appends no `step/start`, so a rewind no longer introduces the first trip-wire and the R-OPENSTEP rewind amplifier is closed. The harness-side root cause (an unclosed step after a crash, tripped by continuing the conversation) remains.
|
|
163
165
|
|
|
166
|
+
### R-PROMPTCARD (resolved on the 0.1.7 line): the repeated `System prompt` card is filtered out of chat
|
|
167
|
+
|
|
168
|
+
> **History (0.1.2–0.1.6 lines)**: Chat rendered a collapsed `System prompt`
|
|
169
|
+
> card at every request-series start. Any surface mutation bumps `contentGeneration` (a positional
|
|
170
|
+
> `replace` — rewind, `/compact` — or a `SessionMessageProjection`, e.g. image offload), so the next
|
|
171
|
+
> request logs `request/header { reason: 'series' }`; a process restart logs `'resume'`. The client
|
|
172
|
+
> shows the card for every reason except `'change'`. The effective prompt is unchanged — only the
|
|
173
|
+
> card repeats. Triggers beyond rewind: `/compact`, restart/resume, projections, explicit
|
|
174
|
+
> `startsSeries`.
|
|
175
|
+
>
|
|
176
|
+
> **Upstream decision (deliberate, twice)**: `6ad01cbd8d` suppressed the repeat on `resume` (note
|
|
177
|
+
> `2026-09-03-resume-headers-do-not-repeat-system-prompts.md`, rejecting the card as a "lifecycle
|
|
178
|
+
> marker" that "incorrectly implies another prompt injection"); three days later `77b6b10c21`
|
|
179
|
+
> restored it — a resume/series header starts a visible request series. Locked by the `ui-chat` test
|
|
180
|
+
> `repeats an unchanged system prompt after a surface rewrite…`.
|
|
181
|
+
>
|
|
182
|
+
> **Resolution (0.1.7)**: upstream stopped rendering the card in chat at all. `isVisibleChatNode`
|
|
183
|
+
> (`packages/client/ui-chat/src/client/contract/chat-visibility.ts`, added by `b6f99fad55`
|
|
184
|
+
> "feat(ui-chat): filter system prompts and permission commands") drops `system-prompt` nodes — and
|
|
185
|
+
> the `permission` command — from the visible chat rows, while the durable events and the trajectory
|
|
186
|
+
> inspection keep them. The `showsPrompt` computation is unchanged and no longer matters: the node is
|
|
187
|
+
> filtered before the row is built, so a rewind on this line adds no prompt row at all. #22, #31 and
|
|
188
|
+
> README known issue #4 no longer reproduce.
|
|
189
|
+
>
|
|
190
|
+
> **Plugin stance**: still no compensation. The DOM row-hiding seam (`hiddenSeqsOf`) covers withdrawn
|
|
191
|
+
> messages, where hiding is essential, not cosmetic; nothing was added for the card, and the
|
|
192
|
+
> display-layer workup above stays valid history.
|
|
193
|
+
|
|
164
194
|
## Uncovered boundaries (need an additional e2e layer; non-blocking)
|
|
165
195
|
|
|
166
196
|
- Real LLM streaming and auto title generation (L2 stubbed).
|
|
@@ -186,7 +216,8 @@ new turn at `phase.turn + 1` (`agent.ts:277-283`) **without closing the leftover
|
|
|
186
216
|
| client ordering | — | — | ✓ | — | — | — | ✓ | — |
|
|
187
217
|
| plan-mode | ✓ | — | ✓ | — | — | — | — | ✓ (static) |
|
|
188
218
|
|
|
189
|
-
✓ = probe passes; — = not applicable. RU-I18N and R-
|
|
190
|
-
|
|
219
|
+
✓ = probe passes; — = not applicable. RU-I18N and R-PROMPTCARD are resolved on the 0.1.7 line (see
|
|
220
|
+
above); R-OPENSTEP is an upstream issue the
|
|
221
|
+
plugin does not compensate for (see above); G3 is a confirmed-non-defect behavior pinned in
|
|
191
222
|
`compat-gaps.test.ts` (G1 surface classification via `foldSurface` and G2 projection checkpoint
|
|
192
223
|
both pass).
|
|
@@ -35,7 +35,9 @@ dsh-chat-timeline#6).
|
|
|
35
35
|
## DOM attribute
|
|
36
36
|
|
|
37
37
|
Each withdrawn row carries `data-dsh-rewind-hidden="true"` while hidden,
|
|
38
|
-
removed on un-hide.
|
|
38
|
+
removed on un-hide. The same attribute also lands on a step/process GROUP shell
|
|
39
|
+
— the view container around a turn's process rows, which is not itself a message
|
|
40
|
+
— when every member it holds is withdrawn. Contract:
|
|
39
41
|
|
|
40
42
|
- The **attribute name** is stable; treat the value as opaque.
|
|
41
43
|
- It is **observational only** — rewind hides via `style.display`; the
|
package/docs/format.md
CHANGED
|
@@ -261,10 +261,11 @@ migration tool. Old-format data is never silently re-interpreted.
|
|
|
261
261
|
|
|
262
262
|
## Cleanup policy persistence
|
|
263
263
|
|
|
264
|
-
The snapshot auto-cleanup policy (the `
|
|
265
|
-
idle cutoff) is no longer a file: it
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
`<dsh home>/snapshot-cleanup.json` file; that
|
|
269
|
-
startup migration have been removed. The last-sweep
|
|
270
|
-
`<dsh home>/snapshot-cleanup-last-sweep.json` state file,
|
|
264
|
+
The snapshot auto-cleanup policy (the `autoCleanupEnabled` switch and the
|
|
265
|
+
`autoCleanupMaxAgeDays` idle cutoff) is no longer a file: it is this plugin
|
|
266
|
+
entry's own live configuration (both fields declared `.volatile()`, validated by
|
|
267
|
+
the entry's schemastery `Config` schema, defaults on the schema). The policy was
|
|
268
|
+
previously persisted in a legacy `<dsh home>/snapshot-cleanup.json` file; that
|
|
269
|
+
file store and its one-time startup migration have been removed. The last-sweep
|
|
270
|
+
clock stays in its own `<dsh home>/snapshot-cleanup-last-sweep.json` state file,
|
|
271
|
+
which is unchanged.
|
|
@@ -53,7 +53,7 @@ src/index.ts host plugin: /rewind|/undo|/snapshot-auto-cleanup
|
|
|
53
53
|
+ checkpoint pipeline (tools/execute|post-execute)
|
|
54
54
|
src/rewind.ts pure planning: target resolution, surface range, candidate listing
|
|
55
55
|
src/snapshot.ts checkpoint store (disk before-backups, restore/preview, bounded prune)
|
|
56
|
-
src/snapshot-cleanup.ts cleanup policy +
|
|
56
|
+
src/snapshot-cleanup.ts cleanup policy + plugin-entry config persistence + auto-sweep throttle
|
|
57
57
|
src/session-cwd.ts session-cwd resolution (fs-tools rule)
|
|
58
58
|
src/locales.ts host i18n (t() renderer, HostKey)
|
|
59
59
|
src/client/index.ts client plugin: /rewind command decoration + per-message ↶ button portals;
|
package/docs/release/release.md
CHANGED
|
@@ -99,6 +99,11 @@ outside it.
|
|
|
99
99
|
forward-looking declaration rather than an enforced guard. Bump it in
|
|
100
100
|
the same release that changes the peer range; never leave code raised while
|
|
101
101
|
the declared floor stays behind. Only the `>=X.Y.Z[-pre]` form is used.
|
|
102
|
+
- **The peers are enforced at startup (`0.1.7-rc.1`)**: DSH checks a profile
|
|
103
|
+
bundle's own `@deepseek-ai/dsh-*` peers against the running version and skips
|
|
104
|
+
the whole bundle when one does not satisfy it, so a peer range that is merely
|
|
105
|
+
stale now costs the plugin its load instead of a warning. See
|
|
106
|
+
`docs/compat/audit.md`.
|
|
102
107
|
|
|
103
108
|
## Versioned-line release model
|
|
104
109
|
|
|
@@ -85,6 +85,10 @@ DSH 仍在 rc 阶段,npm 的 prerelease 匹配规则要求 peer 范围与宿
|
|
|
85
85
|
`dsh.engines.dsh` 声明 DSH 运行时下限(如 `>=0.1.2-rc.1`)。当前线上还没有
|
|
86
86
|
任何读取方,因此它只是前置声明、尚未被强制执行。**与 peer 范围持平的同一发布里
|
|
87
87
|
一并 bump**;不可只升代码、声明下限停留在旧值。仅使用 `>=X.Y.Z[-pre]` 形式。
|
|
88
|
+
- **peer 在启动时会被强制执行(`0.1.7-rc.1`)**:DSH 会拿 bundle 自身的
|
|
89
|
+
`@deepseek-ai/dsh-*` peer 与运行版本比对,只要有一个不满足就**整包跳过**,
|
|
90
|
+
因此过期的 peer 范围不再是"仅告警",而是直接导致插件不加载。见
|
|
91
|
+
`docs/compat/audit.md`。
|
|
88
92
|
|
|
89
93
|
## 发布版本线模型
|
|
90
94
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Snapshot cleanup
|
|
2
2
|
|
|
3
|
+
<!-- docs-scope: applies to DSH <= 0.1.6, where the policy is a dsh-settings document namespace. DSH 0.1.7 stores it as the plugin entry's own live configuration; the 0.1.7 seam is recorded in docs/compat/audit.md and docs/format.md. -->
|
|
4
|
+
|
|
3
5
|
The plugin saves a backup of each file before it's edited, so you can rewind your
|
|
4
6
|
code to an earlier point. These backups are called **snapshots**, and they're
|
|
5
7
|
grouped by message and stored per session.
|
|
@@ -43,7 +45,7 @@ whether or not automatic cleanup is on.
|
|
|
43
45
|
|
|
44
46
|
The auto-cleanup switch and the idle-day cutoff live in the **dsh-settings configuration document**. View and edit them in the **Settings > Plugins > Plugin configuration > Snapshot cleanup** panel (the auto-cleanup switch and the idle days), or view and set them with the `/snapshot-auto-cleanup` command:
|
|
45
47
|
|
|
46
|
-
<img src="../assets/screenshots/cleanup-setting.png" alt="
|
|
48
|
+
<img src="../assets/screenshots/cleanup-setting.png" alt="Plugin configuration card: auto cleanup and idle time (days)" width="600">
|
|
47
49
|
|
|
48
50
|
- `enabled` — whether automatic cleanup runs (default `false`).
|
|
49
51
|
- `maxAgeDays` — how many idle days before a session's snapshots are removed (default `30`). Only positive integers are accepted, so a broken setting can never delete everything.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 快照清理
|
|
2
2
|
|
|
3
|
+
<!-- docs-scope: 适用于 DSH <= 0.1.6,此时策略存放在 dsh-settings 文档的命名空间;DSH 0.1.7 起改为本插件条目自身的实时配置,0.1.7 的接缝记录在 docs/compat/audit.md 与 docs/format.md。 -->
|
|
4
|
+
|
|
3
5
|
插件会在每次修改文件前保存一份备份,方便你把代码回退到之前的状态。这些备份叫**快照**,按消息分组、按会话存放。
|
|
4
6
|
|
|
5
7
|
`/snapshot-auto-cleanup` 帮你管理这些快照——既可以回收旧会话占用的磁盘,也可以清空**当前**会话、让它从"现在"重新开始记录回退历史。
|
|
@@ -29,9 +31,9 @@
|
|
|
29
31
|
|
|
30
32
|
## 设置
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
自动清理开关与失活天数保存在**本插件条目自身的配置**中。可在**插件**页本插件的配置卡片查看与修改(自动清理开关、失活天数),也可用 `/snapshot-auto-cleanup` 命令查看和设置:
|
|
33
35
|
|
|
34
|
-
<img src="../assets/screenshots/cleanup-setting.png" alt="
|
|
36
|
+
<img src="../assets/screenshots/cleanup-setting.png" alt="插件配置卡片:自动清理与不活跃时间(天)" width="600">
|
|
35
37
|
|
|
36
38
|
- `enabled` — 是否运行自动清理(默认 `false`)。
|
|
37
39
|
- `maxAgeDays` — 会话失活多少天后移除其快照(默认 `30`)。只接受正整数,因此一个损坏的设置永远不可能"删掉一切"。
|