voice-runtime 1.0.1 → 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.
- package/README.md +50 -25
- package/dist/index.cjs +22192 -10270
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +1324 -399
- package/dist/index.js +22198 -10302
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,23 +8,29 @@
|
|
|
8
8
|
[TVIC](https://github.com/Kkartik14/TVIC), a provider-neutral runtime for realtime
|
|
9
9
|
voice agents with bring-your-own telephony, speech, model, and synthesis providers.
|
|
10
10
|
|
|
11
|
+
New to the package? Start with the [beginner's guide](https://github.com/Kkartik14/TVIC/blob/main/docs/getting-started.md).
|
|
12
|
+
Use the [voice-agent guide](https://github.com/Kkartik14/TVIC/blob/main/docs/building-a-voice-agent.md)
|
|
13
|
+
for application design, [providers](https://github.com/Kkartik14/TVIC/blob/main/docs/providers.md)
|
|
14
|
+
for model setup, and [transports](https://github.com/Kkartik14/TVIC/blob/main/docs/transports.md)
|
|
15
|
+
for browser and phone connections.
|
|
16
|
+
|
|
11
17
|
## Status
|
|
12
18
|
|
|
13
|
-
`voice-runtime@1.
|
|
14
|
-
|
|
15
|
-
server-side only. The main CI compatibility matrix exercises
|
|
16
|
-
|
|
19
|
+
`voice-runtime@1.1.0` is the public Node.js entry point for the TVIC runtime. It
|
|
20
|
+
supports Node.js 22, 24, and 26, ships both ESM and CommonJS entry points, and is
|
|
21
|
+
server-side only. The main CI compatibility matrix exercises all three supported
|
|
22
|
+
lines.
|
|
17
23
|
|
|
18
24
|
Browser audio connects to a Node server through the browser-audio transport
|
|
19
25
|
adapter. Browser code does not import this package directly.
|
|
20
26
|
|
|
21
|
-
The stable managed API assembles the STT
|
|
27
|
+
The stable managed API assembles the STT -> LLM -> TTS pipeline from a prompt and
|
|
22
28
|
provider configuration. The host application still owns its HTTP server,
|
|
23
29
|
webhook authentication, browser-session authentication, and domain tools.
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
For a system overview, read [How it works](https://github.com/Kkartik14/TVIC/blob/main/docs/how-it-works.md).
|
|
32
|
+
For testing and deployment, read the [testing guide](https://github.com/Kkartik14/TVIC/blob/main/docs/testing.md)
|
|
33
|
+
and [deployment guide](https://github.com/Kkartik14/TVIC/blob/main/docs/deploying.md).
|
|
28
34
|
|
|
29
35
|
## Install
|
|
30
36
|
|
|
@@ -48,12 +54,13 @@ The command asks for `y` before writing `.claude/skills/tvic/SKILL.md` for Claud
|
|
|
48
54
|
Code and `.agents/skills/tvic/SKILL.md` for Codex and OpenRouter-compatible
|
|
49
55
|
agents. It does not run automatically during `npm install`, write to a home
|
|
50
56
|
directory, or overwrite an existing skill without `--force`. Use
|
|
51
|
-
`npx voice-runtime skills install --yes` in automation. See the [AI agent
|
|
52
|
-
guide](https://github.com/Kkartik14/TVIC/blob/main/docs/
|
|
57
|
+
`npx voice-runtime skills install --yes` in automation. See the [AI coding-agent
|
|
58
|
+
guide](https://github.com/Kkartik14/TVIC/blob/main/docs/ai-coding-agents.md) and
|
|
59
|
+
[skills reference](https://github.com/Kkartik14/TVIC/blob/main/docs/agent-skills.md).
|
|
53
60
|
|
|
54
61
|
## Prompt-first agent
|
|
55
62
|
|
|
56
|
-
The prompt-first API assembles the STT
|
|
63
|
+
The prompt-first API assembles the STT -> LLM -> TTS pipeline. It still needs an
|
|
57
64
|
authenticated transport `CallHandle`; `npm install` does not create a public
|
|
58
65
|
audio endpoint or a phone call for your application.
|
|
59
66
|
|
|
@@ -61,14 +68,14 @@ audio endpoint or a phone call for your application.
|
|
|
61
68
|
import { createVoiceAgent } from "voice-runtime";
|
|
62
69
|
|
|
63
70
|
const agent = createVoiceAgent({
|
|
64
|
-
prompt: "You schedule appointments for
|
|
71
|
+
prompt: "You schedule appointments for a doctor Be concise and confirm the time.",
|
|
65
72
|
providers: {
|
|
66
73
|
telephony: { provider: "web-client-audio" },
|
|
67
74
|
stt: { provider: "deepgram", apiKey: process.env.DEEPGRAM_API_KEY },
|
|
68
75
|
llm: {
|
|
69
|
-
provider: "
|
|
70
|
-
apiKey: process.env.
|
|
71
|
-
model: "gpt-
|
|
76
|
+
provider: "groq",
|
|
77
|
+
apiKey: process.env.GROQ_API_KEY,
|
|
78
|
+
model: "openai/gpt-oss-20b",
|
|
72
79
|
},
|
|
73
80
|
tts: {
|
|
74
81
|
provider: "cartesia",
|
|
@@ -153,17 +160,23 @@ outside the realtime critical path.
|
|
|
153
160
|
|
|
154
161
|
Each stage is configured independently. Built-in options currently include:
|
|
155
162
|
|
|
163
|
+
The complete matrix, catalog dates, official provider links, and live-test
|
|
164
|
+
guidance are in the [provider guide](https://github.com/Kkartik14/TVIC/blob/main/docs/providers.md).
|
|
165
|
+
|
|
156
166
|
- STT: Deepgram, Sarvam, ElevenLabs Scribe, AssemblyAI, and Soniox.
|
|
157
|
-
- LLM: OpenAI Responses.
|
|
158
|
-
- TTS: Cartesia and
|
|
167
|
+
- LLM: Groq Chat Completions (the reference path) and an optional OpenAI Responses adapter.
|
|
168
|
+
- TTS: Cartesia, ElevenLabs (WebSocket, REST, and HTTP stream), and Sarvam Bulbul v3.
|
|
159
169
|
- Transport: browser audio and inbound Twilio Media Streams.
|
|
160
170
|
|
|
161
171
|
Maturity is intentionally explicit: Web Client Audio and inbound Twilio Media
|
|
162
|
-
Streams are the stable transport paths in `1.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
172
|
+
Streams are the stable transport paths in `1.1.0`. The paid STT, LLM, and TTS
|
|
173
|
+
adapters are currently `experimental`. `validated` is the intermediate label
|
|
174
|
+
for an exact adapter/model/configuration that has passed the small-scale live
|
|
175
|
+
evidence profile and is reasonable for low-volume use; `stable` additionally
|
|
176
|
+
requires a support matrix, release evidence, ownership, and an upgrade policy.
|
|
177
|
+
The root exports `PROVIDER_STABILITY` and `PROVIDER_STABILITY_LEVELS` contain
|
|
178
|
+
the machine-readable labels. See the provider guide for the complete evidence
|
|
179
|
+
and promotion rules.
|
|
167
180
|
|
|
168
181
|
Pass an explicit `apiKey` or use the documented environment variable. Explicit
|
|
169
182
|
credentials take precedence; missing credentials fail before a live session is
|
|
@@ -176,14 +189,19 @@ created.
|
|
|
176
189
|
| ElevenLabs | `ELEVENLABS_API_KEY` |
|
|
177
190
|
| AssemblyAI | `ASSEMBLYAI_API_KEY` |
|
|
178
191
|
| Soniox | `SONIOX_API_KEY` |
|
|
192
|
+
| Groq | `GROQ_API_KEY` |
|
|
179
193
|
| OpenAI | `OPENAI_API_KEY` |
|
|
180
194
|
| Cartesia | `CARTESIA_API_KEY` |
|
|
195
|
+
| Sarvam TTS | `SARVAM_API_KEY` |
|
|
181
196
|
|
|
182
197
|
STT, LLM, and TTS models are independent settings. TTS voice selection is also
|
|
183
198
|
independent. Built-in TTS can read `CARTESIA_VOICE_ID` or
|
|
184
199
|
`ELEVENLABS_VOICE_ID` for its voice. For complete provider-specific control,
|
|
185
200
|
pass a constructed provider instance instead of a built-in configuration object.
|
|
186
|
-
|
|
201
|
+
Sarvam's managed configuration defaults to its WebSocket adapter; set
|
|
202
|
+
`transport: "rest"` or `transport: "http-stream"` on the Sarvam TTS config when
|
|
203
|
+
the downstream use case needs one-shot HTTP delivery.
|
|
204
|
+
Built-in STT and LLM configurations reject models outside the
|
|
187
205
|
dated TVIC catalog unless `allowUnknownModel: true` is explicitly set.
|
|
188
206
|
|
|
189
207
|
Tools are application-owned functions. Define their schema and executor once,
|
|
@@ -207,7 +225,7 @@ const bookAppointment = defineTool<{ date: string }, { booked: boolean }>({
|
|
|
207
225
|
const providers = {
|
|
208
226
|
telephony: { provider: "web-client-audio" as const },
|
|
209
227
|
stt: { provider: "deepgram" as const, apiKey: process.env.DEEPGRAM_API_KEY },
|
|
210
|
-
llm: { provider: "
|
|
228
|
+
llm: { provider: "groq" as const, apiKey: process.env.GROQ_API_KEY },
|
|
211
229
|
tts: {
|
|
212
230
|
provider: "cartesia" as const,
|
|
213
231
|
apiKey: process.env.CARTESIA_API_KEY,
|
|
@@ -230,9 +248,13 @@ application's responsibility.
|
|
|
230
248
|
|
|
231
249
|
Advanced runtime, media, provider, normalized-error, and durable-adapter APIs
|
|
232
250
|
are exported from the package root. There are no advanced subpath imports in
|
|
233
|
-
1.
|
|
251
|
+
1.1.0. This lets a developer start with `createVoiceAgent` and later own
|
|
234
252
|
the runtime/session/pipeline boundaries without changing package names.
|
|
235
253
|
|
|
254
|
+
Read the [voice-agent guide](https://github.com/Kkartik14/TVIC/blob/main/docs/building-a-voice-agent.md)
|
|
255
|
+
for the managed to composable migration path and the [API reference](https://github.com/Kkartik14/TVIC/blob/main/docs/api-reference.md)
|
|
256
|
+
for the root exports.
|
|
257
|
+
|
|
236
258
|
The host remains responsible for creating authenticated transport connections,
|
|
237
259
|
owning HTTP/webhook lifecycle, and implementing application-domain tools. TVIC
|
|
238
260
|
does not automatically create public unauthenticated endpoints or choose a
|
|
@@ -244,6 +266,9 @@ The root also exposes the PostgreSQL and Redis durability building blocks. The
|
|
|
244
266
|
database drivers are intentionally injected, so install and configure `pg` and
|
|
245
267
|
`redis` in your application:
|
|
246
268
|
|
|
269
|
+
The [persistence guide](https://github.com/Kkartik14/TVIC/blob/main/docs/persistence.md)
|
|
270
|
+
covers migrations, memory scopes, Docker, ownership, and production retention.
|
|
271
|
+
|
|
247
272
|
```ts
|
|
248
273
|
import {
|
|
249
274
|
createPostgresMemory,
|