dsh-rewind-plugin 0.2.2 → 0.2.3
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 +1 -4
- package/README.zh.md +1 -3
- package/lib/client.js +8 -10
- package/lib/types/client/hidden.d.ts +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
In-place conversation rewind for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness): the Claude Code `/rewind` semantics inside the **same session window** — cut the model context back to an earlier user message, and optionally restore workspace files from **disk-persisted before-backups**.
|
|
6
6
|
|
|
7
|
-
> **Status:** published to npm (`dsh-rewind-plugin`, v0.2.
|
|
7
|
+
> **Status:** published to npm (`dsh-rewind-plugin`, v0.2.2) via GitHub Actions Trusted Publishing + Sigstore provenance. Targets the web profile (`dsh --profile web`). Interaction mirrors Claude Code's rewind, adapted to dsh's real web UI.
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/dsh-rewind-plugin)
|
|
10
10
|
[](https://github.com/SiriLee/dsh-rewind/blob/main/LICENSE)
|
|
@@ -40,9 +40,6 @@ In-place conversation rewind for [DeepSeek Harness](https://github.com/deepseek-
|
|
|
40
40
|
|
|
41
41
|
## 📸 Screenshots
|
|
42
42
|
|
|
43
|
-
All screenshots render at a fixed width, so their size stays consistent
|
|
44
|
-
regardless of caption length.
|
|
45
|
-
|
|
46
43
|
<table>
|
|
47
44
|
<tr>
|
|
48
45
|
<td align="center"><img src="assets/screenshots/rewind-button.png" width="440" alt="Per-message ↶ rewind button"><br><sub>Per-message ↶ rewind button</sub></td>
|
package/README.zh.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 插件:**同一会话窗口的 in-place 对话回退**(Claude Code `/rewind` 语义)——把模型上下文剪回更早的一条用户消息,并可基于**落盘的写前备份**还原工作区文件。
|
|
6
6
|
|
|
7
|
-
> **状态**:已发布 npm(`dsh-rewind-plugin`,v0.2.
|
|
7
|
+
> **状态**:已发布 npm(`dsh-rewind-plugin`,v0.2.2),经 GitHub Actions Trusted Publishing + Sigstore provenance 构建发布。目标为 web 配置档(`dsh --profile web`)。交互以 Claude Code 的 rewind 为参考,并贴合 dsh Web 实际 UI。
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/dsh-rewind-plugin)
|
|
10
10
|
[](https://github.com/SiriLee/dsh-rewind/blob/main/LICENSE)
|
|
@@ -40,8 +40,6 @@
|
|
|
40
40
|
|
|
41
41
|
## 📸 截图
|
|
42
42
|
|
|
43
|
-
所有截图以固定宽度渲染,尺寸不随说明文字长短变化。
|
|
44
|
-
|
|
45
43
|
<table>
|
|
46
44
|
<tr>
|
|
47
45
|
<td align="center"><img src="assets/screenshots/rewind-button.png" width="440" alt="用户消息旁的 ↶ 回退按钮"><br><sub>用户消息旁的 ↶ 回退按钮</sub></td>
|
package/lib/client.js
CHANGED
|
@@ -43,8 +43,7 @@ function isPreviewCommand(command) {
|
|
|
43
43
|
}
|
|
44
44
|
function hiddenSeqsOf(snap) {
|
|
45
45
|
const hidden = /* @__PURE__ */ new Set();
|
|
46
|
-
|
|
47
|
-
let maxMarker = Number.NEGATIVE_INFINITY;
|
|
46
|
+
const spans = [];
|
|
48
47
|
for (const key of snap.order) {
|
|
49
48
|
const node = snap.nodes.get(key);
|
|
50
49
|
if (node === void 0 || node.kind !== "command") continue;
|
|
@@ -60,16 +59,15 @@ function hiddenSeqsOf(snap) {
|
|
|
60
59
|
hidden.add(command.seq);
|
|
61
60
|
const target = targetOfOutcome(command.outcome.text);
|
|
62
61
|
if (target !== void 0) {
|
|
63
|
-
|
|
64
|
-
if (marker > maxMarker) maxMarker = marker;
|
|
62
|
+
spans.push({ start: target, end: marker });
|
|
65
63
|
}
|
|
66
64
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
for (const key of snap.order) {
|
|
66
|
+
const node = snap.nodes.get(key);
|
|
67
|
+
if (node === void 0) continue;
|
|
68
|
+
const anchor = node.anchorSeq;
|
|
69
|
+
if (spans.some((span) => anchor >= span.start && anchor <= span.end)) {
|
|
70
|
+
hidden.add(anchor);
|
|
73
71
|
}
|
|
74
72
|
}
|
|
75
73
|
return hidden;
|
|
@@ -23,10 +23,12 @@ export declare function targetOfOutcome(text: string | undefined): number | unde
|
|
|
23
23
|
* withdrawn by a rewind — the target message itself, everything after it, and
|
|
24
24
|
* the (empty, unrendered) marker.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
26
|
+
* Each executed rewind cuts ONE span `[target, marker]`: the target message
|
|
27
|
+
* and everything after it, up to the marker appended at rewind time. Spans are
|
|
28
|
+
* kept SEPARATE (never collapsed to a single `[min target, max marker]`)
|
|
29
|
+
* because a later rewind to a LATER point leaves a visible gap of new traffic
|
|
30
|
+
* between the earlier marker and the later target — collapsing the spans would
|
|
31
|
+
* hide that still-on-surface gap. Endpoints come from the command nodes:
|
|
30
32
|
* `sourceEventSeq` is the marker's log seq, and the outcome text carries the
|
|
31
33
|
* target seq.
|
|
32
34
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-rewind-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "DeepSeek Harness plugin: in-place conversation rewind in the same session window (Claude Code /rewind semantics) with optional workspace file restore",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|