import { ReactNode } from 'react'; import { MessagingSupabaseClient } from '@ai-matrx/messaging'; import { M as MeetStore, R as RoomEngine, C as CallCenter, a as MeetingSession, I as InRoomClient, b as RecordingController, D as DeviceManager, c as MeetRepository, T as TokenClient, d as MeetAi, e as RoomDriverFactory, f as DeviceSnapshot, g as MeetSnapshot } from './in-room-im0H79Y-.js'; import { M as MeetApi, a as MeetIdentity, A as AccessTokenSource, C as CallInvite, U as UserId, P as ParticipantRole } from './collab-D1yqyArT.js'; interface MeetDiagnostic { readonly level: "error" | "info" | "warn"; readonly message: string; readonly remedy?: string | undefined; /** * A background read the host can re-run from its card's Retry (the call center's pending-calls * read after its quiet retries ran out). Present only when re-running it is the remedy. */ readonly retry?: (() => void) | undefined; } interface MeetHost { readonly store: MeetStore; readonly engine: RoomEngine; readonly calls: CallCenter | null; readonly meetings: MeetingSession; /** * Meet wave 2: host moderation and the SAVED chat, both decided and written by * the server (`core/in-room.ts`). A guest's calls carry their room pass. */ readonly inRoom: InRoomClient; readonly recording: RecordingController; readonly devices: DeviceManager; readonly repository: MeetRepository; readonly tokens: TokenClient; /** * 🚨 NEVER NULL as of 0.3.0. Through 0.2.1 this was `null` unless the host * injected a transport AND four agent ids, so the meeting assistant silently * did not exist for any app that had not filled in a config line. The * capability is the SERVER's now: if a Mandate has no Holder bound, the * server refuses with a sentence naming the Mandate admin, and that sentence * is what the panel shows. Absence is a fact the server states, never a prop * a host forgot. */ readonly ai: MeetAi; /** * 🚨 THE ONE WAY ANYTHING IN THIS PACKAGE TALKS TO AIDREAM (MRI-A16). Every * request it builds carries `x-organization-id`; a request built any other * way is refused by the org-admission middleware with 400 * `organization_required`, and `core/api.test.ts` fails the build if a second * way appears. Playing a recording — `GET /files/{id}/download` — goes * through here too, which is the defect this replaced. */ readonly api: MeetApi; readonly identity: MeetIdentity; readonly baseUrl: string; /** * The host's session source, as handed to ``. Exposed for the * host's own diagnostics; package code reaches aidream through `api`. */ readonly accessToken: AccessTokenSource; readonly report: (event: MeetDiagnostic) => void; } interface MeetProviderProps { /** * Any Supabase client. `null` while the host is still resolving one. * * 🚨 DELIBERATELY THE SHALLOW SHAPE (0.2.1) — pass the * `SupabaseClient` you already have, with no cast. The rich * internal contract sent tsc into `TS2589` for any host with generated * Supabase types; see `core/repository.ts`'s header for the whole story. */ client: MessagingSupabaseClient | null | undefined; /** aidream's base URL. LiveKit credentials live THERE, never here. */ baseUrl: string; /** * A guest's typed name — and the ONE way to declare the guest lane (D6). * With it, this mount is a link-follower's room: no session is read, no * calling surface is built, and nothing user-scoped is ever issued. Without * it, the acting user is whoever `client`'s session says it is. * * 🚨 There is NO `userId` prop. See this file's header and * `../core/session-identity.ts`. */ guestName?: null | string | undefined; organizationId: null | string | undefined; displayName?: string | undefined; avatarUrl?: null | string | undefined; /** The bearer token source for aidream calls. */ accessToken: AccessTokenSource; /** Swap the media driver. Defaults to LiveKit — there is no reason to. */ driverFactory?: RoomDriverFactory | undefined; /** A call is ringing this device — for a sound, a toast, or a badge. */ onIncomingCall?: ((invite: CallInvite) => void) | undefined; onDiagnostic?: ((event: MeetDiagnostic) => void) | undefined; ringTimeoutMs?: number | undefined; children: ReactNode; } declare function MeetProvider(props: MeetProviderProps): ReactNode; /** The host, or `null` while auth/org are still resolving. */ declare function useMeetHost(): MeetHost | null; declare function useRequiredMeetHost(): MeetHost; /** The whole room snapshot, re-rendering only when it actually changes. */ declare function useMeetSnapshot(): MeetSnapshot | null; declare function useDeviceSnapshot(): DeviceSnapshot | null; /** * 🚨 THE LOCAL PARTICIPANT'S ROLE — THE SERVER'S WORD, FROM BOTH ITS CARRIERS * (MRI-A11, feedback `7418ef78`). * * Two sources, one decision made once in `services/meet/service.py`: * * 1. `snapshot.grants.role` — the `/meet/token` response, in the store from the * instant the token lands, which is BEFORE any LiveKit roster exists. * 2. the local participant's roster entry, whose role comes from the * `matrx.participant.role` LiveKit attribute the same mint published. * * The stronger of the two wins, and both are server-minted, so this can never * be client state: there is no branch here a browser could take on its own. * Reading only (2) is the shipped defect this replaces — a roster entry arrives * a beat later than the token and, before MRI-A11, carried no role at all. */ declare function useRole(): ParticipantRole; /** Does the local participant hold host powers? ONE predicate, one definition. */ declare function useIsHost(): boolean; /** * May the local participant start a recording? NOT `isHost` — the meeting's * recording policy is the server's, and an `always-on` meeting is recorded by * the server with no host control at all (MRI-A11). */ declare function useCanRecord(): boolean; declare function useLocalUserId(): UserId | null; export { MeetProvider as b, useDeviceSnapshot as d, useIsHost as e, useLocalUserId as f, useMeetHost as g, useMeetSnapshot as h, useRequiredMeetHost as i, useRole as j, useCanRecord as u }; export type { MeetHost as M, MeetDiagnostic as a, MeetProviderProps as c };