/** * Self-registration with the Builder Realtime Gateway. * * Apps deployed by the Builder hosting pipeline are handed a channel id and an * HMAC secret as reserved env vars, because the pipeline already knows their * database — it provisioned it. An app deployed anywhere else has neither, and * the gateway has no way to reach its database at all, so hosted realtime was * effectively pipeline-only. * * This closes that gap from the app's side: when hosted transport is on and no * channel was injected, the app tells the gateway its own Postgres URL and * public origin, authenticating with the deployment's `BUILDER_PRIVATE_KEY` — * the same credential it already holds for the LLM gateway. It gets back a * channel id and secret and mints subscribe tokens exactly as a pipeline app * does. * * Registration runs on demand rather than from a CLI so it self-heals: the * database URL, the app origin and the secret all follow the deployment. A * connection string pasted once by hand goes stale on rotation and takes the * tail down silently. * * Everything here fails soft. No credential, the org's * flag off, the gateway unreachable — all resolve to `null`, the token mint * 404s, and the client stays on the app's own `/_agent-native/poll`. */ export interface RealtimeChannel { channelId: string; hmacSecret: string; } export declare function resetRealtimeRegistrationCache(): void; export declare function realtimeRegistrationUnavailable(): boolean; export declare function isHostedRealtimeTransport(): boolean; /** * The channel this deployment registered for itself, or null. * * Callers should prefer an injected channel (the pipeline's env vars) over this * — see `realtime-token.ts`. Cheap on the hot path: one in-process memo, one * settings read on a cold isolate, and a network call only when the inputs * changed or nothing was stored. */ export declare function resolveRegisteredRealtimeChannel(): Promise;