voice-runtime 0.0.2 → 1.0.1

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/package.json CHANGED
@@ -1,20 +1,26 @@
1
1
  {
2
2
  "name": "voice-runtime",
3
- "version": "0.0.2",
3
+ "version": "1.0.1",
4
4
  "description": "Local-first, provider-neutral runtime for realtime voice agents, powered by TVIC.",
5
5
  "type": "module",
6
- "main": "./index.js",
7
- "types": "./index.d.ts",
6
+ "bin": {
7
+ "voice-runtime": "./bin/voice-runtime.mjs"
8
+ },
9
+ "main": "./dist/index.cjs",
10
+ "module": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
8
12
  "exports": {
9
13
  ".": {
10
- "types": "./index.d.ts",
11
- "import": "./index.js",
12
- "default": "./index.js"
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js",
16
+ "require": "./dist/index.cjs",
17
+ "default": "./dist/index.js"
13
18
  }
14
19
  },
15
20
  "files": [
16
- "index.js",
17
- "index.d.ts",
21
+ "dist",
22
+ "bin",
23
+ "skills",
18
24
  "README.md",
19
25
  "LICENSE"
20
26
  ],
@@ -38,6 +44,34 @@
38
44
  "tvic"
39
45
  ],
40
46
  "license": "Apache-2.0",
47
+ "scripts": {
48
+ "build": "node build.mjs",
49
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json",
50
+ "test": "vitest run",
51
+ "clean": "rm -rf dist dist-types .turbo *.tsbuildinfo"
52
+ },
53
+ "dependencies": {
54
+ "@types/node": "^22.19.19",
55
+ "@types/ws": "^8.18.1",
56
+ "ws": "^8.21.0"
57
+ },
58
+ "devDependencies": {
59
+ "@tvic/core": "workspace:*",
60
+ "@tvic/dal": "workspace:*",
61
+ "@tvic/dal-composite": "workspace:*",
62
+ "@tvic/dal-postgres": "workspace:*",
63
+ "@tvic/dal-postgres-memory": "workspace:*",
64
+ "@tvic/dal-redis": "workspace:*",
65
+ "@tvic/media": "workspace:*",
66
+ "@tvic/providers": "workspace:*",
67
+ "@tvic/runtime": "workspace:*",
68
+ "@tvic/tools": "workspace:*",
69
+ "esbuild": "^0.28.0",
70
+ "rollup": "^4.60.4",
71
+ "rollup-plugin-dts": "^6.3.0",
72
+ "typescript": "^5.7.2",
73
+ "vitest": "^2.1.8"
74
+ },
41
75
  "engines": {
42
76
  "node": ">=20.0.0"
43
77
  },
@@ -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.
package/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export interface VoiceRuntimeIdentity {
2
- readonly name: "voice-runtime";
3
- readonly project: "TVIC";
4
- readonly stage: "early-preview";
5
- readonly repository: "https://github.com/Kkartik14/TVIC";
6
- }
7
-
8
- export declare const voiceRuntime: VoiceRuntimeIdentity;
package/index.js DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * Public identity for the early voice-runtime preview.
3
- *
4
- * The executable createVoiceAgent API will land here once its contract is
5
- * stable enough for external users. Publishing this explicit preview avoids
6
- * presenting an unfinished runtime API as production-ready.
7
- */
8
- export const voiceRuntime = Object.freeze({
9
- name: "voice-runtime",
10
- project: "TVIC",
11
- stage: "early-preview",
12
- repository: "https://github.com/Kkartik14/TVIC",
13
- });