import type { McpServer } from '@agentclientprotocol/sdk'; import type { AgentProfile } from './agents.js'; import type { RuntimeHost } from './host.js'; import { type AcpTransport } from './runtime.js'; import type { RuntimeSessionEvent } from './session.js'; export interface RunOneShotPromptOptions { agent: AgentProfile; cwd: string; prompt: string; /** * Optional host implementation. Defaults to a host that auto-allows tool permissions and uses the * first available auth method. Provide your own for production use. */ host?: RuntimeHost; mcpServers?: McpServer[]; /** Pluggable transport. Defaults to the node child-process transport. */ transport?: AcpTransport; } /** * One-shot helper: spawn the agent, run a single prompt, yield each * `RuntimeSessionEvent` (`message.delta`, `tool.start`, `turn.completed`, ...), * and dispose every resource on completion. * * The agent process is killed when iteration completes (normally or via early * `break` / `return`) or when the underlying turn fails or is cancelled. * * For multi-turn, multi-session, or long-lived hosts use `createAcpRuntime` directly. * * ```ts * import { runOneShotPrompt, onRuntimeEvent, ClaudeCode } from '@acp-kit/core'; * * for await (const event of runOneShotPrompt({ agent: ClaudeCode, cwd, prompt: 'Hi' })) { * onRuntimeEvent(event, { * messageDelta: (e) => process.stdout.write(e.delta), * }); * } * ``` */ export declare function runOneShotPrompt(options: RunOneShotPromptOptions): AsyncIterableIterator;