@lijian-ui/dsh-session-cleaner 0.1.3 → 0.1.5
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 +37 -1
- package/package.json +12 -12
package/lib/client.js
CHANGED
|
@@ -705,7 +705,8 @@ window.__ModuleLoader__.load({
|
|
|
705
705
|
ctx.inject(["workspaces"], (sctx) => {
|
|
706
706
|
officialArchive = async (sessionId) => {
|
|
707
707
|
try {
|
|
708
|
-
|
|
708
|
+
await sctx.workspaces.archiveSession(sessionId);
|
|
709
|
+
return true;
|
|
709
710
|
} catch {
|
|
710
711
|
return false;
|
|
711
712
|
}
|
|
@@ -722,6 +723,41 @@ window.__ModuleLoader__.load({
|
|
|
722
723
|
archiveSession: (sessionId) => officialArchive ? officialArchive(sessionId) : api.archive(sessionId).then((r) => r.ok)
|
|
723
724
|
})
|
|
724
725
|
}, SessionManagerSection));
|
|
726
|
+
const navLabels = /* @__PURE__ */ new Set([zh["section.label"], en["section.label"]]);
|
|
727
|
+
const sessionNavSvg = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-scn-nav=\"1\"><path d=\"M8.00003 0.3237C3.76075 0.3237 0.32373 3.76072 0.32373 8C0.32373 9.17603 0.589121 10.2922 1.0632 11.2901L1.35291 11.8989L2.5705 11.3205L2.28079 10.7117C1.89079 9.89074 1.67301 8.97167 1.67301 8C1.67301 4.50546 4.50549 1.67298 8.00003 1.67298C11.4946 1.67298 14.3271 4.50546 14.3271 8C14.3271 11.4945 11.4946 14.327 8.00003 14.327C7.28473 14.327 6.76077 14.277 6.29621 14.1487C5.83857 14.0224 5.40441 13.8109 4.88514 13.4488C4.12569 12.919 3.03778 12.7316 2.141 13.2978L2.12682 13.307L2.11264 13.3171L1.34886 13.854L1.79659 15.188L2.86122 14.4384C3.19068 14.2305 3.68325 14.2542 4.11326 14.5539C4.72789 14.9826 5.30042 15.2724 5.93762 15.4484C6.56803 15.6224 7.22776 15.6763 8.00003 15.6763C12.2393 15.6763 15.6763 12.2393 15.6763 8C15.6763 3.76072 12.2393 0.3237 8.00003 0.3237ZM7.32033 4.82535V7.32536H4.82538V8.67464H7.32033V11.1747H8.6696V8.67464H11.1747V7.32536H8.6696V4.82535H7.32033Z\" fill=\"currentColor\"/></svg>";
|
|
728
|
+
const patchNavIcon = () => {
|
|
729
|
+
if (typeof document === "undefined") return;
|
|
730
|
+
for (const span of Array.from(document.querySelectorAll("button > span"))) {
|
|
731
|
+
if (!navLabels.has(span.textContent ?? "")) continue;
|
|
732
|
+
const button = span.parentElement;
|
|
733
|
+
if (button === null) continue;
|
|
734
|
+
const stale = button.querySelector("svg:not([data-scn-nav])");
|
|
735
|
+
if (stale === null) continue;
|
|
736
|
+
const template = document.createElement("template");
|
|
737
|
+
template.innerHTML = sessionNavSvg;
|
|
738
|
+
const next = template.content.firstElementChild;
|
|
739
|
+
if (next === null) continue;
|
|
740
|
+
const cls = stale.getAttribute("class");
|
|
741
|
+
if (cls !== null) next.setAttribute("class", cls);
|
|
742
|
+
stale.replaceWith(next);
|
|
743
|
+
}
|
|
744
|
+
};
|
|
745
|
+
if (typeof document !== "undefined" && typeof MutationObserver !== "undefined" && document.body !== null) {
|
|
746
|
+
let scheduled = false;
|
|
747
|
+
const schedule = () => {
|
|
748
|
+
if (scheduled) return;
|
|
749
|
+
scheduled = true;
|
|
750
|
+
queueMicrotask(() => {
|
|
751
|
+
scheduled = false;
|
|
752
|
+
patchNavIcon();
|
|
753
|
+
});
|
|
754
|
+
};
|
|
755
|
+
patchNavIcon();
|
|
756
|
+
new MutationObserver(schedule).observe(document.body, {
|
|
757
|
+
childList: true,
|
|
758
|
+
subtree: true
|
|
759
|
+
});
|
|
760
|
+
}
|
|
725
761
|
}
|
|
726
762
|
//#endregion
|
|
727
763
|
exports.apply = apply;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lijian-ui/dsh-session-cleaner",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Session management plugin for DeepSeek Harness (dsh): list / delete / archive & restore sessions, with a built-in \"Archived\" group and a delete confirm dialog (real delete, not trash). 为 DeepSeek Harness 提供会话管理:列表 / 真删除(二次确认)/ 归档分组与恢复。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -67,21 +67,21 @@
|
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@deepseek-ai/cordis": "4.0.1",
|
|
70
|
-
"@deepseek-ai/dsh-api-gateway": "0.1.
|
|
71
|
-
"@deepseek-ai/dsh-client-connection": "0.1.
|
|
72
|
-
"@deepseek-ai/dsh-client-locale": "0.1.
|
|
73
|
-
"@deepseek-ai/dsh-client-runtime": "0.1.
|
|
74
|
-
"@deepseek-ai/dsh-client-
|
|
75
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.1.
|
|
76
|
-
"@deepseek-ai/dsh-client-ui-
|
|
77
|
-
"@deepseek-ai/dsh-
|
|
78
|
-
"@deepseek-ai/dsh-
|
|
79
|
-
"@deepseek-ai/dsh-typert-protocol": "0.1.0-rc.6",
|
|
70
|
+
"@deepseek-ai/dsh-api-gateway": "0.1.1-rc.2",
|
|
71
|
+
"@deepseek-ai/dsh-client-connection": "0.1.1-rc.2",
|
|
72
|
+
"@deepseek-ai/dsh-client-locale": "0.1.1-rc.2",
|
|
73
|
+
"@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
|
|
74
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.1-rc.2",
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.1-rc.2",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.1-rc.2",
|
|
77
|
+
"@deepseek-ai/dsh-settings": "0.1.1-rc.2",
|
|
78
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.1-rc.2",
|
|
80
79
|
"@deepseek-ai/schemastery": "3.18.1",
|
|
81
80
|
"@types/node": "^22.0.0",
|
|
82
81
|
"@types/react": "^18.3.0",
|
|
83
82
|
"react": "^18.2.0",
|
|
84
83
|
"tsdown": "^0.12.0",
|
|
85
|
-
"typescript": "^5.6.0"
|
|
84
|
+
"typescript": "^5.6.0",
|
|
85
|
+
"@deepseek-ai/dsh-typert-registry": "0.1.1-rc.2"
|
|
86
86
|
}
|
|
87
87
|
}
|