dsh-manage-session 0.5.1 → 0.5.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.
Files changed (63) hide show
  1. package/CHANGELOG.ja.md +207 -242
  2. package/CHANGELOG.ko.md +207 -242
  3. package/CHANGELOG.md +337 -341
  4. package/INSTALL.ja.md +164 -179
  5. package/INSTALL.ko.md +164 -179
  6. package/INSTALL.md +164 -179
  7. package/INSTALL.zh.md +164 -179
  8. package/LICENSE +21 -21
  9. package/README.en.md +4 -12
  10. package/README.ja.md +0 -12
  11. package/README.ko.md +0 -12
  12. package/README.md +4 -14
  13. package/cordis.patch.yml +16 -11
  14. package/dsh.plugin.json +4 -4
  15. package/lib/client.js +3882 -690
  16. package/lib/index.d.ts +759 -29
  17. package/lib/index.js +2604 -93
  18. package/locale/de.json +6 -0
  19. package/locale/en.json +6 -0
  20. package/locale/es.json +6 -0
  21. package/locale/fr.json +6 -0
  22. package/locale/it.json +6 -0
  23. package/locale/ja.json +6 -0
  24. package/locale/ko.json +6 -0
  25. package/locale/ru.json +6 -0
  26. package/locale/zh.json +6 -0
  27. package/package.json +43 -32
  28. package/src/client/bridge-scope.ts +213 -0
  29. package/src/client/card.tsx +150 -150
  30. package/src/client/history-panel.tsx +319 -319
  31. package/src/client/index.ts +465 -354
  32. package/src/client/locales.ts +857 -698
  33. package/src/client/panel.tsx +139 -118
  34. package/src/client/search/card.tsx +563 -0
  35. package/src/client/search/host-api.ts +208 -0
  36. package/src/client/search/locales.ts +780 -0
  37. package/src/client/search/manage.tsx +400 -0
  38. package/src/client/search/panel.tsx +815 -0
  39. package/src/client/search/platform.ts +136 -0
  40. package/src/config.ts +82 -33
  41. package/src/host/health/attribution.ts +118 -118
  42. package/src/host/health/lossless.ts +128 -128
  43. package/src/host/health/source-kind.ts +350 -350
  44. package/src/host/history/archive-source.ts +250 -202
  45. package/src/host/history/archive.ts +249 -194
  46. package/src/host/history/favorites.ts +71 -0
  47. package/src/host/history/purge.ts +370 -370
  48. package/src/host/index/archive-source.ts +90 -0
  49. package/src/host/index/engine.ts +571 -0
  50. package/src/host/index/extract.ts +272 -0
  51. package/src/host/index/peers.ts +62 -0
  52. package/src/host/index/rebuild.ts +368 -0
  53. package/src/host/index/schema.ts +136 -0
  54. package/src/host/index/snapshot.ts +135 -0
  55. package/src/host/index/sync.ts +286 -0
  56. package/src/host/registry/archive-registry.ts +317 -0
  57. package/src/host/settings-bridge.ts +237 -0
  58. package/src/index.ts +1421 -532
  59. package/README.de.md +0 -120
  60. package/README.es.md +0 -120
  61. package/README.fr.md +0 -120
  62. package/README.it.md +0 -120
  63. package/README.ru.md +0 -120
package/INSTALL.md CHANGED
@@ -1,179 +1,164 @@
1
- # Installation Guide (Official DSH CLI)
2
-
3
- This guide uses only the official DSH `dsh plugin` command. That command installs the dependency into a profile and synchronizes `dsh.profile.bundles`. Do not replace it with plain `npm install`, a direct `pnpm add` in the profile, or manual edits to the profile manifest.
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
- The placeholders in this guide are:
33
-
34
- - `<profile>`: the DSH profile to modify, usually `web`;
35
- - `dsh-manage-session`: the npm package and runtime plugin ID.
36
-
37
- > **Supported DSH range: `>=0.1.0-rc.6 <0.2.0-0`.**
38
- >
39
- > This is the range declared in `engines.dsh` of both `package.json` and `dsh.plugin.json`, and it matches the `^0.1.0-rc.6` floor this plugin already declares for its own `@deepseek-ai/dsh-client-ui-slots` dependency. Check the running version with `dsh --version` before installing.
40
-
41
- ## 0. Prerequisites and profile discovery
42
-
43
- ```bash
44
- echo "DSH_HOME=${DSH_HOME:-$HOME/.dsh}"
45
- dsh --version
46
- ls "${DSH_HOME:-$HOME/.dsh}/profiles"
47
- ```
48
-
49
- Use the profile named by your running DSH process. `web` is common, but the active `--profile` argument is authoritative.
50
-
51
- ## 1. Official installation
52
-
53
- ```bash
54
- dsh plugin --profile <profile> add dsh-manage-session -w
55
- ```
56
-
57
- (the `-w` flag is required when the profile is a pnpm workspace root, as `web` is.)
58
-
59
- Install a specific version explicitly:
60
-
61
- ```bash
62
- dsh plugin --profile <profile> add dsh-manage-session@0.1.0-alpha.6 -w
63
- ```
64
-
65
- The official CLI updates the profile dependency, the lockfile, and `dsh.profile.bundles` automatically. Do not add a manual YAML row.
66
-
67
- ### Supply-chain cooling period
68
-
69
- The DSH runtime uses pnpm 11, whose `minimumReleaseAge` policy may block a freshly published version with `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION`. Add the version to `minimumReleaseAgeExclude` in `~/.dsh/profiles/<profile>/pnpm-workspace.yaml`:
70
-
71
- ```yaml
72
- minimumReleaseAgeExclude:
73
- - dsh-manage-session@0.1.0-alpha.6
74
- ```
75
-
76
- ## 2. Restart the host
77
-
78
- **A DSH restart is required after installing or upgrading.** Refreshing the browser page is not enough: the host half registers the `/session-steward/api` routes and the settings namespace at startup, and the host must reload the archive source before it reflects a prune.
79
-
80
- ## 3. Upgrade
81
-
82
- ```bash
83
- dsh plugin --profile <profile> update dsh-manage-session -w
84
- ```
85
-
86
- Restart DSH afterwards.
87
-
88
- ## 4. Local-path / `link:` registration (alternative)
89
-
90
- For development or offline installs, register the plugin from a local checkout:
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
- Or use the official CLI with a local path (no network needed):
103
-
104
- ```bash
105
- dsh plugin --profile <profile> add /absolute/path/to/dsh-manage-session -w
106
- ```
107
-
108
- Building from a source checkout uses these scripts:
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/` is not committed, so a source checkout must be built before it can be registered by path. Publishing builds it automatically through the `prepublishOnly` hook.
118
-
119
- ## 5. Verify installation
120
-
121
- Check the dependency and the installed version:
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
- Check the official composition:
130
-
131
- ```bash
132
- dsh --profile <profile> --dump-default-config
133
- ```
134
-
135
- It must contain:
136
-
137
- ```yaml
138
- - id: dsh-manage-session
139
- name: dsh-manage-session
140
- ```
141
-
142
- ## 6. Verify the plugin
143
-
144
- After the restart, the sidebar entry `dsh-manage-session` is available and the settings section uses the `session-steward` namespace. Confirm:
145
-
146
- 1. Both tabs render — **Retirement Home** and **Checkup** — while both feature gates are on.
147
- 2. Turning `historyFiles` off removes the Retirement Home tab and makes every `session-history-*` call return an explicit disabled error.
148
- 3. Turning `healthCheck` off removes the Checkup tab and makes every `session-health-*` call return an explicit disabled error.
149
- 4. An unrecognized method on `/session-steward/api` returns an explicit error rather than succeeding silently.
150
-
151
- Closed domains return `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }` — the plugin does not leave empty shells behind.
152
-
153
- ## 7. Troubleshooting
154
-
155
- | Symptom | Action |
156
- | --- | --- |
157
- | `dsh` is not found | Install or enable the official DSH CLI. |
158
- | `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION` | Add the version to `minimumReleaseAgeExclude` in the profile's `pnpm-workspace.yaml`. |
159
- | Tabs or routes missing after install | Restart the host process — a page refresh does not re-register routes. |
160
- | Changes to the archive set are not visible | Restart the host; the archive source is read at startup. |
161
- | `session-history-*` returns a disabled error | The `historyFiles` gate is off. Re-enable it in the plugin settings. |
162
- | `session-health-*` returns a disabled error | The `healthCheck` gate is off. Re-enable it in the plugin settings. |
163
- | Stale client bundle after an upgrade | Hard-refresh the browser (Ctrl+Shift+R). |
164
-
165
- ## 8. Remove
166
-
167
- ```bash
168
- dsh plugin --profile <profile> remove dsh-manage-session
169
- ```
170
-
171
- Restart DSH afterwards.
172
-
173
- ## Removal does not undo repairs
174
-
175
- The plugin never rewrites session logs, history data, or silently drops fields. The only irreversible-looking action it takes — quarantining a damaged projection-cache record — copies a backup first, and the quarantine directory is left on disk for you to restore from. Removing the plugin therefore leaves any quarantine you asked for in place; restore it manually if you want the state back.
176
-
177
- ## License
178
-
179
- MIT
1
+ # Installation Guide (Official DSH CLI)
2
+
3
+ This guide uses only the official DSH `dsh plugin` command. That command installs the dependency into a profile and synchronizes `dsh.profile.bundles`. Do not replace it with plain `npm install`, a direct `pnpm add` in the profile, or manual edits to the profile manifest.
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
+ The placeholders in this guide are:
18
+
19
+ - `<profile>`: the DSH profile to modify, usually `web`;
20
+ - `dsh-manage-session`: the npm package and runtime plugin ID.
21
+
22
+ > **Supported DSH range: `>=0.1.0-rc.6 <0.2.0-0`.**
23
+ >
24
+ > This is the range declared in `engines.dsh` of both `package.json` and `dsh.plugin.json`, and it matches the `^0.1.0-rc.6` floor this plugin already declares for its own `@deepseek-ai/dsh-client-ui-slots` dependency. Check the running version with `dsh --version` before installing.
25
+
26
+ ## 0. Prerequisites and profile discovery
27
+
28
+ ```bash
29
+ echo "DSH_HOME=${DSH_HOME:-$HOME/.dsh}"
30
+ dsh --version
31
+ ls "${DSH_HOME:-$HOME/.dsh}/profiles"
32
+ ```
33
+
34
+ Use the profile named by your running DSH process. `web` is common, but the active `--profile` argument is authoritative.
35
+
36
+ ## 1. Official installation
37
+
38
+ ```bash
39
+ dsh plugin --profile <profile> add dsh-manage-session -w
40
+ ```
41
+
42
+ (the `-w` flag is required when the profile is a pnpm workspace root, as `web` is.)
43
+
44
+ Install a specific version explicitly:
45
+
46
+ ```bash
47
+ dsh plugin --profile <profile> add dsh-manage-session@0.1.0-alpha.6 -w
48
+ ```
49
+
50
+ The official CLI updates the profile dependency, the lockfile, and `dsh.profile.bundles` automatically. Do not add a manual YAML row.
51
+
52
+ ### Supply-chain cooling period
53
+
54
+ The DSH runtime uses pnpm 11, whose `minimumReleaseAge` policy may block a freshly published version with `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION`. Add the version to `minimumReleaseAgeExclude` in `~/.dsh/profiles/<profile>/pnpm-workspace.yaml`:
55
+
56
+ ```yaml
57
+ minimumReleaseAgeExclude:
58
+ - dsh-manage-session@0.1.0-alpha.6
59
+ ```
60
+
61
+ ## 2. Restart the host
62
+
63
+ **A DSH restart is required after installing or upgrading.** Refreshing the browser page is not enough: the host half registers the `/session-steward/api` routes and the settings namespace at startup, and the host must reload the archive source before it reflects a prune.
64
+
65
+ ## 3. Upgrade
66
+
67
+ ```bash
68
+ dsh plugin --profile <profile> update dsh-manage-session -w
69
+ ```
70
+
71
+ Restart DSH afterwards.
72
+
73
+ ## 4. Local-path / `link:` registration (alternative)
74
+
75
+ For development or offline installs, register the plugin from a local checkout:
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
+ Or use the official CLI with a local path (no network needed):
88
+
89
+ ```bash
90
+ dsh plugin --profile <profile> add /absolute/path/to/dsh-manage-session -w
91
+ ```
92
+
93
+ Building from a source checkout uses these scripts:
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/` is not committed, so a source checkout must be built before it can be registered by path. Publishing builds it automatically through the `prepublishOnly` hook.
103
+
104
+ ## 5. Verify installation
105
+
106
+ Check the dependency and the installed version:
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
+ Check the official composition:
115
+
116
+ ```bash
117
+ dsh --profile <profile> --dump-default-config
118
+ ```
119
+
120
+ It must contain:
121
+
122
+ ```yaml
123
+ - id: dsh-manage-session
124
+ name: dsh-manage-session
125
+ ```
126
+
127
+ ## 6. Verify the plugin
128
+
129
+ After the restart, the sidebar entry `dsh-manage-session` is available and the settings section uses the `session-steward` namespace. Confirm:
130
+
131
+ 1. Both tabs render — **Retirement Home** and **Checkup** — while both feature gates are on.
132
+ 2. Turning `historyFiles` off removes the Retirement Home tab and makes every `session-history-*` call return an explicit disabled error.
133
+ 3. Turning `healthCheck` off removes the Checkup tab and makes every `session-health-*` call return an explicit disabled error.
134
+ 4. An unrecognized method on `/session-steward/api` returns an explicit error rather than succeeding silently.
135
+
136
+ Closed domains return `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }` — the plugin does not leave empty shells behind.
137
+
138
+ ## 7. Troubleshooting
139
+
140
+ | Symptom | Action |
141
+ | --- | --- |
142
+ | `dsh` is not found | Install or enable the official DSH CLI. |
143
+ | `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION` | Add the version to `minimumReleaseAgeExclude` in the profile's `pnpm-workspace.yaml`. |
144
+ | Tabs or routes missing after install | Restart the host process — a page refresh does not re-register routes. |
145
+ | Changes to the archive set are not visible | Restart the host; the archive source is read at startup. |
146
+ | `session-history-*` returns a disabled error | The `historyFiles` gate is off. Re-enable it in the plugin settings. |
147
+ | `session-health-*` returns a disabled error | The `healthCheck` gate is off. Re-enable it in the plugin settings. |
148
+ | Stale client bundle after an upgrade | Hard-refresh the browser (Ctrl+Shift+R). |
149
+
150
+ ## 8. Remove
151
+
152
+ ```bash
153
+ dsh plugin --profile <profile> remove dsh-manage-session
154
+ ```
155
+
156
+ Restart DSH afterwards.
157
+
158
+ ## Removal does not undo repairs
159
+
160
+ The plugin never rewrites session logs, history data, or silently drops fields. The only irreversible-looking action it takes — quarantining a damaged projection-cache record — copies a backup first, and the quarantine directory is left on disk for you to restore from. Removing the plugin therefore leaves any quarantine you asked for in place; restore it manually if you want the state back.
161
+
162
+ ## License
163
+
164
+ MIT