import type { ModelAccountPreferences, SessionEvent, SessionModelAccountChoiceResponse, SetSessionModelAccountChoiceRequest, SetSessionModelAccountChoiceResponse, UpdateModelAccountPreferencesRequest } from "@opengeni/sdk"; import { type ClientOverride } from "../provider.js"; import { type SessionEventFeedOptions } from "./internal.js"; /** Events after which the session's model account may have changed. */ export declare function isModelAccountEvent(event: Pick): boolean; /** * The structural slice of the SDK client the model-account picker needs. * Method names and signatures match `OpenGeniClient`, so the real client * satisfies it directly and a test client can stand in. */ export type ModelAccountClientLike = { getSessionModelAccount: (workspaceId: string, sessionId: string) => Promise; setSessionModelAccount?: (workspaceId: string, sessionId: string, request: SetSessionModelAccountChoiceRequest) => Promise; updateModelAccountPreferences?: (organizationId: string, request: UpdateModelAccountPreferencesRequest) => Promise; }; export type UseSessionModelAccountOptions = ClientOverride & SessionEventFeedOptions & { sessionId: string; /** Scope choices, including Automatic, to this provider. Omit for a whole-session reset. */ provider?: string | null | undefined; /** The session's organization; needed to change the personal-fallback opt-in. */ organizationId?: string | null | undefined; pollIntervalMs?: number | undefined; modelAccountClient?: ModelAccountClientLike | undefined; }; export type UseSessionModelAccountResult = { choice: SessionModelAccountChoiceResponse | null; loading: boolean; error: Error | null; refresh: () => Promise; /** Choose an account, or `null` for automatic selection; true on success. */ choose: (connectionId: string | null) => Promise; choosing: boolean; /** The in-flight target (`null` is automatic; `undefined` when idle). */ choosingTarget: string | null | undefined; appliedTo: "waiting_turn" | "next_turn" | null; /** Turn the caller's own personal-fallback opt-in on or off; true on success. */ setFallbackOptIn: (optIn: boolean) => Promise; canChangeFallback: boolean; mutationError: Error | null; }; /** * The session's model account across every provider on the shared * subscription core: the accounts it may use (the workspace's shared accounts * and the caller's own personal accounts), the explicit choice, and the * caller's personal-fallback opt-in. The server decides what may be chosen; * this hook only reflects and requests. */ export declare function useSessionModelAccount(options: UseSessionModelAccountOptions): UseSessionModelAccountResult;