/** * Task Executor * * Executes batch tasks sequentially or in parallel (via git worktrees) with git automation. */ import type { Agent } from './agents.js'; import { type BatchTask } from './batch-fetcher.js'; /** * Result of executing a single task */ export interface TaskResult { /** Task that was executed */ task: BatchTask; /** Whether the task completed successfully */ success: boolean; /** Error message if failed */ error?: string; /** Branch name used */ branch?: string; /** PR URL if created */ prUrl?: string; /** Number of iterations used */ iterations?: number; /** Cost in USD */ cost?: number; } /** * Options for batch execution */ export interface TaskExecutionOptions { /** Tasks to execute */ tasks: BatchTask[]; /** Working directory */ cwd: string; /** Agent to use */ agent: Agent; /** Run in auto mode */ auto?: boolean; /** Commit after each task */ commit?: boolean; /** Push to remote */ push?: boolean; /** Create PR */ pr?: boolean; /** Run validation */ validate?: boolean; /** Max iterations per task */ maxIterations?: number; /** Run tasks in parallel using git worktrees */ parallel?: boolean; /** Max concurrent parallel tasks (default: 3) */ concurrency?: number; /** Callback when task starts */ onTaskStart?: (task: BatchTask, index: number) => void; /** Callback when task completes */ onTaskComplete?: (task: BatchTask, result: TaskResult, index: number) => Promise | void; /** Callback when task fails */ onTaskFail?: (task: BatchTask, error: Error, index: number) => void; } /** * Execute tasks sequentially with cascading branches, or in parallel via worktrees. * * Sequential mode: each task creates a branch from the previous task's branch, * and PRs cascade: PR3 -> PR2 -> PR1 -> main. * * Parallel mode (--parallel): each task runs in an isolated git worktree, * all PRs target the default branch independently. */ export declare function executeTaskBatch(options: TaskExecutionOptions): Promise; /** * Execute tasks in parallel using git worktrees. * * Each task runs in an isolated worktree with its own branch, * enabling true parallel execution. All PRs target the default branch. */ export declare function executeTaskBatchParallel(options: TaskExecutionOptions): Promise; /** * Build commit message for the task */ export declare function buildCommitMessage(task: BatchTask): string; /** * Build PR body */ export declare function buildPrBody(task: BatchTask, result: TaskResult, prBase: string): string; //# sourceMappingURL=task-executor.d.ts.map