/** * Types for the task management module. */ import type { ChildProcess } from 'child_process'; import type { RingBuffer } from '../utils/ring-buffer.js'; /** * Task states. Terminal states: completed, failed, cancelled, timed_out. * Pre-spawn failures/timeouts may transition directly from 'created' to terminal. */ export type TaskState = 'created' | 'running' | 'completed' | 'failed' | 'cancelled' | 'timed_out'; /** * Terminal states — no further transitions allowed. */ export declare const TERMINAL_STATES: ReadonlySet; /** * A task record in the store. */ export interface TaskRecord { id: string; state: TaskState; prompt: string; role?: string; specialization?: string; model: string; cwd: string; startTime: string; endTime?: string; outputFilePath?: string; /** Ring buffer for output lines (bounded, no garbage) */ output: RingBuffer; /** Total number of output lines received (including evicted) */ outputLines: number; error?: string; metadata?: Record; pid?: number; /** Process reference (not serialized) */ process?: ChildProcess; /** Timeout timer handle (cleared on terminal transition) */ timeoutTimer?: ReturnType; } /** * Options for creating a new task. */ export interface CreateTaskOptions { prompt: string; role?: string; specialization?: string; model: string; cwd: string; } /** * Lightweight task summary for external APIs. * Mirrors the shape expected by existing MCP resource endpoints. */ export interface TaskSummary { id: string; status: string; prompt: string; role?: string; specialization?: string; model: string; cwd: string; startTime: string; endTime?: string; outputFilePath?: string; outputLines: number; output: string[]; error?: string; metadata?: Record; pid?: number; } //# sourceMappingURL=types.d.ts.map