/** * ClineAgentRunner — AgentRunner backed by the Cline CLI (`cline`, npm * `cline`, cline/cline apps/cli; verified against 3.0.65). Same shape as the * other CLI runners: spawn the CLI per turn, parse its stream, normalize to * AgentMessage; org tools ride the fence protocol (tool-fence.ts). * * Two protocols, one per kind of turn: * - A fresh session: `cline --json` (cline-runner-stream.ts) — NDJSON with * tool start/end on toolCallId, per-step usage and cost, `run_result` as * the terminal frame, `--thinking` for effort, and `iteration_start` * counted for max turns. The session id is not in the stream; it is * read back from `cline history --json`. * - Every later turn of that session (a tool round, the next mailbox * message, AgentRunArgs.resume): ACP `session/load` + `session/prompt` * (cline-runner-acp.ts), because `--id` cannot be combined with `--json`. * ACP drops usage, iterations and thinking: usage/cost come from the * history row's cumulative totals, max turns is approximated by model * steps, and effort does not apply to resumed turns. * * Access: never `-y/--yolo` (it narrows the toolset). Full access, or * `--settings`, runs on the user's own ~/.cline — auth, rules, hooks, MCP — * untouched, with auto-approve on. Scoped isolates state with * `--config`/`--data-dir` and an empty CLINE_MCP_SETTINGS_PATH * (cline-runner-host.ts), and refuses every tool call that needs approval — * commands, edits, subagents, MCP tools — instead of approving it; a refused * call ends `denied` and the turn goes on (cline-runner-scoped.ts). * * Hub daemon: cline starts a detached `cline --cline-hub-daemon` that * outlives the run. Every process the runner spawns carries a per-turn * marker env; the daemon a turn started is found by it (and by the hub lock * file) and killed when the turn's process closes and on abort (Stop). * * Nested-agent marker: MONOMIND_CLINE_TURN (CLINE_TURN_ENV) is set on cline * and everything it runs. */ import type { AgentMessage, AgentRunArgs, AgentRunner } from './agent-runner.js'; import type { ClineHost, ClineTurnOutcome } from './cline-runner-types.js'; export declare const CLINE_INSTALL_HINT = "npm install -g cline && cline auth"; /** * cline stops a run after consecutive failed tool calls (its mistake limit, * `--retries`, default 3; verified live: `run_result.finishReason * "aborted"`). When the last call was a limited-mode refusal, the turn ended * on refusals — a normal end, not an error. */ export declare function endedOnRefusals(o: ClineTurnOutcome, lastCallRefused: boolean): boolean; /** The error of a finished turn, or undefined when it completed. */ export declare function clineTurnFailure(o: ClineTurnOutcome, resumed: boolean): Error | undefined; export declare class ClineAgentRunner implements AgentRunner { private clineBin?; private host; constructor(clineBin?: string | undefined, host?: ClineHost); run(args: AgentRunArgs): AsyncIterable; } //# sourceMappingURL=cline-runner.d.ts.map