dsh-rewind-plugin 0.2.1 → 0.2.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/lib/client.js +9 -2
- package/lib/types/client/hidden.d.ts +5 -5
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -38,6 +38,9 @@ function targetOfOutcome(text) {
|
|
|
38
38
|
const match = text.match(/seq (\d+)/);
|
|
39
39
|
return match !== null ? Number(match[1]) : void 0;
|
|
40
40
|
}
|
|
41
|
+
function isPreviewCommand(command) {
|
|
42
|
+
return (command.args ?? "").includes("preview");
|
|
43
|
+
}
|
|
41
44
|
function hiddenSeqsOf(snap) {
|
|
42
45
|
const hidden = /* @__PURE__ */ new Set();
|
|
43
46
|
let minTarget = Number.POSITIVE_INFINITY;
|
|
@@ -47,10 +50,14 @@ function hiddenSeqsOf(snap) {
|
|
|
47
50
|
if (node === void 0 || node.kind !== "command") continue;
|
|
48
51
|
const command = node.data;
|
|
49
52
|
if (command.name !== "rewind") continue;
|
|
53
|
+
if (isPreviewCommand(command)) {
|
|
54
|
+
hidden.add(command.seq);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
50
57
|
if (command.outcome?.kind !== "success") continue;
|
|
51
|
-
if (command.outcome.sourceEventSeq === void 0) continue;
|
|
52
|
-
hidden.add(command.seq);
|
|
53
58
|
const marker = command.outcome.sourceEventSeq;
|
|
59
|
+
if (marker === void 0) continue;
|
|
60
|
+
hidden.add(command.seq);
|
|
54
61
|
const target = targetOfOutcome(command.outcome.text);
|
|
55
62
|
if (target !== void 0) {
|
|
56
63
|
if (target < minTarget) minTarget = target;
|
|
@@ -17,11 +17,11 @@ export interface HiddenChat {
|
|
|
17
17
|
export declare function targetOfOutcome(text: string | undefined): number | undefined;
|
|
18
18
|
/**
|
|
19
19
|
* Anchor seqs that must be hidden from the rendered transcript so the user
|
|
20
|
-
* sees the conversation as the agent sees it: every
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* rewind — the target message itself, everything after it, and
|
|
24
|
-
* unrendered) marker.
|
|
20
|
+
* sees the conversation as the agent sees it: every impact-preview flow node
|
|
21
|
+
* (pending, succeeded, or errored — it only exists to feed the popover) and
|
|
22
|
+
* every SUCCESSFUL executed `/rewind` command row, plus every message
|
|
23
|
+
* withdrawn by a rewind — the target message itself, everything after it, and
|
|
24
|
+
* the (empty, unrendered) marker.
|
|
25
25
|
*
|
|
26
26
|
* The cut span is [min target, max marker] across ALL executed rewinds, not
|
|
27
27
|
* just the newest one: every rewind withdraws its target and everything after
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-rewind-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
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",
|