/**
 * StreamAgentEventsUseCase
 *
 * Produces a stream of agent/feature lifecycle events by polling the
 * repositories and computing deltas per connection. Originally lived in
 * `src/presentation/web/app/api/agent-events/route.ts` (clean-arch violation
 * #4 in spec 089) — the SSE route is now a thin adapter that framing-wraps
 * whatever this use case yields.
 *
 * Delta computation has been extracted into pure helper modules under
 * `./stream-agent-events/` (clean-arch violation #30 in spec 089). This file
 * is now a thin orchestrator: it owns the connection-scoped cache, the poll
 * loop, and the cloud-deploy bus subscription, and delegates every per-tick
 * diff to the helpers.
 *
 * Output shape: a discriminated union so the caller can route each event
 * onto its own SSE channel without needing to know the business rules.
 *
 * - `{ kind: 'notification', event }`     → `NotificationEvent` (feature/PR/agent)
 * - `{ kind: 'interactive-session', ... }` → interactive session status change
 *
 * Heartbeats are a presentation concern (SSE framing) and are NOT emitted by
 * this use case.
 */
import type { IAgentMessageBus } from '../../ports/output/agents/agent-message-bus.interface.js';
import type { IAgentRunRepository } from '../../ports/output/agents/agent-run-repository.interface.js';
import type { IPhaseTimingRepository } from '../../ports/output/agents/phase-timing-repository.interface.js';
import type { IAgentQuestionRepository } from '../../ports/output/repositories/agent-question-repository.interface.js';
import type { IApplicationRepository } from '../../ports/output/repositories/application-repository.interface.js';
import type { IInteractiveSessionRepository } from '../../ports/output/repositories/interactive-session-repository.interface.js';
import type { ISupervisorDecisionRepository } from '../../ports/output/repositories/supervisor-decision-repository.interface.js';
import type { ICloudDeploymentEventBus } from '../../ports/output/services/cloud-deployment-event-bus.interface.js';
import type { ILogger } from '../../ports/output/services/logger.interface.js';
import type { IOperationLogEventBus } from '../../ports/output/services/operation-log-event-bus.interface.js';
import type { IProcessLivenessProbe } from '../../ports/output/services/process-liveness.interface.js';
import { ListFeaturesUseCase } from '../features/list-features.use-case.js';
import type { StreamedAgentEvent } from './stream-agent-events/stream-agent-events.types.js';
export type { AgentMessageStreamEvent, AgentQuestionStreamEvent, InteractiveSessionStreamEvent, NotificationStreamEvent, StreamedAgentEvent, SupervisorDecisionStreamEvent, } from './stream-agent-events/stream-agent-events.types.js';
export interface StreamAgentEventsOptions {
    /** Filter events to a single agent run (omitted → stream everything). */
    runIdFilter?: string;
    /** Caller-owned abort signal — closes the generator cleanly on client disconnect. */
    signal?: AbortSignal;
    /** Override the poll interval (tests). */
    pollIntervalMs?: number;
}
export declare class StreamAgentEventsUseCase {
    private readonly listFeatures;
    private readonly agentRunRepo;
    private readonly phaseTimingRepo;
    private readonly sessionRepo;
    private readonly processLiveness;
    private readonly cloudEventBus;
    private readonly applicationRepo;
    private readonly operationLogEventBus;
    private readonly logger;
    private readonly agentMessageBus;
    private readonly agentQuestionRepo;
    private readonly supervisorDecisionRepo;
    constructor(listFeatures: ListFeaturesUseCase, agentRunRepo: IAgentRunRepository, phaseTimingRepo: IPhaseTimingRepository, sessionRepo: IInteractiveSessionRepository, processLiveness: IProcessLivenessProbe, cloudEventBus: ICloudDeploymentEventBus, applicationRepo: IApplicationRepository, operationLogEventBus: IOperationLogEventBus, logger: ILogger, agentMessageBus: IAgentMessageBus, agentQuestionRepo: IAgentQuestionRepository, supervisorDecisionRepo: ISupervisorDecisionRepository);
    /**
     * Yields every notification/interactive-session event as soon as the
     * next poll cycle detects it. The generator runs until the provided
     * `signal` is aborted.
     *
     * Buffers events between yields via a simple queue + in-poll notifier,
     * so the cloud-deploy event bus subscription (which fires synchronously
     * on publish) can enqueue without blocking.
     */
    execute(options?: StreamAgentEventsOptions): AsyncGenerator<StreamedAgentEvent>;
    /**
     * Subscribe to the in-process cloud-deploy event bus and re-emit incoming
     * events as `notification` envelopes. Returns the unsubscribe handle.
     */
    private subscribeCloudDeploy;
    /**
     * Subscribe to the in-process operation-log event bus and re-emit each
     * publish as a `NotificationEventType.OperationLogAppended` notification.
     * Returns the unsubscribe handle.
     */
    private subscribeOperationLog;
    /**
     * Single poll cycle: walk every feature's latest agent run, diff against
     * the connection cache, and enqueue notification events for any observed
     * state changes. Also polls interactive session state transitions.
     */
    private pollOnce;
    /**
     * Seed the per-connection cache on first sight of a feature. We do NOT
     * emit any events here — otherwise the client would see a burst of
     * "current state" notifications every time it reconnects.
     */
    private seedFeatureCache;
}
//# sourceMappingURL=stream-agent-events.use-case.d.ts.map