/**
 * Configuration loader/saver for VibeFrame CLI.
 *
 * Two scopes:
 *   - user    ~/.vibeframe/config.yaml         (shared across projects)
 *   - project <cwd>/.vibeframe/config.yaml     (gitignored, per-project)
 *
 * Precedence at runtime: process.env > project > user.
 *
 * Default `loadConfig()` behavior is "auto" — if a project config exists in
 * the current working directory or one of its parents, it is used and the user
 * config is ignored.
 * Pass `{scope:"user"}` or `{scope:"project"}` to force one side.
 *
 * Pass `{merge:true}` to overlay project on user (project wins). Used by
 * doctor to render "where did this key come from" diagnostics.
 */
import { type VibeConfig } from "./schema.js";
export type Scope = "user" | "project";
/** User-scope config directory (~/.vibeframe by default). */
export declare const USER_CONFIG_DIR: string;
/** User-scope config file (~/.vibeframe/config.yaml by default). */
export declare const USER_CONFIG_PATH: string;
/** User data directory (~/.local/share/vibeframe by default). */
export declare const USER_DATA_DIR: string;
/** User cache directory (~/.vibeframe/cache by default). */
export declare const USER_CACHE_DIR: string;
/** Legacy user-scope config directory used by pre-XDG installs. */
export declare const LEGACY_USER_CONFIG_DIR: string;
/** Legacy user-scope config file used by pre-XDG installs. */
export declare const LEGACY_USER_CONFIG_PATH: string;
/**
 * Back-compat aliases. New code should use `USER_CONFIG_PATH` /
 * `USER_CONFIG_DIR` or `getConfigPath(scope)` to be scope-explicit.
 */
export declare const CONFIG_DIR: string;
export declare const CONFIG_PATH: string;
export declare class ConfigFileError extends Error {
    readonly path: string;
    constructor(path: string, cause: unknown);
}
/** Project-scope config directory (`<cwd>/.vibeframe`). */
export declare function getProjectConfigDir(cwd?: string): string;
/** Project-scope config file (`<cwd>/.vibeframe/config.yaml`). */
export declare function getProjectConfigPath(cwd?: string): string;
/** Resolve config file path for a given scope. */
export declare function getConfigPath(scope: Scope, cwd?: string): string;
/** Resolve config directory for a given scope. */
export declare function getConfigDir(scope: Scope, cwd?: string): string;
export interface UserConfigStatus {
    /** True when either the primary config file or legacy ~/.vibeframe/config.yaml exists. */
    configured: boolean;
    /** Path loadConfig({scope:"user"}) will read from, or the write path when absent. */
    configPath: string;
    /** Write target for new user-scope saves. */
    writePath: string;
    /** Legacy fallback path. */
    legacyConfigPath: string;
    /** True when the primary write target exists. */
    primaryConfigured: boolean;
    /** True when the legacy fallback exists. */
    legacyConfigured: boolean;
    /** Source currently used for user-scope reads. */
    source: "user" | "legacy" | null;
}
export declare function getUserConfigStatus(): Promise<UserConfigStatus>;
export declare function findProjectConfigPath(cwd?: string): Promise<string | null>;
/**
 * The scope that `loadConfig()` will read from when called without an
 * explicit scope. Returns `"project"` if a project config exists at cwd or an
 * ancestor directory, else `"user"` (regardless of whether the user file exists).
 */
export declare function getActiveScope(cwd?: string): Promise<Scope>;
export interface LoadConfigOptions {
    /** Force a specific scope. Default: auto (project if exists, else user). */
    scope?: Scope;
    /** Working directory for resolving the project scope. Default: process.cwd(). */
    cwd?: string;
    /** Overlay project on user (project wins). Useful for doctor diagnostics. */
    merge?: boolean;
}
/**
 * Load configuration. Returns null if no config exists at the resolved scope.
 */
export declare function loadConfig(options?: LoadConfigOptions): Promise<VibeConfig | null>;
export interface SaveConfigOptions {
    /** Target scope. Default: "user" (back-compat with prior behavior). */
    scope?: Scope;
    /** Working directory for resolving the project scope. Default: process.cwd(). */
    cwd?: string;
}
/** Save configuration to the chosen scope. Default scope is "user". */
export declare function saveConfig(config: VibeConfig, options?: SaveConfigOptions): Promise<void>;
/**
 * Check if any configuration is present and the primary LLM provider has a
 * key (in the active scope or the environment).
 */
export declare function isConfigured(options?: Pick<LoadConfigOptions, "cwd">): Promise<boolean>;
/**
 * Get an API key. Auto-detects scope (project > user) and falls through to
 * the provider's environment variable if neither config has it.
 */
export declare function getApiKeyFromConfig(providerKey: string, options?: Pick<LoadConfigOptions, "cwd">): Promise<string | undefined>;
/**
 * Update a provider key in the active scope (project if present, else user).
 * Pass `{scope}` to force a specific destination.
 */
export declare function updateProviderKey(providerKey: string, apiKey: string, options?: SaveConfigOptions): Promise<void>;
export type { VibeConfig, LLMProvider } from "./schema.js";
export { createDefaultConfig, PROVIDER_NAMES, PROVIDER_ENV_ALIASES, PROVIDER_ENV_VARS, } from "./schema.js";
