hci-atrium 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +182 -0
  3. package/dist/atrium.d.ts +522 -0
  4. package/dist/atrium.d.ts.map +1 -0
  5. package/dist/atrium.js +806 -0
  6. package/dist/atrium.js.map +1 -0
  7. package/dist/auth.d.ts +85 -0
  8. package/dist/auth.d.ts.map +1 -0
  9. package/dist/auth.js +369 -0
  10. package/dist/auth.js.map +1 -0
  11. package/dist/by.d.ts +84 -0
  12. package/dist/by.d.ts.map +1 -0
  13. package/dist/by.js +87 -0
  14. package/dist/by.js.map +1 -0
  15. package/dist/decider.d.ts +40 -0
  16. package/dist/decider.d.ts.map +1 -0
  17. package/dist/decider.js +76 -0
  18. package/dist/decider.js.map +1 -0
  19. package/dist/discovery.d.ts +15 -0
  20. package/dist/discovery.d.ts.map +1 -0
  21. package/dist/discovery.js +38 -0
  22. package/dist/discovery.js.map +1 -0
  23. package/dist/env.d.ts +11 -0
  24. package/dist/env.d.ts.map +1 -0
  25. package/dist/env.js +28 -0
  26. package/dist/env.js.map +1 -0
  27. package/dist/errors.d.ts +67 -0
  28. package/dist/errors.d.ts.map +1 -0
  29. package/dist/errors.js +86 -0
  30. package/dist/errors.js.map +1 -0
  31. package/dist/files.d.ts +7 -0
  32. package/dist/files.d.ts.map +1 -0
  33. package/dist/files.js +2 -0
  34. package/dist/files.js.map +1 -0
  35. package/dist/http.d.ts +11 -0
  36. package/dist/http.d.ts.map +1 -0
  37. package/dist/http.js +21 -0
  38. package/dist/http.js.map +1 -0
  39. package/dist/index.d.ts +17 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +14 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/models.d.ts +456 -0
  44. package/dist/models.d.ts.map +1 -0
  45. package/dist/models.js +487 -0
  46. package/dist/models.js.map +1 -0
  47. package/dist/pkce.d.ts +16 -0
  48. package/dist/pkce.d.ts.map +1 -0
  49. package/dist/pkce.js +40 -0
  50. package/dist/pkce.js.map +1 -0
  51. package/dist/react/index.d.ts +37 -0
  52. package/dist/react/index.d.ts.map +1 -0
  53. package/dist/react/index.js +89 -0
  54. package/dist/react/index.js.map +1 -0
  55. package/dist/rooms/armed-set.d.ts +33 -0
  56. package/dist/rooms/armed-set.d.ts.map +1 -0
  57. package/dist/rooms/armed-set.js +65 -0
  58. package/dist/rooms/armed-set.js.map +1 -0
  59. package/dist/rooms/brokers.d.ts +62 -0
  60. package/dist/rooms/brokers.d.ts.map +1 -0
  61. package/dist/rooms/brokers.js +109 -0
  62. package/dist/rooms/brokers.js.map +1 -0
  63. package/dist/rooms/codec.d.ts +100 -0
  64. package/dist/rooms/codec.d.ts.map +1 -0
  65. package/dist/rooms/codec.js +101 -0
  66. package/dist/rooms/codec.js.map +1 -0
  67. package/dist/rooms/index.d.ts +40 -0
  68. package/dist/rooms/index.d.ts.map +1 -0
  69. package/dist/rooms/index.js +45 -0
  70. package/dist/rooms/index.js.map +1 -0
  71. package/dist/rooms/offer-capture.d.ts +96 -0
  72. package/dist/rooms/offer-capture.d.ts.map +1 -0
  73. package/dist/rooms/offer-capture.js +338 -0
  74. package/dist/rooms/offer-capture.js.map +1 -0
  75. package/dist/rooms/offer-transcription.d.ts +63 -0
  76. package/dist/rooms/offer-transcription.d.ts.map +1 -0
  77. package/dist/rooms/offer-transcription.js +231 -0
  78. package/dist/rooms/offer-transcription.js.map +1 -0
  79. package/dist/rooms/participant.d.ts +35 -0
  80. package/dist/rooms/participant.d.ts.map +1 -0
  81. package/dist/rooms/participant.js +53 -0
  82. package/dist/rooms/participant.js.map +1 -0
  83. package/dist/rooms/recorder.d.ts +74 -0
  84. package/dist/rooms/recorder.d.ts.map +1 -0
  85. package/dist/rooms/recorder.js +157 -0
  86. package/dist/rooms/recorder.js.map +1 -0
  87. package/dist/rooms/room.d.ts +542 -0
  88. package/dist/rooms/room.d.ts.map +1 -0
  89. package/dist/rooms/room.js +1357 -0
  90. package/dist/rooms/room.js.map +1 -0
  91. package/dist/rooms/snippet.d.ts +48 -0
  92. package/dist/rooms/snippet.d.ts.map +1 -0
  93. package/dist/rooms/snippet.js +70 -0
  94. package/dist/rooms/snippet.js.map +1 -0
  95. package/dist/rooms/sse.d.ts +102 -0
  96. package/dist/rooms/sse.d.ts.map +1 -0
  97. package/dist/rooms/sse.js +347 -0
  98. package/dist/rooms/sse.js.map +1 -0
  99. package/dist/rooms/standing-source.d.ts +190 -0
  100. package/dist/rooms/standing-source.d.ts.map +1 -0
  101. package/dist/rooms/standing-source.js +431 -0
  102. package/dist/rooms/standing-source.js.map +1 -0
  103. package/dist/rooms/transcriber.d.ts +81 -0
  104. package/dist/rooms/transcriber.d.ts.map +1 -0
  105. package/dist/rooms/transcriber.js +111 -0
  106. package/dist/rooms/transcriber.js.map +1 -0
  107. package/dist/rooms/transport-shared.d.ts +28 -0
  108. package/dist/rooms/transport-shared.d.ts.map +1 -0
  109. package/dist/rooms/transport-shared.js +42 -0
  110. package/dist/rooms/transport-shared.js.map +1 -0
  111. package/dist/rooms/transport.d.ts +161 -0
  112. package/dist/rooms/transport.d.ts.map +1 -0
  113. package/dist/rooms/transport.js +258 -0
  114. package/dist/rooms/transport.js.map +1 -0
  115. package/dist/shaping/assets.d.ts +42 -0
  116. package/dist/shaping/assets.d.ts.map +1 -0
  117. package/dist/shaping/assets.js +77 -0
  118. package/dist/shaping/assets.js.map +1 -0
  119. package/dist/shaping/chat.d.ts +39 -0
  120. package/dist/shaping/chat.d.ts.map +1 -0
  121. package/dist/shaping/chat.js +62 -0
  122. package/dist/shaping/chat.js.map +1 -0
  123. package/dist/shaping/index.d.ts +14 -0
  124. package/dist/shaping/index.d.ts.map +1 -0
  125. package/dist/shaping/index.js +13 -0
  126. package/dist/shaping/index.js.map +1 -0
  127. package/dist/shaping/library.d.ts +84 -0
  128. package/dist/shaping/library.d.ts.map +1 -0
  129. package/dist/shaping/library.js +288 -0
  130. package/dist/shaping/library.js.map +1 -0
  131. package/dist/shaping/request.d.ts +47 -0
  132. package/dist/shaping/request.d.ts.map +1 -0
  133. package/dist/shaping/request.js +25 -0
  134. package/dist/shaping/request.js.map +1 -0
  135. package/dist/shaping/rooms.d.ts +128 -0
  136. package/dist/shaping/rooms.d.ts.map +1 -0
  137. package/dist/shaping/rooms.js +330 -0
  138. package/dist/shaping/rooms.js.map +1 -0
  139. package/dist/shaping/sources.d.ts +29 -0
  140. package/dist/shaping/sources.d.ts.map +1 -0
  141. package/dist/shaping/sources.js +51 -0
  142. package/dist/shaping/sources.js.map +1 -0
  143. package/dist/shaping/structured.d.ts +47 -0
  144. package/dist/shaping/structured.d.ts.map +1 -0
  145. package/dist/shaping/structured.js +115 -0
  146. package/dist/shaping/structured.js.map +1 -0
  147. package/dist/storage.d.ts +36 -0
  148. package/dist/storage.d.ts.map +1 -0
  149. package/dist/storage.js +86 -0
  150. package/dist/storage.js.map +1 -0
  151. package/dist/transcribe-stream.d.ts +81 -0
  152. package/dist/transcribe-stream.d.ts.map +1 -0
  153. package/dist/transcribe-stream.js +253 -0
  154. package/dist/transcribe-stream.js.map +1 -0
  155. package/dist/transcribe.d.ts +57 -0
  156. package/dist/transcribe.d.ts.map +1 -0
  157. package/dist/transcribe.js +267 -0
  158. package/dist/transcribe.js.map +1 -0
  159. package/dist/types.d.ts +20 -0
  160. package/dist/types.d.ts.map +1 -0
  161. package/dist/types.js +3 -0
  162. package/dist/types.js.map +1 -0
  163. package/package.json +56 -0
@@ -0,0 +1,542 @@
1
+ /**
2
+ * The live room handle — pure transport over the room WebSocket. Returned by ``client.rooms.open`` /
3
+ * ``client.rooms.join(code)`` / the loginless {@link joinRoom}. Feature-equivalent to the Python
4
+ * SDK's ``Room`` (rooms.py) + ``AsyncRoom`` (aio.py), but JS needs no sync/async split — there is one
5
+ * API: ``room.on(...)`` registers, ``await room.request(...)`` correlates.
6
+ *
7
+ * Transport: everything rides one WebSocket (``/v1/rooms/{id}/ws``) — text signals *and* the
8
+ * ephemeral binary audio stream. That differs from the Python SDK (SSE receive + a REST ``/signal``
9
+ * POST); it's the extract-from-use path (the Player/tools already speak WS) and the only transport
10
+ * that carries binary. The REST ``/signal`` wire body is still the canonical cross-SDK shape
11
+ * ({@link ../shaping/rooms.buildRoomSignal}); the fields match field-for-field.
12
+ *
13
+ * Correlation (mirror of ``_RoomDispatcher``): dispatch starts with {@link connect}. Each inbound
14
+ * signal routes to the handler registered for its ``type``; a handler's return value is sent back as
15
+ * the response when the signal was a {@link request} (carried an ``ackId``) — so a responder writes
16
+ * no correlation plumbing, it just returns. Pending {@link request}s resolve by ``replyTo``.
17
+ *
18
+ * Durable & reactive surfaces (wave 2): {@link Room.record} bridges the room into a session over an
19
+ * SSE-observe {@link ./recorder.Recorder} (every WS send is ephemeral, so durable capture rides the
20
+ * observe stream); {@link Room.audioVectors} embeds the live snippet stream and {@link Room.audioScores}
21
+ * fuses it against named anchors for a {@link ../decider.Decider}. Still deferred to later waves: the
22
+ * ``offer_embeds`` / ``offer_chat`` broker protocol, and ``offerAudioCapture`` (which will bind to the
23
+ * active recorder via {@link Room.activeRecorders} / {@link Room.onRecordersChanged}).
24
+ */
25
+ import { type AnchorLike, type OperandLike } from "../by.js";
26
+ import type { FileSource } from "../files.js";
27
+ import type { ChatReply, CompareResult, Session, Space, Transcript } from "../models.js";
28
+ import type { ShapedRequest } from "../shaping/index.js";
29
+ import type { AudioChunk, TranscribeStreamOptions } from "../transcribe.js";
30
+ import { type AudioSignal } from "./codec.js";
31
+ import { OfferedCapture } from "./offer-capture.js";
32
+ import { OfferedTranscription } from "./offer-transcription.js";
33
+ import { type Participant, type ParticipantPredicate } from "./participant.js";
34
+ import { Recorder } from "./recorder.js";
35
+ import { type FetchImpl } from "./sse.js";
36
+ import { Transcriber } from "./transcriber.js";
37
+ import { type RoomEndReason, type RosterEntry, type WebSocketCtor } from "./transport.js";
38
+ /** One inbound room signal, camelCased — what a {@link Room.on} handler receives. */
39
+ export interface RoomEvent {
40
+ type: string;
41
+ payload: Record<string, unknown>;
42
+ source: string | null;
43
+ /** The sender's connection id (server-stamped), or ``null`` for a server-emitted signal. */
44
+ from: string | null;
45
+ to: string | string[] | null;
46
+ /** Set when this signal is a request awaiting a reply — return a value from the handler to answer. */
47
+ ackId: string | null;
48
+ /** Set when this signal is a reply — correlates to a {@link Room.request}'s ``ackId``. */
49
+ replyTo: string | null;
50
+ ephemeral: boolean;
51
+ }
52
+ /** A signal handler. A returned value (or resolved promise) answers a {@link Room.request}. */
53
+ export type Handler = (event: RoomEvent) => unknown | Promise<unknown>;
54
+ /** One raw ~10s audio window from {@link Room.audioClips} — the decoded snippet plus its source. */
55
+ export interface AudioClip {
56
+ /** The encoded audio bytes for this window (Opus-in-WebM from a browser producer). */
57
+ data: ArrayBuffer;
58
+ /** The producer's mime type for {@link data} (e.g. ``"audio/webm;codecs=opus"``). */
59
+ mime: string;
60
+ /** Monotonic per-producer counter from 0 — a consumer notices drops/reordering. */
61
+ sequence: number;
62
+ /** Non-overlapping window length in seconds (e.g. 10). */
63
+ windowSeconds: number;
64
+ /** The producer's connection id (a Capture tool's v2 attribution), or ``null`` for a Player (v1). */
65
+ source: string | null;
66
+ /** The producer's announced name, resolved from the roster snapshot **at subscribe time** — so a
67
+ * source that joins *after* this subscribes has ``null`` here until you re-subscribe. */
68
+ sourceName: string | null;
69
+ }
70
+ /** One embedded ~10s audio window from {@link Room.audioVectors} — a live vector of "what the room
71
+ * sounds like right now", embedded in ``space``. Ephemeral (never stored); compare it against your
72
+ * own anchors (concepts, text probes, example assets). Mirror of Python's ``AudioVector``. */
73
+ export interface AudioVector {
74
+ vector: number[];
75
+ space: string;
76
+ sequence: number;
77
+ windowSeconds: number;
78
+ /** Unix seconds (a float) when the vector was computed. */
79
+ timestamp: number;
80
+ }
81
+ /** One {@link Room.audioScores} frame — an {@link AudioVector} fused against named anchors via
82
+ * ``library.compare``. ``scores`` is each anchor's calibrated compare score; ``mix`` normalizes them
83
+ * to sum 1 (uniform when every score is 0, so gate on ``max(scores)`` for silence rather than reading
84
+ * a uniform mix as "all tied"). No smoothing here — ease the stream with a {@link ../decider.Decider}.
85
+ * Mirror of Python's ``ScoredAudio``. */
86
+ export interface ScoredAudio {
87
+ scores: Record<string, number>;
88
+ mix: Record<string, number>;
89
+ vector: number[];
90
+ space: string;
91
+ sequence: number;
92
+ windowSeconds: number;
93
+ timestamp: number;
94
+ }
95
+ /** The slice of the authenticated client a room's embedding surfaces call — injected by
96
+ * ``client.rooms`` for an owned room, and absent for a loginless {@link joinRoom} participant (which
97
+ * has no credentials to embed with). {@link Room.audioVectors} / {@link Room.audioScores} require it. */
98
+ export interface RoomAudioClient {
99
+ embed(opts: {
100
+ model: string;
101
+ text?: string;
102
+ audio?: FileSource;
103
+ format?: string;
104
+ }): Promise<number[]>;
105
+ library: {
106
+ spaces(): Promise<Space[]>;
107
+ compare(a: OperandLike, b: OperandLike, opts?: {
108
+ space?: string;
109
+ }): Promise<CompareResult>;
110
+ };
111
+ request(req: ShapedRequest): Promise<unknown>;
112
+ /** Chat completion — what {@link Room.offerChat} generates a reply with (the broker pins the model). */
113
+ chat(messages: string | Array<{
114
+ role: string;
115
+ content: string;
116
+ }>, opts?: Record<string, unknown>): Promise<ChatReply>;
117
+ /** The shared live-transcription engine — what {@link Room.transcribe} runs the snippet stream
118
+ * through (streaming when the backend offers it, per-clip batch otherwise). */
119
+ transcribeStream(clips: AsyncIterable<AudioChunk>, opts: TranscribeStreamOptions): AsyncIterable<Transcript>;
120
+ }
121
+ /** How a {@link Room} carries text signals: ``"auto"`` prefers the WebSocket and falls back to
122
+ * SSE-receive + POST-send if the WS can't come up (a proxy stripping upgrades); ``"ws"`` / ``"sse"``
123
+ * pin one transport. Binary audio is WS-only regardless. Default ``"auto"``. */
124
+ export type RoomTransportMode = "auto" | "ws" | "sse";
125
+ /** REST metadata + connection deps a {@link Room} is built from. */
126
+ export interface RoomDeps {
127
+ id: string;
128
+ connectCode: string;
129
+ name?: string | null;
130
+ projectId?: string | null;
131
+ /** The instance base URL (http/https). */
132
+ baseUrl: string;
133
+ /** Authenticated REST caller for management (rotate/delete); absent for participants. */
134
+ rest?: (req: ShapedRequest) => Promise<unknown>;
135
+ /** The authenticated client's embedding surfaces — set for an owned room, absent for a loginless
136
+ * participant; what {@link Room.audioVectors} / {@link Room.audioScores} run on. */
137
+ client?: RoomAudioClient;
138
+ /** Stable presence identity (e.g. ``"player:bob"``). */
139
+ identity?: string;
140
+ /** Presence announce metadata peers see on join. */
141
+ announce?: Record<string, unknown>;
142
+ /** Default {@link Room.request} timeout (ms). */
143
+ requestTimeout?: number;
144
+ /** Reconnect on unexpected drop (default true). */
145
+ reconnect?: boolean;
146
+ /** Signal transport preference (default ``"auto"`` — WS, falling back to SSE). */
147
+ transport?: RoomTransportMode;
148
+ /** Injected ``WebSocket`` constructor — the test seam. */
149
+ WebSocketCtor?: WebSocketCtor;
150
+ /** Injected ``fetch`` for the SSE transport / roster reads — the test seam. */
151
+ fetchImpl?: FetchImpl;
152
+ /** Aborting this closes the room. */
153
+ signal?: AbortSignal;
154
+ }
155
+ /** A random opaque id (a UUID with dashes stripped, else a time-seeded fallback) — request ack ids
156
+ * and dedicated-consumer socket identities. Shared with the standing offers ({@link ./standing-source}). */
157
+ export declare function randomId(): string;
158
+ export declare class Room {
159
+ readonly id: string;
160
+ connectCode: string;
161
+ name: string | null;
162
+ readonly projectId: string | null;
163
+ private readonly deps;
164
+ private socket;
165
+ private usingSse;
166
+ private connectPromise;
167
+ private readonly handlers;
168
+ private readonly anyHandlers;
169
+ private readonly pending;
170
+ private ended;
171
+ private readonly endListeners;
172
+ private readonly audioSubscribers;
173
+ private audioSocket;
174
+ private readonly layerWatchers;
175
+ private readonly recorders;
176
+ private readonly recorderListeners;
177
+ private readonly transcribers;
178
+ private readonly offeredServices;
179
+ private readonly brokerRoles;
180
+ constructor(deps: RoomDeps);
181
+ /** The server-assigned connection id, or ``null`` before {@link connect} settles. */
182
+ get connectionId(): string | null;
183
+ /** The live participant roster (excludes self), from the ``ready`` snapshot + presence deltas —
184
+ * the raw {@link RosterEntry} view. For the parsed, query-friendly {@link Participant} (merged
185
+ * ``roles`` / ``name`` / ``connectedAt``) use {@link participants} / {@link has}. */
186
+ get presence(): RosterEntry[];
187
+ /** Open the live socket and start dispatch; resolves once the server's ``ready`` frame arrives.
188
+ * Idempotent — safe to call repeatedly, and every wire method calls it for you. */
189
+ connect(): Promise<void>;
190
+ private startSocket;
191
+ private makeSse;
192
+ private handleEnd;
193
+ /** Register a handler for one signal type. The handler's return value auto-replies to a
194
+ * {@link request} (a signal carrying an ``ackId``) — so a responder just returns. */
195
+ on(type: string, handler: Handler): this;
196
+ /** Register a catch-all observer invoked for **every** inbound signal (replies included) — the
197
+ * parity for a raw `receive()` loop (logging, inspection). Observers never auto-reply. Returns an
198
+ * unsubscribe function. */
199
+ onAny(handler: (event: RoomEvent) => void): () => void;
200
+ /** Register a callback for a **terminal** room end — the connection stopped for good with a typed
201
+ * {@link RoomEndReason} (``"code-rotated"`` / ``"bad-code"`` / ``"room-gone"``), on either the WS or
202
+ * SSE transport and whether the end is rejected at connect time or happens mid-session. Fires
203
+ * **exactly once** per handle; a deliberate {@link close} is not an end and never fires it. Returns
204
+ * an unsubscribe function. The typed reason is what a driver maps to its own UI state instead of
205
+ * string-matching a request's reject message. Register before {@link connect} to catch a connect-time
206
+ * reject. Python owes the port (``on_end``). */
207
+ onEnd(cb: (reason: RoomEndReason) => void): () => void;
208
+ /** Send a live message — fire-and-forget, never stored. ``to`` (a connection id/identity, or a
209
+ * list) targets peers; omit it to broadcast to everyone else. (``ephemeral`` is accepted for
210
+ * parity, but the WS inbound path forces ``ephemeral: false`` server-side.) */
211
+ send(type: string, payload?: Record<string, unknown>, opts?: {
212
+ to?: string | string[];
213
+ ephemeral?: boolean;
214
+ }): Promise<void>;
215
+ /** Send a request and await one reply (a peer's handler return). ``to`` targets one peer; omit it
216
+ * to broadcast — first matching reply wins. Rejects if no reply arrives within the timeout. */
217
+ request(type: string, payload?: Record<string, unknown>, opts?: {
218
+ to?: string;
219
+ timeout?: number;
220
+ }): Promise<Record<string, unknown>>;
221
+ private handleSignal;
222
+ private handleAudioBinary;
223
+ private dispatchAudio;
224
+ private onReady;
225
+ /**
226
+ * Subscribe to the room's audio-signal stream — the continuous binary loudness/spectrum frames
227
+ * plus the ``audio.track`` / ``audio.beat`` / ``audio.announce`` text signals a hosted Player (or
228
+ * any producer) broadcasts. The callback receives a discriminated {@link AudioSignal}; switch on
229
+ * ``.kind``. The first subscriber opens a dedicated socket that announces ``role: audio-consumer``
230
+ * (a producer's broadcast gate) and sends an ``audio.discover`` on every (re)connect; the last
231
+ * unsubscribe closes it, releasing demand. Returns an unsubscribe function.
232
+ */
233
+ audioSignals(callback: (signal: AudioSignal) => void): () => void;
234
+ private openAudioSocket;
235
+ /** Refuse fast if this handle latched onto the SSE transport (the WS upgrade wasn't reachable) —
236
+ * binary audio is WS-only, so a doomed WS reconnect would otherwise spin forever. Consulted by every
237
+ * audio consumer AND, via {@link offerDeps}, every standing offer, so signals and audio stay coherent
238
+ * about the environment. Throws {@link AtriumError}. When the transport isn't yet decided (the main
239
+ * socket hasn't connected), it proceeds — the offers, which engage over an already-live signal
240
+ * channel, always see the settled decision. */
241
+ private requireWsAudio;
242
+ /**
243
+ * Subscribe to the room's raw ``audio.snippet`` stream — the ~10s Opus windows a Player (v1) or a
244
+ * Capture tool (v2) shares — as an async iterator of {@link AudioClip}s. The rawest audio consumer:
245
+ * where a later ``audioVectors`` embeds and ``audioTranscripts`` transcribes, this hands you the
246
+ * bytes. Subscribing *is* the demand signal (it announces the ``audio-snippet-consumer`` role, so a
247
+ * producer's own default-off "Share audio clips" toggle actually captures). Break out of the
248
+ * ``for await`` loop (or ``return``) to end the subscription and close the socket.
249
+ *
250
+ * ``sourceName`` is resolved from the roster snapshot **at subscribe time**, so a producer that
251
+ * joins *after* this subscribes has ``null`` there until you re-subscribe (mirror of Python's
252
+ * ``audio_clips``). Binary rides the WebSocket only — a room latched to the SSE fallback throws.
253
+ */
254
+ audioClips(): AsyncGenerator<AudioClip>;
255
+ /**
256
+ * Start capturing this room's live signals into a durable ``session`` — the single durable binding
257
+ * between a room (pure transport) and a session (an append-only log). A **side effect**: it starts
258
+ * immediately in the background and returns a live {@link Recorder} handle. Stop it with
259
+ * ``rec.stop()``, or let {@link close} (an ``await using`` room) stop it. It skips ``ephemeral``
260
+ * signals and presence traffic — only durable-worthy signals are recorded, each stamped with
261
+ * ``via`` provenance (``{ room_id, room_name, from, to }``). Mirror of Python's ``room.record``.
262
+ *
263
+ * A dropped stream reconnects with backoff (the gap is lost — rooms have no replay); only a
264
+ * terminal end stops it cleanly with a {@link Recorder.stoppedReason} (a code rotation, or the
265
+ * room being gone / its code rejected — the latter also sets {@link Recorder.error}). Needs an
266
+ * owned room (durable sessions require an account) — throws on a loginless {@link joinRoom} handle.
267
+ */
268
+ record(into: Session): Recorder;
269
+ /** The recorders currently running on this handle (membership **and** liveness — a stopped one no
270
+ * longer counts) — the source of truth a wave-4 ``offerAudioCapture`` reads for audio-capture
271
+ * availability, and binds its capture to the first active recorder's session. */
272
+ activeRecorders(): Recorder[];
273
+ /** Register a listener fired whenever the active-recorder set changes (a {@link record} started, or
274
+ * a recorder stopped/terminated) — the seam a wave-4 ``offerAudioCapture`` binds to, so it can
275
+ * re-derive availability and disengage when the recorder it wrote under is gone. Returns an
276
+ * unsubscribe function. Mirror of Python's ``_notify_recorders_changed`` registration. */
277
+ onRecordersChanged(listener: () => void | Promise<void>): () => void;
278
+ private notifyRecordersChanged;
279
+ /**
280
+ * Transcribe this room's live audio into ``transcript.*`` signals — the in-room broker. Consumes the
281
+ * room's ``audio.snippet`` stream (announcing the snippet-consumer role, so a Player starts
282
+ * capturing), pushes it through the same engine as {@link ../atrium.Atrium.transcribeLive} on
283
+ * **your** credentials/compute, and publishes back:
284
+ *
285
+ * * ``transcript.partial`` — ``{ text }``, **ephemeral** (a live caption the recorder skips).
286
+ * Wholesale-replaced — render the latest, don't append.
287
+ * * ``transcript.final`` — ``{ text, start, end, seq }``, durable (the {@link record} bridge persists
288
+ * it — no new recording API). ``seq`` is a per-handle counter from 0; the signal's ``source`` is
289
+ * ``"transcriber"``.
290
+ *
291
+ * Any consumer — including a loginless code-joined tool — just does ``room.on("transcript.final")``.
292
+ * Like {@link record}, it's a **side effect**: it starts immediately in the background and is stopped
293
+ * when the room closes, or via ``await handle.stop()`` / ``await using``. Needs an owned room
294
+ * (transcription runs on an account credential) — throws on a loginless {@link joinRoom} handle.
295
+ */
296
+ transcribe(opts?: {
297
+ model?: string;
298
+ language?: string;
299
+ }): Transcriber;
300
+ private snippetBytesFor;
301
+ /** Merge the registered broker/offer roles into the presence announce (mirror of Python's
302
+ * ``_events_params``) — so registering a broker before ``connect()`` rides the first connection. */
303
+ private mergedAnnounce;
304
+ private announceRole;
305
+ private requirePreConnect;
306
+ /** The single capability-injection guard — the authed client slice (embed / chat / compare /
307
+ * transcribe) an owned room carries and a loginless ``join(code)`` handle lacks. Always throws
308
+ * {@link AtriumError} (never a bare ``Error``), so every SDK refusal is catchable under the one
309
+ * hierarchy. ``feature`` names the surface for the message. */
310
+ private requireClient;
311
+ private offerDeps;
312
+ private offerService;
313
+ /**
314
+ * Offer live transcription as a peer-toggleable standing service — a code-joined tool turns it on
315
+ * with a ``transcription.start`` request and off with ``transcription.stop`` (both idempotent).
316
+ * Announces the discoverable ``transcription-offer`` role. **Scoped, multi-source**: ``start`` /
317
+ * ``stop`` are scoped to the requesting connection unless the payload carries ``{ all: true }``;
318
+ * only armed sources are transcribed (up to ``maxSources``, default 8). While on it runs the same
319
+ * engine as {@link transcribe} on **your** credentials, publishing source-attributed ``transcript.*``
320
+ * signals. Register **before** ``connect()``; needs an owned room (throws on a loginless handle).
321
+ * Returns the handle (for ``handle.start({ all: true })`` from the host). Mirror of Python's
322
+ * ``offer_transcription``.
323
+ */
324
+ offerTranscription(opts?: {
325
+ model?: string;
326
+ language?: string;
327
+ maxSources?: number;
328
+ }): OfferedTranscription;
329
+ /**
330
+ * Offer audio capture as a peer-toggleable standing service — **session-less**: it writes into the
331
+ * **active recorder's** session ({@link record} is the single durable binding), so a ``capture.start``
332
+ * with no active recorder replies an error. A code-joined tool toggles it via ``capture.start`` /
333
+ * ``capture.stop`` (idempotent). Announces the discoverable ``capture-offer`` role. **Scoped,
334
+ * multi-source** (up to ``maxSources``, default 8): only armed sources are recorded; a same-name
335
+ * reconnect within grace resumes one file, two simultaneous same-name producers get their own files.
336
+ * Register **before** ``connect()``; needs an owned room (throws on a loginless handle). Returns the
337
+ * handle (for ``handle.start({ all: true })``). Mirror of Python's ``offer_audio_capture``.
338
+ */
339
+ offerAudioCapture(opts?: {
340
+ maxSources?: number;
341
+ }): OfferedCapture;
342
+ private resolveEmbedSpace;
343
+ private resolveAnchorVector;
344
+ /**
345
+ * Handle ``embed.resolve`` requests from code-joined peers (e.g. a loginless Unity scene) — resolve
346
+ * named operand descriptors (``{ text }`` / ``{ concept, collection? }`` / ``{ vector }`` /
347
+ * ``{ asset, match_by? }``) to vectors in ONE embedding space, so a peer with no credentials can
348
+ * compare live signals against library concepts/text/assets. **The requester chooses the space**
349
+ * (omitted → the default text space). A per-anchor
350
+ * failure lands in ``errors`` without failing the others; a malformed / over-``maxAnchors`` request
351
+ * or a ``space`` outside ``spaces`` gets a whole-request ``{ error }``. Announces the discoverable
352
+ * ``embed-broker`` role — call before ``connect()``. Mirror of Python's ``offer_embeds``.
353
+ */
354
+ offerEmbeds(opts?: {
355
+ spaces?: string[];
356
+ maxAnchors?: number;
357
+ }): void;
358
+ /**
359
+ * Handle ``chat.generate`` requests from code-joined peers — a stateless chat completion (no history
360
+ * broker-side), so a loginless peer gets an LLM reply without its own credentials. Reply:
361
+ * ``{ text, model }``, or ``{ error }`` if ``messages`` is malformed / over the payload cap. The
362
+ * **broker** pins ``model`` (the requester cannot choose it — cost control); ``maxTokens`` caps each
363
+ * reply. Announces the discoverable ``chat-broker`` role — call before ``connect()``. Every peer
364
+ * holding the connect code can trigger a reply on **your** billing. Mirror of Python's ``offer_chat``.
365
+ */
366
+ offerChat(opts?: {
367
+ model?: string;
368
+ maxTokens?: number;
369
+ }): void;
370
+ private resolveAudioSpace;
371
+ private snippetStream;
372
+ /**
373
+ * Subscribe to the room's live ``audio.snippet`` stream and embed each ~10s window, yielding an
374
+ * {@link AudioVector} per snippet — a live vector of "what the room sounds like right now".
375
+ * Subscribing *is* the demand signal (announces the ``audio-snippet-consumer`` role, so a
376
+ * producer's default-off "Share audio clips" toggle actually captures). Break out of the
377
+ * ``for await`` loop to end it. Mirror of Python's ``audio_vectors``.
378
+ *
379
+ * ``space`` pins the search space snippets are labeled with (default: the deployment's default
380
+ * audio space, so a no-arg vector is comparable against library-derived vectors); ``model`` the
381
+ * embedding model (default: the resolved space's configured model). ``relay: true`` also relays
382
+ * each vector into the room as an ephemeral ``audio.vector`` signal — so a loginless code-joined
383
+ * peer can consume the live mood vector without credentials of its own. Needs an authenticated
384
+ * client to embed with (throws on a loginless handle); binary rides the WebSocket only.
385
+ */
386
+ audioVectors(opts?: {
387
+ space?: string;
388
+ model?: string;
389
+ relay?: boolean;
390
+ }): AsyncGenerator<AudioVector>;
391
+ private preflightConceptAnchors;
392
+ /**
393
+ * Fuse {@link audioVectors} with per-anchor ``library.compare`` scoring — a live "which anchor does
394
+ * the room sound like right now" signal. ``anchors`` maps a name to anything the ``by`` grammar
395
+ * accepts (a bare string / {@link "../by".Asset} / ``by.*`` marker), **or an array** of those (a
396
+ * few-shot category, scored as the mean of its top-``topN`` members' calibrated compare scores;
397
+ * default ``topN: 1`` — the nearest member wins). Each frame's anchors are scored concurrently.
398
+ *
399
+ * Each {@link ScoredAudio} carries the calibrated ``scores`` plus ``mix`` (normalized to sum 1,
400
+ * uniform when every score is 0 — gate on ``max(scores)`` for silence). No smoothing — ease the
401
+ * stream with a {@link ../decider.Decider}. ``relay: true`` forwards to {@link audioVectors} (it
402
+ * relays the raw ``audio.vector``, not the computed scores). Concept anchors are validated once up
403
+ * front (a typo raises before any frame); a mid-stream compare failure re-throws named by anchor.
404
+ * Mirror of Python's ``audio_scores``.
405
+ */
406
+ audioScores(anchors: Record<string, AnchorLike>, opts?: {
407
+ space?: string;
408
+ model?: string;
409
+ topN?: number;
410
+ relay?: boolean;
411
+ }): AsyncGenerator<ScoredAudio>;
412
+ /**
413
+ * The room's current presence roster as typed {@link Participant}s (merged ``roles`` / ``name`` /
414
+ * ``connectedAt`` as a ``Date``). Opens one short **observe** SSE stream, reads the roster off its
415
+ * first ``ready`` frame, and closes — a per-web-worker, best-effort snapshot (mirror of Python's
416
+ * ``participants()``). Rejects if the stream is refused (a 4xx — room deleted, or a bad code).
417
+ */
418
+ participants(): Promise<Participant[]>;
419
+ /**
420
+ * Is any current participant matching the given predicate connected? Sugar over
421
+ * {@link participants} (same best-effort per-worker caveat). Give at least one of ``role`` /
422
+ * ``name`` / ``identityPrefix`` — several are ANDed; ``role`` matches the merged roles, ``name``
423
+ * the announced name exactly, ``identityPrefix`` the identity's leading segment (a hosted Player
424
+ * announces ``player:web``, so ``{ identityPrefix: "player:" }`` is the launch-once guard). Throws
425
+ * if no predicate is given (mirror of Python's ``has()``).
426
+ */
427
+ has(pred: ParticipantPredicate): Promise<boolean>;
428
+ /** Play a sound (or several) on a layer — the one playback verb. Per-sound options (``effects``,
429
+ * ``spatial`` — including its optional ``distance`` attenuation — ``delay_seconds``, ``loop`` …)
430
+ * ride a hand-rolled track dict and pass through untouched. */
431
+ play(source: unknown, opts?: {
432
+ layer?: string;
433
+ mode?: "oneshot" | "queue";
434
+ transition?: "now" | "after_current" | "queued";
435
+ repeat?: boolean;
436
+ shuffle?: boolean;
437
+ }): Promise<void>;
438
+ /** Declare (or replace) the Player's layer set — idempotent. */
439
+ configureLayers(layers: Array<Record<string, unknown>>): Promise<void>;
440
+ /** Fade out and empty a layer — its queue and one-shots (omit ``layer`` → ``"default"``). */
441
+ clearLayer(opts?: {
442
+ layer?: string;
443
+ fadeOutMs?: number;
444
+ }): Promise<void>;
445
+ /** Fade out and empty **every** layer at once — "stop all audio" (the ``"*"`` wildcard). */
446
+ clearAll(opts?: {
447
+ fadeOutMs?: number;
448
+ }): Promise<void>;
449
+ /** Set (or ramp) a layer's effects, e.g. ``{ lowpass: { hz: 700 } }`` for a backroom muffle.
450
+ * ``lowpass`` / ``highpass`` / ``reverb`` / ``echo`` are all live (an absent implemented key ramps
451
+ * back to neutral); ``layer`` may be ``"*"`` to apply to every existing layer. */
452
+ setLayerEffects(layer: string, effects: Record<string, unknown>, opts?: {
453
+ fadeMs?: number;
454
+ }): Promise<void>;
455
+ /** Set (or ramp) a layer's HRTF position — placed whole-layer in 3D over ``fadeMs`` (default 50ms
456
+ * to avoid zipper noise, applied Player-side). ``z`` defaults to 0. ``distance`` opts into distance
457
+ * attenuation (``{ model, ref, max, rolloff }``); absent → direction-only. No ``"*"`` wildcard. */
458
+ setLayerPosition(layer: string, x: number, y: number, z?: number, opts?: {
459
+ fadeMs?: number;
460
+ distance?: Record<string, unknown>;
461
+ }): Promise<void>;
462
+ /** Pull the Player's current layer state (a broadcast request; first Player to reply wins). */
463
+ queryLayers(opts?: {
464
+ timeout?: number;
465
+ }): Promise<Record<string, unknown>>;
466
+ /**
467
+ * Subscribe to the Player's live layer state, invoking ``callback`` with each ``{ layers }``
468
+ * snapshot the Player pushes (every meaningful change + a ~1s heartbeat while playing). Demand-
469
+ * gated: the Player only broadcasts while a subscriber is present. Returns an unsubscribe function
470
+ * that sends ``layer.unsubscribe``.
471
+ */
472
+ watchLayers(callback: (layers: Record<string, unknown>) => void): () => void;
473
+ /** The hosted Player's launch URL for this room (``<base>/tools/player?code=<code>``). Pure. */
474
+ playerUrl(opts?: {
475
+ analysis?: boolean;
476
+ clips?: boolean;
477
+ }): string;
478
+ /**
479
+ * Show an image on the Viewer — the one display verb. Give exactly one of ``assetId`` (a stored
480
+ * asset) or ``url`` (any reachable image); passing both, or neither, throws. ``caption`` labels
481
+ * the frame; ``projection`` (``"flat"`` for a plain image, ``"360"`` for an equirectangular
482
+ * panorama) forces how the Viewer renders it — omit it and the Viewer's own default applies. See
483
+ * ``docs/reference/viewer-dialect.md``.
484
+ */
485
+ show(opts?: {
486
+ assetId?: string;
487
+ url?: string;
488
+ caption?: string;
489
+ projection?: "flat" | "360";
490
+ }): Promise<void>;
491
+ /** Clear the Viewer — blank the frame (the ``show.clear`` verb, empty body). */
492
+ clearView(): Promise<void>;
493
+ /** The hosted Viewer's launch URL for this room (``<base>/tools/viewer?code=<code>``). Pure. The
494
+ * Viewer defaults to auto-turn on; ``autoTurn`` bakes its persistent preference into the URL as
495
+ * ``autoturn=1``/``0`` (omitted → the Viewer's stored/default preference applies). */
496
+ viewerUrl(opts?: {
497
+ autoTurn?: boolean;
498
+ }): string;
499
+ /** The observation dashboard's launch URL (``<base>/tools/dashboard?code=<code>``). Pure — the
500
+ * dashboard takes only the connect code (mirror of Python's ``dashboard_url``). */
501
+ dashboardUrl(): string;
502
+ /** Open the observation dashboard for this room in a browser tab. Always opens — it does not check
503
+ * presence. Throws outside a browser (there is no tab to open). */
504
+ openDashboard(): void;
505
+ /** The Capture tool's launch URL for this room (``<base>/tools/capture?code=<code>``). Pure.
506
+ * ``name`` prefills the participant name field; ``captions`` / ``save`` pre-engage the "Live
507
+ * captions" / "Save recording" toggles (emitted only when truthy — else the tool's own default
508
+ * applies). Mirror of Python's ``capture_url``. */
509
+ captureUrl(opts?: {
510
+ name?: string;
511
+ captions?: boolean;
512
+ save?: boolean;
513
+ }): string;
514
+ /** Open the Capture tool for this room in a browser tab (see {@link captureUrl}). Always opens —
515
+ * it does not check presence. Throws outside a browser (there is no tab to open). */
516
+ openCapture(opts?: {
517
+ name?: string;
518
+ captions?: boolean;
519
+ save?: boolean;
520
+ }): void;
521
+ private toolBase;
522
+ private rest;
523
+ /** Rotate the connect code (owner only); updates ``connectCode`` and returns it. */
524
+ rotateCode(): Promise<string>;
525
+ /** Delete the room for good (its connect code dies with it). */
526
+ delete(): Promise<void>;
527
+ /** Disconnect the socket, stop dispatch, and fail any in-flight requests — the fire-and-forget
528
+ * teardown. Idempotent. The synchronous state (sockets closed, requests failed, listeners cleared)
529
+ * settles at once; the standing offers' async wind-down (**including finalizing their open
530
+ * recordings**) and the transcribers' stop run in the background. To *await* that finalize — so a
531
+ * process exit can't drop it — use {@link closeAndFinalize} / ``await using room``. */
532
+ close(): void;
533
+ /** Await the full teardown end-to-end — every recorder/transcriber stopped and every standing offer
534
+ * wound down **with its open recordings finalized** — mirroring Python's awaited ``async with room``
535
+ * exit. Idempotent; ``await using room`` calls this. Prefer it over {@link close} when the offers'
536
+ * finalize POSTs must land before the process moves on. */
537
+ closeAndFinalize(): Promise<void>;
538
+ private teardown;
539
+ [Symbol.dispose]: () => void;
540
+ [Symbol.asyncDispose]: () => Promise<void>;
541
+ }
542
+ //# sourceMappingURL=room.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"room.d.ts","sourceRoot":"","sources":["../../src/rooms/room.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAoB,KAAK,WAAW,EAAmB,MAAM,UAAU,CAAA;AAE/F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACxF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAUxD,OAAO,KAAK,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAY3E,OAAO,EAKL,KAAK,WAAW,EAGjB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OA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