@cotal-ai/cli 0.91.0 → 0.92.1
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/dist/chat/chat-view.d.ts.map +1 -1
- package/dist/chat/chat-view.js +3 -3
- package/dist/chat/chat-view.js.map +1 -1
- package/dist/chat/controller.d.ts +2 -1
- package/dist/chat/controller.d.ts.map +1 -1
- package/dist/chat/controller.js +29 -13
- package/dist/chat/controller.js.map +1 -1
- package/dist/chat/engine.d.ts +12 -10
- package/dist/chat/engine.d.ts.map +1 -1
- package/dist/chat/engine.js +17 -19
- package/dist/chat/engine.js.map +1 -1
- package/dist/chat/frontend.d.ts.map +1 -1
- package/dist/chat/frontend.js +17 -2
- package/dist/chat/frontend.js.map +1 -1
- package/dist/chat/native-session.d.ts +25 -3
- package/dist/chat/native-session.d.ts.map +1 -1
- package/dist/chat/native-session.js +72 -31
- package/dist/chat/native-session.js.map +1 -1
- package/dist/chat/picker.d.ts +4 -3
- package/dist/chat/picker.d.ts.map +1 -1
- package/dist/chat/picker.js +7 -5
- package/dist/chat/picker.js.map +1 -1
- package/dist/chat/plain.d.ts.map +1 -1
- package/dist/chat/plain.js +16 -9
- package/dist/chat/plain.js.map +1 -1
- package/dist/chat/session.d.ts +6 -1
- package/dist/chat/session.d.ts.map +1 -1
- package/dist/chat/stdio-io.d.ts +3 -2
- package/dist/chat/stdio-io.d.ts.map +1 -1
- package/dist/chat/stdio-io.js +3 -2
- package/dist/chat/stdio-io.js.map +1 -1
- package/dist/chat/stdio.d.ts.map +1 -1
- package/dist/chat/stdio.js +2 -1
- package/dist/chat/stdio.js.map +1 -1
- package/dist/chat/view.d.ts +37 -6
- package/dist/chat/view.d.ts.map +1 -1
- package/dist/chat/view.js +69 -22
- package/dist/chat/view.js.map +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +5 -2
- package/dist/command.js.map +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +5 -0
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/backup-maintenance.d.ts.map +1 -1
- package/dist/commands/backup-maintenance.js +4 -3
- package/dist/commands/backup-maintenance.js.map +1 -1
- package/dist/commands/backup-read.d.ts.map +1 -1
- package/dist/commands/backup-read.js +4 -1
- package/dist/commands/backup-read.js.map +1 -1
- package/dist/commands/backup-restore.d.ts.map +1 -1
- package/dist/commands/backup-restore.js +7 -10
- package/dist/commands/backup-restore.js.map +1 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +22 -9
- package/dist/commands/backup.js.map +1 -1
- package/dist/commands/describe.d.ts.map +1 -1
- package/dist/commands/describe.js +10 -4
- package/dist/commands/describe.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +119 -13
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/endpoint-authoring.d.ts +2 -0
- package/dist/commands/endpoint-authoring.d.ts.map +1 -1
- package/dist/commands/endpoint-authoring.js +6 -1
- package/dist/commands/endpoint-authoring.js.map +1 -1
- package/dist/commands/history-clear.d.ts.map +1 -1
- package/dist/commands/history-clear.js +3 -2
- package/dist/commands/history-clear.js.map +1 -1
- package/dist/commands/history.d.ts.map +1 -1
- package/dist/commands/history.js +1 -7
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/meshes-add.d.ts.map +1 -1
- package/dist/commands/meshes-add.js +3 -1
- package/dist/commands/meshes-add.js.map +1 -1
- package/dist/commands/mint-endpoint-caller.js +2 -2
- package/dist/commands/mint-endpoint-caller.js.map +1 -1
- package/dist/commands/reset-space-apply.d.ts.map +1 -1
- package/dist/commands/reset-space-apply.js +43 -56
- package/dist/commands/reset-space-apply.js.map +1 -1
- package/dist/commands/reset-store-apply.d.ts +24 -0
- package/dist/commands/reset-store-apply.d.ts.map +1 -1
- package/dist/commands/reset-store-apply.js +115 -53
- package/dist/commands/reset-store-apply.js.map +1 -1
- package/dist/commands/reset.d.ts.map +1 -1
- package/dist/commands/reset.js +30 -18
- package/dist/commands/reset.js.map +1 -1
- package/dist/commands/service-actions.d.ts.map +1 -1
- package/dist/commands/service-actions.js +13 -5
- package/dist/commands/service-actions.js.map +1 -1
- package/dist/commands/service-log-follow.d.ts.map +1 -1
- package/dist/commands/service-log-follow.js +3 -2
- package/dist/commands/service-log-follow.js.map +1 -1
- package/dist/commands/service-registry.js +1 -1
- package/dist/commands/service-registry.js.map +1 -1
- package/dist/commands/service-set-stop.d.ts.map +1 -1
- package/dist/commands/service-set-stop.js +5 -2
- package/dist/commands/service-set-stop.js.map +1 -1
- package/dist/commands/space-delete.d.ts.map +1 -1
- package/dist/commands/space-delete.js +50 -5
- package/dist/commands/space-delete.js.map +1 -1
- package/dist/commands/space-registration.d.ts.map +1 -1
- package/dist/commands/space-registration.js +14 -8
- package/dist/commands/space-registration.js.map +1 -1
- package/dist/commands/spawn.d.ts +4 -4
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +20 -13
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/stack-down.d.ts +15 -1
- package/dist/commands/stack-down.d.ts.map +1 -1
- package/dist/commands/stack-down.js +156 -49
- package/dist/commands/stack-down.js.map +1 -1
- package/dist/commands/stack-up.d.ts +7 -2
- package/dist/commands/stack-up.d.ts.map +1 -1
- package/dist/commands/stack-up.js +63 -24
- package/dist/commands/stack-up.js.map +1 -1
- package/dist/commands/status.d.ts +12 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +71 -17
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/team-boot-controller.js +1 -1
- package/dist/commands/team-boot-controller.js.map +1 -1
- package/dist/commands/team.js +4 -3
- package/dist/commands/team.js.map +1 -1
- package/dist/commands/up.d.ts +2 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +117 -16
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/update.d.ts +2 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +20 -9
- package/dist/commands/update.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/backup-artifact.d.ts +7 -0
- package/dist/lib/backup-artifact.d.ts.map +1 -1
- package/dist/lib/backup-artifact.js +29 -5
- package/dist/lib/backup-artifact.js.map +1 -1
- package/dist/lib/broker-service.d.ts +9 -0
- package/dist/lib/broker-service.d.ts.map +1 -1
- package/dist/lib/broker-service.js +64 -24
- package/dist/lib/broker-service.js.map +1 -1
- package/dist/lib/confirmation-required.d.ts +13 -0
- package/dist/lib/confirmation-required.d.ts.map +1 -0
- package/dist/lib/confirmation-required.js +10 -0
- package/dist/lib/confirmation-required.js.map +1 -0
- package/dist/lib/credential-authority.d.ts.map +1 -1
- package/dist/lib/credential-authority.js +5 -4
- package/dist/lib/credential-authority.js.map +1 -1
- package/dist/lib/delivery-proc.d.ts.map +1 -1
- package/dist/lib/delivery-proc.js +36 -5
- package/dist/lib/delivery-proc.js.map +1 -1
- package/dist/lib/endpoint-client.d.ts +3 -0
- package/dist/lib/endpoint-client.d.ts.map +1 -1
- package/dist/lib/endpoint-client.js +4 -0
- package/dist/lib/endpoint-client.js.map +1 -1
- package/dist/lib/endpoint-errors.d.ts +9 -0
- package/dist/lib/endpoint-errors.d.ts.map +1 -1
- package/dist/lib/endpoint-errors.js +17 -1
- package/dist/lib/endpoint-errors.js.map +1 -1
- package/dist/lib/reset-space-plan.d.ts.map +1 -1
- package/dist/lib/reset-space-plan.js +25 -4
- package/dist/lib/reset-space-plan.js.map +1 -1
- package/dist/lib/restore.d.ts +10 -0
- package/dist/lib/restore.d.ts.map +1 -1
- package/dist/lib/restore.js +35 -1
- package/dist/lib/restore.js.map +1 -1
- package/dist/lib/service-census.d.ts +10 -10
- package/dist/lib/service-install-intent.d.ts +2 -2
- package/dist/lib/service-instances.d.ts +1 -1
- package/dist/lib/service-instances.d.ts.map +1 -1
- package/dist/lib/service-instances.js +2 -2
- package/dist/lib/service-instances.js.map +1 -1
- package/dist/lib/service-journal.d.ts.map +1 -1
- package/dist/lib/service-journal.js +4 -4
- package/dist/lib/service-journal.js.map +1 -1
- package/dist/lib/service-presets.d.ts.map +1 -1
- package/dist/lib/service-presets.js +3 -2
- package/dist/lib/service-presets.js.map +1 -1
- package/dist/lib/service-process.d.ts +26 -1
- package/dist/lib/service-process.d.ts.map +1 -1
- package/dist/lib/service-process.js +140 -20
- package/dist/lib/service-process.js.map +1 -1
- package/dist/lib/service-supervision.d.ts +1 -1
- package/dist/lib/service-systemd-attempt-read.d.ts +3 -3
- package/dist/lib/service-uninstall-intent.d.ts +3 -3
- package/dist/lib/shown-time.d.ts +5 -0
- package/dist/lib/shown-time.d.ts.map +1 -0
- package/dist/lib/shown-time.js +9 -0
- package/dist/lib/shown-time.js.map +1 -0
- package/dist/lib/stack-journal.d.ts +75 -1
- package/dist/lib/stack-journal.d.ts.map +1 -1
- package/dist/lib/stack-journal.js +226 -4
- package/dist/lib/stack-journal.js.map +1 -1
- package/dist/lib/stdout-owner.d.ts +17 -0
- package/dist/lib/stdout-owner.d.ts.map +1 -0
- package/dist/lib/stdout-owner.js +44 -0
- package/dist/lib/stdout-owner.js.map +1 -0
- package/dist/lib/team-additive-attempt.d.ts +1 -1
- package/dist/lib/up-report.d.ts +2 -0
- package/dist/lib/up-report.d.ts.map +1 -1
- package/dist/lib/up-report.js +3 -1
- package/dist/lib/up-report.js.map +1 -1
- package/dist/managed-handoff.d.ts +3 -0
- package/dist/managed-handoff.d.ts.map +1 -1
- package/dist/managed-handoff.js +5 -0
- package/dist/managed-handoff.js.map +1 -1
- package/dist/ui.d.ts +4 -2
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +17 -6
- package/dist/ui.js.map +1 -1
- package/dist/watch-data.js +1 -1
- package/dist/watch-data.js.map +1 -1
- package/dist/watch-json.d.ts.map +1 -1
- package/dist/watch-json.js +3 -2
- package/dist/watch-json.js.map +1 -1
- package/package.json +4 -4
package/dist/commands/status.js
CHANGED
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { CotalEndpoint, dialerFor, EpEnvelopeError, formatAge, isReachable, mintCreds, mintLifecycleUid, resolveService, realDirNoSymlink, invokeRepairingSplit, standaloneConnectOpts, newIdentity, idFromCreds, principalKey, DEV_OWNER, unansweredRequest, resolveAuthProvider, personaDir, presenceText, } from "@cotal-ai/core";
|
|
5
|
-
import { accountInventory, authDir, isCommandFailure, brokerAddressForDisplay, canonicalRoot, CLI_USER_ACTOR, CommandFailure, deliveryCredsKey, DELIVERY_PIDFILE, extensionsDir, findCotalRoot, findPreparedSpace, hasUserAuthState, homeCotalDir, cachedPreferences, resolvePreference, isMeshRegistryError, isWorkspaceTargetError, jsonFlag, loadSoleSpaceAuth, localProcessPath, localProcessVisible, MANAGER_PIDFILE, oneLine, parsePid, plainFlag, preflightTarget, presentationOf, probeLiveness, probeWebReadiness, readCurrent, readMeshRegistry, readRenewalRecord, renderWorkspaceError, resolveMeshTarget, serverFlag, spaceFlag, userAuthStateDir, WEB_PIDFILE, WEB_READINESS_HEADER, workspaceSecretStore, writeResult } from "@cotal-ai/workspace";
|
|
5
|
+
import { accountInventory, authDir, isCommandFailure, readMaintenanceJournal, brokerAddressForDisplay, canonicalRoot, CLI_USER_ACTOR, CommandFailure, deliveryCredsKey, DELIVERY_PIDFILE, extensionsDir, findCotalRoot, findPreparedSpace, hasUserAuthState, homeCotalDir, cachedPreferences, resolvePreference, isMeshRegistryError, isWorkspaceTargetError, jsonFlag, loadSoleSpaceAuth, localProcessPath, localProcessVisible, MANAGER_PIDFILE, oneLine, parsePid, plainFlag, preflightTarget, presentationOf, probeLiveness, probeWebReadiness, readCurrent, readMeshRegistry, readRenewalRecord, renderWorkspaceError, resolveMeshTarget, serverFlag, spaceFlag, userAuthStateDir, WEB_PIDFILE, WEB_READINESS_HEADER, workspaceSecretStore, writeResult } from "@cotal-ai/workspace";
|
|
6
6
|
import { localProcessSurface } from "../ext-loader.js";
|
|
7
7
|
import { cliVersion, cliProvenance, readExtensionVersions } from "../lib/version.js";
|
|
8
8
|
import { agentSkillsSkew } from "../lib/agent-skills.js";
|
|
@@ -21,6 +21,8 @@ import { serviceDefinitionProjection, serviceDefinitionStore } from "../lib/serv
|
|
|
21
21
|
import { instanceProjection, serviceInstances } from "../lib/service-instances.js";
|
|
22
22
|
import { freshTeamAttemptSettled, listFreshTeamAttempts, listFreshTeamSummaries } from "../lib/team-fresh.js";
|
|
23
23
|
import { additiveTeamRecordedState, listAdditiveTeamAttempts } from "../lib/team-additive-attempt.js";
|
|
24
|
+
import { restoreNextStep } from "../lib/restore.js";
|
|
25
|
+
import { readStackJournal } from "../lib/stack-journal.js";
|
|
24
26
|
/** `--components` is the fail-loud health pass with a machine-readable EXIT DISPOSITION. Bare
|
|
25
27
|
* `status` is a broad, recovery-oriented report: it exits 0, or 4 when it could not read part of what
|
|
26
28
|
* it reports; this explicit mode is for an operator or monitor that needs a component state per
|
|
@@ -120,7 +122,8 @@ export async function status(args) {
|
|
|
120
122
|
const target = await readSelected(selected, responder, gaps, hints);
|
|
121
123
|
const services = readOwnedServices(selected, gaps);
|
|
122
124
|
const bootAttempts = readBootAttempts(root, gaps);
|
|
123
|
-
const
|
|
125
|
+
const maintenance = readMaintenance(root, gaps);
|
|
126
|
+
const result = { kind: "infrastructure", machine, extensions, folder, meshes, selected: target, services, bootAttempts, maintenance, hints };
|
|
124
127
|
const parts = gaps.warnings.length;
|
|
125
128
|
writeResult(presentation, {
|
|
126
129
|
command: "status",
|
|
@@ -133,6 +136,22 @@ export async function status(args) {
|
|
|
133
136
|
if (values.components)
|
|
134
137
|
await printComponentHealth(cwd, values);
|
|
135
138
|
}
|
|
139
|
+
/** The folder's maintenance journal, read only. An unreadable one is reported, never taken for none. */
|
|
140
|
+
function readMaintenance(root, gaps) {
|
|
141
|
+
try {
|
|
142
|
+
const journal = readMaintenanceJournal(root);
|
|
143
|
+
if (!journal)
|
|
144
|
+
return null;
|
|
145
|
+
const attemptId = "restore" in journal ? journal.restore.attemptId : journal.cut.attemptId;
|
|
146
|
+
const next = "restore" in journal ? restoreNextStep(journal.state, attemptId)
|
|
147
|
+
: journal.state === "ready" ? `create a backup with ${displayCmd()} backup create <dir>, or resume with bare ${displayCmd()} up` : null;
|
|
148
|
+
return { root, space: journal.space, state: journal.state, attemptId, next };
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
gaps.add("MAINTENANCE_JOURNAL_UNREADABLE", "this folder's maintenance journal could not be read; no absent or settled state was inferred", { root });
|
|
152
|
+
return { root, space: null, state: "unreadable", attemptId: null, next: null };
|
|
153
|
+
}
|
|
154
|
+
}
|
|
136
155
|
/** Local boot and additive intents are recovery coordinates, not evidence of native state. */
|
|
137
156
|
function readBootAttempts(root, gaps) {
|
|
138
157
|
const result = { root, state: "not-checked", observedAt: new Date().toISOString(), unsettled: [], additive: [], unreadable: [] };
|
|
@@ -378,13 +397,14 @@ async function readResponderAxis(selected) {
|
|
|
378
397
|
}
|
|
379
398
|
async function readFolder(root, selected, values, responder, gaps, hints) {
|
|
380
399
|
const cmd = displayCmd();
|
|
381
|
-
const folder = (auth, processes = null, storedState = false, processSpace = null) => ({
|
|
400
|
+
const folder = (auth, processes = null, storedState = false, processSpace = null, controllerStack = false) => ({
|
|
382
401
|
root,
|
|
383
402
|
auth,
|
|
384
403
|
...folderPersonas(root, selected, values, gaps, hints),
|
|
385
404
|
processes,
|
|
386
405
|
processSpace,
|
|
387
406
|
storedState,
|
|
407
|
+
controllerStack,
|
|
388
408
|
});
|
|
389
409
|
const unreadable = (error, hint) => {
|
|
390
410
|
gaps.add("AUTH_UNREADABLE", `this folder's trust material could not be read: ${error}`, { root });
|
|
@@ -472,10 +492,18 @@ async function readFolder(root, selected, values, responder, gaps, hints) {
|
|
|
472
492
|
// A stopped mesh with a persisted store: name the reset verb. Stale state (e.g. durables from
|
|
473
493
|
// an older Cotal generation) is otherwise invisible until a spawn fails on it. The restart is
|
|
474
494
|
// deliberately "your usual flags", never a bare `up` (mode/name/store-dir aren't recorded).
|
|
475
|
-
|
|
495
|
+
// A controller stack's broker has no legacy pidfile, so that heuristic says nothing about it.
|
|
496
|
+
let controllerStack = false;
|
|
497
|
+
try {
|
|
498
|
+
controllerStack = readStackJournal(root)?.journal.space === space;
|
|
499
|
+
}
|
|
500
|
+
catch {
|
|
501
|
+
controllerStack = false;
|
|
502
|
+
}
|
|
503
|
+
const storedState = !controllerStack && nats?.liveness !== "alive" && existsSync(join(root, ".cotal", "nats"));
|
|
476
504
|
if (storedState)
|
|
477
505
|
hints.push(`if the stored JetStream state is stale: ${cmd} clean store --force, then \`up\` with your usual flags (\`clean all\` also resets identity)`);
|
|
478
|
-
return folder({ state: auth ? "space" : "none", spaces: auth ? [auth.space] : [], userAuth: userDisk, error: null }, processes, storedState, space);
|
|
506
|
+
return folder({ state: auth ? "space" : "none", spaces: auth ? [auth.space] : [], userAuth: userDisk, error: null }, processes, storedState, space, controllerStack);
|
|
479
507
|
}
|
|
480
508
|
/** The folder's persona catalog, which must never let a catalog imply a `spawn` the operator does
|
|
481
509
|
* not have.
|
|
@@ -961,6 +989,20 @@ function meshesSections(m) {
|
|
|
961
989
|
sections.push({ title: "Space Catalog Accounts", blocks: [{ kind: "lines", lines: m.catalogs.map((r) => `${r.idp} ${r.state}${r.error ? `: ${r.error}` : ""}`) }] });
|
|
962
990
|
return sections;
|
|
963
991
|
}
|
|
992
|
+
/** The selected space's delivery responder (#1576). Bare status and the verbose mesh section both
|
|
993
|
+
* state it, so an operator on a manager host away from the broker's folder still sees it. */
|
|
994
|
+
function responderText(state) {
|
|
995
|
+
if (state === "unbound")
|
|
996
|
+
return { text: `NOT BOUND - ${RESPONDER_UNBOUND_CONSEQUENCE} · start it with \`${displayCmd()} up\` (or \`${displayCmd()} deliver --space <space>\`)`, tone: "failed" };
|
|
997
|
+
// A stale record is NOT BOUND with a different next move: the slot is occupied by a corpse, so
|
|
998
|
+
// starting a daemon now loses the single-flight CAS. Say that, rather than sending the operator
|
|
999
|
+
// into a refusal they will read as a second failure.
|
|
1000
|
+
if (state === "stale")
|
|
1001
|
+
return { text: `NOT BOUND - a DEAD daemon's ready record still holds the lease - ${RESPONDER_UNBOUND_CONSEQUENCE} · it expires on its own; a replacement can then take the shard`, tone: "failed" };
|
|
1002
|
+
if (state === "bound")
|
|
1003
|
+
return { text: "bound", tone: "ok" };
|
|
1004
|
+
return undefined;
|
|
1005
|
+
}
|
|
964
1006
|
function selectedSection(s) {
|
|
965
1007
|
if (!s.resolved)
|
|
966
1008
|
return { title: "Selected Mesh", blocks: [{ kind: "fields", rows: [["target", cell(s.code, "failed")]] }] };
|
|
@@ -998,15 +1040,9 @@ function selectedSection(s) {
|
|
|
998
1040
|
}
|
|
999
1041
|
else {
|
|
1000
1042
|
rows.push(["connection", s.connection === "ok" ? cell("ok", "ok") : cell(`${s.connection}${s.staleRecord ? " (stale registry entry)" : ""}`, "failed")]);
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
// starting a daemon now loses the single-flight CAS. Say that, rather than sending the operator
|
|
1005
|
-
// into a refusal they will read as a second failure.
|
|
1006
|
-
else if (s.deliveryResponder === "stale")
|
|
1007
|
-
rows.push(["delivery responder", cell(`NOT BOUND - a DEAD daemon's ready record still holds the lease - ${RESPONDER_UNBOUND_CONSEQUENCE} · it expires on its own; a replacement can then take the shard`, "failed")]);
|
|
1008
|
-
else if (s.deliveryResponder === "bound")
|
|
1009
|
-
rows.push(["delivery responder", cell("bound", "ok")]);
|
|
1043
|
+
const responder = responderText(s.deliveryResponder);
|
|
1044
|
+
if (responder)
|
|
1045
|
+
rows.push(["delivery responder", cell(responder.text, responder.tone)]);
|
|
1010
1046
|
}
|
|
1011
1047
|
if (s.snapshot.state === "unavailable" || (s.mode === "user" && s.snapshot.state === "skipped"))
|
|
1012
1048
|
rows.push(["live snapshot", cell(`${s.snapshot.state === "unavailable" ? "unavailable" : "not read"} (${s.snapshot.reason})`, s.snapshot.state === "unavailable" ? "failed" : "hint")]);
|
|
@@ -1106,11 +1142,14 @@ function selectedOverview(r) {
|
|
|
1106
1142
|
const s = r.selected;
|
|
1107
1143
|
if (!s.resolved)
|
|
1108
1144
|
return { title: "Selected space", blocks: [{ kind: "lines", lines: [stateCell(s.message, "failed")] }] };
|
|
1109
|
-
|
|
1145
|
+
// A broker named with `--server` is reported even when nothing on this machine is registered.
|
|
1146
|
+
if (s.source !== "flag-server" && !r.meshes.items.length && !r.meshes.currentPrepared && r.folder.auth.state === "none" && !r.folder.processes?.some((item) => item.pid !== null))
|
|
1110
1147
|
return undefined;
|
|
1148
|
+
const responder = responderText(s.deliveryResponder);
|
|
1111
1149
|
const rows = [
|
|
1112
1150
|
["Broker", s.server ?? stateCell("address unavailable", "failed")],
|
|
1113
1151
|
["Connection", connectionCell(s)],
|
|
1152
|
+
...(responder ? [["Delivery responder", stateCell(responder.text, responder.tone)]] : []),
|
|
1114
1153
|
["Access", s.mode === "user" ? "user sign-in" : s.mode === "auth" ? "static auth" : "open"],
|
|
1115
1154
|
["Project", s.root],
|
|
1116
1155
|
["Default agent", r.machine.defaults ? `${r.machine.defaults.harness ?? "application not set"} · persona ${r.machine.defaults.persona ?? "not set"}` : stateCell("saved defaults could not be read", "failed")],
|
|
@@ -1133,7 +1172,10 @@ function selectedOverview(r) {
|
|
|
1133
1172
|
if (s.snapshot.state === "unavailable")
|
|
1134
1173
|
rows.push(["Live details", stateCell(`unavailable · ${s.snapshot.reason}`, "waiting")]);
|
|
1135
1174
|
const blocks = [{ kind: "fields", rows }];
|
|
1136
|
-
if (r.folder.root === s.root && r.folder.processSpace === s.space && r.folder.
|
|
1175
|
+
if (r.folder.root === s.root && r.folder.processSpace === s.space && r.folder.controllerStack) {
|
|
1176
|
+
blocks.push({ kind: "lines", lines: [cell("Controller stack · its members are the stack-* rows under Owned services", "hint")] });
|
|
1177
|
+
}
|
|
1178
|
+
else if (r.folder.root === s.root && r.folder.processSpace === s.space && r.folder.processes) {
|
|
1137
1179
|
blocks.push({ kind: "lines", lines: [cell("Legacy local process records", "label")] });
|
|
1138
1180
|
blocks.push({
|
|
1139
1181
|
kind: "table", header: false,
|
|
@@ -1173,6 +1215,9 @@ function nextActions(r) {
|
|
|
1173
1215
|
if (r.meshes.items.length > 1)
|
|
1174
1216
|
items.push({ command: `${cmd} status --all`, description: "Check every registered space" });
|
|
1175
1217
|
}
|
|
1218
|
+
// A local controller stack that does not answer restarts its stopped members from its own records.
|
|
1219
|
+
if (r.selected.resolved && r.selected.connection !== "ok" && r.selected.connection !== "reachable" && r.folder.controllerStack && r.folder.root === r.selected.root && r.folder.processSpace === r.selected.space)
|
|
1220
|
+
items.unshift({ command: `${cmd} up --root ${r.selected.root}`, description: "Restart this stack's stopped members from its recorded inputs" });
|
|
1176
1221
|
if (r.selected.resolved && r.selected.mode === "user" && r.selected.login && !r.selected.login.subject)
|
|
1177
1222
|
items.unshift({ command: `${cmd} login --idp ${r.selected.login.idp}`, description: "Sign in to the selected space" });
|
|
1178
1223
|
return { title: "Next", blocks: [{ kind: "commands", items }, ...r.hints.map((hint) => ({ kind: "lines", lines: [cell(hint, "hint")] }))] };
|
|
@@ -1221,12 +1266,21 @@ function bootAttemptOverview(snapshot) {
|
|
|
1221
1266
|
{ kind: "commands", items: [{ command: `${displayCmd()} team show <deployment-id>`, description: "Inspect the original attempt from its recorded root" }] },
|
|
1222
1267
|
] };
|
|
1223
1268
|
}
|
|
1269
|
+
function maintenanceOverview(maintenance) {
|
|
1270
|
+
if (!maintenance)
|
|
1271
|
+
return undefined;
|
|
1272
|
+
return { title: "Maintenance", blocks: [
|
|
1273
|
+
{ kind: "fields", rows: [["Folder root", maintenance.root], ["Space", maintenance.space ?? "not read"], ["State", maintenance.state], ["Attempt", maintenance.attemptId ?? "not read"]] },
|
|
1274
|
+
...(maintenance.next ? [{ kind: "lines", lines: [maintenance.next] }] : []),
|
|
1275
|
+
] };
|
|
1276
|
+
}
|
|
1224
1277
|
/** The approved screen hierarchy; record-level diagnostics are opt-in. */
|
|
1225
1278
|
export function statusView(r, verbose = false) {
|
|
1226
1279
|
const selected = selectedOverview(r);
|
|
1227
1280
|
const owned = ownedServicesOverview(r.services);
|
|
1228
1281
|
const attempts = bootAttemptOverview(r.bootAttempts);
|
|
1229
|
-
const
|
|
1282
|
+
const maintenance = maintenanceOverview(r.maintenance);
|
|
1283
|
+
const sections = [machineOverview(r), brokerOverview(r), ...(selected ? [selected] : []), ...(maintenance ? [maintenance] : []), ...(attempts ? [attempts] : []), ...(owned ? [owned] : [])];
|
|
1230
1284
|
if (verbose)
|
|
1231
1285
|
sections.push(machineSection(r.machine), extensionsSection(r.extensions), folderSection(r.folder, r.selected), ...meshesSections(r.meshes), selectedSection(r.selected));
|
|
1232
1286
|
sections.push(nextActions(r));
|