import { type ParsedArgs } from "@cotal-ai/core"; import { type MeshEntry, type MeshTarget, type Report } from "@cotal-ai/workspace"; import { type CliProvenance } from "../lib/version.js"; import { type MachineStatus } from "../lib/status.js"; import { type DeliveryResponderState } from "../lib/delivery-responder.js"; import { serviceDefinitionProjection } from "../lib/service-definitions.js"; import { instanceProjection } from "../lib/service-instances.js"; import { additiveTeamRecordedState } from "../lib/team-additive-attempt.js"; /** `--components` is the fail-loud health pass with a machine-readable EXIT DISPOSITION. Bare * `status` is a broad, recovery-oriented report: it exits 0, or 4 when it could not read part of what * it reports; this explicit mode is for an operator or monitor that needs a component state per * component and an exit code to branch on. * * THAT DIVISION IS ABOUT EXIT CODES AND COMPLETENESS, NOT ABOUT TRUTHFULNESS, and #1576 is where the * difference bit. Bare status printed `delivery running (pid N)` over a daemon whose responder had * never bound — not a broad answer but a specific and wrong one, identical to the line it prints * when delivery is fully healthy, for 22 hours, while spawn/retirement/join all failed. A broad * diagnostic may omit an axis; it may not claim one it never checked. So bare status stays broad, * and the delivery row names the responder state it actually read (or says plainly that it did not * read it, and points here). */ export declare const statusFlags: readonly [{ readonly name: "space"; readonly short: "s"; readonly type: "string"; readonly value: ""; readonly description: "target space (default: the resolved mesh)"; }, { readonly name: "server"; readonly type: "string"; readonly value: ""; readonly description: "broker URL (overrides the mesh registry entry)"; }, { readonly name: "on"; readonly type: "string"; readonly value: ""; readonly description: "named agent: inspect one manager instance"; }, { readonly name: "creds"; readonly type: "string"; readonly value: ""; readonly description: "named agent: use an explicit connection credential"; }, { readonly name: "all"; readonly type: "boolean"; readonly description: "check every recorded mesh, not only the selected one"; }, { readonly name: "verbose"; readonly short: "v"; readonly type: "boolean"; readonly description: "include installation paths, local records and detailed diagnostics"; }, { readonly name: "components"; readonly type: "boolean"; readonly description: "probe manager, delivery, web, and registered broker component health (exit: 0 serving, or the optional dashboard not installed; 1 absent; 2 present but not serving; 3 probe refused)"; }, { readonly name: "json"; readonly short: "j"; readonly type: "boolean"; readonly description: "structured output on stdout"; }, { readonly name: "plain"; readonly type: "boolean"; readonly description: "plain line-oriented output"; }]; /** What a persona catalog holds: whether its `default` passes the loader spawn uses, and how many of * the demo team's personas do. A catalog directory that exists and cannot be read is `unreadable`, * with no demo count and the error. */ interface PersonaCatalog { root: string; default: "valid" | "invalid" | "missing" | "unreadable"; demo: number | null; error: string | null; } /** One local process row: the state word, the pid it recorded, and what else the row knows. */ interface ProcessRow { name: string; state: "running" | "stopped" | "not-serving" | "unknown" | "unreadable"; pid: number | null; detail: string | null; } interface OwnedServiceStatus { space: string | null; state: "read" | "partial" | "not-checked"; observedAt: string; atomicSnapshot: false; definitions: ReturnType[] | null; instances: ReturnType[] | null; scope: "selected-space local owned records; no remote registration or fresh endpoint probe"; } /** Everything bare `status` reports, in the order it prints. The JSON envelope carries it as * `result`, and the report is built from it, so the two cannot disagree. A part that could not be * read is null or carries its error, and is named in the warnings. */ export interface StatusResult { kind: "infrastructure"; machine: { version: string; node: string; platform: string; install: CliProvenance; nats: MachineStatus["nats"]; integrations: { name: string; state: "ok" | "warn" | "error" | "off"; text: string; }[]; connectors: { name: string; requires: string[]; missing: string[]; }[] | null; defaults: { harness: string | null; persona: string | null; } | null; skills: { state: "current" | "not-installed" | "behind" | "unreadable"; total: number; behind: number; retired: number; error: string | null; }; web: { installed: boolean | null; installedError: string | null; url: string | null; urlError: string | null; }; }; extensions: { root: string; items: { package: string; label: string; version: string; }[] | null; }; folder: { root: string; auth: { state: "space" | "spaces" | "none" | "unreadable"; spaces: string[]; userAuth: boolean; error: string | null; }; personas: PersonaCatalog; launches: boolean | null; processes: ProcessRow[] | null; processSpace: string | null; storedState: boolean; /** Whether this root records a controller stack for the process space. Its members are service * instances, so the legacy pidfile rows say nothing about them. */ controllerStack: boolean; }; meshes: { current: string | null; currentRecorded: boolean; /** Whether the selection names a space `cotal space create` prepared and no `cotal up` started. */ currentPrepared: boolean; unreadable: { file: string; error: string; }[]; items: { space: string; server: string | null; mode: MeshEntry["mode"]; root: string; origin: MeshEntry["origin"] | null; tlsRequired: boolean; eventsRequired: boolean; current: boolean; check: "reachable" | "unreachable" | "not-checked"; catalog: { name: string | null; fetchedAt: string | null; error: string | null; } | null; }[]; catalogs: { idp: string; state: string; error: string | null; }[]; }; selected: SelectedResult; /** Older serialized/read-view inputs may omit this observation; absence is never an empty inventory. */ services?: OwnedServiceStatus; /** Selected folder's local boot intents, not a live broker or ownership census. */ bootAttempts?: { root: string; state: "read" | "partial" | "not-checked"; observedAt: string; unsettled: { deploymentId: string; space: string; server: string; createdAt: string; }[]; additive: { deploymentId: string; space: string; server: string; createdAt: string; recordedState: ReturnType; }[]; unreadable: string[]; elsewhere: { deploymentId: string; root: string; }[]; }; /** This folder's maintenance journal: a preserved cut, a restore or a resume, with the full attempt * a recovery command names. Null when the root holds none; older inputs may omit it. */ maintenance?: { root: string; space: string | null; state: string; attemptId: string | null; next: string | null; } | null; hints: string[]; } type SelectedResult = { resolved: false; code: string; message: string; } | { resolved: true; space: string; server: string | null; mode: MeshTarget["mode"]; source: string; root: string; tlsRequired: boolean; eventsRequired: boolean; idp: string | null; personas: PersonaCatalog; connection: string; staleRecord: boolean; login: { idp: string; subject: string | null; expiresAt: string | null; actor: "granted" | "not-granted" | "not-checkable" | null; grant: { label: string | null; read: string[]; post: string[]; scope: string[]; } | null; } | null; deliveryResponder: DeliveryResponderState | null; snapshot: { state: "read" | "unavailable" | "skipped"; reason: string | null; }; channels: { channel: string; messages: number; }[] | null; membershipFeed: { entries: number; asOf: string | null; } | null; }; /** Named-agent and infrastructure inputs choose different reads. */ export declare function validateStatusArguments(args: ParsedArgs): void; /** `cotal status` — detailed, read-only diagnostics for the local machine + selected mesh. */ export declare function status(args: ParsedArgs): Promise; /** The approved screen hierarchy; record-level diagnostics are opt-in. */ export declare function statusView(r: StatusResult, verbose?: boolean): Report; export {}; //# sourceMappingURL=status.d.ts.map