dsh-sessions-manager 3.5.0 → 3.5.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.en.md +2 -4
- package/README.md +2 -4
- package/lib/client.js +18 -4
- package/lib/client.js.map +2 -2
- package/lib/index.js +92 -29
- package/lib/index.js.map +3 -3
- package/package.json +1 -1
- package/src/client/index.jsx +16 -7
- package/src/client/logic.js +8 -0
- package/src/index.js +26 -5
- package/src/zstd-frame.js +68 -34
package/README.en.md
CHANGED
|
@@ -12,9 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
> DSH session manager: archive, move, restore, and inspect sessions from **Settings → 会话管理**; mark unread, move, and delete sessions directly from the **main sidebar**. Deleted sessions go to the recycle bin first and can be restored or permanently purged.
|
|
14
14
|
|
|
15
|
-
A persistent DSH plugin (host + browser halves)
|
|
16
|
-
|
|
17
|
-
v3.5.0 adds a two-generation DSH persistence adapter. It understands both legacy header lists/`readFrom` and the new snapshot/`SessionHandle` API, and reports action-level capabilities to the UI. When a runtime has no verified safe purge or migration path, the corresponding controls explain why they are disabled and the Host rejects direct calls, preventing false success messages.
|
|
15
|
+
A persistent DSH plugin (host + browser halves) covering both the **settings panel** and the **main sidebar**, so frequent session actions don't require opening Settings. It understands both legacy header lists/`readFrom` and the new snapshot/`SessionHandle` API, enabling actions according to the current Runtime's verified capabilities. Unverified purge or migration paths are disabled in both UI and Host to prevent false success.
|
|
18
16
|
|
|
19
17
|
## Features
|
|
20
18
|
|
|
@@ -45,7 +43,7 @@ A small dot is rendered to the left of each session row. Its color is driven by
|
|
|
45
43
|
| Color | State | Description |
|
|
46
44
|
|---|---|---|
|
|
47
45
|
| 🔵 Blue | Manually marked unread | Toggle via the ⋯ menu or by clicking the dot; auto-cleared when the session is opened |
|
|
48
|
-
| 🟡 Yellow | Working | The session is currently running (`running`) |
|
|
46
|
+
| 🟡 Yellow | Working | The session is currently running (`ongoing`, with legacy `running` compatibility) |
|
|
49
47
|
| 🟠 Amber | Awaiting feedback | The session has a follow-up question and is waiting for your input or confirmation (`warning`) |
|
|
50
48
|
| 🟢 Green | Completed but unread | The session is done (`done`) but you haven't reopened it yet; disappears after you view it |
|
|
51
49
|
| 🔴 Red | Error / needs attention | The session hit an error (`error`) |
|
package/README.md
CHANGED
|
@@ -12,9 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
> DSH 会话管理器:在**设置 → 会话管理**里统一归档、移动、恢复、查看详情;在**主页侧边栏**直接标记未读、移动、删除会话。删除先进入回收站,可恢复或彻底清理。
|
|
14
14
|
|
|
15
|
-
一个 DSH 持久化插件(host + browser
|
|
16
|
-
|
|
17
|
-
v3.5.0 新增 DSH 双代持久化适配:同时识别旧式 header 列表/`readFrom` 与新版 snapshot/`SessionHandle`,并向界面报告每项操作的实际能力。当前 Runtime 没有经过验证的安全删除或迁移路径时,相关按钮会显示禁用原因,Host 也会拒绝调用,避免出现“提示成功但日志没有删除/移动”的假成功。
|
|
15
|
+
一个 DSH 持久化插件(host + browser 双半),同时覆盖「设置面板」与「主页侧边栏」两个入口,无需打开设置即可完成高频会话操作。插件同时识别旧式 header 列表/`readFrom` 与新版 snapshot/`SessionHandle`,并按当前 Runtime 的实际能力启用安全操作;尚未验证的删除或迁移路径会在界面与 Host 端同步禁用,避免假成功。
|
|
18
16
|
|
|
19
17
|
## 功能
|
|
20
18
|
|
|
@@ -45,7 +43,7 @@ v3.5.0 新增 DSH 双代持久化适配:同时识别旧式 header 列表/`read
|
|
|
45
43
|
| 颜色 | 状态 | 说明 |
|
|
46
44
|
|---|---|---|
|
|
47
45
|
| 🔵 蓝 | 手动标记未读 | 通过 ⋯ 菜单或点击圆点手动标记;进入会话后自动清除 |
|
|
48
|
-
| 🟡 黄 | 工作中 |
|
|
46
|
+
| 🟡 黄 | 工作中 | 会话正在运行(新版 `ongoing`,兼容旧版 `running`) |
|
|
49
47
|
| 🟠 琥珀 | 等待反馈 | 会话有追问,需要用户输入或确认(`warning`) |
|
|
50
48
|
| 🟢 绿 | 完成后未读 | 会话已完成(`done`)但你还没重新打开看过;看过一次后不再显示 |
|
|
51
49
|
| 🔴 红 | 出错 / 需关注 | 会话遇到错误(`error`) |
|
package/lib/client.js
CHANGED
|
@@ -40,6 +40,7 @@ var import_react = __toESM(require("react"), 1);
|
|
|
40
40
|
function dotStateFor({ manualUnread = false, dataState = "", isActive = false } = {}) {
|
|
41
41
|
if (manualUnread) return "manual";
|
|
42
42
|
switch (dataState) {
|
|
43
|
+
case "ongoing":
|
|
43
44
|
case "running":
|
|
44
45
|
return "running";
|
|
45
46
|
case "warning":
|
|
@@ -52,6 +53,10 @@ function dotStateFor({ manualUnread = false, dataState = "", isActive = false }
|
|
|
52
53
|
return null;
|
|
53
54
|
}
|
|
54
55
|
}
|
|
56
|
+
function authoritativeTitleForFirstPaint({ firstPaint = false, rendered = "", authoritative = "" } = {}) {
|
|
57
|
+
if (!firstPaint || !authoritative || rendered === authoritative) return null;
|
|
58
|
+
return authoritative;
|
|
59
|
+
}
|
|
55
60
|
function canDropOnWorkspace(item, target) {
|
|
56
61
|
if (!item || !target) return false;
|
|
57
62
|
if (item.workspacePath && target.path === item.workspacePath) return false;
|
|
@@ -1282,7 +1287,7 @@ var SIDEBAR_AUG_CSS = `
|
|
|
1282
1287
|
.dsm-sub-cur{font-size:11px;color:var(--dsw-alias-state-business-primary);flex:none;margin-left:8px}
|
|
1283
1288
|
.dsm-dot{position:absolute;left:6px;top:50%;transform:translateY(-50%);width:8px;height:8px;border-radius:50%;box-sizing:border-box;cursor:pointer;pointer-events:auto;z-index:1}
|
|
1284
1289
|
.dsm-dot-unread-manual{background:var(--dsw-alias-state-business-primary)}
|
|
1285
|
-
.dsm-dot-waiting{background:var(--dsw-alias-state-
|
|
1290
|
+
.dsm-dot-waiting{background:var(--dsw-alias-state-warn-primary,#F59E0B)}
|
|
1286
1291
|
.dsm-dot-unread{background:var(--dsw-alias-state-success-primary)}
|
|
1287
1292
|
.dsm-drag-source{opacity:.48}
|
|
1288
1293
|
.dsm-drop-target{position:relative;background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 10%,transparent)!important;outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px;border-radius:8px}
|
|
@@ -1675,7 +1680,7 @@ function installSidebarStatusDots() {
|
|
|
1675
1680
|
// 蓝 手动标记未读
|
|
1676
1681
|
running: "#EAB308",
|
|
1677
1682
|
// 黄 工作中 (DSH running)
|
|
1678
|
-
feedback: "var(--dsw-alias-state-
|
|
1683
|
+
feedback: "var(--dsw-alias-state-warn-primary, #F59E0B)",
|
|
1679
1684
|
// 琥珀 需用户反馈 (DSH warning)
|
|
1680
1685
|
done: "var(--dsw-alias-state-success-primary)",
|
|
1681
1686
|
// 绿 完成后未读 (DSH done)
|
|
@@ -1683,6 +1688,7 @@ function installSidebarStatusDots() {
|
|
|
1683
1688
|
// 红 出错/需关注 (DSH error)
|
|
1684
1689
|
};
|
|
1685
1690
|
const manualUnread = dsmLoadManual();
|
|
1691
|
+
const titleInitializedRows = /* @__PURE__ */ new WeakSet();
|
|
1686
1692
|
const paint = () => {
|
|
1687
1693
|
const activeId = activeRowId();
|
|
1688
1694
|
if (activeId !== curActive && activeId && manualUnread.has(activeId)) {
|
|
@@ -1703,12 +1709,20 @@ function installSidebarStatusDots() {
|
|
|
1703
1709
|
}
|
|
1704
1710
|
if (row.style.display === "none") row.style.display = "";
|
|
1705
1711
|
const authoritativeTitle = dsmAuthoritativeTitles.get(id);
|
|
1706
|
-
if (
|
|
1712
|
+
if (!titleInitializedRows.has(row)) {
|
|
1707
1713
|
const node = rowNode(row) || {};
|
|
1708
1714
|
const expected = new Set([node.title, node.displayTitle, node.name].filter((value) => typeof value === "string"));
|
|
1709
1715
|
const spans = [...row.children].filter((el) => el.tagName === "SPAN" && !el.querySelector("[data-state]") && (el.textContent || "").trim());
|
|
1710
1716
|
const titleEl = spans.find((el) => expected.has((el.textContent || "").trim())) || spans[0];
|
|
1711
|
-
if (titleEl
|
|
1717
|
+
if (titleEl) {
|
|
1718
|
+
const correction = authoritativeTitleForFirstPaint({
|
|
1719
|
+
firstPaint: true,
|
|
1720
|
+
rendered: titleEl.textContent || "",
|
|
1721
|
+
authoritative: authoritativeTitle || ""
|
|
1722
|
+
});
|
|
1723
|
+
if (correction) titleEl.textContent = correction;
|
|
1724
|
+
titleInitializedRows.add(row);
|
|
1725
|
+
}
|
|
1712
1726
|
}
|
|
1713
1727
|
const sd = row.querySelector("[data-state]");
|
|
1714
1728
|
if (sd) sd.style.display = "none";
|