import type { VisionHarness } from './browse-types'; export type { VisionHarness }; export interface VisionHarnessPrompt { system: string; userText: string; imageBase64?: string; imageMime?: string; maxTokens: number; } export type HarnessTurnOutcome = { kind: 'ok'; text: string; } | { kind: 'error'; /** `fatal` = config will never succeed (missing binary, no image * input) — the caller must STOP the run, not retry. `timeout` reuses * the loop's short backoff; `http_error`/`empty` the 2s retry. */ error: 'timeout' | 'fatal' | 'http_error' | 'empty'; detail: string; }; /** * Build the text prompt for a harness vision turn. The screenshot rides as a * FILE the CLI reads (never base64 inline — argv has length limits and most * CLIs only vision local paths), and the JSON discipline is repeated at the * end because CLI system prompts dilute instructions from our text. */ export declare function buildHarnessVisionPrompt(prompt: VisionHarnessPrompt, imagePath: string | null): string; /** * Pull the model's answer text out of harness stdout. CLIs wrap the answer * (opencode `--format json` envelopes, claude stream-json NDJSON events), so * instead of envelope knowledge we scan for the JSON array the prompt * demands — the same balanced-bracket extraction the direct path uses. * Returns null when stdout holds no action array at all. */ export declare function extractHarnessText(stdout: string): string | null; /** * Run ONE vision turn through a harness CLI and return its answer text. * Fresh process per turn (vision turns are stateless: screenshot + element * list travel in the prompt, so no session continuity is lost). */ export declare function runVisionHarnessTurn(backend: VisionHarness, prompt: VisionHarnessPrompt, opts: { timeoutMs: number; signal?: AbortSignal; }): Promise;