@dan-ai-studio/dshopencodego 0.1.27 → 0.1.28
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 +13 -5
- package/lib/index.js +7 -4
- package/lib/types/update/check.d.ts +9 -0
- package/lib/types/update/check.js +4 -1
- package/lib/types/update/contract.js +3 -0
- package/package.json +1 -1
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,7 @@ 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.",
|
|
370
373
|
updateStopProfile: "The running version cannot be removed without a restart; restart DSH first, then retry.",
|
|
371
374
|
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
375
|
updatePendingBuilds: "Installation needs build-script approval; approve it on the plugin manager page, then retry."
|
|
@@ -454,6 +457,7 @@ var zh = {
|
|
|
454
457
|
updateFailed: "\u66F4\u65B0\u5931\u8D25\uFF1A",
|
|
455
458
|
updateRemoteMissing: "\u66F4\u65B0\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF1B\u8BF7\u70B9\u51FB\u201C\u91CD\u65B0\u68C0\u67E5\u201D\u91CD\u8BD5\u3002",
|
|
456
459
|
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
|
+
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",
|
|
457
461
|
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
462
|
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
463
|
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 +558,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id) + "]")
|
|
|
554
558
|
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
559
|
document.head.appendChild(style);
|
|
556
560
|
}
|
|
557
|
-
var section_default = { "
|
|
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" };
|
|
558
562
|
|
|
559
563
|
// src/client/Section.tsx
|
|
560
564
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -689,9 +693,12 @@ var SectionController = class _SectionController {
|
|
|
689
693
|
const status = result.value;
|
|
690
694
|
this.set({
|
|
691
695
|
update: {
|
|
692
|
-
|
|
696
|
+
// An unanswered lookup is not "up to date": rendering the two alike
|
|
697
|
+
// would report an unreachable registry as a current version, which
|
|
698
|
+
// is the same silent lie that once hid this panel entirely.
|
|
699
|
+
phase: !status.checked ? "failed" : status.available && status.latest !== void 0 ? "ready" : "current",
|
|
693
700
|
status,
|
|
694
|
-
message: void 0
|
|
701
|
+
message: status.checked ? void 0 : "registry-unreachable"
|
|
695
702
|
}
|
|
696
703
|
});
|
|
697
704
|
} catch (error) {
|
|
@@ -1041,6 +1048,7 @@ function updateFailureText(message, t) {
|
|
|
1041
1048
|
if (message === void 0 || message.length === 0) return "";
|
|
1042
1049
|
if (message === "remote-not-mounted") return t("updateRemoteMissing");
|
|
1043
1050
|
if (message === "no-plugin-manager") return t("updateNoManager");
|
|
1051
|
+
if (message === "registry-unreachable") return t("updateUnreachable");
|
|
1044
1052
|
if (message === "stop-profile") return t("updateStopProfile");
|
|
1045
1053
|
if (message === "incompatible-version") return t("updateIncompatible");
|
|
1046
1054
|
if (message === "pending-builds") return t("updatePendingBuilds");
|
|
@@ -1313,7 +1321,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id2) + "]"
|
|
|
1313
1321
|
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
1322
|
document.head.appendChild(style);
|
|
1315
1323
|
}
|
|
1316
|
-
var pill_default = { "
|
|
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" };
|
|
1317
1325
|
|
|
1318
1326
|
// src/client/UsagePill.tsx
|
|
1319
1327
|
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.
|
|
2085
|
+
var PLUGIN_VERSION = true ? "0.1.28" : "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
|
-
|
|
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