import React, { ReactNode } from 'react'; import { GatewayConfig } from '../openai'; /** * App-level AI connection, set once at the root. Every AI surface (grid * assistant, Shell assistant, builder panels) reads it from context — pages * never wire the gateway themselves. Model choice is not here: it is a * property of each function, stated on the surface that hosts it. */ export interface UdpAiConfig { /** OpenAI-compatible gateway (udp-ai-gateway): base URL + extra headers */ gateway: GatewayConfig; } /** * What the gateway allows this tenant/product. This is the value every AI * surface reads: it exists only once the gateway has said yes, so * `useAiAccess() !== null` IS the "render an AI control" test. */ export interface UdpAiAccess extends UdpAiConfig { /** The model ids the gateway offers this cell. */ models: string[]; } export interface UdpAiProviderProps { config: UdpAiConfig; children?: ReactNode; } /** * Resolves the app's AI access once per tenant. The gateway's tenant, product * and environment guards decide who gets AI; this asks them (`GET /v1/models`) * before any surface can render, so a tenant the gateway refuses never sees a * control that would only fail on use. Rejected, empty, or not yet answered all * read as null. Re-asked when the tenant changes, because the answer does. * * The probe waits for a signed-in user: the transport has no token before * that, and the tenant header comes from the same place. */ export declare const UdpAiProvider: ({ config, children }: UdpAiProviderProps) => React.JSX.Element; /** * The app's AI access, or null when there is none: no UdpAiProvider mounted, * the gateway not yet asked, or the gateway refused this tenant. AI surfaces * render nothing on null. */ export declare const useAiAccess: () => UdpAiAccess; //# sourceMappingURL=UdpAiProvider.d.ts.map