/** * Configuration parsing and defaults for the rolebox error recovery framework. * * Provides the default recovery configuration, per-category strategy chains, * known strategy name validation, and a recursive config parser that merges * raw role.yaml data with role-level defaults. * * @module recovery/config */ import type { RecoveryConfig, RecoveryErrorCategory, RecoveryChainConfig } from "./types.ts"; /** * Default recovery configuration applied when no user config is provided. * * Recovery is enabled by default — error recovery hooks (session_error, * edit_error, json_error, context_window, empty_response) activate * automatically. Guard hooks (bash_file_read_guard, write_existing_file_guard, * etc.) remain opt-in. Users can disable everything with `recovery.enabled: false`. */ export declare const DEFAULT_RECOVERY_CONFIG: RecoveryConfig; /** * Default strategy chains for each recoverable error category. * * These chains are used when a category has no explicit user-defined chain. * Each chain is a sequence of strategies that are tried in order until one * succeeds or the chain is exhausted. */ export declare const DEFAULT_CHAINS: Partial>; /** * Set of all recognised recovery strategy names. * * Used for validation during config parsing — unknown strategy names are * warned about and skipped to prevent silent misconfiguration. */ export declare const KNOWN_STRATEGIES: Set; /** * Register a custom recovery strategy name so it passes YAML config validation. */ export declare function addKnownStrategy(name: string): void; /** * Parse raw (typically YAML-derived) configuration into a validated * {@link RecoveryConfig}. * * Handles undefined/null input gracefully, falling back to defaults. * Warns on unknown strategy names and skips them. Merges role-level * defaults after parsing, so role-level overrides take precedence over * parsed values and default chains fill in for categories without an * explicit user chain. * * @param raw - Raw configuration object (from role.yaml `recovery:` block) * @param roleDefaults - Optional role-level default overrides * @returns A fully resolved RecoveryConfig */ export declare function parseRecoveryConfig(raw: unknown, roleDefaults?: Partial): RecoveryConfig; /** * Merge multiple built-in hook flag records with left-to-right priority. * * An explicit `true` in any flag set wins. A `false` only applies when no * earlier flag set has explicitly set the key to `true`. * * This ensures that role-level config overrides can selectively enable * built-in hooks without accidentally disabling hooks that were already * enabled by a higher-priority source. * * @param flags - Array of flag records, ordered from lowest to highest priority * @returns A single merged flag record */ export declare function mergeBuiltinFlags(flags: Record[]): Record; //# sourceMappingURL=config.d.ts.map