/** How a probe's outcome should be read. */ export type Verdict = /** Behaving as a healthy deployment should. */ "ok" /** Reachable and legal, but worth a human look (e.g. a public read). */ | "warn" /** Broken, or wired up wrong. */ | "fail" /** We could not classify the response. */ | "unknown"; export interface ProbeReading { verdict: Verdict; /** What this status code *means for this endpoint*, in one sentence. */ meaning: string; } export interface ProbeSpec { id: string; /** Column label in human output. */ label: string; method: "GET" | "POST"; /** Path relative to the project origin. */ path: (opts: ProbeTargets) => string; body?: unknown; /** One-line statement of what a healthy deployment answers here. */ healthy: string; interpret: (status: number | null) => ProbeReading; /** * Read the response body as well. Set only where the body carries a fact the * status code cannot — today, the function listing. */ needsBody?: boolean; /** * Sharpen the status-code reading using the parsed body. Returning null * keeps {@link interpret}'s verdict. */ refine?: (body: unknown, targets: ProbeTargets) => ProbeReading | null; } export interface ProbeTargets { /** Collection used for the unauthenticated-read probe. */ collection: string; /** Function to confirm exists, if the caller named one. */ fn?: string; } /** * The probe set, in the order a failure cascades: if `health` is down, nothing * below it is meaningful, so it is checked first and reported first. */ export declare const PROBES: ProbeSpec[]; /** The function names out of a listing body, or null when it is not one. */ export declare function functionNames(body: unknown): string[] | null; export interface ProbeResult { id: string; label: string; method: string; url: string; status: number | null; ms: number; verdict: Verdict; meaning: string; healthy: string; /** * Whether the STATUS CODE alone looked healthy. False means the code itself * was wrong; true with a failing `verdict` means the code was fine and the * body carried the bad news (a named function that did not load). The * summary uses this so it never tells you to expect a 200 you already got. */ statusOk: boolean; } /** * Run one probe. A transport failure is a `null` status, never a thrown error: * "nothing answered" is a diagnosis in its own right and the other probes still * need to run. */ export declare function runProbe(origin: string, spec: ProbeSpec, targets: ProbeTargets): Promise; /** The worst verdict across probes — what the command's exit code keys off. */ export declare function overallVerdict(results: ProbeResult[]): Verdict; export interface ParsedLogLine { ts: string | null; pod: string | null; text: string; } export declare function parseLogLine(line: string): ParsedLogLine; /** * Lines an operator scanning for a fault wants to see. * * Matches the structured `severity` field first, then the shapes that show up * in unstructured output. `refus`/`denied` are in the list because a permission * failure often logs at info level and is exactly what one is hunting for. */ export declare function isErrorLine(text: string): boolean; export interface RequestLogEntry { status: number | null; method: string; path: string; latencyMs: number | null; } /** * Pull an HTTP request record out of a log line, or null when it is not one. * * Only structured request lines are recognised. Guessing at prose would produce * a table with invented columns, which is worse than a short one. */ export declare function parseRequestLine(text: string): RequestLogEntry | null; /** * Startup lines: what the server *decided* it was going to do. Which storage * backend it bound, which functions it loaded, whether auth tables were found. * This is the fastest way to tell a misconfiguration from a runtime fault. */ export declare function isBootLine(text: string): boolean; /** Render a number of seconds back as the compact duration a user would type. */ export declare function formatDuration(seconds: number): string; /** * Parse a duration like `15m`, `2h`, `90s`, `1d` (or a bare number of seconds) * into seconds. Returns null when it is not a duration. */ export declare function parseSince(input: string | undefined): number | null; export declare function debugCommand(action: string | undefined, rawArgs: string[]): Promise; export declare function printDebugHelp(): void;