dsh-config-sync-plugin 0.3.56 → 0.3.57
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/README.en.md +11 -12
- package/README.md +9 -10
- package/client.js +1 -1
- package/index.js +8 -8
- package/package.json +5 -5
- package/runtime/apply.ps1 +33 -2
- package/tools/clientcheck.mjs +1 -1
- package/tools/selftest.mjs +1 -1
package/README.en.md
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
# dsh-config-sync
|
|
2
|
-
|
|
1
|
+
# dsh-config-sync-plugin
|
|
3
2
|
[中文](README.md) | English
|
|
4
3
|
|
|
5
4
|
A DSH plugin: it adds a **"Config Sync"** row to the sidebar (opening a full-page health-check panel), plus a summary row under **Settings → General**. It only **inspects and prepares commands** — the sync actions never run inside the app (except the automatic sync that relaunches the client).
|
|
@@ -20,7 +19,7 @@ The package name is **`dsh-config-sync-plugin`** (the `dsh-config-sync` name on
|
|
|
20
19
|
|
|
21
20
|
| Way | Command / entry | Notes |
|
|
22
21
|
|---|---|---|
|
|
23
|
-
| npm | `npm i dsh-config-sync-plugin` | Use it as a dependency, or add `"dsh-config-sync-plugin": "^0.3.
|
|
22
|
+
| npm | `npm i dsh-config-sync-plugin` | Use it as a dependency, or add `"dsh-config-sync-plugin": "^0.3.57"` to the profile's `package.json` and run `pnpm i`. The name matches the `cordis.patch.yml` insert name and the install folder `dsh-config-sync-plugin-<ver>` |
|
|
24
23
|
| Marketplace | client → Plugins → Discover → “Config Sync” | Installs from the git commit registered in `market-index.json` |
|
|
25
24
|
| Offline tgz | `releases\dsh-config-sync-plugin-<ver>.tgz` | GitHub Release asset for air-gapped machines; the panel's Update button downloads the same file |
|
|
26
25
|
|
|
@@ -107,14 +106,14 @@ The plugin is a standard DSH bundle; install it into the current profile:
|
|
|
107
106
|
|
|
108
107
|
```sh
|
|
109
108
|
# Install from this repo's release package (no build needed: host, client and runtime scripts are already inside)
|
|
110
|
-
dsh plugin add https://raw.githubusercontent.com/QcWyGm/dsh-config-sync/main/releases/dsh-config-sync-<version>.tgz # latest on the Releases page
|
|
109
|
+
dsh plugin add https://raw.githubusercontent.com/QcWyGm/dsh-config-sync-plugin/main/releases/dsh-config-sync-plugin-<version>.tgz # latest on the Releases page
|
|
111
110
|
```
|
|
112
111
|
|
|
113
112
|
Or add this repo's index under the official **Plugins → Discover → Index sources** (see "Using this repo as a market index source" below). **The third-party market plugin dshmarket does not read that index** — see that section for why.
|
|
114
113
|
|
|
115
114
|
After installing, point it at your own config repo (common paths are auto-detected by default). The **Plugin update** card asks for a manifest URL and token only when needed — **this repo is public, so updates work without a token**.
|
|
116
115
|
|
|
117
|
-
`apply.ps1` does three things on install: it unpacks `local-plugins\dsh-config-sync-<version>.tgz` into `<AppRoot>\dsh-config-sync-0.1.0`, adds a `link:` dependency and a `dsh.profile.bundles` entry to `package.json`, and a `config-sync` line to `cordis.patch.yml`.
|
|
116
|
+
`apply.ps1` does three things on install: it unpacks `local-plugins\dsh-config-sync-plugin-<version>.tgz` into `<AppRoot>\dsh-config-sync-plugin-0.1.0`, adds a `link:` dependency and a `dsh.profile.bundles` entry to `package.json`, and a `config-sync` line to `cordis.patch.yml`.
|
|
118
117
|
|
|
119
118
|
## Contents
|
|
120
119
|
|
|
@@ -378,7 +377,7 @@ Two machines rarely share drive letters (one has `D:\DeepSeekHarness`, the other
|
|
|
378
377
|
|
|
379
378
|
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:
|
|
380
379
|
|
|
381
|
-
1. Title + details → `POST /repos/QcWyGm/dsh-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;
|
|
380
|
+
1. Title + details → `POST /repos/QcWyGm/dsh-config-sync-plugin/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;
|
|
382
381
|
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;
|
|
383
382
|
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;
|
|
384
383
|
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)`.
|
|
@@ -490,7 +489,7 @@ Default exclusions (50 entries, edit freely): `*.db` / `*.db-*` / `*.sqlite*` /
|
|
|
490
489
|
|
|
491
490
|
## Plugin update (since 0.2.0)
|
|
492
491
|
|
|
493
|
-
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-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).
|
|
492
|
+
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-config-sync-plugin-<version>.tgz` — only a few hundred bytes are read, the package is not; cached 30 minutes, checked on mount and every 30 minutes after).
|
|
494
493
|
|
|
495
494
|
| Status | Meaning |
|
|
496
495
|
|---|---|
|
|
@@ -503,7 +502,7 @@ The **Plugin update** card shows the local version, the cloud version and one st
|
|
|
503
502
|
- **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.
|
|
504
503
|
- **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.
|
|
505
504
|
- **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.
|
|
506
|
-
- 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-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.
|
|
505
|
+
- 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-config-sync-plugin-<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.
|
|
507
506
|
- 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.
|
|
508
507
|
|
|
509
508
|
## Using this repo as a market index source
|
|
@@ -511,17 +510,17 @@ The **Plugin update** card shows the local version, the cloud version and one st
|
|
|
511
510
|
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:
|
|
512
511
|
|
|
513
512
|
```
|
|
514
|
-
https://raw.githubusercontent.com/QcWyGm/dsh-config-sync/main/market-index.json
|
|
513
|
+
https://raw.githubusercontent.com/QcWyGm/dsh-config-sync-plugin/main/market-index.json
|
|
515
514
|
```
|
|
516
515
|
|
|
517
516
|
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.
|
|
518
517
|
|
|
519
518
|
- **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.
|
|
520
519
|
- **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).
|
|
521
|
-
- **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/QcWyGm/dsh-config-sync@main/market-index.json` — but jsDelivr caches branch aliases like `@main`, so a new release may take hours to appear there.
|
|
520
|
+
- **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/QcWyGm/dsh-config-sync-plugin@main/market-index.json` — but jsDelivr caches branch aliases like `@main`, so a new release may take hours to appear there.
|
|
522
521
|
- **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.
|
|
523
522
|
|
|
524
|
-
Release flow: change code → `pwsh -File tools\pack-plugin.ps1` to pack `releases/dsh-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.
|
|
523
|
+
Release flow: change code → `pwsh -File tools\pack-plugin.ps1` to pack `releases/dsh-config-sync-plugin-<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.
|
|
525
524
|
|
|
526
525
|
## Interfaces and paths
|
|
527
526
|
|
|
@@ -536,7 +535,7 @@ Release flow: change code → `pwsh -File tools\pack-plugin.ps1` to pack `releas
|
|
|
536
535
|
|
|
537
536
|
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).
|
|
538
537
|
|
|
539
|
-
Paths: the repo follows the priority above; the client root prefers `config.appRoot` and otherwise derives from the plugin's own location (`<AppRoot>\dsh-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).
|
|
538
|
+
Paths: the repo follows the priority above; the client root prefers `config.appRoot` and otherwise derives from the plugin's own location (`<AppRoot>\dsh-config-sync-plugin-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).
|
|
540
539
|
|
|
541
540
|
**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.
|
|
542
541
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
# dsh-config-sync
|
|
2
|
-
|
|
1
|
+
# dsh-config-sync-plugin
|
|
3
2
|
中文 | [English](README.en.md)
|
|
4
3
|
|
|
5
4
|
DSH 插件:左侧栏多一行「配置同步」,点开是整页体检面板;「设置 → 通用」另有一行摘要。插件**只做体检 + 备命令**,同步动作在客户端退出后由 `runtime\sync.ps1` 执行(自动同步那一路会自己拉起客户端)。
|
|
@@ -16,7 +15,7 @@ DSH 插件:左侧栏多一行「配置同步」,点开是整页体检面板
|
|
|
16
15
|
|
|
17
16
|
| 方式 | 命令 / 入口 | 说明 |
|
|
18
17
|
|---|---|---|
|
|
19
|
-
| npm | `npm i dsh-config-sync-plugin` | 适合把它当依赖管理,或在 profile 的 `package.json` 里写 `"dsh-config-sync-plugin": "^0.3.
|
|
18
|
+
| npm | `npm i dsh-config-sync-plugin` | 适合把它当依赖管理,或在 profile 的 `package.json` 里写 `"dsh-config-sync-plugin": "^0.3.57"` 后 `pnpm i`;包名与 `cordis.patch.yml` 里注册的名字、插件目录 `dsh-config-sync-plugin-<ver>` 一致 |
|
|
20
19
|
| 插件市场 | 客户端「插件市场 → 发现」搜「配置同步」 | 走 `market-index.json` 登记的 git 提交,版本与 README 对齐 |
|
|
21
20
|
| 离线 tgz | `releases\dsh-config-sync-plugin-<ver>.tgz` | GitHub Release 附件,适合内网机器;面板「更新」按钮下载的也是它 |
|
|
22
21
|
|
|
@@ -116,12 +115,12 @@ pwsh -File runtime\sync.ps1 pull `
|
|
|
116
115
|
|
|
117
116
|
```sh
|
|
118
117
|
# 版本号换成 Releases 页里最新的那个
|
|
119
|
-
dsh plugin add https://raw.githubusercontent.com/QcWyGm/dsh-config-sync/main/releases/dsh-config-sync-<版本>.tgz
|
|
118
|
+
dsh plugin add https://raw.githubusercontent.com/QcWyGm/dsh-config-sync-plugin/main/releases/dsh-config-sync-plugin-<版本>.tgz
|
|
120
119
|
```
|
|
121
120
|
|
|
122
121
|
或在 DSH「插件 → 发现 → 索引源」里添加本仓库索引(见「作为插件市场的索引源」)。第三方市场 **dshmarket 不读这份索引**,原因见同一节。
|
|
123
122
|
|
|
124
|
-
`apply.ps1` 落地时做三件事:`local-plugins\dsh-config-sync-<版本>.tgz` 解压到 `<AppRoot>\dsh-config-sync-0.1.0`;`package.json` 加一条 `link:` 依赖与一条 `dsh.profile.bundles`;`cordis.patch.yml` 加 `config-sync` 行。
|
|
123
|
+
`apply.ps1` 落地时做三件事:`local-plugins\dsh-config-sync-plugin-<版本>.tgz` 解压到 `<AppRoot>\dsh-config-sync-plugin-0.1.0`;`package.json` 加一条 `link:` 依赖与一条 `dsh.profile.bundles`;`cordis.patch.yml` 加 `config-sync` 行。
|
|
125
124
|
|
|
126
125
|
## 包含什么
|
|
127
126
|
|
|
@@ -368,7 +367,7 @@ dsh plugin add https://raw.githubusercontent.com/QcWyGm/dsh-config-sync/main/rel
|
|
|
368
367
|
|
|
369
368
|
**GitHub Issue 是唯一真源**,不再往配置仓库塞 json:
|
|
370
369
|
|
|
371
|
-
1. 填标题 + 详情 → `POST /repos/QcWyGm/dsh-config-sync/issues`,label `feedback`,正文末尾自动附环境块(插件版本、机器名、时间、平台、安装目录、配置仓库路径)。
|
|
370
|
+
1. 填标题 + 详情 → `POST /repos/QcWyGm/dsh-config-sync-plugin/issues`,label `feedback`,正文末尾自动附环境块(插件版本、机器名、时间、平台、安装目录、配置仓库路径)。
|
|
372
371
|
2. 列表直接读 Issue(`state=all&labels=feedback`),点标题去 GitHub 网页。
|
|
373
372
|
3. 点「已解决」→ `PATCH issue {state:'closed'}`。
|
|
374
373
|
4. 顶上一行连接状态三态:`已用 xxx 登录` / `令牌不属于所有者(只能读和提交)` / `匿名读取(提交走浏览器)`。
|
|
@@ -460,7 +459,7 @@ dsh plugin add https://raw.githubusercontent.com/QcWyGm/dsh-config-sync/main/rel
|
|
|
460
459
|
|
|
461
460
|
## 插件自更新
|
|
462
461
|
|
|
463
|
-
面板「插件更新」卡显示本地版本、云端版本和一行状态;清单与安装包都在公开仓库(`version.json` + `releases/dsh-config-sync-<版本>.tgz`,只读几百字节,不拉整包),服务端缓存 30 分钟,挂载时查一次、之后每 30 分钟复查。
|
|
462
|
+
面板「插件更新」卡显示本地版本、云端版本和一行状态;清单与安装包都在公开仓库(`version.json` + `releases/dsh-config-sync-plugin-<版本>.tgz`,只读几百字节,不拉整包),服务端缓存 30 分钟,挂载时查一次、之后每 30 分钟复查。
|
|
464
463
|
|
|
465
464
|
| 状态 | 含义 |
|
|
466
465
|
|---|---|
|
|
@@ -481,21 +480,21 @@ dsh plugin add https://raw.githubusercontent.com/QcWyGm/dsh-config-sync/main/rel
|
|
|
481
480
|
仓库根的 `market-index.json` 就是一份可直接用的 DSH 市场索引(`format: 1`,`source.type: git` + 40 位 commit)。索引地址:
|
|
482
481
|
|
|
483
482
|
```
|
|
484
|
-
https://raw.githubusercontent.com/QcWyGm/dsh-config-sync/main/market-index.json
|
|
483
|
+
https://raw.githubusercontent.com/QcWyGm/dsh-config-sync-plugin/main/market-index.json
|
|
485
484
|
```
|
|
486
485
|
|
|
487
486
|
在 DSH「插件 → 发现 → 索引源」填入即可。**前提**:这是宿主官方发现页(`@deepseek-ai/dsh-plugin-market`)的索引源,需要 profile 启用官方 `@deepseek-ai/dsh-experimental-plugin-market-bundle`。
|
|
488
487
|
|
|
489
488
|
**dshmarket 里搜不到自建索引,是正常的**:dshmarket 的列表只来自它自己的精选目录(`awesome-dsh-plugin.com/plugins.json`,国内走 npm 的 `dsh-plugin-catalog`),源码里没有自定义索引源这条路,安装也被限定在「该目录列出的来源」。要出现在那里,只能向 [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) 提 PR 收录。
|
|
490
489
|
|
|
491
|
-
> **收录后的可见性**(2026-11-13 实测):PR `#14762` 已 MERGED,条目 `data/plugins/QcWyGm__dsh-config-sync.yml` 已进站点正本(`plugins.json`,`updated: 2026-11-13`,10974 条,含 `QcWyGm/dsh-config-sync`)。但客户端取源顺序是「站点正本 → 地区 npm 源 → jsDelivr 兜底」:13.8 MB 正本下载超时后落到 jsDelivr 镜像,而镜像(`dsh-plugin-catalog` npm 包每天 UTC 05:19 重建一次)还停在 `2026-11-12` / 10778 条、**不含** QcWyGm。所以「收录完了却搜不到」=**镜像滞后**,不是代码问题;等当天目录包重建 + 缓存失效,或重启客户端让它重读,就会出来。用 CLI 强制刷新可立刻验证:
|
|
490
|
+
> **收录后的可见性**(2026-11-13 实测):PR `#14762` 已 MERGED,条目 `data/plugins/QcWyGm__dsh-config-sync.yml` 已进站点正本(`plugins.json`,`updated: 2026-11-13`,10974 条,含 `QcWyGm/dsh-config-sync-plugin`)。但客户端取源顺序是「站点正本 → 地区 npm 源 → jsDelivr 兜底」:13.8 MB 正本下载超时后落到 jsDelivr 镜像,而镜像(`dsh-plugin-catalog` npm 包每天 UTC 05:19 重建一次)还停在 `2026-11-12` / 10778 条、**不含** QcWyGm。所以「收录完了却搜不到」=**镜像滞后**,不是代码问题;等当天目录包重建 + 缓存失效,或重启客户端让它重读,就会出来。用 CLI 强制刷新可立刻验证:
|
|
492
491
|
|
|
493
492
|
```powershell
|
|
494
493
|
node ~\.dsh\.dsh-plugin-market\market-core.mjs catalog --profile desktop
|
|
495
494
|
# ok=true, source=official, fromCache=false, version=2026-11-13, count=10974
|
|
496
495
|
```
|
|
497
496
|
|
|
498
|
-
> 同名冲突提醒:目录里 `dsh-config-sync` 有两条——`QcWyGm`(`github:QcWyGm/dsh-config-sync`,category git)与 `bxzfxl`(`@liangfengqi/dsh-config-sync`,category tools,downloads 843),搜索时会并排出现。
|
|
497
|
+
> 同名冲突提醒:目录里 `dsh-config-sync` 有两条——`QcWyGm`(`github:QcWyGm/dsh-config-sync-plugin`,category git)与 `bxzfxl`(`@liangfengqi/dsh-config-sync`,category tools,downloads 843),搜索时会并排出现。
|
|
499
498
|
|
|
500
499
|
升级流程:改代码 → `pwsh -File tools\pack-plugin.ps1` 打包(自动把 sha256 回填 `version.json`)→ 改 `version.json` 的 `version` / `notes` → 把 `market-index.json` 里那条的 `version` 与 `commit` 换成新提交 → 推送。索引只引用 commit,旧版本随时能装回。打完包先跑 `node tools\selftest.mjs <仓库路径>` + `node tools\clientcheck.mjs`。
|
|
501
500
|
|
package/client.js
CHANGED
|
@@ -921,7 +921,7 @@ window.__ModuleLoader__.load({
|
|
|
921
921
|
}
|
|
922
922
|
// 「手动还原」指引里的目标位置:认不出类型时按内容猜不到,索性把三类常见落点都摆出来
|
|
923
923
|
const manualTargets = () => [
|
|
924
|
-
M('插件本体 → 插件安装目录(如 D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.
|
|
924
|
+
M('插件本体 → 插件安装目录(如 D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.57)', 'Plugin files → the plugin install folder (e.g. D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.57)'),
|
|
925
925
|
M('会话目录(--xxx--)→ ~\\.dsh\\sessions', 'Session folders (--xxx--) → ~\\.dsh\\sessions'),
|
|
926
926
|
M('配置五件套(package.json / pnpm-lock.yaml / cordis.yml…)→ ~\\.dsh\\profiles\\desktop', 'Config files (package.json / pnpm-lock.yaml / cordis.yml…) → ~\\.dsh\\profiles\\desktop'),
|
|
927
927
|
]
|
package/index.js
CHANGED
|
@@ -79,10 +79,10 @@ const PLUGIN_VERSION = (() => {
|
|
|
79
79
|
// **不要**用 jsDelivr 兜清单:它对 `@main` 这类分支别名有明显缓存(实测发版后仍返回上一版清单,purge 接口也没
|
|
80
80
|
// 立刻刷新),拿它当清单源会让"有新版本"晚几小时才出现,比读不到更误导人。
|
|
81
81
|
// 用户自己在设置里填了清单地址时只用他那一个 —— 不掺镜像,免得"读到的其实不是他指定的源"。
|
|
82
|
-
const RAW_MANIFEST_URL = 'https://raw.githubusercontent.com/QcWyGm/dsh-config-sync/main/version.json'
|
|
82
|
+
const RAW_MANIFEST_URL = 'https://raw.githubusercontent.com/QcWyGm/dsh-config-sync-plugin/main/version.json'
|
|
83
83
|
const UPDATE_MANIFEST_MIRRORS = [
|
|
84
|
-
'https://gh-proxy.com/https://raw.githubusercontent.com/QcWyGm/dsh-config-sync/main/version.json',
|
|
85
|
-
'https://ghfast.top/https://raw.githubusercontent.com/QcWyGm/dsh-config-sync/main/version.json',
|
|
84
|
+
'https://gh-proxy.com/https://raw.githubusercontent.com/QcWyGm/dsh-config-sync-plugin/main/version.json',
|
|
85
|
+
'https://ghfast.top/https://raw.githubusercontent.com/QcWyGm/dsh-config-sync-plugin/main/version.json',
|
|
86
86
|
RAW_MANIFEST_URL,
|
|
87
87
|
]
|
|
88
88
|
const UPDATE_MANIFEST_URL = RAW_MANIFEST_URL
|
|
@@ -976,9 +976,9 @@ async function inspect(config) {
|
|
|
976
976
|
const remoteFiles = remoteProbe ? remoteProbe.files : null
|
|
977
977
|
if (!appRoot) {
|
|
978
978
|
advice.push(t(
|
|
979
|
-
'定位不到客户端根目录:插件不在 <客户端根> 下(如 D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.
|
|
979
|
+
'定位不到客户端根目录:插件不在 <客户端根> 下(如 D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.57),'
|
|
980
980
|
+ '或客户端是打包版(resources\\app.asar)而这里没认出来 —— 三份同步脚本会因此生成不了',
|
|
981
|
-
'Cannot locate the client root: the plugin is not under <client root> (e.g. D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.
|
|
981
|
+
'Cannot locate the client root: the plugin is not under <client root> (e.g. D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.57), '
|
|
982
982
|
+ 'or this is a packaged build (resources\\app.asar) that was not recognized — the three sync scripts cannot be generated.',
|
|
983
983
|
))
|
|
984
984
|
}
|
|
@@ -3477,9 +3477,9 @@ async function handlePrepare(req, res, config) {
|
|
|
3477
3477
|
if (!appRoot) {
|
|
3478
3478
|
throw new Error(t(
|
|
3479
3479
|
'定位不到客户端根目录(要能找到 resources\\app\\package.json 或 resources\\app.asar):'
|
|
3480
|
-
+ '请确认插件装在 <客户端根> 下(例如 D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.
|
|
3480
|
+
+ '请确认插件装在 <客户端根> 下(例如 D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.57),或在设置里填客户端根 appRoot',
|
|
3481
3481
|
'Cannot locate the client root (needs resources\\app\\package.json or resources\\app.asar): '
|
|
3482
|
-
+ 'make sure the plugin is installed under <client root> (e.g. D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.
|
|
3482
|
+
+ 'make sure the plugin is installed under <client root> (e.g. D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.57), or set appRoot in the settings',
|
|
3483
3483
|
))
|
|
3484
3484
|
}
|
|
3485
3485
|
const state = {...await repoState(repo), message}
|
|
@@ -3833,7 +3833,7 @@ async function handleRoots(req, res, config) {
|
|
|
3833
3833
|
// 面板里提交 → 直接建 issue(label=feedback,正文附环境块);列表读 issue(含 open/closed);
|
|
3834
3834
|
// 点「已解决」就 PATCH 成 closed。网络不通时先进本机待发队列,下次点「补发」再建 issue。
|
|
3835
3835
|
|
|
3836
|
-
const GH_DEFAULT_REPO = 'QcWyGm/dsh-config-sync'
|
|
3836
|
+
const GH_DEFAULT_REPO = 'QcWyGm/dsh-config-sync-plugin'
|
|
3837
3837
|
const GH_FEEDBACK_LABEL = 'feedback'
|
|
3838
3838
|
|
|
3839
3839
|
/** 当前插件版本(读自己的 package.json;读不到就空串,不抛)。 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-config-sync-plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.57",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "在 DSH 设置里查看 dsh-config 仓库与本机的同步状态,并生成退出后执行的 push/pull 脚本。同步动作本身不在应用内执行。面板与文案跟随客户端语言(中文/English)。",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"license": "MIT",
|
|
45
45
|
"repository": {
|
|
46
46
|
"type": "git",
|
|
47
|
-
"url": "https://github.com/QcWyGm/dsh-config-sync"
|
|
47
|
+
"url": "https://github.com/QcWyGm/dsh-config-sync-plugin"
|
|
48
48
|
},
|
|
49
|
-
"homepage": "https://github.com/QcWyGm/dsh-config-sync#readme",
|
|
49
|
+
"homepage": "https://github.com/QcWyGm/dsh-config-sync-plugin#readme",
|
|
50
50
|
"bugs": {
|
|
51
|
-
"url": "https://github.com/QcWyGm/dsh-config-sync/issues"
|
|
51
|
+
"url": "https://github.com/QcWyGm/dsh-config-sync-plugin/issues"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
@@ -57,4 +57,4 @@
|
|
|
57
57
|
"check": "node --check index.js && node --check client.js",
|
|
58
58
|
"verify": "node tools/selftest.mjs && node tools/clientcheck.mjs"
|
|
59
59
|
}
|
|
60
|
-
}
|
|
60
|
+
}
|
package/runtime/apply.ps1
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
<#
|
|
2
2
|
DSH 配置同步 —— 应用脚本(把本仓库的配置还原到当前电脑)
|
|
3
3
|
|
|
4
4
|
用法
|
|
@@ -480,6 +480,36 @@ function Sync-ConversationApply {
|
|
|
480
480
|
foreach ($sid in @($w.sessionIds)) { if ($sid) { $projMap[[string]$sid] = $lid } }
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
+
# 登记表 sessionIds 可能滞后(会话是后来新建的、capture 只抄了当时的快照),
|
|
484
|
+
# 仅靠它会漏掉大量 projcache → 那些会话 cwd 仍指 A 机目录,点开历史会话跑偏。
|
|
485
|
+
# 兜底:直接按仓库 conversations\sessions 的 --ws-<工作区ID>--\<sessionId>\ 目录反推,
|
|
486
|
+
# sessionId 就是子目录名,工作区落点沿用 2b) 的 safeId 匹配。
|
|
487
|
+
if (Test-Path -LiteralPath $repoSessions) {
|
|
488
|
+
foreach ($wd in @(Get-ChildItem -LiteralPath $repoSessions -Directory -Force)) {
|
|
489
|
+
if ($wd.Name -notmatch '^--ws-(?<id>.+)--$') { continue }
|
|
490
|
+
$wid = $Matches['id']
|
|
491
|
+
$hit = $null
|
|
492
|
+
foreach ($k in @($idToLocal.Keys)) {
|
|
493
|
+
$safeId = ($k -replace '[^A-Za-z0-9_.-]', '_')
|
|
494
|
+
if ($safeId -eq $wid) { $hit = $k; break }
|
|
495
|
+
}
|
|
496
|
+
if (-not $hit) { continue }
|
|
497
|
+
if (-not (Test-SyncItemEnabled $Scope 'conversations' $hit)) { continue }
|
|
498
|
+
$lid = $idToLocal[$hit]
|
|
499
|
+
foreach ($sd in @(Get-ChildItem -LiteralPath $wd.FullName -Directory -Force)) {
|
|
500
|
+
$projMap[[string]$sd.Name] = $lid
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
# im 会话(--im-- 顶层)的 projcache 也要指到本机 .dsh\im,
|
|
504
|
+
# 否则这类会话的历史 cwd 仍写死 A 机用户目录,点开跑偏。
|
|
505
|
+
foreach ($wd in @(Get-ChildItem -LiteralPath $repoSessions -Directory -Force)) {
|
|
506
|
+
if ($wd.Name -eq '--im--') {
|
|
507
|
+
foreach ($sd in @(Get-ChildItem -LiteralPath $wd.FullName -Directory -Force)) {
|
|
508
|
+
$projMap[[string]$sd.Name] = $imLocal
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
483
513
|
if ($cwdMap.Count -gt 0 -or $projMap.Count -gt 0) {
|
|
484
514
|
if (-not (Test-Path -LiteralPath $cwdHelper)) {
|
|
485
515
|
Warn ('缺少会话头部修正脚本 {0},本次跳过会话还原(铺进去的会话 DSH 会判为损坏)' -f $cwdHelper)
|
|
@@ -789,7 +819,8 @@ if ($dropped.Count -gt 0) { Ok "已剔除 $($dropped.Count) 个实验性 bundle
|
|
|
789
819
|
|
|
790
820
|
$localPluginMap = [ordered]@{
|
|
791
821
|
'dsh-our-free-model-2.8.0' = 'dsh-our-free-model'
|
|
792
|
-
'dsh-purge-1.
|
|
822
|
+
'dsh-purge-1.4.0' = 'dsh-purge'
|
|
823
|
+
'dsh-config-sync-plugin-0.3.57' = 'dsh-config-sync-plugin'
|
|
793
824
|
'dsh-config-sync-plugin-0.3.56' = 'dsh-config-sync-plugin'
|
|
794
825
|
'dsh-config-sync-0.1.0' = 'dsh-config-sync'
|
|
795
826
|
}
|
package/tools/clientcheck.mjs
CHANGED
|
@@ -54,7 +54,7 @@ function loadClient(fetchImpl) {
|
|
|
54
54
|
return loaded
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
console.log('== dsh-config-sync 客户端半身自检 ==')
|
|
57
|
+
console.log('== dsh-config-sync-plugin 客户端半身自检 ==')
|
|
58
58
|
|
|
59
59
|
// 无副作用的 fetch:组件在无数据状态下不该真的发请求(useEffect 在替身里是 noop)
|
|
60
60
|
const noopFetch = async () => ({ ok: true, status: 200, text: async () => '{}' })
|
package/tools/selftest.mjs
CHANGED
|
@@ -93,7 +93,7 @@ function check(label, cond, detail = '') {
|
|
|
93
93
|
else { failures++; console.log(` [X] ${label}${detail ? ' — ' + detail : ''}`) }
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
console.log('== dsh-config-sync 宿主半身自检 ==')
|
|
96
|
+
console.log('== dsh-config-sync-plugin 宿主半身自检 ==')
|
|
97
97
|
check('apply() 注册了路由', routes.size === 10 && routes.has('/config-sync/update') && routes.has('/config-sync/scope') && routes.has('/config-sync/extra-config') && routes.has('/config-sync/conflict') && routes.has('/config-sync/roots') && routes.has('/config-sync/feedback'), `实际 ${routes.size} 条:${[...routes.keys()].join(', ')}`)
|
|
98
98
|
|
|
99
99
|
const status = await call('/config-sync/status', { headers: { host: 'localhost:3080' } })
|