/**
 * SessionTerminator
 *
 * Encapsulates the two stop paths previously inlined in the monolithic
 * `InteractiveSessionService`:
 *
 * - `stop(sessionId)`          — tears down a session by its DB id.
 * - `stopByFeature(featureId)` — finds the active session for a feature
 *   scope and delegates to `stop()`.
 *
 * Side-effects on stop:
 * 1. Aborts any in-flight stream (cancels the AbortController).
 * 2. Drains the turn queue so no pending turns run after teardown.
 * 3. Caches the agent SDK session id in the registry so the next boot
 *    can resume the same SDK conversation.
 * 4. Closes the SDK session handle.
 * 5. Persists `stopped` status + `idle` turn status to the DB and notifies
 *    SSE subscribers.
 *
 * Replaces the `console.log(new Error().stack)` diagnostic call with a
 * structured `logger.debug` call.
 *
 * Extracted from `interactive-session.service.ts` in phase 5 of the
 * strangler refactor documented at
 * `docs/plans/2026-04-14-interactive-session-service-refactor.md`.
 */
import type { SessionRegistry } from '../core/session-registry.js';
import type { SessionPersistence } from '../core/session-persistence.js';
import type { StreamEventDispatcher } from '../core/stream-event-dispatcher.js';
import type { ILogger } from '../../../../application/ports/output/services/logger.interface.js';
import type { IInteractiveMessageRepository } from '../../../../application/ports/output/repositories/interactive-message-repository.interface.js';
import type { IWorkflowStepRepository } from '../../../../application/ports/output/repositories/workflow-step-repository.interface.js';
export declare class SessionTerminator {
    private readonly registry;
    private readonly persistence;
    private readonly dispatcher;
    private readonly logger;
    private readonly messageRepo;
    private readonly workflowStepRepo;
    constructor(registry: SessionRegistry, persistence: SessionPersistence, dispatcher: StreamEventDispatcher, logger: ILogger, messageRepo: IInteractiveMessageRepository, workflowStepRepo: IWorkflowStepRepository);
    /**
     * Stop and tear down the session identified by `sessionId`.
     * Idempotent — returns silently when the session is already gone.
     */
    stop(sessionId: string): Promise<void>;
    /**
     * Find the active session for `featureId` and stop it.
     * No-op when no active session is found.
     */
    stopByFeature(featureId: string): Promise<void>;
    /**
     * Clear all messages and workflow steps for a feature scope.
     * Stops any active session first so the agent doesn't retain old context.
     * Also clears the cached agent session id so the next boot starts fresh.
     */
    clearFeatureMessages(featureId: string): Promise<void>;
}
//# sourceMappingURL=session-terminator.d.ts.map