import type { AgentConfig, AgentSettings, KeyAliasInfo } from "shared";
/** Get current agent settings. */
export declare function getAgentSettings(): AgentSettings;
/**
 * Whether the OpenRouter provider is usable — i.e. an API key is configured.
 * Drives provider selection for quick completions (title / branch / theme
 * generation) and the New Chat panel's provider toggle.
 */
export declare function isOpenRouterConfigured(settings?: AgentSettings): boolean;
/**
 * Resolve a user-defined OpenRouter model alias to its target slug.
 *
 * Lookup is case-insensitive on the alias name. An alias shadows a real
 * model slug of the same name (custom overrides the OpenRouter namespace);
 * anything that doesn't match an alias passes through unchanged, so raw
 * slugs keep working everywhere aliases are accepted. Resolution is one hop
 * by construction — the settings route rejects alias targets that are
 * themselves aliases.
 */
export declare function resolveOpenRouterModel(value: string | undefined, settings?: AgentSettings): string | undefined;
/**
 * Build the subset of environment variables that should be injected into the
 * Claude Agent SDK subprocess to reflect user-configured API / auth / model
 * overrides. Empty/unset fields are omitted so that process.env (i.e. the
 * regular subscription-based login flow) stays in effect.
 */
export declare function getApiEnvOverrides(settings?: AgentSettings): Record<string, string>;
export declare function getClaudeCodeExecutablePath(): string | undefined;
/**
 * Resolve the active MCP config directory based on the current proxy mode.
 *
 * Resolution:
 *   proxyMode === "local"  -> localMcpConfigDir ?? mcpConfigDir
 *   proxyMode === "remote" -> remoteMcpConfigDir ?? mcpConfigDir
 *   no proxyMode           -> mcpConfigDir
 */
export declare function getActiveMcpConfigDir(): string | undefined;
/** Merge updates into current settings and persist. */
export declare function updateAgentSettings(updates: Partial<AgentSettings>): AgentSettings;
/**
 * Discover key aliases from {mcpConfigDir}/keys/callers/.
 *
 * Each subdirectory under keys/callers/ represents a named caller identity.
 * Returns info about what key files exist in each alias directory so the
 * frontend can show which aliases are usable.
 *
 * In local mode, also includes caller aliases from remote.config.json
 * since local mode doesn't require crypto keys — the proxy runs in-process.
 */
export declare function discoverKeyAliases(overrideProxyMode?: "local" | "remote"): KeyAliasInfo[];
/**
 * Ensure the local proxy config directory exists.
 * Creates the directory (and parent dirs) if missing.
 * Safe to call multiple times (idempotent).
 */
export declare function ensureLocalProxyConfigDir(): void;
/**
 * Ensure the remote proxy config directory and key structure exist.
 * Creates the directory tree and a stub proxy.config.json if missing.
 *
 * Directory structure:
 *   {configDir}/
 *     proxy.config.json          — stub with default remoteUrl
 *     keys/callers/default/      — place your caller keypair here
 *     keys/server/               — place the server's public keys here
 *
 * Safe to call multiple times (idempotent).
 */
export declare function ensureRemoteProxyConfigDir(): void;
/**
 * Migrate legacy drawlatch directory names to the new convention and
 * ensure both directories exist.
 *
 *   .drawlatch        -> .drawlatch.local
 *   .drawlatch-remote -> .drawlatch.remote
 *
 * Also fixes stale agent-settings.json references that still point to
 * the old directory names (e.g., localMcpConfigDir still set to the
 * legacy .drawlatch path after a directory rename).
 *
 * Uses renameSync for atomic rename on the same filesystem.
 * Safe to call multiple times (idempotent).
 */
export declare function migrateDrawlatchDirs(): void;
/**
 * Migrate old key directory layout to the new callers/server structure.
 *
 * Old layout:
 *   keys/local/<alias>/         → keys/callers/<alias>/
 *   keys/remote/                → keys/server/
 *   keys/peers/remote-server/   → keys/server/  (public keys only)
 *   keys/peers/<alias>/         → keys/callers/<alias>/  (public keys only)
 *
 * Safe to call multiple times (idempotent). Only renames if old dirs exist
 * and new dirs don't.
 */
export declare function migrateKeyDirectories(): void;
/**
 * Resolve `mcpKeyAlias` on an agent based on the current proxy mode.
 *
 * Priority:
 *   1. Per-mode field matching current proxyMode (mcpKeyAliasLocal / mcpKeyAliasRemote)
 *   2. Legacy `mcpKeyAlias` field (old agents that haven't been migrated yet)
 *
 * Returns a shallow copy with `mcpKeyAlias` set to the resolved value.
 */
export declare function resolveAgentKeyAlias(agent: AgentConfig): AgentConfig;
/**
 * Route an incoming `mcpKeyAlias` value to the correct per-mode field
 * and strip the transient `mcpKeyAlias` before persistence.
 *
 * Also migrates legacy agents: if the agent has only the old `mcpKeyAlias`
 * field, copies it to the per-mode field for the *other* mode so the
 * alias is preserved when switching back.
 */
export declare function routeKeyAliasForPersist(agent: AgentConfig, incomingAlias: string | undefined): AgentConfig;
//# sourceMappingURL=agent-settings.d.ts.map