/** * OpenCode Spawner - Spawns and manages tasks using the OpenCode headless server HTTP API. * * OpenCode Spawner - Spawns and manages tasks using the OpenCode headless server HTTP API. * * Uses the OpenCode HTTP API to: * - Create sessions * - Send messages/prompts * - Poll for completion * - Get results */ import { type SpawnOptions, type TaskState } from '../types.js'; import { type OpenCodeClient } from './opencode-client.js'; /** * Initialize the spawner with the OpenCode client instance. */ export declare function initSpawner(client: OpenCodeClient): void; /** * Spawn a new task using the OpenCode headless server. */ export declare function spawnOpenCodeTask(options: SpawnOptions): Promise; /** * Execute a waiting task (called when dependencies are satisfied). */ export declare function executeWaitingTask(task: TaskState): Promise; /** * Cancel a running task. Aborts polling and tells OpenCode to stop the session. */ export declare function cancelOpenCodeTask(taskId: string): Promise; export { cancelOpenCodeTask as cancelTask }; /** * Send a follow-up message to an existing session. */ export declare function sendMessageToSession(taskId: string, message: string): Promise<{ success: boolean; error?: string; response?: string; }>; /** * Check if the OpenCode server is healthy. */ export declare function checkOpenCodeAvailable(): Promise; /** * Get a diagnostic summary for error messages. */ export declare function diagnoseConnection(): Promise; /** * Shutdown the spawner - cancel all active pollers. */ export declare function shutdownSpawner(): void; /** * Get spawner statistics. */ export declare function getSpawnerStats(): { activeTasks: number; activePollers: number; queuedTasks: number; maxConcurrent: number; clientInitialized: boolean; baseUrl: string; }; //# sourceMappingURL=opencode-spawner.d.ts.map