dsh-xdpool 2.7.3 → 2.7.5

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,83 @@
1
1
  # Changelog
2
2
  本项目的所有重要变更都会记录在此文件。
3
3
  版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
+ ## 2.7.5 — 一键安装更新
5
+
6
+ > 2.7.4 加了「检查更新」,但查到了只会告诉你「去插件设置里更新」。现在有安装按钮。
7
+
8
+ ### 点一下就能装
9
+
10
+ 「更新与备份」页在检查到新版本时多一个按钮:
11
+
12
+ ```
13
+ 有新版本 2.7.6
14
+ [ 安装 2.7.6 ] 下载到本机并写入插件配置,重启 DSH 后生效
15
+ ```
16
+
17
+ 点下去:从 npm 下载 tarball → 校验 gzip 文件头 → 写入 profile 的 `package.json` →
18
+ 提示「已下载,重启后生效」。
19
+
20
+ **为什么需要重启**:已加载的模块没法原地替换。不这么说就是骗人,用户会在下次崩溃时才发现。
21
+
22
+ ### 宿主没有安装 API,所以改的是配置
23
+
24
+ 插件无法「调用一个安装接口」。宿主在启动时解析 profile `package.json` 里的依赖描述,
25
+ 所以更新 = 改描述 + 重启。这就是所有自更新插件实际在做的事。
26
+
27
+ 写成 `file:` 而不是版本号:指定版本号会让宿主每次启动都去 registry 拉取,在代理或慢网络下
28
+ 的失败形态是「插件加载不出来」。钉住刚刚验证过能下载的 tarball,更新和它替代的安装一样本地。
29
+
30
+ ### 两个安全设计
31
+
32
+ **版本号不由前端传。** `POST /update/install` 忽略 body,版本由路由自己问 registry ——
33
+ 否则这个会写 `package.json` 的接口就能被诱导装任意版本。
34
+
35
+ **重复点击不重复写。** 配置已指向同一文件时直接返回成功,不重写。否则第二次点击会让宿主
36
+ 再跑一遍安装,中间要是重启,用户会看到一个没完成的更新。
37
+
38
+ ### 检查到最新
39
+
40
+ 显示「已是最新版本(N 分钟前检查)」—— 这条 2.7.4 就有,保留。
41
+
42
+ ## 2.7.4 — 远程可用、只列已绑定渠道、检查更新
43
+
44
+ ### 远程访问时所有按钮 403(#164)
45
+
46
+ 通过 `tailscale serve`、局域网主机名或任何反向代理打开 Web UI 时,卡片**数据显示正常、所有
47
+ 按钮报「请求失败」**。根因不是网络:插件的 `loopbackOrigin` 只认 loopback `Origin`,而浏览器
48
+ 在非本机地址下必然发送公开主机名 —— 于是写请求全部 `403 origin-not-trusted`,而只读请求没事,
49
+ 因为页面自己发的 GET 不带 `Origin`。
50
+
51
+ 宿主其实早就放行了这些地址(`connection.trustedHosts`,宿主自己的 `/api` 桥用它),只有插件
52
+ 还在说不。
53
+
54
+ 现在按四条规则放行:
55
+
56
+ 1. 没有 `Origin` —— 同源请求,页面自己发的那种
57
+ 2. loopback `Origin` —— 默认部署
58
+ 3. `Origin` 命中 `trustedHosts` 里的条目 —— 显式配置的服务面
59
+ 4. `Origin` 的主机名等于请求自己的 `Host` —— 浏览器意义上的同源
60
+
61
+ 第 4 条让反向代理无需配置即可工作;跨站页面伪造不了这一条,因为浏览器分别从页面和 URL 填这
62
+ 两个头,只有页面真的由该地址提供时它们才会一致。
63
+
64
+ ### 只列已绑定的渠道(#166)
65
+
66
+ 首页原本把所有渠道都列出来,于是绑了一个豆包的账号池要滚过十几个「– 账号 – 模型 – 积分」的
67
+ 空卡片才能看到它。
68
+
69
+ 现在默认只列有账号的渠道,并给一个「显示全部渠道」的开关(要再加一个的时候用)。
70
+ **一个都没绑时仍然全部显示** —— 否则新装的用户看到的是空白页,没有任何入口添加第一个账号。
71
+
72
+ ### 检查更新(#166)
73
+
74
+ 升级原本要人肉去 GitHub 看,或者让 agent 定期跑任务。现在备份页顶部有「检查更新」:
75
+ 读 npm registry 的 `dist-tags.latest`,与当前版本比较,答「有新版本 / 已是最新 / 没法检查」。
76
+
77
+ - 结果缓存 10 分钟;点按钮强制刷新
78
+ - **失败单独报**:告诉用户「已是最新」而实际是网络不通,是这里唯一不能给的答案
79
+ - 页面改名「更新与备份」 —— 两者都是偶尔做一次的维护,不是日常跑池子的一部分
80
+
4
81
  ## 2.7.3 — 豆包进模型选择器,开关能记住了
5
82
 
6
83
  > 两个问题:豆包的模型在选择器里完全看不到;勾选和全开全关关掉面板就失效。
package/lib/client.js CHANGED
@@ -112,6 +112,10 @@ window.__ModuleLoader__.load({
112
112
  const POOL_ACCOUNT_IGNORE_PATH = "/plugins/dsh-xdpool/accounts/ignored";
113
113
  /** Run one automation job immediately, so the card can verify it on demand. */
114
114
  const POOL_AUTOMATION_RUN_PATH = "/plugins/dsh-xdpool/automation/run";
115
+ /** Is there a newer build of this plugin? */
116
+ const POOL_UPDATE_CHECK_PATH = "/plugins/dsh-xdpool/update";
117
+ /** Install the newest build. The host applies it on the next start. */
118
+ const POOL_UPDATE_INSTALL_PATH = "/plugins/dsh-xdpool/update/install";
115
119
  /** Set or clear one account's reserved-credit floor. */
116
120
  const POOL_CREDIT_RESERVE_PATH = "/plugins/dsh-xdpool/accounts/credit-reserve";
117
121
  /**
@@ -746,6 +750,7 @@ window.__ModuleLoader__.load({
746
750
  model always visible, and keeping the old names on the new shapes would
747
751
  leave two rule sets fighting over one element. */
748
752
  .dsm-xdpool-cpool{display:flex;flex-direction:column;gap:10px}
753
+ .dsm-xdpool-cpool-bar{display:flex;justify-content:flex-end;margin:0 0 8px}
749
754
  .dsm-xdpool-cpool-grid{display:flex;flex-direction:column;gap:12px;min-width:0}
750
755
  .dsm-xdpool-cpool-card{--dsm-xdpool-cpool-accent:var(--dsw-alias-brand-primary,#5686fe);position:relative;display:flex;flex-direction:column;gap:8px;padding:12px 13px 12px 15px;overflow:hidden;border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:13px;background:color-mix(in srgb, var(--dsw-alias-bg-layer-3,#2a2c33) 80%, transparent);box-shadow:inset 0 1px 0 rgb(255 255 255 / 6%), 0 1px 2px rgb(0 0 0 / 6%);transition:transform .22s cubic-bezier(.32,.72,0,1),box-shadow .24s ease,border-color .2s ease}
751
756
  .dsm-xdpool-cpool-card:hover{transform:translateY(-3px);border-color:color-mix(in srgb, var(--dsm-xdpool-cpool-accent,#5686fe) 55%, var(--dsw-alias-border-l2,#36373b));box-shadow:inset 0 1px 0 rgb(255 255 255 / 8%),0 18px 40px rgb(0 0 0 / 15%)}
@@ -1937,6 +1942,18 @@ window.__ModuleLoader__.load({
1937
1942
  .dsm-xdpool-bak-clear:hover{background:color-mix(in srgb, var(--dsw-alias-label-primary,#e8eaf0) 12%, transparent);color:var(--dsw-alias-label-primary,#e8eaf0)}
1938
1943
  .dsm-xdpool-bak-note{margin:0;font-size:11px;line-height:16px;color:var(--dsw-alias-state-success-primary,#22a06b)}
1939
1944
  .dsm-xdpool-bak-error{margin:0;font-size:11px;line-height:16px;color:var(--dsw-alias-state-error-primary,#e5534b)}
1945
+ .dsm-xdpool-update{display:flex;flex-direction:column;gap:8px;margin:0 0 14px;padding:12px 14px;border-radius:12px;border:1px solid color-mix(in srgb, var(--dsw-alias-border-l2,#ffffff1f) 82%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2,#1c1e22) 60%, transparent)}
1946
+ .dsm-xdpool-update-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
1947
+ .dsm-xdpool-update-title{font-size:13px;font-weight:650;color:var(--dsw-alias-label-primary,#e8eaf0)}
1948
+ .dsm-xdpool-update-versions{font-size:11.5px;color:var(--dsw-alias-label-tertiary,#8a90a0);font-variant-numeric:tabular-nums}
1949
+ .dsm-xdpool-update-versions b{color:var(--dsw-alias-label-secondary,#c6c9d0);font-weight:600}
1950
+ .dsm-xdpool-update-sep{margin:0 5px;opacity:.6}
1951
+ .dsm-xdpool-update-head .dsm-xdpool-btn{margin-left:auto}
1952
+ .dsm-xdpool-update-current{margin:0;font-size:11.5px;line-height:17px;color:var(--dsw-alias-state-success-primary,#22a06b)}
1953
+ .dsm-xdpool-update-newer{margin:0;font-size:11.5px;line-height:17px;color:var(--dsw-alias-state-warning-primary,#d99a2b)}
1954
+ .dsm-xdpool-update-acts{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
1955
+ .dsm-xdpool-update-hint{font-size:10.5px;line-height:15px;color:var(--dsw-alias-label-tertiary,#8a90a0)}
1956
+ .dsm-xdpool-update-error{margin:0;font-size:11.5px;line-height:17px;color:var(--dsw-alias-state-error-primary,#e5534b)}
1940
1957
  `;
1941
1958
  //#endregion
1942
1959
  //#region src/client/avatar.ts
@@ -12436,7 +12453,7 @@ window.__ModuleLoader__.load({
12436
12453
  * @module dsh-xdpool/client/DoubaoAutomationPane
12437
12454
  */
12438
12455
  /** A short "3 小时前" style line for the last pass. */
12439
- function agoText(iso) {
12456
+ function agoText$1(iso) {
12440
12457
  if (iso === void 0) return void 0;
12441
12458
  const at = Date.parse(iso);
12442
12459
  if (Number.isNaN(at)) return void 0;
@@ -12485,7 +12502,7 @@ window.__ModuleLoader__.load({
12485
12502
  }
12486
12503
  }, []);
12487
12504
  const enabled = state.enabled === true;
12488
- const lastRun = agoText(state.lastRunAt);
12505
+ const lastRun = agoText$1(state.lastRunAt);
12489
12506
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12490
12507
  className: "dsm-xdpool-cpool-auto",
12491
12508
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
@@ -12999,6 +13016,15 @@ window.__ModuleLoader__.load({
12999
13016
  const [busy, setBusy] = (0, react.useState)(/* @__PURE__ */ new Set());
13000
13017
  /** Channels whose model catalogue is being re-read. */
13001
13018
  const [catalogBusy, setCatalogBusy] = (0, react.useState)(/* @__PURE__ */ new Set());
13019
+ /**
13020
+ * Whether channels without an account are listed.
13021
+ *
13022
+ * They are hidden by default: a card for a channel nobody signed into says "– accounts, –
13023
+ * models, – credit" and takes a full row to say it, so an account pool with one signed-in
13024
+ * channel scrolled past a dozen empty ones to reach it (#166). The switch brings them back for
13025
+ * the one case where they are wanted — adding another.
13026
+ */
13027
+ const [showAll, setShowAll] = (0, react.useState)(false);
13002
13028
  /** provider → what the reader typed into that card's model search box. */
13003
13029
  const [queries, setQueries] = (0, react.useState)(/* @__PURE__ */ new Map());
13004
13030
  const entriesRef = (0, react.useRef)(entries);
@@ -13586,9 +13612,32 @@ window.__ModuleLoader__.load({
13586
13612
  className: "dsm-xdpool-note",
13587
13613
  children: notice
13588
13614
  }),
13615
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13616
+ className: "dsm-xdpool-cpool-bar",
13617
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
13618
+ type: "button",
13619
+ className: "dsm-xdpool-btn",
13620
+ "aria-pressed": showAll,
13621
+ onClick: () => {
13622
+ setShowAll(!showAll);
13623
+ },
13624
+ children: showAll ? t?.("channelpool.onlyBound") ?? "只显示已绑定" : t?.("channelpool.showAll") ?? `显示全部渠道(${String(entries.length)})`
13625
+ })
13626
+ }),
13589
13627
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13590
13628
  className: "dsm-xdpool-cpool-grid",
13591
- children: [entries.map((entry) => {
13629
+ children: [(() => {
13630
+ const bound = entries.filter((entry) => entry.accounts.length > 0);
13631
+ /**
13632
+ * Nothing bound yet means EVERYTHING is shown.
13633
+ *
13634
+ * Hiding empty cards is only useful once there is something to hide them behind. On a
13635
+ * fresh install every card is empty, so the same rule would produce a blank page with
13636
+ * no way to add the first account.
13637
+ */
13638
+ if (showAll || bound.length === 0) return entries;
13639
+ return bound;
13640
+ })().map((entry) => {
13592
13641
  const { channel, accounts, models, facts, balances, statuses, status } = entry;
13593
13642
  const icon = channelIcon(channel.id);
13594
13643
  const tileMark = icon === void 0 ? { initials: channelInitials(channel.name) } : { icon };
@@ -14051,6 +14100,200 @@ window.__ModuleLoader__.load({
14051
14100
  });
14052
14101
  }
14053
14102
  //#endregion
14103
+ //#region src/client/UpdatePanel.tsx
14104
+ /**
14105
+ * The update check, above the backup controls.
14106
+ *
14107
+ * WHY IT SITS HERE
14108
+ *
14109
+ * "Is there a newer version" and "put this machine back how it was" are the same kind of task —
14110
+ * maintenance the user does occasionally, not part of running the pool. They belong on one page,
14111
+ * which is why the tab is now 「更新与备份」 rather than just 备份.
14112
+ *
14113
+ * WHAT IT SAYS
14114
+ *
14115
+ * Three outcomes, three sentences: newer, current, or could not check. The third is why `error`
14116
+ * is kept apart from "no update": telling a user they are current when the registry was
14117
+ * unreachable is the one wrong answer this panel could give.
14118
+ *
14119
+ * @module dsh-xdpool/client/UpdatePanel
14120
+ */
14121
+ /** A short "3 分钟前" line for the last check. */
14122
+ function agoText(iso) {
14123
+ if (iso === void 0) return void 0;
14124
+ const at = Date.parse(iso);
14125
+ if (Number.isNaN(at)) return void 0;
14126
+ const minutes = Math.floor((Date.now() - at) / 6e4);
14127
+ if (minutes < 1) return "刚刚";
14128
+ if (minutes < 60) return `${String(minutes)} 分钟前`;
14129
+ const hours = Math.floor(minutes / 60);
14130
+ if (hours < 24) return `${String(hours)} 小时前`;
14131
+ return `${String(Math.floor(hours / 24))} 天前`;
14132
+ }
14133
+ /** The published date, as a plain day. */
14134
+ function dayText(iso) {
14135
+ if (iso === void 0) return void 0;
14136
+ const at = Date.parse(iso);
14137
+ if (Number.isNaN(at)) return void 0;
14138
+ return new Date(at).toISOString().slice(0, 10);
14139
+ }
14140
+ function UpdatePanel({ t }) {
14141
+ const [status, setStatus] = (0, react.useState)(void 0);
14142
+ const [busy, setBusy] = (0, react.useState)(false);
14143
+ const [installing, setInstalling] = (0, react.useState)(false);
14144
+ /** What the install attempt said, kept apart from the check result. */
14145
+ const [installed, setInstalled] = (0, react.useState)(void 0);
14146
+ const mounted = (0, react.useRef)(true);
14147
+ (0, react.useEffect)(() => {
14148
+ mounted.current = true;
14149
+ return () => {
14150
+ mounted.current = false;
14151
+ };
14152
+ }, []);
14153
+ const check = (0, react.useCallback)(async (force) => {
14154
+ setBusy(true);
14155
+ try {
14156
+ const body = await (await fetch(POOL_UPDATE_CHECK_PATH, {
14157
+ method: force ? "POST" : "GET",
14158
+ credentials: "same-origin"
14159
+ })).json().catch(() => void 0);
14160
+ if (!mounted.current || body === void 0) return;
14161
+ setStatus(body);
14162
+ } catch {
14163
+ if (!mounted.current) return;
14164
+ setStatus({
14165
+ error: "无法连接插件(请确认页面已连上宿主)",
14166
+ checkedAt: (/* @__PURE__ */ new Date()).toISOString()
14167
+ });
14168
+ } finally {
14169
+ if (mounted.current) setBusy(false);
14170
+ }
14171
+ }, []);
14172
+ /**
14173
+ * Install the newest build.
14174
+ *
14175
+ * The version is not sent: the route asks the registry itself, so the panel cannot be talked
14176
+ * into installing something it did not just see.
14177
+ */
14178
+ const install = (0, react.useCallback)(async () => {
14179
+ setInstalling(true);
14180
+ setInstalled(void 0);
14181
+ try {
14182
+ const body = await (await fetch(POOL_UPDATE_INSTALL_PATH, {
14183
+ method: "POST",
14184
+ credentials: "same-origin"
14185
+ })).json().catch(() => void 0);
14186
+ if (!mounted.current) return;
14187
+ if (body?.ok === true && body.restartRequired === true) {
14188
+ setInstalled({
14189
+ ok: true,
14190
+ text: t?.("update.installed", { version: body.version ?? "" }) ?? `已下载 ${body.version ?? ""},重启 DSH 后生效`
14191
+ });
14192
+ return;
14193
+ }
14194
+ if (body?.ok === true) {
14195
+ setInstalled({
14196
+ ok: true,
14197
+ text: t?.("update.upToDate") ?? "已是最新版本"
14198
+ });
14199
+ return;
14200
+ }
14201
+ setInstalled({
14202
+ ok: false,
14203
+ text: body?.error ?? t?.("update.installFailed") ?? "安装失败"
14204
+ });
14205
+ } catch (cause) {
14206
+ if (mounted.current) setInstalled({
14207
+ ok: false,
14208
+ text: cause instanceof Error ? cause.message : String(cause)
14209
+ });
14210
+ } finally {
14211
+ if (mounted.current) setInstalling(false);
14212
+ }
14213
+ }, [t]);
14214
+ (0, react.useEffect)(() => {
14215
+ check(false);
14216
+ }, [check]);
14217
+ const newer = status?.newer === true;
14218
+ const checked = agoText(status?.checkedAt);
14219
+ const published = dayText(status?.publishedAt);
14220
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
14221
+ className: "dsm-xdpool-update",
14222
+ children: [
14223
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
14224
+ className: "dsm-xdpool-update-head",
14225
+ children: [
14226
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
14227
+ className: "dsm-xdpool-update-title",
14228
+ children: t?.("update.title") ?? "检查更新"
14229
+ }),
14230
+ status?.current === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
14231
+ className: "dsm-xdpool-update-versions",
14232
+ children: [
14233
+ t?.("update.current") ?? "当前",
14234
+ " ",
14235
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: status.current }),
14236
+ status.latest === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
14237
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
14238
+ className: "dsm-xdpool-update-sep",
14239
+ "aria-hidden": "true",
14240
+ children: "·"
14241
+ }),
14242
+ t?.("update.latest") ?? "最新",
14243
+ " ",
14244
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: status.latest })
14245
+ ] })
14246
+ ]
14247
+ }),
14248
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
14249
+ type: "button",
14250
+ className: "dsm-xdpool-btn",
14251
+ disabled: busy,
14252
+ onClick: () => {
14253
+ check(true);
14254
+ },
14255
+ children: busy ? t?.("update.checking") ?? "检查中…" : t?.("update.check") ?? "检查更新"
14256
+ })
14257
+ ]
14258
+ }),
14259
+ status?.error === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
14260
+ className: "dsm-xdpool-update-error",
14261
+ children: [
14262
+ t?.("update.failed") ?? "没能检查更新",
14263
+ ":",
14264
+ status.error
14265
+ ]
14266
+ }),
14267
+ status?.error !== void 0 || status === void 0 ? null : newer ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
14268
+ className: "dsm-xdpool-update-newer",
14269
+ children: [t?.("update.available", { version: status.latest ?? "" }) ?? `有新版本 ${status.latest ?? ""}`, published === void 0 ? "" : `(发布于 ${published})`]
14270
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
14271
+ className: "dsm-xdpool-update-acts",
14272
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
14273
+ type: "button",
14274
+ className: "dsm-xdpool-btn",
14275
+ "data-tone": "primary",
14276
+ disabled: installing,
14277
+ onClick: () => {
14278
+ install();
14279
+ },
14280
+ children: installing ? t?.("update.installing") ?? "安装中…" : t?.("update.install", { version: status.latest ?? "" }) ?? `安装 ${status.latest ?? ""}`
14281
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
14282
+ className: "dsm-xdpool-update-hint",
14283
+ children: t?.("update.installHint") ?? "下载到本机并写入插件配置,重启 DSH 后生效;数据和账号不受影响。"
14284
+ })]
14285
+ })] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
14286
+ className: "dsm-xdpool-update-current",
14287
+ children: [t?.("update.upToDate") ?? "已是最新版本", checked === void 0 ? "" : `(${checked}检查)`]
14288
+ }),
14289
+ installed === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
14290
+ className: installed.ok ? "dsm-xdpool-update-current" : "dsm-xdpool-update-error",
14291
+ children: installed.text
14292
+ })
14293
+ ]
14294
+ });
14295
+ }
14296
+ //#endregion
14054
14297
  //#region src/client/backup-crypto.ts
14055
14298
  /**
14056
14299
  * Password-encrypted backup envelope for the credential export.
@@ -14369,6 +14612,7 @@ window.__ModuleLoader__.load({
14369
14612
  className: "dsm-xdpool-bak",
14370
14613
  children: [
14371
14614
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: BACKUP_CSS }),
14615
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UpdatePanel, { t }),
14372
14616
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
14373
14617
  className: "dsm-xdpool-bak-head",
14374
14618
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -14477,7 +14721,7 @@ window.__ModuleLoader__.load({
14477
14721
  *
14478
14722
  * @module dsh-xdpool/version
14479
14723
  */
14480
- const POOL_VERSION = "2.7.3";
14724
+ const POOL_VERSION = "2.7.5";
14481
14725
  //#endregion
14482
14726
  //#region src/client/PoolCard.tsx
14483
14727
  /**
@@ -17591,6 +17835,22 @@ window.__ModuleLoader__.load({
17591
17835
  * @module dsh-xdpool/client/locales
17592
17836
  */
17593
17837
  const en = {
17838
+ "update.install": "Install {version}",
17839
+ "update.installing": "Installing…",
17840
+ "update.installHint": "Downloads to this machine and updates the plugin config; takes effect after a DSH restart. Your data and accounts are unaffected.",
17841
+ "update.installed": "Downloaded {version} — restart DSH to apply",
17842
+ "update.installFailed": "Install failed",
17843
+ "update.title": "Check for updates",
17844
+ "update.current": "current",
17845
+ "update.latest": "latest",
17846
+ "update.check": "Check",
17847
+ "update.checking": "Checking…",
17848
+ "update.upToDate": "Up to date",
17849
+ "update.available": "Version {version} is available",
17850
+ "update.howTo": "Update it from the plugin settings; your data and accounts are unaffected.",
17851
+ "update.failed": "Could not check",
17852
+ "channelpool.showAll": "Show all channels",
17853
+ "channelpool.onlyBound": "Show bound only",
17594
17854
  "channelpool.reloadModels": "Reload models",
17595
17855
  "channelpool.reloadModelsBusy": "Reading…",
17596
17856
  "channelpool.reloadModelsHint": "Read the model list (and multipliers) from the vendor again",
@@ -17982,7 +18242,7 @@ window.__ModuleLoader__.load({
17982
18242
  "shell.subRouting": "Chains that try models in order, so one busy or rate-limited model falls through to the next.",
17983
18243
  "shell.tabGateway": "Gateway",
17984
18244
  "shell.tabDoubao": "Doubao",
17985
- "shell.tabBackup": "Backup",
18245
+ "shell.tabBackup": "Updates & backup",
17986
18246
  "shell.subGateway": "Open the pool to the other devices on your network.",
17987
18247
  "gw.title": "Gateway",
17988
18248
  "gw.sub": "An OpenAI-compatible endpoint other devices on your network can point at. Off until you turn it on, and bound to this computer only until you say otherwise.",
@@ -18207,6 +18467,22 @@ window.__ModuleLoader__.load({
18207
18467
  "channelpool.note": "Note"
18208
18468
  };
18209
18469
  const zh = {
18470
+ "update.install": "安装 {version}",
18471
+ "update.installing": "安装中…",
18472
+ "update.installHint": "下载到本机并写入插件配置,重启 DSH 后生效;数据和账号不受影响。",
18473
+ "update.installed": "已下载 {version},重启 DSH 后生效",
18474
+ "update.installFailed": "安装失败",
18475
+ "update.title": "检查更新",
18476
+ "update.current": "当前",
18477
+ "update.latest": "最新",
18478
+ "update.check": "检查更新",
18479
+ "update.checking": "检查中…",
18480
+ "update.upToDate": "已是最新版本",
18481
+ "update.available": "有新版本 {version}",
18482
+ "update.howTo": "在插件设置里更新到该版本即可;数据和账号不受影响。",
18483
+ "update.failed": "没能检查更新",
18484
+ "channelpool.showAll": "显示全部渠道",
18485
+ "channelpool.onlyBound": "只显示已绑定",
18210
18486
  "channelpool.reloadModels": "重新加载模型",
18211
18487
  "channelpool.reloadModelsBusy": "正在读取…",
18212
18488
  "channelpool.reloadModelsHint": "从上游重新读取这个渠道的模型列表(含倍率)",
@@ -18598,7 +18874,7 @@ window.__ModuleLoader__.load({
18598
18874
  "shell.subRouting": "把几个模型串成一条链,按顺序试;一个忙了或被限流,就自动落到下一个。",
18599
18875
  "shell.tabGateway": "网关",
18600
18876
  "shell.tabDoubao": "豆包",
18601
- "shell.tabBackup": "备份",
18877
+ "shell.tabBackup": "更新与备份",
18602
18878
  "shell.subGateway": "把账号池开放给同网络里的其它设备。",
18603
18879
  "gw.title": "网关",
18604
18880
  "gw.sub": "开一个 OpenAI 兼容的入口,同网络的其它设备可以指过来。默认关闭,默认只绑定本机 —— 你不改,它就一直只在你这台电脑上。",
package/lib/index.d.ts CHANGED
@@ -4340,10 +4340,22 @@ export declare function readPreferredIdSync(path?: string): string | undefined;
4340
4340
  */
4341
4341
  export declare function writePreferredId(accountId: string | undefined, path?: string): Promise<void>;
4342
4342
  //#endregion
4343
+ //#region src/origin-trust.d.ts
4344
+ /** The authorities a deployment says it serves, as the host reports them. */
4345
+ type TrustedHosts = readonly string[];
4346
+ //#endregion
4343
4347
  //#region src/web-status.d.ts
4344
4348
  /** Constructor dependencies — a narrow slice of the pool runtime. */
4345
4349
  interface PoolStatusRouteOptions {
4346
4350
  pool: WorkBuddyAccountPool;
4351
+ /**
4352
+ * The authorities this deployment serves, read per request.
4353
+ *
4354
+ * Passed through from `connection.trustedHosts` so the plugin's gate agrees with the host's
4355
+ * own `/api` bridge. They disagreed once, and the symptom was a card that displayed its data
4356
+ * and refused every button — see `origin-trust.ts`.
4357
+ */
4358
+ trustedHosts?: () => TrustedHosts;
4347
4359
  /** One catalog per region; the card reads the one for its active tab. */
4348
4360
  catalogs: Readonly<Record<PoolRegion, WorkBuddyCatalog>>;
4349
4361
  client: WorkBuddyUpstreamClient;