/** * Config Path Resolver * * Centralizes all 0xRay config file path resolution. * Supports XRAY_CONFIG_DIR env var for custom config roots. * * Resolution order (per file type): * 1. XRAY_CONFIG_DIR/ (if env var set) * 2. .xray/ (preferred lightweight root) * 3. null (callers fall back to built-in defaults) * * For state/data directories, uses: * 1. XRAY_CONFIG_DIR/state (if env var set) * 2. .xray/state * 3. .opencode/state (legacy) * 4. .xray/state (default — always writable) */ /** Environment variable name for custom config root */ export declare const XRAY_CONFIG_DIR_ENV = "XRAY_CONFIG_DIR"; /** * Detect the best available config directory. * Scans in priority order and caches the first one that exists (or the first default). */ export declare function getConfigDir(projectRoot?: string): string; /** * Resolve a specific config file path using the standard priority chain. * Returns null if no suitable path is found (caller should use defaults). * * @param relativePath - Path relative to config dir (e.g., "features.json") * @param projectRoot - Optional project root override */ export declare function resolveConfigPath(relativePath: string, projectRoot?: string): string | null; /** * Get the state persistence directory (the parent directory for state.json). * Similar logic to resolveConfigPath but for the state/ subdirectory. */ export declare function resolveStateDir(projectRoot?: string): string; /** * Get the state persistence FILE path (e.g. .opencode/state/state.json). * Prefer this over resolveStateDir when you need a file path for fs.writeFileSync. */ export declare function resolveStateFilePath(projectRoot?: string): string; /** * Get the profiles storage directory. */ export declare function resolveProfilesDir(projectRoot?: string): string; /** * Resolve codex.json path. * Has additional fallback locations beyond the standard config dir. */ /** Environment variable for explicit project root override */ export declare const XRAY_ROOT_ENV = "XRAY_ROOT"; /** * Resolve project root using XRAY_ROOT env var if set, * otherwise fall back to projectRoot param or cwd. */ export declare function resolveProjectRoot(projectRoot?: string): string; export declare function resolveCodexPath(projectRoot?: string): string[]; /** * Get the logs directory for framework logging. */ export declare function resolveLogDir(projectRoot?: string): string; /** * Reset the cached config dir (useful for testing). */ export declare function resetConfigDirCache(): void;