dsh-profile-config-sync 0.5.0 → 0.6.41
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/LICENSE +2 -1
- package/README.en.md +174 -738
- package/README.md +246 -571
- package/client.js +609 -292
- package/cordis.patch.yml +1 -1
- package/docs/CHANGELOG.en.md +28 -0
- package/docs/CHANGELOG.md +81 -0
- package/docs/HISTORY.en.md +221 -0
- package/docs/HISTORY.md +252 -0
- package/docs/MULTI-PLATFORM.md +165 -0
- package/docs/REFERENCE.md +172 -0
- package/index.js +1049 -189
- package/package.json +11 -5
- package/runtime/apply.ps1 +79 -33
- package/runtime/atomic-write.mjs +57 -0
- package/runtime/capture.ps1 +188 -37
- package/runtime/contract.mjs +59 -7
- package/runtime/dsh-sync-common.ps1 +361 -22
- package/runtime/install-plugin.ps1 +94 -3
- package/runtime/live-log.mjs +75 -0
- package/runtime/platform.mjs +35 -0
- package/runtime/post-exit.ps1 +192 -28
- package/runtime/restore.ps1 +76 -8
- package/runtime/sync-engine.mjs +1324 -857
- package/runtime/sync.ps1 +192 -82
- package/runtime/tools/fix-session-cwd.mjs +12 -3
- package/runtime/tools/workspace-view.mjs +7 -3
- package/runtime/webdav.mjs +269 -23
package/README.en.md
CHANGED
|
@@ -1,738 +1,174 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
|
95
|
-
|
|
96
|
-
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
- **
|
|
152
|
-
- **
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
##
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
|
167
|
-
|
|
168
|
-
|
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
## When some files never make it into the repo
|
|
177
|
-
|
|
178
|
-
Anything left out is reported in three places, so nobody has to read the log:
|
|
179
|
-
|
|
180
|
-
| Where | What you see |
|
|
181
|
-
|---|---|
|
|
182
|
-
| Post-exit progress window | A `N file(s) not synced` block printed **before** the "sync finished" banner: grouped by kind, up to 5 rows per group (kind, relative path, size, reason), with "…and N more, full list: <path>" |
|
|
183
|
-
| Config-sync panel | A permanent warning box at the bottom of the "last auto sync" card: per-kind counts, up to 30 rows, plus "they are still on this machine, just not in the repo; the next sync re-checks them" |
|
|
184
|
-
| Machine-readable | `~\.dsh\sync-notices.json` (`at/mode/total/byKind/items`, four fixed `byKind` keys) and the `notices` field of `auto-sync-result.json` |
|
|
185
|
-
|
|
186
|
-
Four `kind` values: `too-large` (over the single-file cap: skipped at capture >100 MB, unstaged before commit ≥95 MB, or not restored on pull), `history` (an oversized file already sits in local history, so the remote rejects the whole push), `skipped` (rule-based skip such as model weights or `*.whl`, or a locked file), `failed` (per-file write failure, session-header/projcache rewrite failure, or remote rejection).
|
|
187
|
-
|
|
188
|
-
### Two prechecks before pushing
|
|
189
|
-
|
|
190
|
-
1. **Index precheck**: after `git add -A`, every staged file is stat'ed; anything ≥95 MB is taken out with `git reset -- <path>`, added to `.git\info\exclude` so a later add skips it, recorded as a notice, and the rest of the commit pushes as usual — one huge file no longer blocks a whole sync. 50–95 MB only warns.
|
|
191
|
-
2. **History precheck**: `git ls-tree -r -l HEAD` is scanned; a ≥95 MB hit is reported up front as "the remote will reject the whole push (this is not a network problem)" with two ways out: ① point the panel at a fresh empty repo via "Initialize push" (config sync needs no old history), or ② rewrite history with `git filter-repo` and force-push. **Report only — history is never rewritten automatically.**
|
|
192
|
-
|
|
193
|
-
### Why a push failed
|
|
194
|
-
|
|
195
|
-
The raw `git push` output is no longer collapsed into "network/auth failure"; it is classified by signature: `File <path> is X MB; this exceeds ... limit` → file too large (paths and sizes listed); `exceeds ... quota` / `repository size` → repo quota; `[remote rejected]` / `pre-receive hook declined` → remote rejection; `Could not read from remote` / `Permission denied` / `publickey` / `Host key verification` / `Could not resolve host` / `timed out` → network or auth.
|
|
196
|
-
|
|
197
|
-
### The non-ASCII path trap (0.3.48)
|
|
198
|
-
|
|
199
|
-
`git` keeps `core.quotepath=true` by default, so non-ASCII paths come back octal-escaped and wrapped in quotes (`"workspace/DSH\347\240\264\347\224\262/..."`). The 0.3.47 index precheck read that straight from `& $git ... diff --cached --name-only`, so `Test-Path -LiteralPath` hit the `"` and threw `路径中具有非法字符` (illegal characters in path) — the whole sync died before committing.
|
|
200
|
-
|
|
201
|
-
Fix: every path-consuming git query now goes through `Read-GitLines` (`-c core.quotepath=false` + cmd byte redirect + UTF-8 read), and each per-file `stat` sits inside `try/catch` so one bad name only skips the size check instead of killing the run. Measured on the real repo: 918 staged paths, 0 quoted and 0 stat failures; the history precheck parsed all 3222 `ls-tree -r -l` lines into path plus size.
|
|
202
|
-
|
|
203
|
-
Measured (2026-11-14, isolated repo + local bare remote + fake `pre-receive` hook): a 96 MB file was unstaged while the rest pushed fine and `sync-notices.json` recorded `too-large=1`; after the same file went into history the precheck reported `history=1`; a hook replaying GitHub's message (`File big.bin is 96.00 MB; this exceeds ...`) was classified as "1 file over the cap", not as a network problem; the window summary and the panel block read the same file.
|
|
204
|
-
|
|
205
|
-
## Workspaces and sessions follow the machine too (projcache cwd fixed in 0.3.44)
|
|
206
|
-
|
|
207
|
-
Whether a workspace and its sessions work on a new machine depends on three paths being rewritten to this machine's value:
|
|
208
|
-
|
|
209
|
-
| Where | What it stores | What happens on another machine |
|
|
210
|
-
|---|---|---|
|
|
211
|
-
| `workspace\workspace-registry.json` | each workspace's location, already written as a `{{APP_ROOT}}/xxx` placeholder | expanded to this machine's path on pull, so the workspace opens in the right folder |
|
|
212
|
-
| `conversations\sessions\--ws-<id>--\...\session.v4.jsonl.zstd` | the `cwd` in the first frame of the session log | the first frame is rewritten from "where is this workspace on this machine" (only that frame - the rest of the file is untouched) |
|
|
213
|
-
| `conversations\session_projcache\<sessionId>.json` | `record.identity.cwd` | **since 0.3.44** rewritten by looking the session's workspace up through the registry's `sessionIds`; this step used to be missing, so a workspace listed fine but its history still pointed at the other machine's folder |
|
|
214
|
-
|
|
215
|
-
So "the original machine's location becomes this machine's location" is inferred like this: the registry tells you the workspace's title/slot and its shape under `{{APP_ROOT}}`, which expands to an absolute path here; sessions claim the same workspace through `sessionIds` and follow that location - never by guessing a drive letter. If it cannot be inferred (the registered path is a bare old drive path, or there is no matching entry), nothing is rewritten: the panel reports it instead of writing a guessed path.
|
|
216
|
-
|
|
217
|
-
The report produced on push is split into two groups: `scope: config` for paths inside config files, `scope: data` for records under `workspace\` and `conversations\` that still point at the other machine. The panel lists them separately ("Paths inside config files" / "Paths in workspace / session records"), and both can be accepted row by row.
|
|
218
|
-
|
|
219
|
-
### Hidden/archived workspaces no longer reappear on the other machine (0.3.75)
|
|
220
|
-
|
|
221
|
-
Workspaces and sessions you hide/archive from the config-sync panel used to show up again on machine B after a pull. Cause: DSH stores that state separately in `<DshHome>\dsh-session-manager\workspace-archives.v1.json` (`archived:true` plus the related `sessionIds`), which was never part of the sync set; the workspace registry is merged by ID (union), so a locally hidden record gets merged back in.
|
|
222
|
-
|
|
223
|
-
Since 0.3.75 this file is part of the `settings` sync: a push writes it to the repo as `settings\workspace-archives.json`, and a pull restores it to the same path on B. When B starts, DSH reads `archived:true` workspaces and filters them out of the workspace list; their sessions move to the archived group and stop showing. This is whole-file replace semantics — machine A is authoritative. Hiding is not deletion: the workspace/session files remain and can be restored by un-hiding in DSH.
|
|
224
|
-
|
|
225
|
-
### New "Workspace visibility" card in the panel (0.3.76)
|
|
226
|
-
|
|
227
|
-
A new **Workspace visibility** section brings both native DSH hiding mechanisms into one card:
|
|
228
|
-
|
|
229
|
-
| Action | Effect | Backing file |
|
|
230
|
-
|---|---|---|
|
|
231
|
-
| Visible | Workspace shown normally, all sessions visible | Drop the archive record; remove sessions from `archivedSessionIds` |
|
|
232
|
-
| Hide sessions | Workspace stays in the list, its sessions go to Archived | Sessions written to `global.archivedSessionIds` in `<DshHome>\storages\workspace.json` |
|
|
233
|
-
| Archive workspace | Workspace disappears from the list, sessions kept | `<DshHome>\dsh-session-manager\workspace-archives.v1.json` gets `archived:true` and its sessions hidden too |
|
|
234
|
-
|
|
235
|
-
Each workspace switches between the three states independently; expanding it lets you hide/show a single session without touching others (a session toggle changes only that one `archivedSessionIds` entry, never the workspace archive record). Changes do not call the session-manager Web API (it needs a DSH connection-owner credential the plugin route does not have) — they go through the host `workspaceRegistry`, which persists and pushes the session-list update, so toggles apply immediately (see 0.3.82). Since 0.3.75 the archive file is synced, so these states travel with push/pull too.
|
|
236
|
-
|
|
237
|
-
### Panel: session names, Edit button, click-to-expand and quick jump (0.3.77)
|
|
238
|
-
|
|
239
|
-
Five interaction refinements on top of the 0.3.76 "Workspace visibility" card:
|
|
240
|
-
|
|
241
|
-
1. **Session names**: each expanded session shows a readable title (from the `session/title` event, falling back to the first user message text); hover for the full session ID. Titles are cached and rebuilt from the local logs on each machine.
|
|
242
|
-
2. **Edit button**: the state dropdown and per-session Hide/Show buttons stay hidden until you click Edit on that workspace; click Done to leave edit mode, so states cannot be changed by accident. (From 0.3.84 there is a single Edit button for the whole card — see below.)
|
|
243
|
-
3. **Click to expand**: click anywhere on a workspace row to expand/collapse its sessions; no separate expand button.
|
|
244
|
-
4. **Card position**: the Workspace visibility card moved just above Feedback, as the last configuration step.
|
|
245
|
-
5. **Sticky title + quick jump**: the panel title bar is sticky, with shortcut tabs below it (Overview / Workspaces / Targets / Automation / Scripts / Restore / Content / Plugin data / Feedback); clicking one smoothly scrolls to that section.
|
|
246
|
-
|
|
247
|
-
Title reading and state changes stay self-contained in this plugin and do not call the session-manager Web API.
|
|
248
|
-
|
|
249
|
-
### Quick-jump order matches the cards; scrolling no longer hides behind the title (0.3.78)
|
|
250
|
-
|
|
251
|
-
Two display fixes on top of 0.3.77:
|
|
252
|
-
|
|
253
|
-
1. **Jump order matches section order**: the quick-jump tabs now follow the exact render order of the sections (Overview / Sync conflicts [when present] / Local paths [when expanded] / Targets / Automation & updates / Scripts / Restore / Content / Plugin data / Workspace visibility / Feedback). The two conditional sections (conflicts, local paths) appear in the tabs only when their cards are shown.
|
|
254
|
-
2. **Scroll lands below the title**: the sticky title bar now uses an opaque background (same fill as panel cards), so content no longer shows through it; jumping to a tab sets the scroll offset from the title bar's actual height, so the target section lands fully below the title instead of being covered.
|
|
255
|
-
|
|
256
|
-
### Plugin update falls back to two npm sources (0.3.89)
|
|
257
|
-
|
|
258
|
-
The "Plugin update" card now shows an **npm download URL** line with the actual fallback addresses (domestic mirror `registry.npmmirror.com` + official `registry.npmjs.org`). When the GitHub release download is unreachable (common in mainland China), the update package automatically falls back to npm. It is still verified against the authoritative sha256 in `version.json` — switching source never relaxes verification. The two sources back each other up: the mirror can briefly 404 during its first-sync window, and the official source takes over. The npm tarball is byte-identical to the GitHub release tgz (same sha256).
|
|
259
|
-
|
|
260
|
-
### Clicking × to close DSH now checks once for auto pull/push immediately (0.3.93)
|
|
261
|
-
|
|
262
|
-
With "Pull on startup" or "Push on exit" enabled, the only queues used to be the 8-second startup check and the 2-minute re-check. If you made changes between two re-checks and then clicked the top-right × to close DSH, no watcher was waiting for the exit at that moment, so nothing ran after closing. A quit hook now covers it: when the last visible window closes (the × click), the plugin checks once and queues the watcher **before** the client exits; once the DSH processes are gone the watcher runs the pull/push immediately.
|
|
263
|
-
|
|
264
|
-
1. **Check once on exit**: when no visible windows remain, call `triggerAutoSyncOnClose(config)`, which reads the `autoPull`/`autoPush` switches; an in-flight watcher is reused rather than relaunched; with an empty local repo only autoPull can queue (first clone).
|
|
265
|
-
2. **Same criteria as the re-check**: pull takes priority (behind > 0 → queue pull, no confirmation dialog on the close path); push queues when any of "commits ahead / uncommitted changes / local data newer than last sync" hits; `autoRestart` semantics unified to `!== false` (relaunch by default).
|
|
266
|
-
3. **Queue before quit**: the queue must be awaited **before** `app.quit()` — the plugin dies with the main process, so checking after quit is too late. With both switches off / nothing to sync the function returns quickly and does not slow down closing; a successful queue logs "queued pull/push before exit …: runs right after DSH exits".
|
|
267
|
-
|
|
268
|
-
### Remote "uncommitted" now includes local pending changes + Refresh really fetches (0.3.92)
|
|
269
|
-
|
|
270
|
-
Root cause found by measurement for "remote info still not updating": the git-level behind/ahead really is 0 (local HEAD matches the gitee cloud), while what the user means by "not updated" is the runtime-generated changes on this machine not yet captured into the repo. Two substantive fixes:
|
|
271
|
-
|
|
272
|
-
1. **"Uncommitted" = git work-tree changes + local pending**: the status `repo` object gains `pending` (local session/config changes not yet synced) and `uncommitted` (`dirty + pending`). Both "Remote" Kv rows in the panel use `uncommitted` for the uncommitted figure and append "(N pending on this machine)" when there are pending items. New local sessions/config changes show up immediately without waiting for DSH exit + capture.
|
|
273
|
-
2. **"Refresh" button actually fetches**: the summary-row "Refresh" button previously only re-read status (no git fetch, so behind/ahead stayed the same). It now runs `refreshRemoteNow`: first `/config-sync/auto {action:'check'}` to trigger `git fetch` and refresh remote refs, then refresh the snapshot. The 30-second auto-refresh while expanded shares the same chain.
|
|
274
|
-
|
|
275
|
-
### Settings → General → Config Sync: live remote info + Pull/Push now buttons (0.3.91)
|
|
276
|
-
|
|
277
|
-
Two adjustments to the "Settings → General → Config Sync" summary row:
|
|
278
|
-
|
|
279
|
-
1. **Remote info no longer stale**: expanding the row first requests the `check` action on `/config-sync/auto` (triggering `git fetch` to refresh `@{upstream}`) and then refreshes status, so "behind X · ahead Y · uncommitted Z" shows the latest cloud figures instead of stale ones; it refreshes every 30 seconds while expanded and stops when collapsed. Root cause: the behind/ahead counts from `@{upstream}` only update after a fetch — a plain status read never triggers one.
|
|
280
|
-
2. **Buttons replaced with Pull/Push now**: the four "Generate scripts / push only / pull only / restore only" buttons are replaced by two — **Pull now (closes DSH)** and **Push now (closes DSH)** — sharing the same `pull-now` / `push-now` queue as the main panel's Automation card: clicking queues the action, which runs after DSH exits. Buttons are gated by backend permissions (`pullAllowed` / `pushAllowed`) with hints (empty repo → push first; empty cloud → pull first), and queued/result states give Chinese feedback. The script-generation entry remains on the main panel and is no longer duplicated in the summary row.
|
|
281
|
-
|
|
282
|
-
### To-do and jump-tab display cleanup (0.3.90)
|
|
283
|
-
|
|
284
|
-
Four display adjustments to the panel:
|
|
285
|
-
|
|
286
|
-
1. **Jump tabs highlight the current position**: the quick-jump tabs now auto-highlight the topmost visible section in the scroll region (primary fill + primary text), so "where am I" is obvious at a glance; clicking a tab also lights it up immediately.
|
|
287
|
-
2. **"Local data" label removed from To-do**: the old subheading-like "Local data / 本机数据" row is gone; the To-do card presents its stats and details directly without the redundant title.
|
|
288
|
-
3. **To-do expands to concrete names**: each group (Conversations / Local profile / Skills …) is one row; click it to reveal the concrete names — sessions show the session title (or `<sessionId> (session)` when unavailable), and the local profile shows file names like `package.json`, `cordis.patch.yml`; each group is de-duplicated and capped at 50 items. The To-do card title row has an Expand / Collapse toggle, expanded by default so details are visible on entry.
|
|
289
|
-
4. **Overview description synced**: changed to "Versions, dependencies, snapshots and to-do at a glance".
|
|
290
|
-
|
|
291
|
-
### Local data moved into To-do, grouped by sync content, sessions shown by name (0.3.86)
|
|
292
|
-
|
|
293
|
-
The "Local data" row in the "Local repo" card moved into "Overview → To-do", with its presentation reorganised:
|
|
294
|
-
|
|
295
|
-
1. **Location**: the old "Local data" line at the bottom of the "Local repo" card is gone. The To-do card now shows even when nothing else is wrong — it starts with local data (last sync time / pending count / mode) and then the existing to-do suggestions. "How much is still unsynced" and "what to do about it" sit together.
|
|
296
|
-
2. **Grouped by sync content**: pending files are counted by the same twelve groups as "Sync content" — Conversations / Skills / Plugin data / Memory data / Local profile / Global prompts / Agent presets / Plugin settings & workflows / Workspace files / Extra paths, etc. Each group is a chip with a count, sorted by count descending; no more bare single total.
|
|
297
|
-
3. **Sessions shown by name**: in the "Recently changed" sample, session files show the projected session title (matching the DSH panel, e.g. "列出工作区下的文件夹") instead of a `session-xxx/session.v4.jsonl.zstd` directory id; non-session items with no title still show their parent directory / file name.
|
|
298
|
-
|
|
299
|
-
### Workspace visibility card: one Edit button for the whole card, sessions paired with their toggles (0.3.84 / 0.3.85)
|
|
300
|
-
|
|
301
|
-
The edit interaction of the "Workspace visibility" card was rebuilt:
|
|
302
|
-
|
|
303
|
-
1. **A single Edit button for the entire card** (0.3.84): previously every workspace row carried its own Edit/Done button, and once there were several rows the buttons no longer lined up with the sessions. Now there is one button on the right of the header row — "Edit" when idle, switching to "Done" (primary colour, same position) once you are editing — and it unlocks every workspace tri-state plus every session toggle at once; clicking again leaves edit mode. The per-row button is gone.
|
|
304
|
-
2. **Session/button pairing made concrete** (0.3.84): each session gets its own row with a divider between rows; in edit mode the whole row gets a background and rounded corners, framing "this session" together with "its button". The toggle sits at the end of that row with a fixed width, so a wrap never puts it next to a different session. The word and colour distinguish Hide (red) from Show (green), the `title` carries the session name, and hidden sessions get a struck-through, dimmed name (the separate "Hidden" label was dropped).
|
|
305
|
-
3. **No tinted explanation banner** (0.3.85): edit mode no longer inserts a yellow-bordered hint row above the list; whether you are editing is read from the header button alone.
|
|
306
|
-
|
|
307
|
-
### Workspace visibility card: blank sessions and idle-review parents are collapsed too (0.3.83)
|
|
308
|
-
|
|
309
|
-
On top of 0.3.82's "collapse agent child sessions by default", two more kinds of noise are folded away:
|
|
310
|
-
|
|
311
|
-
1. **Blank sessions**: entries that were created but never used — no message, no turn (empty `origin` in the session header, and the log only holds permission / sandbox / approval / session-end-seed events, no `turn/start` and no `user/message`).
|
|
312
|
-
2. **Mnemon idle-review parents**: `mnemon-review-owner-v1-*`, which carry only a `subagent/catalog` event — the actual content lives in the `mnemon-review-v1-*` child session they point at.
|
|
313
|
-
|
|
314
|
-
Both naturally satisfy the same "blank" test, so one rule folds them away; no name matching is needed. A "Show blank" checkbox in the header row brings them back, and the footer reports how many blank and how many agent sessions were collapsed. On this machine the default view drops from 99 entries to 10.
|
|
315
|
-
|
|
316
|
-
### Workspace visibility card: agent sessions collapsed by default + instant hide/show (0.3.82)
|
|
317
|
-
|
|
318
|
-
Two changes to the "Workspace visibility" card:
|
|
319
|
-
|
|
320
|
-
1. **Agent (subagent) sessions are collapsed by default**: the card lists only your own sessions. A "Show agents" checkbox in the header row reveals agent child sessions and reports how many were folded away. 80 of the 99 registered sessions on this machine were agent sessions (mnemon reviews and delegated tasks each leave one behind), flooding the list so you could not find your own.
|
|
321
|
-
2. **Hide/show takes effect immediately**: toggling the workspace tri-state or a single session used to only rewrite the on-disk state file, leaving the host's in-memory `archivedSessionIds` stale — a client restart or session-list refresh was required. It now goes through the host `workspaceRegistry` (`archiveSession` / `unarchiveSession`), which persists and pushes the session-list update, so toggles apply the moment you click. If the host service is unavailable it falls back to the previous file-based write and the card hint says which path was used.
|
|
322
|
-
|
|
323
|
-
Reading the owning workspace and the session title stays self-contained; the session-manager Web API is not used.
|
|
324
|
-
|
|
325
|
-
### Workspace visibility card session names now match the DSH panel (0.3.81)
|
|
326
|
-
|
|
327
|
-
Fixes session names in the "Workspace visibility" card differing from the DSH session panel.
|
|
328
|
-
|
|
329
|
-
DSH session titles evolve: a fallback title (truncated first message) is created first, then a provider title is generated by the model. The card previously stopped at the first fallback; it now picks the latest title by priority — provider > fallback > untagged title > first user message — matching the DSH panel exactly.
|
|
330
|
-
### Fix cross-machine sync downgrading the installed plugin and rolling back pulls (0.3.80)
|
|
331
|
-
|
|
332
|
-
Fixes an issue where pulling on another machine replaced a newer locally installed plugin with an older archive from the config repo, turning the link into 0.0.0, failing bundle resolution, and rolling the pull back.
|
|
333
|
-
|
|
334
|
-
| Problem | Fix |
|
|
335
|
-
|---|---|
|
|
336
|
-
| An older archive was still deployed because versions merely differed | Version comparison is now semantic upgrade-only: the archive is deployed only when its version is higher than the installed one |
|
|
337
|
-
| Archive top-level folder mismatched the file name (e.g. a 0.3.70 package wrapping a 0.3.56 folder), producing nested folders and a broken link | capture now validates the archive top-level folder and version after packing; bad archives are deleted with a warning instead of being synced |
|
|
338
|
-
| Stale plugin keys caused repeated plugin-missing notices | Removed invalid legacy keys from localPluginMap and cleared stale notices |
|
|
339
|
-
|
|
340
|
-
The corrupted archive in the config repo was also repacked with correct 0.3.79 content.
|
|
341
|
-
|
|
342
|
-
### The panel is now a fixed header plus an independently scrolling body (0.3.79)
|
|
343
|
-
|
|
344
|
-
0.3.78 still kept the sticky header inside the same scroll container, so two cases leaked through: with a shorter panel, or with a header that wraps onto more lines, content brushed past the header's divider and even showed up in the padding above it; and the jump offset was computed from the header height, so it shifted whenever conditional sections appeared or disappeared.
|
|
345
|
-
|
|
346
|
-
0.3.79 splits the panel in two: the header (title, badges, meta line and section tabs) now sits **outside** the scroll area, pinned at the top of the panel; below it a separate `overflow-y:auto` region holds the notices and every section card. Three direct results:
|
|
347
|
-
|
|
348
|
-
1. **Structurally impossible to leak through**: the scrolling region starts 20px under the header divider, so however far you scroll, content stays inside it — never in the header area or above it.
|
|
349
|
-
2. **Jump targets are fixed**: a section tab now just scrolls to the top of the scrolling region plus 8px, with no header-height math, so header wrapping and conditional sections no longer move the landing point.
|
|
350
|
-
3. **No more header jitter**: the header does not scroll at all, so the shadow, translucent background and padding patches are gone; a single divider line is all that is left.
|
|
351
|
-
|
|
352
|
-
The change touches only the panel itself (`S.page` / `pageInner` are used nowhere else); the sidebar row and the settings summary row are unaffected.
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
## New sessions land in the default workspace (since 0.3.28)
|
|
356
|
-
|
|
357
|
-
A finished sync brings DSH back up, and the client opens a fresh session on startup. Where that session lands is decided by `global.defaultWorkspaceId` in `<DshHome>\storages\workspace.json` — and DSH writes that value only during **first-time initialization**, so after a few syncs it can be left pointing at whatever workspace was used last.
|
|
358
|
-
|
|
359
|
-
Since 0.3.28, `post-exit.ps1` corrects that value **after the client has fully exited and before it is relaunched**. The timing is not cosmetic: the client owns that registry and writes it back on exit, so anything written earlier is lost.
|
|
360
|
-
|
|
361
|
-
| Item | Detail |
|
|
362
|
-
|---|---|
|
|
363
|
-
| Default behaviour | Auto-detect the workspace titled `default-workspace` (or whose path ends with `\deepseek-harness\default-workspace`) and point `defaultWorkspaceId` at it |
|
|
364
|
-
| Targeting another one | Set `defaultWorkspace` in `~\.dsh\dsh-config-sync.json` to a workspace ID or an absolute path |
|
|
365
|
-
| Turn it off | Set the same field to `off` (or `none`) |
|
|
366
|
-
| Safety | Only written when the value actually differs; the original is backed up as `workspace.json.bak-<timestamp>` first; the result is read back and checked (value plus workspace count); a path matching no workspace is skipped, never guessed |
|
|
367
|
-
| Side effect | A default workspace you switched by hand gets pulled back to `default-workspace` on the next sync — set `off` if you don't want that |
|
|
368
|
-
| Undo | Copy `workspace.json.bak-<timestamp>` back over `workspace.json` |
|
|
369
|
-
|
|
370
|
-
## The scripts generated in one click
|
|
371
|
-
|
|
372
|
-
"Generate push / pull / restore" can write all three at once, or one of them; when the local repo is still empty it generates pull + restore only. File names, buttons and the script text are Chinese by design.
|
|
373
|
-
|
|
374
|
-
| Script | What it does | Safety valve |
|
|
375
|
-
|---|---|---|
|
|
376
|
-
| `同步-推送.cmd` | capture this machine's config after exit and push it | first checks whether `DeepSeek Harness.exe` is still running; refuses outright when the local repo is an empty folder |
|
|
377
|
-
| `同步-拉取.cmd` | pull from the remote after exit and apply locally | same; **states how many commits ahead / uncommitted items first, and requires `y`** — it overwrites local config with the repo version |
|
|
378
|
-
| `同步-还原.cmd` | roll the profile back to the snapshot taken before a given apply | same; **runs `-DryRun` to print the plan first, writes only after `y`** |
|
|
379
|
-
| `同步-还原-<snapshot name>.cmd` | the same, but rolling back to **that specific snapshot** (generated by a row in the "Restore backup" card) | same; the file name carries the snapshot name, so several can coexist without overwriting each other |
|
|
380
|
-
|
|
381
|
-
All three bake in this machine's parameters (repo, AppRoot, `.dsh` location) and can be double-clicked. Pull and restore accept `--yes` to skip confirmation (for automation/remote control); with no confirmation they say plainly "no confirmation (y) received, exited: nothing changed on this machine" instead of exiting silently.
|
|
382
|
-
|
|
383
|
-
- **Commit note**: optional when generating the push script; passed as `-Message "..."` to `sync.ps1`, and **the timestamp is appended at run time**. Empty means the default `sync: capture <time> @ <machine>`.
|
|
384
|
-
- **Which restore snapshot**: if a snapshot exists at generation time it is written into `-BackupDir` explicitly (with time and total count); if not (fresh machine, plugin just installed) it is **left out** and `restore.ps1` picks the newest at run time — otherwise the script would stick to "there was no snapshot when it was generated". If the newest one turns out to be an empty snapshot, it walks back to the first one containing `package.json` and says so. Clicking a row in the "Restore backup" card uses the same generator and simply writes that snapshot's absolute path as `-BackupDir`, with the snapshot name in the file name.
|
|
385
|
-
|
|
386
|
-
## Sync conflicts (since 0.3.17; both copies backed up since 0.3.18)
|
|
387
|
-
|
|
388
|
-
When a pull is blocked by local files (the same path exists locally with different content), git aborts the whole batch. The old behaviour — "on failure, `reset --hard` and restore the latest snapshot" — actually knocked the **already fast-forwarded** HEAD back to the old commit, so the repo stayed permanently a few commits behind and every retry failed. 0.3.17 stops resetting:
|
|
389
|
-
|
|
390
|
-
1. `sync.ps1 pull` runs `git fetch`, checks whether a fast-forward is possible, then intersects `git diff --name-only HEAD origin/x` with (local untracked ∪ local modified). On a hit it **backs up both sides** of every file and writes the list to `~\.dsh\sync-conflicts.json` (kind, both sizes, binary flag, 1500-char preview each side, whether each copy was saved), then `exit 6`. The repo and the local config are left untouched; HEAD is not rolled back.
|
|
391
|
-
The backup folder is named to say what it is: `~\.dsh\backups\conflict-<time>-拉取冲突-Pull-conflict\`, containing
|
|
392
|
-
- `本机-Local\<relative path>` — the local version (exactly what was in the working tree);
|
|
393
|
-
- `云端-Cloud\<relative path>` — the cloud version (`git show origin/x:<path>`; written byte-exact through `git cat-file blob` + a redirection, so `.zstd`/`.tgz` binaries are never re-encoded);
|
|
394
|
-
- `说明-README.txt` — bilingual (Chinese/English): created time, repo, HEAD before the pull, remote ref and sha, item count, what each folder holds, and both ways to restore;
|
|
395
|
-
- `清单-Conflicts.json` — a snapshot of the list, so you can check later which options were offered and which side was picked.
|
|
396
|
-
|
|
397
|
-
If a copy's written size does not match the source, the script warns, marks that side as not saved, and the panel greys out the matching button — no "thought it was backed up" surprises.
|
|
398
|
-
2. `runtime\post-exit.ps1` treats exit code 6 as "pull pending" and skips the rollback branch.
|
|
399
|
-
3. After the client restarts, a "Sync conflicts" card appears under the metrics (hidden when there is no list):
|
|
400
|
-
- one row per file, **click the row itself** to expand/collapse both previews (no separate "details" button);
|
|
401
|
-
- "Keep local / Use cloud" per row, plus "All local / All cloud" at the bottom;
|
|
402
|
-
- when expanded, two buttons: "Restore local copy" and "Restore cloud copy" — **either copy can be written back to the working tree independently, they never overwrite each other, and neither touches git history**; a copy that failed to save greys out its button and says why;
|
|
403
|
-
- "Save" writes the choices into the list, "Discard" deletes the list (the next pull recomputes it).
|
|
404
|
-
4. Save, then click "Pull now": `sync.ps1` reads the same list, deletes the working-tree copy for every `cloud` item (and also for `local` items, so git can fast-forward), fast-forwards, then writes the `local` items back from the backup — they become a normal local change that the next push carries. The list is then removed.
|
|
405
|
-
|
|
406
|
-
Granularity is only "keep local / use cloud per item" plus "restore one item from the backup"; there is no in-preview editing or manual merge. Conflicts are almost always "the other machine changed the same config file", where picking one side is enough — for a real merge, edit the file and push.
|
|
407
|
-
|
|
408
|
-
API: `GET/POST /config-sync/conflict` (GET reads the list, each item carrying `localSaved`/`cloudSaved`; POST `{items:[{path,choice}]}` saves choices, `{action:'restore',path,side:'local'|'cloud'}` restores one file (local by default), `{action:'reset'}` discards the list). A restore writes into the `repo` recorded in the list, so changing `repoPath` later cannot point it at the wrong repo. `status` now returns `conflicts: {exists,total,pending,at,backupDir}`.
|
|
409
|
-
|
|
410
|
-
## Restore backup (since 0.3.13; "Restore now" + point-in-time since 0.3.25)
|
|
411
|
-
|
|
412
|
-
The panel has a "Restore backup" card (placed after "After exit" and before "Sync content"): the top row is the **backup folder** (default `~\.dsh\backups`, where `apply.ps1` takes a snapshot before every pull/apply), and below it every **snapshot in that folder** is listed — name, time (plus a relative time such as "3 min ago"), how many plugins it holds, and whether it can be restored.
|
|
413
|
-
|
|
414
|
-
- **No sizes in the list (since 0.3.41)**: each snapshot is a whole profile (thousands of files). Older builds re-walked every snapshot on every panel refresh — 92 snapshots / 48k files measured 7.7 s, pushing `/config-sync/status` to 11 s; a single front-end fetch could not survive that and showed "read failed" until you clicked "Recheck" by hand. The list now shows name / time / plugin count / restorability only; sizes belong in Explorer. The same change also: caches the remote probe for 5 minutes, caps each probe at 2.5 s, warms it up when the plugin loads, and gives the front-end status call a 15 s timeout plus 3 automatic retries (the message says "retried 3 times"). Measured status went from 8.0 s to 0.35 s (median over 20 calls).
|
|
415
|
-
|
|
416
|
-
- **Since 0.3.25 this is the same pipeline as "Pull now"**: clicking "Restore now" on a row first asks the host for a **diff preview** — which plugins installed after that snapshot will be removed, which files created after it will be moved out, which files will be overwritten / written back, and which plugins will be re-installed — and only "Confirm restore" queues it: the client closes normally, `post-exit.ps1` opens a visible progress window running `restore.ps1 -RollbackToPoint`, the result is written to `auto-sync-result.json`, and the client restarts automatically. No more quitting the client yourself, double-clicking a `.cmd` and typing `y`.
|
|
417
|
-
- **Point-in-time means rolling back to that moment**, not just copying the snapshot files back: files created after the snapshot move into `backups\manual-<timestamp>\rollback\files`; plugins installed afterwards lose only their junction link (never deleting through it into the real directory) or have their real directory moved into `rollback\plugins`; every item is recorded in `rollback\rollback-manifest.json` — all restorable, nothing physically deleted. The current config is saved first as `manual-<timestamp>` as well.
|
|
418
|
-
- **What counts as "a plugin installed after the snapshot"**: the `dependencies` of the restored `package.json`. Direct children of `node_modules` (including `@scope/pkg`, but not `.bin` / `.pnpm`) that are not in it get removed, and `pnpm install` afterwards adds back whatever the snapshot had.
|
|
419
|
-
- **The folder is editable**: click "Edit", type an absolute path (e.g. `D:\DSH-backups`) and save; the card then scans that folder. "Use default" clears it back to `~\.dsh\backups`. Stored as `backupRoot` in `~\.dsh\dsh-config-sync.json` — empty means the default, and it stays on this machine, never in the repo.
|
|
420
|
-
- **Three kinds of backups, three restore paths (since 0.3.49)**: the backup folder is shared by several producers, so the panel classifies each folder by its content and every class gets a working button:
|
|
421
|
-
- **Config snapshot** (`config-*` / `manual-*`, top-level `package.json` with `name: dsh-profile-*`) → "Restore now", a point-in-time rollback.
|
|
422
|
-
- **Plugin backup** (`plugin-<version>-*`, containing `runtime\` / `client.js`, or just one `dsh-config-sync-<version>\` layer) → "Roll back plugin": the current plugin is copied to `plugin-<current version>-<timestamp>` first, then written back with a merging copy (`Copy-Tree` walks level by level, so you never get `runtime\runtime` — a real bug measured while building 0.3.49).
|
|
423
|
-
- **Session backup** (`session-corrupt-*`, top level is all `--<path-encoded>--` folders) → "Restore sessions": the folders are written back into `~\.dsh\sessions`, with any existing folder of the same name copied to `backups\session-<timestamp>` first.
|
|
424
|
-
- **Anything unrecognised** (conflict comparisons, hand-copied folders) → "How to restore": shows the backup path, what is inside, and the three usual targets, so no row is a dead end.
|
|
425
|
-
- **Classification cannot rely on `package.json` alone**: a profile's `package.json` **also** carries a `dsh` field (`dsh.profile.bundles`), so judging plugins by `dsh` misclassifies whole config snapshots (all 8 `config-*` and 2 `manual-*` snapshots did). The order is now: `name: dsh-profile-*` or `dsh.profile` → config; `name: dsh-config-sync` → plugin; then top-level contents and the folder-name prefix as fallbacks. Empty folders (half-finished installs) are marked "Empty backup" with no button.
|
|
426
|
-
- **Only usable snapshots are offered**: a config snapshot without `profile\package.json` (the empty one `apply` leaves on a brand-new machine) is marked "Empty backup" and greyed out; `restore-backup` / `restore-preview` / `restore-now` share `resolveSnapshotDir`, and an unrecognised type is rejected with a pointer to the manual route.
|
|
427
|
-
- **Only this folder's snapshots are accepted**: the path from the panel must be a real snapshot under the backup root (escaping it, relative paths, quotes or newlines are rejected), so changing the folder never widens the scope to arbitrary directories.
|
|
428
|
-
- **The old path still works**: "generate restore script only" in the "After exit" card still writes `<repo>\restore-<snapshot name>.cmd` (dry-run preview, `y` confirmation, `manual-<timestamp>` safety copy) for offline / remote / manual use; `restore.ps1 -BackupDir` is unchanged, and `-RollbackToPoint` is added automatically by the panel pipeline.
|
|
429
|
-
|
|
430
|
-
## Plugin configs travel with the sync + cross-machine paths (since 0.3.30)
|
|
431
|
-
|
|
432
|
-
A new machine ending up with "no config" is mostly not a failed pull — **those configs were never in the repo**. 0.3.30 grows the settings group from 4 files to 13:
|
|
433
|
-
|
|
434
|
-
| Repo path | Local source | What it is |
|
|
435
|
-
|---|---|---|
|
|
436
|
-
| `settings\our-free-model.json` | `~\our-free-model\settings.json` | Free-model relay settings (runtime fields normalised, so every round is not "changed") |
|
|
437
|
-
| `settings\comfyui-workflows.json` | `~\data\dsh-comfyui\workflows.json` | ComfyUI workflow library |
|
|
438
|
-
| `settings\dsh-pet-main-config.jsonc` | `~\dsh-pet\main-config.jsonc` | Desktop pet config |
|
|
439
|
-
| `settings\dsh-market-state.json` | `.dsh-market\state.json` under the profile | Plugin market state |
|
|
440
|
-
| `settings\dsh-pet-memory.json` | `~\dsh-pet\memory.json` | Pet memory |
|
|
441
|
-
| `settings\our-free-model-picks.json` | `~\our-free-model\picks.json` | Picks / favourites |
|
|
442
|
-
| `settings\dsh-im-interface-language.json` | `~\integrations\dsh-im\interface-language.json` | dsh-im UI language |
|
|
443
|
-
| `settings\dsh-qq-config.json` | `~\integrations\dsh-qq\config.json` | QQ integration config |
|
|
444
|
-
| `settings\dsh-qq-workspaces.json` | `~\integrations\dsh-qq\workspaces.json` | QQ integration workspaces |
|
|
445
|
-
| `settings\redteam-preset-declare.json` | `~\redteam\preset-declare.json` | Redteam preset declarations |
|
|
446
|
-
| `settings\task-board-ledger.json` | `~\task-board\ledger-v2.json` | Task-board ledger |
|
|
447
|
-
| `settings\task-board-scheduler.json` | `~\task-board\scheduler-v2.json` | Task-board scheduler |
|
|
448
|
-
| `settings\dsh-workspaces.json` | `~\storages\workspace.json` | **DSH workspace registry** (the usual reason workspaces vanish on a new machine) |
|
|
449
|
-
|
|
450
|
-
**Still excluded**: credentials and runtime state — `channel-pack` (contains `token-ledger.json`), `workbuddy-vault`, `dsh-purge`, `stats` / `feed` / `catalog` / `availability`, `integrations\dsh-qq\bots\<bot>\state.json`, session caches.
|
|
451
|
-
|
|
452
|
-
### Configs that carry absolute paths: placeholders + a one-time confirmation
|
|
453
|
-
|
|
454
|
-
Two machines rarely share drive letters (one has `D:\DeepSeekHarness`, the other does not), so such configs cannot be copied verbatim:
|
|
455
|
-
|
|
456
|
-
| Placeholder | Meaning |
|
|
457
|
-
|---|---|
|
|
458
|
-
| `{{APP_ROOT}}` | Client install root (the folder holding `DeepSeekHarness`) |
|
|
459
|
-
| `{{DSH_HOME}}` | `.dsh` folder (usually `%USERPROFILE%\.dsh`) |
|
|
460
|
-
| `{{WORKSPACE_HOME}}` | Workspace root |
|
|
461
|
-
| `{{ROOT:<key>}}` | A folder you pick (ComfyUI models, proxy binary path, ...), the value is yours to decide in the panel |
|
|
462
|
-
|
|
463
|
-
- Before writing to the repo, `capture.ps1` normalises local roots into placeholders. All four spellings of a path are recognised (raw backslashes / JSON doubled / forward slashes / JSON escaped slash), and longer roots are replaced first so `{{WORKSPACE_HOME}}` never gets swallowed by `{{APP_ROOT}}`.
|
|
464
|
-
- The repo always stores **forward slashes** (`{{APP_ROOT}}/mnemon`), so JSON needs no backslash escaping.
|
|
465
|
-
- Before landing, `apply.ps1` expands placeholders back into local paths.
|
|
466
|
-
|
|
467
|
-
### Path confirmation: you pick after a pull, never asked twice
|
|
468
|
-
|
|
469
|
-
- The first sync writes `<dshHome>\config-sync-roots.json` with detected roots. **Local only, never committed.**
|
|
470
|
-
- When a root is missing on this machine, `apply.ps1` **skips that file instead of writing it** and records it in `<dshHome>\config-sync-pending-paths.json` (which token, which file, what folder to pick).
|
|
471
|
-
- The panel's "Local paths" card lists those items; fill in the paths, save, then pull once more.
|
|
472
|
-
- Confirmed values win over detection and are not asked again. **Not writing beats writing garbage** — a literal `{{ROOT:xxx}}` inside a config is read by plugins as a real path, and that error is far harder to trace than a skipped file.
|
|
473
|
-
|
|
474
|
-
### Two health checks: stray paths after a push, overwritten edits before a pull (since 0.3.36; receiver-only since 0.3.43)
|
|
475
|
-
|
|
476
|
-
**After a push** (`capture.ps1` tail): it walks the repo's **config files** (`settings\*.json`, `profile\*.json`, `skills\`, `presets\`, `prompt\`, top-level json - `conversations\` / `workspace\` / `mnemon\` / `storages-record\` are session and runtime data that is not meant to match across machines, so they are skipped), pulls out every absolute path that falls **outside all confirmed roots** (e.g. `F:\workspace-new` while every root on this machine is under `D:\`) and records them in `<dshHome>\config-sync-absolute-paths.json`, together with the `machine` that wrote it and the root values at that moment. The console prints a warning. **It never blocks the commit** - the path may well be right, it just cannot travel to another machine.
|
|
477
|
-
|
|
478
|
-
**Since 0.3.43 that list only means something on the receiving machine**: it is written during a push, and paths this machine pushed obviously exist here, so showing them locally only looks like a fault (in a real run 40+ of 50 entries were `conversations\session_projcache` noise). The panel now compares the report's `machine` against this machine:
|
|
479
|
-
- **Written by this machine** → not shown, and not counted as a warning (`status.localPaths.absolute` is 0).
|
|
480
|
-
- **Written by another machine** (this machine is receiving, before or after a pull) → it says "this config was pushed from `<machine>`" and gives **a suggested folder per entry**: first a prefix mapping using the remote machine's root values from the report (`F:\DSH\SquadLink` → this machine's `<APP_ROOT>\SquadLink`, original case preserved); with no root to map, it looks for a same-named folder under this machine's roots, the user profile, the Desktop and each fixed drive; if nothing matches it says so instead of guessing.
|
|
481
|
-
- Every row has **Accept**: one click records that folder as a custom root (`{{ROOT:<key>}}`), so from the next push on those paths become placeholders that each machine expands to its own value; accepted rows show "Accepted". The old wording ("add it as a custom root and push once") left that work to you.
|
|
482
|
-
- Regex false positives are filtered too: `s://1v3.apiipu.com/...` used to be read as a path on drive `s:`; anything containing `://` is now skipped.
|
|
483
|
-
|
|
484
|
-
**Before a pull** (`apply.ps1`, ahead of writing settings): laying configs down is a whole-file `WriteAllText`, so editing a path and pulling before pushing silently overwrites your edit (the backup exists under `<dshHome>\backups\config-<stamp>\settings\`, but nobody digs through that). So the overwrite is now detected first: the local file is normalised the same way capture writes it (roots → placeholders, CRLF flattened to LF, and `catalogSyncedAt` / `reloadedAt` / `reloadCount` in `our-free-model.json` zeroed), compared against the repo copy, and every difference is recorded in `<dshHome>\config-sync-overwrite.json`. The panel then says "N config files were overwritten by the repo version (your local edits were backed up first)", with the backup path per item. To keep your edits: **push first, then pull** - never the other way round.
|
|
485
|
-
|
|
486
|
-
### How the Local paths card works (since 0.3.34: read-only + Edit; since 0.3.37: hidden by default)
|
|
487
|
-
|
|
488
|
-
- **It stays off the page**: the card and its whole section title are not rendered - on a normal machine the paths are not meant to be edited. There is exactly one entry point: the **Local paths** button in the page title row, which expands the section and turns into "Hide local paths".
|
|
489
|
-
- **All three count as warnings**: paths still to confirm, absolute paths in the repo outside every root, and configs the last pull overwrote - `status.localPaths.alert` is their sum, and that button turns amber reading "Local paths · N alert(s)"; click it for details.
|
|
490
|
-
- **Read-only by default**: the three roots (`{{APP_ROOT}}` / `{{DSH_HOME}}` / `{{WORKSPACE_HOME}}`) show their current value in a monospace line with the placeholder as a grey hint underneath; custom folders (`{{ROOT:<key>}}`) render the same way.
|
|
491
|
-
- Click **Edit** (top right) to turn them into inputs, which brings up Save and Cancel; a successful save returns to the read-only view - the same pattern as Local repo and Sync content.
|
|
492
|
-
- In edit mode three extras appear: a **Detected** button next to each root (fills in the auto-detected folder - this is how you undo a wrong value), a **Remove** button next to each custom folder, and an **Add folder** row (key + path, key limited to letters, digits, `_ . -`) for roots that live elsewhere on this machine.
|
|
493
|
-
- The chip in the card head is orange "N to confirm" while something is pending, green "Confirmed" when everything resolves; **Reload** is always available and re-reading detected values never overwrites what you confirmed.
|
|
494
|
-
- If not a single root was detected, the card stays in edit mode - fill them in before saving.
|
|
495
|
-
- Values here **win over everything**: a saved root outranks the value the script detected on its command line (`Get-SyncRoots` prefers roots.json and only fills the gaps). A wrong value therefore does not "fail to apply" - it applies, expanding placeholders into a dead folder.
|
|
496
|
-
|
|
497
|
-
## Feedback goes to GitHub Issues (since 0.3.31, token-free reading since 0.3.32)
|
|
498
|
-
|
|
499
|
-
The Feedback card at the bottom of the panel. **GitHub Issues are the single source of truth** - no more json files in the config repo:
|
|
500
|
-
|
|
501
|
-
1. Title + details → `POST /repos/huanyu-a/dsh-profile-config-sync/issues` with label `feedback`; an environment block (plugin version, machine, time, platform, install root, config repo path) is appended to the body so nobody has to ask later;
|
|
502
|
-
2. The list reads the Issues directly (`GET /issues?state=all&labels=feedback`): open and closed both show, and the title is a link to the GitHub page;
|
|
503
|
-
3. Resolve → `PATCH issue {state:'closed'}`. It is still the same thread on GitHub, so the discussion can continue there, and reopening is one click;
|
|
504
|
-
4. The top row of the card is the connection state, in one of three forms: `signed in as xxx (submit and close)` / `token is not the owner (read and submit only)` / `anonymous read (submit via browser)`.
|
|
505
|
-
|
|
506
|
-
**Reading needs no token** (0.3.32): this repo is public and the Issue list is readable anonymously (verified HTTP 200, 60 requests/hour per IP). So it reads with the token when one exists (your account, 5000/hour) and falls back to an anonymous read when the token is expired or absent - a fresh machine shows existing feedback on the very first panel open, with no token setup first.
|
|
507
|
-
|
|
508
|
-
**Submitting without a token** (0.3.32): the panel prefills title, body and environment block into GitHub's new-issue page (`https://github.com/<repo>/issues/new?title=&body=&labels=feedback`); if GitHub is signed in on your browser, one Submit button finishes it, no token involved. This path is only used when no token exists; with a token the API path still applies, which is what makes queueing and refushing possible.
|
|
509
|
-
|
|
510
|
-
**Only the repo owner can close** (0.3.32): before changing state the server checks `GET /user`; a token whose `login` differs from the repo owner gets a 403, and the "Resolve" button is disabled and reads "Owner only". So a foreign token cannot close issues even if it is pasted into the panel - the restriction lives on the server, not just in the UI.
|
|
511
|
-
|
|
512
|
-
**No token typing needed**: by default it is taken once from the local git credential (`git credential fill` - it is already there if you have pushed from this machine) and stored in `<dshHome>\config-sync-gh.json` (local only, **never committed**). Only when that fails do you paste one, which is verified against `/repos/{repo}` immediately and not saved if it fails. Repo and label can be changed in the same row.
|
|
513
|
-
|
|
514
|
-
**Offline reports are not lost**: when creating an Issue fails, the report goes into `<dshHome>\config-sync-feedback-outbox.json`; the panel shows how many are pending and Flush creates them one by one when the network returns, dropping each one that succeeds. It is a sending queue, not a second copy - once sent, the queue empties.
|
|
515
|
-
|
|
516
|
-
**Filter and search** (0.3.33): a row above the list with `Open / Closed / All` (each carrying a live count - the server fetches everything once and derives open/closed/total), plus a search box that filters as you type. It matches issue number, title, author and body, including the machine/version inside the environment block. All filtering is local: switching state or typing never calls the API, so it does not consume the anonymous quota. A grey line reports "N of M shown (keyword x)" live, and an empty result under the current filter says so instead of going blank.
|
|
517
|
-
|
|
518
|
-
## Uninstall leftovers cleaned automatically (since 0.3.29)
|
|
519
|
-
|
|
520
|
-
Uninstalling a plugin is the host's job: it removes the install directory, the `package.json` dependency and the `cordis.patch.yml` block. It does **not** remove the junction under `profile\node_modules` - measured on `dsh-image-search`, whose target `D:\DeepSeekHarness\dsh-image-search-0.1.0` was gone while the link still pointed at it. Broken links like that are invisible to pnpm too (with a flat layout it only reinstalls from the lockfile, and the link was not created by pnpm), and syncing never cleaned them either, so they survive until the next reinstall.
|
|
521
|
-
|
|
522
|
-
So `apply.ps1` sweeps them on every landing (section 9.6) and only removes links where **all three** hold:
|
|
523
|
-
|
|
524
|
-
| Test | Meaning |
|
|
525
|
-
|---|---|
|
|
526
|
-
| it is a link | `LinkType` is Junction / SymbolicLink; plain directories are never touched |
|
|
527
|
-
| none of its targets exist | if any target is still there, the link is treated as legitimate and kept |
|
|
528
|
-
| it is absent from `package.json` dependencies | every `link:` plugin in use is skipped |
|
|
529
|
-
|
|
530
|
-
Removal uses `Directory.Delete`, so only the link itself goes and nothing is deleted through it; the log prints one line per removal, `已清理孤儿链接(卸载残留):xxx → 目标不存在 yyy`.
|
|
531
|
-
|
|
532
|
-
**Plugin backups are tidied too**: every round of "rename the old directory into a backup first" piles up `<dir>.bak-<timestamp>`. A backup whose version equals the live one is pure waste (it is the copy that was just replaced), so it is deleted; different versions keep only the newest; if the live directory is gone the backup is kept as the only rollback point.
|
|
533
|
-
|
|
534
|
-
**One misjudgement fixed as well**: before 0.3.29 the deploy test compared mtime, and `git checkout/fetch` stamps the archive with the current time, so every sync round concluded "new version" and renamed the directory into a backup and re-extracted it again (that is how `dsh-purge-1.1.92` and `.bak-timestamp` ended up side by side). It now compares the version inside the archive `package.json` against the deployed one; when the version cannot be read it falls back to mtime with a 10-second margin.
|
|
535
|
-
## Sync scope (per-group and per-item checkboxes, since 0.3.8)
|
|
536
|
-
|
|
537
|
-
The panel has a "Sync content" card (placed at the very bottom of the page): the twelve groups that sync to the cloud are listed individually and **checked by default**. Clicking a row expands that group's items and clicking it again collapses them (there is no separate "Details" button); both the group and each item can be unchecked — unchecked content is **no longer captured on push and no longer restored on pull**; tick it again and syncing resumes (push and pull share the same file).
|
|
538
|
-
|
|
539
|
-
- **It opens read-only**: every checkbox is greyed out and only reflects the current selection. Click "Edit" to unlock them, then "Save" to write the file (or "Cancel" to drop the change and re-read the saved state). This prevents a stray click from silently changing what gets synced.
|
|
540
|
-
|
|
541
|
-
| Group | Cloud folder | Items (excludable individually) |
|
|
542
|
-
|---|---|---|
|
|
543
|
-
| Local profile | `profile/` | package.json / lockfile / cordis (group switch only — these files interlock) |
|
|
544
|
-
| Prompts | `prompt/` | `AGENTS.md`, `prompt-inject.md` |
|
|
545
|
-
| Skills | `skills/` | one entry per skill folder |
|
|
546
|
-
| Presets | `presets/` | one entry per preset |
|
|
547
|
-
| Skill-market ledger | `storages-record/` | `skill-market-installed.json`, `skill-market-panel.json` |
|
|
548
|
-
| Plugin configs | `settings/` | 13 config files (see the table in "Plugin configs travel with the sync"), each excludable |
|
|
549
|
-
| Mnemon | `mnemon/` | the whole folder (single entry) |
|
|
550
|
-
| Local plugins | `local-plugins/` | one entry per linked plugin |
|
|
551
|
-
| Plugin data | `plugin-data/` | one entry per top-level plugin folder (auto-enumerated, see below) |
|
|
552
|
-
| Extra paths | `extra/` | absolute paths you add yourself (see below) |
|
|
553
|
-
| Workspaces | `workspace/` | one entry per registered workspace (`workspace-registry.json` only lists checked ones) |
|
|
554
|
-
| Conversations | `conversations/` | one entry per workspace |
|
|
555
|
-
|
|
556
|
-
- Choices live in `~\.dsh\config-sync-scope.json`, **on this machine only and never committed** (each machine ticks its own); the file stores only what differs from the default, so deleting it means "everything checked".
|
|
557
|
-
- Skipping applies to **both directions**: `capture.ps1` stops capturing (nothing new lands in the repo) and `apply.ps1` stops restoring (your machine is untouched). `-PruneSkills` also stops treating "a skill you unchecked" as an extra to delete.
|
|
558
|
-
- The card carries one more switch, "Also delete the cloud copy when unchecked", **off by default**: while off, unchecking just means "this machine stops caring" and the cloud copy stays, so re-ticking resumes immediately; when on, unchecking really deletes the matching folder/sub-path from the repo on the next push (the other machine can no longer pull it) and **that deletion cannot be undone**.
|
|
559
|
-
- Items you cannot tick (the five profile files, mnemon) are deliberately group-level switches: the lockfile specifiers must match package.json, and excluding one alone breaks installation.
|
|
560
|
-
- **The "Local profile" group is required and cannot be unchecked** (the panel shows "required" and greys the checkbox out). It is not an optional extra but a precondition of `apply.ps1`: when `profile\package.json` or `profile\cordis.patch.yml` is missing from the repo, a pull stops with `[X] 仓库内容不完整`; and `profile\host-contract.json` in the same group is the version-consistency check between the two machines — lose it and configs are laid down across mismatched client versions, which can leave the app unable to start. Editing `config-sync-scope.json` to `false` does not help either: `capture.ps1`, `apply.ps1` and the panel all treat it as on (`Test-SyncGroupEnabled` pins it).
|
|
561
|
-
|
|
562
|
-
## Plugin data & extra paths (0.3.51)
|
|
563
|
-
|
|
564
|
-
Third-party plugins usually keep their own config and data in their own top-level folder (`~\.dsh\<plugin>\`). These two groups carry them along:
|
|
565
|
-
|
|
566
|
-
- **Plugin data (`plugin-data/`)**: `<DshHome>`'s top-level folders are enumerated automatically — one folder, one slot — stored as `plugin-data\<slot>\...` plus `plugin-data\manifest.json` (`slots[{id,src,files,bytes}]`).
|
|
567
|
-
- Skipped by default: `profiles`, `skills`, `.agent-presets`, `storages`, `sessions`, `attachments`, `logs`, `backups`, `update-staging`, `electron`, `dsh-runtimes`, `dsh-market`, `.dsh-plugin-market`, `dsh-session-manager`, `im`, `node_modules` and hidden folders — they either already have a dedicated group or are cache/runtime.
|
|
568
|
-
- Each slot scans at most 8 levels deep and 4000 files (so no plugin can drag a whole repository in).
|
|
569
|
-
- **Extra paths (`extra/`)**: absolute paths you add in the panel, folder or single file; stored as `extra\<id>\...` or `extra\<id><ext>` plus `extra\manifest.json`.
|
|
570
|
-
- **Text is placeholder-normalised, binary stays byte-exact**: text files get `{{APP_ROOT}}` / `{{DSH_HOME}}` / `{{WORKSPACE_HOME}}` / `{{ROOT:x}}` written into the repo (CRLF→LF along the way) and are expanded on the other machine by `Expand-TokenText`; binaries (`.db`/`.node`/`.exe`/images, or any file containing NUL bytes) are copied byte for byte.
|
|
571
|
-
- **Write-back always keeps a copy first**: apply merges file by file and backs up the overwritten target file into `backups\config-<timestamp>\plugin-data-<slot>` or `extra-<id>`.
|
|
572
|
-
|
|
573
|
-
### Rules file: `~\.dsh\config-sync-extra.json` (this machine only, never committed)
|
|
574
|
-
|
|
575
|
-
The "Plugin data & extra paths" card edits this file directly:
|
|
576
|
-
|
|
577
|
-
| Field | Meaning |
|
|
578
|
-
|---|---|
|
|
579
|
-
| `pluginData.enabled` | group switch for plugin data (linked with the row in "Sync content") |
|
|
580
|
-
| `pluginData.maxFileBytes` | per-file limit, **hard-capped at 104857600 (100MB, GitHub's single-file limit)**; larger values are clamped |
|
|
581
|
-
| `pluginData.exclude` | exclusion list, wildcards one per line, **replaced wholesale** (emptying it really excludes nothing) |
|
|
582
|
-
| `pluginData.skipDirs` | top-level folders skipped during enumeration, also replaced wholesale |
|
|
583
|
-
| `extra.enabled` / `extra.paths[]` | extra-paths switch and list (`{id,src,label}`, `src` must be absolute) |
|
|
584
|
-
|
|
585
|
-
Default exclusions (50 entries, edit freely): `*.db` / `*.db-*` / `*.sqlite*` / `*.db-shm` / `*.db-wal`, `*.node` / `*.exe` / `*.dll` / `*.asar` / `*.pak` / `*.bin` / `*.img` / `*.iso`, archives `*.zip|7z|rar|tar|gz|tgz`, media `*.mp4|mkv|avi`, `*.log` / `*.log.*`, `*.tmp` / `*.bak` / `*.bak-*` / `*.old` / `*.orig` / `*.swp`, `api-key` / `*.pem|key|p12|pfx|crt`, `*cache*` / `*token*` / `*secret*` / `*credential*` / `*password*` / `*vault*`, `node_modules` / `.git` / `.cache` / `__pycache__` / `.venv`.
|
|
586
|
-
|
|
587
|
-
- **Why cache/token/database files are excluded by default**: `*cache*` and `*token*` files change on every run and would put a diff in every push; `.db` files are often locked by the plugin itself and restore badly across machines.
|
|
588
|
-
- **Extra paths are safest under a standard root**: anything under `~\.dsh\`, the client folder or the workspace root is normalised into a placeholder; elsewhere (say `D:\tmp\xxx`) it can only be laid down at the same absolute path, and a machine without it skips the item with a `[!]` notice.
|
|
589
|
-
- If a path still contains an unconfigured placeholder after expansion, apply skips that slot with a `[!]` notice instead of writing `{{DSH_HOME}}` into a plugin's config.
|
|
590
|
-
|
|
591
|
-
## Auto sync / auto push (two switches, both off by default)
|
|
592
|
-
|
|
593
|
-
| Switch | Behaviour |
|
|
594
|
-
|---|---|
|
|
595
|
-
| Pull on startup | 8 s after start, a read-only `git fetch` comparison; behind > 0 → system confirmation dialog (Yes/No) → "Yes" **exits the whole client family right away** (measured: processes gone within 5 s) → a visible window runs the pull → relaunches automatically. Clicking × to close also checks once and queues (0.3.93; no confirmation dialog on the close path — behind > 0 queues the pull) |
|
|
596
|
-
| Push on exit | **queued when any of three sources hit**: local commits ahead, uncommitted changes, local data newer than the last sync (new sessions etc). Re-checked every 2 minutes after start, and checked once more when × closes the window (0.3.93), no duplicate watcher while queued; pushes only after DSH fully exits, then relaunches |
|
|
597
|
-
|
|
598
|
-
- The work is done by `runtime\post-exit.ps1 -Phase wait`, which the plugin launches as a **hidden** process to watch for the client exiting; only after it really exits does it start a **visible** `-Phase run` window titled "DSH 配置同步 · 拉取/推送". **No window while queued** — otherwise an empty window would sit in the way from boot to shutdown.
|
|
599
|
-
- When the repo is not in place yet (empty folder included) the startup check simply skips and does **not** record a failure — an empty folder is only waiting for the first pull.
|
|
600
|
-
- **Launch pitfalls hit here**: `detached: true` PowerShell exits immediately on Windows (not one log line), so a short-lived PowerShell starts a separate process with `Start-Process -PassThru`; `spawn()` failures are asynchronous (only an `error` event), so the launcher's exit code is awaited and a missing pid fails honestly, logged to `~\.dsh\logs\auto-sync-launch.log`.
|
|
601
|
-
- **Waiting for exit cannot rely on pid**: the plugin runs in a child process, so `process.pid` is not the client's main process — pid checks produce "client still running, waiter thinks it exited" and pull mid-run. It matches by process name instead; "closed but processes linger" (measured: 7 processes with `hwnd=0` alive for over a minute) also counts: alive past 60 s with no visible window for 16 s → kill the leftovers, then sync (`auto-sync-wait.log` records it).
|
|
602
|
-
- **One sync at a time**: `~\.dsh\auto-sync.lock` records the pid. A startup push and a user-confirmed pull once ran together and rewrote config in parallel; now the later one reads the lock — same kind is reused, a different kind (manual wins) first ends the waiting process that has not started yet, then re-queues.
|
|
603
|
-
- **Exit uses the whole process family**: `taskkill /PID <main>` (without `/F`) does nothing for the Electron main process (`This process can only be terminated forcefully`), so it uses `/IM "DeepSeek Harness.exe"` and adds `/F` 3.5 s later.
|
|
604
|
-
- **Clear environment variables before relaunching**: clients started through the plugin chain "quit right after start" three times in a row while the same script in a clean shell succeeded — the difference was the inherited `ELECTRON_RUN_AS_NODE` (plus `ELECTRON_NO_ATTACH_CONSOLE`/`NODE_OPTIONS`/`NODE_PATH`); clearing them worked first try. After start it also counts processes and retries up to 3 times, 8 s each.
|
|
605
|
-
- **Pull failure rolls back**: `git reset --hard` to the original commit → run `restore.ps1` with the `backups\config-<timestamp>` created just before this apply wrote to disk → the rollback result is logged either way, and an incomplete rollback says "open the log and check".
|
|
606
|
-
- **Both pull and push relaunch**: success uses the new config, failure the rolled-back one. A successful relaunch refreshes `lastSyncAt` in `config-sync-state.json`, so files just written by apply are not misread as "to push" by the next startup check.
|
|
607
|
-
- **How the progress window ends**: after a pull or push finishes the window **stays open** instead of closing itself 3 seconds later (that used to flash the result past you, failure reason included). It keeps "sync finished / log path" on screen and exits only when you press a key or click the ×. The client was already relaunched by `explorer.exe` **before** this, so it shares no parent/console job with the window — leaving the window open or closing it kills nothing. `update` (the install-after-exit path) keeps its window too, with a "plugin update finished" banner; only `relaunch` still closes itself after 3 s, since there is no result to read.
|
|
608
|
-
- Exit codes: `0` done, `2` wait timeout, `3` sync.ps1 missing, `4` relaunch failed, `5` sync failed (pull already tried to roll back).
|
|
609
|
-
- "Cancel queue" only drops the plugin's queue record; an already launched external waiter still waits for your exit — end it manually to stop it (the pid is in `auto-sync-wait.log` / the launch log).
|
|
610
|
-
|
|
611
|
-
## Plugin update (since 0.2.0)
|
|
612
|
-
|
|
613
|
-
The **Plugin update** card shows the local version, the cloud version and one status line; the manifest and package live in this public repo (`version.json` + `releases/dsh-profile-config-sync-<version>.tgz` — only a few hundred bytes are read, the package is not; cached 30 minutes, checked on mount and every 30 minutes after).
|
|
614
|
-
|
|
615
|
-
| Status | Meaning |
|
|
616
|
-
|---|---|
|
|
617
|
-
| Green "Up to date" | local version ≥ manifest version |
|
|
618
|
-
| Orange "New version x.y.z" | the manifest is higher, with a one-line note and a "Download x.y.z" button |
|
|
619
|
-
| Orange "Downloaded, install pending" | the package is already in `~\.dsh\update-staging\` (the plugin directory is untouched) — click "Restart & install" to apply |
|
|
620
|
-
| Orange "Installed, restart pending" | only on the legacy path (installed while running but not yet restarted) — click "Restart DSH" to apply |
|
|
621
|
-
| Red "Check failed" | manifest unreadable (network / repo missing / 404), with "Check for updates" to force a re-check and the per-source failure reason listed |
|
|
622
|
-
|
|
623
|
-
- **The manifest has several sources, tried in order**: the built-in candidates are `gh-proxy.com` → `ghfast.top` → GitHub raw; the first two are live proxies (a fresh manifest comes back within a second, and the tgz downloads through the same prefix). `raw.githubusercontent.com` is frequently unreachable from mainland networks, and the host's `fetch` is Node's built-in one that **ignores system proxies** — so the request gets aborted on timeout (that is exactly the `This operation was aborted` line on the card). The package download follows the same order (the source that served the manifest first, then the rest): a reachable manifest does not guarantee the package is reachable on the same domain. 30-second timeout per request.
|
|
624
|
-
- **Do not use jsDelivr as a manifest source**: it caches branch aliases like `@main` for a long time and was still serving the previous `version.json` after a release (`purge.jsdelivr.net` did not refresh it either), so "new version available" would show up hours late — more misleading than a failed check. Versioned package files are unaffected by that cache, but the manifest is.
|
|
625
|
-
- **Token**: this repo is public, so no token is needed. If `updateManifestUrl` points at a private Gitee mirror instead, fill in a Gitee personal token and both the manifest and the package switch to the API raw endpoint (`/api/v5/repos/<owner>/<repo>/raw/<path>?ref=main&access_token=…`), passing the branch as `ref` rather than in the path. A URL you fill in is used **alone**, with no mirrors mixed in. The token lives only in the local settings file, never in the repo; saving empty means "keep the stored token", and there is a separate "Clear stored token" button. A relative `tgz` resolves against **the manifest actually read**, so switching addresses cannot build the wrong domain.
|
|
626
|
-
- The update is split into two steps (since 0.3.7): **download and install are separate**. "Download x.y.z" only saves the tgz into `~\.dsh\update-staging\dsh-profile-config-sync-<version>.tgz` and verifies its sha256 — the host never touches the plugin directory, so DSH does not resync its plugin tree and the Config Sync page you are looking at never jumps away. The button then becomes "Restart & install": that one exits DSH (`spawnWatcher(-Mode update -UpdateTgz <local package> -UpdateSha256 …)`), and the post-exit script backs up the old directory (`~\.dsh\backups\plugin-<old version>-<time>`), installs, and relaunches the new version (`runtime\post-exit.ps1`, rolling back from the backup on failure). Installation happens after exit, so exactly one restart is needed.
|
|
627
|
-
- Why the old path was dropped: 0.3.4–0.3.6 installed **while DSH kept running**, overwriting the plugin directory. In practice that made the host tear down the current panel — the page vanished mid-update and users had to click back before they could press restart. The logs line up: `11:41:55 覆盖安装` → `11:42:10 已启动 relaunch`, with a visible 15-second gap in between. `POST {action:'install-live'}` stays available for CLI/scripts but the panel no longer uses it; `POST {action:'apply'}` (exit first, then download and install) remains too.
|
|
628
|
-
|
|
629
|
-
## Using this repo as a market index source
|
|
630
|
-
|
|
631
|
-
The root `market-index.json` is a ready-to-use DSH market index (`format: 1`, `source.type: git` with a 40-character commit; installing fetches the package from this repo, no build). Index URL:
|
|
632
|
-
|
|
633
|
-
```
|
|
634
|
-
https://raw.githubusercontent.com/huanyu-a/dsh-profile-config-sync/main/market-index.json
|
|
635
|
-
```
|
|
636
|
-
|
|
637
|
-
In DSH go to **Plugins → Discover → Index sources**, paste the URL above, and "Config Sync" shows up in the list; installing pulls this repo at that commit.
|
|
638
|
-
|
|
639
|
-
- **Prerequisite**: this is an index source for the **official Discover page** (`@deepseek-ai/dsh-plugin-market`), which needs the official `@deepseek-ai/dsh-experimental-plugin-market-bundle` enabled in the profile. Without it, neither the Discover page nor the index-source entry exists.
|
|
640
|
-
- **Not found in dshmarket is expected**: the third-party market plugin dshmarket lists only its own curated catalog (`awesome-dsh-plugin.com/plugins.json`, or the `dsh-plugin-catalog` npm package in China). Its source has no path for user-supplied indexes (`lib/registry.js` reads that single catalog per region on every call, `lib/sources.js` only parses entries of that catalog), and its installs are restricted to sources listed there — anything else is rejected. So a self-hosted index, however valid, never shows up in dshmarket's search. To appear there, open a PR against [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) (its README says plainly: don't PR plugin entries against the market repo).
|
|
641
|
-
- **Fetching the index from China**: `raw.githubusercontent.com` comes and goes; prefix it with `https://gh-proxy.com/` or `https://ghfast.top/`, or use jsDelivr's `https://cdn.jsdelivr.net/gh/huanyu-a/dsh-profile-config-sync@main/market-index.json` — but jsDelivr caches branch aliases like `@main`, so a new release may take hours to appear there.
|
|
642
|
-
- **Just want it on your own machine**: no market needed — `dsh plugin add` with the tgz from the install section above is the shortest path.
|
|
643
|
-
|
|
644
|
-
Release flow: change code → `pwsh -File tools\pack-plugin.ps1` to pack `releases/dsh-profile-config-sync-<version>.tgz` (it collects files from `package.json`'s `files` and writes the sha256 back into `version.json`) → bump `version` (and `notes`) in `version.json` → replace `version` and `commit` of the entry in `market-index.json` → push. The index only references a commit, so older versions stay installable. Run `node tools\selftest.mjs <repo path>` and `node tools\clientcheck.mjs` before releasing.
|
|
645
|
-
|
|
646
|
-
## Interfaces and paths
|
|
647
|
-
|
|
648
|
-
| Interface | Notes |
|
|
649
|
-
|---|---|
|
|
650
|
-
| `GET /config-sync/status` | health-check JSON (including `repo.source` / `repo.configured` / `repo.phase` / `repo.empty` / `repo.remoteHeads` / `repo.remoteFiles` / `repo.pushAllowed` / `repo.pullAllowed`, `remote.configured`, `remote.backupRoot` / `remote.backupRootCustom`, `backup.{root,defaultRoot,custom,count,latest,latestFiles,snapshots:[{name,dir,at,files,bytes,usable,plugins,bundles}]}`, `local.{lastSyncAt,pending,sample}`, `auto.lastResult`) |
|
|
651
|
-
| `POST /config-sync/prepare` | `{action:'push'\|'pull'\|'restore'\|'restore-backup'\|'all', message?, backupDir?}`, generates the matching `.cmd`; `all` returns `built: [...]` (when the local repo is empty the cloud file count decides: both empty → `['push','restore']`, cloud has files → `['pull','restore']`, the other one goes into `skipped`); on an empty folder `push` is allowed only when the cloud holds 0 files (that run is the initialize push) and `pull` only when the cloud actually has files; `restore-backup` requires `backupDir` (a real snapshot under the backup root that contains `profile\package.json`) |
|
|
652
|
-
| `POST /config-sync/settings` | `{repoPath?, remoteUrl?, sshKey?, autoPull?, autoPush?, autoRestart?, backupRoot?, clearBackupRoot?}`: validate → write settings → (touch git only when the URL changed); failure rolls back and returns 400; an empty `backupRoot` / `clearBackupRoot` resets it to the default `~\.dsh\backups`; an empty folder is accepted, only "holds other files yet not a repo" is refused |
|
|
653
|
-
| `POST /config-sync/auto` | `{action:'check'\|'pull-now'\|'push-now'\|'restore-preview'\|'restore-now'\|'cancel', backupDir?, closeNow?, restart?}`; `check` is a read-only fetch comparison (short-circuits with `pendingPull: true` when the local repo is empty instead of failing), `pull-now`/`push-now`/`restore-now` close the client without `/F` (a normal exit, so config is saved), `push-now` returns 400 on an empty folder; `restore-preview` only computes the diff (`pluginsRemove` / `pluginsInstall` / `willRemove` / `willOverwrite` / `willWrite`), while `restore-now` queues the "restore to that point after exit" run; `auto.pending` in `status` carries `reason` (why it queued) |
|
|
654
|
-
| `GET/POST /config-sync/update` | `{action:'check'\|'prepare'\|'install-restart'\|'install-live'\|'restart'\|'apply'}`: `check` re-reads the manifest (mirrors tried in order); `prepare` only downloads into `~\.dsh\update-staging\`; `install-restart` hands that local package to the post-exit installer and closes DSH; `install-live` / `apply` / `restart` remain for CLI and compatibility |
|
|
655
|
-
| `GET/POST /config-sync/scope` | GET returns the twelve-group scope (`{id,title,desc,enabled,items:[{id,label,enabled,excludable}]}` per group, plus `deleteCloud` and the local file `path`); POST `{deleteCloud?, groups:{id:{enabled?,excluded?}}}` stores only what differs from the default (fully-checked groups are not written) and drops exclusions that no longer exist |
|
|
656
|
-
|
|
657
|
-
Cross-origin requests get 403. The client only `fetch`es these routes, imports no `@deepseek-ai/dsh-client-*`, and styles with `--dsw-alias-*` tokens only. Every request carries `accept-language`, which the host turns into Chinese or English text (`node:async_hooks` `AsyncLocalStorage`, one language per request).
|
|
658
|
-
|
|
659
|
-
Paths: the repo follows the priority above; the client root prefers `config.appRoot` and otherwise derives from the plugin's own location (`<AppRoot>\dsh-profile-config-sync-0.1.0`), so moving machines needs no edit; `.dsh` is `config.dshHome` → `%DSH_HOME%` → `~\.dsh`. The sync state file `~\.dsh\config-sync-state.json` is written by `sync.ps1`; the plugin only reads it. Local-only files: `config-sync-roots.json` (confirmed roots), `config-sync-pending-paths.json` (files skipped for a missing root), `config-sync-absolute-paths.json` (0.3.36: stray roots-outside paths found after a push) and `config-sync-overwrite.json` (0.3.36: which local configs a pull overwrote, with backup paths), `config-sync-scope.json` (per-group checkboxes) and `config-sync-extra.json` (0.3.51: plugin-data rules and extra paths).
|
|
660
|
-
|
|
661
|
-
**Boundary**: `capture` has to read `cordis.patch.yml` while DSH holds that file, so it would capture a half-written state; and after `apply` writes, DSH writes over it again on exit. Hence the fixed boundary: decide what to run and write the command now, double-click after DSH exits. The full explanation of the sync mechanism, directory layout, moving to another machine and troubleshooting lives in the config repo's root `README.md`; this document covers the plugin itself.
|
|
662
|
-
|
|
663
|
-
## Pitfalls already closed in the generator
|
|
664
|
-
|
|
665
|
-
All of them surfaced only by **actually running on a new machine**:
|
|
666
|
-
|
|
667
|
-
| Pitfall | Handling |
|
|
668
|
-
|---|---|
|
|
669
|
-
| cmd's `echo` swallows `< > \| & ^ %`, so `echo ... config-<timestamp>` became a redirect and printed nothing | every dynamic line goes through `echoSafe()`: `%`→`%%`, special characters prefixed with `^` |
|
|
670
|
-
| after `chcp 65001`, `set /p` cannot read redirected input: automation feeding `y` left `GO` empty, "finished" printed while nothing happened, exit code still 0 | `--yes` skips confirmation + an explicit receipt when there is none |
|
|
671
|
-
| a fresh machine has no upstream, `git pull --ff-only` says *There is no tracking information…*, PowerShell 5.1 wraps it as NativeCommandError and the script carried on | `sync.ps1` probes upstream first; since 0.3.54 a pull is `fetch` + `merge --ff-only origin/<branch>` (one network round trip), and a missing upstream is fixed with `set-upstream-to`; push uses `-u` |
|
|
672
|
-
| `GIT_SSH_COMMAND` without the ssh.exe program → `/usr/bin/sh: - : invalid option` | four branches: use `core.sshCommand` if set; write a full command when `ssh.exe` is found; **unset the variable** when only a key exists; hand it to `.ssh\config` when there is no key |
|
|
673
|
-
| with an asar build, AppRoot lookups by path all miss and every bundle is reported missing | `isAppRoot` accepts `app\package.json` **or** `app.asar`; version and bundle existence are read straight out of the asar (PowerShell 5.1 `ConvertFrom-Json` caps at 2 MB, a 5.7 MB header has to be read by entry offset), and anything undecidable is reported as "unknown" |
|
|
674
|
-
| plugin directory already present skips deployment, so a newer tgz leaves old code running | `apply.ps1` compares the tgz with the newest deployed file and, when newer, renames to `.bak-<timestamp>` and redeploys |
|
|
675
|
-
| "push on exit" was enabled yet nothing happened (no log, no result file) | two causes stacked: ① the queue predicate only looked at `ahead > 0`, which stays 0 until new sessions are captured → count all three sources + re-check every 2 minutes; ② `spawn` faked success (`detached` PowerShell exiting immediately / failures only on the `error` event) → start a separate process with `Start-Process`, await the launcher's exit code, and write `auto-sync-launch.log` |
|
|
676
|
-
| an empty folder was treated as "the repo is broken": red text plus an enabled push button that would always fail | since 0.3.26 `repo.phase` splits it into four states; an empty folder allows pull only, blocked at three layers: `prepare(push)`, `push-now`, and `sync.ps1 push` |
|
|
677
|
-
| "does the cloud have anything to pull" was answered by branch count → a remote whose `main` still exists but whose tree was emptied still read as "has content, pull only": pulling produced an empty folder, the state never changed and the initialize-push entry never appeared (a dead loop; verified on Gitee: 98 commits, the last 12 all "delete file", the newest tree has 0 files) | since 0.3.36 the criterion is **the file count inside the branch tree**: `ls-remote --heads` counts branches first (0 branches = empty, no fetch), and only when branches exist does it create a temporary bare repo, `fetch --depth 1 --filter=blob:none` and `ls-tree -r`, then delete it; `remoteFiles===0` always means "both sides empty" → push only, and `sync.ps1` overwrites that empty branch with `--force-with-lease` (the tree is empty, nothing is lost) |
|
|
678
|
-
| a pull rewrote settings wholesale: edit a path, pull before pushing and the edit was silently replaced (only a backup folder, no notice) | since 0.3.36 the overwrite is compared first (roots → placeholders, CRLF flattened, the three timestamp fields in `our-free-model.json` zeroed); every difference lands in `config-sync-overwrite.json` and the panel/console say "N files were overwritten, local edits backed up first" |
|
|
679
|
-
| after a sync, **creating a session failed outright**: `failed to create session … corrupt Zstandard session log: invalid frame magic at byte 186` | the first frame DSH writes carries a **4-byte content checksum** (frame header descriptor FHD bit2), and the decompressor happily succeeds on the prefix with that checksum trimmed, so the binary search for the "shortest decodable prefix" ended 4 bytes early; the rewritten file then kept the old checksum as garbage and DSH blew up on the second frame. Now: add 4 bytes per FHD bit2 → correct against "the next frame magic" → self-check before writing (cwd applied + new first frame is followed by a frame magic), refuse to write otherwise; leftover tails in already-broken files are dropped (self-healing) |
|
|
680
|
-
|
|
681
|
-
Session header `cwd`, empty-snapshot fallback and missing `Get-FileHash` are handled by `apply.ps1` / `restore.ps1` / `dsh-sync-common.ps1` in the config repo; see sections 5 and 10 of its root `README.md`.
|
|
682
|
-
|
|
683
|
-
## Performance (0.3.54): three speedups, zero behaviour change
|
|
684
|
-
|
|
685
|
-
All three change *how* things are computed, not *what* is computed: the files written to the repo, the commit contents and the failure decisions stay byte-identical to 0.3.53 — it just runs faster. Numbers come from a same-size synthetic repo (50,889 files / 416 MB) and against real Gitee:
|
|
686
|
-
|
|
687
|
-
| Step | Before | After | Why |
|
|
688
|
-
|---|---|---|---|
|
|
689
|
-
| capture deciding "does this file need rewriting" | two `Get-FileHash` per file (source + repo): 1.2 ms each → ~**120 s** for 50k files | two `Get-ChildItem` passes, one `FileInfo` each (Length / LastWriteTimeUtc already read by the enumeration) + an in-memory dictionary diff: **3.9 s**; hashes only for the few whose size or mtime differs | per-file `Test-Path` / `Get-Item` is *slower* (measured **37.8 s**, ~0.7 ms per cmdlet call), so bulk enumeration is the only sane way |
|
|
690
|
-
| push scanning history for oversized blobs | `git ls-tree -r -l HEAD` on every push: **20–23 s** on a 50k-file repo, for a history that barely changes | cached per commit in `.dsh\sync-history-scan.json` (`{commit, oversized, at}`): skipped when the commit matches or is an ancestor of HEAD; a full scan only on first push, after a remote rejection, or with `-ScanHistory` | newly added files are already caught by the index pre-check; the history scan only covers "an old commit already carries a huge blob" |
|
|
691
|
-
| pull | `git pull --ff-only` is fetch + merge internally, while the script had already fetched → **two network round trips** (SSH handshake measured ≈0.95 s) | `fetch origin --prune`, then `merge --ff-only origin/<branch>` → **one round trip**; `merge --ff-only` still refuses anything but a fast-forward, so a dirty tree or divergence fails exactly as before | when the run starts from a pending conflict list the earlier fetch was skipped, so one fetch is issued first to make the merge use fresh refs |
|
|
692
|
-
|
|
693
|
-
Two new switches on `sync.ps1`, both **off by default** — the default path behaves exactly like 0.3.53:
|
|
694
|
-
|
|
695
|
-
- `-DeepVerify`: forwarded to `capture.ps1`, ignoring the size/mtime fast path and **hashing every file**. Use it when you suspect drift where size and mtime both look unchanged (cost: back to 1.2 ms per file).
|
|
696
|
-
- `-ScanHistory`: ignores the history-scan cache and **always does a full** `ls-tree -r -l HEAD`. Use it after switching remotes, when the cache looks stale, or for a manual re-check.
|
|
697
|
-
|
|
698
|
-
```powershell
|
|
699
|
-
pwsh -File sync.ps1 push -DeepVerify
|
|
700
|
-
pwsh -File sync.ps1 push -ScanHistory
|
|
701
|
-
```
|
|
702
|
-
|
|
703
|
-
The log shows which path ran: `文件比较(快筛):比对 N 个,深哈希 M 个` versus `文件比较(深校验开):比对 N 个,深哈希 N 个`.
|
|
704
|
-
|
|
705
|
-
## Self-check
|
|
706
|
-
|
|
707
|
-
- `node tools\selftest.mjs <repo path>`: starts the host half with a fake ctx, hits status, generates scripts and asserts the JSON and the files on disk; it backs up any existing `同步-*.cmd` in the repo root and restores them afterwards. **The repo path must be passed explicitly.**
|
|
708
|
-
- `node tools\clientcheck.mjs`: runs the client half with a fake `__ModuleLoader__` and a react stand-in, asserting the module loads, all three `apply()` registrations succeed (sidebar row and main with matching id/key), `inject` returns a disposer, and the component renders without throwing when data is empty. It validates the contract and structure; the UI still needs a restart and a look.
|
|
709
|
-
- `pwsh -File tools\pack-plugin.ps1`: packs the tgz and writes the sha256 back into `version.json`. **PowerShell 7 is required** (the script is UTF-8 without a BOM, and 5.1 reads the Chinese text as GBK and fails).
|
|
710
|
-
|
|
711
|
-
## Test log
|
|
712
|
-
|
|
713
|
-
| Date | Version | Summary |
|
|
714
|
-
|---|---|---|
|
|
715
|
-
| 2026-11-24 | 0.3.93 | Clicking × to close DSH now checks once for auto pull/push and queues the watcher immediately (no more waiting for the 2-minute window); autoRestart semantics unified to !== false |
|
|
716
|
-
| 2026-11-24 | 0.3.92 | Remote "uncommitted" now includes local pending data (pending); Refresh button really triggers git fetch; fixes "remote figures always 0" |
|
|
717
|
-
| 2026-11-24 | 0.3.91 | Settings summary row fetches before refreshing remote info (no longer stale, auto-refresh every 30s); four generate-script buttons replaced with Pull/Push now (closes DSH) sharing the automation queue |
|
|
718
|
-
| 2026-11-24 | 0.3.90 | Jump tabs highlight the current section; "Local data" label removed from To-do; To-do expands to concrete session names and local profile files |
|
|
719
|
-
| 2026-11-24 | 0.3.89 | Plugin update card shows an "npm download URL"; falls back to two npm sources (mirror + official) when GitHub release is unreachable, still verified against the authoritative sha256 |
|
|
720
|
-
| 2026-11-23 | 0.3.86 | Moved "Local data" into Overview / To-do, grouped pending files by the twelve sync-content groups, and show session names instead of session ids in the sample |
|
|
721
|
-
| 2026-11-23 | 0.3.85 | Removed the tinted banner above the workspace list in edit mode; edit state is read from the Edit/Done button in the header |
|
|
722
|
-
| 2026-11-23 | 0.3.84 | Workspace visibility card uses one Edit button for the whole card; each session row carries its own toggle with a background and divider, hidden names struck through |
|
|
723
|
-
| 2026-11-23 | 0.3.83 | Workspace visibility card also collapses blank sessions and Mnemon idle-review parents; default view on this machine 99 → 10 |
|
|
724
|
-
| 2026-11-23 | 0.3.82 | Workspace visibility card collapses agent sessions by default; hide/show goes through workspaceRegistry and applies instantly (no restart) |
|
|
725
|
-
| 2026-11-21 | 0.3.75 | Sync hidden/archived workspaces across machines (workspace-archives.v1.json into settings); hidden workspaces and sessions stay hidden on B after pull |
|
|
726
|
-
| 2026-11-19 | 0.3.69 | Carry billion-context compaction state across machines (bili-state.mjs); two new notice kinds (plugin-missing / context-state) |
|
|
727
|
-
| 2026-11-19 | 0.3.68 | Session projection-cache guard (fixes agent-busy session creation) |
|
|
728
|
-
| 2026-11-19 | 0.3.67 | Session log seq reconciliation guard (merge by seq, no more whole-file overwrite) |
|
|
729
|
-
| 2026-11-19 | 0.3.66 | .gitattributes silences LF/CRLF warnings |
|
|
730
|
-
| 2026-11-18 | 0.3.65 | Refresh button feedback (text changes to "Refreshing…") |
|
|
731
|
-
| 2026-11-18 | 0.3.64 | Backup restore fix (write back to original location) + failure summary + auto-close |
|
|
732
|
-
| 2026-11-18 | 0.3.63 | Push speed: Get-RelPath ~10x faster |
|
|
733
|
-
| 2026-11-18 | 0.3.62 | Pull speed: 341s → 109s (3.1×) |
|
|
734
|
-
| 2026-11-15 | 0.3.54 | Three speedups (fast-screen / history cache / single fetch), zero behaviour change |
|
|
735
|
-
| 2026-11-14 | — | Two machines from scratch (isolated); session log first-frame 4-byte leftover fix |
|
|
736
|
-
| 2026-11-11 | — | Single-machine isolated end-to-end (install → pull → push → restore) |
|
|
737
|
-
|
|
738
|
-
Detailed test data is in each version's Release Notes.
|
|
1
|
+
# Config Backup & Sync
|
|
2
|
+
|
|
3
|
+
> **dsh-profile-config-sync** — multi-device configuration **backup / sync / restore** for the DeepSeek Harness desktop client.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/dsh-profile-config-sync)
|
|
6
|
+
[](https://github.com/huanyu-a/dsh-profile-config-sync/releases/latest)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](#sync-scope)
|
|
9
|
+
[](#sync-scope)
|
|
10
|
+
[](https://github.com/huanyu-a/dsh-profile-config-sync/blob/main/docs/CHANGELOG.md)
|
|
11
|
+
|
|
12
|
+
[中文](README.md) | English
|
|
13
|
+
|
|
14
|
+
DSH keeps its configuration in a dozen places under `~/.dsh`: the profile, the global prompt, skills, agent presets, plugin settings, plugin data, workspaces and session logs.
|
|
15
|
+
This plugin captures them as **12 groups** into one Git repository, pushes it to your own Git remote or a WebDAV endpoint, and lays it back down on another machine — or after a reinstall, or after a bad edit.
|
|
16
|
+
**Every sync runs after the client has exited**, so a half-written config never reaches the repo.
|
|
17
|
+
|
|
18
|
+
Based on [QcWyGm/dsh-config-sync-plugin](https://github.com/QcWyGm/dsh-config-sync-plugin) (MIT) — rewritten and extended; see [Upstream & license](#credits).
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## What it does
|
|
25
|
+
|
|
26
|
+
- **Captures 12 groups**: profile files, global prompt (`AGENTS.md` / `prompt-inject.md`), skills, agent presets, the skill-market ledger, plugin settings & workflows (14 sources), memory data, local source plugins, plugin-data slots, extra paths, workspaces and session logs (attachments and `session_projcache` included). Every group and item can be switched off; anything that could not be captured is named at the end of the log and in a persistent panel notice.
|
|
27
|
+
- **Two transports**: Git remotes (SSH / HTTPS — GitHub, Gitee, GitLab, self-hosted Gitea/Forgejo) and **WebDAV**, sharing one repository layout, switchable at any time.
|
|
28
|
+
- **Four actions, one-click scripts**: push, pull, restore (a snapshot or a git commit) and init-push, each generated as a double-clickable `.cmd` (Windows) or `.sh` (macOS/Linux).
|
|
29
|
+
- **Runs after the client quits**: nothing is copied while the app is running; actions can queue for the next launch, and auto-sync can relaunch the client itself.
|
|
30
|
+
- **No forked repository across platforms**: PowerShell on Windows, the Node engine on macOS/Linux, one shared repo; machine identity lives in `machines/`.
|
|
31
|
+
- **Backs up before overwriting**: files about to be replaced or deleted go to `~/.dsh/backups/` first, so a wrong restore can itself be rolled back.
|
|
32
|
+
- **Panel health check**: local / cloud badges (cloud re-checked every two minutes), version contract, bundle, dependencies, backup snapshots, last sync, and a to-do list with jump links.
|
|
33
|
+
- **Safety boundaries**: browser profiles and credential stores are blocked at three independent layers (capture, upload, engine); three per-file size tiers (>100 MB skipped at capture, ≥95 MB dropped before commit, 50–95 MB warn only); both sides of a conflict are kept; path-traversal guards.
|
|
34
|
+
- **Pending counts match the executor**: 12 groups on Windows, only the four groups the engine really syncs on macOS/Linux.
|
|
35
|
+
- **Self-update**: reads the `version.json` manifest and checks / downloads / installs from the panel.
|
|
36
|
+
|
|
37
|
+
**Four keywords**: **configure** · **back up** · **sync** · **restore**.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
Package name **`dsh-profile-config-sync`** (the npm package `dsh-config-sync` is the *upstream* project, not this one).
|
|
44
|
+
|
|
45
|
+
| Method | Entry |
|
|
46
|
+
|---|---|
|
|
47
|
+
| npm | `npm i dsh-profile-config-sync` — **npm only has `0.4.1`**, without the 0.6.x safety fixes |
|
|
48
|
+
| Plugin market | Search “Config Backup & Sync” in the client's plugin market (via the git commit registered in `market-index.json`) |
|
|
49
|
+
| Offline tgz | `pnpm add ./dsh-profile-config-sync-0.6.41.tgz` |
|
|
50
|
+
|
|
51
|
+
**Release status**: the latest release is [`v0.6.41`](https://github.com/huanyu-a/dsh-profile-config-sync/releases/tag/v0.6.41) (2026-11-26); the repository is public and the npm package publishes alongside (`npm i dsh-profile-config-sync`).
|
|
52
|
+
|
|
53
|
+
## Known limits
|
|
54
|
+
|
|
55
|
+
- **No mutex off Windows**: Windows capture/apply use a named mutex (`Lock-SyncRun`, exit code 3 for a second runner); the macOS/Linux engine has no such lock.
|
|
56
|
+
- **The non-Windows engine covers 4 groups**: profile, global prompt, skills, presets. Sessions, plugin data and extra paths need the Windows build.
|
|
57
|
+
- **Browser profiles never enter the repo**: `browser-profiles`, `Login Data`, `Cookies` and friends are blocked at three layers.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Quickstart
|
|
62
|
+
|
|
63
|
+
Push once on machine A, pull once on machine B.
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
Machine A ──────────────────────► remote (Gitee / GitHub / self-hosted) ──────► Machine B
|
|
67
|
+
1 install the plugin 1 install the SAME client version, launch once
|
|
68
|
+
2 panel: local repo + cloud URL 2 install the plugin, same local repo + cloud URL
|
|
69
|
+
3 click "init push" 3 click "pull" (overwrites local config)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
| Prerequisite | Requirement | Otherwise |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| Client version | **identical** on both machines (`profile\host-contract.json`) | pull reports a version mismatch; `-AllowVersionDrift` forces it |
|
|
75
|
+
| Target `.dsh` | the client has been launched at least once | `[X] target profile does not exist`, pull exits |
|
|
76
|
+
| Built-in runtime | `<AppRoot>\node.exe` or the client binary | sessions' `cwd` cannot be rewritten — **the session list will be empty** |
|
|
77
|
+
| git | installed on both sides | `git.exe not found` |
|
|
78
|
+
|
|
79
|
+
CLI equivalent (the panel buttons do exactly this):
|
|
80
|
+
|
|
81
|
+
```powershell
|
|
82
|
+
pwsh -File runtime\sync.ps1 push -RepoRoot <repo> -DshHome <~\.dsh> -AppRoot <client root> -SkipInstall -Force
|
|
83
|
+
pwsh -File runtime\sync.ps1 pull -RepoRoot <repo> -DshHome <~\.dsh> -AppRoot <client root> -SkipInstall -Force
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`-SkipInstall` skips `pnpm install` (required offline); `-Force` bypasses the “DSH is running” guard (quit the client instead).
|
|
87
|
+
|
|
88
|
+
Details, raw first-push/first-pull output and the five classic pitfalls: [docs/REFERENCE.md](docs/REFERENCE.md#fromscratch).
|
|
89
|
+
|
|
90
|
+
## Where the entries hang
|
|
91
|
+
|
|
92
|
+
| Entry | Slot | Notes |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| Sidebar row | `sidebar.panellist` (`id: config-sync`) | Title “Config Backup & Sync” |
|
|
95
|
+
| Full page | `main` (`key: config-sync`) | Both registers must happen in a nested `inject` |
|
|
96
|
+
| Settings summary | `settings.general.item` | One four-state chip + expandable detail |
|
|
97
|
+
|
|
98
|
+
## What the panel shows
|
|
99
|
+
|
|
100
|
+
- **Title row**: local badge (consistent / pending push / pending pull / problem) and cloud badge (re-checked automatically every two minutes).
|
|
101
|
+
- **Metric strip**: local/contract, bundle, dependencies, backup snapshots, last sync (with `(+N)` for later writes); a to-do list appears only when something needs attention.
|
|
102
|
+
- **Sections**: overview → local paths (hidden by default) → conflicts (only when real) → sync targets → automation & updates → after-exit actions → restore → sync scope → feedback.
|
|
103
|
+
- **Every card is read-only until you press Edit**; a never-configured card is forced into edit mode.
|
|
104
|
+
- **“Pending push” is not just `git status`**: the host compares mtimes across all 12 captured groups, so a new session that has not been captured yet still counts (capped at 20,000 files / 1.5 s).
|
|
105
|
+
|
|
106
|
+
## Local repo / cloud repo
|
|
107
|
+
|
|
108
|
+
- **Repo test**: `apply.ps1` plus `profile\package.json` present (plus `sync.ps1` to push/pull).
|
|
109
|
+
- **Resolution order**: settings file → `repoPath` → `DSH_CONFIG_REPO` → common locations. An empty directory in the settings is still a valid answer.
|
|
110
|
+
- **Four states**: `ok`, `empty` (await first pull), `missing`, `unusable`.
|
|
111
|
+
- **Empty local + cloud has content → pull only**; **both empty → init push only**.
|
|
112
|
+
- Cloud emptiness is probed with `ls-remote` + a shallow bare fetch (15 s timeout); unreachable means “pull only”.
|
|
113
|
+
- Settings live in `~\.dsh\dsh-config-sync.json` (machine-local, never committed); the SSH key path is stored, but may be left empty for `.ssh\config`.
|
|
114
|
+
|
|
115
|
+
## Sync scope
|
|
116
|
+
|
|
117
|
+
All **12 groups are checked by default**; each group and each item can be unchecked, and unchecking stops both capture and restore.
|
|
118
|
+
|
|
119
|
+
| Group | Cloud dir | Items |
|
|
120
|
+
|---|---|---|
|
|
121
|
+
| profile | `profile/` | package.json / lock / cordis (mandatory, cannot be unchecked) |
|
|
122
|
+
| prompt | `prompt/` | `AGENTS.md`, `prompt-inject.md` |
|
|
123
|
+
| skills | `skills/` | one directory per skill |
|
|
124
|
+
| presets | `presets/` | one entry per preset |
|
|
125
|
+
| market ledger | `storages-record/` | two ledger JSON files |
|
|
126
|
+
| plugin settings | `settings/` | 13 files |
|
|
127
|
+
| memory | `mnemon/` | the whole directory |
|
|
128
|
+
| local plugins | `local-plugins/` | one per linked plugin |
|
|
129
|
+
| plugin data | `plugin-data/` | one slot per plugin-owned directory |
|
|
130
|
+
| extra paths | `extra/` | absolute paths you add |
|
|
131
|
+
| workspaces | `workspace/` | every registered workspace |
|
|
132
|
+
| sessions | `conversations/` | logs, attachments and projcache |
|
|
133
|
+
|
|
134
|
+
Scope is stored in `~\.dsh\config-sync-scope.json` (machine-local, only the deltas). An optional switch also deletes the cloud copy when you uncheck something — off by default.
|
|
135
|
+
|
|
136
|
+
## Restore
|
|
137
|
+
|
|
138
|
+
- The restore card lists every snapshot in `~\.dsh\backups` with name, time, plugin count and whether it is restorable (no per-snapshot `stat` sweep — that used to take 7.7 s for 92 snapshots).
|
|
139
|
+
- **“Restore now”** is a flow: diff preview → confirm → the client quits normally → `post-exit.ps1` runs `restore.ps1` in a visible window → result written to `auto-sync-result.json` → the client relaunches. No manual `.cmd`, no typing `y`.
|
|
140
|
+
- **Point-in-time restore** moves newer files into `backups\manual-<ts>\rollback\` and records everything in `rollback-manifest.json`, so the rollback itself can be rolled back.
|
|
141
|
+
- Three backup kinds each get a button: config snapshots, plugin backups, session backups; unrecognised directories offer a manual path instead of a dead button.
|
|
142
|
+
|
|
143
|
+
## Sync conflicts
|
|
144
|
+
|
|
145
|
+
1. `sync.ps1 pull` fetches, checks fast-forward, then intersects changed paths with local modifications. On a hit it **backs up both sides**, writes `~\.dsh\sync-conflicts.json` and exits 6 — repository and config untouched, HEAD not reset.
|
|
146
|
+
2. The panel shows a conflict card: one row per file, expandable previews, “use local / use cloud” per row (plus both-all buttons), and “restore local/cloud copy” from the backup.
|
|
147
|
+
3. Applying the choice deletes the working copy so git can fast-forward, then writes the local picks back as a normal local change.
|
|
148
|
+
|
|
149
|
+
## Auto sync (both switches off by default)
|
|
150
|
+
|
|
151
|
+
- **Auto pull on start**: 8 s after launch a read-only `git fetch` decides; if behind, a confirm dialog, then the whole client family exits and a visible window runs the pull and relaunches.
|
|
152
|
+
- **Auto push on exit**: queued when local commits, uncommitted changes, or newer local data exist; re-checked every two minutes and once more when you close the window.
|
|
153
|
+
|
|
154
|
+
Details (process detection, lock file, environment cleanup, exit codes): [docs/REFERENCE.md](docs/REFERENCE.md#api).
|
|
155
|
+
|
|
156
|
+
## Self-update
|
|
157
|
+
|
|
158
|
+
The panel card shows local and cloud versions; the manifest and packages live in the public repo (`version.json` + `releases/*.tgz`, a few hundred bytes to check). Status is one of: up to date / update available / downloaded (in `~\.dsh\update-staging\`) / installed pending restart / check failed.
|
|
159
|
+
|
|
160
|
+
Manifest sources are tried in order (`gh-proxy.com` → `ghfast.top` → GitHub raw); download and install are separate steps, and installing quits the client, backs up the old directory, overwrites and relaunches once.
|
|
161
|
+
|
|
162
|
+
## Upstream & license
|
|
163
|
+
|
|
164
|
+
| Item | Value |
|
|
165
|
+
|---|---|
|
|
166
|
+
| Upstream | [QcWyGm/dsh-config-sync-plugin](https://github.com/QcWyGm/dsh-config-sync-plugin) (originally `dsh-config-sync`) |
|
|
167
|
+
| Upstream license | MIT, `Copyright (c) 2026 dsh-config-sync contributors` |
|
|
168
|
+
| This project | [huanyu-a/dsh-profile-config-sync](https://github.com/huanyu-a/dsh-profile-config-sync), MIT, `Copyright (c) 2026 dsh-profile-config-sync contributors` |
|
|
169
|
+
| What changed | Independent package/bundle names; a macOS/Linux Node engine and a WebDAV transport; pending/settings/plugin-data/extra-paths/local-plugin/memory groups in the health check and scope UI; three hard blocks for browser profiles and credential stores; conflict handling, restore snapshots, self-update and bilingual copy re-implemented |
|
|
170
|
+
| What was kept | The repository layout (`profile/`, `prompt/`, `skills/`, `sessions/`…), the after-exit execution model, and the historical pitfall notes from the upstream README |
|
|
171
|
+
|
|
172
|
+
Full license text: [LICENSE](LICENSE) — MIT requires keeping the original notice, so that file lists both copyright lines.
|
|
173
|
+
|
|
174
|
+
> The Chinese [README.md](README.md) is the reference (shorter, current). Dated per-version notes live in [docs/HISTORY.en.md](docs/HISTORY.en.md); the verification log is in [docs/CHANGELOG.en.md](docs/CHANGELOG.en.md) and [docs/CHANGELOG.md](docs/CHANGELOG.md).
|