import { AgentBase, type SpawnPlan } from '../../../core/agent-base.js'; import type { AgentSendOpts } from '../../../core/types.js'; export declare class OpenCodeAdapter extends AgentBase { readonly name = "opencode"; readonly aliases: string[]; readonly kind: "cli"; protected buildArgs(prompt: string, opts: AgentSendOpts): string[]; /** * opencode keys its per-project AGENTS.md and memory off the spawn cwd, * so for IM calls we pin to ~/.agim-workspaces/opencode/. Non-IM calls * (web/scheduler) keep cwd undefined and inherit agim's cwd, preserving * the prior behavior. See agent-cwd.ts for full rationale. * * MCP context (for the agim reminder tools): when we have a real IM * thread + the bus is running, register a unique runId and inject * AGIM_APPROVAL_SOCK + AGIM_RUN_ID into the spawn env. opencode forwards * its env to MCP server children (per opencode/src/mcp/index.ts:384), so * the sidecar inherits these and can route reminder.* RPCs back to the * right RunContext. No env injection → sidecar still launches but * connects to nothing → reminder tools deny gracefully ("bus unavailable"). */ protected prepareCommand(prompt: string, opts: AgentSendOpts): Promise; protected extractText(event: unknown): string; /** * Pull metadata out of every event: * - `sessionID` on any event → bubble up via opts.onAgentSessionId so cli * can persist it. Idempotent (the callback handles dedup). * - `cost` / `tokens` on `step_finish` → bubble up via opts.onUsage so * callAgentWithHistory can roll into /stats. */ protected inspectEvent(event: unknown, opts: AgentSendOpts): void; } //# sourceMappingURL=opencode-stdio-adapter.d.ts.map