dsh-ws-recency 0.12.2 → 0.13.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 +34 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,11 +61,11 @@ DSH 原生的置顶只把会话顶到**它所属工作区分组的第一行**,
|
|
|
61
61
|
5. 把日志目录移动到 `~/.hypers-work/.trash/ws-recency/<sessionId>-<时间戳>/`;
|
|
62
62
|
6. 广播 `api-session/removed`,浏览器立即移除该行。
|
|
63
63
|
|
|
64
|
-
**不是物理删除**:目录只是被改名搬走。每个条目在 `.trash/ws-recency/` 下带一份 `.wsr-trash.json`(会话 id、原 cwd
|
|
64
|
+
**不是物理删除**:目录只是被改名搬走。每个条目在 `.trash/ws-recency/` 下带一份 `.wsr-trash.json`(会话 id、原 cwd、时间、来源),界面里的**回收站**(侧栏底部「回收站」按钮)会列出它们:
|
|
65
65
|
|
|
66
66
|
- 「恢复」:按记录的 cwd 算回 `sessions/<project>/<id>/`,并重新挂到对应工作区;
|
|
67
67
|
- 「彻底删除」:真正删掉这份日志(二次确认);
|
|
68
|
-
- 恢复/扫描/移动之后宿主会广播 `api-session/added
|
|
68
|
+
- 恢复/扫描/移动之后宿主会广播 `api-session/added`;面板与「扫描并刷新」都能重载页面(不重启应用)让侧栏立刻看到改动;
|
|
69
69
|
- 移动操作留下的旧副本会标成「移动时的旧副本」,只允许彻底删除。
|
|
70
70
|
|
|
71
71
|
## 六、Token 消耗统计
|
|
@@ -135,7 +135,7 @@ dsh plugin --profile <profile> add github:chyxhtc/dsh-ws-recency
|
|
|
135
135
|
或固定版本的预构建包:
|
|
136
136
|
|
|
137
137
|
```powershell
|
|
138
|
-
dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.
|
|
138
|
+
dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.13.0/dsh-ws-recency-0.13.0.tgz
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
装完把 `dsh-ws-recency` 加进 `~/.hypers-work/profiles/<profile>/package.json` 的 `dsh.profile.bundles`,重启应用。
|
package/client.js
CHANGED
|
@@ -133,6 +133,9 @@
|
|
|
133
133
|
".wsr-move-path{font-size:11px;color:var(--dsw-alias-label-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
134
134
|
".wsr-move-badge{font-size:11px;color:var(--dsw-alias-label-tertiary)}",
|
|
135
135
|
".wsr-trash-row{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;background:var(--dsw-alias-bg-layer-2,rgba(255,255,255,.04))}",
|
|
136
|
+
".wsr-footer-action{display:inline-flex;align-items:center;gap:6px;border:none;background:0 0;color:var(--dsw-alias-label-tertiary);font:inherit;cursor:pointer;padding:4px 8px;border-radius:6px}",
|
|
137
|
+
".wsr-footer-action:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08));color:var(--dsw-alias-label-primary)}",
|
|
138
|
+
".wsr-footer-label{font-size:12px}",
|
|
136
139
|
".wsr-trash-actions{display:flex;gap:6px;flex:none}",
|
|
137
140
|
".wsr-danger{border-color:var(--dsw-alias-state-error-primary,#d9534f);color:var(--dsw-alias-state-error-primary,#d9534f)}",
|
|
138
141
|
".wsr-chart{display:flex;flex-direction:column;gap:6px}",
|
|
@@ -219,7 +222,7 @@
|
|
|
219
222
|
"move.repaired": "已补登记到「{workspace}」:上一次移动只搬了日志、没登记工作区,这次把它补上了。",
|
|
220
223
|
"adopt.title": "补登记游离会话",
|
|
221
224
|
"adopt.description": "修复会话归属:把“目录属于某工作区却不在任何分组”的会话挂回去,并把仍挂在旧工作区分组里的重复归属清掉。",
|
|
222
|
-
"adopt.action": "
|
|
225
|
+
"adopt.action": "扫描并刷新",
|
|
223
226
|
"adopt.working": "扫描中…",
|
|
224
227
|
"adopt.done": "已补登记 {n} 个会话。",
|
|
225
228
|
"adopt.cleaned": "清理了 {n} 处重复/失效的工作区归属。",
|
|
@@ -298,7 +301,7 @@
|
|
|
298
301
|
"move.repaired": "Registered in \"{workspace}\": the previous attempt moved the log without the bookkeeping, and this repaired it.",
|
|
299
302
|
"adopt.title": "Adopt unlisted sessions",
|
|
300
303
|
"adopt.description": "Repairs session membership: re-attaches sessions whose directory belongs to a workspace but are listed nowhere, and clears stale memberships that make one session appear twice.",
|
|
301
|
-
"adopt.action": "Scan",
|
|
304
|
+
"adopt.action": "Scan and reload",
|
|
302
305
|
"adopt.working": "Scanning\u2026",
|
|
303
306
|
"adopt.done": "Re-attached {n} session(s).",
|
|
304
307
|
"adopt.cleaned": " Cleared {n} stale membership(s).",
|
|
@@ -1776,17 +1779,20 @@
|
|
|
1776
1779
|
load("");
|
|
1777
1780
|
}
|
|
1778
1781
|
|
|
1779
|
-
/**
|
|
1780
|
-
function
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1782
|
+
/** Sidebar footer action: the trash, one click away from the account area. */
|
|
1783
|
+
function TrashFooterAction(props) {
|
|
1784
|
+
var wide = props === undefined || props === null || props.wide !== false;
|
|
1785
|
+
var label = t("trash.title");
|
|
1786
|
+
var Icon = ui.IconTrashOutlineRegular;
|
|
1787
|
+
return h("button", {
|
|
1788
|
+
type: "button",
|
|
1789
|
+
className: "wsr-footer-action",
|
|
1790
|
+
title: label,
|
|
1791
|
+
"aria-label": label,
|
|
1792
|
+
onClick: function () { openTrashPanel(); },
|
|
1793
|
+
},
|
|
1794
|
+
typeof Icon === "function" ? h(Icon, {}) : null,
|
|
1795
|
+
wide ? h("span", { className: "wsr-footer-label" }, label) : null);
|
|
1790
1796
|
}
|
|
1791
1797
|
|
|
1792
1798
|
/** Settings -> General: re-attach sessions that belong to no workspace. */
|
|
@@ -1811,6 +1817,16 @@
|
|
|
1811
1817
|
var text = t("adopt.done", { n: count });
|
|
1812
1818
|
if (cleaned > 0) text += t("adopt.cleaned", { n: cleaned });
|
|
1813
1819
|
setMessage(text);
|
|
1820
|
+
/* The scan is the refresh: reload once it has changed something. */
|
|
1821
|
+
if (count > 0 || cleaned > 0) {
|
|
1822
|
+
window.setTimeout(function () {
|
|
1823
|
+
try {
|
|
1824
|
+
if (window.location !== undefined && typeof window.location.reload === "function") window.location.reload();
|
|
1825
|
+
} catch (error) {
|
|
1826
|
+
/* nothing to do */
|
|
1827
|
+
}
|
|
1828
|
+
}, 900);
|
|
1829
|
+
}
|
|
1814
1830
|
return;
|
|
1815
1831
|
}
|
|
1816
1832
|
setMessage(t("adopt.failed") + (answer.json && answer.json.error ? answer.json.error : answer.text.slice(0, 120)));
|
|
@@ -1826,7 +1842,6 @@
|
|
|
1826
1842
|
),
|
|
1827
1843
|
h("div", { className: "wsr-controls" },
|
|
1828
1844
|
h("button", { type: "button", className: "wsr-step", onClick: run }, t("adopt.action")),
|
|
1829
|
-
h("button", { type: "button", className: "wsr-step", onClick: function () { reloadButton().click(); } }, t("ui.reload")),
|
|
1830
1845
|
),
|
|
1831
1846
|
);
|
|
1832
1847
|
}
|
|
@@ -1969,14 +1984,13 @@
|
|
|
1969
1984
|
}, ColorsRow);
|
|
1970
1985
|
});
|
|
1971
1986
|
|
|
1972
|
-
ctx.slots.inject("
|
|
1987
|
+
ctx.slots.inject("sidebar.footer.action", function () {
|
|
1973
1988
|
return ctx.slots.register({
|
|
1974
|
-
name: "
|
|
1975
|
-
id: "ws-recency-trash-
|
|
1976
|
-
order:
|
|
1977
|
-
store: prefs,
|
|
1989
|
+
name: "sidebar.footer.action",
|
|
1990
|
+
id: "ws-recency-trash-footer",
|
|
1991
|
+
order: 30,
|
|
1978
1992
|
locale: NS,
|
|
1979
|
-
},
|
|
1993
|
+
}, TrashFooterAction);
|
|
1980
1994
|
});
|
|
1981
1995
|
|
|
1982
1996
|
ctx.slots.inject("settings.general.item", function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ws-recency",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.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, per-session token statistics split by tool, and moving a session to another workspace.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "chyxhtc",
|