dsh-drydock 1.1.3 → 1.1.4
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 +80 -59
- package/README.md +17 -14
- package/bin/drydock-update.mjs +5 -13
- package/lib/client.js +47 -50
- package/lib/evidence-schema.mjs +2 -2
- package/lib/index.js +118 -18
- package/lib/remote.js +17 -6
- package/lib/self-update.mjs +32 -0
- package/package.json +31 -29
- package/schema/badge-v1.json +2 -2
- package/schema/evidence-v1.json +3 -2
- package/schema/matrix-v1.json +4 -3
package/lib/evidence-schema.mjs
CHANGED
|
@@ -103,7 +103,7 @@ export const EvidenceV1 = z.strictObject({
|
|
|
103
103
|
host: HostV1,
|
|
104
104
|
profile: ProfileV1,
|
|
105
105
|
plugin: PluginV1,
|
|
106
|
-
checks: z.array(CheckV1).min(1),
|
|
106
|
+
checks: z.array(CheckV1).min(1).max(100), // 1.1.4 安全加固:证据文件也可能来自外部,数组要有上界
|
|
107
107
|
verdict: VerdictV1,
|
|
108
108
|
testedAt: isoDateTime,
|
|
109
109
|
expiresAt: isoDateTime,
|
|
@@ -126,7 +126,7 @@ export const MatrixV1 = z.strictObject({
|
|
|
126
126
|
schema: z.literal(MATRIX_SCHEMA),
|
|
127
127
|
generatedAt: isoDateTime,
|
|
128
128
|
tool: ToolV1,
|
|
129
|
-
entries: z.array(MatrixEntryV1),
|
|
129
|
+
entries: z.array(MatrixEntryV1).max(10000), // 1.1.4 安全加固:同上(zod<4.6.6 的数组 issue 累积)
|
|
130
130
|
skippedExpired: z.number().int().min(0)
|
|
131
131
|
});
|
|
132
132
|
|
package/lib/index.js
CHANGED
|
@@ -1975,6 +1975,19 @@ function loadCompatModule() {
|
|
|
1975
1975
|
return COMPAT_PROMISE;
|
|
1976
1976
|
}
|
|
1977
1977
|
//#endregion
|
|
1978
|
+
//#region 自更新状态(A1,1.1.4):进程内读取
|
|
1979
|
+
/**
|
|
1980
|
+
* `lib/self-update.mjs` 按需**动态**加载:它带 `node:https` / 下载器依赖,只在真的要读状态时才进内存。
|
|
1981
|
+
* 这样 host 入口的静态依赖白名单(test-isolation ①)不变,而状态读取不再 spawn 子进程
|
|
1982
|
+
* ——上一版每次打开「全部插件」页都要起一个 node CLI(实测 113–243ms/次)。
|
|
1983
|
+
* 写盘 / 联网 / detached worker 依旧只发生在 `bin/drydock-update.mjs` 里。
|
|
1984
|
+
*/
|
|
1985
|
+
let SELF_UPDATE_PROMISE = null;
|
|
1986
|
+
function loadSelfUpdateModule() {
|
|
1987
|
+
if (SELF_UPDATE_PROMISE === null) SELF_UPDATE_PROMISE = import("./self-update.mjs");
|
|
1988
|
+
return SELF_UPDATE_PROMISE;
|
|
1989
|
+
}
|
|
1990
|
+
//#endregion
|
|
1978
1991
|
|
|
1979
1992
|
let PluginManagerPro = (() => {
|
|
1980
1993
|
let _classSuper = TypertRemoteService;
|
|
@@ -2126,6 +2139,11 @@ let PluginManagerPro = (() => {
|
|
|
2126
2139
|
// L9:卸载自身前的自启清理(默认 20s 超时,测试可注入更短的值)
|
|
2127
2140
|
this.selfPackageDir = typeof config.selfPackageDir === "string" && config.selfPackageDir !== "" ? config.selfPackageDir : null;
|
|
2128
2141
|
this.autostartTimeoutMs = Number.isFinite(config.autostartTimeoutMs) ? Number(config.autostartTimeoutMs) : 20000;
|
|
2142
|
+
// 1.1.4(A3):首启预热 —— 引擎启动后延迟一次 snapshot(),把冷路径(实测 ~271ms:240 份 package.json +
|
|
2143
|
+
// README 简介)挪到用户看不见的启动窗口里;之后用户第一次打开插件页就命中 P-02 的结果级缓存。
|
|
2144
|
+
// 定时器 unref():不拖住进程;失败只记日志(绝不影响引擎启动)。
|
|
2145
|
+
this.preheatEnabled = config.preheat !== false;
|
|
2146
|
+
this.preheatDelayMs = Number.isFinite(config.preheatDelayMs) ? Number(config.preheatDelayMs) : 3000;
|
|
2129
2147
|
const baseUrl = ctx.loader.ctx.baseUrl;
|
|
2130
2148
|
if (baseUrl === void 0) throw new Error("dsh-drydock requires a file-backed Loader root");
|
|
2131
2149
|
this.baseUrl = baseUrl;
|
|
@@ -2202,6 +2220,19 @@ let PluginManagerPro = (() => {
|
|
|
2202
2220
|
}, () => {
|
|
2203
2221
|
this.log("rescue", "webServer unavailable - rescue page not registered");
|
|
2204
2222
|
});
|
|
2223
|
+
// 1.1.4(A3):首启预热(可关:config.preheat=false / 测试注入更短 preheatDelayMs)
|
|
2224
|
+
if (this.preheatEnabled) {
|
|
2225
|
+
const timer = setTimeout(() => {
|
|
2226
|
+
const started = Date.now();
|
|
2227
|
+
try {
|
|
2228
|
+
this.snapshot();
|
|
2229
|
+
this.log("preheat", `snapshot warmed in ${Date.now() - started}ms`);
|
|
2230
|
+
} catch (error) {
|
|
2231
|
+
this.log("preheat", `warm failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
2232
|
+
}
|
|
2233
|
+
}, Math.max(0, this.preheatDelayMs));
|
|
2234
|
+
if (typeof timer?.unref === "function") timer.unref();
|
|
2235
|
+
}
|
|
2205
2236
|
}
|
|
2206
2237
|
/** 直接读 Loader,不维护第二份生命周期缓存。 */
|
|
2207
2238
|
list() {
|
|
@@ -4004,6 +4035,51 @@ setTimeout(() => {
|
|
|
4004
4035
|
}, timeoutMs);
|
|
4005
4036
|
});
|
|
4006
4037
|
}
|
|
4038
|
+
/**
|
|
4039
|
+
* 状态 → RPC 的 `pending` 投影(1.1.3 语义,1.1.4 抽成公共函数给进程内读取复用):
|
|
4040
|
+
* stale(目标 ≤ 已装)与 applied 都代表「没有待处理更新」——旧实现把它们投影成 pending,
|
|
4041
|
+
* 管理台于是又显示「1.1.3 → 1.1.3」和「现在/稍后」按钮(用户看到的就是"误报")。
|
|
4042
|
+
*/
|
|
4043
|
+
selfUpdatePendingOf(state) {
|
|
4044
|
+
if (state === null || state === void 0 || state.stale === true || state.phase === "applied") return null;
|
|
4045
|
+
return {
|
|
4046
|
+
targetVersion: String(state.targetVersion ?? ""),
|
|
4047
|
+
currentVersion: String(state.currentVersion ?? ""),
|
|
4048
|
+
channel: String(state.channel ?? ""),
|
|
4049
|
+
phase: String(state.phase ?? ""),
|
|
4050
|
+
decision: state.decision === null || state.decision === void 0 ? null : String(state.decision),
|
|
4051
|
+
stagedFile: state.stagedFile === null || state.stagedFile === void 0 ? null : String(state.stagedFile),
|
|
4052
|
+
source: state.source === null || state.source === void 0 ? null : String(state.source),
|
|
4053
|
+
fetchedAt: state.fetchedAt === null || state.fetchedAt === void 0 ? null : String(state.fetchedAt)
|
|
4054
|
+
};
|
|
4055
|
+
}
|
|
4056
|
+
/** 当前已装版本:优先 profile 里真实安装的那份,读不到回退本模块自己的 package.json。 */
|
|
4057
|
+
selfInstalledVersion() {
|
|
4058
|
+
const installed = packageInfoOf(SELF_MODULE, this.baseUrl).installedVersion;
|
|
4059
|
+
if (typeof installed === "string" && installed !== "") return installed;
|
|
4060
|
+
try {
|
|
4061
|
+
const manifest = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), "..", "package.json"), "utf8"));
|
|
4062
|
+
return typeof manifest?.version === "string" && manifest.version !== "" ? manifest.version : null;
|
|
4063
|
+
} catch {
|
|
4064
|
+
return null;
|
|
4065
|
+
}
|
|
4066
|
+
}
|
|
4067
|
+
/**
|
|
4068
|
+
* 读首启画像里的宿主形态(与 CLI `--status` 的 resolveForm 同源:同一份
|
|
4069
|
+
* `<DSH_HOME>/.drydock/host-profile.json`,不做 TTL 判断)。
|
|
4070
|
+
* 为什么需要:`canApply` 必须按**当前机器**的形态裁决(桌面形态不给「现在升级」按钮),
|
|
4071
|
+
* 而 `prompt` 按状态里记录的形态渲染 —— 两者在 CLI 里本来就是分开的,这里保持一致。
|
|
4072
|
+
*/
|
|
4073
|
+
hostFormOf(dshHome) {
|
|
4074
|
+
if (typeof dshHome !== "string" || dshHome === "") return null;
|
|
4075
|
+
try {
|
|
4076
|
+
const parsed = JSON.parse(readFileSync(join(dshHome, ".drydock", "host-profile.json"), "utf8"));
|
|
4077
|
+
const form = parsed?.form;
|
|
4078
|
+
return form === "web" || form === "desktop" || form === "unknown" ? form : null;
|
|
4079
|
+
} catch {
|
|
4080
|
+
return null;
|
|
4081
|
+
}
|
|
4082
|
+
}
|
|
4007
4083
|
/** 把 CLI 的 `--status --json` 输出映射成 RPC 契约(缺字段补空,绝不让 UI 拿到 undefined)。 */
|
|
4008
4084
|
selfUpdateProject(run) {
|
|
4009
4085
|
const json = run?.json ?? null;
|
|
@@ -4016,28 +4092,52 @@ setTimeout(() => {
|
|
|
4016
4092
|
channel: typeof json?.channel === "string" ? json.channel : "latest",
|
|
4017
4093
|
form: typeof json?.form === "string" ? json.form : "unknown",
|
|
4018
4094
|
canApply: json?.canApply === true,
|
|
4019
|
-
|
|
4020
|
-
// 管理台于是又显示「1.1.3 → 1.1.3」和「现在/稍后」按钮(用户看到的就是"误报")。
|
|
4021
|
-
pending:
|
|
4022
|
-
state === null || state === void 0 || state.stale === true || state.phase === "applied"
|
|
4023
|
-
? null
|
|
4024
|
-
: {
|
|
4025
|
-
targetVersion: String(state.targetVersion ?? ""),
|
|
4026
|
-
currentVersion: String(state.currentVersion ?? ""),
|
|
4027
|
-
channel: String(state.channel ?? ""),
|
|
4028
|
-
phase: String(state.phase ?? ""),
|
|
4029
|
-
decision: state.decision === null || state.decision === void 0 ? null : String(state.decision),
|
|
4030
|
-
stagedFile: state.stagedFile === null || state.stagedFile === void 0 ? null : String(state.stagedFile),
|
|
4031
|
-
source: state.source === null || state.source === void 0 ? null : String(state.source),
|
|
4032
|
-
fetchedAt: state.fetchedAt === null || state.fetchedAt === void 0 ? null : String(state.fetchedAt)
|
|
4033
|
-
},
|
|
4095
|
+
pending: this.selfUpdatePendingOf(state),
|
|
4034
4096
|
prompt: typeof json?.prompt === "string" ? json.prompt : ""
|
|
4035
4097
|
};
|
|
4036
4098
|
}
|
|
4037
|
-
/**
|
|
4099
|
+
/** 把进程内 `readSelfUpdateStatus()` 的返回投影成同一份 RPC 契约(1.1.4 A1)。 */
|
|
4100
|
+
selfUpdateProjectStatus(status) {
|
|
4101
|
+
return {
|
|
4102
|
+
ok: true,
|
|
4103
|
+
message: "自更新状态已读取",
|
|
4104
|
+
currentVersion: typeof status?.currentVersion === "string" ? status.currentVersion : (packageInfoOf(SELF_MODULE, this.baseUrl).installedVersion ?? "unknown"),
|
|
4105
|
+
channel: typeof status?.channel === "string" ? status.channel : "latest",
|
|
4106
|
+
form: typeof status?.form === "string" ? status.form : "unknown",
|
|
4107
|
+
canApply: status?.canApply === true,
|
|
4108
|
+
pending: this.selfUpdatePendingOf(status?.state ?? null),
|
|
4109
|
+
prompt: typeof status?.prompt === "string" ? status.prompt : ""
|
|
4110
|
+
};
|
|
4111
|
+
}
|
|
4112
|
+
/**
|
|
4113
|
+
* 只读:当前版本 + 是否有待安装更新 + 提示文案(UI 挂载时调用)。
|
|
4114
|
+
*
|
|
4115
|
+
* 1.1.4(A1):**进程内读取**,不再 spawn `bin/drydock-update.mjs --status`。
|
|
4116
|
+
* 依据:该 CLI 干的活是「读 self-update.json + 纯函数格式化」,实测 113–243ms/次,全是 node 启动与模块加载;
|
|
4117
|
+
* 逻辑已收进 `lib/self-update.mjs` 的 `readSelfUpdateStatus()`,与 CLI 同源。写盘/联网/worker 仍只在 CLI 里。
|
|
4118
|
+
*/
|
|
4038
4119
|
async selfUpdateStatus() {
|
|
4039
|
-
|
|
4040
|
-
|
|
4120
|
+
try {
|
|
4121
|
+
const mod = await loadSelfUpdateModule();
|
|
4122
|
+
const dshHome = (() => { try { return resolveDshHome(); } catch { return null; } })();
|
|
4123
|
+
if (typeof dshHome !== "string" || dshHome === "") {
|
|
4124
|
+
return { ok: false, message: "无法确定 DSH_HOME,自更新状态不可读。", currentVersion: this.selfInstalledVersion() ?? "unknown", channel: "latest", form: "unknown", canApply: false, pending: null, prompt: "" };
|
|
4125
|
+
}
|
|
4126
|
+
const hostForm = this.hostFormOf(dshHome);
|
|
4127
|
+
const status = mod.readSelfUpdateStatus({ dshHome, currentVersion: this.selfInstalledVersion(), form: hostForm });
|
|
4128
|
+
return this.selfUpdateProjectStatus(status);
|
|
4129
|
+
} catch (error) {
|
|
4130
|
+
return {
|
|
4131
|
+
ok: false,
|
|
4132
|
+
message: `读取自更新状态失败:${error instanceof Error ? error.message : String(error)}`,
|
|
4133
|
+
currentVersion: this.selfInstalledVersion() ?? "unknown",
|
|
4134
|
+
channel: "latest",
|
|
4135
|
+
form: "unknown",
|
|
4136
|
+
canApply: false,
|
|
4137
|
+
pending: null,
|
|
4138
|
+
prompt: ""
|
|
4139
|
+
};
|
|
4140
|
+
}
|
|
4041
4141
|
}
|
|
4042
4142
|
/** 查权威源 + 下载校验 + 暂存(耗时长,UI 要转圈);完成后返回带 pending 的状态。 */
|
|
4043
4143
|
async selfUpdatePrepare() {
|
package/lib/remote.js
CHANGED
|
@@ -595,21 +595,32 @@ const descriptor = (method, parameters, result) => ({
|
|
|
595
595
|
result: strict(`dsh-drydock/types#${SNAPSHOT_RESULT_METHODS.has(method) ? "PluginManagerSnapshot" : RECEIPT_RESULT_METHODS.has(method) ? method === "quarantine" ? "PluginManagerQuarantineReceipt" : method === "uninstallPackages" ? "PluginManagerUninstallReceipt" : "PluginManagerMutationReceipt" : RESULT_TYPES[method] ?? "PluginManagerMutationReceipt"}`, result)
|
|
596
596
|
});
|
|
597
597
|
|
|
598
|
+
/**
|
|
599
|
+
* 对外入参的硬上限(1.1.4 安全加固)。
|
|
600
|
+
*
|
|
601
|
+
* 背景(Dependabot #1 / GHSA-mrhx-c7xc-m3w5 / CVE-2023-54404):zod < 4.6.6 的 `$ZodArray`
|
|
602
|
+
* 会对**每个**失败元素累积一条 issue 对象,攻击者提交超大数组即可把校验进程的内存吃光。
|
|
603
|
+
* 本项目已把 zod 升到 ≥4.6.6;这里再按**业务上限**加第二道闸 —— 即使将来再出现类似的
|
|
604
|
+
* issue 累积/线性扫描缺陷,入参也不会变成无界输入。UI 单次最多操作几十项,500 足够宽松。
|
|
605
|
+
*/
|
|
606
|
+
const MAX_BATCH_SIZE = 500;
|
|
607
|
+
const MAX_SOURCES = 50;
|
|
608
|
+
|
|
598
609
|
const descriptors = [
|
|
599
610
|
descriptor("list", [], snapshot),
|
|
600
611
|
descriptor("refresh", [], snapshot),
|
|
601
612
|
descriptor("getSources", [], snapshot),
|
|
602
|
-
descriptor("setSources", [parameter("sources", z.array(source)), parameter("options", sourcesOptions.nullable())], snapshot),
|
|
613
|
+
descriptor("setSources", [parameter("sources", z.array(source).max(MAX_SOURCES)), parameter("options", sourcesOptions.nullable())], snapshot),
|
|
603
614
|
descriptor("setEnabled", [parameter("entryId", z.string()), parameter("enabled", z.boolean())], receipt),
|
|
604
615
|
descriptor("resetToggles", [], snapshot),
|
|
605
|
-
descriptor("update", [parameter("packageNames", z.array(z.string()))], updateReceipt),
|
|
616
|
+
descriptor("update", [parameter("packageNames", z.array(z.string()).max(MAX_BATCH_SIZE))], updateReceipt),
|
|
606
617
|
// —— 救援 / 事务化卸载 ——
|
|
607
618
|
descriptor("diagnose", [], diagnoseResult),
|
|
608
|
-
descriptor("quarantine", [parameter("entryIds", z.array(z.string()))], quarantineReceipt),
|
|
619
|
+
descriptor("quarantine", [parameter("entryIds", z.array(z.string()).max(MAX_BATCH_SIZE))], quarantineReceipt),
|
|
609
620
|
descriptor("repairHarness", [], repairResult),
|
|
610
621
|
descriptor("restartHarness", [], restartResult),
|
|
611
|
-
descriptor("uninstallPackages", [parameter("packageNames", z.array(z.string())), parameter("options", uninstallOptions)], uninstallReceipt),
|
|
612
|
-
descriptor("uninstallPreview", [parameter("packageNames", z.array(z.string()))], uninstallPreviewResult),
|
|
622
|
+
descriptor("uninstallPackages", [parameter("packageNames", z.array(z.string()).max(MAX_BATCH_SIZE)), parameter("options", uninstallOptions)], uninstallReceipt),
|
|
623
|
+
descriptor("uninstallPreview", [parameter("packageNames", z.array(z.string()).max(MAX_BATCH_SIZE))], uninstallPreviewResult),
|
|
613
624
|
// —— 操作历史 / 撤销 ——
|
|
614
625
|
descriptor("operationHistory", [], historyResult),
|
|
615
626
|
descriptor("undoOperation", [parameter("id", z.string())], undoResult),
|
|
@@ -628,7 +639,7 @@ const descriptors = [
|
|
|
628
639
|
descriptor("resolveDownloadUrl", [parameter("packageName", z.string())], downloadUrlResult),
|
|
629
640
|
descriptor("verifyProfile", [], verifyResult),
|
|
630
641
|
descriptor("fixProfile", [], fixResult),
|
|
631
|
-
descriptor("updateBrowser", [parameter("packageNames", z.array(z.string()))], browserReceipt),
|
|
642
|
+
descriptor("updateBrowser", [parameter("packageNames", z.array(z.string()).max(MAX_BATCH_SIZE))], browserReceipt),
|
|
632
643
|
descriptor("marketCatalog", [], marketCatalogResult),
|
|
633
644
|
descriptor("marketInstall", [parameter("target", marketTarget), parameter("dryRun", z.boolean())], marketInstallResult),
|
|
634
645
|
// —— 管理器自身的更新(权威源校验 → 暂存 → 现在/稍后)——
|
package/lib/self-update.mjs
CHANGED
|
@@ -363,6 +363,38 @@ export function statusText(state, { now = Date.now } = {}) {
|
|
|
363
363
|
.join("\n");
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
+
/**
|
|
367
|
+
* 进程内读取自更新状态(1.1.4,A1)——与 `bin/drydock-update.mjs --status` **同源**,一条逻辑两处用:
|
|
368
|
+
* · 读 `<DSH_HOME>/.drydock/self-update.json`(`readState` 自带坏数据自愈);
|
|
369
|
+
* · 陈旧状态(target ≤ 已装版本)按「无待处理更新」投影成 `phase=applied` + `stale=true`(不删文件、不静默改盘);
|
|
370
|
+
* · `prompt` / `channel` / `canApply` 全由本模块的纯函数生成,保证 UI、CLI、issue 文案一致。
|
|
371
|
+
*
|
|
372
|
+
* 只读:不写盘、不联网、**不起子进程**(这是 A1 要消掉的 113–243ms/次开销)。
|
|
373
|
+
*
|
|
374
|
+
* @param {object} opts
|
|
375
|
+
* @param {string} opts.dshHome DSH_HOME(状态文件所在机器级目录)
|
|
376
|
+
* @param {string|null} opts.currentVersion 当前已装版本(用于陈旧判定;读不到可传 null)
|
|
377
|
+
* @param {string|null} [opts.form] 当前宿主形态(web/desktop);**显式传入**时按它算 `canApply`(CLI 走这条),
|
|
378
|
+
* 不传则用状态里记录的形态(更贴合 `decide()` 的裁决口径,host 走这条)
|
|
379
|
+
* @param {object|null} [opts.fsx] 可注入 fs(测试用)
|
|
380
|
+
*/
|
|
381
|
+
export function readSelfUpdateStatus({ dshHome, currentVersion = null, form = null, fsx = null } = {}) {
|
|
382
|
+
const raw = readState({ dshHome, fsx });
|
|
383
|
+
const state = isStaleState(raw, currentVersion) ? { ...raw, phase: "applied", stale: true } : raw;
|
|
384
|
+
const stateForm = typeof state?.form === "string" && state.form !== "" ? state.form : null;
|
|
385
|
+
const effectiveForm = typeof form === "string" && form !== "" ? form : (stateForm ?? "unknown");
|
|
386
|
+
return {
|
|
387
|
+
dshHome,
|
|
388
|
+
currentVersion,
|
|
389
|
+
form: effectiveForm,
|
|
390
|
+
channel: distTagForForm(effectiveForm),
|
|
391
|
+
canApply: canSelfApply(effectiveForm),
|
|
392
|
+
state,
|
|
393
|
+
// 提示文案按**状态里记录的形态**渲染(与 --status 历史行为一致):桌面暂存的包不能在网页机器上被渲染成「现在」按钮
|
|
394
|
+
prompt: promptText(state, { canApply: canSelfApply(stateForm ?? effectiveForm) })
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
|
|
366
398
|
/**
|
|
367
399
|
* 后台 worker:真正执行「停引擎 → 装包 → 健康检查 → 启引擎」,失败则回滚。
|
|
368
400
|
* 全部动作可注入(`run` / `stopEngine` / `startEngine` / `health`),便于测试状态机与顺序。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-drydock",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "DSH 引擎船坞(drydock,原名 dsh-plugin-manager-pro):引擎外灾备与坞修——引擎起不来时仍能独立救援(3081 兜底页 / 3082 守护 / 官方 dsh rescue profile 通道)、离线只读诊断报告、官方恢复后自愈、启动前自检;装完之后的事——本地插件管理器:分类折叠(核心组件/引擎内置组件/用户插件,跟随官方 PROTECTED_PLUGINS 与 HIDDEN_BUNDLES)、更新源一键更新(npm/GitHub/自定义镜像)、浏览器下载优先、下载目录自动安装、插件市场(ADP 精选目录)、README 简介提取;事务化卸载(备份→删除→校验→回滚)、操作历史一键撤销、场景方案、来源人工修正、依赖关系感知;独立救援工具链(3082 rescue-daemon / open-boot 浏览器触发自启 / dsh-boot 启动序列);1.1.0 起支持 DSH 桌面版(按 profile 能力门控 + 首启环境探测自动剥离非本环境模块:只做官方覆盖不到的引擎外灾备,不抢宿主生命周期);跨平台(Windows/macOS/Linux)",
|
|
5
5
|
"author": "nonentity303",
|
|
6
6
|
"repository": {
|
|
@@ -74,35 +74,35 @@
|
|
|
74
74
|
"scripts": {
|
|
75
75
|
"build": "node build.mjs",
|
|
76
76
|
"prepack": "node build.mjs",
|
|
77
|
-
"test": "node build.mjs && node test-bundle.mjs && node test-admission.mjs && node test-daemon-security.mjs && node test-render.mjs && node test-integration.mjs && node test-launcher.mjs && node test-ux.mjs && node test-downloader.mjs && node test-security-provenance.mjs && node test-capabilities.mjs && node test-origin.mjs && node test-cors.mjs && node test-diagnostics.mjs && node test-rescue-profile.mjs && node test-host-strip.mjs && node test-self-update.mjs && node test-mod-list.mjs && node test-boot-diff.mjs && node test-watchdog.mjs && node test-sources.mjs && node test-isolation.mjs && node test-channels.mjs && node test-host-descriptor.mjs && node test-compat.mjs && node test-patch-inventory.mjs && node test-evidence.mjs && node test-evidence-cli.mjs && node test-docs.mjs",
|
|
78
|
-
"test:host-descriptor": "node test-host-descriptor.mjs",
|
|
79
|
-
"test:compat": "node test-compat.mjs",
|
|
80
|
-
"test:patch-inventory": "node test-patch-inventory.mjs",
|
|
81
|
-
"test:evidence": "node test-evidence.mjs",
|
|
82
|
-
"test:evidence-cli": "node test-evidence-cli.mjs",
|
|
77
|
+
"test": "node build.mjs && node test/test-bundle.mjs && node test/test-admission.mjs && node test/test-daemon-security.mjs && node test/test-render.mjs && node test/test-integration.mjs && node test/test-launcher.mjs && node test/test-ux.mjs && node test/test-downloader.mjs && node test/test-security-provenance.mjs && node test/test-capabilities.mjs && node test/test-origin.mjs && node test/test-cors.mjs && node test/test-diagnostics.mjs && node test/test-rescue-profile.mjs && node test/test-host-strip.mjs && node test/test-self-update.mjs && node test/test-mod-list.mjs && node test/test-boot-diff.mjs && node test/test-watchdog.mjs && node test/test-sources.mjs && node test/test-isolation.mjs && node test/test-channels.mjs && node test/test-host-descriptor.mjs && node test/test-compat.mjs && node test/test-patch-inventory.mjs && node test/test-evidence.mjs && node test/test-evidence-cli.mjs && node test/test-perf.mjs && node test/test-docs.mjs",
|
|
78
|
+
"test:host-descriptor": "node test/test-host-descriptor.mjs",
|
|
79
|
+
"test:compat": "node test/test-compat.mjs",
|
|
80
|
+
"test:patch-inventory": "node test/test-patch-inventory.mjs",
|
|
81
|
+
"test:evidence": "node test/test-evidence.mjs",
|
|
82
|
+
"test:evidence-cli": "node test/test-evidence-cli.mjs",
|
|
83
83
|
"schema": "node tools/dev/gen-schema.mjs --write",
|
|
84
84
|
"schema:check": "node tools/dev/gen-schema.mjs --check",
|
|
85
|
-
"test:isolation": "node test-isolation.mjs",
|
|
86
|
-
"test:channels": "node test-channels.mjs",
|
|
87
|
-
"test:host-strip": "node test-host-strip.mjs",
|
|
88
|
-
"test:update": "node test-self-update.mjs",
|
|
89
|
-
"test:mod-list": "node test-mod-list.mjs",
|
|
90
|
-
"test:boot-diff": "node test-boot-diff.mjs",
|
|
91
|
-
"test:watchdog": "node test-watchdog.mjs",
|
|
92
|
-
"test:sources": "node test-sources.mjs",
|
|
85
|
+
"test:isolation": "node test/test-isolation.mjs",
|
|
86
|
+
"test:channels": "node test/test-channels.mjs",
|
|
87
|
+
"test:host-strip": "node test/test-host-strip.mjs",
|
|
88
|
+
"test:update": "node test/test-self-update.mjs",
|
|
89
|
+
"test:mod-list": "node test/test-mod-list.mjs",
|
|
90
|
+
"test:boot-diff": "node test/test-boot-diff.mjs",
|
|
91
|
+
"test:watchdog": "node test/test-watchdog.mjs",
|
|
92
|
+
"test:sources": "node test/test-sources.mjs",
|
|
93
93
|
"channels": "node tools/dev/channels.mjs",
|
|
94
|
-
"test:admission": "node test-admission.mjs",
|
|
95
|
-
"test:launcher": "node test-launcher.mjs",
|
|
96
|
-
"test:strict": "node test-launcher.mjs --strict",
|
|
97
|
-
"test:ux": "node test-ux.mjs",
|
|
98
|
-
"test:downloader": "node test-downloader.mjs",
|
|
99
|
-
"test:security": "node test-security-provenance.mjs",
|
|
100
|
-
"test:capabilities": "node test-capabilities.mjs",
|
|
101
|
-
"test:origin": "node test-origin.mjs",
|
|
102
|
-
"test:cors": "node test-cors.mjs",
|
|
103
|
-
"test:diagnostics": "node test-diagnostics.mjs",
|
|
104
|
-
"test:rescue-profile": "node test-rescue-profile.mjs",
|
|
105
|
-
"test:desktop": "node test-capabilities.mjs && node test-origin.mjs && node test-cors.mjs && node test-diagnostics.mjs && node test-rescue-profile.mjs",
|
|
94
|
+
"test:admission": "node test/test-admission.mjs",
|
|
95
|
+
"test:launcher": "node test/test-launcher.mjs",
|
|
96
|
+
"test:strict": "node test/test-launcher.mjs --strict",
|
|
97
|
+
"test:ux": "node test/test-ux.mjs",
|
|
98
|
+
"test:downloader": "node test/test-downloader.mjs",
|
|
99
|
+
"test:security": "node test/test-security-provenance.mjs",
|
|
100
|
+
"test:capabilities": "node test/test-capabilities.mjs",
|
|
101
|
+
"test:origin": "node test/test-origin.mjs",
|
|
102
|
+
"test:cors": "node test/test-cors.mjs",
|
|
103
|
+
"test:diagnostics": "node test/test-diagnostics.mjs",
|
|
104
|
+
"test:rescue-profile": "node test/test-rescue-profile.mjs",
|
|
105
|
+
"test:desktop": "node test/test-capabilities.mjs && node test/test-origin.mjs && node test/test-cors.mjs && node test/test-diagnostics.mjs && node test/test-rescue-profile.mjs",
|
|
106
106
|
"check:vendor": "node tools/check-vendor.mjs",
|
|
107
107
|
"pack": "node build.mjs && npm pack",
|
|
108
108
|
"preflight": "node tools/dev/npm-preflight.mjs",
|
|
@@ -112,11 +112,13 @@
|
|
|
112
112
|
"publish:all": "node tools/dev/publish-all.mjs",
|
|
113
113
|
"publish:status": "node tools/dev/publish-all.mjs --status",
|
|
114
114
|
"verify:triple": "node tools/dev/verify-triple.mjs",
|
|
115
|
-
"test:daemon": "node test-daemon-security.mjs"
|
|
115
|
+
"test:daemon": "node test/test-daemon-security.mjs",
|
|
116
|
+
"test:perf": "node test/test-perf.mjs",
|
|
117
|
+
"bench": "node tools/dev/bench-pages.mjs"
|
|
116
118
|
},
|
|
117
119
|
"dependencies": {
|
|
118
120
|
"yaml": "^2.9.0",
|
|
119
|
-
"zod": "^4.
|
|
121
|
+
"zod": "^4.6.6"
|
|
120
122
|
},
|
|
121
123
|
"peerDependencies": {
|
|
122
124
|
"@deepseek-ai/dsh-home-paths": ">=0.1.7-rc.2 <0.3.0-0",
|
package/schema/badge-v1.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"expiresAt": {
|
|
11
11
|
"format": "date-time",
|
|
12
|
-
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d
|
|
12
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
|
|
13
13
|
"type": "string"
|
|
14
14
|
},
|
|
15
15
|
"hostRange": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"testedAt": {
|
|
42
42
|
"format": "date-time",
|
|
43
|
-
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d
|
|
43
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
|
|
44
44
|
"type": "string"
|
|
45
45
|
},
|
|
46
46
|
"verdict": {
|
package/schema/evidence-v1.json
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
],
|
|
31
31
|
"type": "object"
|
|
32
32
|
},
|
|
33
|
+
"maxItems": 100,
|
|
33
34
|
"minItems": 1,
|
|
34
35
|
"type": "array"
|
|
35
36
|
},
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
},
|
|
40
41
|
"expiresAt": {
|
|
41
42
|
"format": "date-time",
|
|
42
|
-
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d
|
|
43
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
|
|
43
44
|
"type": "string"
|
|
44
45
|
},
|
|
45
46
|
"host": {
|
|
@@ -149,7 +150,7 @@
|
|
|
149
150
|
},
|
|
150
151
|
"testedAt": {
|
|
151
152
|
"format": "date-time",
|
|
152
|
-
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d
|
|
153
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
|
|
153
154
|
"type": "string"
|
|
154
155
|
},
|
|
155
156
|
"tool": {
|
package/schema/matrix-v1.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"expiresAt": {
|
|
19
19
|
"format": "date-time",
|
|
20
|
-
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d
|
|
20
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
|
|
21
21
|
"type": "string"
|
|
22
22
|
},
|
|
23
23
|
"host": {
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
},
|
|
111
111
|
"testedAt": {
|
|
112
112
|
"format": "date-time",
|
|
113
|
-
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d
|
|
113
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
|
|
114
114
|
"type": "string"
|
|
115
115
|
},
|
|
116
116
|
"verdict": {
|
|
@@ -133,11 +133,12 @@
|
|
|
133
133
|
],
|
|
134
134
|
"type": "object"
|
|
135
135
|
},
|
|
136
|
+
"maxItems": 10000,
|
|
136
137
|
"type": "array"
|
|
137
138
|
},
|
|
138
139
|
"generatedAt": {
|
|
139
140
|
"format": "date-time",
|
|
140
|
-
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d
|
|
141
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
|
|
141
142
|
"type": "string"
|
|
142
143
|
},
|
|
143
144
|
"schema": {
|