import { z } from "zod"; import type { RuleConfig } from "./defaultRules.js"; import type { CustomRule, EnforcementThresholds } from "../types/guardrail.types.js"; /** Config files discovered in the working directory, in priority order. */ export declare const CONFIG_FILE_NAMES: string[]; /** Environment variable that points at a config file. Overridden by `--config`. */ export declare const CONFIG_ENV_VAR = "AI_TEST_GUARDRAILS_CONFIG"; export declare const configSchema: z.ZodObject<{ rules: z.ZodOptional; detectHardSleeps: z.ZodOptional; detectRandomWithoutSeed: z.ZodOptional; detectUnboundedRetries: z.ZodOptional; detectUnmockedNetworkCalls: z.ZodOptional; detectDynamicSelectors: z.ZodOptional; }, z.core.$strict>>; architecture: z.ZodOptional; forbidGlobalState: z.ZodOptional; maxDescribeDepth: z.ZodOptional; forbidDuplicateTestTitles: z.ZodOptional; detectPositionalSelectors: z.ZodOptional; detectForcedActions: z.ZodOptional; }, z.core.$strict>>; flakeRisk: z.ZodOptional; networkDependencyWeight: z.ZodOptional; multipleNavigationsWeight: z.ZodOptional; sharedStateWeight: z.ZodOptional; timingAssertionsWeight: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>>; thresholds: z.ZodOptional; flakeRiskThreshold: z.ZodOptional; determinismThreshold: z.ZodOptional; }, z.core.$strict>>; plugins: z.ZodOptional; severity: z.ZodEnum<{ critical: "critical"; major: "major"; minor: "minor"; }>; description: z.ZodOptional; check: z.ZodCustom<(context: import("../types/guardrail.types.js").RuleContext) => import("../types/guardrail.types.js").RuleFinding[], (context: import("../types/guardrail.types.js").RuleContext) => import("../types/guardrail.types.js").RuleFinding[]>; }, z.core.$strip>>; }, z.core.$strip>]>>>; scan: z.ZodOptional>; ignore: z.ZodOptional>; }, z.core.$strict>>; }, z.core.$strict>; /** Shape of an `ai-test-guardrails.config.*` file. */ export type GuardrailsConfig = z.infer; /** Identity helper that gives JS config files type checking and editor completion. */ export declare function defineConfig(config: GuardrailsConfig): GuardrailsConfig; /** Fully resolved configuration used by the server and scanner. */ export interface RuntimeConfig { /** Absolute path of the loaded config file, or null when defaults are in use. */ configPath: string | null; rules: RuleConfig; thresholds: EnforcementThresholds; /** Names of the loaded plugins, in load order. */ plugins: string[]; customRules: CustomRule[]; scan: ScanPolicy; } export interface ScanPolicy { /** Absolute directories that scan_project paths must fall within. Empty means unrestricted. */ allowedRoots: string[]; /** Ignore globs applied to every scan, in addition to the built-in directory list. */ ignore: string[]; } export interface LoadRuntimeConfigOptions { argv?: string[]; env?: Record; cwd?: string; } /** Read a `--name value` or `--name=value` option from an argv array. */ export declare function readArgvOption(argv: string[], name: string): string | undefined; /** * Locate the config file: `--config` wins, then the environment variable, * then the first conventional file name found in `cwd`. */ export declare function resolveConfigPath(argv: string[], env: Record, cwd: string): string | null; /** Validate an already-loaded config object. Throws with a readable message on failure. */ export declare function parseConfig(value: unknown, source: string): GuardrailsConfig; /** Load and validate a config file (`.json`, `.js`, `.mjs`, or `.cjs`). */ export declare function loadConfigFile(configPath: string): Promise; /** Resolve plugin entries (module specifiers or inline objects) into a flat rule list. */ export declare function loadPlugins(entries: NonNullable, baseDir: string): Promise<{ plugins: string[]; customRules: CustomRule[]; }>; /** Overlay partial rule settings from a config file onto the defaults. */ export declare function mergeRules(overrides: GuardrailsConfig["rules"]): RuleConfig; export declare function mergeThresholds(overrides: GuardrailsConfig["thresholds"]): EnforcementThresholds; /** Build the runtime config from defaults plus a resolved config file, if any. */ export declare function resolveRuntimeConfig(config: GuardrailsConfig, configPath: string | null): Promise; /** Locate, load, validate, and merge the config for this process. */ export declare function loadRuntimeConfig(options?: LoadRuntimeConfigOptions): Promise; //# sourceMappingURL=loadConfig.d.ts.map