@dan-ai-studio/dshopencodego 0.1.28 → 0.1.30

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
@@ -370,6 +370,8 @@ var en = {
370
370
  updateRemoteMissing: "The update service is not ready yet; choose Check again to retry.",
371
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
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:",
373
375
  updateStopProfile: "The running version cannot be removed without a restart; restart DSH first, then retry.",
374
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).",
375
377
  updatePendingBuilds: "Installation needs build-script approval; approve it on the plugin manager page, then retry."
@@ -458,6 +460,8 @@ var zh = {
458
460
  updateRemoteMissing: "\u66F4\u65B0\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF1B\u8BF7\u70B9\u51FB\u201C\u91CD\u65B0\u68C0\u67E5\u201D\u91CD\u8BD5\u3002",
459
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",
460
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",
461
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",
462
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",
463
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"
@@ -558,7 +562,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id) + "]")
558
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)}";
559
563
  document.head.appendChild(style);
560
564
  }
561
- var section_default = { "itemBody": "d7lz0W_itemBody", "name": "d7lz0W_name", "itemMeta": "d7lz0W_itemMeta", "hint": "d7lz0W_hint", "row": "d7lz0W_row", "ok": "d7lz0W_ok", "input": "d7lz0W_input", "mono": "d7lz0W_mono", "badge": "d7lz0W_badge", "list": "d7lz0W_list", "item": "d7lz0W_item", "itemMain": "d7lz0W_itemMain", "number": "d7lz0W_number", "block": "d7lz0W_block", "itemModalities": "d7lz0W_itemModalities", "title": "d7lz0W_title", "root": "d7lz0W_root", "warn": "d7lz0W_warn", "button": "d7lz0W_button", "select": "d7lz0W_select" };
565
+ var section_default = { "name": "d7lz0W_name", "itemBody": "d7lz0W_itemBody", "itemMeta": "d7lz0W_itemMeta", "number": "d7lz0W_number", "block": "d7lz0W_block", "title": "d7lz0W_title", "root": "d7lz0W_root", "input": "d7lz0W_input", "button": "d7lz0W_button", "select": "d7lz0W_select", "ok": "d7lz0W_ok", "row": "d7lz0W_row", "mono": "d7lz0W_mono", "itemModalities": "d7lz0W_itemModalities", "badge": "d7lz0W_badge", "item": "d7lz0W_item", "list": "d7lz0W_list", "itemMain": "d7lz0W_itemMain", "hint": "d7lz0W_hint", "warn": "d7lz0W_warn" };
562
566
 
563
567
  // src/client/Section.tsx
564
568
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -752,9 +756,14 @@ var SectionController = class _SectionController {
752
756
  this.set({ update: { phase: "failed", status, message } });
753
757
  };
754
758
  try {
755
- 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
+ }
756
765
  if (_SectionController.field(inspected, "bundle") === false) {
757
- fail(`the registry target is not a DSH bundle: ${spec}`);
766
+ fail("not-a-bundle");
758
767
  return;
759
768
  }
760
769
  } catch (error) {
@@ -1049,6 +1058,11 @@ function updateFailureText(message, t) {
1049
1058
  if (message === "remote-not-mounted") return t("updateRemoteMissing");
1050
1059
  if (message === "no-plugin-manager") return t("updateNoManager");
1051
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
+ }
1052
1066
  if (message === "stop-profile") return t("updateStopProfile");
1053
1067
  if (message === "incompatible-version") return t("updateIncompatible");
1054
1068
  if (message === "pending-builds") return t("updatePendingBuilds");
@@ -1321,7 +1335,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id2) + "]"
1321
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}";
1322
1336
  document.head.appendChild(style);
1323
1337
  }
1324
- var pill_default = { "limited": "mMNkkW_limited", "panel": "mMNkkW_panel", "retry": "mMNkkW_retry", "warning": "mMNkkW_warning", "root": "mMNkkW_root", "window": "mMNkkW_window", "trigger": "mMNkkW_trigger", "progress": "mMNkkW_progress", "row": "mMNkkW_row", "hint": "mMNkkW_hint", "local": "mMNkkW_local" };
1338
+ var pill_default = { "warning": "mMNkkW_warning", "hint": "mMNkkW_hint", "limited": "mMNkkW_limited", "panel": "mMNkkW_panel", "row": "mMNkkW_row", "root": "mMNkkW_root", "progress": "mMNkkW_progress", "local": "mMNkkW_local", "window": "mMNkkW_window", "trigger": "mMNkkW_trigger", "retry": "mMNkkW_retry" };
1325
1339
 
1326
1340
  // src/client/UsagePill.tsx
1327
1341
  var import_jsx_runtime2 = require("react/jsx-runtime");
package/lib/index.js CHANGED
@@ -561,9 +561,10 @@ var OpencodeGoCatalog = class {
561
561
  * the id but this build cannot configure it, naming the reason.
562
562
  */
563
563
  async forModel(id) {
564
- const cached = this.served;
565
564
  let snapshot = await this.snapshot();
566
- if (!snapshot.facts.has(id) && snapshot === cached) snapshot = await this.snapshot(true);
565
+ if (!snapshot.facts.has(id) && !snapshot.unavailable.has(id)) {
566
+ snapshot = await this.snapshot(true);
567
+ }
567
568
  const reason = snapshot.unavailable.get(id);
568
569
  if (reason !== void 0) {
569
570
  throw new LlmError4(
@@ -2082,7 +2083,7 @@ function createUpdateChecker(deps) {
2082
2083
  }
2083
2084
 
2084
2085
  // src/update/version.ts
2085
- var PLUGIN_VERSION = true ? "0.1.28" : "0.0.0-dev";
2086
+ var PLUGIN_VERSION = true ? "0.1.30" : "0.0.0-dev";
2086
2087
 
2087
2088
  // src/update/service.ts
2088
2089
  import { TypertRemoteService as TypertRemoteService2 } from "@deepseek-ai/dsh-typert-protocol";
@@ -113,10 +113,21 @@ export class OpencodeGoCatalog {
113
113
  * the id but this build cannot configure it, naming the reason.
114
114
  */
115
115
  async forModel(id) {
116
- const cached = this.served;
117
116
  let snapshot = await this.snapshot();
118
- if (!snapshot.facts.has(id) && snapshot === cached)
117
+ // A snapshot that cannot serve this id forces one revalidation, because
118
+ // "this build has not seen the id" and "the id was just published" are
119
+ // indistinguishable from here.
120
+ //
121
+ // The condition must not compare the snapshot with what was cached before
122
+ // the await: on a cold catalog there is nothing cached, so that comparison
123
+ // was false and the revalidation was skipped — an id missing from the
124
+ // very first build then failed as UNKNOWN_MODEL instead of being retried.
125
+ // Presence in `unavailable` is a positive statement (the gateway
126
+ // advertises the id but this build cannot configure it), so it needs no
127
+ // revalidation and is reported below.
128
+ if (!snapshot.facts.has(id) && !snapshot.unavailable.has(id)) {
119
129
  snapshot = await this.snapshot(true);
130
+ }
120
131
  const reason = snapshot.unavailable.get(id);
121
132
  if (reason !== undefined) {
122
133
  throw new LlmError(`opencode-go model "${id}" is advertised but cannot be configured: ${reason};`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dan-ai-studio/dshopencodego",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
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",