dsh-life-pack 0.3.59 → 0.3.60

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 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.0/node_modules/dsh-plugin-update/dist/config.js
474
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/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) + ")");
@@ -492,7 +492,7 @@ window.__ModuleLoader__.load({
492
492
  return buildPhoneNames(prefix).logAppend;
493
493
  }
494
494
  //#endregion
495
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.0/node_modules/dsh-plugin-update/dist/redaction.js
495
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/redaction.js
496
496
  const COPY_BUDGET_CHARS = 1500;
497
497
  const REDACTED_PATH = "<路径>";
498
498
  const REDACTED_SECRET = "<脱敏>";
@@ -556,7 +556,7 @@ window.__ModuleLoader__.load({
556
556
  return truncateForCopy(scrubWithoutBudget(flat));
557
557
  }
558
558
  //#endregion
559
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.0/node_modules/dsh-plugin-update/dist/service.js
559
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/service.js
560
560
  function updateError(code) {
561
561
  return Object.assign(new Error(code), { code });
562
562
  }
@@ -643,7 +643,7 @@ window.__ModuleLoader__.load({
643
643
  return 0;
644
644
  }
645
645
  //#endregion
646
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.0/node_modules/dsh-plugin-update/dist/lang.js
646
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/lang.js
647
647
  function normalizeLangTag(tag) {
648
648
  if (typeof tag !== "string") return "zh";
649
649
  const s = tag.trim().toLowerCase().replace(/_/g, "-");
@@ -785,7 +785,7 @@ window.__ModuleLoader__.load({
785
785
  };
786
786
  }
787
787
  //#endregion
788
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.0/node_modules/dsh-plugin-update/dist/bilingual.js
788
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/bilingual.js
789
789
  const BILINGUAL_STRINGS = {
790
790
  "entry.label.idle": {
791
791
  en: "Check for updates",
@@ -2432,7 +2432,7 @@ window.__ModuleLoader__.load({
2432
2432
  }
2433
2433
  const BILINGUAL_CSS = [".dsh-upd-bi{display:inline;overflow-wrap:anywhere}", ".dsh-upd-bi [lang]{overflow-wrap:anywhere}"].join("\n");
2434
2434
  //#endregion
2435
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.0/node_modules/dsh-plugin-update/dist/changelog.js
2435
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/changelog.js
2436
2436
  const CHANGELOG_MAX_CHARS = 65536;
2437
2437
  const CHANGELOG_ALL_CATEGORIES = [
2438
2438
  "Added",
@@ -3540,7 +3540,7 @@ ${note}${blocks.join("\n")}
3540
3540
  }
3541
3541
  }
3542
3542
  //#endregion
3543
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.0/node_modules/dsh-plugin-update/dist/log-events.js
3543
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/log-events.js
3544
3544
  const LOG_EVENT_CALL = "host.call";
3545
3545
  const LOG_EVENT_CALL_FAIL = "host.call.fail";
3546
3546
  const LOG_EVENT_INSTALL_EXEC = "update.install.exec";
@@ -3791,7 +3791,7 @@ ${note}${blocks.join("\n")}
3791
3791
  };
3792
3792
  }
3793
3793
  //#endregion
3794
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.0/node_modules/dsh-plugin-update/dist/codes.js
3794
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/codes.js
3795
3795
  const BLOCKED_REASONS = [
3796
3796
  "unknown-profile",
3797
3797
  "channel-mismatch",
@@ -3825,7 +3825,7 @@ ${note}${blocks.join("\n")}
3825
3825
  return typeof code === "string" && isOneOf(CHECK_SIDE_FAILURE_CODES, code.trim());
3826
3826
  }
3827
3827
  //#endregion
3828
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.0/node_modules/dsh-plugin-update/dist/panel.js
3828
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/panel.js
3829
3829
  function normalizePanelTheme(value) {
3830
3830
  return value === "archive" ? "archive" : "default";
3831
3831
  }
@@ -4048,6 +4048,29 @@ ${note}${blocks.join("\n")}
4048
4048
  if (typeof fallback === "string" && fallback.trim()) return fallback.trim();
4049
4049
  return INTERNAL_CODE;
4050
4050
  }
4051
+ function replyIsCheckExpired(reply) {
4052
+ if (!reply || typeof reply !== "object") return false;
4053
+ const kind = reply["errorKind"];
4054
+ if (typeof kind === "string" && kind.trim() === "check-expired") return true;
4055
+ const err = reply["error"];
4056
+ return typeof err === "string" && err.trim() === "check-expired";
4057
+ }
4058
+ function thrownIsCheckExpired(err) {
4059
+ if (typeof err === "string") return err.trim() === "check-expired";
4060
+ if (err instanceof Error) {
4061
+ if (err.message.trim() === "check-expired") return true;
4062
+ const code = err.code;
4063
+ return typeof code === "string" && code.trim() === "check-expired";
4064
+ }
4065
+ if (err && typeof err === "object" && !Array.isArray(err)) {
4066
+ const rec = err;
4067
+ const e = typeof rec["error"] === "string" ? rec["error"].trim() : "";
4068
+ const k = typeof rec["errorKind"] === "string" ? rec["errorKind"].trim() : "";
4069
+ const c = typeof rec["code"] === "string" ? rec["code"].trim() : "";
4070
+ return e === "check-expired" || k === "check-expired" || c === "check-expired";
4071
+ }
4072
+ return false;
4073
+ }
4051
4074
  function redactForCopy(text) {
4052
4075
  return sanitizeForCopy(text);
4053
4076
  }
@@ -5037,7 +5060,7 @@ ${UPDATE_PANEL_ARCHIVE_CSS}` : UPDATE_PANEL_CSS}</style>
5037
5060
  ${body}`;
5038
5061
  }
5039
5062
  //#endregion
5040
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.0/node_modules/dsh-plugin-update/dist/entry.js
5063
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/entry.js
5041
5064
  const UPDATE_ENTRY_CSS = [
5042
5065
  ".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)}",
5043
5066
  ".dsh-upd-entry-btn{font:inherit;border:1px solid var(--dsh-update-border,#d1d5db);border-radius:var(--dsh-update-entry-border-radius,6px);",
@@ -5151,7 +5174,7 @@ ${body}`;
5151
5174
  }
5152
5175
  }
5153
5176
  //#endregion
5154
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.0/node_modules/dsh-plugin-update/dist/panel-batch.js
5177
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/panel-batch.js
5155
5178
  const BATCH_PANEL_POLL = {
5156
5179
  defaultMs: 1500,
5157
5180
  minMs: 250
@@ -6670,7 +6693,7 @@ ${body}`;
6670
6693
  };
6671
6694
  }
6672
6695
  //#endregion
6673
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.0/node_modules/dsh-plugin-update/dist/entry-batch.js
6696
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/entry-batch.js
6674
6697
  function isObject$1(value) {
6675
6698
  return !!value && typeof value === "object" && !Array.isArray(value);
6676
6699
  }
@@ -7585,93 +7608,93 @@ ${body}`;
7585
7608
  }
7586
7609
  }
7587
7610
  async function doInstall() {
7588
- if (!receipt) try {
7589
- const checked = await call(phoneNames.updateCheck, queueArgs());
7590
- if (!mounted) return;
7591
- applyStatusReply(checked, "check");
7592
- } catch (err) {
7611
+ for (let attempt = 0; attempt < 2; attempt += 1) {
7612
+ if (!receipt) {
7613
+ const prevLatch = latch;
7614
+ try {
7615
+ const checked = await call(phoneNames.updateCheck, queueArgs());
7616
+ if (!mounted) return;
7617
+ applyStatusReply(checked, "check");
7618
+ } catch (err) {
7619
+ if (!mounted) return;
7620
+ if (thrownBusy(err)) {
7621
+ await refresh();
7622
+ return;
7623
+ }
7624
+ const env = currentEnvPair();
7625
+ setLatch({
7626
+ code: "check-failed",
7627
+ kind: null,
7628
+ detail: thrownDetail(err),
7629
+ diag: null,
7630
+ requestId: null,
7631
+ checkId: null,
7632
+ runningVersion: snapshot?.runningVersion ?? null,
7633
+ installedVersion: snapshot?.installedVersion ?? null,
7634
+ latestVersion: snapshot?.latestVersion ?? null,
7635
+ targetVersion: null,
7636
+ hostKind: env.hostKind,
7637
+ profileName: env.profileName,
7638
+ source: "check",
7639
+ volatile: false,
7640
+ atMs: latchNow()
7641
+ });
7642
+ return;
7643
+ }
7644
+ if (!mounted) return;
7645
+ if (!receipt) {
7646
+ if (latch === prevLatch) clearLatch();
7647
+ return;
7648
+ }
7649
+ }
7593
7650
  if (!mounted) return;
7594
- if (thrownBusy(err)) {
7595
- await refresh();
7651
+ requestId = randomRequestId();
7652
+ pollCount = 0;
7653
+ pollCapped = false;
7654
+ let reply;
7655
+ try {
7656
+ reply = await call(phoneNames.updateInstall, {
7657
+ checkId: receipt.checkId,
7658
+ requestId,
7659
+ ...queueArgs()
7660
+ });
7661
+ } catch (err) {
7662
+ if (!mounted) return;
7663
+ if (thrownBusy(err)) {
7664
+ await refresh();
7665
+ return;
7666
+ }
7667
+ if (thrownIsCheckExpired(err) && attempt === 0) {
7668
+ receipt = null;
7669
+ continue;
7670
+ }
7671
+ const env = currentEnvPair();
7672
+ setLatch({
7673
+ code: "install-failed",
7674
+ kind: null,
7675
+ detail: thrownDetail(err),
7676
+ diag: null,
7677
+ requestId,
7678
+ checkId: receipt?.checkId ?? null,
7679
+ runningVersion: snapshot?.runningVersion ?? null,
7680
+ installedVersion: snapshot?.installedVersion ?? null,
7681
+ latestVersion: snapshot?.latestVersion ?? null,
7682
+ targetVersion: null,
7683
+ hostKind: env.hostKind,
7684
+ profileName: env.profileName,
7685
+ source: "install",
7686
+ volatile: false,
7687
+ atMs: latchNow()
7688
+ });
7596
7689
  return;
7597
7690
  }
7598
- const env = currentEnvPair();
7599
- setLatch({
7600
- code: "check-failed",
7601
- kind: null,
7602
- detail: thrownDetail(err),
7603
- diag: null,
7604
- requestId: null,
7605
- checkId: null,
7606
- runningVersion: snapshot?.runningVersion ?? null,
7607
- installedVersion: snapshot?.installedVersion ?? null,
7608
- latestVersion: snapshot?.latestVersion ?? null,
7609
- targetVersion: null,
7610
- hostKind: env.hostKind,
7611
- profileName: env.profileName,
7612
- source: "check",
7613
- volatile: false,
7614
- atMs: latchNow()
7615
- });
7616
- return;
7617
- }
7618
- if (!mounted) return;
7619
- if (!receipt) {
7620
- const env = currentEnvPair();
7621
- setLatch({
7622
- code: "check-expired",
7623
- kind: "check-expired",
7624
- detail: null,
7625
- diag: null,
7626
- requestId,
7627
- checkId: null,
7628
- runningVersion: snapshot?.runningVersion ?? null,
7629
- installedVersion: snapshot?.installedVersion ?? null,
7630
- latestVersion: snapshot?.latestVersion ?? null,
7631
- targetVersion: null,
7632
- hostKind: env.hostKind,
7633
- profileName: env.profileName,
7634
- source: "install",
7635
- volatile: false,
7636
- atMs: latchNow()
7637
- });
7638
- return;
7639
- }
7640
- requestId = randomRequestId();
7641
- pollCount = 0;
7642
- pollCapped = false;
7643
- try {
7644
- const reply = await call(phoneNames.updateInstall, {
7645
- checkId: receipt.checkId,
7646
- requestId,
7647
- ...queueArgs()
7648
- });
7649
7691
  if (!mounted) return;
7650
- applyStatusReply(reply, "install");
7651
- } catch (err) {
7652
- if (!mounted) return;
7653
- if (thrownBusy(err)) {
7654
- await refresh();
7655
- return;
7692
+ if (replyIsCheckExpired(reply) && attempt === 0) {
7693
+ receipt = null;
7694
+ continue;
7656
7695
  }
7657
- const env = currentEnvPair();
7658
- setLatch({
7659
- code: "install-failed",
7660
- kind: null,
7661
- detail: thrownDetail(err),
7662
- diag: null,
7663
- requestId,
7664
- checkId: receipt?.checkId ?? null,
7665
- runningVersion: snapshot?.runningVersion ?? null,
7666
- installedVersion: snapshot?.installedVersion ?? null,
7667
- latestVersion: snapshot?.latestVersion ?? null,
7668
- targetVersion: null,
7669
- hostKind: env.hostKind,
7670
- profileName: env.profileName,
7671
- source: "install",
7672
- volatile: false,
7673
- atMs: latchNow()
7674
- });
7696
+ applyStatusReply(reply, "install");
7697
+ return;
7675
7698
  }
7676
7699
  }
7677
7700
  function diagText() {
@@ -10619,7 +10642,7 @@ ${body}`;
10619
10642
  }, 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)))));
10620
10643
  }
10621
10644
  /** 版本胶囊那一行字:只在这里拼一次,屏上与用例读的是同一串。 */
10622
- const MANAGER_VERSION_TEXT = "dsh-life-pack · 0.3.59";
10645
+ const MANAGER_VERSION_TEXT = "dsh-life-pack · 0.3.60";
10623
10646
  /** 右下角那本书离面板两沿的距离:用户口径「一直处于面板右下角、不随列表滑动消失」
10624
10647
  * ⇒ sticky 吸附(面板相对,视口多大都落在面板角上);INSET=右沿,BOTTOM=底沿。 */
10625
10648
  const MANUAL_ENTRY_INSET = 16;