dsh-plugin-external-session-sync 1.2.1 → 1.10.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.md CHANGED
@@ -1,38 +1,114 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.2 — 2026-11-30
4
+
5
+ ### Fixed
6
+
7
+ - **One Antigravity chat no longer appears as a dozen entries.** Antigravity creates a separate
8
+ cascade database for parallel branches of the same request, so one conversation surfaced as many
9
+ rows sharing a title. Discovery now groups databases that share the workspace, the first user
10
+ prompt and a ten-minute window into one entry (`variants` records how many branches existed), and
11
+ reading imports the most complete branch once instead of concatenating duplicated prompts.
12
+ On the development machine the list dropped from 96 rows to 81, with the review conversation's
13
+ twelve rows collapsing to its two real sessions.
14
+
3
15
  All notable changes to `dsh-plugin-external-session-sync`.
4
16
 
5
- ## 1.2.1 — 2026-11-10
17
+ ## 1.10.0 — 2026-11-30
18
+
19
+ ### Fixed
20
+
21
+ - **Antigravity imports now include the real assistant replies**, not just reasoning. The reader
22
+ uses the same verified path as `dsh-conversation-sync`: `brain/<session>/.system_generated/
23
+ logs/transcript.jsonl`, where `USER_INPUT` / `PLANNER_RESPONSE` records carry the visible
24
+ dialogue. The old path read `conversations/<id>.db`'s `steps` table, which only stores reasoning.
25
+ - Sessions with `<USER_REQUEST>` wrappers are unwrapped; `CHECKPOINT`, `GENERIC`, `SYSTEM` and our
26
+ own `dshSyncId` lines are filtered, so a write-back never echoes into a later import.
27
+ - Workspace (`cwd`) is recovered from the paired cascade database's `trajectory_metadata_blob`:
28
+ 84 of 92 sessions now show their project.
29
+ - Tool results are sanitized to lossless JSON (non-finite numbers dropped), fixing
30
+ `value is not lossless JSON` on `/status` and `/conversation`.
31
+
32
+ ### Added
33
+
34
+ - `appendAntigravityTurns()` in `readers-antigravity.js`: append-only write-back to the transcript
35
+ with a byte backup (`*.dsh-sync-backup-<epoch>`), a re-read verification and `dshSyncId` markers.
36
+
37
+ ## 1.9.0 — 2026-11-29
6
38
 
7
- ### Fixed
39
+ ### Added
40
+
41
+ - **Antigravity support.** A third source joins Codex and Claude Code in the picker. Each Antigravity
42
+ conversation is one SQLite database under `~/.gemini/antigravity{,-ide}/conversations/<cascade-id>.db`;
43
+ the reader walks `steps.step_payload` (protobuf) for the user prompt (`step_type 14`), the model's
44
+ reasoning (`15`), the turn summary (`23`) and the event time (field `5`), and recovers the project
45
+ from the `file://` root stored in `trajectory_metadata_blob`. Opened with SQLite's read-only flag;
46
+ listing is cached by file size + mtime, so a refresh costs ~10 ms warm.
47
+ - Both Antigravity profiles are scanned: the desktop IDE and the standalone agent.
48
+
49
+ ### Verified
50
+
51
+ - 96 stored conversations discovered on the development machine (87 agent + 9 IDE) with titles,
52
+ projects and timestamps.
53
+ - One conversation imported end to end: 4 messages, workspace `e:\HS——ocean` attached, `/validate` OK.
54
+ - Four new tests cover title selection, markdown-structure rejection and `file://` workspace recovery
55
+ (32 total).
56
+
57
+ ### Known limitation
58
+
59
+ - Antigravity does not persist the assistant reply it renders; the sidecar `.pb` files are encrypted
60
+ (8.00 bits/byte). Imports carry prompts plus the `【思考】` reasoning trace, not final answers.
61
+
62
+
63
+
64
+ ## 1.8.0 — 2026-11-10
65
+
66
+ ### Changed
67
+
68
+ - Session reads go through DSH's supported API first: `sessionPersistence.open(id, 'read')`
69
+ returns the validated header and events, so the plugin no longer depends on
70
+ `sessionController.inspect` (removed upstream) or on decoding the log format itself.
71
+ - The raw-log decoder stays as a fallback for logs the current build refuses to restore,
72
+ and a missing or failing `open()` degrades instead of throwing.
73
+ - Fork ancestry reads the header through the same API-first path (`readHeaderAny`).
74
+
75
+ ### Verified
8
76
 
9
- - **The plugin could not activate on current DSH.** `POST /external-session-sync/sync` was
10
- registered twice, so the Host row failed with `duplicate exact route` and nothing mounted.
11
- - **Every session read failed with 500.** `sessionController.inspect` no longer exists on
12
- current DSH; stored sessions are now read through `sessionPersistence.open(id, 'read')`,
13
- which returns the validated header and events and closes the handle afterwards.
14
- - `/health` and `client-mounted` now report the real version instead of `1.0.0`.
77
+ - `readSessionAny` closes every handle it opens, falls back when the service refuses a log,
78
+ and tolerates a service without `open()` — covered by three new tests (28 total).
79
+ - Test fixtures now expose `open()` so the suite exercises the same path as production.
15
80
 
16
81
  ### Credits
17
82
 
18
83
  - **Thanks to [@rumeng2580](https://github.com/rumeng2580)** — PR
19
- [#1](https://github.com/s17765152890-gif/dsh-plugin-external-session-sync/pull/1) diagnosed
20
- both root causes and proposed the `sessionPersistence.open(id, 'read')` fix that this release
21
- ships. The duplicate-route failure in particular meant 1.2.0 was unusable on a recent build.
84
+ [#1](https://github.com/s17765152890-gif/dsh-plugin-external-session-sync/pull/1) identified
85
+ that `sessionController.inspect` had been removed upstream and that reading through
86
+ `sessionPersistence.open(id, 'read')` is the supported replacement. This feature branch now
87
+ uses the same API-first path, with the decoded log demoted to a fallback.
22
88
 
23
89
  ## 1.2.0 — 2026-11-06
24
90
 
25
91
  ### Added
26
92
 
27
- - **Permanent deletion of archived sessions.** `POST /external-session-sync/delete-archived`
28
- removes the archived session log under `$DSH_HOME/sessions/<project>/<session-id>` and the
29
- plugin's plain-text archive, then records a tombstone. Dry run unless `dryRun:false`.
30
- - Never touches pinned, currently-open, non-archived or already-deleted sessions.
31
- - Every path is validated as `<sessions-root>/<one project slot>/<session-id>` before it is removed.
32
- - Each run writes a journal at `$DSH_HOME/external-session-sync/deletions-<timestamp>.json`.
33
- - `/unarchive` now refuses a tombstoned id instead of surfacing an unreadable chat.
34
- - Sidebar footer action **删除已归档**: two confirmation dialogs, then deletes and reports the
35
- reclaimed byte count.
93
+ - Reverse sync (`POST /external-session-sync/reverse`, dry run by default): appends the
94
+ turns that exist only inside a DSH session back into the Codex conversation it was
95
+ imported from. Codex rollout files are append-only, each write is preceded by a byte
96
+ backup (`*.reverse-sync-backup-<epoch>`) and followed by a re-read that must show the new
97
+ records, and the payloads mirror what Codex itself writes.
98
+ - Fork resolution: a DSH "fork conversation" copies its parent and records `parentSession`
99
+ in the session header. The fork's seeded prefix is proved equal to the parent before any
100
+ write, and the Codex thread is taken from the imported ancestor's mapping, so a fork syncs
101
+ back to the same "main" conversation.
102
+ - DSH runtime context (`<system-reminder>`, the runtime snapshot, the skill catalog, the
103
+ turn timestamp) is filtered out of user messages: it is not user speech and must never be
104
+ written into another tool's history.
105
+
106
+ ### Safety
107
+
108
+ - An unscoped request is refused (HTTP 400): reverse sync only ever touches the sessions
109
+ named in `sessionIds`.
110
+ - Threads whose rollout file no longer exists are reported instead of being recreated.
111
+ - `entry.reversed` records what was written, so a repeated request does not duplicate turns.
36
112
 
37
113
  ## 1.1.1 — 2026-11-02
38
114
 
@@ -113,4 +189,4 @@ All notable changes to `dsh-plugin-external-session-sync`.
113
189
  - Web panel with source picker, search, per-session and bulk sync, and "continue in DSH".
114
190
  - Bulk archival for old sessions (1 / 3 / 6 / 12 months), pinned sessions never archived,
115
191
  empty projects unregistered only after a real archive in the same request.
116
- - Three agent tools: `codex_sync_status`, `codex_sync_import`, `codex_read_conversation`.
192
+ - Three agent tools: `codex_sync_status`, `codex_sync_import`, `codex_read_conversation`.
package/README.md CHANGED
@@ -1,129 +1,131 @@
1
- ![External Session Sync — import Codex and Claude Code conversations into DSH, continue work, and archive older sessions](assets/external-session-sync-hero.png)
2
-
3
- # dsh-plugin-external-session-sync
4
-
5
- A standard DSH (DeepSeek Harness) plugin bundle that imports **Codex** and **Claude Code** conversation history into **native DSH sessions**, verifies that each imported chat is registered in its project, and lets you continue the work inside DSH. It also ships **bulk archival** for old sessions.
6
-
7
- > DSH plugin, not a standalone app. It runs inside a DSH profile: one Host row (routes + agent tools) and one browser bundle (the panel and the sidebar actions).
8
-
9
- ## Features
10
-
11
- - **One import list for both sources.** Codex rollouts and Claude Code JSONL are read directly, read-only.
12
- - **Complete Codex history.** A single Codex thread is often split across many `rollout-*.jsonl` files; the reader merges every segment of the thread and sorts by timestamp, so an import contains the newest turns instead of only the first rollout.
13
- - **Uses Codex's own thread index.** Discovery reads `state_5.sqlite` so archived and continuation threads are not silently dropped, and it also finds a rollout that exists on disk before Codex indexes it.
14
- - **Native imports only.** Each chat is created through DSH's Session, Session Persistence, Session Controller and Workspace Registry APIs. No hand-written session log, no edited workspace index.
15
- - **Verified project membership.** "Synced" means the body is readable, the **original session id** resumed, and the chat is registered in its project. Re-running sync repairs a missing registration without rewriting history.
16
- - **Work handoff.** From the panel you can open the imported native session and keep working in it with DSH's own composer.
17
- - **Idempotent snapshots.** Same source revision → skip. New source revision → a new native session, so a chat you already continued is never overwritten.
18
- - **Bulk archival.** Archive old sessions by age (1 / 3 / 6 / 12 months), pinned sessions are never archived, and a project whose members are all archived can be unregistered so the sidebar has no empty projects. Chat bodies, session logs and directories are kept.
19
- - **Agent tools.** `codex_sync_status`, `codex_sync_import`, `codex_read_conversation`.
20
-
21
- ## Install
22
-
23
- Install the directory as a DSH bundle (Plugin Manager → install bundle from a local package directory), or add the row by hand to your profile patch:
24
-
25
- ```yaml
26
- - insert:
27
- - id: external-session-sync-native
28
- name: dsh-plugin-external-session-sync
29
- ```
30
-
31
- Requirements: DSH with the Web client, Node.js 22.5+ (the readers use the built-in `node:sqlite`, and degrade to filesystem-only discovery when it is unavailable).
32
-
33
- ## Use
34
-
35
- 1. Click **Codex 同步 / External Sync** in the left sidebar, or **会话同步** in a chat header.
36
- 2. Pick **Codex** or **Claude**, search by title or project directory.
37
- 3. **同步所选** imports the selected conversation, **同步全部** imports every normal conversation of that source.
38
- 4. The result line reports `新增 / 已同步 / 修复项目关联 / 失败`.
39
- 5. **在 DSH 继续** opens the imported native session and hands the work over to DSH.
40
-
41
- Archive buttons:
42
-
43
- - Panel row: month selector (**1 month** by default) + **归档旧会话** — archives synced conversations of the current source.
44
- - Sidebar footer: **旧会话归档** — archives **native DSH sessions only**, older than 1 month, with a confirmation dialog.
45
-
46
- ## Where data lives
47
-
48
- | Path | Purpose |
49
- | --- | --- |
50
- | `$DSH_HOME/storages/external-session-sync-v1.json` | external id → native session id map |
51
- | `$DSH_HOME/external-session-sync/archives/<session-id>.json` | plain-text archive of the imported messages |
52
- | `$DSH_HOME/external-session-sync/runtime.log` | runtime log |
53
-
54
- Source history is never modified: `.codex/` and `.claude/` are opened read-only.
55
-
56
- ## What is imported
57
-
58
- Visible user and assistant text, title, and working directory. Tool calls, hidden reasoning and binary attachments are **not** replayed as actions. Only text is imported, so a chat with paths or secrets inside its transcript carries that text with it — remember that when you publish or share a synced profile.
59
-
60
- ## Security notes
61
-
62
- - HTTP routes are bound to the local DSH web server and reject non-loopback `Origin`s and POSTs without the `x-dsh-sync` header.
63
- - The plugin never stores credentials. It does not read provider configuration.
64
- - Archiving uses DSH's registry, so it is reversible with `workspaceRegistry.unarchiveSession`.
65
- - `deleteEmptyWorkspaces` only runs after a real archive in the same request; an empty request can never unregister projects.
66
-
67
- ## Session format compatibility
68
-
69
- DSH records the first surface event of a session as its **protected system head** and rejects
70
- any later `system/message` when no head was recorded
71
- (`system/message requires a protected first surface head`). Continuing an imported chat makes
72
- the runtime append its own system message, so an import that starts with a user message
73
- corrupts the log on the first continued turn.
74
-
75
- Imports therefore open with `turn/start -> step/start -> system/message` (role `system`,
76
- source `system-prompt`, carrying an id) and only then the transcript.
77
-
78
- `POST /external-session-sync/self-check` runs the generated shape through DSH's own session
79
- validator, once as written and once with the appended runtime system message, so a profile
80
- upgrade cannot silently break imports.
81
-
82
- Sessions imported by versions before 1.0.2 lack that head and can still corrupt when continued.
83
-
84
- ### Migrating older imports
85
-
86
- `GET /external-session-sync/legacy-imports` lists every mapping whose log has no protected
87
- head, split into re-importable and no-longer-recoverable ones. `POST
88
- /external-session-sync/migrate-heads` archives the old session and re-imports the same source
89
- conversation under a new identity, in batches:
90
-
91
- ```bash
92
- curl -s -XPOST -H 'x-dsh-sync: 1' -H 'content-type: application/json' \
93
- -d '{"dryRun":true}' http://127.0.0.1:<port>/external-session-sync/migrate-heads
94
- curl -s -XPOST -H 'x-dsh-sync: 1' -H 'content-type: application/json' \
95
- -d '{"dryRun":false,"limit":30}' http://127.0.0.1:<port>/external-session-sync/migrate-heads
96
- ```
97
-
98
- Repeat until `remaining` reaches 0 or a batch reports no progress. Mappings whose source
99
- history is gone are never touched. Archiving is reversible with
100
- `workspaceRegistry.unarchiveSession(oldSessionId)`, and each run appends a rollback journal at
1
+ ![External Session Sync — import Codex and Claude Code conversations into DSH, continue work, and archive older sessions](assets/external-session-sync-hero.png)
2
+
3
+ # dsh-plugin-external-session-sync
4
+
5
+ A standard DSH (DeepSeek Harness) plugin bundle that imports **Codex** and **Claude Code** conversation history into **native DSH sessions**, verifies that each imported chat is registered in its project, and lets you continue the work inside DSH. It also ships **bulk archival** for old sessions.
6
+
7
+ > DSH plugin, not a standalone app. It runs inside a DSH profile: one Host row (routes + agent tools) and one browser bundle (the panel and the sidebar actions).
8
+
9
+ ## Features
10
+
11
+ - **Three sources in one list: Codex, Claude Code and Antigravity.** Codex rollouts, Claude Code JSONL and Antigravity's per-conversation SQLite databases are all read directly and read-only.
12
+ - **Honest Antigravity fidelity.** Antigravity stores the user prompt, the model's reasoning and a turn summary in `~/.gemini/antigravity{,-ide}/conversations/<id>.db`; the assistant reply the UI renders is not persisted (the sidecar `.pb` files are encrypted, 8.00 bits/byte). Antigravity imports therefore carry the prompts plus the reasoning trace, marked `【思考】`, and the project comes from the `file://` root recorded in `trajectory_metadata_blob`.
13
+ - **Complete Codex history.** A single Codex thread is often split across many `rollout-*.jsonl` files; the reader merges every segment of the thread and sorts by timestamp, so an import contains the newest turns instead of only the first rollout.
14
+ - **Uses Codex's own thread index.** Discovery reads `state_5.sqlite` so archived and continuation threads are not silently dropped, and it also finds a rollout that exists on disk before Codex indexes it.
15
+ - **Native imports only.** Each chat is created through DSH's Session, Session Persistence, Session Controller and Workspace Registry APIs. No hand-written session log, no edited workspace index.
16
+ - **Verified project membership.** "Synced" means the body is readable, the **original session id** resumed, and the chat is registered in its project. Re-running sync repairs a missing registration without rewriting history.
17
+ - **Work handoff.** From the panel you can open the imported native session and keep working in it with DSH's own composer.
18
+ - **Idempotent snapshots.** Same source revision → skip. New source revision → a new native session, so a chat you already continued is never overwritten.
19
+ - **Bulk archival.** Archive old sessions by age (1 / 3 / 6 / 12 months), pinned sessions are never archived, and a project whose members are all archived can be unregistered so the sidebar has no empty projects. Chat bodies, session logs and directories are kept.
20
+ - **Agent tools.** `codex_sync_status`, `codex_sync_import`, `codex_read_conversation`.
21
+
22
+ ## Install
23
+
24
+ Install the directory as a DSH bundle (Plugin Manager → install bundle from a local package directory), or add the row by hand to your profile patch:
25
+
26
+ ```yaml
27
+ - insert:
28
+ - id: external-session-sync-native
29
+ name: dsh-plugin-external-session-sync
30
+ ```
31
+
32
+ Requirements: DSH with the Web client, Node.js 22.5+ (the readers use the built-in `node:sqlite`, and degrade to filesystem-only discovery when it is unavailable).
33
+
34
+ ## Use
35
+
36
+ 1. Click **Codex 同步 / External Sync** in the left sidebar, or **会话同步** in a chat header.
37
+ 2. Pick **Codex** or **Claude**, search by title or project directory.
38
+ 3. **同步所选** imports the selected conversation, **同步全部** imports every normal conversation of that source.
39
+ 4. The result line reports `新增 / 已同步 / 修复项目关联 / 失败`.
40
+ 5. **在 DSH 继续** opens the imported native session and hands the work over to DSH.
41
+
42
+ Archive buttons:
43
+
44
+ - Panel row: month selector (**1 month** by default) + **归档旧会话** — archives synced conversations of the current source.
45
+ - Sidebar footer: **旧会话归档** — archives **native DSH sessions only**, older than 1 month, with a confirmation dialog.
46
+
47
+ ## Where data lives
48
+
49
+ | Path | Purpose |
50
+ | --- | --- |
51
+ | `$DSH_HOME/storages/external-session-sync-v1.json` | external id → native session id map |
52
+ | `$DSH_HOME/external-session-sync/archives/<session-id>.json` | plain-text archive of the imported messages |
53
+ | `$DSH_HOME/external-session-sync/runtime.log` | runtime log |
54
+
55
+ Source history is never modified: `.codex/` and `.claude/` are opened read-only.
56
+
57
+ ## What is imported
58
+
59
+ Visible user and assistant text, title, and working directory. Tool calls, hidden reasoning and binary attachments are **not** replayed as actions. Only text is imported, so a chat with paths or secrets inside its transcript carries that text with it — remember that when you publish or share a synced profile.
60
+
61
+ ## Security notes
62
+
63
+ - HTTP routes are bound to the local DSH web server and reject non-loopback `Origin`s and POSTs without the `x-dsh-sync` header.
64
+ - The plugin never stores credentials. It does not read provider configuration.
65
+ - Archiving uses DSH's registry, so it is reversible with `workspaceRegistry.unarchiveSession`.
66
+ - `deleteEmptyWorkspaces` only runs after a real archive in the same request; an empty request can never unregister projects.
67
+
68
+ ## Session format compatibility
69
+
70
+ DSH records the first surface event of a session as its **protected system head** and rejects
71
+ any later `system/message` when no head was recorded
72
+ (`system/message requires a protected first surface head`). Continuing an imported chat makes
73
+ the runtime append its own system message, so an import that starts with a user message
74
+ corrupts the log on the first continued turn.
75
+
76
+ Imports therefore open with `turn/start -> step/start -> system/message` (role `system`,
77
+ source `system-prompt`, carrying an id) and only then the transcript.
78
+
79
+ `POST /external-session-sync/self-check` runs the generated shape through DSH's own session
80
+ validator, once as written and once with the appended runtime system message, so a profile
81
+ upgrade cannot silently break imports.
82
+
83
+ Sessions imported by versions before 1.0.2 lack that head and can still corrupt when continued.
84
+
85
+ ### Migrating older imports
86
+
87
+ `GET /external-session-sync/legacy-imports` lists every mapping whose log has no protected
88
+ head, split into re-importable and no-longer-recoverable ones. `POST
89
+ /external-session-sync/migrate-heads` archives the old session and re-imports the same source
90
+ conversation under a new identity, in batches:
91
+
92
+ ```bash
93
+ curl -s -XPOST -H 'x-dsh-sync: 1' -H 'content-type: application/json' \
94
+ -d '{"dryRun":true}' http://127.0.0.1:<port>/external-session-sync/migrate-heads
95
+ curl -s -XPOST -H 'x-dsh-sync: 1' -H 'content-type: application/json' \
96
+ -d '{"dryRun":false,"limit":30}' http://127.0.0.1:<port>/external-session-sync/migrate-heads
97
+ ```
98
+
99
+ Repeat until `remaining` reaches 0 or a batch reports no progress. Mappings whose source
100
+ history is gone are never touched. Archiving is reversible with
101
+ `workspaceRegistry.unarchiveSession(oldSessionId)`, and each run appends a rollback journal at
101
102
  `$DSH_HOME/external-session-sync/migration-<timestamp>.json`.
102
103
 
103
- ## Known limitations
104
-
105
- - Codex `state_5.sqlite` may lag behind the newest rollout; discovery compensates by scanning rollouts, but a thread whose files are all gone cannot be imported.
106
- - A conversation whose original working directory no longer exists is imported into the plugin checkout's parent directory and flagged with a warning.
107
- - Imported sessions are snapshots: continuing inside DSH does not write back to Codex or Claude Code.
108
- - Codex reasoning items and tool payloads are intentionally dropped.
109
-
110
- ## Tests
111
-
112
- ```bash
113
- node --test test/
114
- ```
115
-
116
- The suite covers thread-index discovery, multi-rollout merging, snapshot stability, missing-project repair, idempotent re-sync, dry runs, attachment failures, and the panel/footer archive selection logic. It uses temporary fixtures only — no personal data.
117
-
118
- ## 中文速览
119
-
120
- 这是一个标准 DSH 插件包:把 Codex / Claude Code 的历史会话导入为 DSH 原生会话,校验项目归属后可继续对话,并支持按时间批量归档旧会话。
121
-
122
- - 左侧「Codex 同步」打开同步页;聊天标题旁「会话同步」打开右侧上下文面板。
123
- - 同步完成需同时满足:正文可读、原会话 id 恢复成功、已登记到对应项目。
124
- - 同一版本重复同步会跳过;源会话更新则创建新快照,保护你已经接手过的会话。
125
- - 右侧面板可选择 1 / 3 / 6 / 12 个月并「归档旧会话」;左下角「旧会话归档」只作用于 DSH 原生会话。
126
- - 置顶会话永不归档;归档保留正文与文件;某项目成员全部归档后会移除该空项目注册。
127
- - 只导入可见的用户/助手文本,不回放工具调用与隐藏推理,也不修改 `.codex` / `.claude` 原始文件。
128
-
129
- MIT License.
104
+ ## Known limitations
105
+
106
+ - Codex `state_5.sqlite` may lag behind the newest rollout; discovery compensates by scanning rollouts, but a thread whose files are all gone cannot be imported.
107
+ - A conversation whose original working directory no longer exists is imported into the plugin checkout's parent directory and flagged with a warning.
108
+ - Imported sessions are snapshots: continuing inside DSH does not write back to Codex or Claude Code.
109
+ - Codex reasoning items and tool payloads are intentionally dropped.
110
+ - Antigravity imports use `brain/<session>/.system_generated/logs/transcript.jsonl` (the same path as the official client), so prompts and final assistant replies are preserved. Tool calls and system step logs are dropped.
111
+
112
+ ## Tests
113
+
114
+ ```bash
115
+ node --test test/
116
+ ```
117
+
118
+ The suite covers thread-index discovery, multi-rollout merging, snapshot stability, missing-project repair, idempotent re-sync, dry runs, attachment failures, and the panel/footer archive selection logic. It uses temporary fixtures only — no personal data.
119
+
120
+ ## 中文速览
121
+
122
+ 这是一个标准 DSH 插件包:把 Codex / Claude Code 的历史会话导入为 DSH 原生会话,校验项目归属后可继续对话,并支持按时间批量归档旧会话。
123
+
124
+ - 左侧「Codex 同步」打开同步页;聊天标题旁「会话同步」打开右侧上下文面板。
125
+ - 同步完成需同时满足:正文可读、原会话 id 恢复成功、已登记到对应项目。
126
+ - 同一版本重复同步会跳过;源会话更新则创建新快照,保护你已经接手过的会话。
127
+ - 右侧面板可选择 1 / 3 / 6 / 12 个月并「归档旧会话」;左下角「旧会话归档」只作用于 DSH 原生会话。
128
+ - 置顶会话永不归档;归档保留正文与文件;某项目成员全部归档后会移除该空项目注册。
129
+ - 只导入可见的用户/助手文本,不回放工具调用与隐藏推理,也不修改 `.codex` / `.claude` 原始文件。
130
+
131
+ MIT License.