dsh-update-status 0.4.5 → 0.4.7
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 +18 -0
- package/README.md +17 -14
- package/README.zh.md +18 -15
- package/docs/service-supervision.md +1 -1
- package/lib/client.js +2 -164
- package/lib/client.js.map +1 -1
- package/lib/index.js +62 -8
- package/package.json +3 -2
package/lib/index.js
CHANGED
|
@@ -25,7 +25,8 @@ const VERIFIED_DSH_VERSIONS = [
|
|
|
25
25
|
"0.2.1-alpha.3",
|
|
26
26
|
"0.2.1-alpha.4",
|
|
27
27
|
"0.2.1-alpha.5",
|
|
28
|
-
"0.2.1-rc.2"
|
|
28
|
+
"0.2.1-rc.2",
|
|
29
|
+
"0.2.1-rc.3"
|
|
29
30
|
];
|
|
30
31
|
function isCacheTtlMinutes(value) {
|
|
31
32
|
return typeof value === "number" && Number.isInteger(value) && value >= 30 && value <= 1440;
|
|
@@ -674,10 +675,19 @@ function collectActiveWork(ctx) {
|
|
|
674
675
|
if (face === void 0) continue;
|
|
675
676
|
if (typeof face.list !== "function") return unavailable();
|
|
676
677
|
try {
|
|
678
|
+
let published = false;
|
|
677
679
|
for (const terminal of face.list(owner)) {
|
|
678
680
|
if (terminal.status?.kind !== "running") continue;
|
|
681
|
+
published = true;
|
|
679
682
|
terminals.set(String(terminal.sessionId), terminal);
|
|
680
683
|
}
|
|
684
|
+
if (typeof face.hasOwnerActivity === "function" && face.hasOwnerActivity(owner) && !published) items.push({
|
|
685
|
+
type: "terminal",
|
|
686
|
+
id: `pending:${String(owner.id)}`,
|
|
687
|
+
label: "Pending terminal activity",
|
|
688
|
+
status: "pending",
|
|
689
|
+
ownerSession: String(owner.id)
|
|
690
|
+
});
|
|
681
691
|
} catch {
|
|
682
692
|
return unavailable();
|
|
683
693
|
}
|
|
@@ -763,7 +773,52 @@ var RestartController = class {
|
|
|
763
773
|
kind: "unavailable",
|
|
764
774
|
status
|
|
765
775
|
};
|
|
766
|
-
const
|
|
776
|
+
const maintenance = [];
|
|
777
|
+
try {
|
|
778
|
+
const registry = ctx.get?.("agents");
|
|
779
|
+
const probes = [];
|
|
780
|
+
for (const agent of registry?.list?.() ?? []) {
|
|
781
|
+
if (agent.status !== "idle" || typeof agent.whenIdle !== "function") continue;
|
|
782
|
+
const probe = {
|
|
783
|
+
agent,
|
|
784
|
+
settled: false,
|
|
785
|
+
failed: false
|
|
786
|
+
};
|
|
787
|
+
const pending = agent.whenIdle();
|
|
788
|
+
if (pending === void 0 || typeof pending.then !== "function") throw new Error("invalid quiescence probe");
|
|
789
|
+
pending.then(() => {
|
|
790
|
+
probe.settled = true;
|
|
791
|
+
}, () => {
|
|
792
|
+
probe.failed = true;
|
|
793
|
+
});
|
|
794
|
+
probes.push(probe);
|
|
795
|
+
}
|
|
796
|
+
for (let turn = 0; turn < 4; turn += 1) await Promise.resolve();
|
|
797
|
+
for (const { agent, settled, failed } of probes) {
|
|
798
|
+
if (failed) throw new Error("quiescence probe failed");
|
|
799
|
+
if (!settled) maintenance.push({
|
|
800
|
+
type: "agent",
|
|
801
|
+
id: String(agent.id),
|
|
802
|
+
label: String(agent.id),
|
|
803
|
+
status: "maintenance"
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
} catch {
|
|
807
|
+
return {
|
|
808
|
+
kind: "unavailable",
|
|
809
|
+
status: {
|
|
810
|
+
...status,
|
|
811
|
+
available: false,
|
|
812
|
+
unavailableReason: "activity-unavailable"
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
const snapshot = collectActiveWork(ctx);
|
|
817
|
+
const activity = {
|
|
818
|
+
...snapshot,
|
|
819
|
+
hasActive: snapshot.hasActive || maintenance.length > 0,
|
|
820
|
+
items: [...snapshot.items, ...maintenance.filter((item) => !snapshot.items.some((other) => other.type === "agent" && other.id === item.id))]
|
|
821
|
+
};
|
|
767
822
|
if (!activity.available) return {
|
|
768
823
|
kind: "unavailable",
|
|
769
824
|
status: {
|
|
@@ -1436,12 +1491,11 @@ const Config = buildConfigSchema(runtime.z, runtime.volatile);
|
|
|
1436
1491
|
/**
|
|
1437
1492
|
* Suppress the auto-generated settings page for this entry.
|
|
1438
1493
|
*
|
|
1439
|
-
*
|
|
1440
|
-
* the plugin's
|
|
1441
|
-
*
|
|
1442
|
-
*
|
|
1443
|
-
*
|
|
1444
|
-
* it through `ctx.configForms`.
|
|
1494
|
+
* Keep Settings free of a redundant version/update page: the sidebar chip and
|
|
1495
|
+
* its detail panel are the plugin's UI. The entry's row stays in
|
|
1496
|
+
* `settings.describe()` either way — the browser half still reads and writes
|
|
1497
|
+
* cache preferences through `ctx.configForms`, and existing profile preferences
|
|
1498
|
+
* remain compatible.
|
|
1445
1499
|
*
|
|
1446
1500
|
* Guarded twice: a deployment without the settings service never runs the inject
|
|
1447
1501
|
* callback (the plugin keeps working from its defaults), and a refused policy
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-update-status",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "DeepSeek Harness Web plugin for version status, copy-only upgrade guidance, and safe restart when an explicit user-level supervisor is installed.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -75,7 +75,8 @@
|
|
|
75
75
|
"0.2.1-alpha.3": "compatible",
|
|
76
76
|
"0.2.1-alpha.4": "compatible",
|
|
77
77
|
"0.2.1-alpha.5": "compatible",
|
|
78
|
-
"0.2.1-rc.2": "compatible"
|
|
78
|
+
"0.2.1-rc.2": "compatible",
|
|
79
|
+
"0.2.1-rc.3": "compatible"
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
},
|