/** * SuperGrok chat turns on the shared subscription core: the bearer resolver * for the SuperGrok transport. Everything else the worker uses (placement, * request custody, health) is the provider-neutral runtime bound to * `SUBSCRIPTION_CORE_XAI`, which stays unregistered until the SuperGrok * cutover (design 5.3, X3): every entry point fails closed before then. * * The snapshot's `userId` is the connection's `provider_account_id` (the * token identity subject the transport sends as `x-userid`); a connection * without one cannot be used and needs a new sign-in, as on the legacy path. */ import type { Settings } from "@opengeni/config"; import type { Database } from "./database.js"; import type { SubscriptionCoreProvider } from "./subscription-core/provider.js"; import type { SubscriptionCoreLeaseRef, SubscriptionCoreRefreshDeps, SubscriptionCoreTurnIdentity } from "./subscription-core/turns.js"; /** The SuperGrok transport's token snapshot, plus the credential version it came from. */ export type SubscriptionCoreXaiTokenSnapshot = { accessToken: string; userId: string; /** The connection's refresh generation. */ credentialVersion: number; }; /** A SuperGrok core turn lease's TTL (the legacy SuperGrok lease's, which it replaced). */ export declare const XAI_CREDENTIAL_LEASE_TTL_MS: number; export declare function buildSubscriptionCoreXaiTokenResolver(db: Database, settings: Settings, identity: SubscriptionCoreTurnIdentity, lease: SubscriptionCoreLeaseRef, deps?: SubscriptionCoreRefreshDeps & { provider?: SubscriptionCoreProvider; }): { getToken: () => Promise; refresh: () => Promise; };