@dan-ai-studio/dshopencodego 0.1.26 → 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 +28 -25
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -366,6 +366,7 @@ var en = {
|
|
|
366
366
|
updateRestart: "Restart DSH to finish applying the update.",
|
|
367
367
|
updateFailed: "Update failed:",
|
|
368
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.",
|
|
369
370
|
updateStopProfile: "The running version cannot be removed without a restart; restart DSH first, then retry.",
|
|
370
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).",
|
|
371
372
|
updatePendingBuilds: "Installation needs build-script approval; approve it on the plugin manager page, then retry."
|
|
@@ -452,6 +453,7 @@ var zh = {
|
|
|
452
453
|
updateRestart: "\u8BF7\u91CD\u542F DSH \u4EE5\u5B8C\u6210\u66F4\u65B0\u3002",
|
|
453
454
|
updateFailed: "\u66F4\u65B0\u5931\u8D25\uFF1A",
|
|
454
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",
|
|
455
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",
|
|
456
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",
|
|
457
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"
|
|
@@ -552,14 +554,12 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id) + "]")
|
|
|
552
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)}";
|
|
553
555
|
document.head.appendChild(style);
|
|
554
556
|
}
|
|
555
|
-
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" };
|
|
556
558
|
|
|
557
559
|
// src/client/Section.tsx
|
|
558
560
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
559
561
|
var API_KEY_REF = "OPENCODE_GO_API_KEY";
|
|
560
562
|
var VISIBILITY_WRITE_DELAY_MS = 250;
|
|
561
|
-
var UPDATE_MOUNT_WAIT_MS = 2e3;
|
|
562
|
-
var UPDATE_MOUNT_POLL_MS = 50;
|
|
563
563
|
var INITIAL = {
|
|
564
564
|
loading: true,
|
|
565
565
|
reading: void 0,
|
|
@@ -651,27 +651,21 @@ var SectionController = class _SectionController {
|
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
/**
|
|
654
|
-
* The update Remote
|
|
654
|
+
* The update Remote.
|
|
655
655
|
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
-
*
|
|
660
|
-
*
|
|
661
|
-
*
|
|
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
662
|
* @returns the mounted update Remote.
|
|
663
|
-
* @throws {Error} `remote-not-mounted` when
|
|
663
|
+
* @throws {Error} `remote-not-mounted` when the namespace is absent.
|
|
664
664
|
*/
|
|
665
|
-
|
|
666
|
-
const
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
if (remote !== void 0) return remote;
|
|
670
|
-
if (Date.now() >= deadline) throw new Error("remote-not-mounted");
|
|
671
|
-
await new Promise((resolve) => {
|
|
672
|
-
setTimeout(resolve, UPDATE_MOUNT_POLL_MS);
|
|
673
|
-
});
|
|
674
|
-
}
|
|
665
|
+
updateRemote() {
|
|
666
|
+
const remote = this.services.remote.opencodeGoUpdate;
|
|
667
|
+
if (remote === void 0) throw new Error("remote-not-mounted");
|
|
668
|
+
return remote;
|
|
675
669
|
}
|
|
676
670
|
/**
|
|
677
671
|
* Ask the Host whether a newer release is published.
|
|
@@ -689,7 +683,7 @@ var SectionController = class _SectionController {
|
|
|
689
683
|
const previous = this.state.update;
|
|
690
684
|
this.set({ update: { ...previous, phase: "checking", message: void 0 } });
|
|
691
685
|
try {
|
|
692
|
-
const remote =
|
|
686
|
+
const remote = this.updateRemote();
|
|
693
687
|
const result = force ? await remote.refreshUpdate() : await remote.readUpdate();
|
|
694
688
|
if (!result.ok) throw result.error;
|
|
695
689
|
const status = result.value;
|
|
@@ -740,7 +734,11 @@ var SectionController = class _SectionController {
|
|
|
740
734
|
const status = this.state.update.status;
|
|
741
735
|
const latest = status?.latest;
|
|
742
736
|
if (this.state.update.phase !== "confirming" || latest === void 0) return;
|
|
743
|
-
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
|
+
}
|
|
744
742
|
const spec = `${PACKAGE_NAME}@${latest}`;
|
|
745
743
|
this.set({ update: { phase: "updating", status, message: void 0 } });
|
|
746
744
|
const fail = (message) => {
|
|
@@ -1042,6 +1040,7 @@ function UpdateBanner({ controller, t, busy, act, update }) {
|
|
|
1042
1040
|
function updateFailureText(message, t) {
|
|
1043
1041
|
if (message === void 0 || message.length === 0) return "";
|
|
1044
1042
|
if (message === "remote-not-mounted") return t("updateRemoteMissing");
|
|
1043
|
+
if (message === "no-plugin-manager") return t("updateNoManager");
|
|
1045
1044
|
if (message === "stop-profile") return t("updateStopProfile");
|
|
1046
1045
|
if (message === "incompatible-version") return t("updateIncompatible");
|
|
1047
1046
|
if (message === "pending-builds") return t("updatePendingBuilds");
|
|
@@ -1314,7 +1313,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id2) + "]"
|
|
|
1314
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}";
|
|
1315
1314
|
document.head.appendChild(style);
|
|
1316
1315
|
}
|
|
1317
|
-
var pill_default = { "
|
|
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" };
|
|
1318
1317
|
|
|
1319
1318
|
// src/client/UsagePill.tsx
|
|
1320
1319
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
@@ -1484,10 +1483,14 @@ function apply(ctx) {
|
|
|
1484
1483
|
void dispose?.();
|
|
1485
1484
|
};
|
|
1486
1485
|
}, "dshopencodego: usage Remote");
|
|
1487
|
-
ctx.inject(["configForms", "remote.opencodeGoCatalog", "remote.credentials"], (scope) => {
|
|
1486
|
+
ctx.inject(["configForms", "remote.opencodeGoCatalog", "remote.opencodeGoUpdate", "remote.credentials"], (scope) => {
|
|
1488
1487
|
const forms = scope.get("configForms");
|
|
1489
1488
|
const controller = new SectionController({
|
|
1490
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"),
|
|
1491
1494
|
scope: forms?.get("dshopencodego")
|
|
1492
1495
|
});
|
|
1493
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