@linxin666/dsh-client-ui-plugin-manager 0.4.7 → 0.4.8
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.i18n.yaml +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/client.js +76 -35
- package/lib/client.js.map +1 -1
- package/lib/index.js +457 -86
- package/lib/types/client/PluginUpdatePatch.d.ts +25 -0
- package/lib/types/client/locales.d.ts +3 -0
- package/lib/types/client/telemetry.d.ts +14 -2
- package/lib/types/core/protocol.d.ts +5 -3
- package/lib/types/core/version.d.ts +20 -22
- package/lib/types/host/dsh-compat.d.ts +47 -0
- package/lib/types/host/gateway.d.ts +129 -7
- package/lib/types/host/loopback.d.ts +20 -1
- package/lib/types/host/restart.d.ts +23 -0
- package/lib/types/host/rows.d.ts +51 -0
- package/lib/types/host/state.d.ts +10 -6
- package/package.json +3 -1
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# node scripts/verify-docs.mjs --write <dir>
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 1c69fcaac099c5e3635f8450c721f5db8148abad
|
|
6
|
+
README.zh.md: af3a7b0efcafe92cc9d2cf71854eac5711adc0fb
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ An update and lifecycle manager for DeepSeek Harness (DSH) Web GUI and official
|
|
|
23
23
|
- Adds a list-level toolbar beside that page's **Installed** heading. The heading is the page's own chrome and the page declares no seat beside it (its extension points are `plugins.detail.*`, `plugins.item`, `plugins.bundle.config`, `plugins.row.config` and `plugins.bundle.activation`), so the toolbar is inserted into that element and kept in place through the family's shared body-mutation hub. One click checks every installed plugin; the panel lists the third-party rows that have a newer release, with the declared DSH minimum for any row this runtime is too old for; **Update all** applies the eligible rows one at a time with per-row progress and stops at the first failure, leaving the rest listed; **Restart now** then makes the update effective (see the restart note under Known limitations). Official `@deepseek-ai/` packages are never updated in bulk — their version belongs to the DSH installation.
|
|
24
24
|
- Dual-channel transport: on runtimes with the official installer services (DSHCode and the 1.0.4 checkout web), every operation rides the official `/plugin-installer` and `/plugin-control` loopback RPC channels; on the npm-published web runtime those channels do not exist, so the package's host half mounts a loopback-fenced HTTP gateway that spawns the official `dsh plugin` CLI for installs/removals (the single writer) and writes `disabled` override rows for enablement. An application-owned profile (a packaged Desktop launch) takes the third writer for installs, updates and removals: the official in-process plugin manager the host mounts, because the CLI refuses to write that profile at all.
|
|
25
25
|
- Detects the legacy aggregate `@linxin666/dsh-web-ui-all` and converts its update action into a transactional migration to `@linxin666/dsh-web-all`; the gateway removes the legacy package, installs the current package at an exact version, restores the legacy layer position, and verifies `--dump-config` before reporting success.
|
|
26
|
-
- Verifies DSH runtime compatibility before npm updates (issue #754): update checks read the declared minimum DSH version from the latest manifest (`dsh.engines.dsh` with a top-level `engines.dsh` fallback), show the requirement beside the update action,
|
|
26
|
+
- Verifies DSH runtime compatibility before npm updates (issue #754): update checks read the declared minimum DSH version from the latest manifest (`dsh.engines.dsh` with a top-level `engines.dsh` fallback), evaluate it as a node-semver range with the call the official boot gate makes — `semver.satisfies(host, range, { includePrerelease: true })` — so `||` alternatives, `^` and `~`, whitespace-separated comparators and x-ranges decide here exactly as they decide at boot, and show the requirement beside the update action. A requirement the running DSH does not satisfy disables the action and says to upgrade DSH. A requirement the host could not verify — an unreadable running version, or a declaration that is not a range node-semver parses — is a different verdict with its own copy: it names no cause and never sends the user to upgrade a DSH that was never compared. Neither verdict lets the update run, and the host update route answers 412 before starting any CLI job in both cases.
|
|
27
27
|
- Protects the next boot on the npm runtime: after each install the gateway verifies the dependency actually landed, rejects duplicate entry-id claims and insert rows naming unresolvable packages, and composes the profile with the CLI's `--dump-config` preflight; a conflicting or failing install is rolled back through the official remove path and the existing plugins are never touched.
|
|
28
28
|
|
|
29
29
|
## Install
|
package/README.zh.md
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
- 在该页 **已安装** 标题旁加一条列表级工具条。该标题是官方页面自己的 chrome,页面并未为它声明席位(扩展点是 `plugins.detail.*`、`plugins.item`、`plugins.bundle.config`、`plugins.row.config` 与 `plugins.bundle.activation`),因此工具条直接插入该元素,并靠家族共享的 body mutation hub 保持就位。一次点击检查全部已装插件;面板列出有新版本的第三方插件(当前运行时版本不够的行附上其声明的 DSH 最低版本);「全部更新」逐条应用合格行并显示逐行进度,遇到第一个失败即停止并把其余行留在列表里;随后「立即重启」使更新生效(见「已知限制」中的重启说明)。官方 `@deepseek-ai/` 包绝不参与批量更新——它们的版本属于 DSH 安装本身。
|
|
24
24
|
- 双通道传输:带官方安装器服务的运行时(DSHCode 与 1.0.4 checkout 版 web)走官方 `/plugin-installer`、`/plugin-control` loopback RPC 通道;npm 发布的官方 web 没有这些通道,本包的 host 半区挂载 loopback 门禁的 HTTP 网关——安装/卸载 spawn 官方 `dsh plugin` CLI(唯一写入器),启停写入 `disabled` 覆盖行。应用自有 profile(打包桌面启动)的安装、更新与卸载走第三种写入器:宿主挂载的官方进程内插件管理器,因为 CLI 完全拒绝写该 profile。
|
|
25
25
|
- 检测旧聚合包 `@linxin666/dsh-web-ui-all`,把更新动作转换为到 `@linxin666/dsh-web-all` 的事务迁移;网关先移除旧包、安装精确版本的新包、恢复旧聚合包的层顺序,并在 `--dump-config` 通过后才报告成功。
|
|
26
|
-
- 更新前校验 DSH 运行时兼容(issue #754):更新检查读取最新版本清单声明的 DSH 最低版本(`dsh.engines.dsh`,兼容回退读顶层 `engines.dsh
|
|
26
|
+
- 更新前校验 DSH 运行时兼容(issue #754):更新检查读取最新版本清单声明的 DSH 最低版本(`dsh.engines.dsh`,兼容回退读顶层 `engines.dsh`),按 node-semver 范围求值——用的正是官方启动门禁那一句 `semver.satisfies(host, range, { includePrerelease: true })`,因此 `||` 备选、`^` 与 `~`、空格分隔的多比较器与 x-range 在这里的判定与启动时完全一致——并在更新动作旁显示要求。运行 DSH 确实不满足要求时禁用更新并提示升级 DSH。宿主无法核验要求时(运行版本读不出来,或声明不是 node-semver 能解析的范围)是另一种结论,有独立文案:不预设原因,也绝不把用户推去升级一个从未参与比较的 DSH。两种结论都不放行更新,host 更新路由在两种情况下都会在启动任何 CLI 任务前返回 412。
|
|
27
27
|
- npm 运行时保护下次启动:安装后网关校验依赖真实落盘、拒绝重复入口 id 认领与引用不可解析包的 insert 行,并用 CLI 的 `--dump-config` 做组合预检;冲突或失败的安装会经官方 remove 路径自动回滚,绝不触碰现有插件。
|
|
28
28
|
|
|
29
29
|
## 安装
|
package/lib/client.js
CHANGED
|
@@ -13,7 +13,9 @@ window.__ModuleLoader__.load({
|
|
|
13
13
|
* The bare minimum version for display: strips the `>=` operator (and an
|
|
14
14
|
* optional leading `v`) from a declared requirement so UI copy that already
|
|
15
15
|
* contains the comparison operator renders `0.1.1-rc.1` instead of
|
|
16
|
-
* `>= >=0.1.1-rc.1`.
|
|
16
|
+
* `>= >=0.1.1-rc.1`. Every other range form renders unchanged — the browser
|
|
17
|
+
* half does not evaluate a range (the host does, in `../host/dsh-compat.ts`),
|
|
18
|
+
* so it must not pull a range parser into the client bundle to shorten copy.
|
|
17
19
|
* @param minimum - the declared minimum range.
|
|
18
20
|
* @returns the version portion for display.
|
|
19
21
|
*/
|
|
@@ -98,6 +100,17 @@ window.__ModuleLoader__.load({
|
|
|
98
100
|
return progress.percent === void 0 ? t("downloading") : t("downloadingPercent", { percent: String(progress.percent) });
|
|
99
101
|
}
|
|
100
102
|
/**
|
|
103
|
+
* Read the gate state out of one wire row.
|
|
104
|
+
* @param item - the update row, or undefined when no check has answered yet.
|
|
105
|
+
* @returns `open` when nothing blocks the update, otherwise the reason it is
|
|
106
|
+
* held back: `below-minimum` only when the host compared a version it read,
|
|
107
|
+
* `unverified` when it could not make that comparison.
|
|
108
|
+
*/
|
|
109
|
+
function dshGateOf(item) {
|
|
110
|
+
if (item?.compatible !== false) return "open";
|
|
111
|
+
return item.hostVersion === void 0 ? "unverified" : "below-minimum";
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
101
114
|
* The update block on one official Plugins page: one check action, the verdict
|
|
102
115
|
* for this page's bundle, and the update action it unlocks. The check is
|
|
103
116
|
* explicit rather than automatic because one check reads every installed
|
|
@@ -184,8 +197,8 @@ window.__ModuleLoader__.load({
|
|
|
184
197
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("localOnlyTitle") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("localOnlyBody") })]
|
|
185
198
|
});
|
|
186
199
|
const requiresDsh = found?.requiresDsh;
|
|
187
|
-
const
|
|
188
|
-
const
|
|
200
|
+
const gate = dshGateOf(found);
|
|
201
|
+
const blocked = gate !== "open";
|
|
189
202
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
190
203
|
className: plugin_manager_module_css_default.section,
|
|
191
204
|
"data-update-patch": true,
|
|
@@ -214,11 +227,11 @@ window.__ModuleLoader__.load({
|
|
|
214
227
|
"data-update-latest": found.latest,
|
|
215
228
|
children: t("latest", { version: found.latest })
|
|
216
229
|
}),
|
|
217
|
-
found !== void 0 && requiresDsh !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
230
|
+
found !== void 0 && (requiresDsh !== void 0 || blocked) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
218
231
|
className: blocked ? plugin_manager_module_css_default.compatBlocked : plugin_manager_module_css_default.compatHint,
|
|
219
232
|
"data-update-compat": blocked ? "blocked" : "ok",
|
|
220
|
-
"data-update-compat-reason": blocked ?
|
|
221
|
-
children:
|
|
233
|
+
"data-update-compat-reason": blocked ? gate : void 0,
|
|
234
|
+
children: requiresDsh !== void 0 ? t(gate === "open" ? "updateRequiresDsh" : gate === "unverified" ? "updateUnverifiedDsh" : "updateBlockedDsh", { min: displayMinimumVersion(requiresDsh) }) : t("updateUnverifiedDshUnknownRange")
|
|
222
235
|
}),
|
|
223
236
|
found !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
224
237
|
type: "button",
|
|
@@ -602,30 +615,33 @@ window.__ModuleLoader__.load({
|
|
|
602
615
|
}),
|
|
603
616
|
rows.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
604
617
|
className: plugin_manager_module_css_default.panelList,
|
|
605
|
-
children: rows.map((row) =>
|
|
606
|
-
|
|
607
|
-
"
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
"
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
618
|
+
children: rows.map((row) => {
|
|
619
|
+
const gate = dshGateOf(row);
|
|
620
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
621
|
+
className: plugin_manager_module_css_default.panelRow,
|
|
622
|
+
"data-update-row": row.id,
|
|
623
|
+
"data-compatible": gate === "open" ? "yes" : "no",
|
|
624
|
+
children: [
|
|
625
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
626
|
+
className: plugin_manager_module_css_default.panelName,
|
|
627
|
+
children: row.id
|
|
628
|
+
}),
|
|
629
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
630
|
+
className: plugin_manager_module_css_default.panelVersion,
|
|
631
|
+
children: [
|
|
632
|
+
row.current,
|
|
633
|
+
" → ",
|
|
634
|
+
row.latest
|
|
635
|
+
]
|
|
636
|
+
}),
|
|
637
|
+
gate === "open" ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
638
|
+
className: plugin_manager_module_css_default.compatBlocked,
|
|
639
|
+
"data-update-row-compat-reason": gate,
|
|
640
|
+
children: row.requiresDsh !== void 0 ? t(gate === "unverified" ? "updateUnverifiedDsh" : "updateBlockedDsh", { min: displayMinimumVersion(row.requiresDsh) }) : t("updateUnverifiedDshUnknownRange")
|
|
641
|
+
})
|
|
642
|
+
]
|
|
643
|
+
}, row.id);
|
|
644
|
+
})
|
|
629
645
|
}),
|
|
630
646
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
631
647
|
className: plugin_manager_module_css_default.panelActions,
|
|
@@ -761,7 +777,8 @@ window.__ModuleLoader__.load({
|
|
|
761
777
|
"latest": "最新 {version}",
|
|
762
778
|
"updateRequiresDsh": "需要 DSH ≥ {min}",
|
|
763
779
|
"updateBlockedDsh": "需要 DSH ≥ {min},请先升级 DSH 再更新",
|
|
764
|
-
"updateUnverifiedDsh": "
|
|
780
|
+
"updateUnverifiedDsh": "无法核验本机 DSH 与该声明的兼容性(需要 DSH ≥ {min}),已暂停更新",
|
|
781
|
+
"updateUnverifiedDshUnknownRange": "无法核验该插件声明的 DSH 兼容范围,已暂停更新",
|
|
765
782
|
"restartHint": "插件变更将在重启应用后生效。",
|
|
766
783
|
"updatesAvailable": "{count} 个可更新",
|
|
767
784
|
"updateAll": "全部更新({count})",
|
|
@@ -773,7 +790,7 @@ window.__ModuleLoader__.load({
|
|
|
773
790
|
"restarting": "正在重启…",
|
|
774
791
|
"restartConfirm": "确认重启",
|
|
775
792
|
"restartPlanRelaunch": "会重启 DSH 服务,正在运行的任务会中断。",
|
|
776
|
-
"restartPlanShell": "
|
|
793
|
+
"restartPlanShell": "桌面版重启由应用外壳执行:确认后宿主进程会退出,由外壳重新拉起。",
|
|
777
794
|
"restartPlanManual": "当前进程无法自动重启,请手动重启 DSH。",
|
|
778
795
|
"restartShellWarning": "它同时会写一份崩溃报告;也可以手动重启:退出 DeepSeek Harness(⌘Q)后重新打开。",
|
|
779
796
|
"restartDesktopHint": "请在随后出现的系统对话框中选择「重启」。",
|
|
@@ -800,7 +817,8 @@ window.__ModuleLoader__.load({
|
|
|
800
817
|
"latest": "Latest {version}",
|
|
801
818
|
"updateRequiresDsh": "Requires DSH >= {min}",
|
|
802
819
|
"updateBlockedDsh": "Requires DSH >= {min}; upgrade DSH before updating",
|
|
803
|
-
"updateUnverifiedDsh": "Cannot
|
|
820
|
+
"updateUnverifiedDsh": "Cannot verify this host against the declared DSH range (this update needs DSH >= {min}); update paused",
|
|
821
|
+
"updateUnverifiedDshUnknownRange": "Cannot verify the DSH range this plugin declares; update paused",
|
|
804
822
|
"restartHint": "Plugin changes take effect after restarting the application.",
|
|
805
823
|
"updatesAvailable": "{count} updates available",
|
|
806
824
|
"updateAll": "Update all ({count})",
|
|
@@ -812,7 +830,7 @@ window.__ModuleLoader__.load({
|
|
|
812
830
|
"restarting": "Restarting…",
|
|
813
831
|
"restartConfirm": "Restart",
|
|
814
832
|
"restartPlanRelaunch": "The DSH service restarts; running tasks are interrupted.",
|
|
815
|
-
"restartPlanShell": "The desktop app
|
|
833
|
+
"restartPlanShell": "The desktop app performs the restart: confirming stops the host process and the shell brings a new one up.",
|
|
816
834
|
"restartPlanManual": "This process cannot restart itself; restart DSH yourself.",
|
|
817
835
|
"restartShellWarning": "It also writes a crash report. You can instead restart manually: quit DeepSeek Harness (Cmd+Q) and open it again.",
|
|
818
836
|
"restartDesktopHint": "Choose Restart in the system dialog that follows.",
|
|
@@ -977,17 +995,39 @@ window.__ModuleLoader__.load({
|
|
|
977
995
|
const PLUGIN_MANAGER_SERVICE = "pluginManager";
|
|
978
996
|
//#endregion
|
|
979
997
|
//#region src/client/telemetry.ts
|
|
998
|
+
/** localStorage key carrying the family-wide telemetry opt-out ('1' = off). */
|
|
999
|
+
const TELEMETRY_OPT_OUT_KEY = "dsh-web-ui-telemetry-opt-out";
|
|
980
1000
|
const VISITOR_KEY = "dsh-web-ui-telemetry-visitor";
|
|
981
1001
|
const DAY_KEY_PREFIX = "dsh-web-ui-telemetry-day:";
|
|
982
1002
|
const ENDPOINT = "https://dsh-market.com/api/telemetry/event";
|
|
983
1003
|
/** The building package's version, when the bundle carries it. */
|
|
984
1004
|
function bakedVersion() {
|
|
985
1005
|
try {
|
|
986
|
-
return "0.4.
|
|
1006
|
+
return "0.4.8";
|
|
987
1007
|
} catch {
|
|
988
1008
|
return;
|
|
989
1009
|
}
|
|
990
1010
|
}
|
|
1011
|
+
/** Whether the user switched the family-wide opt-out on (reads storage only). */
|
|
1012
|
+
function isTelemetryOptedOut() {
|
|
1013
|
+
try {
|
|
1014
|
+
return localStorage.getItem(TELEMETRY_OPT_OUT_KEY) === "1";
|
|
1015
|
+
} catch {
|
|
1016
|
+
return false;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
/** Whether the browser itself asks not to be tracked; a failed read means no signal. */
|
|
1020
|
+
function doNotTrackRequested() {
|
|
1021
|
+
try {
|
|
1022
|
+
return navigator.doNotTrack === "1" || navigator.doNotTrack === "yes";
|
|
1023
|
+
} catch {
|
|
1024
|
+
return false;
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
/** Whether a heartbeat must be suppressed right now: opt-out stored, or the browser asks not to be tracked. */
|
|
1028
|
+
function isTelemetrySuppressed() {
|
|
1029
|
+
return isTelemetryOptedOut() || doNotTrackRequested();
|
|
1030
|
+
}
|
|
991
1031
|
/** Read or lazily create the anonymous visitor id; null when storage is unavailable. */
|
|
992
1032
|
function visitorId() {
|
|
993
1033
|
try {
|
|
@@ -1016,6 +1056,7 @@ window.__ModuleLoader__.load({
|
|
|
1016
1056
|
*/
|
|
1017
1057
|
function reportDailyHeartbeat(items) {
|
|
1018
1058
|
try {
|
|
1059
|
+
if (isTelemetrySuppressed()) return;
|
|
1019
1060
|
if (items.length === 0) return;
|
|
1020
1061
|
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
1021
1062
|
if (navigator.webdriver) return;
|