dsh-xdpool 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,21 @@
1
1
  # Changelog
2
2
  本项目的所有重要变更都会记录在此文件。
3
3
  版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
+ ## 3.0.2 — 自动更新不再把自己变成「本地开发」
5
+
6
+ > 3.0.1 的自动更新把一个临时 tgz 路径写进了 profile,装完会变成「本地开发插件」,版本号还可能对不上。
7
+
8
+ ### 修掉的问题
9
+
10
+ | 反馈 | 原因 | 现在 |
11
+ | --- | --- | --- |
12
+ | 插件市场把它显示成「本地开发」 | 更新把依赖写成 `file:<系统临时目录>/dsh-xdpool-3.0.1.tgz`,市场按 `link:`/`file:` 判定为本地开发,于是不再提供线上更新 | 依赖写成版本号 `3.0.2`,来源仍是 registry |
13
+ | 市场显示「3.0.1.tgz」但版本号是 3.0.0 | 市场读的是 spec 里的文件名,界面上的版本号来自已加载的 bundle,两者可以不一致 | 两者都来自同一个版本号,不会再分叉 |
14
+ | 重启后版本号还是旧的 | 安装指向的那个 tgz 里就是旧 bundle,重启加载的还是它 | 重启时按版本号从 registry 装真正的新版 |
15
+ | 更新后过一段时间插件加载失败 | `file:` 指向系统临时目录,被清理后文件就没了 | 不再依赖临时目录;pnpm store 保留已安装的包,重启不需要网络 |
16
+
17
+ 下载与 gzip 校验仍然保留,作用变成「写之前先证明 registry 可达、包完好」,失败就中止且不碰 `package.json`。
18
+
4
19
  ## 3.0.1 — 亮色模式与五条反馈
5
20
 
6
21
  > 3.0.0 之后收到的反馈,一次收完。默认外观不变,没人会被迫换配色。
package/README.md CHANGED
@@ -9,14 +9,17 @@
9
9
 
10
10
  ## 更新公告
11
11
 
12
- **3.0.1** — 亮色模式来了,五条反馈一次收完。
13
-
14
- - 新增护眼绿亮色模式:左栏一键切换,默认仍是暗色,选择会记住
15
- - 豆包渠道:卡片上的勾选状态同步进模型选择器,取消勾选即消失
16
- - 账号池:取消勾选的模型保存后立刻从选择器消失,不用再重启 DSH
17
- - 账号使用方式(优先/轮换/均衡/粘住/按到期)点了没反应、提示 HTTP 405 —— 已修
18
- - CodeArts 积分耗尽后不再被反复命中:识别 TM.00001050,冷却并换下一个账号
19
- - 渠道车道多轮对话第二轮必空响应 —— 已修,失败也会把上游原话透出来
12
+ **3.0.2** — 自动更新不再把自己变成「本地开发」。
13
+
14
+ - 更新后依赖写成版本号(registry 来源),插件市场不再显示「本地开发」、也不再断掉线上更新
15
+ - 市场里的版本号与插件左上角的版本号不会再对不上(「3.0.1.tgz 却显示 3.0.0」那条)
16
+ - 不再依赖系统临时目录:之前那个 tgz 被清理后,下次启动会变成插件加载失败
17
+ - 装完仍需重启一次 DSH 才生效(已加载的模块无法热替换),面板会写「需要重启」
18
+ - 3.0.1 的内容仍在:护眼绿亮色模式、豆包勾选进选择器、账号使用方式 HTTP 405、CodeArts 额度冷却、渠道多轮对话
19
+
20
+ **3.0.1** — 亮色模式与五条反馈(明细见 CHANGELOG)。
21
+
22
+ - 护眼绿亮色模式:左栏一键切换,默认仍是暗色,选择会记住
20
23
  - 护眼绿配色与各处字面色校正来自 @Refeain 的 PR #198,豆包勾选的思路来自 #197
21
24
 
22
25
  ## 先加群
package/lib/client.js CHANGED
@@ -135,7 +135,7 @@ window.__ModuleLoader__.load({
135
135
  const POOL_NAV_ICON_MASK_URL = `data:image/svg+xml;utf8,${encodeURIComponent(POOL_NAV_ICON_SVG)}`;
136
136
  //#endregion
137
137
  //#region src/version.ts
138
- const POOL_VERSION = "3.0.1";
138
+ const POOL_VERSION = "3.0.2";
139
139
  function compareVersions(left, right) {
140
140
  const parse = (value) => {
141
141
  const [core, ...rest] = value.trim().replace(/^v/u, "").split("-");
package/lib/index.js CHANGED
@@ -29220,7 +29220,7 @@ function parseBody(body) {
29220
29220
  *
29221
29221
  * @module dsh-xdpool/version
29222
29222
  */
29223
- const POOL_VERSION = "3.0.1";
29223
+ const POOL_VERSION = "3.0.2";
29224
29224
  //#endregion
29225
29225
  //#region src/update-check.ts
29226
29226
  /**
@@ -31597,28 +31597,50 @@ function pruneOldBackups(root, keep = 5, keepPath) {
31597
31597
  *
31598
31598
  * WHAT THIS DOES
31599
31599
  *
31600
- * A newer version is downloaded from the npm registry to a local file, and the profile's
31601
- * dependency is pointed at it with a `file:` spec. On the next start the host installs from that
31602
- * file. Nothing is written outside the profile's own directory, and nothing is changed if the
31603
- * download fails — a half-applied update is worse than an unapplied one.
31600
+ * A newer version is downloaded from the npm registry and checked, and then the
31601
+ * profile's dependency is set to that VERSION NUMBER — the ordinary registry
31602
+ * spec, not a path. On the next start the host installs that version. Nothing is
31603
+ * written outside the profile's own directory, and nothing is changed if the
31604
+ * download or the check fails — a half-applied update is worse than an
31605
+ * unapplied one.
31604
31606
  *
31605
31607
  * 更新前自动备份:改 package.json 之前,插件的全部数据(账号池、API Key、路由链、各渠道会话、
31606
31608
  * channel-pack 状态、宿主 settings 文档)先复制到 `<插件数据目录>/pre-update/<旧版本>-<时间>/`,
31607
31609
  * 原 spec 写进那里的 restore.json,只保留最近 5 份。复制失败就中止更新,package.json 不动。
31608
31610
  * 回退见 `pre-update-backup.ts` 的 rollbackPackageSpec 和备份目录里的「回退说明.txt」。
31609
31611
  *
31610
- * WHY `file:` AND NOT THE PUBLISHED VERSION
31611
- *
31612
- * Naming the version (`"dsh-xdpool": "2.7.5"`) makes the host fetch from the registry on every
31613
- * start, which fails on a machine whose registry is proxied or slow — and the failure mode is a
31614
- * plugin that does not load. Pinning the tarball that was just verified to download keeps the
31615
- * update as local as the install it replaces.
31612
+ * WHY THE VERSION NUMBER AND NOT A `file:` PATH (it used to be the other way)
31613
+ *
31614
+ * This used to point the profile at the tarball it had just downloaded
31615
+ * (`"dsh-xdpool": "file:C:/Users/…/Temp/dsh-xdpool-3.0.1.tgz"`), on the theory
31616
+ * that a registry spec makes the host re-fetch on every start and a slow or
31617
+ * proxied registry would leave the plugin unloadable. Three things went wrong
31618
+ * with that, all of them reported by users:
31619
+ *
31620
+ * 1. **The plugin market read it as a local development install.** Its rule is
31621
+ * `link:`/`file:` ⇒ "locally developed", and a locally developed plugin does
31622
+ * not update from the registry — so the entry showed 「本地开发」 and the
31623
+ * next update had nothing to update against.
31624
+ * 2. **The path was in the OS temp directory.** A cleanup deleted the tarball
31625
+ * and the profile then pointed at a file that no longer existed: a plugin
31626
+ * that fails to load on the next start, with no obvious cause.
31627
+ * 3. **The version shown kept disagreeing with the package.** The market read
31628
+ * the spec's file name while the loaded bundle reported its own constant,
31629
+ * so 「3.0.1.tgz 但是版本号 3.0.0」 was a reachable state.
31630
+ *
31631
+ * The original worry is handled by pnpm itself: once the version is installed,
31632
+ * its store holds the tarball, so a restart does not need the network at all.
31633
+ * The download below is therefore a PRE-CHECK — it proves the registry is
31634
+ * reachable and the package is a real gzip before anything is written — rather
31635
+ * than the thing being installed.
31616
31636
  *
31617
31637
  * A RESTART IS REQUIRED, AND SAYS SO
31618
31638
  *
31619
- * Modules already loaded cannot be swapped in place. The panel reports `restartRequired` and the
31620
- * user restarts when convenient — claiming the update took effect immediately would be a lie the
31621
- * user discovers on the next crash.
31639
+ * Modules already loaded cannot be swapped in place. The panel reports
31640
+ * `restartRequired` and the user restarts when convenient — claiming the update
31641
+ * took effect immediately would be a lie the user discovers on the next crash.
31642
+ * (The host does reload plugin code between sessions; a running window keeps the
31643
+ * modules it started with.)
31622
31644
  *
31623
31645
  * @module dsh-xdpool/update-install
31624
31646
  */
@@ -31748,7 +31770,19 @@ async function installVersion(version) {
31748
31770
  });
31749
31771
  return failed(chineseFailure("校验安装包失败", error));
31750
31772
  }
31751
- const newSpec = `file:${target.replaceAll("\\", "/")}`;
31773
+ /**
31774
+ * The spec the profile gets: the plain version number.
31775
+ *
31776
+ * NOT `file:<the tarball we just downloaded>`. That made the market treat this
31777
+ * as a locally developed plugin (so it stopped offering updates), pointed the
31778
+ * profile at the OS temp directory (so a cleaner broke the next start), and let
31779
+ * the displayed version drift from the running bundle. See the module note.
31780
+ *
31781
+ * The download above already proved the registry is reachable and the package
31782
+ * is intact; after installing, pnpm's store holds the tarball, so a restart
31783
+ * does not go back to the network.
31784
+ */
31785
+ const newSpec = version;
31752
31786
  const pkgPath = join(profile, "package.json");
31753
31787
  const read = readProfilePackage(pkgPath);
31754
31788
  if ("error" in read) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dsh-xdpool",
3
3
  "displayName": "DSH XD Pool",
4
4
  "description": "One DSH model pool for every free quota you have: merge all locally signed-in WorkBuddy accounts with auto-failover, sign in to 22 vendors by QR/web, aggregate 77 external vendors' keys, plus a usage dashboard, model routing, a local OpenAI-compatible gateway and a points-automation suite.",
5
- "version": "3.0.1",
5
+ "version": "3.0.2",
6
6
  "license": "MIT",
7
7
  "author": "XDTrees",
8
8
  "homepage": "https://github.com/XDTrees/dsh-xdpool#readme",