/**
 * Claude Code Interactive Executor Service
 *
 * Infrastructure implementation of IInteractiveAgentExecutor using the
 * @anthropic-ai/claude-agent-sdk V2 session API. This is the ONLY file
 * that imports from the SDK.
 *
 * ## V2 API Stability Notice
 *
 * This file uses the `unstable_v2_*` session API. The V2 API is chosen over
 * the stable V1 `query()` API because V2 maintains a persistent agent process
 * across turns, providing near-instant turn responses. V1 `query()` spawns a
 * new process per turn with `resume`, adding 5-15s latency — unacceptable
 * for interactive chat.
 *
 * The SDK version is pinned exactly in package.json to prevent surprise
 * breakage. If Anthropic removes the V2 API, migrate to V1 `query()` with
 * `resume: sessionId` — the InteractiveAgentSessionHandle interface is
 * designed to support either backend transparently.
 *
 * ## V2 Limitations (vs V1 query())
 *
 * SDKSessionOptions does NOT support: `cwd`, `maxTurns`, `maxBudgetUsd`,
 * `abortController`, `settingSources`, `persistSession`, `effort`.
 * These must be handled at the service layer:
 * - cwd: Handled via process.chdir() mutex (see withCwd)
 * - abort: Handled via SDKSession.close() which kills the process
 * - maxTurns/maxBudgetUsd: Should be tracked by InteractiveSessionService
 *
 * Design decisions:
 * - The CLAUDECODE env var is stripped to prevent nested-session detection
 *   errors when shep itself is running inside a Claude Code session.
 * - SDK message types are mapped to our own InteractiveAgentEvent to
 *   keep the application layer decoupled from SDK specifics.
 * - AskUserQuestion is intercepted via the SDK's `canUseTool` callback,
 *   which pauses the stream until the user responds. The callback delegates
 *   to the `onUserQuestion` option provided by the session service.
 */
import type { IInteractiveAgentExecutor, InteractiveAgentOptions, InteractiveAgentSessionHandle } from '../../../../../application/ports/output/agents/interactive-agent-executor.interface.js';
export declare class ClaudeCodeInteractiveExecutor implements IInteractiveAgentExecutor {
    createSession(options: InteractiveAgentOptions): Promise<InteractiveAgentSessionHandle>;
    resumeSession(sessionId: string, options: InteractiveAgentOptions): Promise<InteractiveAgentSessionHandle>;
    /**
     * Acquire a process-level mutex, change cwd, run the synchronous factory
     * function, restore cwd, and release the mutex.
     *
     * This prevents concurrent session creations from seeing each other's cwd.
     * The mutex is async to serialize across concurrent API request handlers.
     */
    private withCwd;
    private buildSdkOptions;
    private wrapSession;
    /**
     * Map the SDK message stream to domain events.
     *
     * Tracks whether streaming deltas (`stream_event`) have been emitted for
     * the current turn. When deltas are available, the `assistant` message's
     * text blocks are skipped to prevent double-emission of the same content.
     */
    private mapStream;
    /**
     * Map a single SDK message to zero or more InteractiveAgentEvents.
     *
     * SDK message types we handle:
     * - stream_event (SDKPartialAssistantMessage): streaming content deltas
     * - assistant (SDKAssistantMessage): complete assistant turn with tool_use blocks
     * - result (SDKResultMessage): success or error result with distinct subtypes
     * - system (SDKStatusMessage / SDKSystemMessage): status updates, compaction
     * - tool_use_summary: tool execution summaries
     * - tool_progress: tool execution progress
     * - rate_limit_event: rate limit notifications
     *
     * Other message types are silently ignored (user replays, auth, hooks, etc.)
     */
    private mapSdkMessage;
}
//# sourceMappingURL=claude-code-interactive-executor.service.d.ts.map