dsh-ws-recency 0.23.2 → 0.23.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 CHANGED
@@ -135,6 +135,8 @@ DSH 原生的置顶只把会话顶到**它所属工作区分组的第一行**,
135
135
 
136
136
  交接块按 markdown 围栏解析:**只有独占一行的 ``` 才算结束**,正文里引用「```handoff 块」不会把内容截半(0.23.2 修)。
137
137
 
138
+ 交接块只认**行首且成对闭合**的围栏:正文里提到 ```handoff 不会把交接切断,写了一半的回复也不会被提前抓取。
139
+
138
140
  两处发送都是模拟 Enter:当前会话里先写入、等 250ms 再按回车,并按需再补两次(共 3 次);草稿会话在 14 秒内重试。始终送不出去时文本仍留在输入框,手动回车即可。
139
141
 
140
142
  ## 设置
@@ -173,7 +175,7 @@ dsh plugin --profile <profile> add github:chyxhtc/dsh-ws-recency
173
175
  或固定版本的预构建包:
174
176
 
175
177
  ```powershell
176
- dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.23.2/dsh-ws-recency-0.23.2.tgz
178
+ dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.23.3/dsh-ws-recency-0.23.3.tgz
177
179
  ```
178
180
 
179
181
  装完把 `dsh-ws-recency` 加进 `~/.hypers-work/profiles/<profile>/package.json` 的 `dsh.profile.bundles`,重启应用。
package/client.js CHANGED
@@ -2133,15 +2133,36 @@
2133
2133
  return blocks;
2134
2134
  }
2135
2135
 
2136
+ /**
2137
+ * Pull the fenced block out of an assistant reply.
2138
+ *
2139
+ * Fences only count at the start of a line, and only a closed pair counts at
2140
+ * all: a note often mentions a ```handoff block in prose (which cut the note
2141
+ * in half before), and a reply that is still streaming has no closing fence
2142
+ * yet (which would otherwise be captured half-written).
2143
+ */
2136
2144
  function handoffBlockOf(text) {
2137
2145
  if (typeof text !== "string") return "";
2138
- var blocks = fencedBlocks(text);
2139
- for (var i = 0; i < blocks.length; i += 1) {
2140
- if (blocks[i].label === "handoff") return blocks[i].body;
2141
- }
2142
- /* A reply that forgot the label still counts if it reads like the note. */
2143
- for (var j = 0; j < blocks.length; j += 1) {
2144
- if (blocks[j].body.indexOf("#") !== -1) return blocks[j].body;
2146
+ var tagged = /^[ \t]*```handoff[ \t]*$/m.exec(text);
2147
+ if (tagged !== null) {
2148
+ var from = tagged.index + tagged[0].length;
2149
+ var rest = text.slice(from);
2150
+ var close = /^[ \t]*```[ \t]*$/m.exec(rest);
2151
+ if (close === null) return "";
2152
+ return rest.slice(0, close.index).replace(/^\r?\n/, "").trim();
2153
+ }
2154
+ /* Older replies may use a plain fence: take the first one that reads like a
2155
+ document, skipping unrelated code samples above it. */
2156
+ var fence = /^[ \t]*```[ \t]*[a-zA-Z0-9_-]*[ \t]*$/gm;
2157
+ var opened;
2158
+ while ((opened = fence.exec(text)) !== null) {
2159
+ var bodyFrom = opened.index + opened[0].length;
2160
+ var tail = text.slice(bodyFrom);
2161
+ var ending = /^[ \t]*```[ \t]*$/m.exec(tail);
2162
+ if (ending === null) return "";
2163
+ var body = tail.slice(0, ending.index).replace(/^\r?\n/, "").trim();
2164
+ if (body.indexOf("#") !== -1) return body;
2165
+ fence.lastIndex = bodyFrom + ending.index + ending[0].length;
2145
2166
  }
2146
2167
  return "";
2147
2168
  }
@@ -2165,7 +2186,8 @@
2165
2186
  setHandoffState({ sessionId: sessionId, phase: "ready", block: found, needsEnter: false });
2166
2187
  return;
2167
2188
  }
2168
- handoffBaseline = replies;
2189
+ /* Keep looking at this same reply: it may still be streaming, and a
2190
+ reply without a block is not a reason to move past it. */
2169
2191
  }
2170
2192
  }
2171
2193
  if (handoffTries > 150) {
package/index.js CHANGED
@@ -32,7 +32,7 @@ import { dirname, join } from "node:path";
32
32
  export const name = "ws-recency";
33
33
 
34
34
  /** Version marker reported by the health route. */
35
- export const HOST_VERSION = "0.23.2";
35
+ export const HOST_VERSION = "0.23.3";
36
36
 
37
37
  /**
38
38
  * Exact routes the client half calls. Registered on the bare web server, so they
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ws-recency",
3
- "version": "0.23.2",
3
+ "version": "0.23.3",
4
4
  "description": "Sidebar session management for DeepSeek Harness: workspace groups sorted by latest activity, stale history folded, a global pinned section, follow-up marks, session delete into a recoverable trash, archived sessions managed from that same trash panel, per-session token statistics with an argument/result split and an option to count tool arguments as the agent's writing, and moving a session to another workspace.",
5
5
  "license": "MIT",
6
6
  "author": "chyxhtc",