@dan-ai-studio/dshopencodego 0.1.25 → 0.1.26
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 +36 -8
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -365,6 +365,7 @@ 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.",
|
|
368
369
|
updateStopProfile: "The running version cannot be removed without a restart; restart DSH first, then retry.",
|
|
369
370
|
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
371
|
updatePendingBuilds: "Installation needs build-script approval; approve it on the plugin manager page, then retry."
|
|
@@ -450,6 +451,7 @@ var zh = {
|
|
|
450
451
|
updateDone: "\u5DF2\u66F4\u65B0\u5230",
|
|
451
452
|
updateRestart: "\u8BF7\u91CD\u542F DSH \u4EE5\u5B8C\u6210\u66F4\u65B0\u3002",
|
|
452
453
|
updateFailed: "\u66F4\u65B0\u5931\u8D25\uFF1A",
|
|
454
|
+
updateRemoteMissing: "\u66F4\u65B0\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF1B\u8BF7\u70B9\u51FB\u201C\u91CD\u65B0\u68C0\u67E5\u201D\u91CD\u8BD5\u3002",
|
|
453
455
|
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
456
|
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
457
|
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,12 +552,14 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id) + "]")
|
|
|
550
552
|
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
553
|
document.head.appendChild(style);
|
|
552
554
|
}
|
|
553
|
-
var section_default = { "
|
|
555
|
+
var section_default = { "itemMain": "d7lz0W_itemMain", "title": "d7lz0W_title", "hint": "d7lz0W_hint", "itemBody": "d7lz0W_itemBody", "button": "d7lz0W_button", "block": "d7lz0W_block", "itemMeta": "d7lz0W_itemMeta", "name": "d7lz0W_name", "input": "d7lz0W_input", "itemModalities": "d7lz0W_itemModalities", "item": "d7lz0W_item", "ok": "d7lz0W_ok", "number": "d7lz0W_number", "warn": "d7lz0W_warn", "root": "d7lz0W_root", "list": "d7lz0W_list", "row": "d7lz0W_row", "badge": "d7lz0W_badge", "select": "d7lz0W_select", "mono": "d7lz0W_mono" };
|
|
554
556
|
|
|
555
557
|
// src/client/Section.tsx
|
|
556
558
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
557
559
|
var API_KEY_REF = "OPENCODE_GO_API_KEY";
|
|
558
560
|
var VISIBILITY_WRITE_DELAY_MS = 250;
|
|
561
|
+
var UPDATE_MOUNT_WAIT_MS = 2e3;
|
|
562
|
+
var UPDATE_MOUNT_POLL_MS = 50;
|
|
559
563
|
var INITIAL = {
|
|
560
564
|
loading: true,
|
|
561
565
|
reading: void 0,
|
|
@@ -646,12 +650,35 @@ var SectionController = class _SectionController {
|
|
|
646
650
|
this.set({ keyConfigured: void 0 });
|
|
647
651
|
}
|
|
648
652
|
}
|
|
653
|
+
/**
|
|
654
|
+
* The update Remote, waiting for its namespace to finish mounting.
|
|
655
|
+
*
|
|
656
|
+
* The settings section is constructed as soon as the catalog and credentials
|
|
657
|
+
* are visible, which can precede the rest of this package's own Remote
|
|
658
|
+
* contribution. Reading `opencodeGoUpdate` too early made the first check
|
|
659
|
+
* throw a TypeError into the page's catch, which returned the panel to
|
|
660
|
+
* `idle` — a permanently blank panel with no retry. This is the defect a
|
|
661
|
+
* live run reported, so the race is waited out here instead of hidden.
|
|
662
|
+
* @returns the mounted update Remote.
|
|
663
|
+
* @throws {Error} `remote-not-mounted` when it never appears.
|
|
664
|
+
*/
|
|
665
|
+
async updateRemote() {
|
|
666
|
+
const deadline = Date.now() + UPDATE_MOUNT_WAIT_MS;
|
|
667
|
+
for (; ; ) {
|
|
668
|
+
const remote = this.services.remote.opencodeGoUpdate;
|
|
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
|
+
}
|
|
675
|
+
}
|
|
649
676
|
/**
|
|
650
677
|
* Ask the Host whether a newer release is published.
|
|
651
678
|
*
|
|
652
679
|
* 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.
|
|
680
|
+
* unreachable registry still answers "no update known" rather than erroring
|
|
681
|
+
* the page. Runs once with the page and again only on explicit refresh.
|
|
655
682
|
*
|
|
656
683
|
* Both wire methods take zero arguments: the gateway client rejects any
|
|
657
684
|
* call whose positional arity differs from the descriptor's `parameters`,
|
|
@@ -662,7 +689,7 @@ var SectionController = class _SectionController {
|
|
|
662
689
|
const previous = this.state.update;
|
|
663
690
|
this.set({ update: { ...previous, phase: "checking", message: void 0 } });
|
|
664
691
|
try {
|
|
665
|
-
const remote = this.
|
|
692
|
+
const remote = await this.updateRemote();
|
|
666
693
|
const result = force ? await remote.refreshUpdate() : await remote.readUpdate();
|
|
667
694
|
if (!result.ok) throw result.error;
|
|
668
695
|
const status = result.value;
|
|
@@ -676,9 +703,9 @@ var SectionController = class _SectionController {
|
|
|
676
703
|
} catch (error) {
|
|
677
704
|
this.set({
|
|
678
705
|
update: {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
message: error instanceof Error ? error.message :
|
|
706
|
+
phase: "failed",
|
|
707
|
+
status: previous.status,
|
|
708
|
+
message: error instanceof Error ? error.message : "the update check failed"
|
|
682
709
|
}
|
|
683
710
|
});
|
|
684
711
|
}
|
|
@@ -1014,6 +1041,7 @@ function UpdateBanner({ controller, t, busy, act, update }) {
|
|
|
1014
1041
|
}
|
|
1015
1042
|
function updateFailureText(message, t) {
|
|
1016
1043
|
if (message === void 0 || message.length === 0) return "";
|
|
1044
|
+
if (message === "remote-not-mounted") return t("updateRemoteMissing");
|
|
1017
1045
|
if (message === "stop-profile") return t("updateStopProfile");
|
|
1018
1046
|
if (message === "incompatible-version") return t("updateIncompatible");
|
|
1019
1047
|
if (message === "pending-builds") return t("updatePendingBuilds");
|
|
@@ -1286,7 +1314,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id2) + "]"
|
|
|
1286
1314
|
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
1315
|
document.head.appendChild(style);
|
|
1288
1316
|
}
|
|
1289
|
-
var pill_default = { "
|
|
1317
|
+
var pill_default = { "root": "mMNkkW_root", "panel": "mMNkkW_panel", "warning": "mMNkkW_warning", "progress": "mMNkkW_progress", "hint": "mMNkkW_hint", "limited": "mMNkkW_limited", "row": "mMNkkW_row", "local": "mMNkkW_local", "retry": "mMNkkW_retry", "trigger": "mMNkkW_trigger", "window": "mMNkkW_window" };
|
|
1290
1318
|
|
|
1291
1319
|
// src/client/UsagePill.tsx
|
|
1292
1320
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
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.26" : "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