import type { AgentBackend, BackendId, BackendRunContext, BackendRunResult, BackendTask } from './types.js'; /** Accumulator threaded through per-line parsing. */ export interface CliParsed { sessionId?: string; content?: string; isError?: boolean; } export interface CliBackendSpec { id: BackendId; displayName: string; /** Binary name looked up on PATH (overridable via `binEnv`). */ bin: string; /** argv for a fresh run. `prompt` already includes any role preamble. */ runArgs(prompt: string, task: BackendTask): string[]; /** argv to continue an existing session with a new message. */ resumeArgs?(sessionId: string, message: string, task: BackendTask): string[]; /** Parse one output line (or the whole raw output, as a fallback) into `acc`. */ parseLine(line: string, acc: CliParsed): void; /** Extra process env. */ env?: NodeJS.ProcessEnv; /** Env var overriding the binary path (e.g. INFINICODE_CLAUDE_BIN). */ binEnv?: string; /** Env var of extra whitespace-split args appended to every invocation. */ extraArgsEnv?: string; } export declare class CliAgentBackend implements AgentBackend { private spec; readonly id: BackendId; readonly displayName: string; constructor(spec: CliBackendSpec); private resolveBin; /** A directly-spawnable target — on Windows unwraps the npm shim to the real * executable so `spawn` (array args, no shell) works and multi-line prompts * survive intact. */ private resolveSpawn; available(): boolean; private extraArgs; run(task: BackendTask, ctx: BackendRunContext): Promise; send(sessionId: string, message: string, ctx: BackendRunContext): Promise; private exec; }