@cotal-ai/cli 0.173.0 → 0.174.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/command.d.ts.map +1 -1
- package/dist/command.js +17 -9
- package/dist/command.js.map +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +22 -11
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/channel-members.d.ts.map +1 -1
- package/dist/commands/channel-members.js +29 -2
- package/dist/commands/channel-members.js.map +1 -1
- package/dist/commands/channels.js +5 -1
- package/dist/commands/channels.js.map +1 -1
- package/dist/commands/clean.d.ts +1 -0
- package/dist/commands/clean.d.ts.map +1 -1
- package/dist/commands/clean.js +19 -3
- package/dist/commands/clean.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +31 -12
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/ext.d.ts.map +1 -1
- package/dist/commands/ext.js +22 -5
- package/dist/commands/ext.js.map +1 -1
- package/dist/commands/help.d.ts +1 -1
- package/dist/commands/help.js +1 -1
- package/dist/commands/history.d.ts +10 -2
- package/dist/commands/history.d.ts.map +1 -1
- package/dist/commands/history.js +21 -9
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/join.js +5 -1
- package/dist/commands/join.js.map +1 -1
- package/dist/commands/mint-endpoint-caller.d.ts.map +1 -1
- package/dist/commands/mint-endpoint-caller.js +13 -2
- package/dist/commands/mint-endpoint-caller.js.map +1 -1
- package/dist/commands/mint.d.ts.map +1 -1
- package/dist/commands/mint.js +10 -2
- package/dist/commands/mint.js.map +1 -1
- package/dist/commands/persona.js +3 -3
- package/dist/commands/persona.js.map +1 -1
- package/dist/commands/personas.js +1 -1
- package/dist/commands/personas.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +10 -6
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +17 -1
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/space.js +1 -1
- package/dist/commands/space.js.map +1 -1
- package/dist/commands/spawn-managed-launch.d.ts.map +1 -1
- package/dist/commands/spawn-managed-launch.js +6 -4
- package/dist/commands/spawn-managed-launch.js.map +1 -1
- package/dist/commands/spawn-preview.d.ts.map +1 -1
- package/dist/commands/spawn-preview.js +3 -0
- package/dist/commands/spawn-preview.js.map +1 -1
- package/dist/commands/stack-up.d.ts.map +1 -1
- package/dist/commands/stack-up.js +13 -6
- package/dist/commands/stack-up.js.map +1 -1
- package/dist/commands/status-model.d.ts +402 -0
- package/dist/commands/status-model.d.ts.map +1 -0
- package/dist/commands/status-model.js +64 -0
- package/dist/commands/status-model.js.map +1 -0
- package/dist/commands/status.d.ts +4 -368
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +20 -77
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/team-deploy-apply.d.ts.map +1 -1
- package/dist/commands/team-deploy-apply.js +0 -2
- package/dist/commands/team-deploy-apply.js.map +1 -1
- package/dist/commands/up-pending.d.ts +24 -0
- package/dist/commands/up-pending.d.ts.map +1 -0
- package/dist/commands/up-pending.js +5 -0
- package/dist/commands/up-pending.js.map +1 -0
- package/dist/commands/up-transport.d.ts +121 -0
- package/dist/commands/up-transport.d.ts.map +1 -0
- package/dist/commands/up-transport.js +348 -0
- package/dist/commands/up-transport.js.map +1 -0
- package/dist/commands/up.d.ts +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +50 -391
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/update-continuity.d.ts +47 -0
- package/dist/commands/update-continuity.d.ts.map +1 -0
- package/dist/commands/update-continuity.js +430 -0
- package/dist/commands/update-continuity.js.map +1 -0
- package/dist/commands/update-process.d.ts +26 -0
- package/dist/commands/update-process.d.ts.map +1 -0
- package/dist/commands/update-process.js +283 -0
- package/dist/commands/update-process.js.map +1 -0
- package/dist/commands/update-release.d.ts +32 -0
- package/dist/commands/update-release.d.ts.map +1 -0
- package/dist/commands/update-release.js +232 -0
- package/dist/commands/update-release.js.map +1 -0
- package/dist/commands/update.d.ts +6 -54
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +25 -949
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/use.d.ts.map +1 -1
- package/dist/commands/use.js +4 -7
- package/dist/commands/use.js.map +1 -1
- package/dist/console/commands.js +2 -2
- package/dist/console/commands.js.map +1 -1
- package/dist/help.d.ts +1 -1
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +3 -1
- package/dist/help.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/choose-target.d.ts +2 -0
- package/dist/lib/choose-target.d.ts.map +1 -1
- package/dist/lib/choose-target.js +16 -1
- package/dist/lib/choose-target.js.map +1 -1
- package/dist/lib/credential-authority.d.ts +1 -1
- package/dist/lib/credential-authority.d.ts.map +1 -1
- package/dist/lib/credential-authority.js +8 -3
- package/dist/lib/credential-authority.js.map +1 -1
- package/dist/lib/foreground-hold.d.ts +2 -0
- package/dist/lib/foreground-hold.d.ts.map +1 -1
- package/dist/lib/foreground-hold.js +47 -1
- package/dist/lib/foreground-hold.js.map +1 -1
- package/dist/lib/mint-renewal.d.ts +5 -0
- package/dist/lib/mint-renewal.d.ts.map +1 -0
- package/dist/lib/mint-renewal.js +60 -0
- package/dist/lib/mint-renewal.js.map +1 -0
- package/dist/lib/persona-files.d.ts +1 -1
- package/dist/lib/persona-files.d.ts.map +1 -1
- package/dist/lib/persona-files.js +5 -5
- package/dist/lib/persona-files.js.map +1 -1
- package/dist/lib/restore-streams.d.ts +18 -0
- package/dist/lib/restore-streams.d.ts.map +1 -0
- package/dist/lib/restore-streams.js +275 -0
- package/dist/lib/restore-streams.js.map +1 -0
- package/dist/lib/restore.d.ts +2 -0
- package/dist/lib/restore.d.ts.map +1 -1
- package/dist/lib/restore.js +5 -273
- package/dist/lib/restore.js.map +1 -1
- package/dist/lib/self-exec.d.ts +5 -2
- package/dist/lib/self-exec.d.ts.map +1 -1
- package/dist/lib/self-exec.js +6 -3
- package/dist/lib/self-exec.js.map +1 -1
- package/dist/lib/stack-journal.d.ts +3 -1
- package/dist/lib/stack-journal.d.ts.map +1 -1
- package/dist/lib/stack-journal.js +10 -0
- package/dist/lib/stack-journal.js.map +1 -1
- package/dist/lib/update-connector-config.d.ts +2 -0
- package/dist/lib/update-connector-config.d.ts.map +1 -1
- package/dist/lib/update-connector-config.js +15 -1
- package/dist/lib/update-connector-config.js.map +1 -1
- package/dist/lib/update-managers.d.ts.map +1 -1
- package/dist/lib/update-managers.js +11 -3
- package/dist/lib/update-managers.js.map +1 -1
- package/dist/lib/update-recovery-state.d.ts +7 -0
- package/dist/lib/update-recovery-state.d.ts.map +1 -1
- package/dist/lib/update-recovery-state.js +55 -2
- package/dist/lib/update-recovery-state.js.map +1 -1
- package/dist/lib/update-snapshot.d.ts.map +1 -1
- package/dist/lib/update-snapshot.js +14 -7
- package/dist/lib/update-snapshot.js.map +1 -1
- package/dist/seed/lock.d.ts +1 -1
- package/dist/seed/lock.d.ts.map +1 -1
- package/dist/seed/lock.js +3 -2
- package/dist/seed/lock.js.map +1 -1
- package/dist/telemetry.d.ts +6 -0
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +11 -5
- package/dist/telemetry.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,376 +1,13 @@
|
|
|
1
1
|
import { type ParsedArgs } from "@cotal-ai/core";
|
|
2
|
-
import { type
|
|
3
|
-
import { type CliProvenance } from "../lib/version.js";
|
|
4
|
-
import { type MachineStatus } from "../lib/status.js";
|
|
5
|
-
import { type DeliveryResponderState } from "../lib/delivery-responder.js";
|
|
6
|
-
import { type StoreWriteObservation } from "../lib/broker-store-health.js";
|
|
7
|
-
import { serviceDefinitionProjection } from "../lib/service-definitions.js";
|
|
8
|
-
import { instanceProjection } from "../lib/service-instances.js";
|
|
9
|
-
import { additiveTeamRecordedState } from "../lib/team-additive-attempt.js";
|
|
10
|
-
import { type StackOperationBlock, type StackRole } from "../lib/stack-journal.js";
|
|
2
|
+
import { type Report } from "@cotal-ai/workspace";
|
|
11
3
|
import { readCursor } from "../seed/lock.js";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* component and an exit code to branch on.
|
|
16
|
-
*
|
|
17
|
-
* THAT DIVISION IS ABOUT EXIT CODES AND COMPLETENESS, NOT ABOUT TRUTHFULNESS, and #1576 is where the
|
|
18
|
-
* difference bit. Bare status printed `delivery running (pid N)` over a daemon whose responder had
|
|
19
|
-
* never bound — not a broad answer but a specific and wrong one, identical to the line it prints
|
|
20
|
-
* when delivery is fully healthy, for 22 hours, while spawn/retirement/join all failed. A broad
|
|
21
|
-
* diagnostic may omit an axis; it may not claim one it never checked. So bare status stays broad,
|
|
22
|
-
* and the delivery row names the responder state it actually read (or says plainly that it did not
|
|
23
|
-
* read it, and points here). */
|
|
24
|
-
export declare const statusFlags: readonly [{
|
|
25
|
-
readonly name: "space";
|
|
26
|
-
readonly short: "s";
|
|
27
|
-
readonly type: "string";
|
|
28
|
-
readonly value: "<s>";
|
|
29
|
-
readonly description: "target space (default: the resolved mesh)";
|
|
30
|
-
}, {
|
|
31
|
-
readonly name: "server";
|
|
32
|
-
readonly type: "string";
|
|
33
|
-
readonly value: "<url>";
|
|
34
|
-
readonly description: "broker URL (overrides the mesh registry entry)";
|
|
35
|
-
}, {
|
|
36
|
-
readonly name: "on";
|
|
37
|
-
readonly type: "string";
|
|
38
|
-
readonly value: "<manager-instance>";
|
|
39
|
-
readonly description: "named agent: inspect one manager instance";
|
|
40
|
-
}, {
|
|
41
|
-
readonly name: "creds";
|
|
42
|
-
readonly type: "string";
|
|
43
|
-
readonly value: "<file>";
|
|
44
|
-
readonly description: "explicit credential file (unsupported for status)";
|
|
45
|
-
}, {
|
|
46
|
-
readonly name: "all";
|
|
47
|
-
readonly type: "boolean";
|
|
48
|
-
readonly description: "check every recorded mesh, not only the selected one, and report every row in full";
|
|
49
|
-
}, {
|
|
50
|
-
readonly name: "wide";
|
|
51
|
-
readonly type: "boolean";
|
|
52
|
-
readonly description: "report every row in full: each known agent application, each extension, and the spaces under their broker addresses";
|
|
53
|
-
}, {
|
|
54
|
-
readonly name: "verbose";
|
|
55
|
-
readonly short: "v";
|
|
56
|
-
readonly type: "boolean";
|
|
57
|
-
readonly description: "include installation paths, local records and detailed diagnostics";
|
|
58
|
-
}, {
|
|
59
|
-
readonly name: "components";
|
|
60
|
-
readonly type: "boolean";
|
|
61
|
-
readonly description: "probe manager, delivery, web, and registered broker component health (exit: 0 serving, an intentionally omitted manager, or the optional dashboard not installed or not started; 1 absent; 2 present but not serving; 3 probe refused)";
|
|
62
|
-
}, {
|
|
63
|
-
readonly name: "json";
|
|
64
|
-
readonly short: "j";
|
|
65
|
-
readonly type: "boolean";
|
|
66
|
-
readonly description: "structured output on stdout";
|
|
67
|
-
}, {
|
|
68
|
-
readonly name: "plain";
|
|
69
|
-
readonly type: "boolean";
|
|
70
|
-
readonly description: "plain line-oriented output";
|
|
71
|
-
}];
|
|
72
|
-
/** What a persona catalog holds: whether its `default` passes the loader spawn uses, and how many of
|
|
73
|
-
* the demo team's personas do. A catalog directory that exists and cannot be read is `unreadable`,
|
|
74
|
-
* with no demo count and the error. */
|
|
75
|
-
interface PersonaCatalog {
|
|
76
|
-
root: string;
|
|
77
|
-
default: "valid" | "invalid" | "missing" | "unreadable";
|
|
78
|
-
demo: number | null;
|
|
79
|
-
error: string | null;
|
|
80
|
-
}
|
|
81
|
-
/** One local process row: the state word, the pid it recorded, and what else the row knows. */
|
|
82
|
-
interface ProcessRow {
|
|
83
|
-
name: string;
|
|
84
|
-
state: "running" | "stopped" | "not-serving" | "unknown" | "unreadable";
|
|
85
|
-
pid: number | null;
|
|
86
|
-
detail: string | null;
|
|
87
|
-
/** The nats summary's source. Older serialized reports and other components may omit it. */
|
|
88
|
-
source?: "legacy-pidfile" | "owned-service";
|
|
89
|
-
legacyPidfile?: {
|
|
90
|
-
state: ProcessRow["state"];
|
|
91
|
-
pid: number | null;
|
|
92
|
-
detail: string | null;
|
|
93
|
-
};
|
|
94
|
-
ownedService?: Pick<ReturnType<typeof instanceProjection>, "definition" | "instanceId" | "observedProcess" | "recordedState" | "pid"> | null;
|
|
95
|
-
}
|
|
96
|
-
interface OwnedServiceStatus {
|
|
97
|
-
space: string | null;
|
|
98
|
-
state: "read" | "partial" | "not-checked";
|
|
99
|
-
observedAt: string;
|
|
100
|
-
atomicSnapshot: false;
|
|
101
|
-
definitions: ReturnType<typeof serviceDefinitionProjection>[] | null;
|
|
102
|
-
instances: ReturnType<typeof instanceProjection>[] | null;
|
|
103
|
-
scope: "selected-space local owned records; no remote registration or fresh endpoint probe";
|
|
104
|
-
}
|
|
105
|
-
/** Everything bare `status` reports, in the order it prints. The JSON envelope carries it as
|
|
106
|
-
* `result`, and the report is built from it, so the two cannot disagree. A part that could not be
|
|
107
|
-
* read is null or carries its error, and is named in the warnings. */
|
|
108
|
-
export interface StatusResult {
|
|
109
|
-
kind: "infrastructure";
|
|
110
|
-
machine: {
|
|
111
|
-
version: string;
|
|
112
|
-
node: string;
|
|
113
|
-
platform: string;
|
|
114
|
-
install: CliProvenance;
|
|
115
|
-
nats: MachineStatus["nats"];
|
|
116
|
-
natsServer: MachineStatus["natsServer"];
|
|
117
|
-
natsProblem: MachineStatus["natsProblem"];
|
|
118
|
-
integrations: {
|
|
119
|
-
name: string;
|
|
120
|
-
state: "ok" | "warn" | "error" | "off";
|
|
121
|
-
text: string;
|
|
122
|
-
}[];
|
|
123
|
-
connectors: {
|
|
124
|
-
name: string;
|
|
125
|
-
requires: string[];
|
|
126
|
-
missing: string[];
|
|
127
|
-
}[] | null;
|
|
128
|
-
/** For a resolved space, the bare direct launch's persona and effective harness, including its pin. */
|
|
129
|
-
defaults: {
|
|
130
|
-
harness: string | null;
|
|
131
|
-
persona: string | null;
|
|
132
|
-
} | null;
|
|
133
|
-
skills: {
|
|
134
|
-
state: "current" | "not-installed" | "behind" | "unreadable";
|
|
135
|
-
total: number;
|
|
136
|
-
behind: number;
|
|
137
|
-
retired: number;
|
|
138
|
-
error: string | null;
|
|
139
|
-
};
|
|
140
|
-
web: {
|
|
141
|
-
installed: boolean | null;
|
|
142
|
-
installedError: string | null;
|
|
143
|
-
url: string | null;
|
|
144
|
-
urlError: string | null;
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
extensions: {
|
|
148
|
-
root: string;
|
|
149
|
-
items: {
|
|
150
|
-
package: string;
|
|
151
|
-
label: string;
|
|
152
|
-
version: string;
|
|
153
|
-
}[] | null;
|
|
154
|
-
};
|
|
155
|
-
folder: {
|
|
156
|
-
root: string;
|
|
157
|
-
auth: {
|
|
158
|
-
state: "space" | "spaces" | "none" | "unreadable";
|
|
159
|
-
spaces: string[];
|
|
160
|
-
userAuth: boolean;
|
|
161
|
-
error: string | null;
|
|
162
|
-
};
|
|
163
|
-
personas: PersonaCatalog;
|
|
164
|
-
launches: boolean | null;
|
|
165
|
-
processes: ProcessRow[] | null;
|
|
166
|
-
processSpace: string | null;
|
|
167
|
-
storedState: boolean;
|
|
168
|
-
/** Whether this root records a controller stack for the process space. The nats summary uses
|
|
169
|
-
* its owned broker observation and retains the legacy pidfile observation separately. */
|
|
170
|
-
controllerStack: boolean;
|
|
171
|
-
/** Presence of a folder's journal, even when it cannot be parsed or read. Older inputs may omit it. */
|
|
172
|
-
stackJournal?: "present" | "absent" | "unreadable";
|
|
173
|
-
/** Whether that controller stack was started with `--no-manager`, so it runs no manager by choice. */
|
|
174
|
-
noManager: boolean;
|
|
175
|
-
/** The service of this space, outside that stack, whose process runs this root's manager, as a
|
|
176
|
-
* `manager` preset started here does. Null when none does; older inputs may omit it. */
|
|
177
|
-
managerService?: {
|
|
178
|
-
definition: string;
|
|
179
|
-
instanceId: string;
|
|
180
|
-
} | null;
|
|
181
|
-
/** The services of this space, outside that stack, whose processes run this root's records, as
|
|
182
|
-
* `up` names them before it refuses to start the stack beside them. Null when the records could
|
|
183
|
-
* not be read; older inputs may omit it. */
|
|
184
|
-
heldServices?: {
|
|
185
|
-
definition: string;
|
|
186
|
-
instanceId: string;
|
|
187
|
-
record: string;
|
|
188
|
-
pid: number;
|
|
189
|
-
}[] | null;
|
|
190
|
-
/** The member that keeps `up` and `down` from settling that stack's last operation, which ended
|
|
191
|
-
* with no recorded outcome, with why and the way out their refusal names. Null when none does;
|
|
192
|
-
* older inputs may omit it. */
|
|
193
|
-
stackBlock?: StackOperationBlock | null;
|
|
194
|
-
/** That stack's last `up` or `down` when it ended with no recorded outcome part way, with the
|
|
195
|
-
* members left running and stopped. Null when there is none; older inputs may omit it. */
|
|
196
|
-
stackUnfinished?: {
|
|
197
|
-
kind: "up" | "down";
|
|
198
|
-
id: string;
|
|
199
|
-
running: StackRole[];
|
|
200
|
-
stopped: StackRole[];
|
|
201
|
-
noManager: boolean;
|
|
202
|
-
} | null;
|
|
203
|
-
};
|
|
204
|
-
meshes: {
|
|
205
|
-
current: string | null;
|
|
206
|
-
currentRecorded: boolean;
|
|
207
|
-
/** Whether the selection names a space `cotal space create` prepared and no `cotal up` started. */
|
|
208
|
-
currentPrepared: boolean;
|
|
209
|
-
/** Whether any local space is prepared, including one that is not selected. Older inputs may omit it. */
|
|
210
|
-
hasPrepared?: boolean;
|
|
211
|
-
/** Whether that prepared space's controller stack ran and was stopped. */
|
|
212
|
-
currentStopped: boolean;
|
|
213
|
-
/** This folder's space when a command without `--space` targets it here instead of `current`, as
|
|
214
|
-
* `cotal space` gives it, else null. Older inputs may omit it. */
|
|
215
|
-
folder?: string | null;
|
|
216
|
-
unreadable: {
|
|
217
|
-
file: string;
|
|
218
|
-
error: string;
|
|
219
|
-
}[];
|
|
220
|
-
items: {
|
|
221
|
-
space: string;
|
|
222
|
-
server: string | null;
|
|
223
|
-
mode: MeshEntry["mode"];
|
|
224
|
-
root: string;
|
|
225
|
-
origin: MeshEntry["origin"] | null;
|
|
226
|
-
tlsRequired: boolean;
|
|
227
|
-
eventsRequired: boolean;
|
|
228
|
-
modeChecked: boolean;
|
|
229
|
-
current: boolean;
|
|
230
|
-
check: BrokerCheck | "not-checked";
|
|
231
|
-
catalog: {
|
|
232
|
-
name: string | null;
|
|
233
|
-
fetchedAt: string | null;
|
|
234
|
-
error: string | null;
|
|
235
|
-
} | null;
|
|
236
|
-
}[];
|
|
237
|
-
/** `account` is the IdP subject whose catalog this is, which its error line names instead of the
|
|
238
|
-
* token URL. Older inputs may omit it. */
|
|
239
|
-
catalogs: {
|
|
240
|
-
idp: string;
|
|
241
|
-
account?: string;
|
|
242
|
-
state: string;
|
|
243
|
-
error: string | null;
|
|
244
|
-
}[];
|
|
245
|
-
};
|
|
246
|
-
selected: SelectedResult;
|
|
247
|
-
/** Older serialized/read-view inputs may omit this observation; absence is never an empty inventory. */
|
|
248
|
-
services?: OwnedServiceStatus;
|
|
249
|
-
/** Selected folder's local boot intents, not a live broker or ownership census. */
|
|
250
|
-
bootAttempts?: {
|
|
251
|
-
root: string;
|
|
252
|
-
state: "read" | "partial" | "not-checked";
|
|
253
|
-
observedAt: string;
|
|
254
|
-
unsettled: {
|
|
255
|
-
deploymentId: string;
|
|
256
|
-
space: string;
|
|
257
|
-
server: string;
|
|
258
|
-
createdAt: string;
|
|
259
|
-
}[];
|
|
260
|
-
additive: {
|
|
261
|
-
deploymentId: string;
|
|
262
|
-
space: string;
|
|
263
|
-
server: string;
|
|
264
|
-
createdAt: string;
|
|
265
|
-
recordedState: ReturnType<typeof additiveTeamRecordedState>;
|
|
266
|
-
}[];
|
|
267
|
-
unreadable: string[];
|
|
268
|
-
elsewhere: {
|
|
269
|
-
deploymentId: string;
|
|
270
|
-
root: string;
|
|
271
|
-
}[];
|
|
272
|
-
};
|
|
273
|
-
/** This folder's maintenance journal: a preserved cut, a restore or a resume, with the full attempt
|
|
274
|
-
* a recovery command names. Null when the root holds none; older inputs may omit it.
|
|
275
|
-
* `rolledBackRuns` names the runs a restore over a newer cut rolled back, and `rolledBackRunsMore`
|
|
276
|
-
* counts those it did not list. */
|
|
277
|
-
maintenance?: {
|
|
278
|
-
root: string;
|
|
279
|
-
space: string | null;
|
|
280
|
-
state: string;
|
|
281
|
-
attemptId: string | null;
|
|
282
|
-
next: string | null;
|
|
283
|
-
rolledBackRuns?: readonly RolledBackRun[];
|
|
284
|
-
rolledBackRunsMore?: number;
|
|
285
|
-
} | null;
|
|
286
|
-
/** A store write failure the selected space's running local broker logged, or a store over its
|
|
287
|
-
* recorded cap; older inputs may omit it. */
|
|
288
|
-
store?: StoreWriteObservation;
|
|
289
|
-
/** One probe of the selected space's running stack manager's own endpoint. Its process record alone
|
|
290
|
-
* stays `running` while it hangs; absent when no stack manager runs, and older inputs may omit it. */
|
|
291
|
-
stackManager?: {
|
|
292
|
-
instanceId: string;
|
|
293
|
-
pid: number;
|
|
294
|
-
endpoint: ManagerEndpoint;
|
|
295
|
-
};
|
|
296
|
-
/** The selected space's manager endpoint when this stack intentionally omitted its manager. */
|
|
297
|
-
outsideStackManager?: ManagerObservation;
|
|
298
|
-
hints: string[];
|
|
299
|
-
}
|
|
300
|
-
type SelectedResult = {
|
|
301
|
-
resolved: false;
|
|
302
|
-
code: string;
|
|
303
|
-
message: string;
|
|
304
|
-
channelSeedBlocksRestart?: true;
|
|
305
|
-
space?: string;
|
|
306
|
-
root?: string;
|
|
307
|
-
/** In a copy or a moved folder, the folder its records were recorded at, and `space` the space
|
|
308
|
-
* they name, which the commands run here refuse on. */
|
|
309
|
-
recordedRoot?: string;
|
|
310
|
-
} | {
|
|
311
|
-
resolved: true;
|
|
312
|
-
space: string;
|
|
313
|
-
server: string | null;
|
|
314
|
-
mode: MeshTarget["mode"];
|
|
315
|
-
source: string;
|
|
316
|
-
root: string;
|
|
317
|
-
/** The project folder is gone while this machine still records the space's stack there. */
|
|
318
|
-
rootGone: boolean;
|
|
319
|
-
tlsRequired: boolean;
|
|
320
|
-
eventsRequired: boolean;
|
|
321
|
-
idp: string | null;
|
|
322
|
-
personas: PersonaCatalog;
|
|
323
|
-
connection: string;
|
|
324
|
-
channelSeedBlocksRestart?: true;
|
|
325
|
-
/** The stopped process holding a loopback broker's listener, when `connection` is `broker-stopped`. */
|
|
326
|
-
brokerPid?: number;
|
|
327
|
-
staleRecord: boolean;
|
|
328
|
-
login: {
|
|
329
|
-
idp: string;
|
|
330
|
-
subject: string | null;
|
|
331
|
-
expiresAt: string | null;
|
|
332
|
-
actor: "granted" | "not-granted" | "not-checkable" | null;
|
|
333
|
-
grant: {
|
|
334
|
-
label: string | null;
|
|
335
|
-
read: string[];
|
|
336
|
-
post: string[];
|
|
337
|
-
scope: string[];
|
|
338
|
-
} | null;
|
|
339
|
-
} | null;
|
|
340
|
-
deliveryResponder: DeliveryResponderState | null;
|
|
341
|
-
snapshot: {
|
|
342
|
-
state: "read" | "unavailable" | "skipped";
|
|
343
|
-
reason: string | null;
|
|
344
|
-
};
|
|
345
|
-
channels: {
|
|
346
|
-
channel: string;
|
|
347
|
-
messages: number;
|
|
348
|
-
}[] | null;
|
|
349
|
-
membershipFeed: {
|
|
350
|
-
entries: number;
|
|
351
|
-
asOf: string | null;
|
|
352
|
-
} | null;
|
|
353
|
-
/** Whether the space's streams are on its broker, read only where `cotal up` created them.
|
|
354
|
-
* When they are absent, `root` is this machine's stack of the space, null when none runs from
|
|
355
|
-
* here, and `stack` says whether it still runs members other than the broker, null when its
|
|
356
|
-
* records cannot be read. */
|
|
357
|
-
spaceStreams: {
|
|
358
|
-
state: "present" | "absent" | "not-checked";
|
|
359
|
-
root: string | null;
|
|
360
|
-
stack: "running" | "stopped" | null;
|
|
361
|
-
};
|
|
362
|
-
/** The bytes the space's account holds in the broker's JetStream file store, null when not read. */
|
|
363
|
-
storedBytes: number | null;
|
|
364
|
-
};
|
|
4
|
+
import { type StatusResult } from "./status-model.js";
|
|
5
|
+
export { statusFlags } from "./status-model.js";
|
|
6
|
+
export type { StatusResult } from "./status-model.js";
|
|
365
7
|
/** Named-agent and infrastructure inputs choose different reads. */
|
|
366
8
|
export declare function validateStatusArguments(args: ParsedArgs): void;
|
|
367
9
|
/** `cotal status` — detailed, read-only diagnostics for the local machine + selected mesh. */
|
|
368
10
|
export declare function status(args: ParsedArgs): Promise<void>;
|
|
369
|
-
type ManagerEndpoint = "answered" | "not-answering" | "unchecked";
|
|
370
|
-
type ManagerObservation = {
|
|
371
|
-
endpoint: ManagerEndpoint;
|
|
372
|
-
instanceId?: string;
|
|
373
|
-
};
|
|
374
11
|
/** A no-responder service rail or an absent manager registry: the definitive no-service evidence
|
|
375
12
|
* that both the manager row and the manager health check grade on, kept in one place (#3046). */
|
|
376
13
|
export declare function managerNoService(e: unknown): boolean;
|
|
@@ -384,5 +21,4 @@ export declare function statusView(r: StatusResult, verbose?: boolean, wide?: bo
|
|
|
384
21
|
}): Report;
|
|
385
22
|
/** True when a delivery-lease read failed because the lease stream/bucket is absent (#3046). */
|
|
386
23
|
export declare function deliveryLeaseAbsent(e: unknown): boolean;
|
|
387
|
-
export {};
|
|
388
24
|
//# sourceMappingURL=status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAIA,OAAO,EAuBL,KAAK,UAAU,EAGhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAIA,OAAO,EAuBL,KAAK,UAAU,EAGhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAiFL,KAAK,MAAM,EAOZ,MAAM,qBAAqB,CAAC;AAmD7B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C,OAAO,EAQL,KAAK,YAAY,EAKlB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAsCtD,oEAAoE;AACpE,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAiB9D;AAED,8FAA8F;AAC9F,wBAAsB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAoJ5D;AAkrBD;kGACkG;AAClG,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAEpD;AA0lCD;yCACyC;AACzC,wBAAgB,UAAU,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,UAAQ,EAAE,IAAI,UAAQ,EAAE,EAAE,WAAmB,EAAE,eAAe,EAAE,IAAI,EAAE,QAAwC,EAAE,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,GAAG,MAAM,CAYrS;AAoUD,gGAAgG;AAChG,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAEvD"}
|
package/dist/commands/status.js
CHANGED
|
@@ -3,7 +3,7 @@ import { drainAndClose } from "@cotal-ai/core";
|
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { CotalEndpoint, agentFilePath, dialerFor, EpEnvelopeError, formatAge, globalConfigDir, isReachable, isStreamNotFound, mintCreds, mintLifecycleUid, resolveService, realDirNoSymlink, invokeRepairingSplit, standaloneConnectOpts, newIdentity, idFromCreds, principalKey, DEV_OWNER, unansweredRequest, resolveAuthProvider, personaDir, } from "@cotal-ai/core";
|
|
6
|
-
import { stoppedLoopbackListener, UnreadableConnectorSelection, stackRunsUnderOtherHome, accountInventory, authDir, isCommandFailure, readMaintenanceJournal, recordsElsewhereError, recordsElsewhereText, restoreRolledBackRuns, targetErrorSpace, brokerAddressForDisplay, brokerCheck, brokerUrlKey, canonicalRoot, CLI_USER_ACTOR, codeSpan, credentialFileExposure, CommandFailure, deliveryCredsKey, DELIVERY_PIDFILE, extensionsDir, findCotalRoot, folderSpaceOverSelection, isGenuineSpace, meshesForRoot, resolveReadsLiveness, stoppedStack, unsettledStackOperation, withdrawOperationNote, hasUserAuthState, homeCotalDir, installationWriter, cachedPreferences, loadLaunchPersonaFile, resolvePreference, isMeshRegistryError, isWorkspaceTargetError,
|
|
6
|
+
import { stoppedLoopbackListener, UnreadableConnectorSelection, stackRunsUnderOtherHome, accountInventory, authDir, isCommandFailure, readMaintenanceJournal, recordsElsewhereError, recordsElsewhereText, restoreRolledBackRuns, targetErrorSpace, brokerAddressForDisplay, brokerCheck, brokerUrlKey, canonicalRoot, CLI_USER_ACTOR, codeSpan, credentialFileExposure, CommandFailure, deliveryCredsKey, DELIVERY_PIDFILE, extensionsDir, findCotalRoot, folderSpaceOverSelection, isGenuineSpace, meshesForRoot, resolveReadsLiveness, stoppedStack, unsettledStackOperation, withdrawOperationNote, hasUserAuthState, homeCotalDir, installationWriter, cachedPreferences, loadLaunchPersonaFile, resolvePreference, isMeshRegistryError, isWorkspaceTargetError, loadManagerInstanceIdentity, loadSoleSpaceAuth, localProcessPath, localProcessVisible, MANAGER_PIDFILE, NATS_PIDFILE, OFFICIAL_CONNECTORS, oneLine, PREFERENCE_KEYS, preflightTarget, preparedNeverStarted, presentationOf, principalFromBearer, verifyIdentityPin, probeWebReadiness, readCurrent, readMeshRegistry, readPidfile, preparedRecordSkipped, readPreparedSpaces, stackJournalPath, readRenewalRecord, recordOperationSpace, resolveMeshTarget, userAuthStateDir, WEB_PIDFILE, workspaceSecretStore, displayWidth, terminalWidth, wrapWords, writeResult, workspaceErrorParts, preferencesPath, preferencesFolderWarning, cotalDirLink, movedProject, spaceStreamsAbsent, spaceStreamsExpected, resolveControlTarget, } from "@cotal-ai/workspace";
|
|
7
7
|
import { localProcessSurface } from "../ext-loader.js";
|
|
8
8
|
import { cliVersion, cliProvenance, readExtensionVersions } from "../lib/version.js";
|
|
9
9
|
import { agentSkillsSkew } from "../lib/agent-skills.js";
|
|
@@ -33,7 +33,7 @@ import { readinessAddressSurvivors } from "../lib/service-process.js";
|
|
|
33
33
|
import { freshTeamAttemptSettled, listFreshTeamAttempts, listFreshTeamSummaries } from "../lib/team-fresh.js";
|
|
34
34
|
import { additiveTeamRecordedState, listAdditiveTeamAttempts } from "../lib/team-additive-attempt.js";
|
|
35
35
|
import { maintenanceNextStep, rolledBackNotes } from "../lib/restore.js";
|
|
36
|
-
import { journalRecordedElsewhere, readStackJournal, serviceHeldRecords, STACK_ADAPTER, STACK_DEFINITION, stackStartedWithoutManager, stackOperationBlock, stackRootGone, unfinishedStackOperation, } from "../lib/stack-journal.js";
|
|
36
|
+
import { journalRecordedElsewhere, readStackJournal, serviceHeldRecords, STACK_ADAPTER, STACK_DEFINITION, stackStartedWithoutManager, stackOperationBlock, stackRootGone, unfinishedStackOperation, unusableStackJournal, } from "../lib/stack-journal.js";
|
|
37
37
|
import { cotalLinkHere, homeHoldsStack, linkedCotalRemedy } from "../lib/paths.js";
|
|
38
38
|
import { channelSeedRestartBlock } from "../lib/channel-seed.js";
|
|
39
39
|
import { rootStoreProblem } from "../lib/store-dir.js";
|
|
@@ -44,40 +44,8 @@ import { readCursor } from "../seed/lock.js";
|
|
|
44
44
|
import { reconcileCursorPath } from "../seed/paths.js";
|
|
45
45
|
import { managerStopImpactFacts } from "./status-stop-impact.js";
|
|
46
46
|
import { responderText } from "./status-delivery.js";
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
* it reports; this explicit mode is for an operator or monitor that needs a component state per
|
|
50
|
-
* component and an exit code to branch on.
|
|
51
|
-
*
|
|
52
|
-
* THAT DIVISION IS ABOUT EXIT CODES AND COMPLETENESS, NOT ABOUT TRUTHFULNESS, and #1576 is where the
|
|
53
|
-
* difference bit. Bare status printed `delivery running (pid N)` over a daemon whose responder had
|
|
54
|
-
* never bound — not a broad answer but a specific and wrong one, identical to the line it prints
|
|
55
|
-
* when delivery is fully healthy, for 22 hours, while spawn/retirement/join all failed. A broad
|
|
56
|
-
* diagnostic may omit an axis; it may not claim one it never checked. So bare status stays broad,
|
|
57
|
-
* and the delivery row names the responder state it actually read (or says plainly that it did not
|
|
58
|
-
* read it, and points here). */
|
|
59
|
-
export const statusFlags = [
|
|
60
|
-
spaceFlag,
|
|
61
|
-
serverFlag,
|
|
62
|
-
{ name: "on", type: "string", value: "<manager-instance>", description: "named agent: inspect one manager instance" },
|
|
63
|
-
{ name: "creds", type: "string", value: "<file>", description: "explicit credential file (unsupported for status)" },
|
|
64
|
-
{ name: "all", type: "boolean", description: "check every recorded mesh, not only the selected one, and report every row in full" },
|
|
65
|
-
{ name: "wide", type: "boolean", description: "report every row in full: each known agent application, each extension, and the spaces under their broker addresses" },
|
|
66
|
-
{ name: "verbose", short: "v", type: "boolean", description: "include installation paths, local records and detailed diagnostics" },
|
|
67
|
-
{ name: "components", type: "boolean", description: "probe manager, delivery, web, and registered broker component health (exit: 0 serving, an intentionally omitted manager, or the optional dashboard not installed or not started; 1 absent; 2 present but not serving; 3 probe refused)" },
|
|
68
|
-
jsonFlag,
|
|
69
|
-
plainFlag,
|
|
70
|
-
];
|
|
71
|
-
/** A project root with an empty `.cotal/` and no registration or prepared space. The resolver
|
|
72
|
-
* gives it the default broker address, which any broker may hold, so status selects no space for
|
|
73
|
-
* it and dials nothing. A root whose records name no space is refused by the resolver instead, and
|
|
74
|
-
* status uses that refusal. */
|
|
75
|
-
class UnregisteredRoot {
|
|
76
|
-
root;
|
|
77
|
-
constructor(root) {
|
|
78
|
-
this.root = root;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
47
|
+
import { statusFlags, UnregisteredRoot, Gaps, displayStatusBroker, } from "./status-model.js";
|
|
48
|
+
export { statusFlags } from "./status-model.js";
|
|
81
49
|
function resolveSelected(cwd, values, offline) {
|
|
82
50
|
try {
|
|
83
51
|
const target = resolveMeshTarget(cwd, { server: values.server, space: values.space, offline });
|
|
@@ -122,26 +90,6 @@ async function registryFallbackChecks(root, values) {
|
|
|
122
90
|
} // The reporting pass names unreadable records.
|
|
123
91
|
return new Map(await Promise.all(entries.map(async (entry) => [entry.space, { entry, check: await brokerCheck(entry.server, entry.tlsRequired) }])));
|
|
124
92
|
}
|
|
125
|
-
/** Collects what each reader could not read, so the report names it on its row and the run is
|
|
126
|
-
* reported partial rather than complete. */
|
|
127
|
-
class Gaps {
|
|
128
|
-
warnings = [];
|
|
129
|
-
/** Two readers that hit the same part, such as one catalog read as the folder's and the selected
|
|
130
|
-
* mesh's, name it once. */
|
|
131
|
-
add(code, message, target = null) {
|
|
132
|
-
if (this.warnings.some((w) => w.code === code && w.message === message))
|
|
133
|
-
return;
|
|
134
|
-
this.warnings.push({ code, target, message });
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
/** Keep unsafe stored addresses explicit without exposing their original text. */
|
|
138
|
-
function displayStatusBroker(server, space, gaps) {
|
|
139
|
-
const display = brokerAddressForDisplay(server);
|
|
140
|
-
if (display !== undefined)
|
|
141
|
-
return display;
|
|
142
|
-
gaps.add("BROKER_ADDRESS_INVALID", `broker address for '${space}' cannot be displayed`, { space });
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
93
|
/** Named-agent and infrastructure inputs choose different reads. */
|
|
146
94
|
export function validateStatusArguments(args) {
|
|
147
95
|
presentationOf(args.values);
|
|
@@ -186,7 +134,7 @@ export async function status(args) {
|
|
|
186
134
|
const blocked = folderReadProblem(root);
|
|
187
135
|
if (blocked) {
|
|
188
136
|
gaps.add("FOLDER_UNREADABLE", `this folder ${root} cannot be read by this account (${blocked}), so nothing in it was read`, { root });
|
|
189
|
-
hints.push(`make it readable by you, for example with chmod u+rx ${root}`);
|
|
137
|
+
hints.push(`make it readable by you, for example with chmod u+rx ${shellWord(root)}`);
|
|
190
138
|
}
|
|
191
139
|
// Every command warns about a preferences folder another account could write; status also lists its fix.
|
|
192
140
|
const preferencesFolder = preferencesFolderWarning();
|
|
@@ -1265,17 +1213,6 @@ function readStackStoreWarnings(root, gaps, hints, space) {
|
|
|
1265
1213
|
// A copied or moved journal is diagnosed by the folder and selection readers.
|
|
1266
1214
|
}
|
|
1267
1215
|
}
|
|
1268
|
-
/** The refusal of the stack journal at `root` when it is one no command can use, as `up` and `down`
|
|
1269
|
-
* refuse it. Undefined when it reads or is absent. */
|
|
1270
|
-
function unusableStackJournal(root) {
|
|
1271
|
-
try {
|
|
1272
|
-
readStackJournal(root);
|
|
1273
|
-
return undefined;
|
|
1274
|
-
}
|
|
1275
|
-
catch (error) {
|
|
1276
|
-
return isCommandFailure(error) && (error.code === "SCHEMA_INVALID" || error.code === "PERMISSION_DENIED") ? error : undefined;
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
1216
|
/** The refusal of `space`'s service instance records when one is a record no command can use, as
|
|
1280
1217
|
* `up` and `down` refuse it. Undefined when they read. */
|
|
1281
1218
|
function unusableServiceInstances(space) {
|
|
@@ -2095,6 +2032,7 @@ function nextActions(r, seedFailed, interactive, recovery, preparedHarness) {
|
|
|
2095
2032
|
const cmd = displayCmd();
|
|
2096
2033
|
const items = [];
|
|
2097
2034
|
const extra = [];
|
|
2035
|
+
let restartBlock;
|
|
2098
2036
|
const noApplication = !setUpApplications(r.machine).length;
|
|
2099
2037
|
if (!r.selected.resolved && !r.meshes.items.length && !r.meshes.unreadable.length) {
|
|
2100
2038
|
items.push({ command: `${cmd} login`, description: "Sign in to Cotal Cloud" });
|
|
@@ -2115,17 +2053,17 @@ function nextActions(r, seedFailed, interactive, recovery, preparedHarness) {
|
|
|
2115
2053
|
if (r.selected.resolved) {
|
|
2116
2054
|
const s = r.selected;
|
|
2117
2055
|
const reachable = s.connection === "ok" || s.connection === "reachable";
|
|
2118
|
-
|
|
2056
|
+
const scope = { space: s.source === "flag-server" ? undefined : s.space, server: s.source === "flag-server" || s.source === "flag-space-override" ? s.server : undefined };
|
|
2119
2057
|
if (!noApplication) {
|
|
2120
2058
|
if (s.personas.default !== "missing" && s.personas.default !== "valid")
|
|
2121
|
-
items.push({ command: `${cmd} persona show default
|
|
2059
|
+
items.push({ command: onRerun(`${cmd} persona show default`, scope), description: "See what is wrong with the default persona" });
|
|
2122
2060
|
else if (reachable && s.deliveryResponder !== "unbound" && s.deliveryResponder !== "stale")
|
|
2123
|
-
items.push({ command: `${cmd} spawn`, description: s.personas.default === "missing" ? "Open your default agent; creates the shipped default persona" : "Open your default agent" });
|
|
2061
|
+
items.push({ command: onRerun(`${cmd} spawn`, scope), description: s.personas.default === "missing" ? "Open your default agent; creates the shipped default persona" : "Open your default agent" });
|
|
2124
2062
|
}
|
|
2125
2063
|
if (reachable)
|
|
2126
|
-
items.push({ command: `${cmd} who`, description: "See the live roster" });
|
|
2064
|
+
items.push({ command: onRerun(`${cmd} who`, scope), description: "See the live roster" });
|
|
2127
2065
|
if (r.stackManager?.endpoint === "answered" || r.outsideStackManager?.endpoint === "answered")
|
|
2128
|
-
items.push({ command: `${cmd} ps`, description: "List managed agents" });
|
|
2066
|
+
items.push({ command: onRerun(`${cmd} ps`, scope), description: "List managed agents" });
|
|
2129
2067
|
}
|
|
2130
2068
|
if (r.selected.resolved || !noApplication) {
|
|
2131
2069
|
items.push({ command: `${cmd} space`, description: "List the spaces on this machine" });
|
|
@@ -2194,7 +2132,9 @@ function nextActions(r, seedFailed, interactive, recovery, preparedHarness) {
|
|
|
2194
2132
|
items.unshift(...held.map((row) => ({ command: `${cmd} svc stop ${row.definition} --instance ${row.instanceId} --space ${shellWord(space)} --yes`, description: `Stop the ${row.definition} service, which runs this root's ${row.record} (pid ${row.pid}) outside the stack` })), { command: `${cmd} up --root ${shellWord(r.selected.root)}${r.folder.noManager ? " --no-manager" : ""}`, description: held.length ? "Then restart this stack's stopped members from its recorded inputs" : "Restart this stack's stopped members from its recorded inputs" });
|
|
2195
2133
|
}
|
|
2196
2134
|
else if (!elsewhere && legacy && dialed.mode === "open" && origin === "up" && exited.includes("manager") && r.folder.processes?.some((row) => row.name === "nats" && row.state === "running")) {
|
|
2197
|
-
|
|
2135
|
+
restartBlock = channelSeedRestartBlock(dialed.root);
|
|
2136
|
+
if (!restartBlock)
|
|
2137
|
+
items.unshift({ command: `${cmd} down --yes`, description: "Stop this folder's broker so the exited manager can be restarted" }, { command: `${cmd} up --foreground`, description: "Then start the stack with its manager" });
|
|
2198
2138
|
}
|
|
2199
2139
|
else if (!storeBlocked && !seedBlocksRestart && local && exited.length) {
|
|
2200
2140
|
const broker = exited.includes("nats"), manager = exited.includes("manager");
|
|
@@ -2248,7 +2188,8 @@ function nextActions(r, seedFailed, interactive, recovery, preparedHarness) {
|
|
|
2248
2188
|
// The broker keeps serving a store it found damage in, from what it can still read there.
|
|
2249
2189
|
if (r.store?.state === "damaged" && r.selected.resolved && r.services?.instances?.some((row) => row.definition === STACK_DEFINITION.broker))
|
|
2250
2190
|
items.unshift({ command: `${cmd} service logs stack-broker${own ? "" : ` --space ${shellWord(r.selected.space)}`}`, description: "Read what the broker logged about the damage it found in its store; history holds only what it could still read" });
|
|
2251
|
-
|
|
2191
|
+
const first = restartBlock ? [{ kind: "lines", lines: [cell(`Restart blocked: ${restartBlock.message}. ${restartBlock.remedy}`, "hint")] }] : [];
|
|
2192
|
+
return { title: "Next", blocks: [...first, { kind: "commands", items }, ...[...extra, ...r.hints].map((hint) => ({ kind: "lines", lines: [cell(hint, "hint")] }))] };
|
|
2252
2193
|
}
|
|
2253
2194
|
function ownedServicesOverview(services) {
|
|
2254
2195
|
if (!services || services.state === "not-checked")
|
|
@@ -2842,8 +2783,10 @@ async function brokerHealth(target, store) {
|
|
|
2842
2783
|
async function printComponentHealth(selected, store, brokerUnreachable) {
|
|
2843
2784
|
section("Component Health");
|
|
2844
2785
|
if (!selected.ok) {
|
|
2845
|
-
const
|
|
2846
|
-
|
|
2786
|
+
const error = selected.error;
|
|
2787
|
+
const e = isWorkspaceTargetError(error) && error.code === "not-started" && error.details.root !== undefined && !error.details.rootMissing
|
|
2788
|
+
? unusableStackJournal(error.details.root) ?? error : error;
|
|
2789
|
+
if (isCommandFailure(e) && (e.code === "SCHEMA_INVALID" || e.code === "PERMISSION_DENIED")) {
|
|
2847
2790
|
printComponent({ name: "target", verdict: "refused", facts: [e.code, e.message, ...(e.remedy ? [e.remedy] : [])] });
|
|
2848
2791
|
process.exitCode = COMPONENT_EXIT.refused;
|
|
2849
2792
|
return;
|