export type ChatAbortControllerEntry = { controller: AbortController; sessionId: string; sessionKey: string; startedAtMs: number; expiresAtMs: number; ownerConnId?: string; ownerDeviceId?: 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"; }; type RegisteredChatAbortController = { controller: AbortController; registered: boolean; entry?: ChatAbortControllerEntry; cleanup: () => void; }; export declare function isChatStopCommandText(text: string): boolean; export declare function resolveAgentRunExpiresAtMs(params: { now: number; timeoutMs: number; graceMs?: number; }): number; export declare function registerChatAbortController(params: { chatAbortControllers: Map; runId: string; sessionId: string; sessionKey?: string | null; timeoutMs: number; ownerConnId?: string; ownerDeviceId?: string; kind?: ChatAbortControllerEntry["kind"]; now?: number; expiresAtMs?: number; }): RegisteredChatAbortController; export type ChatAbortOps = { chatAbortControllers: Map; chatRunBuffers: Map; chatDeltaSentAt: Map; chatDeltaLastBroadcastLen: Map; chatAbortedRuns: Map; removeChatRun: (sessionId: string, clientRunId: string, sessionKey?: string) => { sessionKey: string; clientRunId: string; } | undefined; agentRunSeq: Map; broadcast: (event: string, payload: unknown, opts?: { dropIfSlow?: boolean; }) => void; nodeSendToSession: (sessionKey: string, event: string, payload: unknown) => void; }; export declare function abortChatRunById(ops: ChatAbortOps, params: { runId: string; sessionKey: string; stopReason?: string; }): { aborted: boolean; }; export {};