/**
 * DiracAgent - Decoupled ACP Agent implementation for Dirac CLI.
 *
 * This class implements the ACP (Agent Client Protocol) Agent interface,
 * allowing Dirac to be used programmatically without stdio dependency.
 * It uses a callback pattern for permission requests and EventEmitters
 * for session updates, enabling embedding in other Node.js applications.
 *
 * For stdio-based ACP communication, use the AcpAgent wrapper class.
 *
 * @module acp
 */
import type * as acp from "@agentclientprotocol/sdk";
import { DiracSessionEmitter } from "./DiracSessionEmitter.js";
import type { DiracAcpSession, DiracAgentOptions, PermissionHandler } from "./public-types.js";
/**
 * Dirac's implementation of the ACP Agent interface.
 *
 * This agent bridges the ACP protocol with Dirac's core Controller,
 * translating ACP requests into Controller operations and emitting
 * session updates via EventEmitters.
 *
 * This class is decoupled from the stdio connection, enabling:
 * - Programmatic usage without stdio dependency
 * - Running multiple concurrent sessions
 * - Handling ACP events via EventEmitter pattern
 *
 * For stdio-based ACP communication, use the AcpAgent wrapper class.
 */
export declare class DiracAgent implements acp.Agent {
    #private;
    shutdown(): Promise<void>;
    private readonly options;
    private readonly ctx;
    /** Map of active sessions by session ID */
    readonly sessions: Map<string, DiracAcpSession>;
    /** Runtime state for active sessions */
    private readonly sessionStates;
    /** Per-session event emitters for session updates */
    private readonly sessionEmitters;
    /** Permission handler callback for requesting user permission */
    private permissionHandler?;
    /** Client capabilities received during initialization */
    private clientCapabilities?;
    /** Track last sent content for partial messages to compute deltas */
    private partialMessageLastContent;
    /** Map message timestamps to toolCallIds to avoid creating duplicate tool calls during streaming */
    private messageToToolCallId;
    /** Current active session ID for use by DiffViewProvider */
    private currentActiveSessionId;
    /** Shared WebviewProvider instance for auth and other operations */
    private webviewProvider;
    constructor(options: DiracAgentOptions);
    /**
     * Set the permission handler callback.
     *
     * This handler is called when the agent needs permission for a tool call.
     * The handler should present the request to the user and call the resolve
     * callback with their response.
     *
     * @param handler - The permission handler callback
     */
    setPermissionHandler(handler: PermissionHandler): void;
    private requestPermission;
    /**
     * Get the event emitter for a session.
     *
     * Use this to subscribe to session events like agent_message_chunk,
     * tool_call, etc.
     *
     * @param sessionId - The session ID
     * @returns The session's event emitter
     */
    emitterForSession(sessionId: string): DiracSessionEmitter;
    /**
     * Initialize the agent and return its capabilities.
     *
     * This is the first method called by the client after establishing
     * the connection. The agent returns its protocol version and capabilities.
     */
    initialize(params: acp.InitializeRequest, connection?: acp.AgentSideConnection): Promise<acp.InitializeResponse>;
    /**
     * Initialize the host provider with optional connection for ACP mode.
     *
     * When used with the AcpAgent wrapper, a connection is provided for
     * host bridge operations. When used programmatically, connection is
     * undefined and standalone providers are used.
     *
     * @param clientCapabilities - Client capabilities from initialization
     * @param connection - Optional ACP connection for host bridge operations
     */
    initializeHostProvider(clientCapabilities?: acp.ClientCapabilities, connection?: acp.AgentSideConnection): void;
    /**
     * Create a new session.
     *
     * A session represents a conversation/task with the agent. The client
     * provides the working directory.
     */
    newSession(params: acp.NewSessionRequest): Promise<acp.NewSessionResponse>;
    /**
     * Get the current model state for ACP responses.
     * Returns available models and the current model ID based on the session mode.
     */
    private getSessionModelState;
    /**
     * Set the model for a session.
     *
     * This method allows changing the model for either plan or act mode.
     * The modelId format is "provider/modelId" (e.g., "anthropic/claude-3-5-sonnet-20241022").
     *
     * @experimental This is an unstable API that may change.
     */
    unstable_setSessionModel(params: acp.SetSessionModelRequest): Promise<acp.SetSessionModelResponse>;
    /**
     * Handle a user prompt.
     *
     * This is the main entry point for user interaction. The agent
     * processes the prompt and sends updates back via sessionUpdate.
     *
     * The prompt flow:
     * 1. Extract content from the ACP prompt (text, images, files)
     * 2. Set up internal dirac state subsription
     * 3. Initialize or continue dirac task
     * 4. Translate DiracMessages to ACP SessionUpdates
     * 5. Handle permission requests for tools/commands
     * 6. Return when dirac task completes, is cancelled, or needs user input
     */
    prompt(params: acp.PromptRequest): Promise<acp.PromptResponse>;
    private handleDiracMessagesChanged;
    /**
     * Handle a permission request for an ask message.
     *
     * This method:
     * 1. Sends the permission request to the client
     * 2. Waits for the user's decision
     * 3. Responds to Dirac's ask based on the decision
     *
     * @param sessionId - The session ID
     * @param sessionState - The session state
     * @param message - The Dirac ask message
     * @param permissionRequest - The permission request details from translateMessage
     */
    private handlePermissionRequest;
    /**
     * Check if a message should resolve the prompt (end the turn).
     */
    private checkMessageForPromptResolution;
    /**
     * Process a message and compute deltas for streaming content.
     *
     * This method uses translateMessage to properly map DiracMessages to ACP SessionUpdates,
     * while computing deltas for text content to avoid sending duplicate content during
     * streaming updates.
     *
     * For text-streaming messages (text, reasoning, followup, plan_mode_respond):
     * - Computes delta between current and last-sent content
     * - Only sends the new portion to avoid duplicates
     *
     * For other messages (tool calls, commands, etc.):
     * - Uses translateMessage to produce proper ACP updates
     * - Sends complete updates (no delta computation needed)
     */
    private processMessageWithDelta;
    /**
     * Cancel the current operation in a session.
     *
     * This is a notification (no response expected). The agent should
     * stop any ongoing processing for the specified session.
     */
    cancel(params: acp.CancelNotification): Promise<void>;
    /**
     * Set the session mode (plan/act).
     *
     * Dirac supports two modes:
     * - "plan": Gather information and create a detailed plan
     * - "act": Execute actions to accomplish the task
     */
    setSessionMode(params: acp.SetSessionModeRequest): Promise<acp.SetSessionModeResponse>;
    authenticate(params: acp.AuthenticateRequest): Promise<acp.AuthenticateResponse>;
    private emitSessionUpdate;
    private sendAvailableCommands;
}
