/** * Output adapters for audit reports. * * Audit results today are emitted as JSON via `printReport` to stdout. * The output adapters here let callers redirect to a file and/or * transform to CSV / Markdown for human-readable reporting. * * Adapters operate on the canonical `ScaiEnvelope` shape that * `printReport` produces: * * { * command: "audit.broken-links.list", * environment: "sandbox", * count: 42, * data: [ { itemId, path, ... } ], // renamed from `results` 2026-05-14 * * } * * For `audit all`, the envelope wraps multiple per-audit reports: * * { * command: "audit.all", * environment: "sandbox", * audits: { "broken-links": , ... }, * summary: { totalFindings, byAudit } * } */ export type OutputFormat = "json" | "csv" | "markdown"; export interface AuditEnvelope { command: string; environment: string | null; count?: number; /** Canonical envelope key for the primary payload. */ data: unknown[]; summary?: string; [key: string]: unknown; } /** Format a single-audit envelope. */ export declare const formatAuditOutput: (envelope: AuditEnvelope, format: OutputFormat) => string; /** * Write an audit envelope to a file or stdout (when filePath is unset). * Returns the formatted string for callers that want to also display * it in the logger. */ export declare const writeAuditOutput: (envelope: AuditEnvelope, options?: { format?: OutputFormat; output?: string; }) => string; export declare const inferFormatFromExtension: (filePath: string) => OutputFormat | undefined;