dsh-ws-recency 0.26.0 → 0.26.1
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 +2 -1
- package/client.js +105 -3
- package/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,6 +46,7 @@ DSH 原生的置顶只把会话顶到**它所属工作区分组的第一行**,
|
|
|
46
46
|
- 置顶区每行显示标题 + 所属工作区名,点行直接打开;hover 出现「取消置顶」;
|
|
47
47
|
- 置顶期间它在原工作区分组里的那一行**隐藏**(不重复出现),取消置顶后原行回到原位;
|
|
48
48
|
- 置顶行沿用同一套状态色(运行中蓝 / 完成未读绿 / 需要跟进琥珀),运行状态变化即时更新(0.25.1 修);
|
|
49
|
+
- 置顶行也带状态图标:运行中是转圈、完成未读是圆点、等你确认/回答时是同款琥珀点(0.26.1 起与分组里的行一致,之前只有颜色);
|
|
49
50
|
- 工作区分组、组内顺序、折叠、颜色全部照旧;
|
|
50
51
|
- 只在按工作区分组时出现;搜索、扁平视图、侧栏收起时自动隐藏。
|
|
51
52
|
|
|
@@ -195,7 +196,7 @@ dsh plugin --profile <profile> add github:chyxhtc/dsh-ws-recency
|
|
|
195
196
|
或固定版本的预构建包:
|
|
196
197
|
|
|
197
198
|
```powershell
|
|
198
|
-
dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.26.
|
|
199
|
+
dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.26.1/dsh-ws-recency-0.26.1.tgz
|
|
199
200
|
```
|
|
200
201
|
|
|
201
202
|
装完把 `dsh-ws-recency` 加进 `~/.hypers-work/profiles/<profile>/package.json` 的 `dsh.profile.bundles`,重启应用。
|
package/client.js
CHANGED
|
@@ -107,6 +107,15 @@
|
|
|
107
107
|
".wsr-pin-ws{flex:none;max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--dsw-alias-label-tertiary)}",
|
|
108
108
|
".wsr-pin-unpin{flex:none;border:none;background:transparent;color:var(--dsw-alias-label-tertiary);cursor:pointer;font-size:11px;padding:2px 4px;border-radius:4px;visibility:hidden}",
|
|
109
109
|
".wsr-pin-row:hover .wsr-pin-unpin{visibility:visible}",
|
|
110
|
+
".wsr-pin-slot{flex:none;width:14px;height:14px;display:flex;align-items:center;justify-content:center}",
|
|
111
|
+
".wsr-pin-dot{display:block;width:10px;height:10px;border-radius:50%;background:var(--dsw-alias-label-tertiary,#8a8f98)}",
|
|
112
|
+
'.wsr-pin-dot[data-state="done"]{background:var(--dsw-alias-state-success-primary,#3fae6b)}',
|
|
113
|
+
'.wsr-pin-dot[data-state="warning"]{background:var(--dsw-alias-state-warning-primary,#d99a2b)}',
|
|
114
|
+
".wsr-pin-spin{animation:wsr-pin-spin 1s linear infinite;transform-origin:50% 50%}",
|
|
115
|
+
".wsr-pin-spin circle{fill:none;stroke-width:2}",
|
|
116
|
+
".wsr-pin-track{stroke:var(--dsw-alias-border-l3,rgba(255,255,255,.2))}",
|
|
117
|
+
".wsr-pin-arc{stroke:var(--dsw-alias-state-business-primary,#4f8ef7);stroke-linecap:round;stroke-dasharray:22 60}",
|
|
118
|
+
"@keyframes wsr-pin-spin{to{transform:rotate(360deg)}}",
|
|
110
119
|
".wsr-pin-row[" + STATE_ATTR + '="running"] .wsr-pin-title{color:#4f8ef7}',
|
|
111
120
|
".wsr-pin-row[" + STATE_ATTR + '="unread"] .wsr-pin-title{color:#3fae6b}',
|
|
112
121
|
".wsr-pin-row[" + STATE_ATTR + '="followup"] .wsr-pin-title{color:#d99a2b}',
|
|
@@ -279,6 +288,7 @@
|
|
|
279
288
|
'[' + STATE_ATTR + '="running"] [class*="_title"]{color:#4f8ef7}',
|
|
280
289
|
'[' + STATE_ATTR + '="unread"] [class*="_title"]{color:#3fae6b}',
|
|
281
290
|
'[' + STATE_ATTR + '="followup"] [class*="_title"]{color:#d99a2b}',
|
|
291
|
+
'[' + STATE_ATTR + '="waiting"] [class*="_title"]{color:#d99a2b}',
|
|
282
292
|
".wsr-search-bar{display:flex;gap:8px;align-items:center}",
|
|
283
293
|
".wsr-search-input{flex:1;min-width:0;height:30px;padding:0 10px;border-radius:6px;border:.5px solid var(--dsw-alias-border-l2);background:transparent;color:inherit;font-size:13px}",
|
|
284
294
|
".wsr-hit{display:flex;flex-direction:column;gap:4px;padding:8px 10px;border-radius:8px;cursor:pointer}",
|
|
@@ -319,6 +329,9 @@
|
|
|
319
329
|
"pin.enabled": "\u663e\u793a\u7f6e\u9876\u533a",
|
|
320
330
|
"pin.head": "\u7f6e\u9876",
|
|
321
331
|
"pin.unpin": "\u53d6\u6d88\u7f6e\u9876",
|
|
332
|
+
"pin.status.running": "运行中",
|
|
333
|
+
"pin.status.done": "已完成",
|
|
334
|
+
"pin.status.followup": "需要跟进",
|
|
322
335
|
"argmode.title": "把工具参数计入主 agent",
|
|
323
336
|
"argmode.description": "工具参数是模型自己写的(pwsh 的命令、write 的文件内容),严格说算主 agent 的输出,不算工具的消耗。打开后消耗分布里工具只算返回结果,参数并入主 agent。",
|
|
324
337
|
"argmode.enabled": "工具参数计入主 agent",
|
|
@@ -481,6 +494,9 @@
|
|
|
481
494
|
"argmode.enabled": "Tool arguments count for the agent",
|
|
482
495
|
"pin.head": "Pinned",
|
|
483
496
|
"pin.unpin": "Unpin",
|
|
497
|
+
"pin.status.running": "Running",
|
|
498
|
+
"pin.status.done": "Completed",
|
|
499
|
+
"pin.status.followup": "Needs follow-up",
|
|
484
500
|
"menu.flag": "Mark as needs follow-up",
|
|
485
501
|
"menu.unflag": "Clear follow-up mark",
|
|
486
502
|
"menu.trash": "Delete session (move to trash)",
|
|
@@ -1129,11 +1145,88 @@
|
|
|
1129
1145
|
return false;
|
|
1130
1146
|
}
|
|
1131
1147
|
|
|
1148
|
+
/** The host's four status looks, mapped onto the plugin's own states. */
|
|
1149
|
+
function pinDotStateOf(state) {
|
|
1150
|
+
if (state === "running") return "ongoing";
|
|
1151
|
+
if (state === "waiting") return "warning";
|
|
1152
|
+
if (state === "unread") return "done";
|
|
1153
|
+
if (state === "followup") return "warning";
|
|
1154
|
+
return "idle";
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
/** The running spinner, drawn as the host draws it: track + arc, both circling. */
|
|
1158
|
+
function pinSpinner() {
|
|
1159
|
+
if (typeof document === "undefined" || typeof document.createElementNS !== "function") return null;
|
|
1160
|
+
try {
|
|
1161
|
+
var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1162
|
+
svg.setAttribute("class", "wsr-pin-spin");
|
|
1163
|
+
svg.setAttribute("viewBox", "0 0 24 24");
|
|
1164
|
+
svg.setAttribute("width", "14");
|
|
1165
|
+
svg.setAttribute("height", "14");
|
|
1166
|
+
svg.setAttribute("aria-hidden", "true");
|
|
1167
|
+
var track = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
1168
|
+
track.setAttribute("class", "wsr-pin-track");
|
|
1169
|
+
track.setAttribute("cx", "12");
|
|
1170
|
+
track.setAttribute("cy", "12");
|
|
1171
|
+
track.setAttribute("r", "9.5");
|
|
1172
|
+
var arc = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
1173
|
+
arc.setAttribute("class", "wsr-pin-arc");
|
|
1174
|
+
arc.setAttribute("cx", "12");
|
|
1175
|
+
arc.setAttribute("cy", "12");
|
|
1176
|
+
arc.setAttribute("r", "9.5");
|
|
1177
|
+
svg.appendChild(track);
|
|
1178
|
+
svg.appendChild(arc);
|
|
1179
|
+
return svg;
|
|
1180
|
+
} catch (error) {
|
|
1181
|
+
return null;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* Repaint the leading marker of a pinned row.
|
|
1187
|
+
*
|
|
1188
|
+
* A grouped row gets this from the host (`SessionStatusDots`: spinner while
|
|
1189
|
+
* running, a dot when done). Pinned rows are the plugin's own DOM, so the
|
|
1190
|
+
* same shapes are drawn here; the paint is skipped when the state did not
|
|
1191
|
+
* change, so a running spinner is not re-created on every pass.
|
|
1192
|
+
*/
|
|
1193
|
+
function paintPinState(row, state) {
|
|
1194
|
+
if (row === null || typeof row.querySelector !== "function") return;
|
|
1195
|
+
var slot = row.querySelector(".wsr-pin-slot");
|
|
1196
|
+
if (slot === null) return;
|
|
1197
|
+
var key = pinDotStateOf(state);
|
|
1198
|
+
if (slot.getAttribute("data-wsr-dot") === key) return;
|
|
1199
|
+
slot.setAttribute("data-wsr-dot", key);
|
|
1200
|
+
while (slot.firstChild !== undefined && slot.firstChild !== null) slot.removeChild(slot.firstChild);
|
|
1201
|
+
if (key === "ongoing") {
|
|
1202
|
+
slot.setAttribute("title", t("pin.status.running"));
|
|
1203
|
+
var spinner = pinSpinner();
|
|
1204
|
+
if (spinner !== null) slot.appendChild(spinner);
|
|
1205
|
+
return;
|
|
1206
|
+
}
|
|
1207
|
+
if (key === "idle") {
|
|
1208
|
+
slot.setAttribute("title", "");
|
|
1209
|
+
return;
|
|
1210
|
+
}
|
|
1211
|
+
var label = key === "done" ? t("pin.status.done") : t("pin.status.followup");
|
|
1212
|
+
var dot = document.createElement("span");
|
|
1213
|
+
dot.className = "wsr-pin-dot";
|
|
1214
|
+
dot.setAttribute("data-state", key);
|
|
1215
|
+
dot.setAttribute("role", "img");
|
|
1216
|
+
dot.setAttribute("aria-label", label);
|
|
1217
|
+
dot.setAttribute("title", label);
|
|
1218
|
+
slot.appendChild(dot);
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1132
1221
|
function pinnedRowElement(item, state) {
|
|
1133
1222
|
var row = document.createElement("div");
|
|
1134
1223
|
row.className = "wsr-pin-row";
|
|
1135
1224
|
row.setAttribute("data-row-key", "pin:" + item.id);
|
|
1136
1225
|
setRowState(row, state === undefined ? null : state);
|
|
1226
|
+
var slot = document.createElement("span");
|
|
1227
|
+
slot.className = "wsr-pin-slot";
|
|
1228
|
+
row.appendChild(slot);
|
|
1229
|
+
paintPinState(row, state === undefined ? null : state);
|
|
1137
1230
|
var title = document.createElement("span");
|
|
1138
1231
|
title.className = "wsr-pin-title";
|
|
1139
1232
|
title.textContent = item.title;
|
|
@@ -1162,7 +1255,8 @@
|
|
|
1162
1255
|
}
|
|
1163
1256
|
|
|
1164
1257
|
/** Hide the copies inside their own groups so nothing is listed twice. */
|
|
1165
|
-
function hideOriginalRows(entries, pinnedIds) {
|
|
1258
|
+
function hideOriginalRows(entries, pinnedIds) {
|
|
1259
|
+
for (var i = 0; i < entries.length; i += 1) {
|
|
1166
1260
|
var rows = rowElements(entries[i].section);
|
|
1167
1261
|
for (var j = 0; j < rows.length; j += 1) {
|
|
1168
1262
|
var id = sessionIdOf(rows[j]);
|
|
@@ -1197,7 +1291,9 @@
|
|
|
1197
1291
|
for (var i = 0; i < rows.length; i += 1) {
|
|
1198
1292
|
var key = rows[i].getAttribute("data-row-key");
|
|
1199
1293
|
var id = key === null ? "" : key.slice("pin:".length);
|
|
1200
|
-
|
|
1294
|
+
var state = statesOfId(states, id);
|
|
1295
|
+
setRowState(rows[i], state);
|
|
1296
|
+
paintPinState(rows[i], state);
|
|
1201
1297
|
}
|
|
1202
1298
|
}
|
|
1203
1299
|
|
|
@@ -1307,7 +1403,13 @@
|
|
|
1307
1403
|
conversation moved on - continuing a conversation is often the very
|
|
1308
1404
|
reason a follow-up is still owed. */
|
|
1309
1405
|
var flagged = flags[id] !== undefined;
|
|
1310
|
-
|
|
1406
|
+
/* Waiting on the user outranks everything the host itself reports:
|
|
1407
|
+
an approval, a plan review or a question is what the row is for now. */
|
|
1408
|
+
var pending = status !== null && status.pendingInteraction !== null && status.pendingInteraction !== undefined
|
|
1409
|
+
? status.pendingInteraction.kind
|
|
1410
|
+
: undefined;
|
|
1411
|
+
var waiting = pending === "approval" || pending === "plan-review" || pending === "question";
|
|
1412
|
+
states[id] = waiting ? "waiting" : running ? "running" : unread ? "unread" : flagged ? "followup" : null;
|
|
1311
1413
|
}
|
|
1312
1414
|
return states;
|
|
1313
1415
|
}
|
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.26.
|
|
35
|
+
export const HOST_VERSION = "0.26.1";
|
|
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.26.
|
|
3
|
+
"version": "0.26.1",
|
|
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, moving a session to another workspace, and a literal content search that jumps to the turn a word was said in.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "chyxhtc",
|