import express from 'express';
import { type AgentRuntimeAnalysisResult, type Hypothesis, type IOrchestrator, type StreamingUpdate } from '../agent';
import { AssistantApplicationService, type ManagedAssistantSession } from '../assistant/application/assistantApplicationService';
import { StreamProjector } from '../assistant/stream/streamProjector';
import { type SessionLogger } from '../services/sessionLogger';
import { SceneStoryService } from '../agent/scene/sceneStoryService';
import type { SceneReport } from '../agent/scene/types';
export interface SceneReconstructConversationStep {
    eventId: string;
    ordinal: number;
    phase: 'progress' | 'thinking' | 'tool' | 'result' | 'error';
    role: 'agent' | 'system';
    text: string;
    timestamp: number;
    sourceEventType?: string;
}
export interface SceneReconstructSession extends ManagedAssistantSession {
    orchestrator: IOrchestrator;
    orchestratorUpdateHandler?: (update: StreamingUpdate) => void;
    traceId: string;
    query: string;
    tenantId?: string;
    workspaceId?: string;
    userId?: string;
    logger: SessionLogger;
    result?: AgentRuntimeAnalysisResult;
    /** Set by SceneStoryService once the pipeline completes (fresh or cached). */
    sceneStoryReport?: SceneReport;
    hypotheses: Hypothesis[];
    scenes?: any[];
    trackEvents?: any[];
    agentDialogue: Array<{
        agentId: string;
        type: 'task' | 'response' | 'question';
        content: any;
        timestamp: number;
    }>;
    dataEnvelopes: any[];
    agentResponses: Array<{
        taskId: string;
        agentId: string;
        response: any;
        timestamp: number;
    }>;
    conversationOrdinal: number;
    conversationSteps: SceneReconstructConversationStep[];
}
interface RegisterSceneReconstructRoutesDeps<TSession extends SceneReconstructSession> {
    assistantAppService: AssistantApplicationService<TSession>;
    streamProjector: StreamProjector;
    ensureToolsRegistered: () => void;
    /**
     * Legacy `/analyze`-style runner. Kept here for backward compatibility with
     * the keyword-triggered path; the primary `/scene-reconstruct` POST handler
     * now uses sceneStoryService.start() instead.
     */
    runAgentDrivenAnalysis: (sessionId: string, query: string, traceId: string, options?: any) => Promise<void>;
    broadcastToAgentDrivenClients: (sessionId: string, update: StreamingUpdate) => void;
    sendAgentDrivenResult: (res: express.Response, session: TSession) => void;
    isSceneReplayOnlyQuery: (query: string) => boolean;
    buildSceneReplayNarrative: (scenes: any[]) => string;
    normalizeNarrativeForClient: (narrative: string) => string;
    /** Scene-specific pipeline. Replaces runAgentDrivenAnalysis for /scene-reconstruct. */
    sceneStoryService: SceneStoryService;
}
export declare function registerSceneReconstructRoutes<TSession extends SceneReconstructSession>(router: express.Router, deps: RegisterSceneReconstructRoutesDeps<TSession>): void;
export {};
//# sourceMappingURL=agentSceneReconstructRoutes.d.ts.map