/**
 * 流状态管理类型定义
 * 管理JSON↔SSE双向转换过程中的流状态
 */
// 流状态枚举
export var StreamState;
(function (StreamState) {
    StreamState["IDLE"] = "idle";
    StreamState["STARTING"] = "starting";
    StreamState["ACTIVE"] = "active";
    StreamState["PAUSED"] = "paused";
    StreamState["COMPLETING"] = "completing";
    StreamState["COMPLETED"] = "completed";
    StreamState["ERROR"] = "error";
    StreamState["TIMEOUT"] = "timeout";
    StreamState["ABORTED"] = "aborted";
})(StreamState || (StreamState = {}));
// 流方向
export var StreamDirection;
(function (StreamDirection) {
    StreamDirection["JSON_TO_SSE"] = "json_to_sse";
    StreamDirection["SSE_TO_JSON"] = "sse_to_json";
})(StreamDirection || (StreamDirection = {}));
// 默认流配置
export const DEFAULT_STREAM_CONFIG = {
    idleTimeoutMs: 30000,
    totalTimeoutMs: 300000, // 5分钟
    heartbeatTimeoutMs: 60000,
    maxBufferSize: 10000,
    highWaterMark: 8000,
    lowWaterMark: 2000,
    enableBackpressure: true,
    backpressureThreshold: 0.8,
    backpressureStrategy: 'buffer',
    maxRetries: 3,
    retryDelayMs: 1000,
    retryBackoffMultiplier: 2,
    enableMetrics: true,
    metricsIntervalMs: 5000,
    enableDetailedLogging: false,
    maxConcurrentEvents: 50,
    eventProcessingTimeoutMs: 5000,
    gcThreshold: 1000
};
