dsh-update-status 0.1.3 → 0.1.5
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/CHANGELOG.md +21 -0
- package/README.md +80 -11
- package/README.zh.md +80 -11
- package/assets/sidebar-chip.png +0 -0
- package/assets/update-panel.png +0 -0
- package/docs/RELEASING.md +1 -1
- package/lib/client.js +78 -9
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +20 -0
- package/lib/index.js +11 -2
- package/package.json +4 -2
package/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,23 @@ import { Context } from "@deepseek-ai/cordis";
|
|
|
4
4
|
declare const RELEASE_CHANNELS: readonly ['latest', 'next', 'alpha'];
|
|
5
5
|
type ReleaseChannel = (typeof RELEASE_CHANNELS)[number];
|
|
6
6
|
type ReleaseCompatibility = 'verified' | 'unverified' | 'incompatible';
|
|
7
|
+
/**
|
|
8
|
+
* Severity of `warning`, so a surface can tell "the plugin could not determine
|
|
9
|
+
* the update state" from "here is something worth knowing".
|
|
10
|
+
*
|
|
11
|
+
* - `failure`: no usable answer — a failed registry read, a channel the registry
|
|
12
|
+
* does not publish, or a version SemVer cannot compare. This is what justifies
|
|
13
|
+
* repainting the sidebar chip.
|
|
14
|
+
* - `notice`: the answer is complete and usable; the text is advisory, e.g. a
|
|
15
|
+
* preview channel whose release this bundle has not been verified against.
|
|
16
|
+
* The chip must NOT repaint for this — an operator upgrading DSH ahead of the
|
|
17
|
+
* plugin would otherwise see the chip turn red for a plugin-side bookkeeping
|
|
18
|
+
* fact.
|
|
19
|
+
*
|
|
20
|
+
* Optional on purpose: a Host older than this field leaves it `undefined`, and
|
|
21
|
+
* the client then falls back to treating any warning as a failure.
|
|
22
|
+
*/
|
|
23
|
+
type UpdateWarningKind = 'failure' | 'notice';
|
|
7
24
|
type InstallKind = 'npm-global' | 'pnpm-global' | 'source-checkout' | 'unknown';
|
|
8
25
|
interface ChannelRelease {
|
|
9
26
|
channel: ReleaseChannel;
|
|
@@ -23,6 +40,8 @@ interface UpdateStatus {
|
|
|
23
40
|
cached: boolean;
|
|
24
41
|
checkedAt: string | null;
|
|
25
42
|
warning: string | null;
|
|
43
|
+
/** Severity of `warning`; absent from a Host older than the field. */
|
|
44
|
+
warningKind?: UpdateWarningKind | null;
|
|
26
45
|
installKind: InstallKind;
|
|
27
46
|
upgradeCommand: string;
|
|
28
47
|
releaseUrl: string;
|
|
@@ -74,6 +93,7 @@ declare class UpdateStatusService {
|
|
|
74
93
|
private refreshRelease;
|
|
75
94
|
private statusAfterFailure;
|
|
76
95
|
private statusFromCache;
|
|
96
|
+
/** No remote data at all: the registry read itself failed, never a notice. */
|
|
77
97
|
private statusWithoutRemoteRelease;
|
|
78
98
|
}
|
|
79
99
|
//#endregion
|
package/lib/index.js
CHANGED
|
@@ -21,7 +21,11 @@ const UPDATE_STATUS_CHANNEL = "/api";
|
|
|
21
21
|
* release the registry reports stays `unverified` — the plugin never claims a
|
|
22
22
|
* compatibility nobody checked.
|
|
23
23
|
*/
|
|
24
|
-
const VERIFIED_DSH_VERSIONS = [
|
|
24
|
+
const VERIFIED_DSH_VERSIONS = [
|
|
25
|
+
"0.1.5-rc.1",
|
|
26
|
+
"0.1.6-alpha.1",
|
|
27
|
+
"0.1.6-alpha.2"
|
|
28
|
+
];
|
|
25
29
|
const RELEASE_CHANNELS = [
|
|
26
30
|
"latest",
|
|
27
31
|
"next",
|
|
@@ -477,13 +481,16 @@ var UpdateStatusService = class {
|
|
|
477
481
|
const missingWarning = selected.version === null ? `npm registry 未发布 ${channel} 通道。` : null;
|
|
478
482
|
const comparisonWarning = selected.version !== null && comparison === void 0 ? `无法按 SemVer 比较当前版本 ${this.installation.currentVersion} 与 ${channel} 通道版本 ${selected.version}。` : null;
|
|
479
483
|
const previewWarning = channel !== "latest" && selected.version !== null && selected.compatibility !== "verified" ? `${channel} 是预览通道,版本 ${selected.version} 尚未验证与本插件兼容。` : null;
|
|
484
|
+
const failureWarning = warningWith(warningWith(initialWarning, missingWarning), comparisonWarning);
|
|
485
|
+
const warning = warningWith(failureWarning, previewWarning);
|
|
480
486
|
return {
|
|
481
487
|
currentVersion: this.installation.currentVersion,
|
|
482
488
|
latestVersion: selected.version,
|
|
483
489
|
hasUpdate: comparison !== void 0 && comparison < 0,
|
|
484
490
|
cached,
|
|
485
491
|
checkedAt: new Date(cache.checkedAtMs).toISOString(),
|
|
486
|
-
warning
|
|
492
|
+
warning,
|
|
493
|
+
warningKind: warning === null ? null : failureWarning === null ? "notice" : "failure",
|
|
487
494
|
installKind: this.installation.installKind,
|
|
488
495
|
upgradeCommand: upgradeCommandFor(this.installation.installKind, this.installation.packageName || "@deepseek-ai/dsh", channel),
|
|
489
496
|
releaseUrl: this.releaseUrl,
|
|
@@ -495,6 +502,7 @@ var UpdateStatusService = class {
|
|
|
495
502
|
canApplyInPlace: false
|
|
496
503
|
};
|
|
497
504
|
}
|
|
505
|
+
/** No remote data at all: the registry read itself failed, never a notice. */
|
|
498
506
|
statusWithoutRemoteRelease(channel, warning) {
|
|
499
507
|
return {
|
|
500
508
|
currentVersion: this.installation.currentVersion,
|
|
@@ -503,6 +511,7 @@ var UpdateStatusService = class {
|
|
|
503
511
|
cached: false,
|
|
504
512
|
checkedAt: null,
|
|
505
513
|
warning,
|
|
514
|
+
warningKind: "failure",
|
|
506
515
|
installKind: this.installation.installKind,
|
|
507
516
|
upgradeCommand: upgradeCommandFor(this.installation.installKind, this.installation.packageName || "@deepseek-ai/dsh", channel),
|
|
508
517
|
releaseUrl: this.releaseUrl,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-update-status",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Read-only DeepSeek Harness Web plugin that shows the running DSH version, discovers latest/next/alpha releases, warns about compatibility, and generates copy-only upgrade commands.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"CHANGELOG.md",
|
|
25
25
|
"LICENSE",
|
|
26
26
|
"assets/update-panel.png",
|
|
27
|
+
"assets/sidebar-chip.png",
|
|
27
28
|
"docs/RELEASING.md"
|
|
28
29
|
],
|
|
29
30
|
"engines": {
|
|
@@ -57,7 +58,8 @@
|
|
|
57
58
|
"compatibility": {
|
|
58
59
|
"dshReleases": {
|
|
59
60
|
"0.1.5-rc.1": "compatible",
|
|
60
|
-
"0.1.6-alpha.1": "compatible"
|
|
61
|
+
"0.1.6-alpha.1": "compatible",
|
|
62
|
+
"0.1.6-alpha.2": "compatible"
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
},
|