@michengai/dsh-archive-manager 0.1.41 → 0.1.43

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/CHANGELOG.md CHANGED
@@ -4,6 +4,30 @@
4
4
 
5
5
  Published release notes are retained below; new versions are added without removing earlier entries.
6
6
 
7
+ ## Unreleased
8
+
9
+ ## 0.1.43 - 2026-09-16
10
+
11
+ - Disable the official DSH 0.1.6+ Archived sessions settings plugin (`ui-settings-unarchive-sessions`) on install, so only this plugin's archive manager remains in Settings.
12
+ - Declare DeepSeek Harness `0.1.6-alpha.1` in the DSH peer range and pin development dependencies to `0.1.6-alpha.1`. Host `workspace` and `session-projection-cache` remain replaced so batch archive and permanent delete keep working.
13
+ - Treat unknown session ids as a no-op on archive and unarchive: skip them instead of throwing `UNKNOWN_SESSION`, and drop orphan archive markers on restore.
14
+ - Opening the archived-sessions page drops an archive id from the durable set only when `persistence.stat` confirms the transcript is gone. Unreadable headers stay archived and are omitted from the visible metadata list. Hosts without `stat` do not persist-drop.
15
+ - Batch archive and restore run serially and can succeed in part: a later failure leaves earlier changes written and shows the error. DSH 0.1.6+ success counts come from the official workspace snapshot and can lag; older hosts use the plugin remote archive set.
16
+ - Treat missing sessions the same on delete as on archive: clean leftover traces without throwing `UNKNOWN_SESSION`.
17
+ - Register the archive sidebar without waiting for official `uiWorkspace`, so the session menu is not stuck on the official three-item archive menu on DSH 0.1.6.
18
+ - Bind archived-session navigation after official `uiWorkspace` is ready so Open session is not immediately cleared.
19
+ - Restore and open now aborts in-flight workspace navigation and reveals the original group, then unarchives and opens. A selected workspace can still be collapsed. If open fails after restore, the settings page stays on Unarchived.
20
+ - While a session remains archived, missing path-index entries are not pruned from workspace accounting. Unarchive reindexes by cwd and re-attaches if needed. Live unarchived membership filtering is unchanged.
21
+ - Settings and sidebar batch archive now call official `archiveSession` serially instead of the plugin `archiveSessions` channel.
22
+ - Batch restore still calls single-session unarchive serially. DSH 0.1.6+ uses official `ctx.workspaces.unarchiveSession`; older hosts fall back to this plugin's `workspaceRegistry.unarchiveSession`. Unused plugin batch `archiveSessions` / `archiveWorkspaceSessions` / `unarchiveSessions` endpoints and client sync helpers are removed.
23
+ - Copy existing sidebar grouping, expansion, and sort prefs from `dsh.workspace.view.v5` onto `dsh.archive-manager.workspace.view.v1` once, so the persist-key split does not reset them.
24
+
25
+ ## 0.1.42 - 2026-09-14
26
+
27
+ - Add Archived / Unarchived tabs with Archived selected by default. Select sessions across projects for batch archiving, or archive all chats in a project or ungrouped section from its menu.
28
+ - Unify session action labels and make batch archive buttons and menu actions easier to identify. Keep the confirmation dialog open with an error on archive failure for direct retries, and clear stale feedback.
29
+ - Add the Typert `workspaceRegistry/archiveSessions` endpoint accepting `{ sessionIds: string[] }` to archive sessions across projects, with deduplication, idempotency, and whole-batch rejection for invalid sessions.
30
+
7
31
  ## 0.1.41 - 2026-09-14
8
32
 
9
33
  - Improve the archived-session bulk action bar with grouped selection details and actions, fixing wrapped button labels in narrow content areas.
@@ -4,6 +4,30 @@
4
4
 
5
5
  以下发布说明会持续保留;新增版本时不再删除较早记录。
6
6
 
7
+ ## Unreleased
8
+
9
+ ## 0.1.43 - 2026-09-16
10
+
11
+ - 安装时禁用 DSH 0.1.6+ 官方「已归档会话」设置页(`ui-settings-unarchive-sessions`),设置里只保留本插件的归档管理入口。
12
+ - DSH peer 范围纳入 `0.1.6-alpha.1`,开发依赖固定到同一版本。仍替换官方 `workspace` 与 `session-projection-cache`,以保留批量归档和永久删除。
13
+ - 归档和恢复遇到未知 id 都不再抛 `UNKNOWN_SESSION`:跳过不存在的会话,恢复时清掉孤儿归档标记。
14
+ - 打开归档列表时,只有 `persistence.stat` 确认转录已不在才从持久集合摘掉 id。头部读不出的归档仍保留,只是不出现在本次元数据里。没有 `stat` 的宿主不落盘删除。
15
+ - 批量归档和批量恢复都是串行执行,可以为部分成功:中途失败会留下已经改掉的部分,并显示错误。DSH 0.1.6+ 的成功计数取自官方工作区快照,可能滞后;更早宿主用插件 remote 返回的归档集合。
16
+ - 删除与归档对失踪会话同一套逻辑:清掉残留痕迹,不抛 `UNKNOWN_SESSION`。
17
+ - 侧栏不再等待官方 `uiWorkspace` 才注册,避免 0.1.6 上官方三项菜单一直占着、删除进不来。
18
+ - 打开归档会话改为在官方 `uiWorkspace` 就绪后再适配 `clearArchivedCurrent`,避免点「打开会话」被官方立刻清掉。
19
+ - 「恢复并打开」先中止其他工作区正在进行的导航并展开原分组,再恢复并打开;打开失败则留在未归档列表。选中工作区仍可折叠。
20
+ - 仍在归档集合中、但路径索引缺失的记账,恢复前不被官方 mutate 写丢;恢复时按 cwd 重新编入索引,必要时挂回原工作区。不改未归档会话的官方成员过滤。
21
+ - 设置页与侧栏批量归档改为串行调用官方 `archiveSession`,不再走插件 `archiveSessions` 通道。
22
+ - 批量恢复仍串行调用单条恢复。DSH 0.1.6+ 走官方 `ctx.workspaces.unarchiveSession`;更早宿主回退到本插件一直提供的 `workspaceRegistry.unarchiveSession`。删除插件批量 `archiveSessions`、`archiveWorkspaceSessions`、`unarchiveSessions` 以及已无调用方的客户端同步辅助方法。
23
+ - 换 persist 键时把已有的分组/展开/排序偏好从 `dsh.workspace.view.v5` 迁到 `dsh.archive-manager.workspace.view.v1`,避免老用户侧栏偏好被静默重置。
24
+
25
+ ## 0.1.42 - 2026-09-14
26
+
27
+ - 新增「已归档 / 未归档」页签,默认展示已归档;支持跨项目选择会话批量归档,也可通过项目或未分组菜单归档该组全部聊天。
28
+ - 统一会话操作文案,提升批量归档按钮与菜单的辨识度;归档失败时保留确认框并显示错误,可直接重试,同时清理过期提示。
29
+ - 新增 Typert `workspaceRegistry/archiveSessions` 接口,接受 `{ sessionIds: string[] }` 批量归档跨项目会话,支持去重与幂等,无效会话导致整批拒绝。
30
+
7
31
  ## 0.1.41 - 2026-09-14
8
32
 
9
33
  - 优化归档会话的批量操作栏:选择摘要与操作分组显示,修复窄内容区内按钮文字折行的问题。
package/README.md CHANGED
@@ -40,7 +40,7 @@ Find, restore, and clean up chats in **Settings → Archived sessions**:
40
40
  ## Prerequisites
41
41
 
42
42
  - A working [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web installation with `dsh` available in your terminal.
43
- - Supported DSH versions: `0.1.0-rc.8`, `0.1.1-rc.2`, `0.1.2-rc.1`, `0.1.5-rc.1`, and `0.1.5-rc.2`. Other versions are not currently supported.
43
+ - Supported DSH versions: `0.1.0-rc.8`, `0.1.1-rc.2`, `0.1.2-rc.1`, `0.1.5-rc.1`, `0.1.5-rc.2`, and `0.1.6-alpha.1`. Other versions are not currently supported.
44
44
  - Node.js matching `^22.19.0 || >=24.0.0`. Source installation also requires pnpm.
45
45
 
46
46
  ## Installation
@@ -76,16 +76,22 @@ Restart DSH Web, then hard-refresh your browser with `Ctrl+Shift+R`. Open **Sett
76
76
  | Archive a workspace | Open the workspace menu and choose the option to archive its chats |
77
77
  | Find an archive | Open **Settings → Archived sessions**, then search titles or filter by project |
78
78
  | Change the order | Sort by update time, creation time, or title |
79
- | Restore one chat | Click **Unarchive** beside the session |
79
+ | Restore one chat | Click **Restore** beside the session |
80
+ | Archive a project or ungrouped chats | On **Unarchived**, open the group’s **…** menu and confirm archiving all chats in that group, regardless of search filters |
81
+ | Archive across projects | Switch to **Unarchived**, select sessions across projects, then click **Archive** and confirm |
80
82
  | Restore or delete in bulk | Select chats and use the bulk actions, or use the project menu or page-wide actions |
81
83
 
82
- Selections persist when filters change. Check the hidden selection count before applying bulk actions, or clear your selection first.
84
+ The page opens on **Archived**, with **Unarchived** on the right. Switching tabs clears selections; changing search or project filters preserves them. Check the hidden selection count before applying bulk actions, or clear your selection first.
85
+
86
+ **Restore all / Delete all** remain on the Archived tab and apply to archived sessions across all projects, regardless of filters. Unarchived excludes subagents and blank placeholders and supports sorting by update time or title.
87
+
88
+ Settings and sidebar batch archive/restore call the single-session APIs serially: official `ctx.workspaces.archiveSession` on every supported host, official `ctx.workspaces.unarchiveSession` on DSH 0.1.6+, and this plugin's `workspaceRegistry.unarchiveSession` on older hosts.
83
89
 
84
90
  ### View and continue archived conversations
85
91
 
86
92
  Available starting with `0.1.40`:
87
93
 
88
- - **View conversation**: open the native DSH session to view messages, attachments, and tool details. Continue chatting while keeping the session archived.
94
+ - **Open session**: open the native DSH session to view messages, attachments, and tool details. Continue chatting while keeping the session archived.
89
95
  - **Restore and open**: unarchive the session and open it to resume work.
90
96
 
91
97
  ## Updates
@@ -105,7 +111,7 @@ $OutputEncoding = [System.Text.Encoding]::UTF8
105
111
  dsh --profile web --dump-config
106
112
  ```
107
113
 
108
- The configuration should include `workspace-archive-manager` and `ui-workspace-archive-manager`. If you previously set the official `ui-workspace` to `disabled: true` in your profile's `cordis.patch.yml`, remove that disabling override and restart.
114
+ The configuration should include `workspace-archive-manager` and `ui-workspace-archive-manager`. On DSH 0.1.6+, official `ui-settings-unarchive-sessions` should be `disabled: true` so Settings keeps only this plugin's Archived sessions page. If you previously set the official `ui-workspace` to `disabled: true` in your profile's `cordis.patch.yml`, remove that disabling override and restart.
109
115
 
110
116
  ### How is archiving different from deletion?
111
117
 
package/README.zh-CN.md CHANGED
@@ -40,7 +40,7 @@
40
40
  ## 前置条件
41
41
 
42
42
  - 已能正常使用 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web,并可在终端运行 `dsh`。
43
- - 当前支持 DSH `0.1.0-rc.8`、`0.1.1-rc.2`、`0.1.2-rc.1`、`0.1.5-rc.1`、`0.1.5-rc.2`;其他版本暂未纳入支持范围。
43
+ - 当前支持 DSH `0.1.0-rc.8`、`0.1.1-rc.2`、`0.1.2-rc.1`、`0.1.5-rc.1`、`0.1.5-rc.2`、`0.1.6-alpha.1`;其他版本暂未纳入支持范围。
44
44
  - Node.js 版本需满足 `^22.19.0 || >=24.0.0`;从源码安装还需要 pnpm。
45
45
 
46
46
  ## 安装
@@ -76,16 +76,22 @@ dsh plugin --profile web add @michengai/dsh-archive-manager@latest --registry=ht
76
76
  | 归档整个工作区 | 打开工作区菜单,选择归档该工作区的会话 |
77
77
  | 查找归档 | 打开「设置 → 归档会话」,搜索标题或按项目筛选 |
78
78
  | 调整排列顺序 | 按更新时间、创建时间或标题排序 |
79
- | 恢复一条会话 | 点击会话右侧的「取消归档」 |
79
+ | 恢复一条会话 | 点击会话右侧的「恢复」 |
80
+ | 归档某个项目或未分组 | 在「未归档」页点击分组右侧“…”菜单,确认归档该组全部聊天;不受搜索筛选影响 |
81
+ | 跨项目批量归档 | 切换到「未归档」,跨项目勾选会话后点击「归档」并确认 |
80
82
  | 批量恢复或删除 | 勾选会话后使用批量操作;也可使用项目菜单或页面顶部的全部操作 |
81
83
 
82
- 切换筛选条件会保留已选会话。批量操作前留意隐藏的已选数量,或先清空选择。
84
+ 页面默认打开「已归档」,右侧「未归档」用于批量归档。切换 TAB 会清空选择;切换搜索或项目筛选会保留已选会话。批量操作前留意隐藏的已选数量,或先清空选择。
85
+
86
+ 「全部恢复 / 全部删除」仅在已归档页显示,作用于所有项目的归档会话,不受筛选影响。未归档页排除子代理和空白占位会话,支持按更新时间或标题排序。
87
+
88
+ 设置页与侧栏的批量归档、批量恢复均串行调用单条接口:归档在所有支持的宿主走官方 `ctx.workspaces.archiveSession`;恢复在 DSH 0.1.6+ 走官方 `ctx.workspaces.unarchiveSession`,更早宿主回退到本插件的 `workspaceRegistry.unarchiveSession`。
83
89
 
84
90
  ### 查看并继续归档对话
85
91
 
86
92
  从 `0.1.40` 起支持以下操作:
87
93
 
88
- - **查看对话**:打开 DSH 原生会话页,查看消息、附件和工具详情;可直接继续聊天,保持归档状态。
94
+ - **打开会话**:打开 DSH 原生会话页,查看消息、附件和工具详情;可直接继续聊天,保持归档状态。
89
95
  - **恢复并打开**:取消归档后进入原会话,继续工作。
90
96
 
91
97
  ## 更新
@@ -105,7 +111,7 @@ $OutputEncoding = [System.Text.Encoding]::UTF8
105
111
  dsh --profile web --dump-config
106
112
  ```
107
113
 
108
- 配置中应包含 `workspace-archive-manager` 和 `ui-workspace-archive-manager`。若曾在 profile 的 `cordis.patch.yml` 中手动将官方 `ui-workspace` 设为 `disabled: true`,请移除该禁用覆盖,再重启。
114
+ 配置中应包含 `workspace-archive-manager` 和 `ui-workspace-archive-manager`。DSH 0.1.6+ 上官方 `ui-settings-unarchive-sessions` 应为 `disabled: true`,设置里只保留本插件的「归档会话」。若曾在 profile 的 `cordis.patch.yml` 中手动将官方 `ui-workspace` 设为 `disabled: true`,请移除该禁用覆盖,再重启。
109
115
 
110
116
  ### 归档和删除有什么区别?
111
117
 
package/cordis.patch.yml CHANGED
@@ -1,10 +1,17 @@
1
1
  # 保留官方工作区 UI,仅替换归档需要的后端服务。
2
2
  # 自定义侧栏通过优先级覆盖插槽;发布后的安装命令:
3
3
  # dsh plugin --profile web add @michengai/dsh-archive-manager
4
+ #
5
+ # workspace / session-projection-cache:宿主注册表与投影缓存,不是设置页。
6
+ # 换成本插件子类,才能加批量归档、永久删除和安全缓存域。
7
+ # ui-settings-unarchive-sessions:DSH 0.1.6+官方「已归档会话」设置页,只能单条恢复;
8
+ # 禁用后只保留本插件的归档管理入口。旧宿主没有该 id 时补丁被忽略。
4
9
  - id: workspace
5
10
  disabled: true
6
11
  - id: session-projection-cache
7
12
  disabled: true
13
+ - id: ui-settings-unarchive-sessions
14
+ disabled: true
8
15
  - id: ui-workspace
9
16
  disabled: false
10
17
  - insert:
@@ -9,11 +9,15 @@ function formatArchiveNavigationError(error, t) {
9
9
  return error instanceof ArchiveNavigationError ? t(`archives.${error.code}`) : String(error?.message ?? error);
10
10
  }
11
11
  async function openArchivedConversation(actions, sessionId, restore, isActive = () => true) {
12
- if (restore) await actions.restore(sessionId);
12
+ if (restore) {
13
+ if (typeof actions.prepare === "function") await actions.prepare(sessionId);
14
+ if (!isActive()) return;
15
+ await actions.restore(sessionId);
16
+ }
13
17
  if (isActive()) await actions.open(sessionId);
14
18
  }
15
19
  function allowArchivedNavigation(navigation, sessions, workspaces, { onOpened = () => {
16
- }, warn = (...args) => console.warn(...args) } = {}) {
20
+ }, beginNavigation, warn = (...args) => console.warn(...args) } = {}) {
17
21
  let allowed;
18
22
  const original = navigation?.clearArchivedCurrent;
19
23
  const descriptor = navigation && Object.getOwnPropertyDescriptor(navigation, "clearArchivedCurrent");
@@ -40,6 +44,7 @@ function allowArchivedNavigation(navigation, sessions, workspaces, { onOpened =
40
44
  warn("archive-manager: \u5F52\u6863\u5BFC\u822A\u9002\u914D\u4E0D\u53EF\u7528\u6216\u5DF2\u88AB\u66FF\u6362\u3002");
41
45
  throw new ArchiveNavigationError("navigationUnavailable");
42
46
  }
47
+ beginNavigation?.();
43
48
  sessions.open(id);
44
49
  if (sessions.list.getSnapshot().current !== id) {
45
50
  warn("archive-manager: \u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\u3002", { cleanupAvailable: typeof original === "function" });