dsh-sessions-manager 3.7.4 → 3.7.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/README.en.md +2 -2
- package/README.md +2 -2
- package/lib/client.js +50 -7
- package/lib/client.js.map +2 -2
- package/lib/index.js +34 -3
- package/lib/index.js.map +2 -2
- package/package.json +1 -1
- package/src/client/index.jsx +47 -6
- package/src/index.js +46 -2
package/README.en.md
CHANGED
|
@@ -213,10 +213,10 @@ lib/client.js pre-built client (ModuleLoader CJS handshake)
|
|
|
213
213
|
- `0.1.3-alpha.1`: snapshot lists and chunked `SessionHandle` read flows are supported. Permanent purge and cross-workspace move are available through guarded path derivation + write-ownership probes (see the behavior notes below), and disable themselves whenever a safe path cannot be verified; other management capabilities are unaffected. The panel shows the effective capabilities.
|
|
214
214
|
- `0.1.5-rc.1` / `0.1.5-rc.2` (both verified): the session log format is upgraded to **v3** and this plugin is adapted — it reads the **highest generation** (matching the runtime), tolerates v0/v2/v3 generations side by side, follows the new `SessionHandle.read()` shape (`{ eventState, events }`), moves sessions as **whole-directory moves** (reclaiming superseded-generation copies automatically), and queues moves for sessions DSH holds open (see "Moving an active session" above).
|
|
215
215
|
- `0.1.7-rc.2` (verified): the session format is upgraded again to **v4** and the format catalog moves to its own package; this plugin is adapted — reads go through the official automatic migration, and cross-workspace moves re-sample the header against the backend's current format (sessions created on older formats can be moved again, and the relocated copy lands on the current format).
|
|
216
|
-
- `0.2.0-rc.1` (verified):
|
|
216
|
+
- `0.2.0-rc.1` / `0.2.0-rc.2` (both verified):
|
|
217
217
|
- Still format **v4** (the version is probed from the backend's format catalog, never hardcoded).
|
|
218
218
|
- `ctx.sessions` is now a session **data-stream** service with no `open`: opening a session goes through the official `uiWorkspace.openSession` — the settings panel's "open session" action and subagent navigation are both adapted (issue #12).
|
|
219
|
-
- Install gate: 0.2.0 validates the `@deepseek-ai/dsh*` ranges in a plugin's `peerDependencies`; this plugin widened them to `>=0.1.0-rc.6`, which passes on both `0.1.7-rc.2` and `0.2.0-rc.
|
|
219
|
+
- Install gate: 0.2.0 validates the `@deepseek-ai/dsh*` ranges in a plugin's `peerDependencies`; this plugin widened them to `>=0.1.0-rc.6`, which passes on both `0.1.7-rc.2` and `0.2.0-rc.2` (issue #13).
|
|
220
220
|
- `ctx.storageDomain` is the **domain data form** in 0.2.0: writes are schema-validated and durable before they resolve. This plugin only writes fields that exist in the official domain schema, verified end-to-end against a **real domain + real WorkspaceRegistry** (archive / restore / list / storage stats / cross-workspace move) with a read-back from the storage medium to prove the archive state really persisted.
|
|
221
221
|
- Active-session detection: since 0.1.7 the host exposes no "current session" accessor (all three historical probes come back empty), so the **client reports the open session id every 15 seconds** and the host trusts it only within a 45-second freshness window. It backs two guards: refusing to move the session you are looking at (409 / queued) and skipping it in auto-archive. A stopped heartbeat (panel closed, tab hidden, process gone) means "cannot prove it is active" — the move is allowed rather than locking the session forever.
|
|
222
222
|
- Unverified future runtimes expose only capabilities the plugin can safely identify; method presence alone is not presented as behavioral compatibility.
|
package/README.md
CHANGED
|
@@ -214,10 +214,10 @@ lib/client.js 预构建 client(ModuleLoader CJS handshake)
|
|
|
214
214
|
- `0.1.5-rc.1` / `0.1.5-rc.2`(已实测):会话日志格式升级到 **v3**,本插件已适配——按**最高代**读取(与官方一致)、v0/v2/v3 多代共存、跟随 `SessionHandle.read()` 的新返回结构
|
|
215
215
|
(`{ eventState, events }`)、跨工作区移动按**整目录搬运**并自动回收被取代的旧代副本;被 DSH 打开着的会话改为**排队延迟移动**(见上文「移动活跃会话」)。
|
|
216
216
|
- `0.1.7-rc.2`(已实测):会话格式再升 **v4**,格式版本目录拆分到独立包;本插件已适配——读取走官方自动迁移,跨工作区移动自动按后端当前格式重采样会话头(旧格式会话可正常移动,落盘即当前格式)。
|
|
217
|
-
- `0.2.0-rc.1
|
|
217
|
+
- `0.2.0-rc.1` / `0.2.0-rc.2`(均已实测):
|
|
218
218
|
- 会话格式仍为 **v4**(版本由后端格式目录包动态探测,不写死)。
|
|
219
219
|
- `ctx.sessions` 已退化为会话**数据流**服务(不再提供 `open`):打开会话改走官方 `uiWorkspace.openSession`——设置面板与侧栏的「打开会话」、子代理导航均已适配(issue #12)。
|
|
220
|
-
- 安装门禁:0.2.0 会校验插件 `peerDependencies` 中的 `@deepseek-ai/dsh*` 版本范围,本插件已放宽为 `>=0.1.0-rc.6`,`0.1.7-rc.2` 与 `0.2.0-rc.
|
|
220
|
+
- 安装门禁:0.2.0 会校验插件 `peerDependencies` 中的 `@deepseek-ai/dsh*` 版本范围,本插件已放宽为 `>=0.1.0-rc.6`,`0.1.7-rc.2` 与 `0.2.0-rc.2` 通过(issue #13)。
|
|
221
221
|
- 存储域(`ctx.storageDomain`)在 0.2.0 是**领域数据形式**:写入经 schema 校验并在返回前落盘。本插件只写官方域 schema 内的字段,已用**真实域 + 真实 WorkspaceRegistry** 端到端实测(归档 / 恢复 / 列表 / 存储统计 / 跨工作区移动),并回到磁盘介质核验归档状态真的持久化。
|
|
222
222
|
- 活跃会话判定:0.1.7 起 host 侧不再有「当前会话」访问器(三个历史探测全部落空),改由**客户端每 15 秒上报**当前会话 id、host 只在 45 秒新鲜期内采信;用于「移动正在看的会话」(409 / 排队)与「自动归档跳过当前会话」两条保护。心跳停止(面板关闭、标签页隐藏、进程退出)即视为无法证明活跃,放行移动而不是把会话永久锁死。
|
|
223
223
|
- 未经验证的未来 Runtime 默认只开放能够识别的安全能力;插件不会用方法存在与否冒充行为兼容。
|
package/lib/client.js
CHANGED
|
@@ -330,7 +330,8 @@ var CSS = `
|
|
|
330
330
|
.archv{--dsm-radius-tag:9px;--dsm-radius-ctl:9px;--dsm-radius-sheet:10px;--dsm-radius-card:12px;display:flex;flex-direction:column;gap:4px;max-width:800px;padding:8px 2px 28px}
|
|
331
331
|
.archv-head{display:flex;align-items:center;gap:10px;margin:0 0 2px}
|
|
332
332
|
.archv-title{font-size:16px;font-weight:650;color:var(--dsw-alias-label-primary);letter-spacing:-0.01em;margin:0}
|
|
333
|
-
.archv-stamp{font-size:11px;font-weight:500;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-fill-secondary);border:1px solid var(--dsw-alias-border-l1);border-radius:999px;padding:2px 8px;white-space:nowrap;cursor:
|
|
333
|
+
.archv-stamp{font-size:11px;font-weight:500;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-fill-secondary);border:1px solid var(--dsw-alias-border-l1);border-radius:999px;padding:2px 8px;white-space:nowrap;cursor:pointer;transition:color .15s ease,border-color .15s ease}
|
|
334
|
+
.archv-stamp:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-border-l3)}
|
|
334
335
|
.archv-count{font-size:11px;font-weight:600;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-fill-subtle);border:1px solid var(--dsw-alias-border-l2);border-radius:999px;padding:1px 8px;flex:none}
|
|
335
336
|
.archv-sub{font-size:12px;line-height:1.55;color:var(--dsw-alias-label-tertiary);margin:0 0 12px;max-width:64ch}
|
|
336
337
|
.archv-err{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 12px;border:1px solid color-mix(in srgb,var(--dsw-alias-state-error-primary) 40%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,transparent);border-radius:var(--dsm-radius-sheet);color:var(--dsw-alias-state-error-primary);font-size:12px;margin-bottom:10px}
|
|
@@ -355,8 +356,11 @@ var CSS = `
|
|
|
355
356
|
.sess-fbtn-on{background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-border-l3)}
|
|
356
357
|
.sess-tools{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px;margin:0 0 8px}
|
|
357
358
|
.sess-tools-4{grid-template-columns:repeat(auto-fit,minmax(132px,1fr))}
|
|
358
|
-
/* T4 \u8D77\u641C\u7D22\u884C\u6709 5 \u4E2A\u5B57\u6BB5\uFF08\u641C\u7D22/\u5DE5\u4F5C\u533A/\u6807\u7B7E/\u6392\u5E8F/\u5206\u7EC4\uFF09\uFF1A\
|
|
359
|
-
|
|
359
|
+
/* T4 \u8D77\u641C\u7D22\u884C\u6709 5 \u4E2A\u5B57\u6BB5\uFF08\u641C\u7D22/\u5DE5\u4F5C\u533A/\u6807\u7B7E/\u6392\u5E8F/\u5206\u7EC4\uFF09\uFF1A\u56FA\u5B9A 5 \u5217 + minmax(0,1fr)
|
|
360
|
+
\u4E00\u884C\u6392\u6EE1\u2014\u2014auto-fit(minmax(124px,\u2026)) \u5728\u9762\u677F\u5BBD\u5EA6\u4E0D\u8DB3 5\xD7124+gap \u65F6\u4F1A\u628A\u6700\u540E
|
|
361
|
+
\u4E00\u5217\u6324\u5230\u7B2C\u4E8C\u884C\uFF08\u5206\u7EC4\u5B64\u884C\uFF09\u3002minmax(0,1fr) \u5141\u8BB8\u5217\u5747\u5206\u6536\u7F29\uFF0Cselect/input
|
|
362
|
+
\u5404\u81EA\u622A\u65AD\uFF1B<640px \u4ECD\u7531\u4E0B\u65B9\u65AD\u70B9\u6536\u6210\u5355\u5217\u3002 */
|
|
363
|
+
.sess-tools-5{grid-template-columns:repeat(5,minmax(0,1fr))}
|
|
360
364
|
.dsm-kids{display:flex;flex-direction:column;gap:6px;margin:10px 0 2px;margin-left:43px;padding-left:10px;border-left:2px solid var(--dsw-alias-border-l3)}
|
|
361
365
|
.dsm-kid .dsm-kids{margin-left:8px;margin-top:6px}
|
|
362
366
|
.dsm-kids-toggle{appearance:none;min-height:22px;padding:0 9px;border:1px solid color-mix(in srgb,var(--dsw-alias-state-business-primary) 40%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 10%,transparent);color:var(--dsw-alias-state-business-primary);border-radius:var(--dsm-radius-tag);font:inherit;font-size:11px;font-weight:500;cursor:pointer;flex:none;white-space:nowrap}
|
|
@@ -1062,6 +1066,33 @@ function SessionPanel({ workspacesSvc }) {
|
|
|
1062
1066
|
setToast({ msg, kind: kind === "err" ? "err" : "ok" });
|
|
1063
1067
|
timer.current = setTimeout(() => setToast(null), toastDurationFor(msg, kind));
|
|
1064
1068
|
};
|
|
1069
|
+
const copyBuildStamp = async () => {
|
|
1070
|
+
const full = String(capabilities && capabilities.buildStamp || "");
|
|
1071
|
+
if (!full) return;
|
|
1072
|
+
try {
|
|
1073
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
1074
|
+
await navigator.clipboard.writeText(full);
|
|
1075
|
+
showToast("\u5DF2\u590D\u5236\u5B8C\u6574\u7248\u672C\u53F7 " + full, "ok");
|
|
1076
|
+
return;
|
|
1077
|
+
}
|
|
1078
|
+
throw new Error("clipboard unavailable");
|
|
1079
|
+
} catch (e) {
|
|
1080
|
+
try {
|
|
1081
|
+
const ta = document.createElement("textarea");
|
|
1082
|
+
ta.value = full;
|
|
1083
|
+
ta.style.position = "fixed";
|
|
1084
|
+
ta.style.opacity = "0";
|
|
1085
|
+
document.body.appendChild(ta);
|
|
1086
|
+
ta.select();
|
|
1087
|
+
const ok = document.execCommand("copy");
|
|
1088
|
+
document.body.removeChild(ta);
|
|
1089
|
+
if (!ok) throw new Error("execCommand failed");
|
|
1090
|
+
showToast("\u5DF2\u590D\u5236\u5B8C\u6574\u7248\u672C\u53F7 " + full, "ok");
|
|
1091
|
+
} catch (e2) {
|
|
1092
|
+
showToast("\u590D\u5236\u5931\u8D25\uFF0C\u5B8C\u6574\u7248\u672C\u53F7\uFF1A" + full, "err");
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
};
|
|
1065
1096
|
const refresh = () => {
|
|
1066
1097
|
setError(null);
|
|
1067
1098
|
Promise.all([
|
|
@@ -1761,8 +1792,20 @@ function SessionPanel({ workspacesSvc }) {
|
|
|
1761
1792
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: CSS }),
|
|
1762
1793
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "archv-head", children: [
|
|
1763
1794
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "archv-title", children: "\u4F1A\u8BDD\u7BA1\u7406" }),
|
|
1764
|
-
capabilities && capabilities.buildStamp ? /* @__PURE__ */ (0, import_jsx_runtime.
|
|
1765
|
-
|
|
1795
|
+
capabilities && capabilities.buildStamp ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1796
|
+
"span",
|
|
1797
|
+
{
|
|
1798
|
+
className: "archv-stamp",
|
|
1799
|
+
role: "button",
|
|
1800
|
+
"aria-label": "\u590D\u5236\u5B8C\u6574\u7248\u672C\u53F7",
|
|
1801
|
+
title: capabilities.buildStamp,
|
|
1802
|
+
onClick: copyBuildStamp,
|
|
1803
|
+
children: [
|
|
1804
|
+
"v",
|
|
1805
|
+
String(capabilities.buildStamp).split("+")[0]
|
|
1806
|
+
]
|
|
1807
|
+
}
|
|
1808
|
+
) : null,
|
|
1766
1809
|
sessions !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "archv-count", "aria-label": `${sessions.length} \u4E2A\u4F1A\u8BDD`, children: sessions.length })
|
|
1767
1810
|
] }),
|
|
1768
1811
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "archv-sub", children: "\u7EDF\u4E00\u7BA1\u7406\u5168\u90E8\u4F1A\u8BDD\uFF1A\u5F52\u6863 / \u6062\u590D / \u79FB\u52A8\u5230\u5176\u4ED6\u5DE5\u4F5C\u533A / \u4F1A\u8BDD\u8BE6\u60C5 / \u6279\u91CF\u64CD\u4F5C\uFF0C\u5220\u9664\u4F1A\u5148\u8FDB\u5165\u56DE\u6536\u7AD9\uFF0C\u53EF\u5728\u56DE\u6536\u7AD9\u5185\u6062\u590D\u6216\u5F7B\u5E95\u6E05\u7406\u3002" }),
|
|
@@ -2108,8 +2151,8 @@ function SessionPanel({ workspacesSvc }) {
|
|
|
2108
2151
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sess-field", children: [
|
|
2109
2152
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "dsm-group", children: "\u5206\u7EC4" }),
|
|
2110
2153
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { id: "dsm-group", value: groupByLineage ? "lineage" : "flat", onChange: (e) => setGroupByLineage(e.target.value === "lineage"), title: "\u8840\u7F18\u5206\u7EC4\uFF1A\u5B50\u4EE3\u7406\u6298\u53E0\u3001\u5206\u652F\u805A\u62E2\u6210\u7EC4\uFF1B\u5E73\u94FA\uFF1A\u4E0E DSH \u539F\u751F\u4E00\u81F4\uFF0C\u5168\u90E8\u5E76\u5217", children: [
|
|
2111
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "lineage", children: "\u8840\u7F18\uFF08\u6298\u53E0\
|
|
2112
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "flat", children: "\u5E73\u94FA\uFF08\
|
|
2154
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "lineage", children: "\u8840\u7F18\uFF08\u6298\u53E0\uFF09" }),
|
|
2155
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "flat", children: "\u5E73\u94FA\uFF08\u5E76\u5217\uFF09" })
|
|
2113
2156
|
] })
|
|
2114
2157
|
] })
|
|
2115
2158
|
] }),
|