dsh-manage-session 0.5.7 → 2.0.4

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.
Files changed (67) hide show
  1. package/CHANGELOG.ja.md +33 -229
  2. package/CHANGELOG.ko.md +33 -229
  3. package/CHANGELOG.md +33 -363
  4. package/INSTALL.ja.md +164 -164
  5. package/INSTALL.ko.md +164 -164
  6. package/INSTALL.md +164 -164
  7. package/INSTALL.zh.md +164 -164
  8. package/LICENSE +21 -21
  9. package/README.en.md +41 -46
  10. package/README.ja.md +33 -57
  11. package/README.ko.md +32 -55
  12. package/README.md +64 -64
  13. package/cordis.patch.yml +19 -16
  14. package/dsh.plugin.json +4 -4
  15. package/lib/client.js +661 -3082
  16. package/lib/index.d.ts +79 -970
  17. package/lib/index.js +249 -2669
  18. package/locale/de.json +2 -2
  19. package/locale/en.json +2 -2
  20. package/locale/es.json +2 -2
  21. package/locale/fr.json +2 -2
  22. package/locale/it.json +2 -2
  23. package/locale/ja.json +2 -2
  24. package/locale/ko.json +2 -2
  25. package/locale/ru.json +2 -2
  26. package/locale/zh.json +2 -2
  27. package/package.json +15 -25
  28. package/screenshots.json +3 -3
  29. package/src/client/bridge-scope.ts +202 -213
  30. package/src/client/card.tsx +154 -154
  31. package/src/client/health-panel.tsx +49 -49
  32. package/src/client/host-api.ts +72 -6
  33. package/src/client/index.ts +594 -503
  34. package/src/client/locales.ts +893 -893
  35. package/src/client/manage-locales.ts +178 -0
  36. package/src/client/{search/manage.tsx → manage.tsx} +430 -404
  37. package/src/client/panel.tsx +131 -129
  38. package/src/client/session-menu-legacy.ts +2 -3
  39. package/src/client/session-menu.tsx +5 -5
  40. package/src/config.ts +43 -99
  41. package/src/host/health/attribution.ts +118 -118
  42. package/src/host/health/lossless.ts +128 -128
  43. package/src/host/health/repair.ts +2 -2
  44. package/src/host/health/source-kind.ts +350 -350
  45. package/src/host/history/archive-source.ts +250 -250
  46. package/src/host/history/archive.ts +249 -249
  47. package/src/host/history/favorites.ts +71 -71
  48. package/src/host/history/purge.ts +370 -370
  49. package/src/host/history/tombstones.ts +3 -3
  50. package/src/host/registry/archive-registry.ts +317 -317
  51. package/src/host/settings-bridge.ts +222 -264
  52. package/src/index.ts +66 -694
  53. package/src/client/search/card.tsx +0 -563
  54. package/src/client/search/host-api.ts +0 -213
  55. package/src/client/search/locales.ts +0 -861
  56. package/src/client/search/locate.ts +0 -330
  57. package/src/client/search/panel.tsx +0 -940
  58. package/src/client/search/platform.ts +0 -136
  59. package/src/host/index/archive-source.ts +0 -90
  60. package/src/host/index/drs-source.ts +0 -211
  61. package/src/host/index/engine.ts +0 -699
  62. package/src/host/index/extract.ts +0 -272
  63. package/src/host/index/peers.ts +0 -62
  64. package/src/host/index/rebuild.ts +0 -432
  65. package/src/host/index/schema.ts +0 -136
  66. package/src/host/index/snapshot.ts +0 -135
  67. package/src/host/index/sync.ts +0 -413
package/INSTALL.zh.md CHANGED
@@ -1,164 +1,164 @@
1
- # 安装指南(官方 DSH CLI)
2
-
3
- 本指南只使用官方 `dsh plugin` 命令。该命令会把依赖装入 profile 并同步 `dsh.profile.bundles`。请勿改用裸 `npm install`、在 profile 里直接 `pnpm add`,或手工编辑 profile 清单。
4
-
5
- - [English installation guide](./INSTALL.md)
6
- - [中文安装指南](./INSTALL.zh.md)
7
- - [日本語インストールガイド](./INSTALL.ja.md)
8
- - [한국어 설치 안내](./INSTALL.ko.md)
9
- - [中文 README](./README.md)
10
- - [English README](./README.en.md)
11
- - [日本語 README](./README.ja.md)
12
- - [한국어 README](./README.ko.md)
13
- - [Changelog](./CHANGELOG.md)
14
- - [日本語 changelog](./CHANGELOG.ja.md)
15
- - [한국어 changelog](./CHANGELOG.ko.md)
16
-
17
- 本指南中的占位符:
18
-
19
- - `<profile>`:要改动的 DSH profile,通常是 `web`;
20
- - `dsh-manage-session`:npm 包名,同时也是运行时插件 ID。
21
-
22
- > **支持的 DSH 范围:`>=0.1.0-rc.6 <0.2.0-0`。**
23
- >
24
- > 该范围同时写在 `package.json` 与 `dsh.plugin.json` 的 `engines.dsh` 中,也与本插件为其 `@deepseek-ai/dsh-client-ui-slots` 依赖已经声明的 `^0.1.0-rc.6` 下界一致。安装前先用 `dsh --version` 确认当前版本。
25
-
26
- ## 0. 前置条件与 profile 探查
27
-
28
- ```bash
29
- echo "DSH_HOME=${DSH_HOME:-$HOME/.dsh}"
30
- dsh --version
31
- ls "${DSH_HOME:-$HOME/.dsh}/profiles"
32
- ```
33
-
34
- 请使用正在运行的 DSH 进程所使用的那个 profile。`web` 很常见,但以实际生效的 `--profile` 参数为准。
35
-
36
- ## 1. 官方安装
37
-
38
- ```bash
39
- dsh plugin --profile <profile> add dsh-manage-session -w
40
- ```
41
-
42
- (当 profile 是 pnpm workspace 根时,如 `web`,`-w` 是必需的。)
43
-
44
- 显式安装指定版本:
45
-
46
- ```bash
47
- dsh plugin --profile <profile> add dsh-manage-session@0.1.0-alpha.6 -w
48
- ```
49
-
50
- 官方 CLI 会自动更新 profile 依赖、锁文件与 `dsh.profile.bundles`。不要手工添加 YAML 行。
51
-
52
- ### 供应链冷却期
53
-
54
- DSH 运行时使用 pnpm 11,其 `minimumReleaseAge` 策略可能拦截刚发布的版本并报 `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION`。把该版本加入 `~/.dsh/profiles/<profile>/pnpm-workspace.yaml` 的 `minimumReleaseAgeExclude`:
55
-
56
- ```yaml
57
- minimumReleaseAgeExclude:
58
- - dsh-manage-session@0.1.0-alpha.6
59
- ```
60
-
61
- ## 2. 重启宿主
62
-
63
- **安装或升级后必须重启 DSH。** 仅刷新浏览器页面无效:宿主半身在启动时注册 `/session-steward/api` 路由与设置命名空间,且归档来源需要在宿主重启后才会反映清理结果。
64
-
65
- ## 3. 升级
66
-
67
- ```bash
68
- dsh plugin --profile <profile> update dsh-manage-session -w
69
- ```
70
-
71
- 升级后重启 DSH。
72
-
73
- ## 4. 本地路径 / `link:` 注册(备选)
74
-
75
- 用于开发或离线安装,可从本地检出注册:
76
-
77
- ```bash
78
- # ~/.dsh/profiles/<profile>/package.json dependencies:
79
- # "dsh-manage-session": "link:<absolute path to dsh-manage-session>"
80
- # ~/.dsh/profiles/<profile>/cordis.patch.yml:
81
- # - insert:
82
- # - id: dsh-manage-session
83
- # name: dsh-manage-session
84
- cd ~/.dsh/profiles/<profile> && pnpm install && dsh web
85
- ```
86
-
87
- 或用官方 CLI 直接指定本地路径(无需联网):
88
-
89
- ```bash
90
- dsh plugin --profile <profile> add /absolute/path/to/dsh-manage-session -w
91
- ```
92
-
93
- 从源码检出构建时用以下脚本:
94
-
95
- ```bash
96
- pnpm install
97
- pnpm typecheck # tsc -b --pretty false
98
- pnpm test # vitest run
99
- pnpm build # tsc -b && tsdown → lib/index.js + lib/index.d.ts + lib/client.js
100
- ```
101
-
102
- `lib/` 不入库,因此源码检出必须先构建才能按路径注册。发布时由 `prepublishOnly` 钩子自动构建。
103
-
104
- ## 5. 校验安装
105
-
106
- 检查依赖与已安装版本:
107
-
108
- ```bash
109
- grep -n "dsh-manage-session" \
110
- "${DSH_HOME:-$HOME/.dsh}/profiles/<profile>/package.json"
111
- node -p "require('${DSH_HOME:-$HOME/.dsh}/profiles/<profile>/node_modules/dsh-manage-session/package.json').version"
112
- ```
113
-
114
- 检查官方装配:
115
-
116
- ```bash
117
- dsh --profile <profile> --dump-default-config
118
- ```
119
-
120
- 其中必须包含:
121
-
122
- ```yaml
123
- - id: dsh-manage-session
124
- name: dsh-manage-session
125
- ```
126
-
127
- ## 6. 验证插件
128
-
129
- 重启后,侧边栏入口 `dsh-manage-session` 可用,设置区使用 `session-steward` 命名空间。请确认:
130
-
131
- 1. 两个开关均开启时,**养老院**与**体检**两个页签都会渲染。
132
- 2. 关闭 `historyFiles` 后「养老院」页签消失,且所有 `session-history-*` 调用返回显式的 disabled 错误。
133
- 3. 关闭 `healthCheck` 后「体检」页签消失,且所有 `session-health-*` 调用返回显式的 disabled 错误。
134
- 4. 对 `/session-steward/api` 调用未识别的方法时返回显式错误,而不是静默成功。
135
-
136
- 关闭的子域返回 `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }` —— 本插件不留空壳。
137
-
138
- ## 7. 故障排查
139
-
140
- | 现象 | 处理 |
141
- | --- | --- |
142
- | 找不到 `dsh` | 安装或启用官方 DSH CLI。 |
143
- | `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION` | 把该版本加入该 profile 的 `pnpm-workspace.yaml` 中的 `minimumReleaseAgeExclude`。 |
144
- | 安装后页签或路由缺失 | 重启宿主进程——刷新页面不会重新注册路由。 |
145
- | 归档集合的改动不可见 | 重启宿主;归档来源在启动时读取。 |
146
- | `session-history-*` 返回 disabled 错误 | `historyFiles` 开关已关闭,在插件设置中重新开启。 |
147
- | `session-health-*` 返回 disabled 错误 | `healthCheck` 开关已关闭,在插件设置中重新开启。 |
148
- | 升级后客户端包陈旧 | 强制刷新浏览器(Ctrl+Shift+R)。 |
149
-
150
- ## 8. 卸载
151
-
152
- ```bash
153
- dsh plugin --profile <profile> remove dsh-manage-session
154
- ```
155
-
156
- 卸载后重启 DSH。
157
-
158
- ## 卸载不会撤销已执行的处置
159
-
160
- 本插件从不改写会话日志、不修改历史数据、不静默丢弃字段。它唯一看起来不可逆的动作——隔离损坏的投影缓存记录——会先复制备份,并把隔离目录留在磁盘上供你恢复。因此卸载插件不会撤销你主动请求过的隔离;如需还原状态请手工恢复。
161
-
162
- ## 许可
163
-
164
- MIT
1
+ # 安装指南(官方 DSH CLI)
2
+
3
+ 本指南只使用官方 `dsh plugin` 命令。该命令会把依赖装入 profile 并同步 `dsh.profile.bundles`。请勿改用裸 `npm install`、在 profile 里直接 `pnpm add`,或手工编辑 profile 清单。
4
+
5
+ - [English installation guide](./INSTALL.md)
6
+ - [中文安装指南](./INSTALL.zh.md)
7
+ - [日本語インストールガイド](./INSTALL.ja.md)
8
+ - [한국어 설치 안내](./INSTALL.ko.md)
9
+ - [中文 README](./README.md)
10
+ - [English README](./README.en.md)
11
+ - [日本語 README](./README.ja.md)
12
+ - [한국어 README](./README.ko.md)
13
+ - [Changelog](./CHANGELOG.md)
14
+ - [日本語 changelog](./CHANGELOG.ja.md)
15
+ - [한국어 changelog](./CHANGELOG.ko.md)
16
+
17
+ 本指南中的占位符:
18
+
19
+ - `<profile>`:要改动的 DSH profile,通常是 `web`;
20
+ - `dsh-manage-session`:npm 包名,同时也是运行时插件 ID。
21
+
22
+ > **支持的 DSH 范围:`engines.dsh` 的逐 rc 枚举白名单(`0.1.0-rc.2` … `0.2.1-rc.3`,逐版本实测)。**
23
+ >
24
+ > 该范围同时写在 `package.json` 与 `dsh.plugin.json` 的 `engines.dsh` 中,也与本插件为其 `@deepseek-ai/dsh-client-ui-slots` 依赖已经声明的 `^0.1.0-rc.6` 下界一致。安装前先用 `dsh --version` 确认当前版本。
25
+
26
+ ## 0. 前置条件与 profile 探查
27
+
28
+ ```bash
29
+ echo "DSH_HOME=${DSH_HOME:-$HOME/.dsh}"
30
+ dsh --version
31
+ ls "${DSH_HOME:-$HOME/.dsh}/profiles"
32
+ ```
33
+
34
+ 请使用正在运行的 DSH 进程所使用的那个 profile。`web` 很常见,但以实际生效的 `--profile` 参数为准。
35
+
36
+ ## 1. 官方安装
37
+
38
+ ```bash
39
+ dsh plugin --profile <profile> add dsh-manage-session -w
40
+ ```
41
+
42
+ (当 profile 是 pnpm workspace 根时,如 `web`,`-w` 是必需的。)
43
+
44
+ 显式安装指定版本:
45
+
46
+ ```bash
47
+ dsh plugin --profile <profile> add dsh-manage-session@1.0.0 -w
48
+ ```
49
+
50
+ 官方 CLI 会自动更新 profile 依赖、锁文件与 `dsh.profile.bundles`。不要手工添加 YAML 行。
51
+
52
+ ### 供应链冷却期
53
+
54
+ DSH 运行时使用 pnpm 11,其 `minimumReleaseAge` 策略可能拦截刚发布的版本并报 `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION`。把该版本加入 `~/.dsh/profiles/<profile>/pnpm-workspace.yaml` 的 `minimumReleaseAgeExclude`:
55
+
56
+ ```yaml
57
+ minimumReleaseAgeExclude:
58
+ - dsh-manage-session@1.0.0
59
+ ```
60
+
61
+ ## 2. 重启宿主
62
+
63
+ **安装或升级后必须重启 DSH。** 仅刷新浏览器页面无效:宿主半身在启动时注册 `/manage-session/api` 路由与设置命名空间,且归档来源需要在宿主重启后才会反映清理结果。
64
+
65
+ ## 3. 升级
66
+
67
+ ```bash
68
+ dsh plugin --profile <profile> update dsh-manage-session -w
69
+ ```
70
+
71
+ 升级后重启 DSH。
72
+
73
+ ## 4. 本地路径 / `link:` 注册(备选)
74
+
75
+ 用于开发或离线安装,可从本地检出注册:
76
+
77
+ ```bash
78
+ # ~/.dsh/profiles/<profile>/package.json dependencies:
79
+ # "dsh-manage-session": "link:<absolute path to dsh-manage-session>"
80
+ # ~/.dsh/profiles/<profile>/cordis.patch.yml:
81
+ # - insert:
82
+ # - id: dsh-manage-session
83
+ # name: dsh-manage-session
84
+ cd ~/.dsh/profiles/<profile> && pnpm install && dsh web
85
+ ```
86
+
87
+ 或用官方 CLI 直接指定本地路径(无需联网):
88
+
89
+ ```bash
90
+ dsh plugin --profile <profile> add /absolute/path/to/dsh-manage-session -w
91
+ ```
92
+
93
+ 从源码检出构建时用以下脚本:
94
+
95
+ ```bash
96
+ pnpm install
97
+ pnpm typecheck # tsc -b --pretty false
98
+ pnpm test # vitest run
99
+ pnpm build # tsc -b && tsdown → lib/index.js + lib/index.d.ts + lib/client.js
100
+ ```
101
+
102
+ `lib/` 不入库,因此源码检出必须先构建才能按路径注册。发布时由 `prepublishOnly` 钩子自动构建。
103
+
104
+ ## 5. 校验安装
105
+
106
+ 检查依赖与已安装版本:
107
+
108
+ ```bash
109
+ grep -n "dsh-manage-session" \
110
+ "${DSH_HOME:-$HOME/.dsh}/profiles/<profile>/package.json"
111
+ node -p "require('${DSH_HOME:-$HOME/.dsh}/profiles/<profile>/node_modules/dsh-manage-session/package.json').version"
112
+ ```
113
+
114
+ 检查官方装配:
115
+
116
+ ```bash
117
+ dsh --profile <profile> --dump-default-config
118
+ ```
119
+
120
+ 其中必须包含:
121
+
122
+ ```yaml
123
+ - id: dsh-manage-session
124
+ name: dsh-manage-session
125
+ ```
126
+
127
+ ## 6. 验证插件
128
+
129
+ 重启后,侧边栏入口 `dsh-manage-session` 可用,设置区使用 `manage-session` 命名空间。请确认:
130
+
131
+ 1. 两个开关均开启时,**养老院**与**体检**两个页签都会渲染。
132
+ 2. 关闭 `historyFiles` 后「养老院」页签消失,且所有 `session-history-*` 调用返回显式的 disabled 错误。
133
+ 3. 关闭 `healthCheck` 后「体检」页签消失,且所有 `session-health-*` 调用返回显式的 disabled 错误。
134
+ 4. 对 `/manage-session/api` 调用未识别的方法时返回显式错误,而不是静默成功。
135
+
136
+ 关闭的子域返回 `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }` —— 本插件不留空壳。
137
+
138
+ ## 7. 故障排查
139
+
140
+ | 现象 | 处理 |
141
+ | --- | --- |
142
+ | 找不到 `dsh` | 安装或启用官方 DSH CLI。 |
143
+ | `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION` | 把该版本加入该 profile 的 `pnpm-workspace.yaml` 中的 `minimumReleaseAgeExclude`。 |
144
+ | 安装后页签或路由缺失 | 重启宿主进程——刷新页面不会重新注册路由。 |
145
+ | 归档集合的改动不可见 | 重启宿主;归档来源在启动时读取。 |
146
+ | `session-history-*` 返回 disabled 错误 | `historyFiles` 开关已关闭,在插件设置中重新开启。 |
147
+ | `session-health-*` 返回 disabled 错误 | `healthCheck` 开关已关闭,在插件设置中重新开启。 |
148
+ | 升级后客户端包陈旧 | 强制刷新浏览器(Ctrl+Shift+R)。 |
149
+
150
+ ## 8. 卸载
151
+
152
+ ```bash
153
+ dsh plugin --profile <profile> remove dsh-manage-session
154
+ ```
155
+
156
+ 卸载后重启 DSH。
157
+
158
+ ## 卸载不会撤销已执行的处置
159
+
160
+ 本插件从不改写会话日志、不修改历史数据、不静默丢弃字段。它唯一看起来不可逆的动作——隔离损坏的投影缓存记录——会先复制备份,并把隔离目录留在磁盘上供你恢复。因此卸载插件不会撤销你主动请求过的隔离;如需还原状态请手工恢复。
161
+
162
+ ## 许可
163
+
164
+ MIT
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 drscrewdriver
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 drscrewdriver
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md CHANGED
@@ -1,34 +1,44 @@
1
- # dsh-manage-session (Session Steward)
1
+ # dsh-manage-session (Session Manager)
2
2
 
3
- A DSH web plugin for the **session management console** and **session health checks**. It never touches session data itself.
3
+ > **Former name**: `dsh-session-steward` (Session Steward). Renamed to `dsh-manage-session` at 2.0.0;
4
+ > search/indexing moved back to [`dsh-search-index`](https://github.com/drscrewdriver/dsh-search-index).
4
5
 
5
- - **Manage (session console, main tab)** — all sessions grouped by workspace with an
6
- archived-domain filter; select rows to batch archive, un-archive (array-only, reversible)
7
- or purge (deletes on-disk entities, irreversible; backup + atomic replace, a DSH restart
8
- is required for the host to reload the store file).
9
- (2026-10-20 UI change: the former standalone "Retirement Home" tab was merged into this page.)
10
- - **Checkup (health, secondary tab)** — four gates → prescription (command list) → discharge (reversible repair with a
11
- before/after comparison).
6
+ A DSH web plugin: **one console over active and archived sessions + a four-gate checkup**.
12
7
 
13
- > Naming boundary: **this package ships no search or index features**. Search/indexing belongs to
14
- > `dsh-search-index`; neither side mentions or re-interprets the other's fields.
8
+ - **Manage (main page)** — sessions grouped by workspace, **active + archived**: domain filter
9
+ (all / active / archived), title filter, favorites, and batch archive / unarchive / purge
10
+ (real deletion, irreversible).
11
+ - **Checkup (secondary tab)** — four gates → prescription → discharge (reversible repair).
12
+
13
+ > Reversible operations only. **No search or index of its own, and no DRS dependency**:
14
+ > retrieval (title/content FTS5) belongs to `dsh-search-index`; the manage console builds its
15
+ > corpus from the host `sessionQuery` service plus the official archive set (`session-catalog`).
16
+
17
+ ## Where the entry lives (top tool slot / footer fallback)
18
+
19
+ | Host capability | Entry form |
20
+ |---|---|
21
+ | Sidebar declares the top tool row (`sidebar.panellist` + the `main` page slot — the Plugins / More row of 0.1.7+/0.2.x) | A **panel row** right after Plugins and before More (order 6), icon + label left-aligned; clicking opens a **full page**, Close returns to the conversation |
22
+ | No such slot (older lines / reduced layouts) | Falls back to the sidebar **footer** (`sidebar.footer.action`) with a floating dialog |
15
23
 
16
24
  <!-- hosts-sync:begin -->
17
25
  <!-- Generated by scripts/sync-hosts.mjs; single source in scripts/hosts.mjs -->
18
- Supports DSH 0.1.0-rc.2, 0.1.0-rc.3, 0.1.0-rc.6, 0.1.0-rc.7, 0.1.0-rc.8, 0.1.1-rc.1, 0.1.1-rc.2, 0.1.2-rc.1, 0.1.5-rc.1, 0.1.5-rc.2, 0.1.5-rc.3, 0.1.7-rc.1, 0.1.7-rc.2, 0.2.0-rc.1, 0.2.0-rc.2, 0.2.1-rc.1, 0.2.1-rc.2, 0.2.1-rc.3 (enumerated peers — a per-rc tested whitelist; alpha/beta releases are out of scope).
19
- <!-- hosts-sync:end -->
20
- ## Screenshots
26
+ Supports DSH 0.1.0-rc.2, 0.1.0-rc.3, 0.1.0-rc.6, 0.1.0-rc.7, 0.1.0-rc.8, 0.1.1-rc.1, 0.1.1-rc.2, 0.1.2-rc.1, 0.1.5-rc.1, 0.1.5-rc.2, 0.1.5-rc.3, 0.1.7-rc.1, 0.1.7-rc.2, 0.2.0-rc.1, 0.2.0-rc.2, 0.2.1-rc.1, 0.2.1-rc.2, 0.2.1-rc.3, 0.2.1-rc.4 (enumerated peers — a per-rc tested whitelist; alpha/beta releases are out of scope).
27
+ <!-- hosts-sync:end -->
21
28
 
22
- A **Session Steward** entry sits next to Search and Settings at the bottom of the sidebar:
29
+ ## Screenshots
23
30
 
24
- ![Sidebar entry](assets/left-sidebar.png)
31
+ **Current form** — the entry sits in the sidebar's top tool row (after Plugins, before More) and opens the
32
+ session console: three-column cards grouped by workspace, workspace / domain (all · active · archived)
33
+ filters, favorites, and batch archive · unarchive · purge on the selection (destructive steps ask twice):
25
34
 
26
- **Manage (main tab)** — sessions grouped by workspace with active/archived/favorite filters, each row
27
- carrying its size and whether the on-disk entity still exists; select rows to batch archive, un-archive or purge:
35
+ ![Session console](assets/new-manager.png)
28
36
 
29
- **Checkup (secondary tab)** — the entry point of the four-gate checkup, which ends in a reversible prescription:
37
+ **Historical forms** (for lineage only, not the current UI):
30
38
 
31
- ![Checkup](assets/doctor.png)
39
+ | Merged package era (1.x: search included, two-tab dialog, retired) | Earlier (≤0.5.7: entry at the sidebar foot) |
40
+ |---|---|
41
+ | ![Old two-tab dialog](assets/old-archive.png) | ![Old sidebar footer entry](assets/left-sidebar-old.png) |
32
42
 
33
43
  ## Install
34
44
 
@@ -36,45 +46,30 @@ carrying its size and whether the on-disk entity still exists; select rows to ba
36
46
  dsh plugin --profile web add dsh-manage-session
37
47
  ```
38
48
 
39
- Restart the host process afterwards (refreshing the page is not enough).
49
+ Restart the host process afterwards.
40
50
 
41
51
  ## Routes
42
52
 
43
- Prefix `/session-steward/api`; every method name is `session-*` (never `index-*`), and an unrecognized
44
- method returns an explicit error instead of failing silently.
45
-
46
- | Method | Domain | Purpose |
47
- |---|---|---|
48
- | `session-history-list` | history | list the official archive set (with source and degradation notes) |
49
- | `session-history-prune` | history | bulk-remove ids from the archive array (auto backup, restart required) |
50
- | `session-health-status` | health | switch state and method table (panel polling) |
51
- | `session-health-scan` | health | batch checkup (defaults to non-ok sessions only) |
52
- | `session-health-session` | health | one session's four-gate report plus prescription |
53
- | `session-health-repair` | health | reversible repair (quarantine the projection-cache record) with before/after |
54
-
55
- Settings namespace `session-steward`; sidebar entry id `dsh-manage-session`.
56
-
57
- ## Switches (feature gates)
53
+ Prefix `/manage-session/api`, methods named `session-*`:
54
+ `session-catalog`, `session-history-list|archive|prune|purge`, `session-history-favorites-list` /
55
+ `-favorite-set`, `session-health-status|scan|session|repair|source-migrate`.
58
56
 
59
- | Switch | Field | When off |
60
- |---|---|---|
61
- | Session history files | `historyFiles` (default true) | `session-history-*` is not registered (the UI tab was merged into Manage on 2026-10-20 and no longer gates a tab) |
62
- | Health check | `healthCheck` (default true) | `session-health-*` is not registered and the Checkup tab is not rendered |
57
+ ## Settings
63
58
 
64
- Closed domains return `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }` — no empty shells.
59
+ Namespace `manage-session`: `enabled`, `historyFiles`, `healthCheck`, `directDelete`.
65
60
 
66
- ## Contract with `dsh-search-index`
61
+ ## Storage
67
62
 
68
- The archive file format (`global.archivedSessionIds` of `~/.dsh/storages/workspace.json`):
69
- **this plugin writes, the search-index plugin reads only**. See
70
- `dsh-docs-deliverables/dsh-归档文件格式契约-20260914.md`.
63
+ - `~/.dsh/storages/manage-session-favorites.json` — favorites
64
+ - `~/.dsh/storages/workspace.json` — host-owned archive array + workspace membership (backed up before writes)
71
65
 
72
66
  ## Development
73
67
 
74
68
  ```bash
75
69
  pnpm install
76
70
  pnpm typecheck
77
- pnpm test
71
+ pnpm test # host half
72
+ pnpm test:client # client half (build first)
78
73
  pnpm build
79
74
  ```
80
75
 
package/README.ja.md CHANGED
@@ -1,77 +1,53 @@
1
- # dsh-manage-session(セッション・スチュワード)
1
+ # dsh-manage-session(セッションマネージャー)
2
2
 
3
- **セッション履歴ファイル**と**セッション健康チェック**のための DSH Web プラグインです。セッションデータそのものには一切触れません。
3
+ > **旧名**:`dsh-session-steward`(セッション・スチュワード)。2.0.0 で `dsh-manage-session` に改名し、
4
+ > 検索/索引は [`dsh-search-index`](https://github.com/drscrewdriver/dsh-search-index) に戻しました。
4
5
 
5
- - **カルテ室(履歴ファイル)** — 公式アーカイブ集合を閲覧し、ID を一括整理します
6
- (バックアップ + アトミック置換。ホストに再読み込みさせるには DSH の再起動が必要です)。
7
- - **健診(健康チェック)** — 四つのゲート → 処方(コマンド一覧)→ 退院(before/after 比較を伴う
8
- 可逆的な修復)。
6
+ DSH Web プラグイン:**アクティブ/アーカイブ済みセッションの統合管理台+セッション健診**。
9
7
 
10
- > 命名の境界:**本パッケージは検索・インデックス機能を一切提供しません**。検索/インデックスは
11
- > `dsh-search-index` に属し、双方が相手のフィールドに言及したり再解釈したりすることはありません。
8
+ - **管理(メインページ)** — ワークスペース別に活性+アーカイブのセッションを一覧。ドメイン
9
+ フィルタ(すべて/アクティブ/アーカイブ)、タイトル絞り込み、お気に入り、一括のアーカイブ/
10
+ 解除/実体削除(不可逆)。
11
+ - **健診(補助タブ)** — 四つのゲート → 処方 → 退院(可逆な処置)。
12
12
 
13
- ## スクリーンショット
14
-
15
- サイドバー下部に **「会话管家」**(セッション・スチュワード)のエントリが追加され、検索・設定と並びます:
16
-
17
- ![サイドバーのエントリ](assets/left-sidebar.png)
18
-
19
- **カルテ室(履歴ファイル)** — 公式アーカイブ集合の一覧。各行にサイズとディスク上の実体の有無を表示し、選択してアーカイブ解除または整理ができます:
13
+ > **検索・索引は本パッケージに含まず、DRS 依存もありません**:検索は `dsh-search-index` が担当。
14
+ > 管理台の語料はホストの `sessionQuery` と公式アーカイブ集合から `session-catalog` が組み立てます。
20
15
 
21
- ![カルテ室](assets/archive.png)
16
+ ## 入口の位置(上部ツール枠 / 下部フォールバック)
22
17
 
23
- **健診** — 四つのゲートによる健診の入口。スキャン後に可逆的な処方を提示します:
18
+ | ホストの能力 | 入口の形 |
19
+ |---|---|
20
+ | 上部ツール行(`sidebar.panellist` + `main`)を宣言 | 「プラグイン」の直後、「その他」の手前(order 6)に**パネル行**。クリックでメイン列に全ページ表示 |
21
+ | 枠が無いホスト | サイドバー下部(`sidebar.footer.action`)にフォールバックし、ダイアログを開く |
24
22
 
25
- ![健診](assets/doctor.png)
26
-
27
- ## インストール
28
-
29
- ```bash
30
- dsh plugin --profile web add dsh-manage-session
31
- ```
23
+ <!-- hosts-sync:begin -->
24
+ <!-- Generated by scripts/sync-hosts.mjs; single source in scripts/hosts.mjs -->
25
+ Supports DSH 0.1.0-rc.2, 0.1.0-rc.3, 0.1.0-rc.6, 0.1.0-rc.7, 0.1.0-rc.8, 0.1.1-rc.1, 0.1.1-rc.2, 0.1.2-rc.1, 0.1.5-rc.1, 0.1.5-rc.2, 0.1.5-rc.3, 0.1.7-rc.1, 0.1.7-rc.2, 0.2.0-rc.1, 0.2.0-rc.2, 0.2.1-rc.1, 0.2.1-rc.2, 0.2.1-rc.3 (enumerated peers — a per-rc tested whitelist; alpha/beta releases are out of scope).
26
+ <!-- hosts-sync:end -->
32
27
 
33
- その後、ホストプロセスを再起動してください(ページの再読み込みでは不十分です)。
34
-
35
- ## ルート
36
-
37
- プレフィックスは `/session-steward/api`。メソッド名はすべて `session-*`(`index-*` は使いません)で、
38
- 未知のメソッドは黙って失敗せず明示的なエラーを返します。
39
-
40
- | メソッド | ドメイン | 用途 |
41
- |---|---|---|
42
- | `session-history-list` | history | 公式アーカイブ集合を一覧表示(取得元と縮退の注記付き) |
43
- | `session-history-prune` | history | アーカイブ配列から ID を一括削除(自動バックアップ、再起動が必要) |
44
- | `session-health-status` | health | スイッチの状態とメソッド一覧(パネルのポーリング用) |
45
- | `session-health-scan` | health | 一括健診(既定では非 ok のセッションのみ) |
46
- | `session-health-session` | health | 1 セッションの四ゲートレポートと処方 |
47
- | `session-health-repair` | health | 可逆的な修復(プロジェクションキャッシュのレコードを隔離)と before/after 対照 |
48
-
49
- 設定名前空間は `session-steward`、サイドバーエントリ ID は `dsh-manage-session`。
50
-
51
- ## スイッチ(フィーチャーゲート)
28
+ ## スクリーンショット
52
29
 
53
- | スイッチ | フィールド | オフのとき |
54
- |---|---|---|
55
- | セッション履歴ファイル | `historyFiles`(既定 true) | `session-history-*` は登録されず、カルテ室タブも描画されない |
56
- | 健康チェック | `healthCheck`(既定 true) | `session-health-*` は登録されず、健診タブも描画されない |
30
+ **現在の形** —— 入口はサイドバー上部のツール行(「プラグイン」の後、「その他」の前)。開くとセッション管理台:
31
+ ワークスペース別の 3 列カード、ワークスペース/検索域(すべて・アクティブ・アーカイブ)の絞り込み、お気に入り、
32
+ 選択行の一括アーカイブ・解除・整理(不可逆な操作は 2 回確認):
57
33
 
58
- 閉じられたドメインは `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }` を返します — 空の殻は残しません。
34
+ ![セッション管理台](assets/new-manager.png)
59
35
 
60
- ## `dsh-search-index` との契約
36
+ **過去の形**(沿革の参照用。現行 UI ではありません):
61
37
 
62
- アーカイブファイル形式(`~/.dsh/storages/workspace.json` の `global.archivedSessionIds`)は、
63
- **本プラグインが書き込み、検索インデックスプラグインは読み取りのみ**です。詳細は
64
- `dsh-docs-deliverables/dsh-归档文件格式契约-20260914.md` を参照してください。
38
+ | 統合パッケージ期(1.x:検索同梱・2 タブダイアログ・終了) | さらに以前(≤0.5.7:入口はサイドバー下部) |
39
+ |---|---|
40
+ | ![旧 2 タブダイアログ](assets/old-archive.png) | ![旧サイドバー下部入口](assets/left-sidebar-old.png) |
65
41
 
66
- ## 開発
42
+ ## インストール/設定/開発
67
43
 
68
44
  ```bash
69
- pnpm install
70
- pnpm typecheck
71
- pnpm test
72
- pnpm build
45
+ dsh plugin --profile web add dsh-manage-session # インストール後に再起動
46
+ pnpm install && pnpm typecheck && pnpm test && pnpm build
73
47
  ```
74
48
 
49
+ 設定名前空間 `manage-session`:`enabled`、`historyFiles`、`healthCheck`、`directDelete`。
50
+
75
51
  ## ライセンス
76
52
 
77
53
  MIT