import type { MessageOptions, ModelInfo, ResumeSessionConfig, SessionConfig } from "@github/copilot-sdk"; import type { ThreadEvent, ThreadOptions, TurnOptions } from "@openai/codex-sdk"; import type { AgentProfile } from "../config.js"; export interface WorkerInput { permissionMode?: "read-only" | "workspace-write"; inspectionBase?: string; provider: "codex" | "copilot"; operation: string; id: string; cwd: string; prompt: string; profile: AgentProfile; outputSchema?: Record; resumeSessionId?: string; processFile?: string; timeoutMs?: number; } export type Emit = (type: string, value: unknown) => void; interface CodexThread { runStreamed(prompt: string, options?: TurnOptions): Promise<{ events: AsyncIterable; }>; } export interface CodexClient { startThread(options: ThreadOptions): CodexThread; resumeThread(id: string, options: ThreadOptions): CodexThread; } export declare function runCodex(client: CodexClient, input: WorkerInput, emit: Emit): Promise; export interface CopilotSessionClient { sessionId: string; on(handler: (event: unknown) => void): unknown; sendAndWait(message: MessageOptions, timeout: number): Promise<{ data: { content: string; }; } | undefined>; disconnect(): Promise; } export interface CopilotClientContract { start(): Promise; listModels(): Promise; createSession(options: SessionConfig): Promise; resumeSession(id: string, options: ResumeSessionConfig): Promise; stop(): Promise; forceStop(): Promise; } export declare function runCopilot(client: CopilotClientContract, input: WorkerInput, emit: Emit): Promise; export {};