@dan-ai-studio/dshopencodego 0.1.27 → 0.1.29

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/lib/client.js CHANGED
@@ -159,6 +159,7 @@ function parseUpdateStatus(value) {
159
159
  if (typeof row["current"] !== "string") throw new Error("invalid update reading");
160
160
  if (row["latest"] !== void 0 && typeof row["latest"] !== "string") throw new Error("invalid update reading");
161
161
  if (typeof row["available"] !== "boolean") throw new Error("invalid update reading");
162
+ if (typeof row["checked"] !== "boolean") throw new Error("invalid update reading");
162
163
  if (typeof row["checkedAt"] !== "number" || !Number.isFinite(row["checkedAt"])) {
163
164
  throw new Error("invalid update reading");
164
165
  }
@@ -166,7 +167,8 @@ function parseUpdateStatus(value) {
166
167
  current: row["current"],
167
168
  latest: typeof row["latest"] === "string" ? row["latest"] : void 0,
168
169
  available: row["available"],
169
- checkedAt: row["checkedAt"]
170
+ checkedAt: row["checkedAt"],
171
+ checked: row["checked"]
170
172
  };
171
173
  }
172
174
  var codec2 = (typeSymbol, parse) => ({
@@ -367,6 +369,9 @@ var en = {
367
369
  updateFailed: "Update failed:",
368
370
  updateRemoteMissing: "The update service is not ready yet; choose Check again to retry.",
369
371
  updateNoManager: "This composition has no plugin manager, so the update cannot be applied from here; update the package from the plugin manager page.",
372
+ updateUnreachable: "Could not reach the npm registry, so no version information was read; choose Check again to retry.",
373
+ updateNotBundle: "The published target does not declare a DSH bundle; the installed version was left untouched.",
374
+ updateInspectRefused: "The published target could not be verified, so the installed version was left untouched:",
370
375
  updateStopProfile: "The running version cannot be removed without a restart; restart DSH first, then retry.",
371
376
  updateIncompatible: "The new version is incompatible with this DSH build; finish the update from the plugin manager page (a version exemption needs your explicit approval).",
372
377
  updatePendingBuilds: "Installation needs build-script approval; approve it on the plugin manager page, then retry."
@@ -454,6 +459,9 @@ var zh = {
454
459
  updateFailed: "\u66F4\u65B0\u5931\u8D25\uFF1A",
455
460
  updateRemoteMissing: "\u66F4\u65B0\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF1B\u8BF7\u70B9\u51FB\u201C\u91CD\u65B0\u68C0\u67E5\u201D\u91CD\u8BD5\u3002",
456
461
  updateNoManager: "\u5F53\u524D\u7EC4\u5408\u6CA1\u6709\u63D2\u4EF6\u7BA1\u7406\u5668\uFF0C\u65E0\u6CD5\u5728\u6B64\u5E94\u7528\u66F4\u65B0\uFF1B\u8BF7\u524D\u5F80\u63D2\u4EF6\u7BA1\u7406\u9875\u66F4\u65B0\u3002",
462
+ updateUnreachable: "\u65E0\u6CD5\u8BBF\u95EE npm registry\uFF0C\u672A\u83B7\u53D6\u5230\u7248\u672C\u4FE1\u606F\uFF1B\u8BF7\u70B9\u51FB\u201C\u91CD\u65B0\u68C0\u67E5\u201D\u91CD\u8BD5\u3002",
463
+ updateNotBundle: "\u53D1\u5E03\u7684\u76EE\u6807\u4E0D\u662F DSH \u63D2\u4EF6\u5305\uFF0C\u5DF2\u4FDD\u7559\u5F53\u524D\u7248\u672C\u672A\u505A\u6539\u52A8\u3002",
464
+ updateInspectRefused: "\u65E0\u6CD5\u9A8C\u8BC1\u53D1\u5E03\u7684\u76EE\u6807\uFF0C\u5DF2\u4FDD\u7559\u5F53\u524D\u7248\u672C\u672A\u505A\u6539\u52A8\uFF1A",
457
465
  updateStopProfile: "\u8FD0\u884C\u4E2D\u7684\u7248\u672C\u9700\u91CD\u542F\u540E\u624D\u80FD\u79FB\u9664\uFF1B\u8BF7\u5148\u91CD\u542F DSH \u518D\u91CD\u8BD5\u3002",
458
466
  updateIncompatible: "\u65B0\u7248\u672C\u4E0E\u5F53\u524D DSH \u4E0D\u517C\u5BB9\uFF0C\u8BF7\u524D\u5F80\u63D2\u4EF6\u7BA1\u7406\u9875\u5B8C\u6210\u66F4\u65B0\uFF08\u7248\u672C\u8C41\u514D\u9700\u660E\u786E\u6279\u51C6\uFF09\u3002",
459
467
  updatePendingBuilds: "\u5B89\u88C5\u9700\u8981\u6279\u51C6\u6784\u5EFA\u811A\u672C\uFF1B\u8BF7\u524D\u5F80\u63D2\u4EF6\u7BA1\u7406\u9875\u6279\u51C6\u540E\u518D\u91CD\u8BD5\u3002"
@@ -554,7 +562,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id) + "]")
554
562
  style.textContent = ".d7lz0W_root{color:var(--dsw-alias-label-primary);flex-direction:column;gap:1.25rem;display:flex}.d7lz0W_title{margin:0;font-size:1.05rem}.d7lz0W_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:.8rem}.d7lz0W_warn{color:var(--dsw-alias-state-warn-primary);margin:0;font-size:.8rem}.d7lz0W_ok{color:var(--dsw-alias-state-success-primary);font-size:.8rem}.d7lz0W_block{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:.6rem;flex-direction:column;gap:.5rem;padding:.85rem;display:flex}.d7lz0W_row{flex-wrap:wrap;align-items:center;gap:.5rem;display:flex}.d7lz0W_row>strong{margin-right:auto}.d7lz0W_input{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);min-width:10rem;color:var(--dsw-alias-label-primary);font:inherit;border-radius:.35rem;flex:14rem;padding:.35rem .5rem;font-size:.85rem}.d7lz0W_button{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;border-radius:.35rem;padding:.35rem .7rem;font-size:.8rem}.d7lz0W_button:disabled{color:var(--dsw-alias-state-idle-primary);cursor:default}.d7lz0W_number{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);width:5rem;color:var(--dsw-alias-label-primary);font:inherit;border-radius:.35rem;padding:.25rem .4rem;font-size:.8rem}.d7lz0W_select{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);width:auto;max-width:100%;color:var(--dsw-alias-label-primary);font:inherit;border-radius:.35rem;padding:.25rem .4rem;font-size:.8rem}.d7lz0W_list{flex-direction:column;display:flex}.d7lz0W_item{border-top:1px solid var(--dsw-alias-border-l1);align-items:flex-start;gap:.5rem;padding:.45rem .15rem;display:flex}.d7lz0W_item input[type=checkbox]{accent-color:var(--dsw-alias-brand-primary);margin-top:.15rem}.d7lz0W_itemBody{flex-direction:column;gap:.15rem;min-width:0;display:flex}.d7lz0W_itemMain{flex-wrap:wrap;align-items:baseline;gap:.6rem;display:flex}.d7lz0W_itemMeta{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;gap:.75rem;font-size:.75rem;display:flex}.d7lz0W_itemModalities{color:var(--dsw-alias-label-secondary);font-size:.75rem}.d7lz0W_name{color:var(--dsw-alias-label-primary)}.d7lz0W_mono{color:var(--dsw-alias-label-secondary);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.d7lz0W_badge{color:var(--dsw-alias-brand-primary)}";
555
563
  document.head.appendChild(style);
556
564
  }
557
- var section_default = { "title": "d7lz0W_title", "row": "d7lz0W_row", "number": "d7lz0W_number", "list": "d7lz0W_list", "itemMeta": "d7lz0W_itemMeta", "name": "d7lz0W_name", "input": "d7lz0W_input", "mono": "d7lz0W_mono", "root": "d7lz0W_root", "hint": "d7lz0W_hint", "ok": "d7lz0W_ok", "button": "d7lz0W_button", "item": "d7lz0W_item", "itemModalities": "d7lz0W_itemModalities", "warn": "d7lz0W_warn", "itemMain": "d7lz0W_itemMain", "select": "d7lz0W_select", "block": "d7lz0W_block", "badge": "d7lz0W_badge", "itemBody": "d7lz0W_itemBody" };
565
+ var section_default = { "root": "d7lz0W_root", "ok": "d7lz0W_ok", "badge": "d7lz0W_badge", "hint": "d7lz0W_hint", "block": "d7lz0W_block", "row": "d7lz0W_row", "number": "d7lz0W_number", "select": "d7lz0W_select", "itemModalities": "d7lz0W_itemModalities", "title": "d7lz0W_title", "list": "d7lz0W_list", "itemBody": "d7lz0W_itemBody", "itemMeta": "d7lz0W_itemMeta", "button": "d7lz0W_button", "itemMain": "d7lz0W_itemMain", "input": "d7lz0W_input", "mono": "d7lz0W_mono", "item": "d7lz0W_item", "warn": "d7lz0W_warn", "name": "d7lz0W_name" };
558
566
 
559
567
  // src/client/Section.tsx
560
568
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -689,9 +697,12 @@ var SectionController = class _SectionController {
689
697
  const status = result.value;
690
698
  this.set({
691
699
  update: {
692
- phase: status.available && status.latest !== void 0 ? "ready" : "current",
700
+ // An unanswered lookup is not "up to date": rendering the two alike
701
+ // would report an unreachable registry as a current version, which
702
+ // is the same silent lie that once hid this panel entirely.
703
+ phase: !status.checked ? "failed" : status.available && status.latest !== void 0 ? "ready" : "current",
693
704
  status,
694
- message: void 0
705
+ message: status.checked ? void 0 : "registry-unreachable"
695
706
  }
696
707
  });
697
708
  } catch (error) {
@@ -745,9 +756,14 @@ var SectionController = class _SectionController {
745
756
  this.set({ update: { phase: "failed", status, message } });
746
757
  };
747
758
  try {
748
- const inspected = await manager.inspect(spec);
759
+ const inspected = await manager.inspect(spec, {});
760
+ if (_SectionController.field(inspected, "status") === "refused") {
761
+ const reason = _SectionController.field(inspected, "reason");
762
+ fail(typeof reason === "string" && reason.length > 0 ? `inspect-refused: ${reason}` : "inspect-refused");
763
+ return;
764
+ }
749
765
  if (_SectionController.field(inspected, "bundle") === false) {
750
- fail(`the registry target is not a DSH bundle: ${spec}`);
766
+ fail("not-a-bundle");
751
767
  return;
752
768
  }
753
769
  } catch (error) {
@@ -1041,6 +1057,12 @@ function updateFailureText(message, t) {
1041
1057
  if (message === void 0 || message.length === 0) return "";
1042
1058
  if (message === "remote-not-mounted") return t("updateRemoteMissing");
1043
1059
  if (message === "no-plugin-manager") return t("updateNoManager");
1060
+ if (message === "registry-unreachable") return t("updateUnreachable");
1061
+ if (message === "not-a-bundle") return t("updateNotBundle");
1062
+ if (message === "inspect-refused" || message.startsWith("inspect-refused: ")) {
1063
+ const detail = message.slice("inspect-refused: ".length);
1064
+ return detail.length > 0 && detail !== "inspect-refused" ? `${t("updateInspectRefused")} ${detail}` : t("updateInspectRefused");
1065
+ }
1044
1066
  if (message === "stop-profile") return t("updateStopProfile");
1045
1067
  if (message === "incompatible-version") return t("updateIncompatible");
1046
1068
  if (message === "pending-builds") return t("updatePendingBuilds");
@@ -1313,7 +1335,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id2) + "]"
1313
1335
  style.textContent = ".mMNkkW_root{align-items:center;display:inline-flex;position:relative}.mMNkkW_trigger{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;white-space:nowrap;border-radius:999px;padding:.35rem .6rem;font-size:.8rem;line-height:1}.mMNkkW_trigger:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-border-l2)}.mMNkkW_panel{z-index:20;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-overlay);width:18rem;color:var(--dsw-alias-label-primary);border-radius:.6rem;flex-direction:column;gap:.6rem;padding:.75rem .85rem;display:flex;position:absolute;bottom:calc(100% + .5rem);right:0;box-shadow:0 8px 24px #0000002e}.mMNkkW_window{flex-direction:column;gap:.25rem;display:flex}.mMNkkW_row{justify-content:space-between;gap:.5rem;font-size:.85rem;display:flex}.mMNkkW_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:.75rem}.mMNkkW_progress{width:100%;height:.35rem;accent-color:var(--dsw-alias-brand-primary)}.mMNkkW_limited{color:var(--dsw-alias-state-warn-primary);font-size:.75rem}.mMNkkW_warning{border:1px solid var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-label-primary);border-radius:.4rem;padding:.4rem .5rem;font-size:.75rem}.mMNkkW_retry{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;border-radius:.35rem;align-self:flex-start;padding:.25rem .5rem;font-size:.75rem}.mMNkkW_local{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;gap:.2rem;padding-top:.5rem;display:flex}";
1314
1336
  document.head.appendChild(style);
1315
1337
  }
1316
- var pill_default = { "progress": "mMNkkW_progress", "local": "mMNkkW_local", "panel": "mMNkkW_panel", "hint": "mMNkkW_hint", "limited": "mMNkkW_limited", "window": "mMNkkW_window", "trigger": "mMNkkW_trigger", "retry": "mMNkkW_retry", "warning": "mMNkkW_warning", "row": "mMNkkW_row", "root": "mMNkkW_root" };
1338
+ var pill_default = { "root": "mMNkkW_root", "trigger": "mMNkkW_trigger", "hint": "mMNkkW_hint", "warning": "mMNkkW_warning", "progress": "mMNkkW_progress", "retry": "mMNkkW_retry", "local": "mMNkkW_local", "panel": "mMNkkW_panel", "row": "mMNkkW_row", "limited": "mMNkkW_limited", "window": "mMNkkW_window" };
1317
1339
 
1318
1340
  // src/client/UsagePill.tsx
1319
1341
  var import_jsx_runtime2 = require("react/jsx-runtime");
package/lib/index.js CHANGED
@@ -1774,6 +1774,7 @@ function parseUpdateStatus(value) {
1774
1774
  if (typeof row["current"] !== "string") throw new Error("invalid update reading");
1775
1775
  if (row["latest"] !== void 0 && typeof row["latest"] !== "string") throw new Error("invalid update reading");
1776
1776
  if (typeof row["available"] !== "boolean") throw new Error("invalid update reading");
1777
+ if (typeof row["checked"] !== "boolean") throw new Error("invalid update reading");
1777
1778
  if (typeof row["checkedAt"] !== "number" || !Number.isFinite(row["checkedAt"])) {
1778
1779
  throw new Error("invalid update reading");
1779
1780
  }
@@ -1781,7 +1782,8 @@ function parseUpdateStatus(value) {
1781
1782
  current: row["current"],
1782
1783
  latest: typeof row["latest"] === "string" ? row["latest"] : void 0,
1783
1784
  available: row["available"],
1784
- checkedAt: row["checkedAt"]
1785
+ checkedAt: row["checkedAt"],
1786
+ checked: row["checked"]
1785
1787
  };
1786
1788
  }
1787
1789
  var codec2 = (typeSymbol, parse) => ({
@@ -2059,10 +2061,11 @@ function createUpdateChecker(deps) {
2059
2061
  current: deps.currentVersion,
2060
2062
  latest,
2061
2063
  available: isUpdateAvailable(deps.currentVersion, latest),
2062
- checkedAt
2064
+ checkedAt,
2065
+ checked: true
2063
2066
  };
2064
2067
  } catch {
2065
- return { current: deps.currentVersion, latest: void 0, available: false, checkedAt };
2068
+ return { current: deps.currentVersion, latest: void 0, available: false, checkedAt, checked: false };
2066
2069
  }
2067
2070
  }
2068
2071
  return {
@@ -2079,7 +2082,7 @@ function createUpdateChecker(deps) {
2079
2082
  }
2080
2083
 
2081
2084
  // src/update/version.ts
2082
- var PLUGIN_VERSION = true ? "0.1.27" : "0.0.0-dev";
2085
+ var PLUGIN_VERSION = true ? "0.1.29" : "0.0.0-dev";
2083
2086
 
2084
2087
  // src/update/service.ts
2085
2088
  import { TypertRemoteService as TypertRemoteService2 } from "@deepseek-ai/dsh-typert-protocol";
@@ -33,6 +33,15 @@ export interface UpdateStatus {
33
33
  readonly available: boolean;
34
34
  /** Milliseconds since the epoch of the lookup backing this reading. */
35
35
  readonly checkedAt: number;
36
+ /**
37
+ * Whether the registry actually answered.
38
+ *
39
+ * `false` means the reading is a placeholder for a failed lookup: "no update
40
+ * known", which is not the same fact as "up to date". The page must not
41
+ * render the two alike — reporting an unreachable registry as a current
42
+ * version is a silent lie of exactly the kind that hid the update panel.
43
+ */
44
+ readonly checked: boolean;
36
45
  }
37
46
  interface ParsedVersion {
38
47
  readonly core: readonly number[];
@@ -111,10 +111,13 @@ export function createUpdateChecker(deps) {
111
111
  latest,
112
112
  available: isUpdateAvailable(deps.currentVersion, latest),
113
113
  checkedAt,
114
+ checked: true,
114
115
  };
115
116
  }
116
117
  catch {
117
- return { current: deps.currentVersion, latest: undefined, available: false, checkedAt };
118
+ // The lookup failed, so no version is known. `checked: false` keeps that
119
+ // distinguishable from a confirmed "already latest" reading.
120
+ return { current: deps.currentVersion, latest: undefined, available: false, checkedAt, checked: false };
118
121
  }
119
122
  }
120
123
  return {
@@ -18,6 +18,8 @@ export function parseUpdateStatus(value) {
18
18
  throw new Error('invalid update reading');
19
19
  if (typeof row['available'] !== 'boolean')
20
20
  throw new Error('invalid update reading');
21
+ if (typeof row['checked'] !== 'boolean')
22
+ throw new Error('invalid update reading');
21
23
  if (typeof row['checkedAt'] !== 'number' || !Number.isFinite(row['checkedAt'])) {
22
24
  throw new Error('invalid update reading');
23
25
  }
@@ -26,6 +28,7 @@ export function parseUpdateStatus(value) {
26
28
  latest: typeof row['latest'] === 'string' ? row['latest'] : undefined,
27
29
  available: row['available'],
28
30
  checkedAt: row['checkedAt'],
31
+ checked: row['checked'],
29
32
  };
30
33
  }
31
34
  /** Codec shape accepted by both released and source DSH builds. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dan-ai-studio/dshopencodego",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "OpenCode Go provider for DeepSeek Harness: live gateway catalog, per-conversation session header, usage",
5
5
  "type": "module",
6
6
  "license": "MIT",