@alexkroman1/aai 1.5.1 → 1.6.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 (41) hide show
  1. package/.turbo/turbo-build.log +17 -17
  2. package/CHANGELOG.md +12 -0
  3. package/dist/host/providers/resolve.d.ts +7 -1
  4. package/dist/host/providers/stt/elevenlabs.d.ts +16 -0
  5. package/dist/host/providers/stt/soniox.d.ts +25 -0
  6. package/dist/host/runtime-barrel.js +532 -76
  7. package/dist/sdk/providers/llm/google.d.ts +22 -0
  8. package/dist/sdk/providers/llm/groq.d.ts +21 -0
  9. package/dist/sdk/providers/llm/mistral.d.ts +21 -0
  10. package/dist/sdk/providers/llm/openai.d.ts +21 -0
  11. package/dist/sdk/providers/llm/xai.d.ts +21 -0
  12. package/dist/sdk/providers/llm-barrel.d.ts +5 -0
  13. package/dist/sdk/providers/llm-barrel.js +2 -2
  14. package/dist/sdk/providers/stt/elevenlabs.d.ts +36 -0
  15. package/dist/sdk/providers/stt/soniox.d.ts +37 -0
  16. package/dist/sdk/providers/stt-barrel.d.ts +2 -0
  17. package/dist/sdk/providers/stt-barrel.js +2 -2
  18. package/dist/soniox-DCQ3GqJq.js +69 -0
  19. package/dist/xai-jfQsxxPZ.js +55 -0
  20. package/host/providers/resolve.test.ts +110 -0
  21. package/host/providers/resolve.ts +113 -10
  22. package/host/providers/stt/elevenlabs.test.ts +200 -0
  23. package/host/providers/stt/elevenlabs.ts +145 -0
  24. package/host/providers/stt/soniox.test.ts +338 -0
  25. package/host/providers/stt/soniox.ts +239 -0
  26. package/host/transports/pipeline-transport.test.ts +91 -0
  27. package/host/transports/pipeline-transport.ts +53 -30
  28. package/host/transports/s2s-transport.test.ts +222 -2
  29. package/host/transports/s2s-transport.ts +176 -40
  30. package/package.json +35 -2
  31. package/sdk/providers/llm/google.ts +30 -0
  32. package/sdk/providers/llm/groq.ts +29 -0
  33. package/sdk/providers/llm/mistral.ts +29 -0
  34. package/sdk/providers/llm/openai.ts +29 -0
  35. package/sdk/providers/llm/xai.ts +29 -0
  36. package/sdk/providers/llm-barrel.ts +10 -0
  37. package/sdk/providers/stt/elevenlabs.ts +44 -0
  38. package/sdk/providers/stt/soniox.ts +45 -0
  39. package/sdk/providers/stt-barrel.ts +4 -0
  40. package/dist/anthropic-CcLZygAr.js +0 -10
  41. package/dist/assemblyai-C969QGi4.js +0 -35
@@ -1,5 +1,5 @@
1
1
 
2
- > @alexkroman1/aai@1.5.1 build /home/runner/work/agent/agent/packages/aai
2
+ > @alexkroman1/aai@1.6.0 build /home/runner/work/agent/agent/packages/aai
3
3
  > tsdown && tsc -p tsconfig.build.json
4
4
 
5
5
  ℹ tsdown v0.21.7 powered by rolldown v1.0.0-rc.12
@@ -8,19 +8,19 @@
8
8
  ℹ target: node22
9
9
  ℹ tsconfig: tsconfig.json
10
10
  ℹ Build start
11
- ℹ dist/host/runtime-barrel.js 87.68 kB │ gzip: 25.35 kB
12
- ℹ dist/sdk/protocol.js  4.75 kB │ gzip: 1.76 kB
13
- ℹ dist/index.js  2.88 kB │ gzip: 1.24 kB
14
- ℹ dist/sdk/manifest-barrel.js  0.36 kB │ gzip: 0.20 kB
15
- ℹ dist/sdk/providers/tts-barrel.js  0.26 kB │ gzip: 0.16 kB
16
- ℹ dist/sdk/providers/stt-barrel.js  0.19 kB │ gzip: 0.14 kB
17
- ℹ dist/sdk/providers/llm-barrel.js  0.12 kB │ gzip: 0.11 kB
18
- ℹ dist/_internal-types-DFL07G3f.js  5.66 kB │ gzip: 2.10 kB
19
- ℹ dist/types-KUgezM6u.js  5.64 kB │ gzip: 2.39 kB
20
- ℹ dist/constants-C2nirZUI.js  3.10 kB │ gzip: 1.38 kB
21
- ℹ dist/ws-upgrade-BeOQ7fXL.js  1.14 kB │ gzip: 0.54 kB
22
- ℹ dist/cartesia-BfQPOQ7Y.js  1.08 kB │ gzip: 0.50 kB
23
- ℹ dist/assemblyai-C969QGi4.js  1.03 kB │ gzip: 0.42 kB
24
- ℹ dist/anthropic-CcLZygAr.js  0.23 kB │ gzip: 0.18 kB
25
- ℹ 14 files, total: 114.11 kB
26
- ✔ Build complete in 45ms
11
+ ℹ dist/host/runtime-barrel.js 103.81 kB │ gzip: 29.39 kB
12
+ ℹ dist/sdk/protocol.js  4.75 kB │ gzip: 1.76 kB
13
+ ℹ dist/index.js  2.88 kB │ gzip: 1.24 kB
14
+ ℹ dist/sdk/manifest-barrel.js  0.36 kB │ gzip: 0.20 kB
15
+ ℹ dist/sdk/providers/llm-barrel.js  0.36 kB │ gzip: 0.21 kB
16
+ ℹ dist/sdk/providers/stt-barrel.js  0.30 kB │ gzip: 0.20 kB
17
+ ℹ dist/sdk/providers/tts-barrel.js  0.26 kB │ gzip: 0.16 kB
18
+ ℹ dist/_internal-types-DFL07G3f.js  5.66 kB │ gzip: 2.10 kB
19
+ ℹ dist/types-KUgezM6u.js  5.64 kB │ gzip: 2.39 kB
20
+ ℹ dist/constants-C2nirZUI.js  3.10 kB │ gzip: 1.38 kB
21
+ ℹ dist/soniox-DCQ3GqJq.js  2.03 kB │ gzip: 0.54 kB
22
+ ℹ dist/xai-jfQsxxPZ.js  1.18 kB │ gzip: 0.35 kB
23
+ ℹ dist/ws-upgrade-BeOQ7fXL.js  1.14 kB │ gzip: 0.54 kB
24
+ ℹ dist/cartesia-BfQPOQ7Y.js  1.08 kB │ gzip: 0.50 kB
25
+ ℹ 14 files, total: 132.56 kB
26
+ ✔ Build complete in 43ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @alexkroman1/aai
2
2
 
3
+ ## 1.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - fd3a167: Pluggable Vercel AI SDK LLM providers in pipeline mode: add openai, google, mistral, xai, groq typed factories alongside the existing anthropic. Each is a { model } descriptor; the host resolver lazy-loads the corresponding @ai-sdk/\* package via createRequire. All six AI SDK packages move to optional peer dependencies, so self-hosted users only install the ones they actually use; the managed server installs all six as direct deps in aai-server.
8
+ - c8707d6: Add ElevenLabs Scribe (scribe_v2_realtime via @elevenlabs/elevenlabs-js) and Soniox (stt-rt-v3 via direct WebSocket) STT providers alongside assemblyai and deepgram. Both follow the existing typed-descriptor pattern; agent bundles stay free of provider SDKs and the host resolver constructs the live session at createRuntime time.
9
+
10
+ ### Patch Changes
11
+
12
+ - 149786b: Auto-resume AssemblyAI S2S sessions after transient WebSocket closes (1005, 1006, 1011, 3005) using session.resume within the 30s server window. Drops the in-flight reply via onCancelled so the session unblocks; falls back to the existing 'connection' error on fatal codes (1008/3006/3007/3008/3009) or when resume fails.
13
+ - 877348c: Pipeline mode: insert separator between LLM text segments split by a mid-turn tool call so consecutive deltas don't fuse into '...up.Got it' in the transcript and TTS output.
14
+
3
15
  ## 1.5.1
4
16
 
5
17
  ### Patch Changes
@@ -10,6 +10,12 @@
10
10
  * The guest sandbox never imports these functions, which is how the agent
11
11
  * bundle stays free of `@ai-sdk/anthropic` / `assemblyai` /
12
12
  * `@cartesia/cartesia-js`.
13
+ *
14
+ * `@ai-sdk/*` packages are loaded via `createRequire` lazily so self-hosted
15
+ * users only need to install the providers they actually reference. A
16
+ * missing package is reported as a friendly "package not installed" error
17
+ * at first session start, not as a module-load failure when the host
18
+ * package itself is imported.
13
19
  */
14
20
  import type { LanguageModel } from "ai";
15
21
  import type { LlmProvider, SttOpener, SttProvider, TtsOpener, TtsProvider } from "../../sdk/providers.ts";
@@ -27,7 +33,7 @@ export declare function resolveTts(descriptor: TtsProvider): TtsOpener;
27
33
  * Resolve an {@link LlmProvider} descriptor into a Vercel AI SDK
28
34
  * {@link LanguageModel}.
29
35
  *
30
- * The API key is pulled from the agent's env (e.g. `ANTHROPIC_API_KEY`).
36
+ * The API key is pulled from the agent's env (e.g. `OPENAI_API_KEY`).
31
37
  * Missing keys throw here — the pipeline session would fail on first
32
38
  * `streamText` call otherwise, and the error is clearer at construction.
33
39
  */
@@ -0,0 +1,16 @@
1
+ /**
2
+ * ElevenLabs Scribe streaming STT opener (host-only).
3
+ *
4
+ * The user-facing descriptor factory (`elevenlabs(...)`) lives in
5
+ * `sdk/providers/stt/elevenlabs.ts`. This module is the host-side
6
+ * counterpart: it takes the descriptor options + an API key and
7
+ * returns an {@link SttOpener} that the pipeline session drives.
8
+ *
9
+ * Default model: `"scribe_v2_realtime"`. Audio is sent as base64-encoded
10
+ * PCM_16000; partial transcripts arrive on `transcript`, finals on
11
+ * `committed_transcript`.
12
+ */
13
+ import type { ElevenLabsOptions } from "../../../sdk/providers/stt/elevenlabs.ts";
14
+ import { type SttOpener } from "../../../sdk/providers.ts";
15
+ /** Build an {@link SttOpener} from resolved ElevenLabs descriptor options. */
16
+ export declare function openElevenLabs(opts?: ElevenLabsOptions): SttOpener;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Soniox real-time STT opener (host-only).
3
+ *
4
+ * The user-facing descriptor factory (`soniox(...)`) lives in
5
+ * `sdk/providers/stt/soniox.ts`. This module is the host-side
6
+ * counterpart: it takes the descriptor options + an API key and
7
+ * returns an {@link SttOpener} that the pipeline session drives.
8
+ *
9
+ * Soniox's published JS client (`@soniox/speech-to-text-web`) is
10
+ * browser-only — it depends on `MediaRecorder` and `getUserMedia`. For
11
+ * server-side use we talk to the WebSocket directly:
12
+ * `wss://stt-rt.soniox.com/transcribe-websocket`
13
+ *
14
+ * Wire format:
15
+ * - First text frame: JSON config with api_key, model, audio_format,
16
+ * sample_rate, num_channels (and optional language hints).
17
+ * - Subsequent binary frames: 16-bit signed little-endian PCM audio.
18
+ * - Server replies: JSON `{ tokens: [{ text, is_final }] }` messages.
19
+ * Final tokens accumulate; non-final tokens are a rolling preview.
20
+ * - On error: `{ error_code, error_message }`.
21
+ */
22
+ import type { SonioxOptions } from "../../../sdk/providers/stt/soniox.ts";
23
+ import { type SttOpener } from "../../../sdk/providers.ts";
24
+ /** Build an {@link SttOpener} from resolved Soniox descriptor options. */
25
+ export declare function openSoniox(opts?: SonioxOptions): SttOpener;