/** * Unified YAML Configuration Loader for FABER CLI * * Loads and parses `.fractary/config.yaml` with environment variable substitution. * Provides access to shared configuration for FABER and fractary-core plugins. */ export type { AnthropicConfig, GitHubAppConfig, GitHubConfig, WorktreeConfig, WorkflowConfig, BacklogManagementConfig, FaberConfig, UnifiedConfig, ConfigLoadOptions, } from '../types/config.js'; import type { UnifiedConfig, ConfigLoadOptions } from '../types/config.js'; /** * Load and parse `.fractary/config.yaml` with environment variable substitution * * @param options Configuration loading options * @returns Parsed configuration object or null if not found * @throws Error if config is invalid or throwIfMissing is true and file doesn't exist * * @example * ```typescript * const config = loadYamlConfig(); * if (config?.github) { * console.log('GitHub config:', config.github); * } * ``` */ export declare function loadYamlConfig(options?: ConfigLoadOptions): UnifiedConfig | null; /** * Write unified configuration to `.fractary/config.yaml` * * @param config Configuration object to write * @param projectRoot Project root directory (auto-detected if not provided) * * @example * ```typescript * writeYamlConfig({ * version: '2.0', * github: { * organization: 'myorg', * project: 'myrepo' * } * }); * ``` */ export declare function writeYamlConfig(config: UnifiedConfig, projectRoot?: string): void; /** * Substitute ${ENV_VAR} placeholders with actual environment variables * * Supports: * - ${VAR_NAME} - Replace with env var value * - ${VAR_NAME:-default} - Replace with env var value or default if not set * * Security: Default values are limited to 1000 characters to prevent abuse. * Variable names must match pattern: [A-Z_][A-Z0-9_]* * * @param content Content with environment variable placeholders * @param warnMissing Whether to warn about missing environment variables * @returns Content with substituted values * * @example * ```typescript * const content = 'token: ${GITHUB_TOKEN}'; * const result = substituteEnvVars(content); * // result: 'token: ghp_xxxxx' * ``` */ export declare function substituteEnvVars(content: string, warnMissing?: boolean): string; /** * Find project root by looking for .fractary directory or .git * * Walks up the directory tree from startDir until it finds: * - A directory containing `.fractary/` * - A directory containing `.git/` * - The filesystem root * * Security: Normalizes paths and prevents traversal outside filesystem boundaries. * Maximum of 100 directory levels to prevent infinite loops. * * @param startDir Directory to start searching from (default: current working directory) * @returns Project root directory (normalized absolute path) */ export declare function findProjectRoot(startDir?: string): string; /** * Check if a valid configuration file exists * * @param projectRoot Project root directory (auto-detected if not provided) * @returns true if config exists at .fractary/config.yaml */ export declare function configExists(projectRoot?: string): boolean; /** * Get the configuration file path * * @param projectRoot Project root directory (auto-detected if not provided) * @returns Full path to configuration file */ export declare function getConfigPath(projectRoot?: string): string; /** * Check if old settings.json exists (for migration) * * @param projectRoot Project root directory (auto-detected if not provided) * @returns true if old settings.json exists */ export declare function oldSettingsExists(projectRoot?: string): boolean; /** * Get the old settings.json file path * * @param projectRoot Project root directory (auto-detected if not provided) * @returns Full path to old settings.json file */ export declare function getOldSettingsPath(projectRoot?: string): string; //# sourceMappingURL=yaml-config.d.ts.map