@kangyishuai/dsh-session-rewind 0.6.0 → 0.6.2
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.md +8 -6
- package/README.zh-CN.md +8 -6
- package/lib/client.js +23 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
> In-place conversation rewind for DeepSeek Harness: send the conversation back to before any user message, withdraw everything after it from the model context and the transcript, optionally restore the workspace files those turns changed, and put the message back into the composer.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@kangyishuai/dsh-session-rewind) [](https://www.npmjs.com/package/@kangyishuai/dsh-session-rewind) [](#compatibility) [](./LICENSE)
|
|
6
6
|
|
|
7
7
|
[中文](./README.zh-CN.md)
|
|
8
8
|
|
|
9
9
|
Unofficial plugin for [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness). Not affiliated with DeepSeek.
|
|
10
10
|
|
|
11
|
-
> **Status: early.**
|
|
11
|
+
> **Status: early.** End to end verified against the current target DSH version — the [Compatibility](#compatibility) table records exactly what was run (unit tests, throwaway-home GUI suite, real-desktop read-only and `--recall` suites) and when. `pnpm gate:session-rewind` runs the whole release gate in one command. Young software — keep backups of anything you cannot lose.
|
|
12
12
|
|
|
13
13
|
## What it does
|
|
14
14
|
|
|
@@ -117,12 +117,14 @@ On startup the plugin also removes data for sessions that no longer exist (they
|
|
|
117
117
|
- **Private client seams.** Hiding rows and injecting the ↶ button rely on DSH's internal view/slot registries. They are shape-checked at install and degrade to “context rewound, transcript not hidden” or “button missing” rather than breaking a session.
|
|
118
118
|
- **Recall is a draft edit.** It fills the composer through the host facade, so `Ctrl+Z` steps back through recalls like any other draft change; it never appends to the session or the model context.
|
|
119
119
|
- **POSIX/macOS paths only** in this version; Windows separators and permission bits are not verified.
|
|
120
|
+
- **macOS overlays don't drag the window.** The drawer, its mask and the confirm dialog declare `data-window-drag-exclude`, so dragging over them while they cover the title bar behaves normally (verified with a real mouse drag on DSH 0.2.2-rc.2; earlier builds could drag the whole window).
|
|
120
121
|
|
|
121
122
|
## Compatibility
|
|
122
123
|
|
|
123
|
-
| DSH version | Status
|
|
124
|
-
| ----------- |
|
|
125
|
-
| 0.2.2-rc.
|
|
124
|
+
| DSH version | Status |
|
|
125
|
+
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
126
|
+
| 0.2.2-rc.2 | Verified 2026-11-12: 208 unit tests + `pnpm probe:runtime` 67/67 + web `smoke:session-rewind` 49/49 (throwaway DSH home, real host). Desktop on the live app over CDP: 24/24 read-only + `--recall` 31/31 against the 0.6.2 build (`--deep --workspace` was last measured on 0.6.1 at 39/39; this release only touches the stylesheet, not the file-mode path). 0.6.1 added the macOS window-drag exclusion; 0.6.2 fixes the dark-theme confirm button (it rendered white-on-white) and stops pairing inverted theme fills with a hardcoded white foreground. |
|
|
127
|
+
| 0.2.2-rc.1 | Verified 2026-11-09: 205 unit tests + web `smoke:session-rewind` 49/49 (temp DSH home) + desktop `smoke:session-rewind-desktop` 23/23 read-only, 30/30 with `--recall`, and 39/39 with `--deep` (file mode end to end, real Electron renderer over CDP); the full `--recall --deep` combination is 46/46. |
|
|
126
128
|
|
|
127
129
|
The plugin declares no `engines.dsh` and no `@deepseek-ai/*` peer range: DSH is pre-release and semver ranges over prereleases are unreliable (see [ADR 0005](../../docs/adr/0005-dsh-version-compatibility.md)). Treat the table as the compatibility statement. After a DSH upgrade run `pnpm probe:runtime`, `pnpm smoke:session-rewind`, and check the plugin's diagnostics tab; if a private seam changed, the plugin degrades instead of breaking the session.
|
|
128
130
|
|
|
@@ -132,7 +134,7 @@ The plugin declares no `engines.dsh` and no `@deepseek-ai/*` peer range: DSH is
|
|
|
132
134
|
pnpm test # unit tests (host engine, host RPC, client helpers)
|
|
133
135
|
pnpm verify # repo-wide gates
|
|
134
136
|
pnpm smoke:session-rewind # temp DSH home + real GUI end-to-end (needs dsh & ego-browser)
|
|
135
|
-
pnpm smoke:session-rewind-desktop # desktop (Electron) read-only check (
|
|
137
|
+
pnpm smoke:session-rewind-desktop # desktop (Electron) read-only check (24); --recall adds 7 composer-recall checks; --deep --workspace <dir> adds the file-mode run (40 total)
|
|
136
138
|
```
|
|
137
139
|
|
|
138
140
|
Design notes: [ADR 0006](../../docs/adr/0006-session-rewind-architecture.md) and [ADR 0007](../../docs/adr/0007-session-rewind-file-restore.md) (Chinese; the repository docs are written in Chinese).
|
package/README.zh-CN.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
> DeepSeek Harness 的「就地回溯」:把会话退回到任意一条用户消息之前,目标消息及其后的内容同时从模型上下文和渲染对话中撤回;可选择一并还原这些轮次改过的工作区文件;目标消息文本(和图片)自动回填输入框。
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@kangyishuai/dsh-session-rewind) [](https://www.npmjs.com/package/@kangyishuai/dsh-session-rewind) [](#兼容性) [](./LICENSE)
|
|
6
6
|
|
|
7
7
|
[English](./README.md)
|
|
8
8
|
|
|
9
9
|
非官方插件,与 DeepSeek 无关。面向 [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness)。
|
|
10
10
|
|
|
11
|
-
> **状态:早期。**
|
|
11
|
+
> **状态:早期。** 已针对当前目标 DSH 版本端到端验证——具体跑了什么、什么时候跑的,见[兼容性](#兼容性)表格(单测、一次性 DSH 目录里的 GUI 冒烟、真实桌面版只读与 `--recall`)。`pnpm gate:session-rewind` 一条命令跑完发版门禁。插件还年轻,重要数据请自行备份。
|
|
12
12
|
|
|
13
13
|
## 它做什么
|
|
14
14
|
|
|
@@ -117,12 +117,14 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-session-rewind-*.tgz
|
|
|
117
117
|
- **客户端私有 seam**:隐藏行和注入 ↶ 按钮依赖 DSH 内部 view/slot 注册表;安装时做形状检查,失效时降级为「上下文已回溯、界面不隐藏」或「按钮消失」,不破坏会话。
|
|
118
118
|
- **召回只是改草稿**:它通过宿主输入框 facade 整篇替换草稿,所以 `Ctrl+Z` 会像普通编辑一样一步步退回;它不会向会话或模型上下文追加任何东西。
|
|
119
119
|
- **本版只验证 POSIX/macOS 路径**;Windows 分隔符与权限位未验证。
|
|
120
|
+
- **macOS 浮层不会拖走窗口。** 抽屉、遮罩与确认框都声明了 `data-window-drag-exclude`,覆盖页头时拖动行为正常(在 DSH 0.2.2-rc.2 上用真实鼠标拖动验证;更早的构建会把整个窗口拖走)。
|
|
120
121
|
|
|
121
122
|
## 兼容性
|
|
122
123
|
|
|
123
|
-
| DSH 版本 | 状态
|
|
124
|
-
| ---------- |
|
|
125
|
-
| 0.2.2-rc.
|
|
124
|
+
| DSH 版本 | 状态 |
|
|
125
|
+
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
126
|
+
| 0.2.2-rc.2 | 2026-11-12 已验证:208 个单测 + `pnpm probe:runtime` 67/67 + Web `smoke:session-rewind` 49/49(临时 DSH home,真实宿主)。桌面(live 桌面版,CDP):只读 24/24 + `--recall` 31/31(均为 0.6.2 构建实测;`--deep --workspace` 上次在 0.6.1 上测得 39/39,本次只改样式表、不涉及文件模式)。0.6.1 加了 macOS 窗口拖动排除;0.6.2 修掉深色主题下确认按钮「白底白字」,并禁止「反色填充 + 死白前景」这种配法。 |
|
|
127
|
+
| 0.2.2-rc.1 | 2026-11-09 已验证:205 个单测 + Web `smoke:session-rewind` 49/49(临时 DSH home)+ 桌面 `smoke:session-rewind-desktop` 只读 23/23、加 `--recall` 30/30、加 `--deep` 39/39(文件模式端到端,真实 Electron 渲染进程走 CDP);全量组合 `--recall --deep` 46/46。 |
|
|
126
128
|
|
|
127
129
|
插件不声明 `engines.dsh`,也不声明 `@deepseek-ai/*` 的 peer 范围:DSH 还在预发布阶段,预发布版本的 semver 范围不可靠(见 [ADR 0005](../../docs/adr/0005-dsh-version-compatibility.md))。以这张表为准。DSH 升级后跑 `pnpm probe:runtime`、`pnpm smoke:session-rewind`,并看插件诊断页签;私有 seam 变了会降级而不是让会话出错。
|
|
128
130
|
|
|
@@ -132,7 +134,7 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-session-rewind-*.tgz
|
|
|
132
134
|
pnpm test # 单测(宿主文件引擎、宿主 RPC、客户端 helper)
|
|
133
135
|
pnpm verify # 仓库统一门禁
|
|
134
136
|
pnpm smoke:session-rewind # 临时 DSH 目录 + 真实 GUI 端到端(需要 dsh 与 ego-browser)
|
|
135
|
-
pnpm smoke:session-rewind-desktop # 桌面(Electron)只读回归(
|
|
137
|
+
pnpm smoke:session-rewind-desktop # 桌面(Electron)只读回归(24 项);--recall 再加 7 条召回断言;--deep --workspace <dir> 再跑文件模式(合计 40 项)
|
|
136
138
|
```
|
|
137
139
|
|
|
138
140
|
设计记录:[ADR 0006](../../docs/adr/0006-session-rewind-architecture.md)、[ADR 0007](../../docs/adr/0007-session-rewind-file-restore.md)。
|
package/lib/client.js
CHANGED
|
@@ -2416,7 +2416,7 @@ window.__ModuleLoader__.load({
|
|
|
2416
2416
|
|
|
2417
2417
|
return h(
|
|
2418
2418
|
"div",
|
|
2419
|
-
{ className: "dsh-srw-mask", onClick: () => api.close() },
|
|
2419
|
+
{ className: "dsh-srw-mask", "data-window-drag-exclude": "", onClick: () => api.close() },
|
|
2420
2420
|
h(
|
|
2421
2421
|
"div",
|
|
2422
2422
|
{
|
|
@@ -2994,11 +2994,16 @@ window.__ModuleLoader__.load({
|
|
|
2994
2994
|
|
|
2995
2995
|
return h(
|
|
2996
2996
|
"div",
|
|
2997
|
-
{
|
|
2997
|
+
{
|
|
2998
|
+
className: "dsh-srw-drawer-mask",
|
|
2999
|
+
"data-window-drag-exclude": "",
|
|
3000
|
+
onClick: () => api.closeDrawer(),
|
|
3001
|
+
},
|
|
2998
3002
|
h(
|
|
2999
3003
|
"aside",
|
|
3000
3004
|
{
|
|
3001
3005
|
className: "dsh-srw-drawer",
|
|
3006
|
+
"data-window-drag-exclude": "",
|
|
3002
3007
|
role: "dialog",
|
|
3003
3008
|
"aria-modal": "true",
|
|
3004
3009
|
"aria-label": t("drawer.title"),
|
|
@@ -3255,11 +3260,16 @@ window.__ModuleLoader__.load({
|
|
|
3255
3260
|
".dsh-srw-btn{padding:6px 14px;border-radius:8px;font-size:13px;cursor:pointer;background:transparent;color:var(--dsw-alias-label-primary,inherit);border:1px solid var(--dsw-alias-border-l2,rgba(128,128,128,.35));}",
|
|
3256
3261
|
".dsh-srw-btn:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(128,128,128,.16));}",
|
|
3257
3262
|
".dsh-srw-btn:disabled{opacity:.45;cursor:not-allowed;}",
|
|
3258
|
-
|
|
3259
|
-
|
|
3263
|
+
// 主按钮:底与字必须成对取自宿主语义 token。--dsw-alias-brand-primary 是「反色表面色」
|
|
3264
|
+
// (浅色近黑 #0f1115、深色近白 #f9fafb),配死白 #fff 会在深色主题下变成白底白字(1.05:1)。
|
|
3265
|
+
".dsh-srw-btn-primary{background:var(--dsw-alias-button-primary-fill,var(--dsw-alias-brand-primary,#4f7cff));color:var(--dsw-alias-label-primary-foreground,#fff);border-color:transparent;font-weight:500;}",
|
|
3266
|
+
".dsh-srw-btn-primary:hover{background:var(--dsw-alias-button-primary-hover,var(--dsw-alias-button-primary-fill));}",
|
|
3260
3267
|
".dsh-srw-toast{position:fixed;bottom:24px;right:24px;z-index:2147000000;background:var(--dsw-alias-toast-bg,Canvas);color:var(--dsw-alias-toast-label,CanvasText);border:1px solid var(--dsw-alias-border-l2,rgba(128,128,128,.35));border-radius:10px;padding:10px 14px;font-size:13px;box-shadow:0 10px 30px rgba(0,0,0,.35);display:flex;gap:12px;align-items:center;max-width:min(520px,90vw);}",
|
|
3261
3268
|
".dsh-srw-toast-text{flex:1;min-width:0;}",
|
|
3262
3269
|
".dsh-srw-toast-action{white-space:nowrap;}",
|
|
3270
|
+
// toast 底色两个主题都是深色,链接色必须用该表面自己的文字 token + 下划线做可点线索;
|
|
3271
|
+
// 用 --dsw-alias-link 在浅色主题会变成 #4176e6 压深底(2.86:1)。
|
|
3272
|
+
".dsh-srw-toast .dsh-srw-toast-action{color:var(--dsw-alias-toast-label,#fff);text-decoration:underline;text-underline-offset:2px;}",
|
|
3263
3273
|
".dsh-srw-body{display:flex;flex-direction:column;gap:10px;}",
|
|
3264
3274
|
".dsh-srw-search{width:100%;box-sizing:border-box;padding:7px 10px;border-radius:8px;border:1px solid var(--dsw-alias-border-l2,rgba(128,128,128,.35));background:var(--dsw-alias-bg-layer-1,transparent);color:inherit;font-size:13px;margin-bottom:6px;}",
|
|
3265
3275
|
".dsh-srw-search:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4f7cff);outline-offset:1px;}",
|
|
@@ -3278,19 +3288,20 @@ window.__ModuleLoader__.load({
|
|
|
3278
3288
|
".dsh-srw-files-title{font-weight:500;}",
|
|
3279
3289
|
".dsh-srw-paths{display:flex;flex-direction:column;gap:2px;font-size:12px;}",
|
|
3280
3290
|
".dsh-srw-path{display:flex;gap:8px;align-items:baseline;padding:2px 0;min-width:0;}",
|
|
3281
|
-
".dsh-srw-path-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--
|
|
3291
|
+
".dsh-srw-path-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ds-font-family-code,ui-monospace,monospace);}",
|
|
3282
3292
|
".dsh-srw-path[data-kind=restore] .dsh-srw-path-name{color:var(--dsw-alias-state-success-primary,#3c9a5f);}",
|
|
3283
|
-
|
|
3293
|
+
// 警告色:宿主 token 是 state-warn-*(没有 state-warning-*)。文字用 warn-label,描边才用 warn-primary。
|
|
3294
|
+
".dsh-srw-path[data-kind=trash] .dsh-srw-path-name{color:var(--dsw-alias-state-warn-label,var(--dsw-alias-state-warn-primary));}",
|
|
3284
3295
|
".dsh-srw-path[data-kind=conflict] .dsh-srw-path-name,.dsh-srw-path[data-kind=skipped] .dsh-srw-path-name{color:var(--dsw-alias-state-error-primary,#d9534f);}",
|
|
3285
3296
|
".dsh-srw-path-bytes,.dsh-srw-path-reason{color:var(--dsw-alias-label-tertiary,GrayText);white-space:nowrap;}",
|
|
3286
|
-
".dsh-srw-warn{color:var(--dsw-alias-state-
|
|
3297
|
+
".dsh-srw-warn{color:var(--dsw-alias-state-warn-label,var(--dsw-alias-state-warn-primary));}",
|
|
3287
3298
|
".dsh-srw-warn-list{display:flex;flex-direction:column;gap:3px;}",
|
|
3288
3299
|
".dsh-srw-warn-title{font-weight:600;color:var(--dsw-alias-state-error-primary,#d9534f);}",
|
|
3289
3300
|
".dsh-srw-badge{font-size:11px;color:var(--dsw-alias-label-tertiary,GrayText);border:1px solid var(--dsw-alias-border-l2,rgba(128,128,128,.3));border-radius:999px;padding:0 7px;white-space:nowrap;}",
|
|
3290
3301
|
".dsh-srw-badge[data-ok=true]{color:var(--dsw-alias-state-success-primary,#3c9a5f);}",
|
|
3291
3302
|
".dsh-srw-badge[data-ok=false]{color:var(--dsw-alias-state-error-primary,#d9534f);}",
|
|
3292
3303
|
".dsh-srw-load-older{display:flex;justify-content:center;padding-top:8px;}",
|
|
3293
|
-
".dsh-srw-link{background:none;border:none;padding:0 2px;color:var(--dsw-alias-brand-primary,#4f7cff);cursor:pointer;font-size:12px;}",
|
|
3304
|
+
".dsh-srw-link{background:none;border:none;padding:0 2px;color:var(--dsw-alias-link,var(--dsw-alias-brand-primary,#4f7cff));cursor:pointer;font-size:12px;}",
|
|
3294
3305
|
".dsh-srw-link:hover{text-decoration:underline;}",
|
|
3295
3306
|
".dsh-srw-link:disabled{opacity:.5;cursor:not-allowed;text-decoration:none;}",
|
|
3296
3307
|
".dsh-srw-btn-sm{padding:3px 10px;font-size:12px;}",
|
|
@@ -3307,10 +3318,11 @@ window.__ModuleLoader__.load({
|
|
|
3307
3318
|
// 时间线:竖线 + 圆点 + 卡片
|
|
3308
3319
|
".dsh-srw-timeline{display:flex;flex-direction:column;gap:0;position:relative;}",
|
|
3309
3320
|
".dsh-srw-tl-node{position:relative;display:flex;gap:12px;padding:0 0 14px 0;}",
|
|
3310
|
-
".dsh-srw-tl-node::before{content:'';position:absolute;left:5px;top:14px;bottom:0;width:1px;background:var(--dsw-alias-border-
|
|
3321
|
+
".dsh-srw-tl-node::before{content:'';position:absolute;left:5px;top:14px;bottom:0;width:1px;background:var(--dsw-alias-border-l3,rgba(128,128,128,.35));}",
|
|
3311
3322
|
".dsh-srw-tl-node:last-child{padding-bottom:0;}",
|
|
3312
3323
|
".dsh-srw-tl-node:last-child::before{display:none;}",
|
|
3313
|
-
|
|
3324
|
+
// 圆点描边环必须用圆点所在表面的底色(对话框/抽屉都是 bg-layer-2),否则深色下会露出黑边。
|
|
3325
|
+
".dsh-srw-tl-dot{flex:none;width:11px;height:11px;margin-top:4px;border-radius:50%;background:var(--dsw-alias-brand-primary,#4f7cff);box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-2,transparent);}",
|
|
3314
3326
|
".dsh-srw-tl-node[data-kind='rescue-restore'] .dsh-srw-tl-dot{background:var(--dsw-alias-label-secondary,GrayText);}",
|
|
3315
3327
|
".dsh-srw-tl-card{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1;}",
|
|
3316
3328
|
".dsh-srw-tl-head{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap;}",
|
|
@@ -3324,7 +3336,7 @@ window.__ModuleLoader__.load({
|
|
|
3324
3336
|
".dsh-srw-item-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}",
|
|
3325
3337
|
".dsh-srw-audit-actions{padding:2px 0;}",
|
|
3326
3338
|
".dsh-srw-audit-files{font-size:12px;color:var(--dsw-alias-label-secondary,GrayText);}",
|
|
3327
|
-
".dsh-srw-confirm-row{display:flex;flex-direction:column;gap:6px;border:1px solid var(--dsw-alias-state-
|
|
3339
|
+
".dsh-srw-confirm-row{display:flex;flex-direction:column;gap:6px;border:1px solid var(--dsw-alias-state-warn-primary,#c08a2e);border-radius:8px;padding:8px 10px;}",
|
|
3328
3340
|
".dsh-srw-setting{display:flex;gap:10px;align-items:center;flex-wrap:wrap;}",
|
|
3329
3341
|
".dsh-srw-setting-label{min-width:150px;color:var(--dsw-alias-label-secondary,GrayText);}",
|
|
3330
3342
|
".dsh-srw-check{display:flex;gap:8px;align-items:center;cursor:pointer;}",
|
package/package.json
CHANGED