/** * lex.yaml Discovery Module * * Finds lex.yaml in the filesystem by walking up from a starting directory. * Graceful degradation: returns null when not found, not an error. * * @module lex-yaml/discovery */ /** Default filename to search for */ export declare const LEX_YAML_FILENAME = "lex.yaml"; /** Alternative filename (future-proof) */ export declare const LEX_YAML_ALT_FILENAME = ".lex.yaml"; /** * Check if lex.yaml exists in a directory. * @param dir - Directory to check (absolute path) * @returns true if lex.yaml exists */ export declare function hasLexYaml(dir: string): boolean; /** * Get the path to lex.yaml in a directory if it exists. * @param dir - Directory to check (absolute path) * @returns Path to lex.yaml, or null if not found */ export declare function getLexYamlPath(dir: string): string | null; /** * Find lex.yaml by walking up from a starting directory. * * @param startDir - Directory to start from (defaults to process.cwd()) * @param maxDepth - Maximum parent directories to traverse (default: 10) * @returns Absolute path to lex.yaml, or null if not found * * @example * ```ts * const configPath = findLexYaml(); * if (configPath) { * console.log(`Found lex.yaml at ${configPath}`); * } else { * console.log("No lex.yaml found - using defaults"); * } * ``` */ export declare function findLexYaml(startDir?: string, maxDepth?: number): string | null; /** * Find the repo root by looking for common markers. * Useful for determining where lex.yaml should be placed. * * @param startDir - Directory to start from * @returns Absolute path to repo root, or null if not found */ export declare function findRepoRoot(startDir?: string): string | null; /** * Result of discovery operation with metadata. */ export interface DiscoveryResult { /** Absolute path to lex.yaml, or null if not found */ path: string | null; /** Directory containing lex.yaml (repo root) */ rootDir: string | null; /** Whether lex.yaml was found */ found: boolean; } /** * Discover lex.yaml with full metadata. * * @param startDir - Directory to start from * @returns Discovery result with path and metadata */ export declare function discoverLexYaml(startDir?: string): DiscoveryResult;