@soulcraft/sdk 1.0.0 → 1.2.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 (112) hide show
  1. package/dist/client/index.d.ts +3 -0
  2. package/dist/client/index.d.ts.map +1 -1
  3. package/dist/client/index.js +2 -0
  4. package/dist/client/index.js.map +1 -1
  5. package/dist/index.d.ts +7 -6
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/modules/auth/service-token.d.ts +62 -0
  10. package/dist/modules/auth/service-token.d.ts.map +1 -0
  11. package/dist/modules/auth/service-token.js +99 -0
  12. package/dist/modules/auth/service-token.js.map +1 -0
  13. package/dist/modules/billing/firestore-provider.d.ts +60 -0
  14. package/dist/modules/billing/firestore-provider.d.ts.map +1 -0
  15. package/dist/modules/billing/firestore-provider.js +314 -0
  16. package/dist/modules/billing/firestore-provider.js.map +1 -0
  17. package/dist/modules/billing/index.d.ts +58 -0
  18. package/dist/modules/billing/index.d.ts.map +1 -0
  19. package/dist/modules/billing/index.js +164 -0
  20. package/dist/modules/billing/index.js.map +1 -0
  21. package/dist/modules/billing/local-provider.d.ts +38 -0
  22. package/dist/modules/billing/local-provider.d.ts.map +1 -0
  23. package/dist/modules/billing/local-provider.js +242 -0
  24. package/dist/modules/billing/local-provider.js.map +1 -0
  25. package/dist/modules/billing/portal-provider.d.ts +70 -0
  26. package/dist/modules/billing/portal-provider.d.ts.map +1 -0
  27. package/dist/modules/billing/portal-provider.js +204 -0
  28. package/dist/modules/billing/portal-provider.js.map +1 -0
  29. package/dist/modules/billing/types.d.ts +323 -3
  30. package/dist/modules/billing/types.d.ts.map +1 -1
  31. package/dist/modules/billing/types.js +22 -2
  32. package/dist/modules/billing/types.js.map +1 -1
  33. package/dist/modules/billing/usage-buffer.d.ts +72 -0
  34. package/dist/modules/billing/usage-buffer.d.ts.map +1 -0
  35. package/dist/modules/billing/usage-buffer.js +141 -0
  36. package/dist/modules/billing/usage-buffer.js.map +1 -0
  37. package/dist/modules/formats/types.d.ts +65 -3
  38. package/dist/modules/formats/types.d.ts.map +1 -1
  39. package/dist/modules/formats/types.js +40 -3
  40. package/dist/modules/formats/types.js.map +1 -1
  41. package/dist/modules/formats/wdoc.d.ts +263 -0
  42. package/dist/modules/formats/wdoc.d.ts.map +1 -0
  43. package/dist/modules/formats/wdoc.js +21 -0
  44. package/dist/modules/formats/wdoc.js.map +1 -0
  45. package/dist/modules/formats/wquiz.d.ts +122 -0
  46. package/dist/modules/formats/wquiz.d.ts.map +1 -0
  47. package/dist/modules/formats/wquiz.js +23 -0
  48. package/dist/modules/formats/wquiz.js.map +1 -0
  49. package/dist/modules/formats/wslide.d.ts +130 -0
  50. package/dist/modules/formats/wslide.d.ts.map +1 -0
  51. package/dist/modules/formats/wslide.js +23 -0
  52. package/dist/modules/formats/wslide.js.map +1 -0
  53. package/dist/modules/formats/wviz.d.ts +114 -0
  54. package/dist/modules/formats/wviz.d.ts.map +1 -0
  55. package/dist/modules/formats/wviz.js +21 -0
  56. package/dist/modules/formats/wviz.js.map +1 -0
  57. package/dist/modules/hall/browser.d.ts +88 -0
  58. package/dist/modules/hall/browser.d.ts.map +1 -0
  59. package/dist/modules/hall/browser.js +265 -0
  60. package/dist/modules/hall/browser.js.map +1 -0
  61. package/dist/modules/hall/protocol.d.ts +39 -0
  62. package/dist/modules/hall/protocol.d.ts.map +1 -0
  63. package/dist/modules/hall/protocol.js +52 -0
  64. package/dist/modules/hall/protocol.js.map +1 -0
  65. package/dist/modules/hall/server.d.ts +172 -0
  66. package/dist/modules/hall/server.d.ts.map +1 -0
  67. package/dist/modules/hall/server.js +457 -0
  68. package/dist/modules/hall/server.js.map +1 -0
  69. package/dist/modules/hall/types.d.ts +502 -31
  70. package/dist/modules/hall/types.d.ts.map +1 -1
  71. package/dist/modules/hall/types.js +13 -8
  72. package/dist/modules/hall/types.js.map +1 -1
  73. package/dist/modules/kits/index.d.ts +41 -0
  74. package/dist/modules/kits/index.d.ts.map +1 -0
  75. package/dist/modules/kits/index.js +85 -0
  76. package/dist/modules/kits/index.js.map +1 -0
  77. package/dist/modules/kits/types.d.ts +107 -3
  78. package/dist/modules/kits/types.d.ts.map +1 -1
  79. package/dist/modules/kits/types.js +15 -2
  80. package/dist/modules/kits/types.js.map +1 -1
  81. package/dist/modules/license/index.d.ts +53 -0
  82. package/dist/modules/license/index.d.ts.map +1 -0
  83. package/dist/modules/license/index.js +233 -0
  84. package/dist/modules/license/index.js.map +1 -0
  85. package/dist/modules/license/types.d.ts +222 -3
  86. package/dist/modules/license/types.d.ts.map +1 -1
  87. package/dist/modules/license/types.js +21 -2
  88. package/dist/modules/license/types.js.map +1 -1
  89. package/dist/modules/notifications/index.d.ts +40 -0
  90. package/dist/modules/notifications/index.d.ts.map +1 -0
  91. package/dist/modules/notifications/index.js +280 -0
  92. package/dist/modules/notifications/index.js.map +1 -0
  93. package/dist/modules/notifications/types.d.ts +152 -3
  94. package/dist/modules/notifications/types.d.ts.map +1 -1
  95. package/dist/modules/notifications/types.js +21 -2
  96. package/dist/modules/notifications/types.js.map +1 -1
  97. package/dist/server/create-sdk.d.ts +4 -0
  98. package/dist/server/create-sdk.d.ts.map +1 -1
  99. package/dist/server/create-sdk.js +19 -26
  100. package/dist/server/create-sdk.js.map +1 -1
  101. package/dist/server/hall-handlers.d.ts +90 -151
  102. package/dist/server/hall-handlers.d.ts.map +1 -1
  103. package/dist/server/hall-handlers.js +84 -204
  104. package/dist/server/hall-handlers.js.map +1 -1
  105. package/dist/server/index.d.ts +10 -2
  106. package/dist/server/index.d.ts.map +1 -1
  107. package/dist/server/index.js +9 -2
  108. package/dist/server/index.js.map +1 -1
  109. package/dist/types.d.ts +35 -25
  110. package/dist/types.d.ts.map +1 -1
  111. package/docs/USAGE.md +224 -1
  112. package/package.json +13 -5
@@ -1,56 +1,527 @@
1
1
  /**
2
2
  * @module modules/hall/types
3
- * @description Hall module types for @soulcraft/sdk.
3
+ * @description Types for the sdk.hall namespace — the Soulcraft real-time communication layer.
4
4
  *
5
- * Re-exports the full public API surface of @soulcraft/hall (HallServer, Room, and all
6
- * supporting types) so consumers only need to import from @soulcraft/sdk.
5
+ * Hall is a standalone Rust server at `hall.soulcraft.com`. It handles WebRTC SFU
6
+ * (video/audio/data channels), in-process Whisper ASR transcription, BERT concept
7
+ * matching, RFC 6464 speaker detection, and per-track MKV recording.
7
8
  *
8
- * The HallModule interface defines the sdk.hall namespace exposed on SoulcraftSDK.
9
- * Hall is server-only — the HallServer runs in-process with the product backend,
10
- * and the SDK provides handler factories that products mount as WebSocket routes.
9
+ * The `sdk.hall` namespace has two faces depending on context:
11
10
  *
12
- * @see createHallRoomHandler in @soulcraft/sdk/server for the signaling handler.
13
- * @see @soulcraft/hall for the NAPI implementation.
11
+ * **Server mode** (`@soulcraft/sdk/server`) the product backend (Academy, Workshop, Venue)
12
+ * connects to Hall with a shared secret, creates rooms, and mints short-lived session tokens.
13
+ * Use `createHallModule(options)` from `@soulcraft/sdk/server`.
14
+ *
15
+ * **Client mode** (`@soulcraft/sdk/client`) — a browser kit app joins a room using a session
16
+ * token issued by the product backend. Use `HallRoomClient` from `@soulcraft/sdk/client`.
17
+ *
18
+ * Products never pass their shared secret to the browser. The token is the only browser credential.
19
+ */
20
+ /**
21
+ * Options for the server-side Hall connection (product backend → Hall server).
22
+ */
23
+ export interface HallConnectionOptions {
24
+ /** WebSocket URL of the Hall server (e.g. `"wss://hall.soulcraft.com"`). */
25
+ url: string;
26
+ /**
27
+ * Product name as configured in `[auth.products]` in `hall.toml`.
28
+ * e.g. `"academy"`, `"workshop"`, `"venue"`.
29
+ */
30
+ productName: string;
31
+ /**
32
+ * Shared secret for this product, set via `HALL_<PRODUCT>_SECRET` env var.
33
+ * Must match the value in `[auth.products.<productName>]` in `hall.toml`.
34
+ * Never expose this to browsers.
35
+ */
36
+ secret: string;
37
+ /**
38
+ * Milliseconds to wait before a reconnect attempt after an unexpected disconnect.
39
+ * Set to 0 to disable auto-reconnect. Default: 2000.
40
+ */
41
+ reconnectDelayMs?: number;
42
+ }
43
+ /**
44
+ * A workspace concept node passed to Hall for in-process BERT concept matching.
45
+ * Hall embeds concept names and detects mentions in the Whisper transcript.
46
+ */
47
+ export interface ConceptInput {
48
+ /** Brainy entity ID of the concept node. */
49
+ nodeId: string;
50
+ /** Human-readable concept name (embedded for BERT similarity matching). */
51
+ name: string;
52
+ /** Brainy NounType (e.g. `"skill"`, `"concept"`, `"process"`). */
53
+ nounType: string;
54
+ /** Kit-defined subtype, if any. */
55
+ subtype?: string;
56
+ }
57
+ /** Options for creating a room. All fields are optional with safe defaults. */
58
+ export interface RoomOptions {
59
+ /** Maximum peers before the SFU stops accepting new connections (default: 30). */
60
+ maxPeers?: number;
61
+ /**
62
+ * Enable in-process Whisper ASR transcription and BERT concept matching.
63
+ * Default: true. Disable to reduce CPU usage when transcription is not needed.
64
+ */
65
+ enableTranscription?: boolean;
66
+ /** Enable per-track MKV recording to disk (default: false). */
67
+ enableRecording?: boolean;
68
+ /** Brainy entity ID this room is associated with (e.g. cohort or session entity ID). */
69
+ entityId?: string;
70
+ /**
71
+ * Workspace concept nodes for in-process BERT concept matching.
72
+ * Pass an empty array to disable concept matching while keeping transcription.
73
+ */
74
+ concepts?: ConceptInput[];
75
+ }
76
+ /**
77
+ * Manifest emitted when recording stops.
78
+ * Contains absolute local file paths on the Hall server's disk.
79
+ * The product is responsible for uploading these files to object storage.
80
+ */
81
+ export interface RecordingManifest {
82
+ /** Session UUID assigned by Hall. */
83
+ sessionId: string;
84
+ /** Unix timestamp (ms) when recording started. */
85
+ startedAt: number;
86
+ /** Unix timestamp (ms) when recording stopped. */
87
+ endedAt: number;
88
+ /** Absolute paths to per-participant Opus audio track MKV files. */
89
+ audioTracks: string[];
90
+ /** Absolute paths to per-participant video track MKV files. */
91
+ videoTracks: string[];
92
+ }
93
+ /** A Whisper ASR transcript segment from a peer in the room. */
94
+ export interface TranscriptEvent {
95
+ roomId: string;
96
+ peerId: string;
97
+ /** The transcribed text. May be a partial result if `isFinal` is false. */
98
+ text: string;
99
+ /** Offset from session start in milliseconds. */
100
+ sessionMs: number;
101
+ /** True when the ASR model has committed this segment. False for interim results. */
102
+ isFinal: boolean;
103
+ }
104
+ /** A BERT concept mention detected in the Whisper transcript. */
105
+ export interface ConceptMentionEvent {
106
+ roomId: string;
107
+ peerId: string;
108
+ /** Brainy entity ID of the matched concept node. */
109
+ nodeId: string;
110
+ nounType: string;
111
+ subtype?: string;
112
+ /** How the concept was referenced (e.g. `"define"`, `"apply"`, `"question"`). */
113
+ verbType: string;
114
+ /** BERT cosine similarity score (0–1). */
115
+ confidence: number;
116
+ /** The transcript excerpt that triggered the match. */
117
+ text: string;
118
+ sessionMs: number;
119
+ }
120
+ /** An inferred subject–verb–object relation proposed for review. */
121
+ export interface RelationProposedEvent {
122
+ roomId: string;
123
+ peerId: string;
124
+ fromNodeId: string;
125
+ verbType: string;
126
+ toNodeId: string;
127
+ /** Confidence score (0–1). */
128
+ confidence: number;
129
+ /** The transcript excerpt that triggered the inference. */
130
+ text: string;
131
+ sessionMs: number;
132
+ }
133
+ /** The active speaker changed. Uses RFC 6464 audio level detection. */
134
+ export interface SpeakerChangedEvent {
135
+ roomId: string;
136
+ /** Peer ID of the new active speaker. */
137
+ peerId: string;
138
+ }
139
+ /** A new peer joined the room. */
140
+ export interface PeerJoinedEvent {
141
+ roomId: string;
142
+ peerId: string;
143
+ }
144
+ /** A peer left or was disconnected from the room. */
145
+ export interface PeerLeftEvent {
146
+ roomId: string;
147
+ peerId: string;
148
+ }
149
+ /**
150
+ * Messages sent from the product backend to the Hall server over the product WebSocket.
151
+ * Encoded as msgpack with `t` (type tag) and `d` (data) fields — matching Rust serde
152
+ * `tag/content` encoding.
153
+ *
154
+ * @internal Used by HallClient. Not part of the public sdk.hall API surface.
14
155
  */
15
- export type { HallConfig, RoomOptions, RecordingManifest, ConceptEvent, RelationProposedEvent, AttentionEvent, RoomEventMap, } from '@soulcraft/hall';
16
- export type { Room, HallServer } from '@soulcraft/hall';
156
+ export type HallClientMessage = {
157
+ t: 'authProduct';
158
+ d: {
159
+ productName: string;
160
+ secret: string;
161
+ };
162
+ } | {
163
+ t: 'createRoom';
164
+ d: {
165
+ roomId: string;
166
+ options: RoomOptions;
167
+ };
168
+ } | {
169
+ t: 'closeRoom';
170
+ d: {
171
+ roomId: string;
172
+ };
173
+ } | {
174
+ t: 'listRooms';
175
+ d: Record<string, never>;
176
+ } | {
177
+ t: 'createSessionToken';
178
+ d: {
179
+ roomId: string;
180
+ peerId: string;
181
+ ttlSecs?: number | undefined;
182
+ };
183
+ } | {
184
+ t: 'startRecording';
185
+ d: {
186
+ roomId: string;
187
+ };
188
+ } | {
189
+ t: 'stopRecording';
190
+ d: {
191
+ roomId: string;
192
+ };
193
+ } | {
194
+ t: 'sendData';
195
+ d: {
196
+ roomId: string;
197
+ channel: string;
198
+ payload: Uint8Array;
199
+ };
200
+ };
201
+ /**
202
+ * Messages sent from the Hall server to the product backend.
203
+ * Decoded from msgpack binary frames.
204
+ *
205
+ * @internal Used by HallClient. Not part of the public sdk.hall API surface.
206
+ */
207
+ export type HallServerMessage = {
208
+ t: 'authOk';
209
+ d: {
210
+ productName: string;
211
+ };
212
+ } | {
213
+ t: 'authFailed';
214
+ d: {
215
+ reason: string;
216
+ };
217
+ } | {
218
+ t: 'roomCreated';
219
+ d: {
220
+ roomId: string;
221
+ sessionId: string;
222
+ };
223
+ } | {
224
+ t: 'roomClosed';
225
+ d: {
226
+ roomId: string;
227
+ };
228
+ } | {
229
+ t: 'roomList';
230
+ d: {
231
+ roomIds: string[];
232
+ };
233
+ } | {
234
+ t: 'sessionToken';
235
+ d: {
236
+ token: string;
237
+ expiresAt: number;
238
+ };
239
+ } | {
240
+ t: 'recordingStarted';
241
+ d: {
242
+ roomId: string;
243
+ };
244
+ } | {
245
+ t: 'recordingManifest';
246
+ d: {
247
+ roomId: string;
248
+ manifest: RecordingManifest;
249
+ };
250
+ } | {
251
+ t: 'dataSent';
252
+ d: {
253
+ roomId: string;
254
+ };
255
+ } | {
256
+ t: 'error';
257
+ d: {
258
+ code: string;
259
+ message: string;
260
+ };
261
+ } | {
262
+ t: 'transcript';
263
+ d: TranscriptEvent;
264
+ } | {
265
+ t: 'conceptMention';
266
+ d: ConceptMentionEvent;
267
+ } | {
268
+ t: 'relationProposed';
269
+ d: RelationProposedEvent;
270
+ } | {
271
+ t: 'speakerChanged';
272
+ d: SpeakerChangedEvent;
273
+ } | {
274
+ t: 'peerJoined';
275
+ d: PeerJoinedEvent;
276
+ } | {
277
+ t: 'peerLeft';
278
+ d: PeerLeftEvent;
279
+ };
280
+ /** Event map for server-side {@link HallRoom} listeners. */
281
+ export interface HallRoomEvents {
282
+ transcript: TranscriptEvent;
283
+ conceptMention: ConceptMentionEvent;
284
+ relationProposed: RelationProposedEvent;
285
+ speakerChanged: SpeakerChangedEvent;
286
+ peerJoined: PeerJoinedEvent;
287
+ peerLeft: PeerLeftEvent;
288
+ recordingManifest: RecordingManifest;
289
+ closed: {
290
+ roomId: string;
291
+ };
292
+ }
17
293
  /**
18
- * @description The sdk.hall namespace on SoulcraftSDK (server mode only).
294
+ * The `sdk.hall` namespace on `SoulcraftSDK` in **server mode**.
19
295
  *
20
- * Provides access to the running HallServer instance and room management utilities.
21
- * In server mode, the SDK manages one HallServer per process. Products call
22
- * createRoom/getRoom directly, then mount the signaling handler returned by
23
- * createHallRoomHandler() at their WebSocket route.
296
+ * Products call these methods in request handlers to create rooms and issue session
297
+ * tokens that browser clients use to join. Rooms are managed by the Hall server;
298
+ * the product only holds a control-plane connection over WebSocket.
299
+ *
300
+ * Obtain via `createHallModule(options)` from `@soulcraft/sdk/server`.
301
+ *
302
+ * @example Academy lesson handler
303
+ * ```typescript
304
+ * import { createHallModule } from '@soulcraft/sdk/server'
305
+ *
306
+ * const hall = createHallModule({
307
+ * url: process.env.HALL_URL!,
308
+ * productName: 'academy',
309
+ * secret: process.env.HALL_ACADEMY_SECRET!,
310
+ * })
311
+ * await hall.connect()
312
+ *
313
+ * app.post('/api/lessons/:id/join', requireAuth, async (c) => {
314
+ * const { id } = c.req.param()
315
+ * const user = c.get('user')!
316
+ * await hall.createRoom(id, {
317
+ * enableTranscription: true,
318
+ * concepts: await loadConcepts(id),
319
+ * })
320
+ * const { token } = await hall.createSessionToken(id, user.id, 3600)
321
+ * return c.json({ token, hallUrl: process.env.HALL_URL })
322
+ * })
323
+ * ```
24
324
  */
25
325
  export interface HallModule {
26
326
  /**
27
- * Creates a new room with the given ID and options. Errors if a room with the
28
- * same ID already exists check with getRoom() first.
29
- * @param roomId - Unique room identifier (e.g. Brainy session entity ID).
30
- * @param options - Room creation options (max peers, transcription, recording, etc.).
31
- * @returns The Room instance, ready for peer connections.
327
+ * Connects to the Hall server and authenticates with the product shared secret.
328
+ * Must be called once at startup before any other method.
329
+ *
330
+ * @throws {Error} If auth fails or the connection cannot be established.
32
331
  */
33
- createRoom(roomId: string, options: import('@soulcraft/hall').RoomOptions): Promise<import('@soulcraft/hall').Room>;
332
+ connect(): Promise<void>;
34
333
  /**
35
- * Returns an existing room by ID, or null if it does not exist.
36
- * @param roomId - The room ID to look up.
37
- * @returns The Room or null.
334
+ * Creates a new room. Errors if a room with the same ID already exists.
335
+ *
336
+ * @param roomId - Unique room identifier (e.g. Brainy session entity ID).
337
+ * @param options - Room options: peer limit, transcription, recording, concept list.
338
+ * @returns The HallRoom handle — register event listeners on it immediately.
38
339
  */
39
- getRoom(roomId: string): Promise<import('@soulcraft/hall').Room | null>;
340
+ createRoom(roomId: string, options?: RoomOptions): Promise<HallRoom>;
40
341
  /**
41
- * Close a specific room and disconnect all its peers.
42
- * @param roomId - The room ID to close.
342
+ * Closes a room and disconnects all its peers.
343
+ *
344
+ * @param roomId - The room ID passed to `createRoom`.
43
345
  */
44
346
  closeRoom(roomId: string): Promise<void>;
45
347
  /**
46
- * Return IDs of all currently active rooms.
348
+ * Returns the IDs of all active rooms managed by this Hall connection.
349
+ *
47
350
  * @returns Array of room ID strings.
48
351
  */
49
- roomIds(): Promise<string[]>;
352
+ listRooms(): Promise<string[]>;
353
+ /**
354
+ * Returns an active room handle by ID, or `undefined` if not found.
355
+ *
356
+ * @param roomId - The room ID passed to `createRoom`.
357
+ */
358
+ getRoom(roomId: string): HallRoom | undefined;
359
+ /**
360
+ * Mints a short-lived session token for a browser client.
361
+ * Pass `{ token, hallUrl }` to the browser — never the product secret.
362
+ *
363
+ * @param roomId - The room the browser will join.
364
+ * @param peerId - The peer's unique identifier (e.g. authenticated user ID).
365
+ * @param ttlSecs - Token lifetime in seconds (default: 300).
366
+ * @returns `{ token, expiresAt }`.
367
+ */
368
+ createSessionToken(roomId: string, peerId: string, ttlSecs?: number): Promise<{
369
+ token: string;
370
+ expiresAt: number;
371
+ }>;
372
+ /**
373
+ * Starts per-track MKV recording for an active room.
374
+ * The room emits `recordingManifest` when `stopRecording` is called.
375
+ *
376
+ * @param roomId - The room to start recording.
377
+ */
378
+ startRecording(roomId: string): Promise<void>;
379
+ /**
380
+ * Stops recording. Hall writes track files to disk and emits `recordingManifest`
381
+ * on the room with absolute paths to the recorded files.
382
+ *
383
+ * @param roomId - The room to stop recording.
384
+ */
385
+ stopRecording(roomId: string): Promise<void>;
386
+ /**
387
+ * Registers a listener for unexpected disconnects (not triggered by `close()`).
388
+ *
389
+ * @param listener - Called with a human-readable disconnect reason.
390
+ */
391
+ onDisconnect(listener: (reason: string) => void): void;
392
+ /**
393
+ * Registers a listener for successful reconnections.
394
+ * On reconnect, rooms from before the disconnect are gone — re-create them.
395
+ */
396
+ onReconnect(listener: () => void): void;
50
397
  /**
51
- * Shuts down the Hall server and all active rooms, releasing NAPI resources.
52
- * Called automatically by sdk.shutdown() in server mode.
398
+ * Gracefully closes the Hall connection and releases resources.
399
+ * Called automatically by `sdk.shutdown()` in server mode.
53
400
  */
54
401
  close(): Promise<void>;
55
402
  }
403
+ /**
404
+ * A handle for a live Hall room, returned by `sdk.hall.createRoom()`.
405
+ *
406
+ * Register event listeners immediately after creation — events can arrive before
407
+ * `createRoom` resolves if peers connect rapidly.
408
+ *
409
+ * @example
410
+ * ```typescript
411
+ * const room = await hall.createRoom('cohort-123', { enableTranscription: true })
412
+ * room.on('transcript', (t) => console.log(`${t.peerId}: ${t.text}`))
413
+ * room.on('conceptMention', (c) => brain.relate({ from: c.peerId, to: c.nodeId }))
414
+ * room.on('peerJoined', (p) => updatePresence(p.peerId, 'joined'))
415
+ * ```
416
+ */
417
+ export interface HallRoom {
418
+ /** The room's entity ID (same as passed to `createRoom`). */
419
+ readonly roomId: string;
420
+ /** The session UUID assigned by Hall for this room instance. */
421
+ readonly sessionId: string;
422
+ /**
423
+ * Register a listener for a room event.
424
+ *
425
+ * @param event - The event name.
426
+ * @param listener - Callback invoked with the typed event payload.
427
+ * @returns `this` for chaining.
428
+ */
429
+ on<K extends keyof HallRoomEvents>(event: K, listener: (data: HallRoomEvents[K]) => void): this;
430
+ /**
431
+ * Remove a previously registered listener.
432
+ *
433
+ * @param event - The event name.
434
+ * @param listener - The exact function reference passed to `on`.
435
+ */
436
+ off<K extends keyof HallRoomEvents>(event: K, listener: (data: HallRoomEvents[K]) => void): this;
437
+ }
438
+ /**
439
+ * Events emitted by a `HallRoomHandle` in the browser.
440
+ */
441
+ export interface HallRoomHandleEvents {
442
+ /** A Whisper ASR transcript segment from any peer in the room. */
443
+ transcript: TranscriptEvent;
444
+ /** A BERT concept mention detected in the transcript. */
445
+ conceptMention: ConceptMentionEvent;
446
+ /** An inferred subject–verb–object relation proposed for review. */
447
+ relationProposed: RelationProposedEvent;
448
+ /** The active speaker changed. */
449
+ speakerChanged: SpeakerChangedEvent;
450
+ /** A new peer joined the room. */
451
+ peerJoined: PeerJoinedEvent;
452
+ /** A peer left the room. */
453
+ peerLeft: PeerLeftEvent;
454
+ /** A remote media track became available — render it in a `<video>` or `<audio>` element. */
455
+ trackAdded: {
456
+ peerId: string;
457
+ track: MediaStreamTrack;
458
+ streams: readonly MediaStream[];
459
+ };
460
+ /** A remote media track was removed. */
461
+ trackRemoved: {
462
+ peerId: string;
463
+ track: MediaStreamTrack;
464
+ };
465
+ /** The Hall server closed the room. */
466
+ closed: {
467
+ roomId: string;
468
+ };
469
+ /** A WebRTC or signaling error occurred. */
470
+ error: {
471
+ message: string;
472
+ };
473
+ }
474
+ /**
475
+ * An active WebRTC peer connection to a Hall room, returned by `joinHallRoom()`.
476
+ *
477
+ * Wraps an `RTCPeerConnection` and the Hall signaling WebSocket. Emits AI events
478
+ * (transcript, conceptMention, relationProposed) alongside media track events
479
+ * so kit apps have a single event surface for the full session experience.
480
+ *
481
+ * @example
482
+ * ```typescript
483
+ * const room = await joinHallRoom({ token, hallUrl: 'wss://hall.soulcraft.com' })
484
+ * room.addStream(await navigator.mediaDevices.getUserMedia({ video: true, audio: true }))
485
+ *
486
+ * room.on('trackAdded', ({ peerId, streams }) => {
487
+ * document.getElementById(`video-${peerId}`).srcObject = streams[0]
488
+ * })
489
+ * room.on('transcript', ({ peerId, text, isFinal }) => {
490
+ * if (isFinal) appendTranscript(peerId, text)
491
+ * })
492
+ * room.on('conceptMention', ({ nodeId, confidence }) => pulseGraphNode(nodeId, confidence))
493
+ * ```
494
+ */
495
+ export interface HallRoomHandle {
496
+ /** The room ID this peer has joined. */
497
+ readonly roomId: string;
498
+ /** The peer ID for this connection (decoded from the session token). */
499
+ readonly peerId: string;
500
+ /**
501
+ * Register a listener for a room event.
502
+ *
503
+ * @param event - The event name.
504
+ * @param listener - Callback invoked with the typed event payload.
505
+ */
506
+ on<K extends keyof HallRoomHandleEvents>(event: K, listener: (data: HallRoomHandleEvents[K]) => void): this;
507
+ /**
508
+ * Remove a previously registered listener.
509
+ *
510
+ * @param event - The event name.
511
+ * @param listener - The exact function reference passed to `on`.
512
+ */
513
+ off<K extends keyof HallRoomHandleEvents>(event: K, listener: (data: HallRoomHandleEvents[K]) => void): this;
514
+ /**
515
+ * Adds a local media stream to the peer connection.
516
+ * Call this before or shortly after `joinHallRoom` returns.
517
+ *
518
+ * @param stream - The MediaStream from `navigator.mediaDevices.getUserMedia()`.
519
+ */
520
+ addStream(stream: MediaStream): void;
521
+ /**
522
+ * Disconnects the WebRTC peer connection and the signaling WebSocket.
523
+ * Always call this when the user leaves the session.
524
+ */
525
+ close(): void;
526
+ }
56
527
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/hall/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,YAAY,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,YAAY,GACb,MAAM,iBAAiB,CAAA;AAExB,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEvD;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;OAMG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,iBAAiB,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,iBAAiB,EAAE,IAAI,CAAC,CAAA;IAEnH;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,iBAAiB,EAAE,IAAI,GAAG,IAAI,CAAC,CAAA;IAEvE;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAExC;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAE5B;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/hall/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,4EAA4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C;QAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAA;KAAE,CAAA;IACxF,wCAAwC;IACxC,YAAY,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,gBAAgB,CAAA;KAAE,CAAA;IACzD,uCAAuC;IACvC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1B,4CAA4C;IAC5C,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,wEAAwE;IACxE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IAEvB;;;;;OAKG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,oBAAoB,EACrC,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,IAAI,GAChD,IAAI,CAAA;IAEP;;;;;OAKG;IACH,GAAG,CAAC,CAAC,SAAS,MAAM,oBAAoB,EACtC,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,IAAI,GAChD,IAAI,CAAA;IAEP;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;IAEpC;;;OAGG;IACH,KAAK,IAAI,IAAI,CAAA;CACd"}
@@ -1,16 +1,21 @@
1
1
  /**
2
2
  * @module modules/hall/types
3
- * @description Hall module types for @soulcraft/sdk.
3
+ * @description Types for the sdk.hall namespace — the Soulcraft real-time communication layer.
4
4
  *
5
- * Re-exports the full public API surface of @soulcraft/hall (HallServer, Room, and all
6
- * supporting types) so consumers only need to import from @soulcraft/sdk.
5
+ * Hall is a standalone Rust server at `hall.soulcraft.com`. It handles WebRTC SFU
6
+ * (video/audio/data channels), in-process Whisper ASR transcription, BERT concept
7
+ * matching, RFC 6464 speaker detection, and per-track MKV recording.
7
8
  *
8
- * The HallModule interface defines the sdk.hall namespace exposed on SoulcraftSDK.
9
- * Hall is server-only — the HallServer runs in-process with the product backend,
10
- * and the SDK provides handler factories that products mount as WebSocket routes.
9
+ * The `sdk.hall` namespace has two faces depending on context:
11
10
  *
12
- * @see createHallRoomHandler in @soulcraft/sdk/server for the signaling handler.
13
- * @see @soulcraft/hall for the NAPI implementation.
11
+ * **Server mode** (`@soulcraft/sdk/server`) the product backend (Academy, Workshop, Venue)
12
+ * connects to Hall with a shared secret, creates rooms, and mints short-lived session tokens.
13
+ * Use `createHallModule(options)` from `@soulcraft/sdk/server`.
14
+ *
15
+ * **Client mode** (`@soulcraft/sdk/client`) — a browser kit app joins a room using a session
16
+ * token issued by the product backend. Use `HallRoomClient` from `@soulcraft/sdk/client`.
17
+ *
18
+ * Products never pass their shared secret to the browser. The token is the only browser credential.
14
19
  */
15
20
  export {};
16
21
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modules/hall/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modules/hall/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @module kits
3
+ * @description Factory for sdk.kits.* — the Soulcraft kit registry module.
4
+ *
5
+ * Provides read-only access to kit configurations from the `@soulcraft/kits`
6
+ * package. The package is an optional peer dependency loaded lazily via
7
+ * `createRequire` so that the SDK compiles and runs without it installed;
8
+ * calls gracefully return `null` / empty array when it is absent.
9
+ *
10
+ * The factory accepts an optional `bundledRegistry` override (used in tests)
11
+ * to inject a mock registry without needing the real package.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * import { createKitsModule } from '@soulcraft/sdk/server'
16
+ *
17
+ * const kits = createKitsModule()
18
+ * const kit = await kits.load('wicks-and-whiskers')
19
+ * console.log(kit?.name) // "Wicks & Whiskers"
20
+ * ```
21
+ */
22
+ import type { KitsModule, CreateKitsModuleOptions } from './types.js';
23
+ /**
24
+ * Create the `sdk.kits.*` module.
25
+ *
26
+ * @param options - Optional overrides, primarily for testing.
27
+ * @returns A `KitsModule` backed by the `@soulcraft/kits` registry.
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * // In production:
32
+ * const kits = createKitsModule()
33
+ *
34
+ * // In tests — inject a mock registry to avoid the peer dep:
35
+ * const kits = createKitsModule({
36
+ * bundledRegistry: { 'test-kit': { id: 'test-kit', name: 'Test Kit', ... } }
37
+ * })
38
+ * ```
39
+ */
40
+ export declare function createKitsModule(options?: CreateKitsModuleOptions): KitsModule;
41
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/kits/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAsB,UAAU,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AA8BzF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B,GAAG,UAAU,CAkBlF"}