/** * log10x_doctor — startup health check. * * Single-call verdict on whether this MCP install is correctly wired to * the customer's Log10x backend. Designed to be called once at the start * of a session, or by the `--doctor` CLI flag at install time. * * Each check returns pass / warn / fail with a one-line explanation. * * Multi-env: when no `environment` arg is passed, doctor iterates ALL * configured environments and produces one report section per env, so * multi-env users see per-nickname issues without having to call the * tool N times. Passing an explicit `environment` nickname checks only * that env (useful from the MCP tool interface when the model is * already scoped to one env). */ import { z } from 'zod'; import { type StructuredOutput } from '../lib/output-types.js'; import { type ObjectStoreTarget, type StoreObjectMeta } from '../lib/object-store.js'; export type CheckStatus = 'pass' | 'warn' | 'fail'; export interface DoctorCheck { name: string; status: CheckStatus; message: string; /** Optional remediation hint when status is warn or fail. */ fix?: string; } export interface DoctorReport { overall: CheckStatus; /** Top-level checks that apply independent of a specific environment. */ globalChecks: DoctorCheck[]; /** Per-environment checks, keyed by nickname. */ perEnvChecks: Record; } export declare const doctorSchema: { environment: z.ZodOptional; }; export declare function executeDoctor(args: { environment?: string; }): Promise; /** Runs the full check sequence and returns a structured report. */ export declare function runDoctorChecks(envNickname?: string): Promise; /** Checks that apply independent of a specific environment. */ /** * True when a URL's host is only routable inside a Kubernetes cluster * (the shape the helm_release_probe Retriever fallback emits). Used to * distinguish "resolved an endpoint" from "resolved a REACHABLE endpoint". */ export declare function isClusterInternalUrl(url: string): boolean; /** * Remedy text for each offload_delivery verdict, in the store's own * vocabulary. The Azure branch names blob-data roles and the `az` CLI: an * Azure operator has no IAM policy to grant, and an IAM remedy sends them * looking for a control their account does not have. Exported so the suite * can assert both branches without driving a live doctor run. */ export declare function offloadDeliveryFixes(store: ObjectStoreTarget): Record; /** What the ClickHouse offload readiness check reads. Both probes are read-only. */ export interface ClickhouseReadinessDeps { /** Table and view names in the database. Throws when ClickHouse is unreachable. */ listTables: () => Promise; /** Objects under the offload prefix. Throws when the bucket cannot be read. */ listObjects: () => Promise; /** Database the ClickStack tables live in. */ database: string; /** Where the offloaded objects land. Undefined when no bucket is configured. */ store?: ObjectStoreTarget; hotTable?: string; mergeTable?: string; coldTable?: string; coldView?: string; countsTable?: string; countsMv?: string; } /** * Is this install ready to read hot and cold as one table? * * Reads only. It lists the database's tables and lists the offload bucket, and * it reports what is missing rather than creating anything. A missing Merge * table is not a failure: it means the recipe from `renderClickhouseOffloadSection` * has not been applied yet, which is exactly what an operator runs doctor to * find out. Neither probe throws out of this function, so a doctor run against * an unreachable ClickHouse still produces a report. */ export declare function clickhouseOffloadReadiness(deps: ClickhouseReadinessDeps): Promise; /** Render a structured DoctorReport as markdown for human or LLM consumption. */ export declare function renderDoctorReport(report: DoctorReport): string;