dsh-update-status 0.4.4 → 0.4.6

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/index.js CHANGED
@@ -24,7 +24,9 @@ const VERIFIED_DSH_VERSIONS = [
24
24
  "0.2.1-alpha.1",
25
25
  "0.2.1-alpha.3",
26
26
  "0.2.1-alpha.4",
27
- "0.2.1-alpha.5"
27
+ "0.2.1-alpha.5",
28
+ "0.2.1-rc.2",
29
+ "0.2.1-rc.3"
28
30
  ];
29
31
  function isCacheTtlMinutes(value) {
30
32
  return typeof value === "number" && Number.isInteger(value) && value >= 30 && value <= 1440;
@@ -673,10 +675,19 @@ function collectActiveWork(ctx) {
673
675
  if (face === void 0) continue;
674
676
  if (typeof face.list !== "function") return unavailable();
675
677
  try {
678
+ let published = false;
676
679
  for (const terminal of face.list(owner)) {
677
680
  if (terminal.status?.kind !== "running") continue;
681
+ published = true;
678
682
  terminals.set(String(terminal.sessionId), terminal);
679
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
+ });
680
691
  } catch {
681
692
  return unavailable();
682
693
  }
@@ -762,7 +773,52 @@ var RestartController = class {
762
773
  kind: "unavailable",
763
774
  status
764
775
  };
765
- const activity = collectActiveWork(ctx);
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
+ };
766
822
  if (!activity.available) return {
767
823
  kind: "unavailable",
768
824
  status: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-update-status",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
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",
@@ -74,7 +74,9 @@
74
74
  "0.2.1-alpha.1": "compatible",
75
75
  "0.2.1-alpha.3": "compatible",
76
76
  "0.2.1-alpha.4": "compatible",
77
- "0.2.1-alpha.5": "compatible"
77
+ "0.2.1-alpha.5": "compatible",
78
+ "0.2.1-rc.2": "compatible",
79
+ "0.2.1-rc.3": "compatible"
78
80
  }
79
81
  }
80
82
  },