voice-runtime 1.0.0 → 1.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.
- package/README.md +59 -18
- package/bin/voice-runtime.mjs +248 -0
- package/dist/index.cjs +7353 -2064
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +372 -158
- package/dist/index.js +7342 -2059
- package/dist/index.js.map +4 -4
- package/package.json +7 -2
- package/skills/tvic/SKILL.md +79 -0
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "voice-runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Local-first, provider-neutral runtime for realtime voice agents, powered by TVIC.",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"voice-runtime": "./bin/voice-runtime.mjs"
|
|
8
|
+
},
|
|
6
9
|
"main": "./dist/index.cjs",
|
|
7
10
|
"module": "./dist/index.js",
|
|
8
11
|
"types": "./dist/index.d.ts",
|
|
@@ -16,6 +19,8 @@
|
|
|
16
19
|
},
|
|
17
20
|
"files": [
|
|
18
21
|
"dist",
|
|
22
|
+
"bin",
|
|
23
|
+
"skills",
|
|
19
24
|
"README.md",
|
|
20
25
|
"LICENSE"
|
|
21
26
|
],
|
|
@@ -68,7 +73,7 @@
|
|
|
68
73
|
"vitest": "^2.1.8"
|
|
69
74
|
},
|
|
70
75
|
"engines": {
|
|
71
|
-
"node": "
|
|
76
|
+
"node": "^22.0.0 || ^24.0.0 || ^26.0.0"
|
|
72
77
|
},
|
|
73
78
|
"publishConfig": {
|
|
74
79
|
"access": "public"
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tvic
|
|
3
|
+
description: Use when building, configuring, testing, or debugging a voice agent with voice-runtime or TVIC. Covers the prompt-first API, composable runtime, providers, transports, events, persistence, and security boundaries.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TVIC development guidance
|
|
7
|
+
|
|
8
|
+
Use this skill when the project uses `voice-runtime` or the TVIC runtime. It is
|
|
9
|
+
guidance for the coding agent, not a replacement for the host application's
|
|
10
|
+
authorization or business rules.
|
|
11
|
+
|
|
12
|
+
## Start with the installed package
|
|
13
|
+
|
|
14
|
+
Before suggesting code, inspect the installed `voice-runtime` version and read
|
|
15
|
+
`node_modules/voice-runtime/README.md` when it exists. Prefer APIs exported from
|
|
16
|
+
the package root. Do not invent exports or copy repository-only imports into a
|
|
17
|
+
consumer application.
|
|
18
|
+
|
|
19
|
+
## Core model
|
|
20
|
+
|
|
21
|
+
TVIC runs a server-side cascaded voice pipeline:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
transport -> speech to text -> turn handling -> language model and tools -> text to speech -> transport
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The host application supplies an authenticated `CallHandle`, chooses providers,
|
|
28
|
+
and owns the HTTP or WebSocket lifecycle. A prompt configures behavior, but a
|
|
29
|
+
prompt does not create a phone call, public endpoint, user authentication, or
|
|
30
|
+
permission to change business data.
|
|
31
|
+
|
|
32
|
+
## Managed API
|
|
33
|
+
|
|
34
|
+
Use `createVoiceAgent` when the application wants TVIC to assemble the standard
|
|
35
|
+
speech to text, language model, and text to speech pipeline. Configure every
|
|
36
|
+
required provider explicitly. Start a session only after the host has
|
|
37
|
+
authenticated the connection and created or received its `CallHandle`.
|
|
38
|
+
|
|
39
|
+
The managed run is both an event stream and an awaitable final result. Consume
|
|
40
|
+
events for live UI, transcripts, errors, and audio state, then await the same run
|
|
41
|
+
for the final outcome. Do not assume that audio sent to a socket was heard. Use
|
|
42
|
+
the transport's playout acknowledgement when deciding whether a response was
|
|
43
|
+
delivered.
|
|
44
|
+
|
|
45
|
+
## Composable API
|
|
46
|
+
|
|
47
|
+
Use the lower-level root exports when the application needs to own part of the
|
|
48
|
+
pipeline or provide a custom STT, language model, text to speech, telephony,
|
|
49
|
+
memory, or durable-store implementation. Preserve TVIC's normalized contracts,
|
|
50
|
+
capability declarations, cancellation behavior, and event semantics.
|
|
51
|
+
|
|
52
|
+
## Providers and models
|
|
53
|
+
|
|
54
|
+
Use built-in adapters only with their documented provider names, credentials,
|
|
55
|
+
models, and maturity labels. Do not describe an experimental adapter as stable.
|
|
56
|
+
If a provider or model is not in the built-in catalog, prefer a constructed
|
|
57
|
+
custom provider or the explicit unknown-model option rather than silently
|
|
58
|
+
changing the user's selection.
|
|
59
|
+
|
|
60
|
+
## Tools and security
|
|
61
|
+
|
|
62
|
+
Tools belong to the host application. Validate their inputs and outputs, enforce
|
|
63
|
+
authorization and confirmation for irreversible actions, and make retries safe
|
|
64
|
+
when an action can be performed twice. Keep provider keys, signing secrets,
|
|
65
|
+
database URLs, transcripts, and recordings on the server. Treat caller speech,
|
|
66
|
+
transcripts, prompts, tool arguments, and external controller data as untrusted.
|
|
67
|
+
|
|
68
|
+
## Testing and troubleshooting
|
|
69
|
+
|
|
70
|
+
For a consumer project, test the exact transport and provider configuration being
|
|
71
|
+
used. Mock providers are useful for deterministic tests, but they do not prove a
|
|
72
|
+
live provider works. When debugging a missing response, trace the complete path:
|
|
73
|
+
authenticated transport, inbound media, transcript finality, completed turn,
|
|
74
|
+
model or tool result, synthesized audio, transport receipt, and playout evidence.
|
|
75
|
+
|
|
76
|
+
When changing a public contract, add a test through the public package entry
|
|
77
|
+
point and update the relevant documentation. Report uncertainty instead of
|
|
78
|
+
claiming delivery, cancellation, provider stability, or authorization behavior
|
|
79
|
+
that the underlying integration does not prove.
|