import { type Blueprint, type Environment, type IsolationStrategy } from './schema.js'; import type { StatementObserver } from './statement-observer.js'; export interface ResolvedObservability { readonly slowQueryMs: number; readonly logAllQueries: boolean; readonly poolMetricsInterval: number; /** Caller-supplied per-statement observer; undefined when not configured. */ readonly onStatement: StatementObserver | undefined; } export interface ResolvedTrace { readonly hotRetentionDays: number; readonly errorRetentionDays: number; readonly partitionLeadDays: number; readonly safetyFactor: number; /** Unset → the runtime step cap is open (truncation never fires). Set → cap is `structuralMax × safetyFactor`. */ readonly structuralMax: number | undefined; readonly captureInputs: boolean; /** * Consumer-extension I/O registry (Q9). Keys are lexical call patterns — * either a bare identifier (`"fetch"`) or a single member access * (`"cache.get"`) — and values declare whether the call is a read or a * write. The Tier-2 coverage check unions this with the stock pipework * registry (`pipe.*` writes, `pipe(...)`-chain reads). */ readonly io: Readonly>; /** * Maximum audit rows emitted per write+audit CTE statement (Q8 / Phase 6c). * Bulk inserts whose `values.length × touches.length` would exceed this are * split into chunks executed sequentially inside a transaction (or savepoint * when already nested). Engineering knob: defaults to 5000, never zero. */ readonly auditChunkSize: number; } export interface ResolvedAudit { readonly retentionDays: number; } export interface ResolvedConfig { readonly raw: Blueprint; readonly environment: Environment; readonly observability: ResolvedObservability; readonly trace: ResolvedTrace; readonly audit: ResolvedAudit; readonly env: Readonly>; database(name?: string): ResolvedDatabase; databases(): ReadonlyMap; databaseNames(): readonly string[]; defaultDatabaseName(): string; isolationStrategy(dbName: string): IsolationStrategy; } export interface ResolvedDatabase { readonly name: string; readonly url: string; readonly appUrl?: string; /** Directory relative `migrations`/`schema` paths resolve against — the config file's directory (process.cwd() for directly-constructed configs). */ readonly baseDir: string; /** Glob patterns stay as authored; consumers glob them with `cwd: baseDir`. */ readonly schema: string | string[] | undefined; /** Absolute — resolved against baseDir at load time, so cwd never matters (D1). */ readonly migrations: string | undefined; readonly extensions: readonly string[]; readonly migrationTable: string; readonly pool: { max: number; idleTimeout: number; }; readonly rls?: { readonly sessionVar: string; readonly force: boolean; }; } export declare function loadConfig(raw: unknown): ResolvedConfig; //# sourceMappingURL=load.d.ts.map