/** * Config Paths Resolution * * Provides functions for resolving configuration file paths. * Handles both global (~/.specforge/) and project-level (.specforge.json) paths. */ import { ConfigPaths } from './types.js'; /** * Get all configuration file paths * * @returns ConfigPaths object with all resolved paths * * @example * ```typescript * const paths = getConfigPaths(); * console.log(paths.globalDir); // /home/user/.specforge * console.log(paths.globalConfig); // /home/user/.specforge/config.json * console.log(paths.projectConfig); // /current/dir/.specforge.json * ``` */ export declare function getConfigPaths(): ConfigPaths; /** * Get the global configuration directory path * * Uses $HOME/.specforge on all platforms. * Does not create the directory - that's handled by the writer. * * @returns Absolute path to global config directory * * @example * ```typescript * const dir = getGlobalConfigDir(); * // Linux/macOS: /home/user/.specforge * // Windows: C:\Users\user\.specforge * ``` */ export declare function getGlobalConfigDir(): string; /** * Get the global configuration file path * * @returns Absolute path to ~/.specforge/config.json */ export declare function getGlobalConfigPath(): string; /** * Get the project configuration file path * * Resolves to .specforge.json in the current working directory. * Note: This returns the path in CWD only - for searching up the * directory tree, use findProjectConfigPath(). * * @returns Absolute path to .specforge.json in current directory */ export declare function getProjectConfigPath(): string; /** * Get the MCP configuration file path * * @returns Absolute path to .mcp.json in current directory */ export declare function getMcpConfigPath(): string; /** * Find project config by searching up the directory tree * * Starts from the current directory and walks up to the filesystem root, * looking for .specforge.json at each level. * * @param startDir - Directory to start searching from (defaults to cwd) * @returns Absolute path to .specforge.json if found, null otherwise * * @example * ```typescript * // Given: /home/user/projects/myapp/src/components * // With .specforge.json at /home/user/projects/myapp/.specforge.json * * const configPath = findProjectConfigPath(); * // Returns: /home/user/projects/myapp/.specforge.json * ``` */ export declare function findProjectConfigPath(startDir?: string): string | null; /** * Get the directory containing the project config * * Useful for resolving relative paths from the project root. * * @returns Directory path if project config found, null otherwise */ export declare function findProjectRoot(): string | null; /** * Check if a path is within the global config directory * * Security check to prevent path traversal attacks. * * @param targetPath - Path to check * @returns true if path is within ~/.specforge/ */ export declare function isWithinGlobalDir(targetPath: string): boolean; //# sourceMappingURL=paths.d.ts.map