dsh-manage-session 0.4.8 → 0.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/INSTALL.zh.md CHANGED
@@ -1,164 +1,179 @@
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
+ - [Guide d'installation en français](./INSTALL.fr.md)
10
+ - [Installationsanleitung auf Deutsch](./INSTALL.de.md)
11
+ - [Guida all'installazione in italiano](./INSTALL.it.md)
12
+ - [Руководство по установке на русском](./INSTALL.ru.md)
13
+ - [Guía de instalación en español](./INSTALL.es.md)
14
+ - [中文 README](./README.md)
15
+ - [English README](./README.en.md)
16
+ - [日本語 README](./README.ja.md)
17
+ - [한국어 README](./README.ko.md)
18
+ - [Français README](./README.fr.md)
19
+ - [Deutsch README](./README.de.md)
20
+ - [Italiano README](./README.it.md)
21
+ - [Русский README](./README.ru.md)
22
+ - [Español README](./README.es.md)
23
+ - [Changelog](./CHANGELOG.md)
24
+ - [日本語 changelog](./CHANGELOG.ja.md)
25
+ - [한국어 changelog](./CHANGELOG.ko.md)
26
+ - [Français changelog](./CHANGELOG.fr.md)
27
+ - [Deutsch changelog](./CHANGELOG.de.md)
28
+ - [Italiano changelog](./CHANGELOG.it.md)
29
+ - [Русский changelog](./CHANGELOG.ru.md)
30
+ - [Español changelog](./CHANGELOG.es.md)
31
+
32
+ 本指南中的占位符:
33
+
34
+ - `<profile>`:要改动的 DSH profile,通常是 `web`;
35
+ - `dsh-manage-session`:npm 包名,同时也是运行时插件 ID。
36
+
37
+ > **支持的 DSH 范围:`>=0.1.0-rc.6 <0.2.0-0`。**
38
+ >
39
+ > 该范围同时写在 `package.json` 与 `dsh.plugin.json` 的 `engines.dsh` 中,也与本插件为其 `@deepseek-ai/dsh-client-ui-slots` 依赖已经声明的 `^0.1.0-rc.6` 下界一致。安装前先用 `dsh --version` 确认当前版本。
40
+
41
+ ## 0. 前置条件与 profile 探查
42
+
43
+ ```bash
44
+ echo "DSH_HOME=${DSH_HOME:-$HOME/.dsh}"
45
+ dsh --version
46
+ ls "${DSH_HOME:-$HOME/.dsh}/profiles"
47
+ ```
48
+
49
+ 请使用正在运行的 DSH 进程所使用的那个 profile。`web` 很常见,但以实际生效的 `--profile` 参数为准。
50
+
51
+ ## 1. 官方安装
52
+
53
+ ```bash
54
+ dsh plugin --profile <profile> add dsh-manage-session -w
55
+ ```
56
+
57
+ (当 profile 是 pnpm workspace 根时,如 `web`,`-w` 是必需的。)
58
+
59
+ 显式安装指定版本:
60
+
61
+ ```bash
62
+ dsh plugin --profile <profile> add dsh-manage-session@0.1.0-alpha.6 -w
63
+ ```
64
+
65
+ 官方 CLI 会自动更新 profile 依赖、锁文件与 `dsh.profile.bundles`。不要手工添加 YAML 行。
66
+
67
+ ### 供应链冷却期
68
+
69
+ DSH 运行时使用 pnpm 11,其 `minimumReleaseAge` 策略可能拦截刚发布的版本并报 `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION`。把该版本加入 `~/.dsh/profiles/<profile>/pnpm-workspace.yaml` 的 `minimumReleaseAgeExclude`:
70
+
71
+ ```yaml
72
+ minimumReleaseAgeExclude:
73
+ - dsh-manage-session@0.1.0-alpha.6
74
+ ```
75
+
76
+ ## 2. 重启宿主
77
+
78
+ **安装或升级后必须重启 DSH。** 仅刷新浏览器页面无效:宿主半身在启动时注册 `/session-steward/api` 路由与设置命名空间,且归档来源需要在宿主重启后才会反映清理结果。
79
+
80
+ ## 3. 升级
81
+
82
+ ```bash
83
+ dsh plugin --profile <profile> update dsh-manage-session -w
84
+ ```
85
+
86
+ 升级后重启 DSH。
87
+
88
+ ## 4. 本地路径 / `link:` 注册(备选)
89
+
90
+ 用于开发或离线安装,可从本地检出注册:
91
+
92
+ ```bash
93
+ # ~/.dsh/profiles/<profile>/package.json dependencies:
94
+ # "dsh-manage-session": "link:<absolute path to dsh-manage-session>"
95
+ # ~/.dsh/profiles/<profile>/cordis.patch.yml:
96
+ # - insert:
97
+ # - id: dsh-manage-session
98
+ # name: dsh-manage-session
99
+ cd ~/.dsh/profiles/<profile> && pnpm install && dsh web
100
+ ```
101
+
102
+ 或用官方 CLI 直接指定本地路径(无需联网):
103
+
104
+ ```bash
105
+ dsh plugin --profile <profile> add /absolute/path/to/dsh-manage-session -w
106
+ ```
107
+
108
+ 从源码检出构建时用以下脚本:
109
+
110
+ ```bash
111
+ pnpm install
112
+ pnpm typecheck # tsc -b --pretty false
113
+ pnpm test # vitest run
114
+ pnpm build # tsc -b && tsdown → lib/index.js + lib/index.d.ts + lib/client.js
115
+ ```
116
+
117
+ `lib/` 不入库,因此源码检出必须先构建才能按路径注册。发布时由 `prepublishOnly` 钩子自动构建。
118
+
119
+ ## 5. 校验安装
120
+
121
+ 检查依赖与已安装版本:
122
+
123
+ ```bash
124
+ grep -n "dsh-manage-session" \
125
+ "${DSH_HOME:-$HOME/.dsh}/profiles/<profile>/package.json"
126
+ node -p "require('${DSH_HOME:-$HOME/.dsh}/profiles/<profile>/node_modules/dsh-manage-session/package.json').version"
127
+ ```
128
+
129
+ 检查官方装配:
130
+
131
+ ```bash
132
+ dsh --profile <profile> --dump-default-config
133
+ ```
134
+
135
+ 其中必须包含:
136
+
137
+ ```yaml
138
+ - id: dsh-manage-session
139
+ name: dsh-manage-session
140
+ ```
141
+
142
+ ## 6. 验证插件
143
+
144
+ 重启后,侧边栏入口 `dsh-manage-session` 可用,设置区使用 `session-steward` 命名空间。请确认:
145
+
146
+ 1. 两个开关均开启时,**养老院**与**体检**两个页签都会渲染。
147
+ 2. 关闭 `historyFiles` 后「养老院」页签消失,且所有 `session-history-*` 调用返回显式的 disabled 错误。
148
+ 3. 关闭 `healthCheck` 后「体检」页签消失,且所有 `session-health-*` 调用返回显式的 disabled 错误。
149
+ 4. 对 `/session-steward/api` 调用未识别的方法时返回显式错误,而不是静默成功。
150
+
151
+ 关闭的子域返回 `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }` —— 本插件不留空壳。
152
+
153
+ ## 7. 故障排查
154
+
155
+ | 现象 | 处理 |
156
+ | --- | --- |
157
+ | 找不到 `dsh` | 安装或启用官方 DSH CLI。 |
158
+ | `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION` | 把该版本加入该 profile 的 `pnpm-workspace.yaml` 中的 `minimumReleaseAgeExclude`。 |
159
+ | 安装后页签或路由缺失 | 重启宿主进程——刷新页面不会重新注册路由。 |
160
+ | 归档集合的改动不可见 | 重启宿主;归档来源在启动时读取。 |
161
+ | `session-history-*` 返回 disabled 错误 | `historyFiles` 开关已关闭,在插件设置中重新开启。 |
162
+ | `session-health-*` 返回 disabled 错误 | `healthCheck` 开关已关闭,在插件设置中重新开启。 |
163
+ | 升级后客户端包陈旧 | 强制刷新浏览器(Ctrl+Shift+R)。 |
164
+
165
+ ## 8. 卸载
166
+
167
+ ```bash
168
+ dsh plugin --profile <profile> remove dsh-manage-session
169
+ ```
170
+
171
+ 卸载后重启 DSH。
172
+
173
+ ## 卸载不会撤销已执行的处置
174
+
175
+ 本插件从不改写会话日志、不修改历史数据、不静默丢弃字段。它唯一看起来不可逆的动作——隔离损坏的投影缓存记录——会先复制备份,并把隔离目录留在磁盘上供你恢复。因此卸载插件不会撤销你主动请求过的隔离;如需还原状态请手工恢复。
176
+
177
+ ## 许可
178
+
179
+ 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.de.md ADDED
@@ -0,0 +1,120 @@
1
+ # dsh-manage-session (Session Steward)
2
+
3
+ - [中文 README](./README.md)
4
+ - [English README](./README.en.md)
5
+ - [日本語 README](./README.ja.md)
6
+ - [한국어 README](./README.ko.md)
7
+ - [Français README](./README.fr.md)
8
+ - [Deutsch README](./README.de.md)
9
+ - [Italiano README](./README.it.md)
10
+ - [Русский README](./README.ru.md)
11
+ - [Español README](./README.es.md)
12
+
13
+ DSH-Web-Plugin für **Sitzungsverlaufsdateien + Sitzungs-Healthchecks**.
14
+
15
+ > **Diese Version (0.5.0) macht die DSH-0.2.0-Linie zur Hauptlinie** (peer/engines = `>=0.2.0-rc.1 <0.2.1-0`, npm dist-tag `dsh-0.2.0`, Branch `compat/0.2.0`).
16
+ > Die DSH-0.1.7-Linie wird weiterhin von 0.4.8 bedient (dist-tag `dsh-0.1.7`, Branch `compat/0.1.7`) und entwickelt sich nicht mehr mit dieser Linie weiter.
17
+ > Die Host-Flächen, die dieses Plugin konsumiert (Sitzungsformat V4 und die First-Party-Produzentenlisten von `dsh-session-format-v3-to-v4`, die Dekodier-Exports von `dsh-session`, der Archivverzeichnis-Vertrag `session.jsonl.zstd`/`session.v3.jsonl.zstd` in doppelter Ausführung + `storages/session_projcache` + die beiden id-Listen in `workspace.json`), wurden in 0.2.0-rc.1 Punkt für Punkt als **unverändert verifiziert — null Codeänderungen**; diese Version ist eine reine Metadaten-Anpassung (Generationswechsel bei peer/engines, devDependencies exakt auf `0.2.0-rc.1` gepinnt, Release-Disziplin versionsbegleitend aktualisiert).
18
+
19
+ - **Seniorenheim (Verlaufsdateien)**: den offiziellen Archivbestand durchsehen, mit zwei **unabhängigen** Aktionen —
20
+ **Archivstatus aufheben** (ändert nur das Array, reversibel) und **Archivdateien endgültig löschen (Purge)** (löscht die Datenträger-Entitäten wirklich, irreversibel).
21
+
22
+ > **Die beiden Aktionen sind nicht austauschbar und lassen sich nicht zusammenlegen**:
23
+ >
24
+ > | | Archivstatus aufheben | Archivdateien löschen (Purge) |
25
+ > |---|---|---|
26
+ > | Route | `session-history-prune` | `session-history-purge` |
27
+ > | Was geändert wird | nur `global.archivedSessionIds` | löscht Datenträger-Entitäten + ändert das Archiv-Array + ändert die Mitglieder-Tabelle der Arbeitsbereiche |
28
+ > | Verbleib der Sitzung | zurück in den ursprünglichen Arbeitsbereich der Seitenleiste | verschwindet aus der Welt |
29
+ > | Reversibel | ✅ | ❌ |
30
+ >
31
+ > **Der Purge zieht zwangsläufig das Aufheben des Archivstatus nach sich** — sonst blieben Zombie-ids zurück, die „in der Seitenleiste unsichtbar sind und sobald man ihren Archivstatus aufhebt zu einer leeren Sitzung werden“.
32
+ > Die Größe wird **pro Zeile** angezeigt (praktisch gemessen: ein einzelner Eintrag kann von 0 bis 23 MB reichen), der Button zeigt die Teiltsumme der Auswahl.
33
+ >
34
+ > **Zwei harte Randbedingungen** (einhalten, sonst war die Aktion umsonst):
35
+ > 1. **Liste und Schreibzugriff haben dieselbe Quelle** — beide erkennen die Speicherdatei `~/.dsh/storages/workspace.json` an. Der `workspaceRegistry` im Host-Speicher ist ein Snapshot beim Start: Änderungen an der Datei schreiben nicht in ihn zurück; er dient nur als Diagnosefläche für „bereits aus der Datei hinaus, in diesem Prozess weiterhin wirksam“ (`pendingRestart`).
36
+ > 2. **Direkt nach der Aktion DSH neu starten** — die Speicherschicht schreibt vollständig neu, der Speicher ist maßgeblich: Vor dem Beenden des Hosts schreibt **jede** Archiv- oder Arbeitsbereichsänderung den alten Zustand vollständig zurück und macht die soeben durchgeführte Aktion zunichte.
37
+ - **Check-up (Gesundheitsprüfung / Sitzungsarzt)**: Vier-Gates-Check-up → Verordnung (Befehlsliste) → Entlassung (reversibler Eingriff + Vorher/Nachher-Vergleich).
38
+
39
+ > Namensgrenze: **Dieses Paket bietet weder Suche noch Indizierung.** Suche/eigenständige Indizierung gehören in ein anderes Revier (`dsh-search-index`); keine der beiden Seiten verwendet die Unterdomänen-Begriffe der anderen, und keine interpretiert die Felder der anderen.
40
+
41
+ ## Oberflächen-Vorschau
42
+
43
+ Ein Eintrag **„Session Steward“** erscheint unten in der Seitenleiste, neben Suche und Einstellungen:
44
+
45
+ ![Eintrag in der Seitenleiste](assets/left-sidebar.png)
46
+
47
+ **Seniorenheim (Verlaufsdateien)** — Überblick über den offiziellen Archivbestand; jede Zeile zeigt ihre Größe und den Zustand der Datenträger-Entität; Zeilen auswählen, um den Archivstatus aufzuheben oder zu löschen (Purge):
48
+
49
+ ![Seniorenheim (alles zusammengeführt)](assets/archive.png)
50
+
51
+ **Check-up** — der Einstiegspunkt des Vier-Gates-Check-ups, der in einer reversiblen Verordnung endet:
52
+
53
+ ![Check-up](assets/doctor.png)
54
+
55
+ ## Installation
56
+
57
+ ```bash
58
+ dsh plugin --profile web add dsh-manage-session
59
+ # oder ein lokales Entwicklungsverzeichnis
60
+ dsh plugin --profile web add "link:E:/test/rewrite-agently/mine-dsh-plugins/dsh-manage-session"
61
+ ```
62
+
63
+ Nach der Installation **muss der Host-Prozess neu gestartet werden** (ein Neuladen der Seite genügt nicht).
64
+
65
+ ## Routen-Vertrag
66
+
67
+ Präfix `/session-steward/api`, Methodennamen immer `session-*` (**niemals** mit den `index-*` des Suchindex vermischen);
68
+ eine unbekannte Methode liefert einen expliziten Fehler, niemals Stillschweigen.
69
+
70
+ | Methode | Subdomäne | Zweck |
71
+ |---|---|---|
72
+ | `session-history-list` | history | den Archivbestand auflisten (Speicherdatei hat Vorrang; mit Quelle, Degradierung, Größe pro Zeile und `pendingRestart`-Vermerk) |
73
+ | `session-history-prune` | history | **Archivstatus aufheben**: ids massenweise aus dem Archiv-Array entfernen (automatische Sicherung, Neustart erforderlich) |
74
+ | `session-history-purge` | history | **Archivdateien endgültig löschen**: Transkript-Verzeichnis + Projektions-Cache + beide id-Listen wirklich löschen (**irreversibel**) |
75
+ | `session-health-status` | health | Schalterzustand und Methodentabelle (für das Polling des Panels) |
76
+ | `session-health-scan` | health | Check-up im Batch (standardmäßig nur nicht-ok-Sitzungen zurückgeben) |
77
+ | `session-health-session` | health | Vier-Gates-Bericht einer einzelnen Sitzung + Verordnung |
78
+ | `session-health-repair` | health | reversibler Eingriff (Quarantäne des Projektions-Cache-Datensatzes) + Vorher/Nachher |
79
+
80
+ Einstellungs-Namespace: `session-steward`; id des Seitenleisten-Eintrags: `dsh-manage-session`.
81
+
82
+ ## Die beiden Schalter (feature gates)
83
+
84
+ | Schalter | Feld | Wirkung bei Deaktivierung |
85
+ |---|---|---|
86
+ | Sitzungsverlaufsdateien | `historyFiles` (Standard true) | `session-history-*` wird nicht registriert, der Tab „Seniorenheim“ wird nicht gerendert |
87
+ | Gesundheitsprüfung | `healthCheck` (Standard true) | `session-health-*` wird nicht registriert, der Tab „Check-up“ wird nicht gerendert |
88
+
89
+ Bei Deaktivierung liefert die entsprechende Methode `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }` — **keine leeren Hüllen**.
90
+
91
+ ## Der Vier-Gates-Check-up
92
+
93
+ | gate | Kriterium | level |
94
+ |---|---|---|
95
+ | `log-integrity` | Multi-Frame-Scan mit zstd → Entfaltung der Provenance → Auspacken der gepackten Zeilen; seq fortlaufend, kein zerrissener Endframe | `fail` bei Leseproblemen; `warn` bei nur zerrissenem Endframe |
96
+ | `projection-cache` | Abstand des `minSeq` von `~/.dsh/storages/session_projcache/sessions/<id>.json` zur letzten seq des Logs + nicht abgeschlossene Felder (openStep / activeStep.active / pendingTurnStart / turnBoundary=start) | `fail` bei Abstand und nicht abgeschlossen; `warn` wenn eines von beiden |
97
+ | `lossless-json` | zeilenweise Prüfung auf verlustfreies JSON durch das hot-state `sessionProjections.checkpoint(session)` (undefined / nicht-endliche Zahlen / -0 / löchrige Sparse-Löcher / nicht-gewöhnlicher Prototyp / Funktionen·Symbol·BigInt / Zyklen) | `fail` bei einem Treffer, mit Projektions-Key → zugeordnetem Paket |
98
+ | `cold-read` | Grund des letzten `turn/end`, ob ein offener open step ohne Abschluss existiert, ob nach der letzten user-Nachricht noch Assistant-Ausgabe folgt | `fail` bei open step; `warn` bei interrupted/fehlendem turn/end |
99
+
100
+ **Die Verordnung** enthält nur drei reversible Dinge: ① den beschädigten Projektions-Cache-Datensatz in Quarantäne versetzen (zuerst sichern) ② bei nicht abgeschlossenen steps daran erinnern, auf die Abschlusserklärung des Hosts zu warten ③ eine ausführbare Befehlsliste ausgeben.
101
+ **Verboten**: Sitzungslogs umschreiben, historische Daten ändern, Felder stillschweigend verwerfen.
102
+
103
+ ## Der einzige Vertrag mit `dsh-search-index`
104
+
105
+ Format der Archivdatei (`global.archivedSessionIds` von `~/.dsh/storages/workspace.json`):
106
+ **dieses Plugin schreibt, der Suchindex liest nur**. Formatbeschreibung in
107
+ `dsh-docs-deliverables/dsh-归档文件格式契约-20260914.md`.
108
+
109
+ ## Entwicklung
110
+
111
+ ```bash
112
+ pnpm install
113
+ pnpm typecheck # tsc -b --pretty false
114
+ pnpm test # vitest run
115
+ pnpm build # tsc -b && tsdown → lib/index.js + lib/client.js
116
+ ```
117
+
118
+ ## Lizenz
119
+
120
+ MIT
package/README.en.md CHANGED
@@ -1,7 +1,19 @@
1
1
  # dsh-manage-session (Session Steward)
2
2
 
3
+ - [中文 README](./README.md)
4
+ - [English README](./README.en.md)
5
+ - [日本語 README](./README.ja.md)
6
+ - [한국어 README](./README.ko.md)
7
+ - [Français README](./README.fr.md)
8
+ - [Deutsch README](./README.de.md)
9
+ - [Italiano README](./README.it.md)
10
+ - [Русский README](./README.ru.md)
11
+ - [Español README](./README.es.md)
12
+
3
13
  A DSH web plugin for **session history files** and **session health checks**. It never touches session data itself.
4
14
 
15
+ > **This release (0.5.0) targets the DSH 0.2.0 line** (peer/engines `>=0.2.0-rc.1 <0.2.1-0`, npm dist-tag `dsh-0.2.0`, branch `compat/0.2.0`). The DSH 0.1.7 line remains served by 0.4.8 (dist-tag `dsh-0.1.7`, branch `compat/0.1.7`). Every host surface this plugin consumes (session V4 format and the `dsh-session-format-v3-to-v4` first-party producer lists, the `dsh-session` decode exports, the archive layout `session.jsonl.zstd`/`session.v3.jsonl.zstd` + `storages/session_projcache` + the two id lists in `workspace.json`) was verified unchanged in 0.2.0-rc.1 — **zero code changes**; this release is metadata-only.
16
+
5
17
  - **Retirement Home (history files)** — browse the official archive set and prune ids in bulk
6
18
  (backup + atomic replace; a DSH restart is required for the host to reload it).
7
19
  - **Checkup (health)** — four gates → prescription (command list) → discharge (reversible repair with a