/** * Configuration file loader for Ignition CLI. * * Loads `ignition.config.ts` from the project root via dynamic import * and merges config values with CLI flags (CLI always wins). */ import type { ErrorMode } from "../core/types.ts"; import type { HostKeyPolicy } from "../ssh/types.ts"; import type { OutputFormat, ResolvedRunCheckOptions, RunCheckOptions } from "./types.ts"; /** * Configuration file shape for `ignition.config.ts`. * * All fields are optional — they provide defaults that CLI flags override. * * @example * ```typescript * import type { IgnitionConfig } from '@grovemotorco/ignition' * * const config: IgnitionConfig = { * inventory: 'hosts.ts', * parallelism: 8, * trace: true, * } * * export default config * ``` */ export type IgnitionConfig = { /** Default inventory file path. */ inventory?: string | undefined; /** Default output format. */ format?: OutputFormat | undefined; /** Default error handling mode. */ errorMode?: ErrorMode | undefined; /** Maximum concurrent hosts. */ parallelism?: number | undefined; /** Per-host timeout in ms (0 = unlimited). */ hostTimeout?: number | undefined; /** Per-resource timeout in ms (0 = unlimited). */ resourceTimeout?: number | undefined; /** Retry attempts for transient failures. */ retries?: number | undefined; /** Initial retry backoff in ms. */ retryDelay?: number | undefined; /** Enable SSH connection multiplexing. */ multiplex?: boolean | undefined; /** SSH host key verification policy. */ hostKeyPolicy?: HostKeyPolicy | undefined; /** Dashboard server hostname. */ dashboardHost?: string | undefined; /** Dashboard server port. */ dashboardPort?: number | undefined; /** NDJSON log output directory. */ logDir?: string | undefined; /** Enable trace output. */ trace?: boolean | undefined; /** Enable check result caching. */ cache?: boolean | undefined; /** Cache TTL in ms. */ cacheTtl?: number | undefined; /** Clear cache before running. */ cacheClear?: boolean | undefined; /** Default variable overrides. */ vars?: Record | undefined; }; /** * Load an IgnitionConfig from `ignition.config.ts` in the given directory. * * Returns an empty config if the file doesn't exist. * Throws on syntax errors or invalid config values. */ export declare function loadConfig(cwd: string): Promise; /** * Merge CLI options with config file values. * * Precedence: CLI flag > config file > hardcoded default. * * CLI flags are `undefined` when not explicitly passed by the user (Stricli * flags use `optional: true` instead of `default:`). This lets the merge * correctly distinguish "user explicitly passed --no-trace" (`false`) from * "user didn't pass --trace" (`undefined`). */ export declare function mergeWithConfig(options: RunCheckOptions, config: IgnitionConfig): ResolvedRunCheckOptions; /** Error thrown when config file values are invalid. */ export declare class ConfigValidationError extends Error { constructor(message: string); } /** * Validate config file values at load time. * * Checks top-level shape, field types, enum membership, and numeric * constraints. Throws ConfigValidationError with a clear message on * the first invalid field. */ export declare function validateConfig(config: IgnitionConfig): void; //# sourceMappingURL=config.d.ts.map