/**
 * Network and communication types
 * Contains types for NATS, WebSocket, and network configuration
 */
import type { ChatType } from './chat.types';
export type NatsMessageType = 'message' | 'admin-message';
export type NatsConnectionStatus = 'connecting' | 'connected' | 'disconnected' | 'reconnecting' | 'closed' | 'error';
export type NatsConnectionSource = 'client' | 'agent' | 'dashboard';
export declare const NETWORK_CONFIG: {
    readonly SHARED_CLOSE_DELAY_MS: 3000;
    readonly CONNECT_TIMEOUT_MS: 10000;
    readonly RECONNECT_TIME_WAIT_MS: 2000;
    readonly PING_INTERVAL_MS: 30000;
    readonly MAX_PING_OUT: 3;
    readonly DEFAULT_MESSAGE_LIMIT: 50;
    readonly POLL_MESSAGE_LIMIT: 10;
    readonly RETRY_INITIAL_DELAY_MS: 1000;
    readonly RETRY_MAX_DELAY_MS: 30000;
    readonly RETRY_BACKOFF_MULTIPLIER: 2;
};
export type NetworkConfig = typeof NETWORK_CONFIG;
export interface ChunkData {
    sequenceId?: number;
    /** JetStream stream sequence, populated from JsMsg.info.streamSequence when delivered via JetStream. */
    streamSeq?: number;
    /** Authoritative dialog streaming state at the time this chunk was emitted; consumers should mirror it into their dialog cache. */
    streamState?: 'IDLE' | 'STREAMING';
    type: string;
    text?: string;
    integratedToolType?: string;
    toolFunction?: string;
    /** Execution chunks carry the human-readable title as `title`. */
    title?: string;
    parameters?: Record<string, any>;
    result?: string;
    success?: boolean;
    toolExecutionRequestId?: string;
    error?: string;
    details?: string;
    approvalRequestId?: string;
    approval_request_id?: string;
    approvalType?: string;
    command?: string;
    explanation?: string;
    approved?: boolean;
    toolCalls?: any[];
    modelName?: string;
    providerName?: string;
    provider?: string;
    contextWindow?: number;
    ownerType?: string;
    displayName?: string;
    [key: string]: any;
}
export interface BufferedChunk {
    chunk: ChunkData;
    messageType: NatsMessageType;
}
export interface WebSocketMessage {
    type: string;
    payload: any;
    timestamp?: string;
    id?: string;
}
export interface WebSocketConfig {
    url: string;
    protocols?: string | string[];
    reconnect?: boolean;
    reconnectInterval?: number;
    maxReconnectAttempts?: number;
    onOpen?: (event: Event) => void;
    onClose?: (event: CloseEvent) => void;
    onError?: (event: Event) => void;
    onMessage?: (event: MessageEvent) => void;
}
export type FetchChunksFunction = (dialogId: string, chatType: ChatType, fromSequenceId?: number | null) => Promise<ChunkData[]>;
export interface NetworkResponse<T = any> {
    success: boolean;
    data?: T;
    error?: string;
    message?: string;
}
export interface PaginatedResponse<T = any> extends NetworkResponse<T> {
    page: number;
    pageSize: number;
    totalCount: number;
    totalPages: number;
}
export interface NetworkError {
    code: string;
    message: string;
    details?: any;
    timestamp: string;
}
//# sourceMappingURL=network.types.d.ts.map