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,57 @@
1
+ /**
2
+ * The shared live-transcription engine — the TypeScript port of Python's ``AsyncAtrium``
3
+ * ``_transcribe_engine`` / ``_transcribe_stream`` / ``_transcribe_fallback_clips`` (aio.py).
4
+ *
5
+ * It tries the streaming route ({@link ./transcribe-stream.TranscriptionStream}) and, on a connect-time
6
+ * {@link ./transcribe-stream.StreamUnavailable}, degrades to per-clip batch transcription (POST each
7
+ * self-contained clip; a continuous PCM stream is first re-windowed into WAV clips). An
8
+ * {@link ./errors.AuthError} from the handshake propagates untouched — retrying won't heal it.
9
+ *
10
+ * The degradation is **connect-time only**: once the stream is live, a mid-session failure (an abrupt
11
+ * disconnect, a server crash, a close that never delivered ``done``) raises rather than silently
12
+ * degrading, so a truncated transcript can't masquerade as a clean end.
13
+ *
14
+ * Both {@link ../atrium.Atrium.transcribeLive} and {@link ../rooms/room.Room.transcribe} run on this
15
+ * one engine.
16
+ */
17
+ import type { FileSource } from "./files.js";
18
+ import type { Transcript } from "./models.js";
19
+ import type { WebSocketCtor } from "./rooms/transport.js";
20
+ /** One input audio chunk — an in-memory buffer or a browser ``Blob`` (a ``MediaRecorder`` slice). */
21
+ export type AudioChunk = ArrayBuffer | ArrayBufferView | Blob;
22
+ /** The client capabilities the engine needs: a credential for the stream WS and the batch route for
23
+ * the fallback. Supplied by the {@link ../atrium.Atrium} client. */
24
+ export interface TranscribeStreamDeps {
25
+ baseUrl: string;
26
+ /** A valid bearer/API-key credential for the stream handshake. */
27
+ token(): Promise<string>;
28
+ /** The batch ``transcribe`` route — the per-clip fallback POSTs each clip through it. */
29
+ transcribe(audio: FileSource, opts: {
30
+ model?: string;
31
+ language?: string;
32
+ format?: string;
33
+ }): Promise<Transcript>;
34
+ /** Injected ``WebSocket`` constructor (defaults to the runtime global) — the test seam / Node <22. */
35
+ webSocketCtor?: WebSocketCtor;
36
+ }
37
+ /** Engine options (shared by the streaming and fallback paths). */
38
+ export interface TranscribeStreamOptions {
39
+ model?: string;
40
+ language?: string;
41
+ /** ``"pcm16"`` for a raw headerless stream (needs ``sampleRate``), else a container format. */
42
+ format: string;
43
+ sampleRate?: number;
44
+ /** Also yield revisable partial hypotheses (streaming path only). */
45
+ partials: boolean;
46
+ /** Drop finalized sentences that transcribe to empty text. */
47
+ skipEmpty: boolean;
48
+ /** Aborting tears the stream down cleanly — the {@link ../rooms/transcriber.Transcriber} stop path. */
49
+ signal?: AbortSignal;
50
+ /** Injected ``WebSocket`` constructor for the stream handshake (defaults to the runtime global) —
51
+ * the test seam / Node <22 escape hatch. */
52
+ webSocketCtor?: WebSocketCtor;
53
+ }
54
+ /** Run the shared engine over ``clips``, yielding a {@link Transcript} per finalized sentence (and,
55
+ * with ``partials``, per live partial). Streaming when the backend offers it, per-clip batch otherwise. */
56
+ export declare function transcribeEngine(deps: TranscribeStreamDeps, clips: AsyncIterable<AudioChunk>, opts: TranscribeStreamOptions): AsyncGenerator<Transcript>;
57
+ //# sourceMappingURL=transcribe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcribe.d.ts","sourceRoot":"","sources":["../src/transcribe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGzD,qGAAqG;AACrG,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,eAAe,GAAG,IAAI,CAAA;AAE7D;oEACoE;AACpE,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,kEAAkE;IAClE,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;IACxB,yFAAyF;IACzF,UAAU,CACR,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3D,OAAO,CAAC,UAAU,CAAC,CAAA;IACtB,sGAAsG;IACtG,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AAED,mEAAmE;AACnE,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+FAA+F;IAC/F,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,qEAAqE;IACrE,QAAQ,EAAE,OAAO,CAAA;IACjB,8DAA8D;IAC9D,SAAS,EAAE,OAAO,CAAA;IAClB,uGAAuG;IACvG,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;gDAC4C;IAC5C,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AAKD;2GAC2G;AAC3G,wBAAuB,gBAAgB,CACrC,IAAI,EAAE,oBAAoB,EAC1B,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,EAChC,IAAI,EAAE,uBAAuB,GAC5B,cAAc,CAAC,UAAU,CAAC,CAmB5B"}
@@ -0,0 +1,267 @@
1
+ /**
2
+ * The shared live-transcription engine — the TypeScript port of Python's ``AsyncAtrium``
3
+ * ``_transcribe_engine`` / ``_transcribe_stream`` / ``_transcribe_fallback_clips`` (aio.py).
4
+ *
5
+ * It tries the streaming route ({@link ./transcribe-stream.TranscriptionStream}) and, on a connect-time
6
+ * {@link ./transcribe-stream.StreamUnavailable}, degrades to per-clip batch transcription (POST each
7
+ * self-contained clip; a continuous PCM stream is first re-windowed into WAV clips). An
8
+ * {@link ./errors.AuthError} from the handshake propagates untouched — retrying won't heal it.
9
+ *
10
+ * The degradation is **connect-time only**: once the stream is live, a mid-session failure (an abrupt
11
+ * disconnect, a server crash, a close that never delivered ``done``) raises rather than silently
12
+ * degrading, so a truncated transcript can't masquerade as a clean end.
13
+ *
14
+ * Both {@link ../atrium.Atrium.transcribeLive} and {@link ../rooms/room.Room.transcribe} run on this
15
+ * one engine.
16
+ */
17
+ import { APIError, AtriumError } from "./errors.js";
18
+ import { StreamUnavailable, TranscriptionStream } from "./transcribe-stream.js";
19
+ // PCM fallback window (Python's ``_PCM_FALLBACK_WINDOW_S``): raw PCM is re-windowed into ~5s WAV clips.
20
+ const PCM_FALLBACK_WINDOW_S = 5;
21
+ /** Run the shared engine over ``clips``, yielding a {@link Transcript} per finalized sentence (and,
22
+ * with ``partials``, per live partial). Streaming when the backend offers it, per-clip batch otherwise. */
23
+ export async function* transcribeEngine(deps, clips, opts) {
24
+ let stream;
25
+ try {
26
+ stream = await TranscriptionStream.open(deps.baseUrl, {
27
+ token: await deps.token(),
28
+ model: opts.model,
29
+ language: opts.language,
30
+ format: opts.format,
31
+ sampleRate: opts.sampleRate,
32
+ WebSocketCtor: deps.webSocketCtor,
33
+ });
34
+ }
35
+ catch (err) {
36
+ if (err instanceof StreamUnavailable) {
37
+ yield* transcribeFallbackClips(deps, clips, opts);
38
+ return;
39
+ }
40
+ throw err; // AuthError propagates
41
+ }
42
+ yield* transcribeStreamGen(stream, clips, opts);
43
+ }
44
+ // Pump `clips` up (a background feeder) while reading events down, mapping `final` (always) and
45
+ // `partial` (only when `partials`) to Transcripts and ending on `done`. A stream that ends WITHOUT a
46
+ // `done` — a clean 1000 that skipped it or any abnormal close — is a failure, not a completion, so it
47
+ // raises; the degradation ladder is connect-time only. Aborting (Transcriber.stop) tears down cleanly.
48
+ async function* transcribeStreamGen(stream, clips, opts) {
49
+ const aborted = () => Boolean(opts.signal?.aborted);
50
+ const onAbort = () => stream.close(); // unblock the events read so teardown proceeds at once
51
+ // Guard aborted-before-add (the handshake may already have run past a ≤10s abort while the stream
52
+ // was opening — the listener would then never fire): close now, and only listen otherwise.
53
+ if (opts.signal) {
54
+ if (opts.signal.aborted)
55
+ onAbort();
56
+ else
57
+ opts.signal.addEventListener("abort", onAbort);
58
+ }
59
+ const feeder = feedStream(stream, clips);
60
+ let doneSeen = false;
61
+ try {
62
+ for await (const event of stream.events()) {
63
+ const type = event.type;
64
+ if (type === "final") {
65
+ const text = String(event.text ?? "");
66
+ if (text || !opts.skipEmpty)
67
+ yield transcriptFromEvent(event, true);
68
+ }
69
+ else if (type === "partial") {
70
+ if (opts.partials)
71
+ yield transcriptFromEvent(event, false);
72
+ }
73
+ else if (type === "done") {
74
+ doneSeen = true;
75
+ break;
76
+ }
77
+ else if (type === "error") {
78
+ throw new AtriumError(`transcription stream error: ${String(event.detail ?? "")}`);
79
+ }
80
+ // unknown types (incl. 'ready') are ignored — frozen-safe contract
81
+ }
82
+ }
83
+ catch (err) {
84
+ if (!aborted())
85
+ throw err; // a deliberate teardown closes the socket → swallow the close error
86
+ }
87
+ finally {
88
+ opts.signal?.removeEventListener("abort", onAbort);
89
+ // Always stop the feeder before awaiting it — a normal `done` arrives after the feeder drained
90
+ // (a no-op stop), but a *spurious* `done` (one with no preceding client `stop`) would otherwise
91
+ // leave an infinite clips source pumping forever and wedge `await feeder.done`.
92
+ feeder.stop();
93
+ await feeder.done.catch(() => { });
94
+ stream.close();
95
+ }
96
+ if (!doneSeen && !aborted()) {
97
+ throw new AtriumError("transcription stream ended unexpectedly (no done event)");
98
+ }
99
+ }
100
+ // Send every chunk as a binary frame, then `stop` (so the server flushes and sends `done`). `stop()`
101
+ // ends the pull early (an early teardown), nudging the input iterator's own `return` so a well-behaved
102
+ // generator closes its source.
103
+ function feedStream(stream, clips) {
104
+ const iterator = clips[Symbol.asyncIterator]();
105
+ let stopped = false;
106
+ const done = (async () => {
107
+ try {
108
+ while (!stopped) {
109
+ const next = await iterator.next();
110
+ if (next.done || stopped)
111
+ break;
112
+ try {
113
+ stream.sendBytes(await toArrayBuffer(next.value));
114
+ }
115
+ catch {
116
+ break; // socket gone — nothing left to feed
117
+ }
118
+ }
119
+ if (!stopped) {
120
+ try {
121
+ stream.sendStop();
122
+ }
123
+ catch {
124
+ // the socket may already be closing — the server ends the stream regardless
125
+ }
126
+ }
127
+ }
128
+ catch {
129
+ // input iteration failed / was torn down — the engine's teardown owns the cleanup
130
+ }
131
+ })();
132
+ return {
133
+ done,
134
+ stop() {
135
+ stopped = true;
136
+ void iterator.return?.().catch(() => { });
137
+ },
138
+ };
139
+ }
140
+ // Wrap one stream `final`/`partial` event as a Transcript. `.raw` carries the whole event (a `final`
141
+ // brings `start`/`end`); `.final` marks settled vs revisable. Mirror of Python's `_transcript_from_event`.
142
+ function transcriptFromEvent(event, final) {
143
+ return {
144
+ text: String(event.text ?? ""),
145
+ language: null,
146
+ duration: null,
147
+ segments: [],
148
+ raw: event,
149
+ final,
150
+ };
151
+ }
152
+ // The default per-clip batch fallback: POST each self-contained clip. Continuous PCM (`format="pcm16"`)
153
+ // is first re-windowed into ~5s WAV clips.
154
+ async function* transcribeFallbackClips(deps, clips, opts) {
155
+ if (opts.format === "pcm16") {
156
+ // transcribeLive validated sampleRate is present for pcm16.
157
+ for await (const wav of wavWindows(clips, opts.sampleRate)) {
158
+ const said = await transcribeOne(deps, wav, opts, "wav");
159
+ if (said)
160
+ yield said;
161
+ }
162
+ }
163
+ else {
164
+ for await (const clip of clips) {
165
+ const said = await transcribeOne(deps, clip, opts, opts.format);
166
+ if (said)
167
+ yield said;
168
+ }
169
+ }
170
+ }
171
+ // Transcribe one self-contained clip with the live-stream skip rules. Returns the Transcript, or null
172
+ // for a clip to drop: one the server couldn't transcribe (a bad/empty frame, a transient error) or —
173
+ // when skipEmpty — one whose text is empty. Auth errors (401/403) still propagate.
174
+ async function transcribeOne(deps, chunk, opts, format) {
175
+ let said;
176
+ try {
177
+ said = await deps.transcribe(await toBlob(chunk), {
178
+ model: opts.model,
179
+ language: opts.language,
180
+ format,
181
+ });
182
+ }
183
+ catch (err) {
184
+ if (err instanceof APIError && (err.status === 401 || err.status === 403))
185
+ throw err;
186
+ return null; // a frame the server couldn't transcribe — skip, keep the stream alive
187
+ }
188
+ return said.text || !opts.skipEmpty ? said : null;
189
+ }
190
+ // Batch a continuous PCM16LE-mono byte stream into ~5s self-contained WAV clips, so the batch fallback
191
+ // works for the same raw-mic input the streaming path takes headerless.
192
+ async function* wavWindows(clips, sampleRate) {
193
+ const target = PCM_FALLBACK_WINDOW_S * sampleRate * 2; // 2 bytes/sample, mono
194
+ const parts = [];
195
+ let size = 0;
196
+ for await (const chunk of clips) {
197
+ const bytes = await toBytes(chunk);
198
+ parts.push(bytes);
199
+ size += bytes.length;
200
+ if (size >= target) {
201
+ yield pcm16ToWav(concat(parts, size), sampleRate);
202
+ parts.length = 0;
203
+ size = 0;
204
+ }
205
+ }
206
+ if (size > 0)
207
+ yield pcm16ToWav(concat(parts, size), sampleRate);
208
+ }
209
+ // Wrap raw PCM16LE-mono samples in a minimal WAV container (a 44-byte header + the samples). Mirror of
210
+ // Python's `_pcm16_to_wav` (stdlib `wave`).
211
+ function pcm16ToWav(pcm, sampleRate) {
212
+ const byteRate = sampleRate * 2; // mono, 16-bit
213
+ const buffer = new ArrayBuffer(44 + pcm.length);
214
+ const view = new DataView(buffer);
215
+ const ascii = (offset, text) => {
216
+ for (let i = 0; i < text.length; i++)
217
+ view.setUint8(offset + i, text.charCodeAt(i));
218
+ };
219
+ ascii(0, "RIFF");
220
+ view.setUint32(4, 36 + pcm.length, true);
221
+ ascii(8, "WAVE");
222
+ ascii(12, "fmt ");
223
+ view.setUint32(16, 16, true); // PCM fmt chunk size
224
+ view.setUint16(20, 1, true); // audio format = PCM
225
+ view.setUint16(22, 1, true); // channels = mono
226
+ view.setUint32(24, sampleRate, true);
227
+ view.setUint32(28, byteRate, true);
228
+ view.setUint16(32, 2, true); // block align
229
+ view.setUint16(34, 16, true); // bits per sample
230
+ ascii(36, "data");
231
+ view.setUint32(40, pcm.length, true);
232
+ new Uint8Array(buffer, 44).set(pcm);
233
+ return buffer;
234
+ }
235
+ function concat(parts, size) {
236
+ const out = new Uint8Array(size);
237
+ let offset = 0;
238
+ for (const part of parts) {
239
+ out.set(part, offset);
240
+ offset += part.length;
241
+ }
242
+ return out;
243
+ }
244
+ async function toBytes(chunk) {
245
+ if (chunk instanceof Uint8Array)
246
+ return chunk;
247
+ if (chunk instanceof ArrayBuffer)
248
+ return new Uint8Array(chunk);
249
+ if (ArrayBuffer.isView(chunk)) {
250
+ return new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
251
+ }
252
+ return new Uint8Array(await chunk.arrayBuffer()); // Blob
253
+ }
254
+ async function toArrayBuffer(chunk) {
255
+ if (chunk instanceof ArrayBuffer)
256
+ return chunk;
257
+ if (ArrayBuffer.isView(chunk)) {
258
+ return chunk.buffer.slice(chunk.byteOffset, chunk.byteOffset + chunk.byteLength);
259
+ }
260
+ return chunk.arrayBuffer(); // Blob
261
+ }
262
+ async function toBlob(chunk) {
263
+ if (chunk instanceof Blob)
264
+ return chunk;
265
+ return new Blob([await toArrayBuffer(chunk)]);
266
+ }
267
+ //# sourceMappingURL=transcribe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcribe.js","sourceRoot":"","sources":["../src/transcribe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAInD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAsC/E,wGAAwG;AACxG,MAAM,qBAAqB,GAAG,CAAC,CAAA;AAE/B;2GAC2G;AAC3G,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,gBAAgB,CACrC,IAA0B,EAC1B,KAAgC,EAChC,IAA6B;IAE7B,IAAI,MAA2B,CAAA;IAC/B,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACpD,KAAK,EAAE,MAAM,IAAI,CAAC,KAAK,EAAE;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,aAAa,EAAE,IAAI,CAAC,aAAa;SAClC,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,iBAAiB,EAAE,CAAC;YACrC,KAAK,CAAC,CAAC,uBAAuB,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CA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CAAC,MAAM,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAC/C,CAAC"}
@@ -0,0 +1,20 @@
1
+ /** Public data shapes returned by the SDK. */
2
+ /**
3
+ * The signed-in user, as returned by ``GET /v1/users/me``.
4
+ *
5
+ * Field names mirror the server JSON verbatim (snake_case). Extra fields the server may add in the
6
+ * future are preserved via the index signature, so a newer server never breaks an older client.
7
+ */
8
+ export interface User {
9
+ id: string;
10
+ email: string;
11
+ role: string;
12
+ auth_method: string;
13
+ is_active: boolean;
14
+ created_at: string;
15
+ authenticated_via: "bearer" | "api_key" | "app";
16
+ key_project_id: string | null;
17
+ effective_project_id: string;
18
+ [key: string]: unknown;
19
+ }
20
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,iBAAiB,EAAE,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAA;IAC/C,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB"}
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ /** Public data shapes returned by the SDK. */
2
+ export {};
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,8CAA8C"}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "hci-atrium",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript SDK for the Atrium framework — multimodal asset library, semantic + cross-modal search, and capability routing.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Anders Petruschke",
8
+ "sideEffects": false,
9
+ "engines": {
10
+ "node": ">=20.4"
11
+ },
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "main": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js"
21
+ },
22
+ "./react": {
23
+ "types": "./dist/react/index.d.ts",
24
+ "import": "./dist/react/index.js"
25
+ }
26
+ },
27
+ "peerDependencies": {
28
+ "react": ">=18",
29
+ "zod": ">=4"
30
+ },
31
+ "peerDependenciesMeta": {
32
+ "react": {
33
+ "optional": true
34
+ },
35
+ "zod": {
36
+ "optional": true
37
+ }
38
+ },
39
+ "devDependencies": {
40
+ "@biomejs/biome": "2.4.16",
41
+ "@testing-library/react": "^16.1.0",
42
+ "@types/react": "^19.0.0",
43
+ "@types/react-dom": "^19.0.0",
44
+ "jsdom": "^26.0.0",
45
+ "react": "^19.0.0",
46
+ "react-dom": "^19.0.0",
47
+ "typescript": "^5.7.0",
48
+ "vitest": "^3.0.0"
49
+ },
50
+ "scripts": {
51
+ "build": "tsc",
52
+ "test": "vitest run",
53
+ "lint": "biome check .",
54
+ "format": "biome check --write ."
55
+ }
56
+ }