/**
 * Execution Configuration Storage
 *
 * Stores user preferences for execution settings in the workspace SQLite database.
 * Uses the workspace_settings table (not pmo_settings - execution is workspace-level).
 */
import Database from 'better-sqlite3';
import { ExecutionConfig, TerminalApp, Shell, DisplayMode, OutputMode, ExecutionEnvironment, AuthMethod, PermissionMode } from './types.js';
import { type JsonFlags } from '../prompt-json.js';
declare const CONFIG_KEYS: {
    terminalApp: string;
    terminalOpenInBackground: string;
    shell: string;
    defaultMode: string;
    defaultExecutor: string;
    autoExecute: string;
    outputMode: string;
    permissionMode: string;
    tmuxSession: string;
    tmuxLayout: string;
    tmuxControlMode: string;
    dockerImage: string;
    dockerNetwork: string;
    dockerMemory: string;
    dockerCpus: string;
    firewallAllowlistDomains: string;
    vmDefaultHost: string;
    vmUser: string;
    vmKeyPath: string;
    vmSyncMethod: string;
    coderName: string;
    authMethod: string;
    createPrDefault: string;
    mirrorToPmoDefault: string;
};
/**
 * Load execution config from database, merging with defaults
 */
export declare function loadExecutionConfig(db: Database.Database): ExecutionConfig;
/**
 * Save a single execution config setting to database
 */
export declare function saveExecutionSetting(db: Database.Database, key: keyof typeof CONFIG_KEYS, value: string): void;
/**
 * Save terminal app preference
 */
export declare function saveTerminalApp(db: Database.Database, app: TerminalApp): void;
/**
 * Save shell preference
 */
export declare function saveShell(db: Database.Database, shell: Shell): void;
/**
 * Save tmux control mode preference.
 * When enabled and using iTerm, tmux -CC is used for native tab integration.
 */
export declare function saveTmuxControlMode(db: Database.Database, enabled: boolean): void;
/**
 * Save terminal open in background preference.
 * When enabled, new terminal tabs open without stealing focus from current window.
 */
export declare function saveTerminalOpenInBackground(db: Database.Database, enabled: boolean): void;
/**
 * Save extra firewall allowlist domains.
 */
export declare function saveFirewallAllowlistDomains(db: Database.Database, domains: string[]): void;
/**
 * Save auth method preference (oauth or apikey)
 */
export declare function saveAuthMethod(db: Database.Database, method: AuthMethod): void;
/**
 * Get saved auth method preference.
 * Returns null if no preference has been saved (user should be prompted).
 */
export declare function getAuthMethod(db: Database.Database): AuthMethod | null;
/**
 * Clear saved auth method preference (will prompt again next time)
 */
export declare function clearAuthMethod(db: Database.Database): void;
/**
 * Get saved PR creation default preference.
 * Returns null if no preference has been saved (user should be prompted).
 */
export declare function getCreatePrDefault(db: Database.Database): boolean | null;
/**
 * Save PR creation default preference.
 */
export declare function saveCreatePrDefault(db: Database.Database, createPr: boolean): void;
/**
 * Get saved external issue mirror default preference.
 * Returns null if no preference has been saved.
 */
export declare function getMirrorToPmoDefault(db: Database.Database): boolean | null;
/**
 * Save external issue mirror default preference.
 */
export declare function saveMirrorToPmoDefault(db: Database.Database, mirrorToPmo: boolean): void;
/**
 * Check if terminal app preference has been set
 */
export declare function hasTerminalPreference(db: Database.Database): boolean;
/**
 * Check if shell preference has been set
 */
export declare function hasShellPreference(db: Database.Database): boolean;
/**
 * Auto-detect terminal app from environment.
 * Uses TERM_PROGRAM env var set by most terminal emulators.
 */
export declare function detectTerminalApp(): TerminalApp | null;
/**
 * Auto-detect shell from environment.
 * Uses SHELL env var.
 */
export declare function detectShell(): Shell | null;
/**
 * Prompt user for terminal app preference (first-time setup)
 */
export declare function promptTerminalPreference(db: Database.Database): Promise<TerminalApp>;
/**
 * Prompt user for tmux control mode preference (iTerm only).
 * When enabled, tmux -CC is used for native iTerm tab/window integration.
 */
export declare function promptTmuxControlModePreference(db: Database.Database): Promise<boolean>;
/**
 * Get terminal app, auto-detecting or prompting if not set
 */
export declare function getTerminalApp(db: Database.Database): Promise<TerminalApp>;
/**
 * Prompt user for shell preference (first-time setup)
 */
export declare function promptShellPreference(db: Database.Database): Promise<Shell>;
/**
 * Get shell, auto-detecting or prompting if not set
 */
export declare function getShell(db: Database.Database): Promise<Shell>;
export interface ExecutionPromptOptions {
    /** Display mode selected by user */
    displayMode: DisplayMode;
    /** Environment selected by user */
    environment: ExecutionEnvironment;
    /** Skip output mode prompt and use this value instead */
    outputMode?: OutputMode;
    /** Permission mode override (skips prompt) */
    permissionMode?: PermissionMode;
    /** Skip PR prompt and use this value instead */
    createPR?: boolean;
    /** Force re-prompt for terminal preferences */
    reconfigure?: boolean;
    /** Log function for status messages */
    log?: (msg: string) => void;
    /** JSON mode configuration for AI agents */
    jsonMode?: {
        flags: JsonFlags & Record<string, unknown>;
        commandName: string;
    };
}
export interface ExecutionPromptResult {
    /** Execution config with terminal/shell/output settings */
    executionConfig: ExecutionConfig;
    /** Permission mode for agent execution */
    permissionMode: PermissionMode;
    /** Whether to create PR when work is ready */
    createPR: boolean;
}
/**
 * Prompt for all execution settings in a consistent way.
 * Used by work start, work spawn, and work watch commands.
 */
export declare function promptExecutionSettings(db: Database.Database, options: ExecutionPromptOptions): Promise<ExecutionPromptResult>;
/**
 * Get GitHub username via gh CLI.
 * Returns null if gh is not installed or not authenticated.
 */
export declare function getGitHubUsername(): string | null;
/**
 * Get git config user.name as default coder name.
 * Returns null if git user.name is not configured.
 */
export declare function getGitUserName(): string | null;
/**
 * Get the configured coder name from the database.
 * Returns null if not configured.
 */
export declare function getCoderName(db: Database.Database): string | null;
/**
 * Save coder name preference to database.
 */
export declare function saveCoderName(db: Database.Database, name: string): void;
/**
 * Check if coder name has been configured.
 */
export declare function hasCoderName(db: Database.Database): boolean;
/**
 * Prompt user for coder name preference (first-time setup).
 * Uses git config user.name as default if available.
 */
export declare function promptCoderName(db: Database.Database): Promise<string>;
/**
 * Get coder name, auto-detecting from GitHub if not set.
 * Priority: saved setting > GitHub username > git user.name > prompt
 */
export declare function getOrPromptCoderName(db: Database.Database): Promise<string>;
export {};
