@cotal-ai/cli 0.174.0 → 0.174.2
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/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +13 -8
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/endpoint.d.ts.map +1 -1
- package/dist/commands/endpoint.js +13 -3
- package/dist/commands/endpoint.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +33 -7
- package/dist/commands/setup.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 +3 -55
- package/dist/commands/status.js.map +1 -1
- 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.map +1 -1
- package/dist/commands/up.js +5 -341
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/update-caches.d.ts.map +1 -1
- package/dist/commands/update-caches.js +10 -3
- package/dist/commands/update-caches.js.map +1 -1
- package/dist/commands/who.js +7 -4
- package/dist/commands/who.js.map +1 -1
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +5 -2
- package/dist/telemetry.js.map +1 -1
- package/package.json +4 -4
|
@@ -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";
|
|
@@ -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);
|