dsh-life-pack 0.3.64 → 0.3.66
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/dist/client.js +237 -22
- package/dist/client.js.map +1 -1
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -471,7 +471,7 @@ window.__ModuleLoader__.load({
|
|
|
471
471
|
path: "/api/ilife-manager"
|
|
472
472
|
};
|
|
473
473
|
//#endregion
|
|
474
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
474
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.6/node_modules/dsh-plugin-update/dist/config.js
|
|
475
475
|
const DEFAULT_PANEL_POLL_MS = 1e3;
|
|
476
476
|
function assertPrefix(value, role) {
|
|
477
477
|
if (typeof value !== "string" || value.length === 0) throw new Error("[dsh-plugin-update] " + role + " 非法:须为非空字符串(收到 " + JSON.stringify(value) + ")");
|
|
@@ -485,6 +485,7 @@ window.__ModuleLoader__.load({
|
|
|
485
485
|
updateCheck: checked + ".updateCheck",
|
|
486
486
|
updateInstall: checked + ".updateInstall",
|
|
487
487
|
updateChangelog: checked + ".updateChangelog",
|
|
488
|
+
updateCheckFallback: checked + ".updateCheckFallback",
|
|
488
489
|
logAppend: checked + ".logAppend"
|
|
489
490
|
};
|
|
490
491
|
}
|
|
@@ -492,7 +493,7 @@ window.__ModuleLoader__.load({
|
|
|
492
493
|
return buildPhoneNames(prefix).logAppend;
|
|
493
494
|
}
|
|
494
495
|
//#endregion
|
|
495
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
496
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.6/node_modules/dsh-plugin-update/dist/redaction.js
|
|
496
497
|
const COPY_BUDGET_CHARS = 1500;
|
|
497
498
|
const REDACTED_PATH = "<路径>";
|
|
498
499
|
const REDACTED_SECRET = "<脱敏>";
|
|
@@ -556,7 +557,7 @@ window.__ModuleLoader__.load({
|
|
|
556
557
|
return truncateForCopy(scrubWithoutBudget(flat));
|
|
557
558
|
}
|
|
558
559
|
//#endregion
|
|
559
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
560
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.6/node_modules/dsh-plugin-update/dist/service.js
|
|
560
561
|
function updateError(code) {
|
|
561
562
|
return Object.assign(new Error(code), { code });
|
|
562
563
|
}
|
|
@@ -643,7 +644,7 @@ window.__ModuleLoader__.load({
|
|
|
643
644
|
return 0;
|
|
644
645
|
}
|
|
645
646
|
//#endregion
|
|
646
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
647
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.6/node_modules/dsh-plugin-update/dist/lang.js
|
|
647
648
|
function normalizeLangTag(tag) {
|
|
648
649
|
if (typeof tag !== "string") return "zh";
|
|
649
650
|
const s = tag.trim().toLowerCase().replace(/_/g, "-");
|
|
@@ -785,7 +786,7 @@ window.__ModuleLoader__.load({
|
|
|
785
786
|
};
|
|
786
787
|
}
|
|
787
788
|
//#endregion
|
|
788
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
789
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.6/node_modules/dsh-plugin-update/dist/bilingual.js
|
|
789
790
|
const BILINGUAL_STRINGS = {
|
|
790
791
|
"entry.label.idle": {
|
|
791
792
|
en: "Check for updates",
|
|
@@ -1187,6 +1188,16 @@ window.__ModuleLoader__.load({
|
|
|
1187
1188
|
zh: "安装版本 {latest}",
|
|
1188
1189
|
draft: true
|
|
1189
1190
|
},
|
|
1191
|
+
"panel.banner.update-gated-title": {
|
|
1192
|
+
en: "Version {latest} was just published and is still gated ({unlock}); installing now will fail — use Install fallback build below if you cannot wait.",
|
|
1193
|
+
zh: "新版本 {latest} 刚发布未满门,{unlock}可装;现在点安装会失败,等不及可先装合规版。",
|
|
1194
|
+
draft: true
|
|
1195
|
+
},
|
|
1196
|
+
"panel.action.install-gated-title": {
|
|
1197
|
+
en: "Come back {unlock} to install {latest}; it is still gated and would fail now.",
|
|
1198
|
+
zh: "{unlock}再来装 {latest} 吧,现在装会被门拦住。",
|
|
1199
|
+
draft: true
|
|
1200
|
+
},
|
|
1190
1201
|
"panel.banner.done": {
|
|
1191
1202
|
en: "Up to date. No update needed.",
|
|
1192
1203
|
zh: "已是最新,无需更新。",
|
|
@@ -1252,6 +1263,16 @@ window.__ModuleLoader__.load({
|
|
|
1252
1263
|
zh: "已确认该失败提示;下次查询版本信息或安装将重新评估。",
|
|
1253
1264
|
draft: true
|
|
1254
1265
|
},
|
|
1266
|
+
"panel.toast.fallback-unavailable": {
|
|
1267
|
+
en: "No compliant build for this failure; see the diagnostics or retry later.",
|
|
1268
|
+
zh: "这次失败用不上合规版,请看诊断信息或稍后重试。",
|
|
1269
|
+
draft: true
|
|
1270
|
+
},
|
|
1271
|
+
"panel.toast.fallback-wait": {
|
|
1272
|
+
en: "Latest should clear around {time}; no earlier compliant build for now.",
|
|
1273
|
+
zh: "最新版约 {time} 可装,暂无更早的合规版。",
|
|
1274
|
+
draft: true
|
|
1275
|
+
},
|
|
1255
1276
|
"panel.strip.running": {
|
|
1256
1277
|
en: "Running",
|
|
1257
1278
|
zh: "运行版",
|
|
@@ -1412,6 +1433,36 @@ window.__ModuleLoader__.load({
|
|
|
1412
1433
|
zh: "确认已知晓该失败:返回可安装页,下次查询或安装将重新评估",
|
|
1413
1434
|
draft: true
|
|
1414
1435
|
},
|
|
1436
|
+
"panel.action.install-fallback": {
|
|
1437
|
+
en: "Install compliant build",
|
|
1438
|
+
zh: "装合规版",
|
|
1439
|
+
draft: true
|
|
1440
|
+
},
|
|
1441
|
+
"panel.action.install-fallback-title": {
|
|
1442
|
+
en: "Resolve an age-compliant version first, then confirm; never installs an older version silently",
|
|
1443
|
+
zh: "先决议一个满门限的版本再请你确认,不会静默装旧版",
|
|
1444
|
+
draft: true
|
|
1445
|
+
},
|
|
1446
|
+
"panel.action.install-fallback-confirm": {
|
|
1447
|
+
en: "Confirm install {version}",
|
|
1448
|
+
zh: "确认装 {version}",
|
|
1449
|
+
draft: true
|
|
1450
|
+
},
|
|
1451
|
+
"panel.action.install-fallback-confirm-title": {
|
|
1452
|
+
en: "Install this exact version now",
|
|
1453
|
+
zh: "点下去即安装该精确版本",
|
|
1454
|
+
draft: true
|
|
1455
|
+
},
|
|
1456
|
+
"panel.action.wait-latest": {
|
|
1457
|
+
en: "Wait for latest",
|
|
1458
|
+
zh: "等新版",
|
|
1459
|
+
draft: true
|
|
1460
|
+
},
|
|
1461
|
+
"panel.action.wait-latest-title": {
|
|
1462
|
+
en: "Dismiss this failure; install again once the latest clears the age gate",
|
|
1463
|
+
zh: "收起这次失败;最新版满门限后可再装",
|
|
1464
|
+
draft: true
|
|
1465
|
+
},
|
|
1415
1466
|
"panel.action.copy-diag": {
|
|
1416
1467
|
en: "Copy diagnostics",
|
|
1417
1468
|
zh: "复制诊断",
|
|
@@ -1753,8 +1804,8 @@ window.__ModuleLoader__.load({
|
|
|
1753
1804
|
draft: true
|
|
1754
1805
|
},
|
|
1755
1806
|
"panel.diag.copy.field.registry-unknown": {
|
|
1756
|
-
en: "Source=
|
|
1757
|
-
zh: "
|
|
1807
|
+
en: "Source=Undeclared",
|
|
1808
|
+
zh: "源=未声明",
|
|
1758
1809
|
draft: true
|
|
1759
1810
|
},
|
|
1760
1811
|
"panel.diag.copy.field.action": {
|
|
@@ -2412,6 +2463,26 @@ window.__ModuleLoader__.load({
|
|
|
2412
2463
|
zh: "开发态源码链接,更新中心不可用",
|
|
2413
2464
|
draft: true
|
|
2414
2465
|
},
|
|
2466
|
+
"diag.cause.age.target.timed": {
|
|
2467
|
+
en: "Your plugin {package} was published too recently and was blocked by the host supply-chain age policy (installer words in the summary). Retry after {time}; for urgent use ask the host to relax the policy.",
|
|
2468
|
+
zh: "本插件 {package} 发布未满宿主年龄门限,被供应链策略拦截(安装器原话见摘要)。{time}后点重试即可;急用请找宿主放宽策略。",
|
|
2469
|
+
draft: true
|
|
2470
|
+
},
|
|
2471
|
+
"diag.cause.age.target.untimed": {
|
|
2472
|
+
en: "Your plugin {package} was blocked by the host supply-chain age policy because it is too new (see the summary). Retry later; for urgent use ask the host to relax the policy.",
|
|
2473
|
+
zh: "本插件 {package} 因太新被宿主供应链年龄策略拦截(见摘要)。请稍后重试;急用请找宿主放宽策略。",
|
|
2474
|
+
draft: true
|
|
2475
|
+
},
|
|
2476
|
+
"diag.cause.age.other.timed": {
|
|
2477
|
+
en: "The installer reports: another package in the same environment, {package}, was rejected by a supply-chain age policy — not a problem with this plugin itself (see the summary). Retry after {time}; or ask the host to relax the policy.",
|
|
2478
|
+
zh: "安装器报告:同环境另一包 {package} 因供应链年龄策略被拒,不是本插件的直接问题(见摘要)。{time}后重试;或找宿主放宽策略。",
|
|
2479
|
+
draft: true
|
|
2480
|
+
},
|
|
2481
|
+
"diag.cause.age.other.untimed": {
|
|
2482
|
+
en: "The installer reports: another package in the same environment, {package}, was rejected by a supply-chain age policy — not a problem with this plugin itself (see the summary). Retry later, or ask the host to relax the policy.",
|
|
2483
|
+
zh: "安装器报告:同环境另一包 {package} 因供应链年龄策略被拒,不是本插件的直接问题(见摘要)。请稍后重试,或找宿主放宽策略。",
|
|
2484
|
+
draft: true
|
|
2485
|
+
},
|
|
2415
2486
|
"install-button.action.installed": {
|
|
2416
2487
|
en: "Installed",
|
|
2417
2488
|
zh: "已安装",
|
|
@@ -2447,7 +2518,7 @@ window.__ModuleLoader__.load({
|
|
|
2447
2518
|
}
|
|
2448
2519
|
const BILINGUAL_CSS = [".dsh-upd-bi{display:inline;overflow-wrap:anywhere}", ".dsh-upd-bi [lang]{overflow-wrap:anywhere}"].join("\n");
|
|
2449
2520
|
//#endregion
|
|
2450
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
2521
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.6/node_modules/dsh-plugin-update/dist/changelog.js
|
|
2451
2522
|
const CHANGELOG_MAX_CHARS = 65536;
|
|
2452
2523
|
const CHANGELOG_ALL_CATEGORIES = [
|
|
2453
2524
|
"Added",
|
|
@@ -3555,7 +3626,7 @@ ${note}${blocks.join("\n")}
|
|
|
3555
3626
|
}
|
|
3556
3627
|
}
|
|
3557
3628
|
//#endregion
|
|
3558
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
3629
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.6/node_modules/dsh-plugin-update/dist/log-events.js
|
|
3559
3630
|
const LOG_EVENT_CALL = "host.call";
|
|
3560
3631
|
const LOG_EVENT_CALL_FAIL = "host.call.fail";
|
|
3561
3632
|
const LOG_EVENT_INSTALL_EXEC = "update.install.exec";
|
|
@@ -3806,7 +3877,7 @@ ${note}${blocks.join("\n")}
|
|
|
3806
3877
|
};
|
|
3807
3878
|
}
|
|
3808
3879
|
//#endregion
|
|
3809
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
3880
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.6/node_modules/dsh-plugin-update/dist/codes.js
|
|
3810
3881
|
const BLOCKED_REASONS = [
|
|
3811
3882
|
"unknown-profile",
|
|
3812
3883
|
"channel-mismatch",
|
|
@@ -3841,7 +3912,49 @@ ${note}${blocks.join("\n")}
|
|
|
3841
3912
|
return typeof code === "string" && isOneOf(CHECK_SIDE_FAILURE_CODES, code.trim());
|
|
3842
3913
|
}
|
|
3843
3914
|
//#endregion
|
|
3844
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
3915
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.6/node_modules/dsh-plugin-update/dist/install-cause.js
|
|
3916
|
+
const CAUSE_KINDS = ["minimum-release-age"];
|
|
3917
|
+
function causePackageNameOf(spec) {
|
|
3918
|
+
try {
|
|
3919
|
+
const s = String(spec ?? "").trim();
|
|
3920
|
+
if (!s) return "";
|
|
3921
|
+
const at = s.lastIndexOf("@");
|
|
3922
|
+
if (at > 0) return s.slice(0, at);
|
|
3923
|
+
return s;
|
|
3924
|
+
} catch {
|
|
3925
|
+
return "";
|
|
3926
|
+
}
|
|
3927
|
+
}
|
|
3928
|
+
function blameCausePackage(spec, targetPackageName) {
|
|
3929
|
+
try {
|
|
3930
|
+
const name = causePackageNameOf(spec);
|
|
3931
|
+
const target = String(targetPackageName ?? "").trim();
|
|
3932
|
+
if (!name || !target) return "unknown";
|
|
3933
|
+
if (name === target) return "target";
|
|
3934
|
+
if (name.toLowerCase() === target.toLowerCase()) return "target";
|
|
3935
|
+
return "other-package";
|
|
3936
|
+
} catch {
|
|
3937
|
+
return "unknown";
|
|
3938
|
+
}
|
|
3939
|
+
}
|
|
3940
|
+
function formatUnlockAt(ms, lang) {
|
|
3941
|
+
try {
|
|
3942
|
+
if (typeof ms !== "number" || !Number.isFinite(ms) || ms <= 0) return null;
|
|
3943
|
+
const locale = String(lang ?? "").trim().toLowerCase().startsWith("en") ? "en-US" : "zh-CN";
|
|
3944
|
+
const text = new Intl.DateTimeFormat(locale, {
|
|
3945
|
+
month: locale === "en-US" ? "short" : "numeric",
|
|
3946
|
+
day: "numeric",
|
|
3947
|
+
hour: "2-digit",
|
|
3948
|
+
minute: "2-digit",
|
|
3949
|
+
hour12: locale === "en-US"
|
|
3950
|
+
}).format(ms);
|
|
3951
|
+
return text && text.trim() ? text.trim() : null;
|
|
3952
|
+
} catch {
|
|
3953
|
+
return null;
|
|
3954
|
+
}
|
|
3955
|
+
}
|
|
3956
|
+
//#endregion
|
|
3957
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.6/node_modules/dsh-plugin-update/dist/panel.js
|
|
3845
3958
|
function normalizePanelTheme(value) {
|
|
3846
3959
|
return value === "archive" ? "archive" : "default";
|
|
3847
3960
|
}
|
|
@@ -4136,7 +4249,10 @@ ${note}${blocks.join("\n")}
|
|
|
4136
4249
|
requestId: "string",
|
|
4137
4250
|
checkId: "string",
|
|
4138
4251
|
registryHost: "string",
|
|
4139
|
-
action: "string"
|
|
4252
|
+
action: "string",
|
|
4253
|
+
causeKind: "string",
|
|
4254
|
+
causePackage: "string",
|
|
4255
|
+
causeUnlockAt: "number"
|
|
4140
4256
|
};
|
|
4141
4257
|
function readDiagTolerant(diag) {
|
|
4142
4258
|
const empty = {
|
|
@@ -4155,6 +4271,9 @@ ${note}${blocks.join("\n")}
|
|
|
4155
4271
|
checkId: null,
|
|
4156
4272
|
registryHost: null,
|
|
4157
4273
|
action: null,
|
|
4274
|
+
causeKind: null,
|
|
4275
|
+
causePackage: null,
|
|
4276
|
+
causeUnlockAt: null,
|
|
4158
4277
|
unknownKeys: []
|
|
4159
4278
|
};
|
|
4160
4279
|
if (!diag || typeof diag !== "object" || Array.isArray(diag)) return empty;
|
|
@@ -4184,6 +4303,25 @@ ${note}${blocks.join("\n")}
|
|
|
4184
4303
|
if (typeof pos === "number") return copyText("panel.diag.queue.position", l, { n: pos });
|
|
4185
4304
|
return copyText("panel.diag.queue.absent", l);
|
|
4186
4305
|
}
|
|
4306
|
+
function causeRemedyText(cause, lang) {
|
|
4307
|
+
try {
|
|
4308
|
+
const l = normalizeLangTag(lang ?? "zh");
|
|
4309
|
+
const kind = String(cause?.kind ?? "").trim();
|
|
4310
|
+
if (!kind || !CAUSE_KINDS.includes(kind)) return null;
|
|
4311
|
+
const spec = String(cause?.package ?? "").trim();
|
|
4312
|
+
if (!spec) return null;
|
|
4313
|
+
const blame = blameCausePackage(spec, cause?.target);
|
|
4314
|
+
if (blame === "unknown") return null;
|
|
4315
|
+
const timeRaw = typeof cause?.unlockAtMs === "number" ? formatUnlockAt(cause.unlockAtMs, l) : null;
|
|
4316
|
+
const timed = !!timeRaw;
|
|
4317
|
+
return copyText(blame === "target" ? timed ? "diag.cause.age.target.timed" : "diag.cause.age.target.untimed" : timed ? "diag.cause.age.other.timed" : "diag.cause.age.other.untimed", l, {
|
|
4318
|
+
package: spec,
|
|
4319
|
+
time: timeRaw ?? ""
|
|
4320
|
+
});
|
|
4321
|
+
} catch {
|
|
4322
|
+
return null;
|
|
4323
|
+
}
|
|
4324
|
+
}
|
|
4187
4325
|
function buildUpdateDiagCopy(input, langOverride) {
|
|
4188
4326
|
const l = normalizeLangTag(langOverride ?? input.lang ?? "zh");
|
|
4189
4327
|
const unknown = copyText("panel.diag.copy.unknown", l);
|
|
@@ -4191,6 +4329,12 @@ ${note}${blocks.join("\n")}
|
|
|
4191
4329
|
const rawCode = String(input.code ?? "").trim() || "internal";
|
|
4192
4330
|
const copy = failureCopy(rawCode, l) ?? failureCopy("unknown", l);
|
|
4193
4331
|
const diag = readDiagTolerant(input.diag);
|
|
4332
|
+
const remedy = causeRemedyText({
|
|
4333
|
+
kind: diag.causeKind,
|
|
4334
|
+
package: diag.causePackage,
|
|
4335
|
+
unlockAtMs: diag.causeUnlockAt,
|
|
4336
|
+
target: diag.targetPackageName
|
|
4337
|
+
}, l) ?? copy.act;
|
|
4194
4338
|
const detail = redactForCopy(diag.detail ?? input.detail ?? "") || copyText("panel.diag.copy.no-detail", l);
|
|
4195
4339
|
const pluginName = pickText(diag.targetPackageName ?? input.pluginId, unknownPkg);
|
|
4196
4340
|
const runVer = pickText(diag.runningVersion ?? input.runningVersion, "?");
|
|
@@ -4222,12 +4366,12 @@ ${note}${blocks.join("\n")}
|
|
|
4222
4366
|
prov.push(copyText("panel.diag.copy.field.queue", l, { queue }));
|
|
4223
4367
|
const format = input.format === "line" ? "line" : "block";
|
|
4224
4368
|
const provLine = redactForCopy(prov.join(" · "));
|
|
4225
|
-
if (format === "line") return redactForCopy(`[update-diag] code=${rawCode} \xB7 ${copy.zh} \xB7 ${copyText("panel.diag.copy.line.summary", l, { summary: detail })} \xB7 ${provLine} \xB7 ${copyText("panel.diag.copy.line.remedy", l, { remedy
|
|
4369
|
+
if (format === "line") return redactForCopy(`[update-diag] code=${rawCode} \xB7 ${copy.zh} \xB7 ${copyText("panel.diag.copy.line.summary", l, { summary: detail })} \xB7 ${provLine} \xB7 ${copyText("panel.diag.copy.line.remedy", l, { remedy })}`);
|
|
4226
4370
|
return [
|
|
4227
4371
|
`[update-diag] ${rawCode} \u2014 ${copy.zh}`,
|
|
4228
4372
|
` ${copyText("panel.diag.copy.block.summary", l, { summary: detail })}`,
|
|
4229
4373
|
` ${copyText("panel.diag.copy.block.source", l, { source: provLine })}`,
|
|
4230
|
-
` ${copyText("panel.diag.copy.block.remedy", l, { remedy
|
|
4374
|
+
` ${copyText("panel.diag.copy.block.remedy", l, { remedy })}`
|
|
4231
4375
|
].join("\n");
|
|
4232
4376
|
}
|
|
4233
4377
|
const PANEL_SKIPPED_MAX = 50;
|
|
@@ -4479,7 +4623,8 @@ ${note}${blocks.join("\n")}
|
|
|
4479
4623
|
} catch {
|
|
4480
4624
|
staleFailure = false;
|
|
4481
4625
|
}
|
|
4482
|
-
|
|
4626
|
+
const gated = !(typeof errorKind === "string" && errorKind.trim()) && !lastError ? checkPrejudgeOfView(input.checkPrejudge, snapshot) : null;
|
|
4627
|
+
if (!staleFailure && !gated && (failedCode || jobState === "failed" || jobState === "interrupted")) {
|
|
4483
4628
|
const code = failedCode || "install-failed";
|
|
4484
4629
|
const copy = failureCopy(code, l);
|
|
4485
4630
|
const checkDetail = copy?.zh ?? code;
|
|
@@ -4532,6 +4677,25 @@ ${note}${blocks.join("\n")}
|
|
|
4532
4677
|
}
|
|
4533
4678
|
if (snapshot.canInstall && snapshot.latestVersion) {
|
|
4534
4679
|
const running = snapshot.installed === false ? copyText("panel.banner.not-installed", l) : snapshot.runningVersion;
|
|
4680
|
+
if (gated) {
|
|
4681
|
+
const unlock = formatUnlockAt(gated.unlockAtMs, l) ?? "";
|
|
4682
|
+
return {
|
|
4683
|
+
banner: {
|
|
4684
|
+
kind: "update",
|
|
4685
|
+
title: copyText("panel.banner.update-gated-title", l, {
|
|
4686
|
+
latest: snapshot.latestVersion,
|
|
4687
|
+
unlock
|
|
4688
|
+
}),
|
|
4689
|
+
action: copyText("panel.banner.update-action", l)
|
|
4690
|
+
},
|
|
4691
|
+
installEnabled: false,
|
|
4692
|
+
installLabel: copyText("panel.action.install-version", l, { latest: snapshot.latestVersion }),
|
|
4693
|
+
skippedLatest: false,
|
|
4694
|
+
showManual: manual ? true : false,
|
|
4695
|
+
showReset: false,
|
|
4696
|
+
queueNote
|
|
4697
|
+
};
|
|
4698
|
+
}
|
|
4535
4699
|
return {
|
|
4536
4700
|
banner: {
|
|
4537
4701
|
kind: "update",
|
|
@@ -4867,6 +5031,42 @@ ${note}${blocks.join("\n")}
|
|
|
4867
5031
|
const l = normalizeLangTag(lang ?? "zh");
|
|
4868
5032
|
return copyText(CHAPTER_KEYS[index - 1], l);
|
|
4869
5033
|
}
|
|
5034
|
+
function checkPrejudgeOfView(pre, snapshot) {
|
|
5035
|
+
try {
|
|
5036
|
+
if (!pre || !snapshot?.canInstall) return null;
|
|
5037
|
+
const latest = typeof snapshot.latestVersion === "string" ? snapshot.latestVersion.trim() : "";
|
|
5038
|
+
const target = typeof pre.targetVersion === "string" ? pre.targetVersion.trim() : "";
|
|
5039
|
+
if (!latest || !target || latest !== target) return null;
|
|
5040
|
+
if (typeof pre.unlockAtMs !== "number" || !Number.isFinite(pre.unlockAtMs)) return null;
|
|
5041
|
+
if (typeof pre.nowMs !== "number" || !Number.isFinite(pre.nowMs) || pre.nowMs >= pre.unlockAtMs) return null;
|
|
5042
|
+
return {
|
|
5043
|
+
targetVersion: target,
|
|
5044
|
+
unlockAtMs: pre.unlockAtMs
|
|
5045
|
+
};
|
|
5046
|
+
} catch {
|
|
5047
|
+
return null;
|
|
5048
|
+
}
|
|
5049
|
+
}
|
|
5050
|
+
function fallbackBlockedVersionOf(failure, pluginId) {
|
|
5051
|
+
try {
|
|
5052
|
+
return vetFailureRef(failure, pluginId);
|
|
5053
|
+
} catch {
|
|
5054
|
+
return null;
|
|
5055
|
+
}
|
|
5056
|
+
}
|
|
5057
|
+
function vetFailureRef(failure, pluginId) {
|
|
5058
|
+
const kind = typeof failure?.causeKind === "string" ? failure.causeKind.trim() : "";
|
|
5059
|
+
if (!kind || !CAUSE_KINDS.includes(kind)) return null;
|
|
5060
|
+
const spec = typeof failure?.causePackage === "string" ? failure.causePackage.trim() : "";
|
|
5061
|
+
if (!spec) return null;
|
|
5062
|
+
const target = typeof failure?.causeTarget === "string" && failure.causeTarget.trim() ? failure.causeTarget.trim() : typeof pluginId === "string" && pluginId.trim() ? pluginId.trim() : "";
|
|
5063
|
+
if (!target) return null;
|
|
5064
|
+
if (blameCausePackage(spec, target) !== "target") return null;
|
|
5065
|
+
const direct = typeof failure?.targetVersion === "string" ? failure.targetVersion.trim() : "";
|
|
5066
|
+
if (direct) return direct;
|
|
5067
|
+
const at = spec.lastIndexOf("@");
|
|
5068
|
+
return (at > 0 ? spec.slice(at + 1).trim() : "") || null;
|
|
5069
|
+
}
|
|
4870
5070
|
function formatLatchTime(atMs, lang) {
|
|
4871
5071
|
if (typeof atMs !== "number" || !Number.isFinite(atMs) || atMs <= 0) return null;
|
|
4872
5072
|
const raw = typeof lang === "string" ? lang.trim().replace(/_/g, "-") : "";
|
|
@@ -4929,15 +5129,30 @@ ${note}${blocks.join("\n")}
|
|
|
4929
5129
|
const busyAct = input.busyAct;
|
|
4930
5130
|
const checkBusy = busyAct === "check";
|
|
4931
5131
|
const installBusy = busyAct === "install";
|
|
5132
|
+
const fallbackBusy = busyAct === "fallback";
|
|
4932
5133
|
const jobState = snapshot?.job?.state;
|
|
4933
|
-
const macroBusy = busyAct === "check" || busyAct === "install" || jobState === "installing" || jobState === "verifying";
|
|
5134
|
+
const macroBusy = busyAct === "check" || busyAct === "install" || fallbackBusy || jobState === "installing" || jobState === "verifying";
|
|
5135
|
+
const gatePrejudge = b.kind === "update" ? checkPrejudgeOfView(input.checkPrejudge ?? null, snapshot) : null;
|
|
5136
|
+
const gateOfferRaw = input.fallbackOffer ?? null;
|
|
5137
|
+
const gateCandidate = gatePrejudge && typeof gateOfferRaw?.candidate === "string" && gateOfferRaw.candidate.trim() && typeof gateOfferRaw?.targetVersion === "string" && gateOfferRaw.targetVersion.trim() === gatePrejudge.targetVersion ? gateOfferRaw.candidate.trim() : null;
|
|
4934
5138
|
actions.push("<div class=\"dsh-upd-actions\">");
|
|
4935
|
-
actions.push((checkBusy ? `<button type="button" data-action="check" disabled aria-busy="true" title="${escapeHtml$3(copyText("panel.action.checking-busy-title", l))}">${escapeHtml$3(copyText("panel.action.checking-busy", l))}</button>` : `<button type="button" data-action="check" title="${escapeHtml$3(copyText("panel.action.check-title", l))}"${macroBusy ? " disabled" : ""}>${escapeHtml$3(copyText("panel.action.check", l))}</button>`) + (installBusy ? `<button type="button" data-action="install" data-primary="1" disabled aria-busy="true" title="${escapeHtml$3(copyText("panel.action.installing-busy-title", l))}">${escapeHtml$3(copyText("panel.action.installing-busy", l))}</button>` : `<button type="button" data-action="install" data-primary="1" title="${escapeHtml$3(copyText("panel.action.install-title", l
|
|
5139
|
+
actions.push((checkBusy ? `<button type="button" data-action="check" disabled aria-busy="true" title="${escapeHtml$3(copyText("panel.action.checking-busy-title", l))}">${escapeHtml$3(copyText("panel.action.checking-busy", l))}</button>` : `<button type="button" data-action="check" title="${escapeHtml$3(copyText("panel.action.check-title", l))}"${macroBusy ? " disabled" : ""}>${escapeHtml$3(copyText("panel.action.check", l))}</button>`) + (installBusy ? `<button type="button" data-action="install" data-primary="1" disabled aria-busy="true" title="${escapeHtml$3(copyText("panel.action.installing-busy-title", l))}">${escapeHtml$3(copyText("panel.action.installing-busy", l))}</button>` : `<button type="button" data-action="install" data-primary="1" title="${escapeHtml$3(gatePrejudge ? copyText("panel.action.install-gated-title", l, {
|
|
5140
|
+
latest: snapshot?.latestVersion ?? "",
|
|
5141
|
+
unlock: formatUnlockAt(gatePrejudge.unlockAtMs, l) ?? ""
|
|
5142
|
+
}) : copyText("panel.action.install-title", l))}"${macroBusy || !view.installEnabled ? " disabled" : ""}>${escapeHtml$3(view.installLabel)}</button>`));
|
|
4936
5143
|
if (snapshot?.latestVersion && !view.skippedLatest && view.banner.kind === "update") actions.push(`<button type="button" data-action="skip" title="${escapeHtml$3(copyText("panel.action.skip-title", l))}">${escapeHtml$3(copyText("panel.action.skip", l))}</button>`);
|
|
5144
|
+
if (gatePrejudge) actions.push(gateCandidate ? `<button type="button" data-action="install-fallback-confirm" data-primary="1" title="${escapeHtml$3(copyText("panel.action.install-fallback-confirm-title", l))}"${macroBusy || fallbackBusy ? " disabled" : ""}>${escapeHtml$3(copyText("panel.action.install-fallback-confirm", l, { version: gateCandidate }))}</button>` : fallbackBusy ? `<button type="button" data-action="install-fallback" data-primary="1" disabled aria-busy="true" title="${escapeHtml$3(copyText("panel.action.install-fallback-title", l))}">${escapeHtml$3(copyText("panel.action.install-fallback", l))}</button>` : `<button type="button" data-action="install-fallback" data-primary="1" title="${escapeHtml$3(copyText("panel.action.install-fallback-title", l))}"${macroBusy ? " disabled" : ""}>${escapeHtml$3(copyText("panel.action.install-fallback", l))}</button>`);
|
|
4937
5145
|
if (view.showReset && snapshot?.latestVersion) actions.push(`<button type="button" data-action="reset-skip" title="${escapeHtml$3(copyText("panel.action.unskip-title", l))}">${escapeHtml$3(copyText("panel.action.unskip", l, { version: snapshot.latestVersion }))}</button>`);
|
|
4938
5146
|
if (view.showManual && manual) actions.push(`<button type="button" data-action="copy-manual" title="${escapeHtml$3(copyText("panel.action.copy-manual-title", l))}">${escapeHtml$3(copyText("panel.action.copy-manual", l))}</button>`);
|
|
4939
5147
|
if (b.kind === "restart") actions.push(`<button type="button" data-action="restart-hint" title="${escapeHtml$3(copyText("panel.action.restart-host-title", l))}">${escapeHtml$3(copyText("panel.action.restart-host", l))}</button>`);
|
|
4940
|
-
|
|
5148
|
+
const failureForFallback = input.failure ?? null;
|
|
5149
|
+
const fallbackBlocked = b.kind === "failed" ? fallbackBlockedVersionOf(failureForFallback, pluginId) : null;
|
|
5150
|
+
const fallbackOfferRaw = input.fallbackOffer ?? null;
|
|
5151
|
+
const fallbackCandidate = fallbackBlocked && typeof fallbackOfferRaw?.candidate === "string" && fallbackOfferRaw.candidate.trim() ? fallbackOfferRaw.candidate.trim() : null;
|
|
5152
|
+
if (fallbackBlocked) {
|
|
5153
|
+
actions.push(fallbackCandidate ? `<button type="button" data-action="install-fallback-confirm" data-primary="1" title="${escapeHtml$3(copyText("panel.action.install-fallback-confirm-title", l))}"${macroBusy || fallbackBusy ? " disabled" : ""}>${escapeHtml$3(copyText("panel.action.install-fallback-confirm", l, { version: fallbackCandidate }))}</button>` : fallbackBusy ? `<button type="button" data-action="install-fallback" data-primary="1" disabled aria-busy="true" title="${escapeHtml$3(copyText("panel.action.install-fallback-title", l))}">${escapeHtml$3(copyText("panel.action.install-fallback", l))}</button>` : `<button type="button" data-action="install-fallback" data-primary="1" title="${escapeHtml$3(copyText("panel.action.install-fallback-title", l))}"${macroBusy ? " disabled" : ""}>${escapeHtml$3(copyText("panel.action.install-fallback", l))}</button>`);
|
|
5154
|
+
actions.push(`<button type="button" data-action="wait-latest" title="${escapeHtml$3(copyText("panel.action.wait-latest-title", l))}"${macroBusy || fallbackBusy ? " disabled" : ""}>${escapeHtml$3(copyText("panel.action.wait-latest", l))}</button>`);
|
|
5155
|
+
} else if (b.kind === "failed") actions.push(`<button type="button" data-action="dismiss-failure" title="${escapeHtml$3(copyText("panel.action.dismiss-title", l))}">${escapeHtml$3(copyText("panel.action.dismiss", l))}</button>`);
|
|
4941
5156
|
const failureRef = input.failure;
|
|
4942
5157
|
if (snapshot || b.kind === "failed" || !!failureRef) actions.push(`<button type="button" data-action="copy-diag" title="${escapeHtml$3(copyText("panel.action.copy-diag-title", l))}">${escapeHtml$3(copyText("panel.action.copy-diag", l))}</button>`);
|
|
4943
5158
|
actions.push("</div>");
|
|
@@ -5081,7 +5296,7 @@ ${UPDATE_PANEL_ARCHIVE_CSS}` : UPDATE_PANEL_CSS}</style>
|
|
|
5081
5296
|
${body}`;
|
|
5082
5297
|
}
|
|
5083
5298
|
//#endregion
|
|
5084
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
5299
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.6/node_modules/dsh-plugin-update/dist/entry.js
|
|
5085
5300
|
const UPDATE_ENTRY_CSS = [
|
|
5086
5301
|
".dsh-upd-entry{display:inline-flex;align-items:center;gap:8px;font:13px/1.6 var(--dsh-update-font-sans,system-ui,\"Microsoft YaHei\",sans-serif);font-size:var(--dsh-update-entry-font-size,13px);color:var(--dsh-update-text,#1f2937)}",
|
|
5087
5302
|
".dsh-upd-entry-btn{font:inherit;border:1px solid var(--dsh-update-border,#d1d5db);border-radius:var(--dsh-update-entry-border-radius,6px);",
|
|
@@ -5195,7 +5410,7 @@ ${body}`;
|
|
|
5195
5410
|
}
|
|
5196
5411
|
}
|
|
5197
5412
|
//#endregion
|
|
5198
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
5413
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.6/node_modules/dsh-plugin-update/dist/panel-batch.js
|
|
5199
5414
|
const BATCH_PANEL_POLL = {
|
|
5200
5415
|
defaultMs: 1500,
|
|
5201
5416
|
minMs: 250
|
|
@@ -6721,7 +6936,7 @@ ${body}`;
|
|
|
6721
6936
|
};
|
|
6722
6937
|
}
|
|
6723
6938
|
//#endregion
|
|
6724
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
6939
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.6/node_modules/dsh-plugin-update/dist/entry-batch.js
|
|
6725
6940
|
function isObject$1(value) {
|
|
6726
6941
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
6727
6942
|
}
|
|
@@ -10680,7 +10895,7 @@ ${body}`;
|
|
|
10680
10895
|
}, react.createElement("span", { style: S.morePkg }, row.pkg), react.createElement("span", { style: S.moreDesc }, row.desc), react.createElement("span", { style: S.moreIcon }, react.createElement(ExternalIcon, null)))));
|
|
10681
10896
|
}
|
|
10682
10897
|
/** 版本胶囊那一行字:只在这里拼一次,屏上与用例读的是同一串。 */
|
|
10683
|
-
const MANAGER_VERSION_TEXT = "dsh-life-pack · 0.3.
|
|
10898
|
+
const MANAGER_VERSION_TEXT = "dsh-life-pack · 0.3.66";
|
|
10684
10899
|
/** 右下角那本书离面板两沿的距离:用户口径「一直处于面板右下角、不随列表滑动消失」
|
|
10685
10900
|
* ⇒ sticky 吸附(面板相对,视口多大都落在面板角上);INSET=右沿,BOTTOM=底沿。 */
|
|
10686
10901
|
const MANUAL_ENTRY_INSET = 16;
|