import { EventEmitter } from "node:events";
import type { ACodeRuntimeConfig } from "./types.js";
export declare class ACodeRuntime extends EventEmitter {
    private readonly config;
    private readonly hookBus;
    private initialConversation;
    private state;
    private abortController;
    private submitQueue;
    private activeTurn;
    private abortRequested;
    private sessionCompleteEmitted;
    private contextVersion;
    private readonly stopWaiters;
    constructor(config: ACodeRuntimeConfig);
    private emitAcodeEvent;
    /**
     * 启动 ACode headless 会话。
     * 主流程：加载 `.acode/config.json` 与 skills 目录 -> 发出 MCP/Skill 状态 ->
     * 如有初始 prompt 则执行一轮响应。
     */
    start(): Promise<void>;
    /**
     * 处理一轮用户输入。
     * 主流程：将用户输入追加到会话 -> 调用 OpenAI-compatible 模型 -> 如模型请求
     * MCP tool call 则执行工具并继续同一轮，最后输出 assistant 文本与 usage。
     */
    submit(message: string): Promise<void>;
    /**
     * Reset only the conversation context while keeping the live ACode session,
     * MCP connections, exposed tools, commands, and hooks available.
     */
    resetContext(): Promise<void>;
    private isTurnSuperseded;
    private executeSubmit;
    /** 中止当前轮次；由执行轮次统一发出一个终态事件，避免 aborted/failed 双终态。 */
    abort(): Promise<void>;
    /** 终止 ACode 会话并发出 session_complete。 */
    stop(): Promise<void>;
    private resolveCommandDirs;
    private runModelTurn;
    private requestChatCompletion;
    private readChatCompletionStream;
    private handleToolCalls;
    private callMcpToolWithTimeout;
    /**
     * Build a one-shot waiter that rejects long-running MCP calls when the runtime stops.
     * Main flow: register a stop callback -> race it with the SDK call -> remove it after either side settles.
     */
    private createRuntimeStopWaiter;
    /**
     * Notify and clear every pending runtime-stop waiter.
     * Main flow: snapshot callbacks -> clear the set -> reject each pending MCP race exactly once.
     */
    private notifyRuntimeStop;
    private appendSyntheticMultimodalUserMessage;
    private appendToolFailureResult;
    private connectMcpServers;
    private createMcpTransport;
    private disconnectMcpServers;
}
//# sourceMappingURL=runtime.d.ts.map