/**
 * Configuration File Loading
 *
 * Handles YAML configuration file parsing, discovery, and writing.
 */
import type { Configuration, PartialConfiguration, YamlConfigFile, ConfigFileDiscovery } from './types.js';
/** Default config file name */
export declare const CONFIG_FILE_NAME = "config.yaml";
/** Default .stoneforge directory name */
export declare const STONEFORGE_DIR = ".stoneforge";
/**
 * Finds the nearest .stoneforge directory by walking up from the given directory.
 *
 * This function first checks the STONEFORGE_ROOT environment variable, which
 * is used to support agents working in git worktrees. When an agent is spawned
 * in a worktree, STONEFORGE_ROOT points to the main workspace root where the
 * SQLite database lives.
 *
 * @param startDir - Directory to start searching from
 * @returns Path to .stoneforge directory, or undefined if not found
 */
export declare function findStoneforgeDir(startDir: string): string | undefined;
/**
 * Gets the global config directory path
 */
export declare function getGlobalConfigDir(): string;
/**
 * Gets the global config file path
 */
export declare function getGlobalConfigPath(): string;
/**
 * Discovers the configuration file location
 *
 * @param overridePath - Optional override path to use
 * @param startDir - Directory to start searching from (default: cwd)
 * @returns Discovery result with path and existence info
 */
export declare function discoverConfigFile(overridePath?: string, startDir?: string): ConfigFileDiscovery;
/**
 * Parses YAML content into a config file structure
 *
 * @param content - YAML string content
 * @param filePath - Path to file (for error messages)
 * @returns Parsed YAML config object
 */
export declare function parseYamlConfig(content: string, filePath?: string): YamlConfigFile;
/**
 * Converts YAML config (snake_case) to internal format (camelCase)
 *
 * @param yamlConfig - Parsed YAML config
 * @returns Partial configuration in internal format
 */
export declare function convertYamlToConfig(yamlConfig: YamlConfigFile): PartialConfiguration;
/**
 * Reads and parses a configuration file
 *
 * @param filePath - Path to the configuration file
 * @returns Partial configuration from the file
 */
export declare function readConfigFile(filePath: string): PartialConfiguration;
/**
 * Converts internal config (camelCase) to YAML format (snake_case)
 *
 * @param config - Configuration in internal format
 * @returns YAML config object
 */
export declare function convertConfigToYaml(config: Configuration | PartialConfiguration): YamlConfigFile;
/**
 * Serializes configuration to YAML string
 *
 * @param config - Configuration to serialize
 * @returns YAML string
 */
export declare function serializeConfigToYaml(config: Configuration | PartialConfiguration): string;
/**
 * Writes configuration to a file
 *
 * @param filePath - Path to write to
 * @param config - Configuration to write
 */
export declare function writeConfigFile(filePath: string, config: Configuration | PartialConfiguration): void;
/**
 * Updates a configuration file by merging with existing content
 *
 * @param filePath - Path to the configuration file
 * @param updates - Partial configuration to merge
 */
export declare function updateConfigFile(filePath: string, updates: PartialConfiguration): void;
/**
 * Expands ~ to home directory in a path
 */
export declare function expandPath(filePath: string): string;
/**
 * Expands ~ in all playbook paths
 */
export declare function expandPlaybookPaths(paths: string[]): string[];
//# sourceMappingURL=file.d.ts.map