@dan-ai-studio/dshopencodego 0.1.25 → 0.1.27
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 +41 -10
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -365,6 +365,8 @@ var en = {
|
|
|
365
365
|
updateDone: "Updated to",
|
|
366
366
|
updateRestart: "Restart DSH to finish applying the update.",
|
|
367
367
|
updateFailed: "Update failed:",
|
|
368
|
+
updateRemoteMissing: "The update service is not ready yet; choose Check again to retry.",
|
|
369
|
+
updateNoManager: "This composition has no plugin manager, so the update cannot be applied from here; update the package from the plugin manager page.",
|
|
368
370
|
updateStopProfile: "The running version cannot be removed without a restart; restart DSH first, then retry.",
|
|
369
371
|
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).",
|
|
370
372
|
updatePendingBuilds: "Installation needs build-script approval; approve it on the plugin manager page, then retry."
|
|
@@ -450,6 +452,8 @@ var zh = {
|
|
|
450
452
|
updateDone: "\u5DF2\u66F4\u65B0\u5230",
|
|
451
453
|
updateRestart: "\u8BF7\u91CD\u542F DSH \u4EE5\u5B8C\u6210\u66F4\u65B0\u3002",
|
|
452
454
|
updateFailed: "\u66F4\u65B0\u5931\u8D25\uFF1A",
|
|
455
|
+
updateRemoteMissing: "\u66F4\u65B0\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF1B\u8BF7\u70B9\u51FB\u201C\u91CD\u65B0\u68C0\u67E5\u201D\u91CD\u8BD5\u3002",
|
|
456
|
+
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",
|
|
453
457
|
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",
|
|
454
458
|
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",
|
|
455
459
|
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"
|
|
@@ -550,7 +554,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id) + "]")
|
|
|
550
554
|
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)}";
|
|
551
555
|
document.head.appendChild(style);
|
|
552
556
|
}
|
|
553
|
-
var section_default = { "
|
|
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" };
|
|
554
558
|
|
|
555
559
|
// src/client/Section.tsx
|
|
556
560
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -646,12 +650,29 @@ var SectionController = class _SectionController {
|
|
|
646
650
|
this.set({ keyConfigured: void 0 });
|
|
647
651
|
}
|
|
648
652
|
}
|
|
653
|
+
/**
|
|
654
|
+
* The update Remote.
|
|
655
|
+
*
|
|
656
|
+
* `client/index.ts` declares `remote.opencodeGoUpdate` in its inject list,
|
|
657
|
+
* so by the time this controller exists the namespace is mounted. The guard
|
|
658
|
+
* below is therefore a defensive assertion, not a wait: Cordis throws
|
|
659
|
+
* `cannot get property "…" without inject` on an undeclared read rather
|
|
660
|
+
* than returning undefined, which is how an omitted dependency once turned
|
|
661
|
+
* this panel into a permanently blank row.
|
|
662
|
+
* @returns the mounted update Remote.
|
|
663
|
+
* @throws {Error} `remote-not-mounted` when the namespace is absent.
|
|
664
|
+
*/
|
|
665
|
+
updateRemote() {
|
|
666
|
+
const remote = this.services.remote.opencodeGoUpdate;
|
|
667
|
+
if (remote === void 0) throw new Error("remote-not-mounted");
|
|
668
|
+
return remote;
|
|
669
|
+
}
|
|
649
670
|
/**
|
|
650
671
|
* Ask the Host whether a newer release is published.
|
|
651
672
|
*
|
|
652
673
|
* The Host answers from a cached registry reading and fails silent, so an
|
|
653
|
-
* unreachable registry
|
|
654
|
-
* once with the page and again only on explicit refresh.
|
|
674
|
+
* unreachable registry still answers "no update known" rather than erroring
|
|
675
|
+
* the page. Runs once with the page and again only on explicit refresh.
|
|
655
676
|
*
|
|
656
677
|
* Both wire methods take zero arguments: the gateway client rejects any
|
|
657
678
|
* call whose positional arity differs from the descriptor's `parameters`,
|
|
@@ -662,7 +683,7 @@ var SectionController = class _SectionController {
|
|
|
662
683
|
const previous = this.state.update;
|
|
663
684
|
this.set({ update: { ...previous, phase: "checking", message: void 0 } });
|
|
664
685
|
try {
|
|
665
|
-
const remote = this.
|
|
686
|
+
const remote = this.updateRemote();
|
|
666
687
|
const result = force ? await remote.refreshUpdate() : await remote.readUpdate();
|
|
667
688
|
if (!result.ok) throw result.error;
|
|
668
689
|
const status = result.value;
|
|
@@ -676,9 +697,9 @@ var SectionController = class _SectionController {
|
|
|
676
697
|
} catch (error) {
|
|
677
698
|
this.set({
|
|
678
699
|
update: {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
message: error instanceof Error ? error.message :
|
|
700
|
+
phase: "failed",
|
|
701
|
+
status: previous.status,
|
|
702
|
+
message: error instanceof Error ? error.message : "the update check failed"
|
|
682
703
|
}
|
|
683
704
|
});
|
|
684
705
|
}
|
|
@@ -713,7 +734,11 @@ var SectionController = class _SectionController {
|
|
|
713
734
|
const status = this.state.update.status;
|
|
714
735
|
const latest = status?.latest;
|
|
715
736
|
if (this.state.update.phase !== "confirming" || latest === void 0) return;
|
|
716
|
-
const manager = this.services.
|
|
737
|
+
const manager = this.services.pluginManager;
|
|
738
|
+
if (manager === void 0) {
|
|
739
|
+
this.set({ update: { phase: "failed", status, message: "no-plugin-manager" } });
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
717
742
|
const spec = `${PACKAGE_NAME}@${latest}`;
|
|
718
743
|
this.set({ update: { phase: "updating", status, message: void 0 } });
|
|
719
744
|
const fail = (message) => {
|
|
@@ -1014,6 +1039,8 @@ function UpdateBanner({ controller, t, busy, act, update }) {
|
|
|
1014
1039
|
}
|
|
1015
1040
|
function updateFailureText(message, t) {
|
|
1016
1041
|
if (message === void 0 || message.length === 0) return "";
|
|
1042
|
+
if (message === "remote-not-mounted") return t("updateRemoteMissing");
|
|
1043
|
+
if (message === "no-plugin-manager") return t("updateNoManager");
|
|
1017
1044
|
if (message === "stop-profile") return t("updateStopProfile");
|
|
1018
1045
|
if (message === "incompatible-version") return t("updateIncompatible");
|
|
1019
1046
|
if (message === "pending-builds") return t("updatePendingBuilds");
|
|
@@ -1286,7 +1313,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id2) + "]"
|
|
|
1286
1313
|
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}";
|
|
1287
1314
|
document.head.appendChild(style);
|
|
1288
1315
|
}
|
|
1289
|
-
var pill_default = { "progress": "mMNkkW_progress", "
|
|
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" };
|
|
1290
1317
|
|
|
1291
1318
|
// src/client/UsagePill.tsx
|
|
1292
1319
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
@@ -1456,10 +1483,14 @@ function apply(ctx) {
|
|
|
1456
1483
|
void dispose?.();
|
|
1457
1484
|
};
|
|
1458
1485
|
}, "dshopencodego: usage Remote");
|
|
1459
|
-
ctx.inject(["configForms", "remote.opencodeGoCatalog", "remote.credentials"], (scope) => {
|
|
1486
|
+
ctx.inject(["configForms", "remote.opencodeGoCatalog", "remote.opencodeGoUpdate", "remote.credentials"], (scope) => {
|
|
1460
1487
|
const forms = scope.get("configForms");
|
|
1461
1488
|
const controller = new SectionController({
|
|
1462
1489
|
remote: scope.remote,
|
|
1490
|
+
// Lenient lookup on purpose: the plugin manager is a separate host
|
|
1491
|
+
// plugin a composition may omit, and declaring it as a required
|
|
1492
|
+
// dependency would withdraw this whole settings section when absent.
|
|
1493
|
+
pluginManager: scope.get("remote.pluginManager"),
|
|
1463
1494
|
scope: forms?.get("dshopencodego")
|
|
1464
1495
|
});
|
|
1465
1496
|
const translate = scope.locale.bind(NS);
|
package/lib/index.js
CHANGED
|
@@ -2079,7 +2079,7 @@ function createUpdateChecker(deps) {
|
|
|
2079
2079
|
}
|
|
2080
2080
|
|
|
2081
2081
|
// src/update/version.ts
|
|
2082
|
-
var PLUGIN_VERSION = true ? "0.1.
|
|
2082
|
+
var PLUGIN_VERSION = true ? "0.1.27" : "0.0.0-dev";
|
|
2083
2083
|
|
|
2084
2084
|
// src/update/service.ts
|
|
2085
2085
|
import { TypertRemoteService as TypertRemoteService2 } from "@deepseek-ai/dsh-typert-protocol";
|
package/package.json
CHANGED