dsh-manage-session 0.1.0-alpha.0 → 0.2.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/CHANGELOG.ja.md +159 -0
- package/CHANGELOG.ko.md +160 -0
- package/CHANGELOG.md +232 -0
- package/INSTALL.ja.md +2 -2
- package/INSTALL.ko.md +2 -2
- package/INSTALL.md +4 -4
- package/INSTALL.zh.md +4 -4
- package/README.en.md +63 -63
- package/README.ja.md +63 -63
- package/README.ko.md +61 -61
- package/README.md +96 -75
- package/dsh.plugin.json +22 -22
- package/lib/client.js +560 -120
- package/lib/index.d.ts +333 -78
- package/lib/index.js +694 -97
- package/package.json +121 -104
- package/screenshots.json +3 -3
- package/src/client/card.tsx +153 -106
- package/src/client/health-panel.tsx +397 -205
- package/src/client/history-panel.tsx +150 -35
- package/src/client/host-api.ts +177 -135
- package/src/client/index.ts +234 -198
- package/src/client/locales.ts +203 -153
- package/src/client/panel.tsx +118 -106
- package/src/config.ts +1 -1
- package/src/host/health/cache.ts +97 -0
- package/src/host/health/decode.ts +307 -307
- package/src/host/health/gates.ts +331 -312
- package/src/host/health/repair.ts +217 -126
- package/src/host/health/scan.ts +156 -114
- package/src/host/history/archive-source.ts +103 -42
- package/src/host/history/archive.ts +54 -5
- package/src/host/history/purge.ts +323 -0
- package/src/index.ts +504 -417
package/INSTALL.zh.md
CHANGED
|
@@ -44,7 +44,7 @@ dsh plugin --profile <profile> add dsh-manage-session -w
|
|
|
44
44
|
显式安装指定版本:
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
dsh plugin --profile <profile> add dsh-manage-session@0.1.0-alpha.
|
|
47
|
+
dsh plugin --profile <profile> add dsh-manage-session@0.1.0-alpha.6 -w
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
官方 CLI 会自动更新 profile 依赖、锁文件与 `dsh.profile.bundles`。不要手工添加 YAML 行。
|
|
@@ -55,7 +55,7 @@ DSH 运行时使用 pnpm 11,其 `minimumReleaseAge` 策略可能拦截刚发
|
|
|
55
55
|
|
|
56
56
|
```yaml
|
|
57
57
|
minimumReleaseAgeExclude:
|
|
58
|
-
- dsh-manage-session@0.1.0-alpha.
|
|
58
|
+
- dsh-manage-session@0.1.0-alpha.6
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
## 2. 重启宿主
|
|
@@ -128,8 +128,8 @@ dsh --profile <profile> --dump-default-config
|
|
|
128
128
|
|
|
129
129
|
重启后,侧边栏入口 `dsh-manage-session` 可用,设置区使用 `session-steward` 命名空间。请确认:
|
|
130
130
|
|
|
131
|
-
1.
|
|
132
|
-
2. 关闭 `historyFiles`
|
|
131
|
+
1. 两个开关均开启时,**养老院**与**体检**两个页签都会渲染。
|
|
132
|
+
2. 关闭 `historyFiles` 后「养老院」页签消失,且所有 `session-history-*` 调用返回显式的 disabled 错误。
|
|
133
133
|
3. 关闭 `healthCheck` 后「体检」页签消失,且所有 `session-health-*` 调用返回显式的 disabled 错误。
|
|
134
134
|
4. 对 `/session-steward/api` 调用未识别的方法时返回显式错误,而不是静默成功。
|
|
135
135
|
|
package/README.en.md
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
# dsh-manage-session (Session Steward)
|
|
2
|
-
|
|
3
|
-
A DSH web plugin for **session history files** and **session health checks**. It never touches session data itself.
|
|
4
|
-
|
|
5
|
-
- **
|
|
6
|
-
(backup + atomic replace; a DSH restart is required for the host to reload it).
|
|
7
|
-
- **Checkup (health)** — four gates → prescription (command list) → discharge (reversible repair with a
|
|
8
|
-
before/after comparison).
|
|
9
|
-
|
|
10
|
-
> Naming boundary: **this package ships no search or index features**. Search/indexing belongs to
|
|
11
|
-
> `dsh-search-index`; neither side mentions or re-interprets the other's fields.
|
|
12
|
-
|
|
13
|
-
## Install
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
dsh plugin --profile web add dsh-manage-session
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Restart the host process afterwards (refreshing the page is not enough).
|
|
20
|
-
|
|
21
|
-
## Routes
|
|
22
|
-
|
|
23
|
-
Prefix `/session-steward/api`; every method name is `session-*` (never `index-*`), and an unrecognized
|
|
24
|
-
method returns an explicit error instead of failing silently.
|
|
25
|
-
|
|
26
|
-
| Method | Domain | Purpose |
|
|
27
|
-
|---|---|---|
|
|
28
|
-
| `session-history-list` | history | list the official archive set (with source and degradation notes) |
|
|
29
|
-
| `session-history-prune` | history | bulk-remove ids from the archive array (auto backup, restart required) |
|
|
30
|
-
| `session-health-status` | health | switch state and method table (panel polling) |
|
|
31
|
-
| `session-health-scan` | health | batch checkup (defaults to non-ok sessions only) |
|
|
32
|
-
| `session-health-session` | health | one session's four-gate report plus prescription |
|
|
33
|
-
| `session-health-repair` | health | reversible repair (quarantine the projection-cache record) with before/after |
|
|
34
|
-
|
|
35
|
-
Settings namespace `session-steward`; sidebar entry id `dsh-manage-session`.
|
|
36
|
-
|
|
37
|
-
## Switches (feature gates)
|
|
38
|
-
|
|
39
|
-
| Switch | Field | When off |
|
|
40
|
-
|---|---|---|
|
|
41
|
-
| Session history files | `historyFiles` (default true) | `session-history-*` is not registered and the
|
|
42
|
-
| Health check | `healthCheck` (default true) | `session-health-*` is not registered and the Checkup tab is not rendered |
|
|
43
|
-
|
|
44
|
-
Closed domains return `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }` — no empty shells.
|
|
45
|
-
|
|
46
|
-
## Contract with `dsh-search-index`
|
|
47
|
-
|
|
48
|
-
The archive file format (`global.archivedSessionIds` of `~/.dsh/storages/workspace.json`):
|
|
49
|
-
**this plugin writes, the search-index plugin reads only**. See
|
|
50
|
-
`dsh-docs-deliverables/dsh-归档文件格式契约-20260914.md`.
|
|
51
|
-
|
|
52
|
-
## Development
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
pnpm install
|
|
56
|
-
pnpm typecheck
|
|
57
|
-
pnpm test
|
|
58
|
-
pnpm build
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## License
|
|
62
|
-
|
|
63
|
-
MIT
|
|
1
|
+
# dsh-manage-session (Session Steward)
|
|
2
|
+
|
|
3
|
+
A DSH web plugin for **session history files** and **session health checks**. It never touches session data itself.
|
|
4
|
+
|
|
5
|
+
- **Retirement Home (history files)** — browse the official archive set and prune ids in bulk
|
|
6
|
+
(backup + atomic replace; a DSH restart is required for the host to reload it).
|
|
7
|
+
- **Checkup (health)** — four gates → prescription (command list) → discharge (reversible repair with a
|
|
8
|
+
before/after comparison).
|
|
9
|
+
|
|
10
|
+
> Naming boundary: **this package ships no search or index features**. Search/indexing belongs to
|
|
11
|
+
> `dsh-search-index`; neither side mentions or re-interprets the other's fields.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
dsh plugin --profile web add dsh-manage-session
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Restart the host process afterwards (refreshing the page is not enough).
|
|
20
|
+
|
|
21
|
+
## Routes
|
|
22
|
+
|
|
23
|
+
Prefix `/session-steward/api`; every method name is `session-*` (never `index-*`), and an unrecognized
|
|
24
|
+
method returns an explicit error instead of failing silently.
|
|
25
|
+
|
|
26
|
+
| Method | Domain | Purpose |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `session-history-list` | history | list the official archive set (with source and degradation notes) |
|
|
29
|
+
| `session-history-prune` | history | bulk-remove ids from the archive array (auto backup, restart required) |
|
|
30
|
+
| `session-health-status` | health | switch state and method table (panel polling) |
|
|
31
|
+
| `session-health-scan` | health | batch checkup (defaults to non-ok sessions only) |
|
|
32
|
+
| `session-health-session` | health | one session's four-gate report plus prescription |
|
|
33
|
+
| `session-health-repair` | health | reversible repair (quarantine the projection-cache record) with before/after |
|
|
34
|
+
|
|
35
|
+
Settings namespace `session-steward`; sidebar entry id `dsh-manage-session`.
|
|
36
|
+
|
|
37
|
+
## Switches (feature gates)
|
|
38
|
+
|
|
39
|
+
| Switch | Field | When off |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| Session history files | `historyFiles` (default true) | `session-history-*` is not registered and the Retirement Home tab is not rendered |
|
|
42
|
+
| Health check | `healthCheck` (default true) | `session-health-*` is not registered and the Checkup tab is not rendered |
|
|
43
|
+
|
|
44
|
+
Closed domains return `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }` — no empty shells.
|
|
45
|
+
|
|
46
|
+
## Contract with `dsh-search-index`
|
|
47
|
+
|
|
48
|
+
The archive file format (`global.archivedSessionIds` of `~/.dsh/storages/workspace.json`):
|
|
49
|
+
**this plugin writes, the search-index plugin reads only**. See
|
|
50
|
+
`dsh-docs-deliverables/dsh-归档文件格式契约-20260914.md`.
|
|
51
|
+
|
|
52
|
+
## Development
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pnpm install
|
|
56
|
+
pnpm typecheck
|
|
57
|
+
pnpm test
|
|
58
|
+
pnpm build
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
package/README.ja.md
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
# dsh-manage-session(セッション・スチュワード)
|
|
2
|
-
|
|
3
|
-
**セッション履歴ファイル**と**セッション健康チェック**のための DSH Web プラグインです。セッションデータそのものには一切触れません。
|
|
4
|
-
|
|
5
|
-
- **カルテ室(履歴ファイル)** — 公式アーカイブ集合を閲覧し、ID を一括整理します
|
|
6
|
-
(バックアップ + アトミック置換。ホストに再読み込みさせるには DSH の再起動が必要です)。
|
|
7
|
-
- **健診(健康チェック)** — 四つのゲート → 処方(コマンド一覧)→ 退院(before/after 比較を伴う
|
|
8
|
-
可逆的な修復)。
|
|
9
|
-
|
|
10
|
-
> 命名の境界:**本パッケージは検索・インデックス機能を一切提供しません**。検索/インデックスは
|
|
11
|
-
> `dsh-search-index` に属し、双方が相手のフィールドに言及したり再解釈したりすることはありません。
|
|
12
|
-
|
|
13
|
-
## インストール
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
dsh plugin --profile web add dsh-manage-session
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
その後、ホストプロセスを再起動してください(ページの再読み込みでは不十分です)。
|
|
20
|
-
|
|
21
|
-
## ルート
|
|
22
|
-
|
|
23
|
-
プレフィックスは `/session-steward/api`。メソッド名はすべて `session-*`(`index-*` は使いません)で、
|
|
24
|
-
未知のメソッドは黙って失敗せず明示的なエラーを返します。
|
|
25
|
-
|
|
26
|
-
| メソッド | ドメイン | 用途 |
|
|
27
|
-
|---|---|---|
|
|
28
|
-
| `session-history-list` | history | 公式アーカイブ集合を一覧表示(取得元と縮退の注記付き) |
|
|
29
|
-
| `session-history-prune` | history | アーカイブ配列から ID を一括削除(自動バックアップ、再起動が必要) |
|
|
30
|
-
| `session-health-status` | health | スイッチの状態とメソッド一覧(パネルのポーリング用) |
|
|
31
|
-
| `session-health-scan` | health | 一括健診(既定では非 ok のセッションのみ) |
|
|
32
|
-
| `session-health-session` | health | 1 セッションの四ゲートレポートと処方 |
|
|
33
|
-
| `session-health-repair` | health | 可逆的な修復(プロジェクションキャッシュのレコードを隔離)と before/after 対照 |
|
|
34
|
-
|
|
35
|
-
設定名前空間は `session-steward`、サイドバーエントリ ID は `dsh-manage-session`。
|
|
36
|
-
|
|
37
|
-
## スイッチ(フィーチャーゲート)
|
|
38
|
-
|
|
39
|
-
| スイッチ | フィールド | オフのとき |
|
|
40
|
-
|---|---|---|
|
|
41
|
-
| セッション履歴ファイル | `historyFiles`(既定 true) | `session-history-*` は登録されず、カルテ室タブも描画されない |
|
|
42
|
-
| 健康チェック | `healthCheck`(既定 true) | `session-health-*` は登録されず、健診タブも描画されない |
|
|
43
|
-
|
|
44
|
-
閉じられたドメインは `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }` を返します — 空の殻は残しません。
|
|
45
|
-
|
|
46
|
-
## `dsh-search-index` との契約
|
|
47
|
-
|
|
48
|
-
アーカイブファイル形式(`~/.dsh/storages/workspace.json` の `global.archivedSessionIds`)は、
|
|
49
|
-
**本プラグインが書き込み、検索インデックスプラグインは読み取りのみ**です。詳細は
|
|
50
|
-
`dsh-docs-deliverables/dsh-归档文件格式契约-20260914.md` を参照してください。
|
|
51
|
-
|
|
52
|
-
## 開発
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
pnpm install
|
|
56
|
-
pnpm typecheck
|
|
57
|
-
pnpm test
|
|
58
|
-
pnpm build
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## ライセンス
|
|
62
|
-
|
|
63
|
-
MIT
|
|
1
|
+
# dsh-manage-session(セッション・スチュワード)
|
|
2
|
+
|
|
3
|
+
**セッション履歴ファイル**と**セッション健康チェック**のための DSH Web プラグインです。セッションデータそのものには一切触れません。
|
|
4
|
+
|
|
5
|
+
- **カルテ室(履歴ファイル)** — 公式アーカイブ集合を閲覧し、ID を一括整理します
|
|
6
|
+
(バックアップ + アトミック置換。ホストに再読み込みさせるには DSH の再起動が必要です)。
|
|
7
|
+
- **健診(健康チェック)** — 四つのゲート → 処方(コマンド一覧)→ 退院(before/after 比較を伴う
|
|
8
|
+
可逆的な修復)。
|
|
9
|
+
|
|
10
|
+
> 命名の境界:**本パッケージは検索・インデックス機能を一切提供しません**。検索/インデックスは
|
|
11
|
+
> `dsh-search-index` に属し、双方が相手のフィールドに言及したり再解釈したりすることはありません。
|
|
12
|
+
|
|
13
|
+
## インストール
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
dsh plugin --profile web add dsh-manage-session
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
その後、ホストプロセスを再起動してください(ページの再読み込みでは不十分です)。
|
|
20
|
+
|
|
21
|
+
## ルート
|
|
22
|
+
|
|
23
|
+
プレフィックスは `/session-steward/api`。メソッド名はすべて `session-*`(`index-*` は使いません)で、
|
|
24
|
+
未知のメソッドは黙って失敗せず明示的なエラーを返します。
|
|
25
|
+
|
|
26
|
+
| メソッド | ドメイン | 用途 |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `session-history-list` | history | 公式アーカイブ集合を一覧表示(取得元と縮退の注記付き) |
|
|
29
|
+
| `session-history-prune` | history | アーカイブ配列から ID を一括削除(自動バックアップ、再起動が必要) |
|
|
30
|
+
| `session-health-status` | health | スイッチの状態とメソッド一覧(パネルのポーリング用) |
|
|
31
|
+
| `session-health-scan` | health | 一括健診(既定では非 ok のセッションのみ) |
|
|
32
|
+
| `session-health-session` | health | 1 セッションの四ゲートレポートと処方 |
|
|
33
|
+
| `session-health-repair` | health | 可逆的な修復(プロジェクションキャッシュのレコードを隔離)と before/after 対照 |
|
|
34
|
+
|
|
35
|
+
設定名前空間は `session-steward`、サイドバーエントリ ID は `dsh-manage-session`。
|
|
36
|
+
|
|
37
|
+
## スイッチ(フィーチャーゲート)
|
|
38
|
+
|
|
39
|
+
| スイッチ | フィールド | オフのとき |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| セッション履歴ファイル | `historyFiles`(既定 true) | `session-history-*` は登録されず、カルテ室タブも描画されない |
|
|
42
|
+
| 健康チェック | `healthCheck`(既定 true) | `session-health-*` は登録されず、健診タブも描画されない |
|
|
43
|
+
|
|
44
|
+
閉じられたドメインは `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }` を返します — 空の殻は残しません。
|
|
45
|
+
|
|
46
|
+
## `dsh-search-index` との契約
|
|
47
|
+
|
|
48
|
+
アーカイブファイル形式(`~/.dsh/storages/workspace.json` の `global.archivedSessionIds`)は、
|
|
49
|
+
**本プラグインが書き込み、検索インデックスプラグインは読み取りのみ**です。詳細は
|
|
50
|
+
`dsh-docs-deliverables/dsh-归档文件格式契约-20260914.md` を参照してください。
|
|
51
|
+
|
|
52
|
+
## 開発
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pnpm install
|
|
56
|
+
pnpm typecheck
|
|
57
|
+
pnpm test
|
|
58
|
+
pnpm build
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## ライセンス
|
|
62
|
+
|
|
63
|
+
MIT
|
package/README.ko.md
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
# dsh-manage-session (세션 스튜어드)
|
|
2
|
-
|
|
3
|
-
**세션 히스토리 파일**과 **세션 상태 점검**을 위한 DSH 웹 플러그인입니다. 세션 데이터 자체는 건드리지 않습니다.
|
|
4
|
-
|
|
5
|
-
- **기록 보관소(히스토리 파일)** — 공식 아카이브 집합을 조회하고 id를 일괄 정리합니다
|
|
6
|
-
(백업 + 원자적 교체, 호스트가 다시 로드하려면 DSH 재시작이 필요합니다).
|
|
7
|
-
- **점검(상태)** — 네 개의 gate → 처방(명령 목록) → 퇴원(전후 비교가 포함된 되돌릴 수 있는 복구).
|
|
8
|
-
|
|
9
|
-
> 이름 경계: **이 패키지는 검색이나 인덱스 기능을 제공하지 않습니다**. 검색/인덱싱은
|
|
10
|
-
> `dsh-search-index`에 속하며, 어느 쪽도 상대방의 필드를 언급하거나 재해석하지 않습니다.
|
|
11
|
-
|
|
12
|
-
## 설치
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
dsh plugin --profile web add dsh-manage-session
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
이후 호스트 프로세스를 재시작하세요(페이지 새로고침만으로는 부족합니다).
|
|
19
|
-
|
|
20
|
-
## 라우트
|
|
21
|
-
|
|
22
|
-
접두사 `/session-steward/api`; 모든 메서드 이름은 `session-*`이며(`index-*`는 결코 아닙니다), 인식되지 않는
|
|
23
|
-
메서드는 조용히 실패하지 않고 명시적인 오류를 반환합니다.
|
|
24
|
-
|
|
25
|
-
| 메서드 | 도메인 | 목적 |
|
|
26
|
-
|---|---|---|
|
|
27
|
-
| `session-history-list` | history | 공식 아카이브 집합 조회(출처 및 성능 저하 관련 주석 포함) |
|
|
28
|
-
| `session-history-prune` | history | 아카이브 배열에서 id 일괄 제거(자동 백업, 재시작 필요) |
|
|
29
|
-
| `session-health-status` | health | 스위치 상태와 메서드 표(패널 폴링) |
|
|
30
|
-
| `session-health-scan` | health | 일괄 점검(기본값은 비정상 세션만) |
|
|
31
|
-
| `session-health-session` | health | 단일 세션의 4-gate 리포트와 처방 |
|
|
32
|
-
| `session-health-repair` | health | 되돌릴 수 있는 복구(프로젝션 캐시 레코드 격리)와 전후 비교 |
|
|
33
|
-
|
|
34
|
-
설정 네임스페이스 `session-steward`; 사이드바 항목 id `dsh-manage-session`.
|
|
35
|
-
|
|
36
|
-
## 스위치(기능 게이트)
|
|
37
|
-
|
|
38
|
-
| 스위치 | 필드 | 꺼져 있을 때 |
|
|
39
|
-
|---|---|---|
|
|
40
|
-
| 세션 히스토리 파일 | `historyFiles`(기본값 true) | `session-history-*`가 등록되지 않고 기록 보관소 탭이 렌더링되지 않습니다 |
|
|
41
|
-
| 상태 점검 | `healthCheck`(기본값 true) | `session-health-*`가 등록되지 않고 점검 탭이 렌더링되지 않습니다 |
|
|
42
|
-
|
|
43
|
-
닫힌 도메인은 `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }`를 반환합니다 — 빈 껍데기는 남지 않습니다.
|
|
44
|
-
|
|
45
|
-
## `dsh-search-index`와의 계약
|
|
46
|
-
|
|
47
|
-
아카이브 파일 형식(`~/.dsh/storages/workspace.json`의 `global.archivedSessionIds`):
|
|
48
|
-
**이 플러그인이 쓰고, search-index 플러그인은 읽기만 합니다**. `dsh-docs-deliverables/dsh-归档文件格式契约-20260914.md`를 참고하세요.
|
|
49
|
-
|
|
50
|
-
## 개발
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
pnpm install
|
|
54
|
-
pnpm typecheck
|
|
55
|
-
pnpm test
|
|
56
|
-
pnpm build
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## 라이선스
|
|
60
|
-
|
|
61
|
-
MIT
|
|
1
|
+
# dsh-manage-session (세션 스튜어드)
|
|
2
|
+
|
|
3
|
+
**세션 히스토리 파일**과 **세션 상태 점검**을 위한 DSH 웹 플러그인입니다. 세션 데이터 자체는 건드리지 않습니다.
|
|
4
|
+
|
|
5
|
+
- **기록 보관소(히스토리 파일)** — 공식 아카이브 집합을 조회하고 id를 일괄 정리합니다
|
|
6
|
+
(백업 + 원자적 교체, 호스트가 다시 로드하려면 DSH 재시작이 필요합니다).
|
|
7
|
+
- **점검(상태)** — 네 개의 gate → 처방(명령 목록) → 퇴원(전후 비교가 포함된 되돌릴 수 있는 복구).
|
|
8
|
+
|
|
9
|
+
> 이름 경계: **이 패키지는 검색이나 인덱스 기능을 제공하지 않습니다**. 검색/인덱싱은
|
|
10
|
+
> `dsh-search-index`에 속하며, 어느 쪽도 상대방의 필드를 언급하거나 재해석하지 않습니다.
|
|
11
|
+
|
|
12
|
+
## 설치
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
dsh plugin --profile web add dsh-manage-session
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
이후 호스트 프로세스를 재시작하세요(페이지 새로고침만으로는 부족합니다).
|
|
19
|
+
|
|
20
|
+
## 라우트
|
|
21
|
+
|
|
22
|
+
접두사 `/session-steward/api`; 모든 메서드 이름은 `session-*`이며(`index-*`는 결코 아닙니다), 인식되지 않는
|
|
23
|
+
메서드는 조용히 실패하지 않고 명시적인 오류를 반환합니다.
|
|
24
|
+
|
|
25
|
+
| 메서드 | 도메인 | 목적 |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| `session-history-list` | history | 공식 아카이브 집합 조회(출처 및 성능 저하 관련 주석 포함) |
|
|
28
|
+
| `session-history-prune` | history | 아카이브 배열에서 id 일괄 제거(자동 백업, 재시작 필요) |
|
|
29
|
+
| `session-health-status` | health | 스위치 상태와 메서드 표(패널 폴링) |
|
|
30
|
+
| `session-health-scan` | health | 일괄 점검(기본값은 비정상 세션만) |
|
|
31
|
+
| `session-health-session` | health | 단일 세션의 4-gate 리포트와 처방 |
|
|
32
|
+
| `session-health-repair` | health | 되돌릴 수 있는 복구(프로젝션 캐시 레코드 격리)와 전후 비교 |
|
|
33
|
+
|
|
34
|
+
설정 네임스페이스 `session-steward`; 사이드바 항목 id `dsh-manage-session`.
|
|
35
|
+
|
|
36
|
+
## 스위치(기능 게이트)
|
|
37
|
+
|
|
38
|
+
| 스위치 | 필드 | 꺼져 있을 때 |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| 세션 히스토리 파일 | `historyFiles`(기본값 true) | `session-history-*`가 등록되지 않고 기록 보관소 탭이 렌더링되지 않습니다 |
|
|
41
|
+
| 상태 점검 | `healthCheck`(기본값 true) | `session-health-*`가 등록되지 않고 점검 탭이 렌더링되지 않습니다 |
|
|
42
|
+
|
|
43
|
+
닫힌 도메인은 `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }`를 반환합니다 — 빈 껍데기는 남지 않습니다.
|
|
44
|
+
|
|
45
|
+
## `dsh-search-index`와의 계약
|
|
46
|
+
|
|
47
|
+
아카이브 파일 형식(`~/.dsh/storages/workspace.json`의 `global.archivedSessionIds`):
|
|
48
|
+
**이 플러그인이 쓰고, search-index 플러그인은 읽기만 합니다**. `dsh-docs-deliverables/dsh-归档文件格式契约-20260914.md`를 참고하세요.
|
|
49
|
+
|
|
50
|
+
## 개발
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pnpm install
|
|
54
|
+
pnpm typecheck
|
|
55
|
+
pnpm test
|
|
56
|
+
pnpm build
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 라이선스
|
|
60
|
+
|
|
61
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,75 +1,96 @@
|
|
|
1
|
-
# dsh-manage-session(会话管家 / Session Steward)
|
|
2
|
-
|
|
3
|
-
DSH Web 插件:**会话历史文件 +
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
>
|
|
9
|
-
>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
|
49
|
-
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
##
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
`
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
1
|
+
# dsh-manage-session(会话管家 / Session Steward)
|
|
2
|
+
|
|
3
|
+
DSH Web 插件:**会话历史文件 + 会话健康检查**。
|
|
4
|
+
|
|
5
|
+
- **养老院(会话历史文件)**:浏览官方归档集合,两个**独立**操作 ——
|
|
6
|
+
**取消归档状态**(只改数组,可逆)与 **清理归档文件**(真删磁盘实体,不可逆)。
|
|
7
|
+
|
|
8
|
+
> **两个操作不可互换,也不能合并**:
|
|
9
|
+
>
|
|
10
|
+
> | | 取消归档状态 | 清理归档文件 |
|
|
11
|
+
> |---|---|---|
|
|
12
|
+
> | 路由 | `session-history-prune` | `session-history-purge` |
|
|
13
|
+
> | 改什么 | 只改 `global.archivedSessionIds` | 删磁盘实体 + 改归档数组 + 改工作区成员表 |
|
|
14
|
+
> | 会话去向 | 回到侧边栏原工作区 | 从世界上消失 |
|
|
15
|
+
> | 可逆 | ✅ | ❌ |
|
|
16
|
+
>
|
|
17
|
+
> **清理必然连带取消归档** —— 否则会留下「侧边栏看不见、一取消归档就变成空会话」的僵尸 id。
|
|
18
|
+
> 体积**按行**显示(实测单条可从 0 到 23 MB),按钮给所选小计。
|
|
19
|
+
>
|
|
20
|
+
> **两条硬约束**(照做,否则操作会白做):
|
|
21
|
+
> 1. **列表与写入同源** —— 都认存储文件 `~/.dsh/storages/workspace.json`。宿主内存里的
|
|
22
|
+
> `workspaceRegistry` 是启动快照,改文件写不到它,只作为「已出文件、仍生效」的诊断面
|
|
23
|
+
> (`pendingRestart`)。
|
|
24
|
+
> 2. **操作后立刻重启 DSH** —— 存储层是全量重写、内存为准:宿主退出前**任何**归档或
|
|
25
|
+
> 工作区改动都会把旧状态整份写回,本次操作归零。
|
|
26
|
+
- **体检(健康检查 / 会话医生)**:四门体检 → 处方(命令清单)→ 出院(可逆处置 + before/after 对照)。
|
|
27
|
+
|
|
28
|
+
> 命名边界:**本插件不提供搜索与索引**。搜索/独立索引属于另一片(`dsh-search-index`),
|
|
29
|
+
> 两侧互不出现对方的子域字眼,也不互相解释对方字段。
|
|
30
|
+
|
|
31
|
+
## 安装
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
dsh plugin --profile web add dsh-manage-session
|
|
35
|
+
# 或本地开发目录
|
|
36
|
+
dsh plugin --profile web add "link:E:/test/rewrite-agently/mine-dsh-plugins/dsh-manage-session"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
安装后**必须重启宿主进程**(仅刷新页面无效)。
|
|
40
|
+
|
|
41
|
+
## 路由契约
|
|
42
|
+
|
|
43
|
+
前缀 `/session-steward/api`,方法名一律 `session-*`(**不得**与搜索索引的 `index-*` 混用);
|
|
44
|
+
未识别的方法返回显式错误,绝不静默。
|
|
45
|
+
|
|
46
|
+
| 方法 | 子域 | 作用 |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| `session-history-list` | history | 列出归档集合(存储文件优先;含来源、降级、按行体积与 `pendingRestart` 标注) |
|
|
49
|
+
| `session-history-prune` | history | **取消归档状态**:从归档数组批量移除 id(自动备份,需重启) |
|
|
50
|
+
| `session-history-purge` | history | **清理归档文件**:真删转录目录 + 投影缓存 + 两处 id(**不可逆**) |
|
|
51
|
+
| `session-health-status` | health | 开关状态与方法表(面板轮询用) |
|
|
52
|
+
| `session-health-scan` | health | 批量体检(默认只返回非 ok 的会话) |
|
|
53
|
+
| `session-health-session` | health | 单会话四门报告 + 处方 |
|
|
54
|
+
| `session-health-repair` | health | 可逆处置(隔离投影缓存记录)+ before/after |
|
|
55
|
+
|
|
56
|
+
设置命名空间:`session-steward`;侧边栏入口 id:`dsh-manage-session`。
|
|
57
|
+
|
|
58
|
+
## 两个开关(feature gate)
|
|
59
|
+
|
|
60
|
+
| 开关 | 字段 | 关闭效果 |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| 会话历史文件 | `historyFiles`(默认 true) | 不注册 `session-history-*`,不渲染「养老院」页签 |
|
|
63
|
+
| 健康检查 | `healthCheck`(默认 true) | 不注册 `session-health-*`,不渲染「体检」页签 |
|
|
64
|
+
|
|
65
|
+
关闭时对应方法返回 `{ ok: false, error: '子域已关闭(…=false):<method> 未注册' }`,**不留空壳**。
|
|
66
|
+
|
|
67
|
+
## 四门体检
|
|
68
|
+
|
|
69
|
+
| gate | 判据 | level |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| `log-integrity` | zstd 多帧扫描 → provenance 展开 → 打包行解包;seq 连续、无撕裂尾帧 | 有读取问题 `fail`;仅撕裂尾帧 `warn` |
|
|
72
|
+
| `projection-cache` | `~/.dsh/storages/session_projcache/sessions/<id>.json` 的 `minSeq` 与日志末 seq 的 lag + 未结算字段(openStep / activeStep.active / pendingTurnStart / turnBoundary=start) | 滞后且未结算 `fail`;任一 `warn` |
|
|
73
|
+
| `lossless-json` | 热态 `sessionProjections.checkpoint(session)` 逐行判定无损 JSON(undefined / 非有限数 / -0 / 稀疏洞 / 非普通原型 / 函数·Symbol·BigInt / 环) | 命中 `fail`,并给出投影 key → 归属包 |
|
|
74
|
+
| `cold-read` | 最后 `turn/end` 的原因、是否存在未收尾 open step、最后 user 消息之后是否还有 assistant 输出 | open step `fail`;interrupted/无 turn/end `warn` |
|
|
75
|
+
|
|
76
|
+
**处方**只给三件可逆的事:① 隔离损坏的投影缓存记录(先备份)② 含未结算 step 时提示等待宿主结算 ③ 输出可执行命令清单。
|
|
77
|
+
**禁止**:改写会话日志、改历史数据、静默丢弃字段。
|
|
78
|
+
|
|
79
|
+
## 与 `dsh-search-index` 的唯一契约
|
|
80
|
+
|
|
81
|
+
归档文件格式(`~/.dsh/storages/workspace.json` 的 `global.archivedSessionIds`):
|
|
82
|
+
**本插件写、搜索索引只读**。格式说明见
|
|
83
|
+
`dsh-docs-deliverables/dsh-归档文件格式契约-20260914.md`。
|
|
84
|
+
|
|
85
|
+
## 开发
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pnpm install
|
|
89
|
+
pnpm typecheck # tsc -b --pretty false
|
|
90
|
+
pnpm test # vitest run
|
|
91
|
+
pnpm build # tsc -b && tsdown → lib/index.js + lib/client.js
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 许可
|
|
95
|
+
|
|
96
|
+
MIT
|
package/dsh.plugin.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "dsh-manage-session",
|
|
3
|
-
"name": "dsh-manage-session",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"description": {
|
|
6
|
-
"en": "Session Steward: browse and bulk-prune the official session archive set, and run a four-gate session health checkup that ends in a reversible, backup-first prescription. Never rewrites session logs.",
|
|
7
|
-
"zh": "会话管家:浏览并批量清理官方会话归档集合,并对会话做四门体检,最终给出可逆、先备份的处方。不改写会话日志。"
|
|
8
|
-
},
|
|
9
|
-
"homepage": "https://github.com/drscrewdriver/dsh-manage-session",
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "https://github.com/drscrewdriver/dsh-manage-session.git"
|
|
13
|
-
},
|
|
14
|
-
"license": "MIT",
|
|
15
|
-
"engines": {
|
|
16
|
-
"dsh": ">=0.1.
|
|
17
|
-
},
|
|
18
|
-
"components": {
|
|
19
|
-
"host": "lib/index.js",
|
|
20
|
-
"client": "lib/client.js"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "dsh-manage-session",
|
|
3
|
+
"name": "dsh-manage-session",
|
|
4
|
+
"version": "0.2.3",
|
|
5
|
+
"description": {
|
|
6
|
+
"en": "Session Steward: browse and bulk-prune the official session archive set, and run a four-gate session health checkup that ends in a reversible, backup-first prescription. Never rewrites session logs.",
|
|
7
|
+
"zh": "会话管家:浏览并批量清理官方会话归档集合,并对会话做四门体检,最终给出可逆、先备份的处方。不改写会话日志。"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/drscrewdriver/dsh-manage-session",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/drscrewdriver/dsh-manage-session.git"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"engines": {
|
|
16
|
+
"dsh": ">=0.1.2-rc.1 <0.1.3-0"
|
|
17
|
+
},
|
|
18
|
+
"components": {
|
|
19
|
+
"host": "lib/index.js",
|
|
20
|
+
"client": "lib/client.js"
|
|
21
|
+
}
|
|
22
|
+
}
|