/**
 * 事件序列化适配器模块导出
 * 提供Chat和Responses协议的事件序列化功能
 */
import { BatchSerializer } from './base-serializer.js';
import { ChatEventSerializer, defaultChatEventSerializer } from './chat-event-serializer.js';
import { ResponsesEventSerializer, defaultResponsesEventSerializer } from './responses-event-serializer.js';
// Chat协议序列化器
export { defaultChatEventSerializer } from './chat-event-serializer.js';
// Responses协议序列化器
export { defaultResponsesEventSerializer } from './responses-event-serializer.js';
export { serializeAnthropicEventToSSE } from './anthropic-event-serializer.js';
export { serializeGeminiEventToSSE } from './gemini-event-serializer.js';
/**
 * 创建序列化器工厂
 */
export class SerializerFactory {
    /**
     * 创建Chat协议序列化器
     */
    static createChatSerializer(options) {
        return new ChatEventSerializer();
    }
    /**
     * 创建Responses协议序列化器
     */
    static createResponsesSerializer(options) {
        return new ResponsesEventSerializer();
    }
    /**
     * 根据协议类型创建序列化器
     */
    static createSerializer(protocol, options) {
        switch (protocol) {
            case 'chat':
                return this.createChatSerializer(options);
            case 'responses':
                return this.createResponsesSerializer(options);
            default:
                throw new Error(`Unsupported protocol: ${protocol}`);
        }
    }
    /**
     * 创建批量序列化器
     */
    static createBatchSerializer(serializer) {
        return new BatchSerializer(serializer);
    }
}
/**
 * 默认序列化器实例
 */
export const defaultSerializers = {
    chat: defaultChatEventSerializer,
    responses: defaultResponsesEventSerializer
};
