export class InteractiveSessionController {
    session;
    handlers;
    constructor(session, handlers) {
        this.session = session;
        this.handlers = handlers;
    }
    subscribe() {
        return this.session.subscribe(async (event) => {
            await this.handleEvent(event);
        });
    }
    async handleEvent(event) {
        await this.handlers.ensureInitialized();
        this.handlers.invalidateFooter();
        switch (event.type) {
            case 'turn_start':
            case 'turn_end':
                break;
            case 'agent_start':
                await this.handlers.onAgentStart(event);
                break;
            case 'message_start':
                await this.handlers.onMessageStart(event);
                break;
            case 'message_update':
                await this.handlers.onMessageUpdate(event);
                break;
            case 'message_end':
                await this.handlers.onMessageEnd(event);
                break;
            case 'tool_execution_start':
                await this.handlers.onToolExecutionStart(event);
                break;
            case 'tool_execution_update':
                await this.handlers.onToolExecutionUpdate(event);
                break;
            case 'tool_execution_end':
                await this.handlers.onToolExecutionEnd(event);
                break;
            case 'tool_summary':
                await this.handlers.onToolSummary(event);
                break;
            case 'agent_end':
                await this.handlers.onAgentEnd(event);
                break;
            case 'auto_compaction_start':
                await this.handlers.onAutoCompactionStart(event);
                break;
            case 'auto_compaction_end':
                await this.handlers.onAutoCompactionEnd(event);
                break;
            case 'recovery_start':
                await this.handlers.onRecoveryStart(event);
                break;
            case 'recovery_end':
                await this.handlers.onRecoveryEnd(event);
                break;
        }
    }
}
//# sourceMappingURL=interactive-session-controller.js.map