/** * AiderAgentRunner — AgentRunner backed by Aider (`aider-chat`, * https://github.com/Aider-AI/aider), monoes/monomind#383. * * WHY A SHIM: the aider CLI prints plain text only, exits 0 on an auth * failure, and — decisively — never runs a model-suggested shell command * unattended (`--yes-always` answers "n" to every explicit_yes_required * confirmation, io.py). So this runner drives aider through its Python * scripting API instead: aider/monomind_aider_shim.py, run with aider's * OWN interpreter (aider-runner-resolve.ts), answers confirmations by * access mode (full: yes to everything, incl. shell commands; scoped: no to * shell commands) and emits a monomind-owned NDJSON stream — session, text * (streamed), matched tool_start/tool_end (edit/write/patch/shell with * exit_code, commit), usage (tokens + USD), error (auth/quota, non-zero * exit) and result (end_turn / max_turns). * * Sessions: the shim mints the id and keeps the conversation under the * state dir (defaultStateDir, never in the user's repo); `resume` loads it * back. Effort maps onto the model's reasoning_effort / thinking_tokens; * maxTurns caps aider's reflection loop. MCP is not supported (aider 0.86 * has none) — the shim says so in a status event. * * FALLBACK: when aider's Python cannot be located (or cannot import aider) * the runner runs the plain CLI (`--message-file … --yes-always --no-pretty * --no-stream`) and scrapes its text: tool activity is start-only, and a * status notice says model-suggested shell commands will not run. * * Org tools — FENCE PROTOCOL, like the other subprocess runners: tool_call * fences in the reply run between invocations, and the next invocation * resumes the same session with the results. */ import type { AgentMessage, AgentRunArgs, AgentRunner } from './agent-runner.js'; import { type AiderOutcome } from './aider-runner-stream.js'; export interface AiderRunnerOptions { /** `aider` binary (default: AIDER_CLI_BIN, else `aider` on PATH). */ aiderBin?: string; /** aider's interpreter; `null` forces the plain-CLI fallback. Default: * resolved from the entry point (aider-runner-resolve.ts). */ python?: string | null; shimPath?: string; stateDir?: string; } export declare const AIDER_FALLBACK_NOTICE: string; export declare class AiderAgentRunner implements AgentRunner { private opts; constructor(opts?: AiderRunnerOptions); run(args: AgentRunArgs): AsyncIterable; /** Shim events → AgentMessages (text is handled by run()). */ private toMessages; private endMessage; /** The plain-CLI fallback invocation. The message and aider's history * files live in the state dir; `--restore-chat-history` resumes. */ private cliInvocation; } /** The error a failed invocation throws. Auth/quota/rate-limit carry the * markers agent-exec's classifyStderr maps to `auth` / `quota` / * `rate-limited` (fatal); aider already retried a rate limit itself. */ export declare function aiderError(outcome: AiderOutcome, sawEvent: boolean): Error; //# sourceMappingURL=aider-runner.d.ts.map