/**
 * Execution Runners
 *
 * Implementations for each execution environment (devcontainer, host, docker, vm).
 */
import { ExecutionEnvironment, DisplayMode, OutputMode, PermissionMode, SessionManager, ExecutorType, ExecutionContext, ExecutionConfig } from './types.js';
/**
 * Build a unified name for tmux sessions, window names, and tab titles.
 * Format: "{ticketId}-{action}-{agentName}"
 * Example: "TKT-347-implement-altman"
 */
export declare function buildSessionName(context: ExecutionContext): string;
import type { TerminalApp } from './types.js';
/**
 * Check if tmux control mode (-CC) should be used.
 * Control mode is only used with iTerm when controlMode is enabled in config.
 *
 * When control mode is active:
 * - iTerm handles scrolling, selection, and gestures natively
 * - tmux mouse mode should be disabled to avoid conflicts
 */
export declare function shouldUseControlMode(terminalApp: TerminalApp, controlModeEnabled: boolean): boolean;
/**
 * Build the tmux mouse option string for session creation.
 * Enables mouse mode for scroll support in tmux.
 * To select text or switch tabs, hold Shift or Option to bypass tmux.
 */
export declare function buildTmuxMouseOption(_useControlMode: boolean): string;
/**
 * Build the tmux attach command based on control mode.
 * Uses -u -CC flags for iTerm control mode (native scrolling/selection).
 * -u forces UTF-8 mode which is required for proper iTerm integration.
 * Uses regular attach otherwise.
 */
export declare function buildTmuxAttachCommand(useControlMode: boolean, includeUnicodeFlag?: boolean): string;
/**
 * Configure iTerm tmux preferences for control mode.
 * - windowMode: whether tmux -CC opens windows as tabs or new windows
 * - autoHide: automatically bury/hide the control session (the terminal where -CC was run)
 * @param mode - 'tab' for tabs in current window, 'window' for new windows
 */
export declare function configureITermTmuxPreferences(mode: 'tab' | 'window'): void;
export declare function configureITermTmuxWindowMode(mode: 'tab' | 'window'): void;
/**
 * Check if the claude-credentials Docker volume exists.
 */
export declare function credentialsVolumeExists(): boolean;
/**
 * Check if valid Claude OAuth credentials exist in the Docker volume.
 * Returns true if OAuth credentials are stored (even if access token is expired,
 * since Claude Code handles refresh internally using stored refresh tokens).
 *
 * NOTE: This intentionally does NOT check for ANTHROPIC_API_KEY. If the user
 * has an API key but no OAuth credentials, we want to prompt them to set up
 * OAuth (which uses their Max subscription) rather than silently burning API credits.
 */
export declare function dockerCredentialsExist(): boolean;
/**
 * Get Docker credential info for display.
 * Returns expiration date and subscription type if available.
 */
export declare function getDockerCredentialInfo(): {
    expiresAt: Date;
    subscriptionType?: string;
} | null;
/**
 * Check if Claude Code authentication is available on the host system.
 * Returns true if either:
 * 1. OAuth credentials exist in ~/.claude/.credentials.json, OR
 * 2. ANTHROPIC_API_KEY environment variable is set
 *
 * This is used to validate auth before spawning host sessions (e.g., orchestrator)
 * to avoid creating stuck sessions when the keychain is locked (SSH contexts).
 */
export declare function hostCredentialsExist(): boolean;
export declare function getExecutorCommand(executor: ExecutorType, prompt: string, skipPermissions?: boolean): {
    cmd: string;
    args: string[];
};
/**
 * Check if an executor is Claude Code.
 * Used to gate Claude-specific flags and configuration.
 */
export declare function isClaudeExecutor(executor: ExecutorType): boolean;
/**
 * Get the display name for an executor type.
 */
export declare function getExecutorDisplayName(executor: ExecutorType): string;
/**
 * Get the npm package name for an executor (for container installation).
 */
export declare function getExecutorPackage(executor: ExecutorType): string | null;
export interface PreflightResult {
    ok: boolean;
    error?: string;
}
/**
 * Check executor binary availability on host.
 */
export declare function checkExecutorOnHost(executor: ExecutorType): PreflightResult;
/**
 * Check executor binary availability inside a container.
 */
export declare function checkExecutorInContainer(executor: ExecutorType, containerId: string): PreflightResult;
/**
 * Run executor preflight checks for the target environment.
 */
export declare function runExecutorPreflight(environment: ExecutionEnvironment, executor: ExecutorType, options?: {
    containerId?: string;
}): PreflightResult;
export interface RunnerResult {
    success: boolean;
    pid?: string;
    containerId?: string;
    sessionId?: string;
    logPath?: string;
    error?: string;
}
export type Runner = (context: ExecutionContext, executor: ExecutorType, config: ExecutionConfig) => Promise<RunnerResult>;
/**
 * Run command on the host machine with tmux session for persistence.
 * Supports multiple terminal emulators on macOS.
 *
 * Architecture (same as devcontainer):
 * - Always creates a host tmux session for session persistence
 * - displayMode controls whether to open a terminal tab attached to the session
 * - User can reattach with `prlt session attach` if tab is closed
 */
export declare function runHost(context: ExecutionContext, executor: ExecutorType, config: ExecutionConfig, displayMode?: DisplayMode): Promise<RunnerResult>;
/**
 * Check if GitHub token is available for git push operations.
 * Checks environment variables first, then tries gh auth token.
 * Returns the token if available, null otherwise.
 */
export declare function getGitHubToken(): string | null;
/**
 * Check if GitHub token is available.
 * Returns true if token is available via env vars or gh CLI.
 */
export declare function isGitHubTokenAvailable(): boolean;
/**
 * Check if Docker daemon is running.
 * Returns true if Docker is available and responsive.
 * Uses retry logic to handle slow Docker Desktop startup.
 */
export declare function isDockerRunning(): boolean;
/**
 * Check if the devcontainer CLI is installed.
 * Returns true if the CLI is available, false otherwise.
 * @deprecated No longer required - we use raw Docker commands now
 */
export declare function isDevcontainerCliInstalled(): boolean;
/**
 * Get the container name for an agent.
 * Format: prlt-agent-{agentName}
 */
export declare function getAgentContainerName(agentName: string): string;
/**
 * Check if a Docker container exists (running or stopped).
 */
export declare function containerExists(containerName: string): boolean;
/**
 * Check if a Docker container is running.
 */
export declare function isContainerRunning(containerName: string): boolean;
/**
 * Get the container ID for a running container.
 */
export declare function getContainerId(containerName: string): string | null;
/**
 * Build the command to run Claude inside the container.
 * Uses docker exec for direct container access.
 * Uses a prompt file to avoid shell escaping issues.
 */
export declare function buildDevcontainerCommand(context: ExecutionContext, executor: ExecutorType, promptFile: string, containerId?: string, outputMode?: OutputMode, permissionMode?: PermissionMode, displayMode?: DisplayMode): string;
/**
 * Run command inside a Docker container.
 * Uses raw Docker commands for filesystem isolation - no devcontainer CLI required.
 * Agent can only access mounted worktrees and configured paths.
 *
 * @param displayMode - How to display output (terminal, foreground, background, tmux)
 * @param sessionManager - How to manage the session inside the container (tmux, direct)
 */
export declare function runDevcontainer(context: ExecutionContext, executor: ExecutorType, config: ExecutionConfig, displayMode?: DisplayMode, sessionManager?: SessionManager): Promise<RunnerResult>;
export declare function runDocker(context: ExecutionContext, executor: ExecutorType, config: ExecutionConfig): Promise<RunnerResult>;
export declare function runVm(context: ExecutionContext, executor: ExecutorType, config: ExecutionConfig, host?: string): Promise<RunnerResult>;
export declare function runExecution(environment: ExecutionEnvironment, context: ExecutionContext, executor: ExecutorType, config?: ExecutionConfig, options?: {
    host?: string;
    displayMode?: DisplayMode;
    sessionManager?: SessionManager;
}): Promise<RunnerResult>;
