/**
 * Execution Types
 *
 * Types for agent execution and runtime management.
 */
/**
 * ExecutionEnvironment - Where the agent code runs.
 */
export type ExecutionEnvironment = 'devcontainer' | 'host' | 'docker' | 'vm';
/**
 * SessionManager - How agent sessions are managed inside the execution environment.
 * - tmux: Run inside tmux session (can attach/detach, persistent)
 * - direct: Run process directly (simple, no session management)
 *
 * Currently always 'tmux' for consistent session persistence across all environments.
 */
export type SessionManager = 'tmux' | 'direct';
/**
 * DisplayMode - How output is presented to the user.
 * - terminal: Opens a new terminal tab attached to the tmux session
 * - background: Runs detached, reattach later with `prlt session attach`
 * - foreground: Attaches tmux in current terminal (blocking)
 */
export type DisplayMode = 'terminal' | 'background' | 'foreground';
/**
 * OutputMode - How Claude Code displays its output.
 * - interactive: Shows streaming UI with real-time tool calls, file reads, etc.
 * - print: Outputs final result only (uses -p flag), better for logs/automation
 */
export type OutputMode = 'interactive' | 'print';
/**
 * PermissionMode - How Claude Code handles permission checks.
 * - danger: Skip permission checks (faster, relies on container/environment isolation)
 * - safe: Requires approval for dangerous operations
 */
export type PermissionMode = 'danger' | 'safe';
export type ExecutorType = 'claude-code' | 'codex' | 'aider' | 'custom';
export type TerminalApp = 'Terminal' | 'iTerm' | 'Alacritty' | 'Ghostty' | 'Kitty' | 'tmux' | 'Warp' | 'WezTerm';
export type Shell = 'bash' | 'zsh' | 'fish';
export type ExecutionStatus = 'starting' | 'running' | 'completed' | 'failed' | 'stopped';
export interface AgentWork {
    id: string;
    ticketId: string;
    agentName: string;
    executor: ExecutorType;
    environment: ExecutionEnvironment;
    displayMode: DisplayMode;
    sessionManager?: SessionManager;
    permissionMode: PermissionMode;
    status: ExecutionStatus;
    branch?: string;
    pid?: string;
    containerId?: string;
    sessionId?: string;
    host?: string;
    logPath?: string;
    externalSource?: string;
    externalKey?: string;
    externalId?: string;
    externalUrl?: string;
    startedAt: Date;
    completedAt?: Date;
    exitCode?: number;
    errorMessage?: string;
}
export interface ExecutionContext {
    ticketId: string;
    ticketTitle: string;
    ticketDescription?: string;
    ticketSubtasks?: Array<{
        title: string;
        done: boolean;
    }>;
    ticketPriority?: string;
    ticketCategory?: string;
    epicTitle?: string;
    specId?: string;
    specTitle?: string;
    specProblem?: string;
    specSolution?: string;
    agentName: string;
    agentDir: string;
    worktreePath: string;
    branch: string;
    hqPath?: string;
    pmoPath?: string;
    repoWorktrees?: string[];
    createPR?: boolean;
    actionId?: string;
    actionName?: string;
    actionPrompt?: string;
    actionEndPrompt?: string;
    modifiesCode?: boolean;
    customMessage?: string;
    useApiKey?: boolean;
    prFeedback?: string;
    isRevision?: boolean;
    isOrchestrator?: boolean;
    hqName?: string;
}
/**
 * Map ticket category to branch type.
 * Used when creating branches for agent work.
 */
export declare const CATEGORY_TO_BRANCH_TYPE: Record<string, string>;
/**
 * Get branch type from ticket category.
 * Defaults to 'feat' if no mapping found.
 */
export declare function getBranchType(category?: string): string;
/**
 * Generate branch name for agent work.
 * Format: {ticketId}/{type}/{owner}/{agent}/{slug}
 *
 * Example: TKT-054/feat/chris/altman/update-branch-naming
 *
 * - ticketId first for easy filtering: git branch | grep TKT-054
 * - owner: the human who owns the HQ/spawned the agent
 * - agent: the AI agent doing the work
 */
export declare function generateBranchName(ticketId: string, ticketTitle: string, ownerName: string, agentName: string, category?: string): string;
export type AuthMethod = 'oauth' | 'apikey';
export interface ExecutionConfig {
    defaultEnvironment: ExecutionEnvironment;
    defaultExecutor: ExecutorType;
    autoExecute: boolean;
    shell: Shell;
    outputMode: OutputMode;
    permissionMode: PermissionMode;
    authMethod?: AuthMethod;
    createPrDefault?: boolean;
    tmux: {
        session: string;
        layout: 'split' | 'window';
        controlMode: boolean;
        windowMode: 'tab' | 'window';
    };
    terminal: {
        app: TerminalApp;
        openInBackground: boolean;
    };
    devcontainer: {
        defaultImage: string;
        memory: string;
        cpus: number;
        autoStart: boolean;
    };
    docker: {
        image: string;
        network: string;
        memory?: string;
        cpus?: number;
    };
    firewall: {
        allowlistDomains: string[];
    };
    vm: {
        defaultHost?: string;
        user: string;
        keyPath?: string;
        syncMethod: 'rsync' | 'git';
    };
}
/**
 * Extract ticket ID from a tmux session name.
 * Session names like: prlt-TKT-347-implement or TKT-347-implement
 * Returns the ticket ID (e.g., "TKT-347") or undefined if not found.
 */
export declare function extractTicketFromSession(sessionName: string | null | undefined): string | undefined;
export declare const DEFAULT_EXECUTION_CONFIG: ExecutionConfig;
