@max-null/dsh-plugin-center 0.1.3 → 0.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/client.js CHANGED
@@ -163,8 +163,8 @@ var installedCache = null;
163
163
  var marketCache = {};
164
164
  var toastState = null;
165
165
  var toastListeners = /* @__PURE__ */ new Set();
166
- function showToast(message, kind = "ok") {
167
- toastState = { message, kind };
166
+ function showToast(message, kind = "ok", duration = 3200) {
167
+ toastState = { message, kind, until: Date.now() + duration };
168
168
  toastListeners.forEach((l) => l());
169
169
  }
170
170
  var pendingInstall = /* @__PURE__ */ new Set();
@@ -184,7 +184,7 @@ function useToast() {
184
184
  const id = setTimeout(() => {
185
185
  toastState = null;
186
186
  toastListeners.forEach((l) => l());
187
- }, 3200);
187
+ }, Math.max(0, t.until - Date.now()));
188
188
  return () => clearTimeout(id);
189
189
  }, [t]);
190
190
  return t;
@@ -451,11 +451,11 @@ function MarketView({ category, single, source, search, onCount }) {
451
451
  if (c !== void 0) c.plugins = c.plugins.map((p) => p.name === m.name ? { ...p, installed: true } : p);
452
452
  }
453
453
  setItems((prev) => prev.map((p) => p.name === m.name ? { ...p, installed: true } : p));
454
- showToast(t("installQueued", { n: m.name }));
454
+ showToast(t("installQueued", { n: m.name }), "ok", 5e3);
455
455
  },
456
456
  (e) => {
457
457
  setBusy(null);
458
- showToast(t("installFailed", { e: e instanceof Error ? e.message : String(e) }), "error");
458
+ showToast(t("installFailed", { e: e instanceof Error ? e.message : String(e) }), "error", 8e3);
459
459
  }
460
460
  );
461
461
  };
@@ -527,7 +527,11 @@ function CenterPanel({ variant = "section" }) {
527
527
  void rpc("checkUpdates", { since: new Date(Date.now() - 30 * 864e5).toISOString() }).then(
528
528
  (v) => {
529
529
  const digests = v;
530
- setUpdates(digests);
530
+ setUpdates((prev) => digests.map((d) => {
531
+ if (d.changelog.length > 0) return d;
532
+ const old = prev?.find((p) => p.name === d.name);
533
+ return old !== void 0 && old.changelog.length > 0 ? { ...d, changelog: old.changelog } : d;
534
+ }));
531
535
  setChecking(false);
532
536
  if (!silent) {
533
537
  showToast(digests.length > 0 ? t("foundUpdates", { n: digests.length }) : t("allUpToDate"));
@@ -582,11 +586,11 @@ function CenterPanel({ variant = "section" }) {
582
586
  (v) => {
583
587
  if (v !== true) throw new Error(t("updateNotApplied"));
584
588
  setBusyUpdate(null);
585
- showToast(t("updatedOne", { n: name }));
589
+ showToast(t("updatedOne", { n: name }), "ok", 5e3);
586
590
  },
587
591
  (e) => {
588
592
  setBusyUpdate(null);
589
- showToast(t("updateFailed", { e: e instanceof Error ? e.message : String(e) }), "error");
593
+ showToast(t("updateFailed", { e: e instanceof Error ? e.message : String(e) }), "error", 8e3);
590
594
  }
591
595
  );
592
596
  };
@@ -594,21 +598,23 @@ function CenterPanel({ variant = "section" }) {
594
598
  if (updates === null || updates.length === 0) return;
595
599
  setBusyUpdate("__all__");
596
600
  let okCount = 0;
601
+ const okNames = [];
597
602
  const failures = [];
598
603
  for (const u of updates) {
599
604
  try {
600
605
  const v = await rpc("update", { name: u.name });
601
606
  if (v !== true) throw new Error(t("updateNotApplied"));
602
607
  okCount++;
608
+ okNames.push(u.name);
603
609
  } catch (e) {
604
610
  failures.push(`${u.name}\uFF1A${e instanceof Error ? e.message : String(e)}`);
605
611
  }
606
612
  }
607
613
  setBusyUpdate(null);
608
614
  if (failures.length === 0) {
609
- showToast(t("updatedMany", { n: okCount }));
615
+ showToast(t("updatedMany", { n: okCount }) + `\uFF08${okNames.join("\u3001")}\uFF09`, "ok", 6e3);
610
616
  } else {
611
- showToast(t("updateSummary", { a: okCount, b: failures.length, c: failures.join("\uFF1B") }), "error");
617
+ showToast(t("updateSummary", { a: okCount, b: failures.length, c: failures.join("\uFF1B") }), "error", 8e3);
612
618
  }
613
619
  refreshUpdates();
614
620
  };
@@ -758,10 +764,10 @@ function WhatsNewDialog() {
758
764
  }
759
765
  setBusy(false);
760
766
  if (failures.length === 0) {
761
- showToast(t("updatedMany", { n: okCount }));
767
+ showToast(t("updatedMany", { n: okCount }), "ok", 6e3);
762
768
  closeWhatsNew();
763
769
  } else {
764
- showToast(t("updateSummary", { a: okCount, b: failures.length, c: failures.join("\uFF1B") }), "error");
770
+ showToast(t("updateSummary", { a: okCount, b: failures.length, c: failures.join("\uFF1B") }), "error", 8e3);
765
771
  }
766
772
  };
767
773
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pc-overlay", role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pc-panel", style: { width: "540px" }, role: "dialog", "aria-modal": "true", "aria-label": t("whatsNewTitle"), children: [
package/dist/update.js CHANGED
@@ -87,8 +87,9 @@ function runOne(command, args, cwd) {
87
87
  return new Promise((resolve) => {
88
88
  let child;
89
89
  try {
90
- // shell: true —— Windows 下 .cmd shim 必须经 shell 才能 spawn
91
- child = spawn(command, [...args], { cwd, stdio: 'inherit', shell: true });
90
+ // shell: true —— Windows 下 .cmd shim 必须经 shell 才能 spawn
91
+ // windowsHide —— GUI 宿主下不弹 cmd 窗口(2026-08-18 用户实测闪烁)。
92
+ child = spawn(command, [...args], { cwd, stdio: 'inherit', shell: true, windowsHide: true });
92
93
  }
93
94
  catch (e) {
94
95
  resolve({ ok: false, detail: e instanceof Error ? e.message : String(e) });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@max-null/dsh-plugin-center",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Plugin center for DeepSeek Harness — installed metadata, community market, update detection, and What's New",
5
5
  "license": "MIT",
6
6
  "publishConfig": {