export type LocalLlmConfig = { endpoint: string; model: string; provider?: string; }; export type LocalLlmSession = { id: string; abortController: AbortController; outputBuffer: string; history: Array<{ role: 'user' | 'assistant'; content: string; }>; status: 'streaming' | 'done' | 'error'; onToken?: (content: string) => void; onDone?: () => void; onError?: (message: string) => void; }; /** * SSRF guard: only allow requests to loopback addresses. */ export declare function isLocalEndpoint(endpoint: string): boolean; /** * Create a new local LLM streaming session. * Sends POST to the OpenAI-compatible chat/completions endpoint with `stream: true` * and parses SSE responses. */ export declare function createLocalLlmSession(sessionId: string, message: string, config: LocalLlmConfig, context?: string): LocalLlmSession; export declare function getLocalLlmSession(sessionId: string): LocalLlmSession | undefined; export declare function abortLocalLlmSession(sessionId: string): boolean;