dsh-ws-recency 0.17.0 → 0.18.0
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 +3 -3
- package/client.js +11 -3
- package/index.js +18 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ DSH 已经把**组内**会话按 `updatedAt` 倒序排好了(排序方式 =
|
|
|
15
15
|
- **每组一个控件**:宿主的「展开其余 N 条会话」被隐藏,由插件的 `展开历史 N` / `收起历史` 接管。N = 宿主还没渲染的行 + 已折叠的过期行;
|
|
16
16
|
- 点「展开历史」→ 插件逐轮驱动宿主那个隐藏按钮(每轮它会多渲染 5 条,剩下 ≤5 条时一次全出),直到整组都渲染出来,同时展开过期行——**一次点到全展开**;
|
|
17
17
|
- 点「收起历史」→ 重新折叠过期行(宿主已渲染的部分仍由插件按时间折叠,不会丢失);
|
|
18
|
-
- 选中 / 运行中 /
|
|
18
|
+
- 选中 / 运行中 / 等待处理 / **标记「需要跟进」** 的会话**永不折叠**——标记就是为了提醒自己去看,收进历史等于白标(选中/运行中/等待处理的豁免可在设置里关掉,跟进标记的豁免始终生效);
|
|
19
19
|
- 空白草稿行(新会话)不参与折叠判断;
|
|
20
20
|
- 每 5 分钟自动重算一次,所以跨过 3 天边界的会话会自己折叠,不用刷新。
|
|
21
21
|
|
|
@@ -79,7 +79,7 @@ DSH 原生的置顶只把会话顶到**它所属工作区分组的第一行**,
|
|
|
79
79
|
|
|
80
80
|
- 「恢复」:按记录的 cwd 算回 `sessions/<project>/<id>/`,并重新挂到对应工作区;
|
|
81
81
|
- 「彻底删除」:真正删掉这份日志(二次确认);
|
|
82
|
-
- 每条记录是一张**卡片**:标题、来源(已删除 / 移动前的旧副本 / 已归档)、轮次、步骤、token
|
|
82
|
+
- 每条记录是一张**卡片**:标题、来源(已删除 / 移动前的旧副本 / 已归档)、轮次、步骤、token 总量、日志大小、时间、原目录(归档的统计按日志大小缓存,第一次读完后不再重算);
|
|
83
83
|
已删除会话的标题与统计在删除时就写进 `.wsr-trash.json`,旧条目则在第一次打开面板时从日志里补算并缓存;
|
|
84
84
|
- 恢复/扫描/移动之后宿主会广播 `api-session/added`;面板与「扫描并刷新」都能重载页面(不重启应用)让侧栏立刻看到改动;
|
|
85
85
|
- 移动操作留下的旧副本会标成「移动时的旧副本」,只允许彻底删除。
|
|
@@ -154,7 +154,7 @@ dsh plugin --profile <profile> add github:chyxhtc/dsh-ws-recency
|
|
|
154
154
|
或固定版本的预构建包:
|
|
155
155
|
|
|
156
156
|
```powershell
|
|
157
|
-
dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.
|
|
157
|
+
dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.18.0/dsh-ws-recency-0.18.0.tgz
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
装完把 `dsh-ws-recency` 加进 `~/.hypers-work/profiles/<profile>/package.json` 的 `dsh.profile.bundles`,重启应用。
|
package/client.js
CHANGED
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
var ZH = {
|
|
223
223
|
"settings.title": "\u5386\u53f2\u6298\u53e0\u5929\u6570",
|
|
224
224
|
"settings.description": "\u4f1a\u8bdd\u8d85\u8fc7\u8fd9\u4e48\u591a\u5929\u6ca1\u6709\u66f4\u65b0\u5c31\u6298\u53e0\uff1b\u6574\u4e2a\u5de5\u4f5c\u533a\u90fd\u8fc7\u671f\u65f6\u53ea\u5269\u5de5\u4f5c\u533a\u6807\u9898\u3002",
|
|
225
|
-
"settings.exempt": "
|
|
225
|
+
"settings.exempt": "选中 / 运行中 / 等待处理 / 标记跟进的会话不折叠",
|
|
226
226
|
"fold.show": "\u5c55\u5f00\u5386\u53f2 {n}",
|
|
227
227
|
"fold.hide": "\u6536\u8d77\u5386\u53f2",
|
|
228
228
|
"color.title": "\u989c\u8272\u4e0e\u8ddf\u8fdb\u6807\u8bb0",
|
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
var EN = {
|
|
329
329
|
"settings.title": "Fold history after (days)",
|
|
330
330
|
"settings.description": "Sessions with no update for this many days are folded; a workspace older than that shows as a bare header.",
|
|
331
|
-
"settings.exempt": "Never fold the selected
|
|
331
|
+
"settings.exempt": "Never fold the selected, running, waiting or follow-up session",
|
|
332
332
|
"fold.show": "Show history ({n})",
|
|
333
333
|
"fold.hide": "Hide history",
|
|
334
334
|
"color.title": "Colors and follow-up marks",
|
|
@@ -758,7 +758,13 @@
|
|
|
758
758
|
var updated = updatedAtOf(row, sessions);
|
|
759
759
|
var stale = updated !== null && updated < cutoff;
|
|
760
760
|
var blank = isBlankRow(row, sessions);
|
|
761
|
-
|
|
761
|
+
/* "Needs follow-up" means "I still owe this one an answer": hiding it
|
|
762
|
+
behind a fold defeats the mark, so it is exempt like a running row. */
|
|
763
|
+
var marked = sessionIdOf(row);
|
|
764
|
+
var flagged = marked !== null && settings.followUps !== null
|
|
765
|
+
&& typeof settings.followUps === "object"
|
|
766
|
+
&& settings.followUps[marked] !== undefined;
|
|
767
|
+
var exempt = flagged || (settings.keepActive && (isActiveRow(row) || isSelectedRow(row)));
|
|
762
768
|
var hide = !expanded && stale && !exempt && !blank;
|
|
763
769
|
if (hide) {
|
|
764
770
|
if (row.getAttribute(HIDDEN_ATTR) !== "true") row.setAttribute(HIDDEN_ATTR, "true");
|
|
@@ -2249,6 +2255,8 @@
|
|
|
2249
2255
|
(function (entry) {
|
|
2250
2256
|
var chips = [];
|
|
2251
2257
|
if (entry.turns > 0) chips.push(t("trash.turns") + " " + entry.turns);
|
|
2258
|
+
if (entry.steps > 0) chips.push(t("trash.steps") + " " + entry.steps);
|
|
2259
|
+
if (entry.tokens > 0) chips.push(formatTokens(entry.tokens) + " tokens");
|
|
2252
2260
|
chips.push(formatBytes(entry.sizeBytes));
|
|
2253
2261
|
var when = formatWhen(entry.lastAt !== 0 ? entry.lastAt : entry.createdAt);
|
|
2254
2262
|
if (when !== "") chips.push(when);
|
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.
|
|
35
|
+
export const HOST_VERSION = "0.18.0";
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Exact routes the client half calls. Registered on the bare web server, so they
|
|
@@ -274,6 +274,9 @@ export async function handleTrashRequest(ctx, req, res) {
|
|
|
274
274
|
const STATS_CACHE_MS = 10 * 1000;
|
|
275
275
|
const statsCache = new Map();
|
|
276
276
|
|
|
277
|
+
/** Archived sessions keep their log, so their card facts never change: key by size. */
|
|
278
|
+
const archiveMetaCache = new Map();
|
|
279
|
+
|
|
277
280
|
/** bytes/4 per Latin character, ~1 token per CJK character. */
|
|
278
281
|
export function estimateTokens(text) {
|
|
279
282
|
if (typeof text !== "string" || text === "") return 0;
|
|
@@ -1185,6 +1188,18 @@ export async function listArchivedSessions(ctx) {
|
|
|
1185
1188
|
|
|
1186
1189
|
const outlineTurns = checkpointValue(checkpoint, "turnOutline");
|
|
1187
1190
|
const turns = Array.isArray(outlineTurns?.turns) ? outlineTurns.turns.length : 0;
|
|
1191
|
+
/* Same facts the trash cards show, so both sections read alike. */
|
|
1192
|
+
const metaKey = `${sessionId}:${sizeBytes}`;
|
|
1193
|
+
let archiveMeta = archiveMetaCache.get(metaKey);
|
|
1194
|
+
if (archiveMeta === undefined) {
|
|
1195
|
+
try {
|
|
1196
|
+
const stats = await sessionStatistics(ctx, sessionId);
|
|
1197
|
+
archiveMeta = stats.ok === true ? { steps: stats.stats.steps, tokens: stats.stats.totals.totalTokens } : { steps: 0, tokens: 0 };
|
|
1198
|
+
} catch {
|
|
1199
|
+
archiveMeta = { steps: 0, tokens: 0 };
|
|
1200
|
+
}
|
|
1201
|
+
archiveMetaCache.set(metaKey, archiveMeta);
|
|
1202
|
+
}
|
|
1188
1203
|
const listMeta = checkpointValue(checkpoint, "sessionListMetadata");
|
|
1189
1204
|
let lastAt = typeof listMeta?.lastPromptAt === "number" ? listMeta.lastPromptAt : 0;
|
|
1190
1205
|
if (lastAt === 0 && typeof header?.updatedAt === "number") lastAt = header.updatedAt;
|
|
@@ -1198,6 +1213,8 @@ export async function listArchivedSessions(ctx) {
|
|
|
1198
1213
|
sessionId,
|
|
1199
1214
|
title,
|
|
1200
1215
|
turns,
|
|
1216
|
+
steps: archiveMeta.steps,
|
|
1217
|
+
tokens: archiveMeta.tokens,
|
|
1201
1218
|
cwd,
|
|
1202
1219
|
createdAt: typeof header?.createdAt === "number" ? header.createdAt : 0,
|
|
1203
1220
|
lastAt,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ws-recency",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
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",
|