import { AcpClient, type AcpTransportClosedEvent, type McpServer } from "../../../poe-acp-client/dist/index.js"; import { type AgentSession, type CreateAgentSessionOptions } from "../agent-session.js"; import type { SpawnMode } from "../../../agent-spawn/dist/index.js"; import { type AcpModel } from "./acp-core.js"; import { type RunContext } from "./run-context.js"; import type { AcpEvent, AcpHost, ForkRequest, ForkResult, RunOutput, ToolAckResult, ToolIntent } from "./types.js"; type InMemorySession = Pick; type InMemoryCreateSession = (options: CreateAgentSessionOptions) => Promise; type InMemoryNotificationHandler = (params: unknown, context: { method: string; }) => void | Promise; type InMemoryRequestHandler = (params: unknown, context: { id: string | number | null; method: string; }) => unknown | Promise; type InMemoryAcpTransport = { closed: Promise; sendRequest(method: string, params?: unknown): Promise; sendNotification(method: string, params?: unknown): void; onRequest(method: string, handler: InMemoryRequestHandler): void; onNotification(method: string, handler: InMemoryNotificationHandler): void; dispose(reason?: Error): void; }; export type AgentHostSpawnClient = Pick; export type AgentHostSpawnSession = { client: AgentHostSpawnClient; cwd: string; mcpServers?: McpServer[]; }; export type AgentHostOptions = { runContext: RunContext; model: AcpModel; baseSystemPrompt?: string; maxIterations?: number; emit?(event: AcpEvent): void; createSpawnSession(): AgentHostSpawnSession | Promise; }; export type CreateProcessSpawnSessionOptions = { command: string; args?: readonly string[]; cwd?: string; env?: NodeJS.ProcessEnv; }; export type CreateInMemorySpawnSessionOptions = { model: string; cwd: string; mode?: SpawnMode; baseUrl?: string; mcpServers?: CreateAgentSessionOptions["mcpServers"]; createSession?: InMemoryCreateSession; }; export declare class AgentHost implements AcpHost { #private; constructor(options: AgentHostOptions); setEmit(emit: (event: AcpEvent) => void): void; handle(intent: ToolIntent): Promise; fork(request: ForkRequest): Promise; spawn(prompt: string): Promise; } export declare function createProcessSpawnSession(options: CreateProcessSpawnSessionOptions): AgentHostSpawnSession; export declare function createInMemorySpawnSession(options: CreateInMemorySpawnSessionOptions): AgentHostSpawnSession; export declare function createInMemoryAcpTransport(options: CreateInMemorySpawnSessionOptions): InMemoryAcpTransport; export {};