/**
 * Background Executor
 * Handles async workflow execution with status tracking
 */
import { AgentExecutor } from './agent-executor.js';
export interface WorkflowStep {
    id: string;
    agent: string;
    task: string;
    status: 'pending' | 'running' | 'completed' | 'failed' | 'skipped';
    output?: string;
    error?: string;
    startTime?: string;
    endTime?: string;
    model?: string;
}
export interface WorkflowInstance {
    id: string;
    name: string;
    description: string;
    status: 'pending' | 'running' | 'completed' | 'failed';
    steps: WorkflowStep[];
    context: Record<string, any>;
    startTime: string;
    endTime?: string;
    currentStepIndex: number;
}
export interface WorkflowStatus {
    id: string;
    name: string;
    status: string;
    progress: {
        current: number;
        total: number;
        percent: number;
    };
    steps: Array<{
        id: string;
        agent: string;
        status: string;
        duration?: number;
    }>;
    startedAt: string;
    elapsed?: number;
}
export interface BackgroundExecutionConfig {
    agent: string;
    task: string;
    model?: string;
    dependsOn?: string[];
}
export declare class BackgroundExecutor {
    private worktree;
    private workflowsDir;
    private executor;
    constructor(worktree: string, executor: AgentExecutor);
    /**
     * Generate unique workflow ID
     */
    private generateId;
    /**
     * Save workflow state
     */
    private saveWorkflow;
    /**
     * Load workflow state
     */
    private loadWorkflow;
    /**
     * Start single agent execution in background
     */
    start(config: BackgroundExecutionConfig): Promise<string>;
    /**
     * Execute asynchronously
     */
    private executeAsync;
    /**
     * Start multi-step workflow
     */
    startWorkflow(workflowName: string, steps: Array<{
        agent: string;
        task: string;
        model?: string;
    }>, context?: Record<string, any>): Promise<string>;
    /**
     * Execute workflow asynchronously
     */
    private executeWorkflowAsync;
    /**
     * Get workflow status
     */
    getStatus(id: string): WorkflowStatus | null;
    /**
     * List all workflows
     */
    listWorkflows(): Array<{
        id: string;
        name: string;
        status: string;
        startedAt: string;
    }>;
    /**
     * Cancel running workflow
     */
    cancel(id: string): boolean;
    /**
     * Get workflow output
     */
    getOutput(id: string): {
        success: boolean;
        output?: string;
        error?: string;
    } | null;
}
//# sourceMappingURL=background-executor.d.ts.map