/** * archrad.yml — project-level configuration for the archrad CLI. * * The loader looks for `archrad.yml` (or `archrad.yaml`) starting from the * current working directory and walking upward toward the filesystem root. * When found, its values are used as **defaults** for matching CLI options; * explicit flags on the command line always win. * * Supported shape (version: 1): * * version: 1 * ir: ./archrad-graph.json # default --ir for validate / export / drift * target: python # default --target for export / drift * output: ./generated # default --out / --output * policies: ./policies # default --policies * failOn: error # default --fail-on for validate * failOnWarning: false # default --fail-on-warning * maxWarnings: 0 # default --max-warnings * hostPort: 8080 # default --host-port * skipLint: false # validate: --skip-lint * skipIrLint: false # export / drift: --skip-ir-lint * irLintProfile: default # validate / lint / export / drift — monolith-relaxed omits layered-service rules * strictExtra: false # drift: --strict-extra * strictHostPort: false # export: --strict-host-port * skipHostPortCheck: false # export / drift: --skip-host-port-check * report: ./archrad-report.html # validate: --report * findingsJsonOut: ./archrad-findings.json * metricsFile: ./archrad-metrics.json * codebase: ./src # validate: --codebase; reconstruct: --from * codebaseLanguage: auto # validate: --codebase-language; reconstruct: --language * codebaseExclude: # validate: --codebase-exclude; reconstruct: --exclude * - vendor * implDriftFailOn: error # validate: --impl-drift-fail-on (IR-DRIFT-IMPL-* only) * * File-path values are resolved relative to the directory that contains the * config file, so `archrad validate` behaves consistently regardless of which * subdirectory the user invokes it from. */ import { z } from 'zod'; export declare const CONFIG_FILE_NAMES: readonly ["archrad.yml", "archrad.yaml"]; export declare const ArchradConfigSchema: z.ZodObject<{ version: z.ZodOptional>; ir: z.ZodOptional; target: z.ZodOptional>; output: z.ZodOptional; policies: z.ZodOptional; failOn: z.ZodOptional>; failOnWarning: z.ZodOptional; maxWarnings: z.ZodOptional; skipLint: z.ZodOptional; skipIrLint: z.ZodOptional; irLintProfile: z.ZodOptional>; hostPort: z.ZodOptional>; skipHostPortCheck: z.ZodOptional; strictHostPort: z.ZodOptional; strictExtra: z.ZodOptional; report: z.ZodOptional; findingsJsonOut: z.ZodOptional; metricsFile: z.ZodOptional; policiesRequireSigned: z.ZodOptional; cosignPubkey: z.ZodOptional; codebase: z.ZodOptional; codebaseLanguage: z.ZodOptional>; codebaseExclude: z.ZodOptional>; implDriftFailOn: z.ZodOptional>; }, z.core.$strict>; export type ArchradConfig = z.infer; export interface LoadedArchradConfig { /** Parsed, validated configuration. */ config: ArchradConfig; /** Absolute path to the config file that produced `config`. */ configPath: string; /** Absolute path to the directory containing the config file. */ configDir: string; } export declare class ArchradConfigError extends Error { readonly path: string | null; constructor(message: string, path?: string | null); } /** * Walk upward from `startDir` looking for a config file. Stops at the * filesystem root. Returns `null` when no config is found. */ export declare function findArchradConfigFile(startDir: string): string | null; /** Read and validate an archrad config file (async). */ export declare function readArchradConfigFile(configPath: string): Promise; /** Read and validate an archrad config file (sync — used by CLI bootstrap). */ export declare function readArchradConfigFileSync(configPath: string): LoadedArchradConfig; export interface LoadArchradConfigOptions { startDir?: string; configPath?: string | null; disabled?: boolean; } /** Discover (or accept a path to) and load the project config. Async. */ export declare function loadArchradConfig(opts?: LoadArchradConfigOptions): Promise; /** Discover (or accept a path to) and load the project config. Sync. */ export declare function loadArchradConfigSync(opts?: LoadArchradConfigOptions): LoadedArchradConfig | null; /** * Resolve a config-relative path into an absolute path. Absolute paths * are returned unchanged. Returns `undefined` for empty input. */ export declare function resolveConfigPath(value: string | undefined, configDir: string): string | undefined; /** * Convert a config value into the shape a CLI option default expects. * Paths resolve relative to the config directory; numeric values that * map to string-typed flags (e.g. `--max-warnings`) get stringified. */ export declare function coerceConfigValueForCli(key: keyof ArchradConfig, value: unknown, configDir: string): unknown; /** * Format a stderr line describing which config file (if any) was used. * Returns null when no config was loaded. */ export declare function describeLoadedConfig(loaded: LoadedArchradConfig | null): string | null; //# sourceMappingURL=config.d.ts.map