/** A finding's severity. `error` flips `report.ok` to false; `warn` is advisory (surfaced, not blocking). */ export type DoctorLevel = "error" | "warn"; /** One preflight finding — what's wrong, a stable machine `code`, and the concrete `fix`. */ export interface DoctorFinding { level: DoctorLevel; /** Stable identifier for this finding (e.g. `"ephemeral-gate-secret"`) — safe to switch on. */ code: string; /** What's misconfigured and why it matters, in one sentence. */ message: string; /** The concrete remedy — a command to run or the exact option to set. */ fix: string; } /** The preflight result: `ok` is true iff there are no `error`-level findings. Plain, JSON-safe data. */ export interface DoctorReport { ok: boolean; findings: DoctorFinding[]; } /** The resolved config `runDoctor` inspects — assembled by `CredentAgent.doctor()` from the instance. */ export interface DoctorInput { /** The origin the client resolved to (already defaulted to localhost when omitted). */ walletOrigin: string; /** Is a stable signing key EFFECTIVELY set — from `new CredentAgent({ gateSecret })` OR captured * from the mounted ceremony seams / composed storefront? (Absent ⇒ orders.serve uses an ephemeral key.) */ hasGateSecret: boolean; /** Is the EFFECTIVE verification store shared (survives an instance split) — a non-in-memory * `store` from the constructor OR one the composed host published via mount()? */ sharedVerificationStore: boolean; /** Were BOTH `orderStore` and `completedOrderStore` injected as non-in-memory stores? Only the * `orders.serve()` surface uses them (a composed host owns its own order persistence). */ sharedOrderStores: boolean; /** Is this client COMPOSED with a host that owns the serving surface — `mount(app, ceremony)` * seams, or `createStorefront(...) + mount(store.app)`? Then the signing key / stores may come * from seams doctor only partially sees: the order-store check is skipped (the host owns order * persistence) and a residual secret/store finding is annotated rather than asserted hard. */ composedWithHost?: boolean; /** Was the AP2 mandate-signing key generated at boot (no `mandateSigningKey` supplied)? */ ephemeralMandateKey?: boolean; /** Was the merchant's checkout key generated at boot (no `checkoutSigningKey` supplied)? */ ephemeralCheckoutKey?: boolean; /** Environment to read deployment signals from. Defaults to `process.env`; injected in tests. */ env?: Record; } /** * Run the config preflight over a resolved config. Pure + never-throws: it returns findings, * it does not act on them. A DEV config (no deployment env signals) reports nothing — every * check only fires once the runtime looks deployed. */ export declare function runDoctor(input: DoctorInput): DoctorReport; /** Render a report as a human-readable multi-line block (used by `doctor({ print: true })`). */ export declare function formatDoctorReport(report: DoctorReport): string;