dsh-sessions-manager 3.7.1 → 3.7.3

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 CHANGED
@@ -20,7 +20,7 @@ A persistent DSH plugin (host + browser halves) covering both the **settings pan
20
20
 
21
21
  - **Unified panel**: three always-visible top-level views — **All / Active / Archived** — while the low-frequency ones (**Starred / Empty / Recycle bin**) are tucked behind an arrow button at the end of the filter row and slide out horizontally on click (they stay expanded automatically while a low-frequency view is selected). Search across title, session ID, and workspace, plus workspace filters and creation-time/title sorting. The result line is a single sentence such as "Showing 5 sessions, 4 more subagents folded under their parents". A maintenance row below the filters holds the **Storage usage**, **Manage tags** and **Auto-archive** tools, which expand on demand instead of taking up a view.
22
22
  - **Starred sessions**: an always-visible star button on each session row toggles starring optimistically with rollback on failure; the Starred view is orthogonal to DSH's active/archived states and they stack. The star index is plugin-owned (schema v3) and never touches DSH logs; stars are cleaned up automatically when a session is permanently purged.
23
- - **Tags & saved filters**: label sessions with custom tags (up to 200 global, 10 per session; rename, merge, delete — **deleting a tag never touches the sessions**), filter the list by tag, and save the current "view + workspace + sort + tag" combination as a preset (up to 20) for one-click reuse. Tags and presets live in plugin-owned indexes (same discipline as the star index) inside this machine's DSH data directory — they do not follow your account; cross-machine migration belongs to the 3.10.0 backup scope.
23
+ - **Tags & saved filters**: label sessions with custom tags (up to 200 global, 10 per session; rename, merge, delete — **deleting a tag never touches the sessions**), filter the list by tag, and save the current "view + workspace + sort + tag" combination as a preset (up to 20) for one-click reuse. Tags and presets live in plugin-owned indexes (same discipline as the star index) inside this machine's DSH data directory — they do not follow your account.
24
24
  - **Cold-title synchronization**: the sidebar is corrected from the latest log-backed `session/title`, so renamed cold sessions no longer need to be opened before showing their current name. On cold starts of large stores a title that is not ready yet simply renders blank while it fills in the background — and once it arrives, **rows already on screen and the “⑂ branch” chip's tooltip update automatically**, no page rebuild needed.
25
25
  - **Sidebar workspace drag-and-drop**: drag a session onto a workspace heading to move it, with a highlighted drop target, same-workspace protection, failure feedback, and the More → Move session menu retained for keyboard access.
26
26
  - **Archive / Restore**: archive hides a session from the sidebar; restore unarchives it and puts it back into its original workspace group.
@@ -83,13 +83,14 @@ So held-open sessions get **deferred (queued) moves**:
83
83
  - **Results are no longer silent**: a background completion or a final give-up (5 consecutive non-lock failures) becomes a persisted notice, surfaced as a toast the next time a DSH page is open (give-ups include the reason). Notices stay on the server until acknowledged (up to 20, at most 7 days) — closing the page before the toast never loses one.
84
84
  - **To actually move an active session**: request the move (it queues), then **restart DSH and don't open that session first** — it completes a few seconds after startup. Pending entries survive restarts.
85
85
 
86
- ### Session format v3 (DSH 0.1.5+)
86
+ ### Session formats v3 / v4 (DSH 0.1.5+ / 0.1.7+)
87
87
 
88
- DSH 0.1.5 upgrades the session log format to **v3**; the runtime performs the migration itself while reading:
88
+ DSH 0.1.5 upgrades the session log format to **v3**, and 0.1.7 upgrades it again to **v4**; the runtime performs the migration itself while reading:
89
89
 
90
- - Migration is **automatic** and **keeps the original files** — so one session directory legitimately holds both `session.v2.jsonl.zstd` and `session.v3.jsonl.zstd`. This plugin always reads the **highest generation**, matching the runtime.
91
- - Migration is **one-way, with no downgrade read**: after upgrading to 0.1.5 and opening sessions, rolling the runtime back makes those sessions unreadable. Back up `~/.dsh/sessions` before a rollback.
92
- - Only **supported** old logs are migrated; unknown events, v2 events already carrying reserved v3 tags, or corrupted data are **refused without any repair**. Such sessions surface as `SessionFormatUnsupportedMigrationError` / `SessionFormatError` on read/move — the plugin cannot repair them and reports the error verbatim.
90
+ - Migration is **automatic** and **keeps the original files** — so one session directory legitimately holds multiple generations side by side (`session.v2.jsonl.zstd` next to higher generations). This plugin always reads the **highest generation**, matching the runtime.
91
+ - Migration is **one-way, with no downgrade read**: after opening sessions on a newer runtime, rolling the runtime back makes those sessions unreadable. Back up `~/.dsh/sessions` before a rollback.
92
+ - Only **supported** old logs are migrated; unknown events or corrupted data are **refused without any repair**. Such sessions surface as `SessionFormatUnsupportedMigrationError` / `SessionFormatError` on read/move — the plugin cannot repair them and reports the error verbatim.
93
+ - **Since 0.1.7 newly created sessions strictly require a v4 header**: from v3.7.2 this plugin re-samples the session header against the current backend's format during cross-workspace moves — sessions created in older formats (v3 and earlier) can be moved again, and the relocated copy lands directly on the current format (verified end-to-end against a real v3 log). Earlier plugin versions fail to move such sessions on 0.1.7.
93
94
 
94
95
  ## Screenshots
95
96
 
@@ -209,7 +210,8 @@ lib/client.js pre-built client (ModuleLoader CJS handshake)
209
210
  - Peer dependencies are listed in `package.json`; `react` and `@deepseek-ai/*` are provided by the DSH runtime.
210
211
  - `0.1.2-rc.1`: the existing read, archive, recycle-bin, permanent-purge, and cross-workspace move paths remain available.
211
212
  - `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.
212
- - `0.1.5-rc.1` / `0.1.5-rc.2` (current runtimes; the two are byte-identical across every API this plugin uses, 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).
213
+ - `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).
214
+ - `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).
213
215
  - Unverified future runtimes expose only capabilities the plugin can safely identify; method presence alone is not presented as behavioral compatibility.
214
216
 
215
217
  ### Behavior differences and degradations on the SessionHandle era (`0.1.3+`)
package/README.md CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  - **统一面板**:顶部提供「全部 / 活动 / 已归档」三个常驻视图,低频的「已收藏 / 空白 / 回收站」收进行尾的箭头按钮,点按横向滑出展开(低频视图处于选中态时自动保持展开);支持按标题、会话 ID、工作区搜索,按工作区筛选,并按创建时间或标题排序。结果行合并为一句说明,如「显示 5 个会话,另有 4 个子代理折叠在父会话下」。筛选栏下方的维护栏收纳「存储占用」「标签管理」「自动归档」等按需展开的面板级工具,不占用视图位置。
22
22
  - **收藏(星标)**:会话行左侧常驻星标按钮,单击即收藏 / 取消(乐观更新、失败回滚);「已收藏」视图与 DSH 的活动 / 归档状态正交、可叠加;收藏索引为插件自有 schema v3,不触碰 DSH 日志,会话被彻底删除时自动清理。
23
- - **标签与保存筛选**:给会话贴自定义标签(全局 ≤200、单会话 ≤10;支持重命名、合并、删除——**删除标签只删标签,绝不触碰会话**),并按标签筛选列表;「视图 + 工作区 + 排序 + 标签」的组合可保存为筛选预设(≤20 条)一键应用。标签与预设存在插件自有索引里(同星标索引纪律),跟随这台机器的 DSH 数据目录、不跟账号走——换机迁移属 3.10.0 备份范围。
23
+ - **标签与保存筛选**:给会话贴自定义标签(全局 ≤200、单会话 ≤10;支持重命名、合并、删除——**删除标签只删标签,绝不触碰会话**),并按标签筛选列表;「视图 + 工作区 + 排序 + 标签」的组合可保存为筛选预设(≤20 条)一键应用。标签与预设存在插件自有索引里(同星标索引纪律),跟随这台机器的 DSH 数据目录、不跟账号走。
24
24
  - **冷态标题同步**:侧栏使用日志中最新的 `session/title` 修正冷启动缓存,改名后的会话无需先打开即可显示新名称;冷启动大库里标题先留空、后台分批补齐,补齐后**已经在屏幕上的侧栏行和「⑂ 分支」标记的悬停说明会跟着自动更新**,不必等页面重建。
25
25
  - **侧栏跨工作区拖拽**:直接把会话拖到目标工作区标题即可切换工作区;目标高亮、同工作区拦截、失败反馈,并保留“更多 → 移动会话”作为键盘操作入口。
26
26
  - **归档 / 恢复**:归档把会话从侧栏隐藏;恢复取消归档并放回原工作区分组。
@@ -83,13 +83,14 @@ DSH(0.1.5 起)给每个会话日志加了**单写者锁**:会话一旦被
83
83
  - **结果不再静默**:后台完成或最终放弃(连续 5 次非占用失败)会落成通知,下次打开 DSH 页面时以提示弹出(放弃类附原因)。通知在服务端保留到确认展示(最多 20 条、最长 7 天),没弹就不会丢。
84
84
  - **要真正搬走一个活跃会话**:先发起移动(进队列),再**重启 DSH 并先别打开那个会话**——启动后几秒内会自动完成。未完成的项跨重启保留,不会丢。
85
85
 
86
- ### 关于会话格式 v3(DSH 0.1.5+)
86
+ ### 关于会话格式 v3 / v4(DSH 0.1.5+ / 0.1.7+)
87
87
 
88
- DSH 0.1.5 把会话日志格式升级到 **v3**,由 runtime 自己在读取时完成迁移:
88
+ DSH 0.1.5 把会话日志格式升级到 **v3**,0.1.7 再升到 **v4**,均由 runtime 自己在读取时完成迁移:
89
89
 
90
- - 迁移是**自动**的,且**保留原文件**——所以同一个会话目录里会同时出现 `session.v2.jsonl.zstd` 与 `session.v3.jsonl.zstd`,属官方预期行为;本插件始终按**最高代**读取,与官方一致。
91
- - 迁移**单向、不支持降级读取**:升级到 0.1.5 并打开过会话之后,把 runtime 回滚到旧版本会导致那些会话无法读取。回滚前请先备份 `~/.dsh/sessions`。
92
- - 官方只迁移**受支持的旧日志**;遇到未知事件、已带 v3 预留标记的 v2 事件或损坏数据会**拒绝迁移且不做任何修复**。这类会话在插件里会表现为读取/移动报 `SessionFormatUnsupportedMigrationError` / `SessionFormatError`——插件无法代修,只能如实报错(可先确认该会话是否确实异常,再决定保留或删除)。
90
+ - 迁移是**自动**的,且**保留原文件**——所以同一个会话目录里可能同时出现 `session.v2.jsonl.zstd` 与更高代的 `session.vN.jsonl.zstd`,属官方预期行为;本插件始终按**最高代**读取,与官方一致。
91
+ - 迁移**单向、不支持降级读取**:升级并打开过会话之后,把 runtime 回滚到旧版本会导致那些会话无法读取。回滚前请先备份 `~/.dsh/sessions`。
92
+ - 官方只迁移**受支持的旧日志**;遇到未知事件或损坏数据会**拒绝迁移且不做任何修复**。这类会话在插件里会表现为读取/移动报 `SessionFormatUnsupportedMigrationError` / `SessionFormatError`——插件无法代修,只能如实报错(可先确认该会话是否确实异常,再决定保留或删除)。
93
+ - **0.1.7 起新建会话严格要求 v4 头部**:本插件自 v3.7.2 起在跨工作区移动时自动按当前后端的格式重新采样会话头——旧格式(v3 及更早)会话可以正常移动,且移动后的副本直接落在当前格式(已用真实 v3 旧日志端到端实测)。更早的插件版本在 0.1.7 上移动旧格式会话会失败。
93
94
 
94
95
  ## 截图
95
96
 
@@ -209,8 +210,9 @@ lib/client.js 预构建 client(ModuleLoader CJS handshake)
209
210
  - peerDependencies 见 `package.json`;`react`、`@deepseek-ai/*` 由 DSH 运行时提供。
210
211
  - `0.1.2-rc.1`:现有读取、归档、回收站、永久删除和跨工作区移动能力保持可用。
211
212
  - `0.1.3-alpha.1`:支持 snapshot 列表和 `SessionHandle` 只读流程;永久删除与跨工作区移动经由守卫式路径推导 + 写所有权探测开放(见下文),无法安全验证时自动禁用,其余管理能力不受影响。能力以面板实际提示为准。
212
- - `0.1.5-rc.1` / `0.1.5-rc.2`(当前 runtime,两版对本插件的接口逐字节一致,已分别实测):会话日志格式升级到 **v3**,本插件已适配——按**最高代**读取(与官方一致)、v0/v2/v3 多代共存、跟随 `SessionHandle.read()` 的新返回结构
213
+ - `0.1.5-rc.1` / `0.1.5-rc.2`(已实测):会话日志格式升级到 **v3**,本插件已适配——按**最高代**读取(与官方一致)、v0/v2/v3 多代共存、跟随 `SessionHandle.read()` 的新返回结构
213
214
  (`{ eventState, events }`)、跨工作区移动按**整目录搬运**并自动回收被取代的旧代副本;被 DSH 打开着的会话改为**排队延迟移动**(见上文「移动活跃会话」)。
215
+ - `0.1.7-rc.2`(已实测):会话格式再升 **v4**,格式版本目录拆分到独立包;本插件已适配——读取走官方自动迁移,跨工作区移动自动按后端当前格式重采样会话头(旧格式会话可正常移动,落盘即当前格式)。
214
216
  - 未经验证的未来 Runtime 默认只开放能够识别的安全能力;插件不会用方法存在与否冒充行为兼容。
215
217
 
216
218
  ### 新版 Runtime(SessionHandle 世代,`0.1.3+`)的行为差异与降级说明
package/lib/client.js CHANGED
@@ -543,7 +543,39 @@ async function postJSON(path, body) {
543
543
  var dsmClientCtx = null;
544
544
  function dsmSessionsService() {
545
545
  try {
546
- return dsmClientCtx && typeof dsmClientCtx.get === "function" ? dsmClientCtx.get("sessions") : null;
546
+ if (!dsmClientCtx || typeof dsmClientCtx.get !== "function") return null;
547
+ const native = dsmClientCtx.get("sessions");
548
+ if (native && (typeof native.open === "function" || typeof native.openSubagent === "function")) return native;
549
+ const ui = dsmClientCtx.get("uiWorkspace");
550
+ if (!ui || typeof ui.openSession !== "function") return native;
551
+ let lastOpened = null;
552
+ const bridge = {
553
+ open(id) {
554
+ if (id === null || id === void 0) return;
555
+ const target = String(id);
556
+ ui.openSession(target);
557
+ lastOpened = target;
558
+ },
559
+ openSubagent(address) {
560
+ if (address === null || address === void 0) return;
561
+ if (typeof address === "object") {
562
+ ui.openSession(address);
563
+ lastOpened = String(address.childSessionId);
564
+ } else {
565
+ bridge.open(address);
566
+ }
567
+ },
568
+ // 新核心的子代理目录由投影自动维护,无需手动刷新。
569
+ refreshSubagents() {
570
+ }
571
+ };
572
+ Object.defineProperty(bridge, "list", {
573
+ configurable: true,
574
+ get() {
575
+ return { getSnapshot: () => ({ current: lastOpened }) };
576
+ }
577
+ });
578
+ return bridge;
547
579
  } catch (e) {
548
580
  return null;
549
581
  }