/** * One fresh `cline --json` turn (no session yet): stream its NDJSON as * normalized events, enforce max turns, and recover the session id. * * Invocation: `cline --json --act --auto-approve true -c * [--config --data-dir ] [-P ] [-m ] * [--thinking ] "Complete the task below."` with the prompt on a * FIFO stdin (cline-runner-proc.ts). Never `-y/--yolo`: it narrows the * toolset. `--act` and `--auto-approve true` pin act mode and approvals * even when the user's persisted cline settings say plan / ask — a * headless turn has nobody to answer an approval. A scoped turn passes * `--auto-approve false` instead and refuses what needs approval * (cline-runner-scoped.ts). * Provider: `CLINE_PROVIDER` from the turn env (the variable cline's ACP * mode reads natively) becomes `-P`; unset leaves cline's last-used one. * Max turns: cline has no iteration flag (only loop detection and * `--retries`), so the runner counts top-level `iteration_start` events * and, past `maxTurns`, kills the turn: SIGTERM, then SIGKILL after * MAX_TURNS_KILL_GRACE_MS. Verified live (3.0.65, OpenRouter): neither * SIGTERM nor SIGINT stops a --json run — cline finishes every remaining * iteration and only then exits — so the SIGKILL is what enforces the cap. * Usage then comes from the last `usage` event's running totals. * Session id: not in the stream; read from `cline history --json` after the * process exits (matching cwd + prompt, then pid). */ import type { AgentRunArgs } from './agent-runner.js'; import { type ClineSetup } from './cline-runner-host.js'; import type { ClineEvent, ClineHost, ClineTurnOutcome } from './cline-runner-types.js'; import type { OrgEffortLevel } from './cost-tier.js'; /** `cline --thinking`: none|low|medium|high|xhigh (max clamps to xhigh). */ /** How long cline gets to exit on SIGTERM once past max turns. */ export declare const MAX_TURNS_KILL_GRACE_MS = 1500; export declare const CLINE_THINKING: Record; export declare function jsonTurnArgs(setup: ClineSetup, args: AgentRunArgs): string[]; export declare function streamJsonTurn(setup: ClineSetup, prompt: string, args: AgentRunArgs, host: ClineHost, outcome: ClineTurnOutcome): AsyncGenerator; //# sourceMappingURL=cline-runner-stream.d.ts.map