/** * Which provider powers each organization service: Voice input, Image * generation, and Embeddings. Owners and admins pick one per service in * Settings › Infrastructure (the `manage-service-providers` action); the voice, * image, and embedding resolvers read it here. Unset means each service's * default order, which is also the order the options are listed in. * * Stored as the org setting `service-providers`: * `{ voice?, images?, embeddings?, updatedAt, updatedBy }`. */ export declare const SERVICE_PROVIDERS_SETTING_KEY = "service-providers"; /** * Each service's providers in its default order: the one used when the * organization hasn't chosen, then the fallbacks. */ export declare const SERVICE_PROVIDER_OPTIONS: { readonly voice: readonly ["builder", "gemini", "groq", "openai"]; readonly images: readonly ["builder", "gemini", "openai"]; readonly embeddings: readonly ["builder", "gemini", "cohere", "voyage"]; }; export type ServiceId = keyof typeof SERVICE_PROVIDER_OPTIONS; export declare const SERVICE_IDS: ServiceId[]; export type ServiceProviderId = (typeof SERVICE_PROVIDER_OPTIONS)[S][number]; export type ServiceProviderChoices = { [S in ServiceId]?: ServiceProviderId; }; export interface ServiceProviderSettings { choices: ServiceProviderChoices; updatedAt: number | null; updatedBy: string | null; } /** * The secret each non-Builder provider reads. Gemini is the one key chat and * services share (`GOOGLE_GENERATIVE_AI_API_KEY`; older `GEMINI_API_KEY` rows * still resolve). */ export declare const SERVICE_PROVIDER_KEYS: Record, string>; export declare function isServiceId(value: unknown): value is ServiceId; export declare function isServiceProviderOption(service: S, provider: unknown): provider is ServiceProviderId; /** The providers to try for `service`: the choice first, then the default order. */ export declare function serviceProviderOrder(service: S, choice?: ServiceProviderId | null): ServiceProviderId[]; /** Throws when the settings store cannot be read; never reports "unset" instead. */ export declare function readServiceProviderSettings(orgId: string): Promise; /** Set (or with `provider: null`, clear) one service's choice. */ export declare function writeServiceProviderChoice(orgId: string, input: { service: S; provider: ServiceProviderId | null; updatedBy: string; }): Promise<{ settings: ServiceProviderSettings; previous: ServiceProviderId | null; changed: boolean; }>; /** * The organization's choice for `service`, or null when it hasn't chosen or * there is no organization. `orgId` undefined means the request's org. * Throws when the setting cannot be read, so callers can report a failed * lookup instead of quietly using the default order. */ export declare function readServiceProviderChoice(service: S, options?: { orgId?: string | null; }): Promise | null>;