import { n as AgentEventPayload } from "./agent-events-DOqfzMqh.js"; //#region src/gateway/server-chat-state.d.ts type ChatRunEntry = { sessionKey: string; clientRunId: string; }; type BufferedAgentEvent = { sessionKey?: string; payload: AgentEventPayload & { spawnedBy?: string; }; }; type ChatRunRegistry = { add: (sessionId: string, entry: ChatRunEntry) => void; peek: (sessionId: string) => ChatRunEntry | undefined; shift: (sessionId: string) => ChatRunEntry | undefined; remove: (sessionId: string, clientRunId: string, sessionKey?: string) => ChatRunEntry | undefined; clear: () => void; }; declare function createChatRunRegistry(): ChatRunRegistry; type ChatRunState = { registry: ChatRunRegistry; rawBuffers: Map; buffers: Map; deltaSentAt: Map; /** Length of text at the time of the last broadcast, used to avoid duplicate flushes. */ deltaLastBroadcastLen: Map; deltaLastBroadcastText: Map; agentDeltaSentAt: Map; bufferedAgentEvents: Map; abortedRuns: Map; clear: () => void; }; declare function createChatRunState(): ChatRunState; type ToolEventRecipientRegistry = { add: (runId: string, connId: string) => void; get: (runId: string) => ReadonlySet | undefined; markFinal: (runId: string) => void; }; type SessionEventSubscriberRegistry = { subscribe: (connId: string) => void; unsubscribe: (connId: string) => void; getAll: () => ReadonlySet; clear: () => void; }; type SessionMessageSubscriberRegistry = { subscribe: (connId: string, sessionKey: string) => void; unsubscribe: (connId: string, sessionKey: string) => void; unsubscribeAll: (connId: string) => void; get: (sessionKey: string) => ReadonlySet; clear: () => void; }; declare function createSessionEventSubscriberRegistry(): SessionEventSubscriberRegistry; declare function createSessionMessageSubscriberRegistry(): SessionMessageSubscriberRegistry; declare function createToolEventRecipientRegistry(): ToolEventRecipientRegistry; //#endregion //#region src/gateway/chat-abort.d.ts type ChatAbortControllerEntry = { controller: AbortController; sessionId: string; sessionKey: string; startedAtMs: number; expiresAtMs: number; ownerConnId?: string; ownerDeviceId?: string; providerId?: string; authProviderId?: string; /** * Which RPC owns this registration. Absent (undefined) is treated as * `"chat-send"` so pre-existing callers that constructed entries without * a kind keep their behavior. Consumers that need "chat.send specifically * is active" must check `kind !== "agent"`, not just `.has(runId)`. */ kind?: "chat-send" | "agent"; }; //#endregion export { ChatRunState as a, ToolEventRecipientRegistry as c, createSessionEventSubscriberRegistry as d, createSessionMessageSubscriberRegistry as f, ChatRunRegistry as i, createChatRunRegistry as l, BufferedAgentEvent as n, SessionEventSubscriberRegistry as o, createToolEventRecipientRegistry as p, ChatRunEntry as r, SessionMessageSubscriberRegistry as s, ChatAbortControllerEntry as t, createChatRunState as u };