dsh-rewind-plugin 0.2.2 → 0.2.4

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 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.0) 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.
7
+ > **Status:** published to npm (`dsh-rewind-plugin`, v0.2.4) 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
  [![npm version](https://img.shields.io/npm/v/dsh-rewind-plugin.svg)](https://www.npmjs.com/package/dsh-rewind-plugin)
10
10
  [![npm license](https://img.shields.io/npm/l/dsh-rewind-plugin.svg)](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>
@@ -83,6 +80,8 @@ Backups persist across host restarts, bounded to the newest 100 anchor groups pe
83
80
 
84
81
  Published to npm — the registry path is the recommended one. **Restart dsh web (`--profile web`) after installing.**
85
82
 
83
+ > ⚠️ Note: the npm name `dsh-rewind` belongs to another author's package — install with `dsh-rewind-plugin`.
84
+
86
85
  ### Option A: registry (recommended)
87
86
 
88
87
  ```sh
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.0),经 GitHub Actions Trusted Publishing + Sigstore provenance 构建发布。目标为 web 配置档(`dsh --profile web`)。交互以 Claude Code 的 rewind 为参考,并贴合 dsh Web 实际 UI。
7
+ > **状态**:已发布 npm(`dsh-rewind-plugin`,v0.2.4),经 GitHub Actions Trusted Publishing + Sigstore provenance 构建发布。目标为 web 配置档(`dsh --profile web`)。交互以 Claude Code 的 rewind 为参考,并贴合 dsh Web 实际 UI。
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/dsh-rewind-plugin.svg)](https://www.npmjs.com/package/dsh-rewind-plugin)
10
10
  [![npm license](https://img.shields.io/npm/l/dsh-rewind-plugin.svg)](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>
@@ -82,6 +80,8 @@
82
80
 
83
81
  已发布 npm——推荐走 registry 路径。**装完重启 dsh web(`--profile web`)。**
84
82
 
83
+ > ⚠️ 注意:npm 上的 `dsh-rewind` 属于其他作者,请用 `dsh-rewind-plugin` 安装。
84
+
85
85
  ### 方式 A:registry(推荐)
86
86
 
87
87
  ```sh
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
- let minTarget = Number.POSITIVE_INFINITY;
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
- if (target < minTarget) minTarget = target;
64
- if (marker > maxMarker) maxMarker = marker;
62
+ spans.push({ start: target, end: marker });
65
63
  }
66
64
  }
67
- if (Number.isFinite(minTarget)) {
68
- for (const key of snap.order) {
69
- const node = snap.nodes.get(key);
70
- if (node === void 0) continue;
71
- const anchor = node.anchorSeq;
72
- if (anchor >= minTarget && anchor <= maxMarker) hidden.add(anchor);
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
- * The cut span is [min target, max marker] across ALL executed rewinds, not
27
- * just the newest one: every rewind withdraws its target and everything after
28
- * it, and a later rewind to a LATER point (after new traffic) must not re-show
29
- * rows an earlier rewind already cut. Endpoints come from the command nodes:
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.2",
3
+ "version": "0.2.4",
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",
@@ -66,25 +66,21 @@
66
66
  "access": "public"
67
67
  },
68
68
  "peerDependencies": {
69
- "@deepseek-ai/cordis": "*",
70
- "@deepseek-ai/dsh-agent": "*",
71
- "@deepseek-ai/dsh-client-locale": "*",
72
- "@deepseek-ai/dsh-client-runtime": "*",
73
- "@deepseek-ai/dsh-client-ui-slots": "*",
74
- "@deepseek-ai/dsh-commands": "*",
75
- "@deepseek-ai/dsh-fs": "*",
76
- "@deepseek-ai/dsh-llm": "*",
77
- "@deepseek-ai/dsh-sandbox": "*",
78
- "@deepseek-ai/dsh-session": "*",
79
- "@deepseek-ai/dsh-tools": "*"
69
+ "@deepseek-ai/cordis": "^4.0.1",
70
+ "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6",
71
+ "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
72
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
73
+ "@deepseek-ai/dsh-commands": "^0.1.0-rc.6",
74
+ "@deepseek-ai/dsh-fs": "^0.1.0-rc.6",
75
+ "@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
76
+ "@deepseek-ai/dsh-sandbox": "^0.1.0-rc.6",
77
+ "@deepseek-ai/dsh-session": "^0.1.0-rc.6",
78
+ "@deepseek-ai/dsh-tools": "^0.1.0-rc.6"
80
79
  },
81
80
  "peerDependenciesMeta": {
82
81
  "@deepseek-ai/cordis": {
83
82
  "optional": true
84
83
  },
85
- "@deepseek-ai/dsh-agent": {
86
- "optional": true
87
- },
88
84
  "@deepseek-ai/dsh-client-locale": {
89
85
  "optional": true
90
86
  },
@@ -114,17 +110,17 @@
114
110
  }
115
111
  },
116
112
  "devDependencies": {
117
- "@deepseek-ai/cordis": "^4.0.1-rc.4",
118
- "@deepseek-ai/dsh-agent": "0.1.0-rc.6",
119
- "@deepseek-ai/dsh-client-locale": "0.1.0-rc.6",
120
- "@deepseek-ai/dsh-client-runtime": "0.1.0-rc.6",
121
- "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.6",
122
- "@deepseek-ai/dsh-commands": "0.1.0-rc.6",
123
- "@deepseek-ai/dsh-fs": "0.1.0-rc.6",
124
- "@deepseek-ai/dsh-llm": "0.1.0-rc.6",
125
- "@deepseek-ai/dsh-sandbox": "0.1.0-rc.6",
126
- "@deepseek-ai/dsh-session": "0.1.0-rc.6",
127
- "@deepseek-ai/dsh-tools": "0.1.0-rc.6",
113
+ "@deepseek-ai/cordis": "^4.0.1",
114
+ "@deepseek-ai/dsh-agent": "^0.1.0-rc.7",
115
+ "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.7",
116
+ "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
117
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
118
+ "@deepseek-ai/dsh-commands": "^0.1.0-rc.7",
119
+ "@deepseek-ai/dsh-fs": "^0.1.0-rc.7",
120
+ "@deepseek-ai/dsh-llm": "^0.1.0-rc.7",
121
+ "@deepseek-ai/dsh-sandbox": "^0.1.0-rc.7",
122
+ "@deepseek-ai/dsh-session": "^0.1.0-rc.7",
123
+ "@deepseek-ai/dsh-tools": "^0.1.0-rc.7",
128
124
  "@types/node": "^24.0.0",
129
125
  "esbuild": "^0.28.2",
130
126
  "typescript": "^7.0.2",