import { SSEEvent } from '../models/types'; /** * Thrown when the chat endpoint rejects the session token (401/403). * `` catches this specifically to trigger a silent one-shot re-auth * instead of surfacing a generic error to the user. */ export declare class TokenRejectedError extends Error { constructor(message?: string); } /** * Thrown when the chat endpoint refuses with 403 `CONSENT_REQUIRED` โ€” the * token is VALID; the doctor's consent is missing (server-side enforcement * with stale local state). `` must NOT clear the token nor retry: * the root swaps to the consent screen instead (spec ยง2.5). */ export declare class ConsentRequiredError extends Error { constructor(message?: string); } export declare class ChatService { private apiUrl; constructor(apiUrl: string); /** * Sends a message to the chat endpoint and yields SSEEvents from the stream. * The agent decides mode autonomously โ€” no `mode` field in the request. * Pass an AbortSignal to cancel an in-flight stream (e.g. on drawer close). * * @throws TokenRejectedError if the server returns 401/403 โ€” caller should re-auth and retry once. * @throws Error for any other non-ok response or network failure. */ sendMessage(token: string, message: string, signal?: AbortSignal): AsyncGenerator; }