@ozaiya/openclaw-channel 0.6.0 → 0.7.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.
@@ -0,0 +1,332 @@
1
+ /**
2
+ * VoiceCallSession — Manages a bot's participation in a LiveKit voice call.
3
+ *
4
+ * Pipeline: User speaks → LiveKit audio track → Deepgram Nova-2 STT (WebSocket)
5
+ * → transcript → onTranscript callback (agent dispatch) → reply text
6
+ * → Deepgram Aura TTS (HTTP, sentence-by-sentence) → LiveKit audio publish → User hears bot
7
+ */
8
+ import { Room, RoomEvent, LocalAudioTrack, AudioSource, AudioStream, AudioFrame, TrackKind, } from "@livekit/rtc-node";
9
+ import { TrackPublishOptions } from "@livekit/rtc-node";
10
+ import { TrackSource } from "@livekit/rtc-node";
11
+ import { createClient, LiveTranscriptionEvents } from "@deepgram/sdk";
12
+ export function resolveVoiceCallConfig(cfg) {
13
+ const deepgramApiKey = cfg.deepgramApiKey || process.env.DEEPGRAM_API_KEY || "";
14
+ return {
15
+ deepgramApiKey,
16
+ sttModel: cfg.stt?.model ?? "nova-2",
17
+ sttLanguage: cfg.stt?.language ?? "en",
18
+ utteranceEndMs: cfg.stt?.utteranceEndMs ?? 500,
19
+ endpointing: cfg.stt?.endpointing ?? 300,
20
+ ttsModel: cfg.tts?.model ?? "aura-asteria-en",
21
+ silenceTimeoutSeconds: cfg.silenceTimeoutSeconds ?? 120,
22
+ };
23
+ }
24
+ export class VoiceCallSession {
25
+ callId;
26
+ groupId;
27
+ room;
28
+ config;
29
+ livekitToken;
30
+ livekitUrl;
31
+ onTranscript;
32
+ log;
33
+ audioSource = null;
34
+ localAudioTrack = null;
35
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
+ deepgramConnection = null;
37
+ keepAliveInterval = null;
38
+ silenceTimer = null;
39
+ connected = false;
40
+ disposed = false;
41
+ // TTS playback state for barge-in support
42
+ currentTtsAbort = null;
43
+ constructor(options) {
44
+ this.callId = options.callId;
45
+ this.groupId = options.groupId;
46
+ this.livekitToken = options.livekitToken;
47
+ this.livekitUrl = options.livekitUrl;
48
+ this.config = resolveVoiceCallConfig(options.voiceCallConfig);
49
+ this.onTranscript = options.onTranscript;
50
+ this.log = options.log;
51
+ this.room = new Room();
52
+ }
53
+ /**
54
+ * Connect to the LiveKit room, publish a local audio track,
55
+ * subscribe to remote audio, and start the Deepgram STT pipeline.
56
+ */
57
+ async connect() {
58
+ if (this.disposed)
59
+ return;
60
+ if (!this.config.deepgramApiKey) {
61
+ throw new Error("VoiceCallSession: deepgramApiKey is required");
62
+ }
63
+ this.log?.info?.(`[voice-call:${this.callId}] connecting to LiveKit room`);
64
+ // Create AudioSource for TTS output (48kHz mono, matching Deepgram Aura output)
65
+ this.audioSource = new AudioSource(48000, 1);
66
+ // Create local audio track from the source
67
+ this.localAudioTrack = LocalAudioTrack.createAudioTrack("bot-voice", this.audioSource);
68
+ // Listen for remote track subscriptions
69
+ this.room.on(RoomEvent.TrackSubscribed, (track, publication, participant) => {
70
+ this.handleTrackSubscribed(track, publication, participant);
71
+ });
72
+ // Connect to LiveKit room
73
+ await this.room.connect(this.livekitUrl, this.livekitToken, {
74
+ autoSubscribe: true,
75
+ dynacast: true,
76
+ });
77
+ this.connected = true;
78
+ // Publish our audio track
79
+ if (this.room.localParticipant) {
80
+ await this.room.localParticipant.publishTrack(this.localAudioTrack, new TrackPublishOptions({
81
+ source: TrackSource.SOURCE_MICROPHONE,
82
+ }));
83
+ }
84
+ // Connect Deepgram STT
85
+ this.connectStt();
86
+ // Subscribe to any already-connected remote audio tracks
87
+ for (const [, participant] of this.room.remoteParticipants) {
88
+ for (const [, publication] of participant.trackPublications) {
89
+ if (publication.track && publication.kind === TrackKind.KIND_AUDIO) {
90
+ this.startAudioPipeline(publication.track, participant);
91
+ }
92
+ }
93
+ }
94
+ // Start silence timeout
95
+ this.resetSilenceTimer();
96
+ this.log?.info?.(`[voice-call:${this.callId}] connected and publishing audio`);
97
+ }
98
+ /**
99
+ * Disconnect from the LiveKit room and clean up all resources.
100
+ */
101
+ async disconnect() {
102
+ if (this.disposed)
103
+ return;
104
+ this.disposed = true;
105
+ this.connected = false;
106
+ this.log?.info?.(`[voice-call:${this.callId}] disconnecting`);
107
+ // Cancel any in-flight TTS
108
+ this.cancelCurrentPlayback();
109
+ // Stop silence timer
110
+ if (this.silenceTimer) {
111
+ clearTimeout(this.silenceTimer);
112
+ this.silenceTimer = null;
113
+ }
114
+ // Stop keepalive
115
+ if (this.keepAliveInterval) {
116
+ clearInterval(this.keepAliveInterval);
117
+ this.keepAliveInterval = null;
118
+ }
119
+ // Close Deepgram connection
120
+ if (this.deepgramConnection) {
121
+ try {
122
+ this.deepgramConnection.requestClose();
123
+ }
124
+ catch {
125
+ // ignore
126
+ }
127
+ this.deepgramConnection = null;
128
+ }
129
+ // Close audio source and track
130
+ if (this.localAudioTrack) {
131
+ try {
132
+ await this.localAudioTrack.close(true);
133
+ }
134
+ catch {
135
+ // ignore
136
+ }
137
+ this.localAudioTrack = null;
138
+ this.audioSource = null;
139
+ }
140
+ // Disconnect from LiveKit
141
+ try {
142
+ await this.room.disconnect();
143
+ }
144
+ catch {
145
+ // ignore
146
+ }
147
+ }
148
+ /**
149
+ * Synthesize text to speech using Deepgram Aura and play it through the LiveKit audio track.
150
+ * Supports sentence-level streaming — call multiple times for each sentence.
151
+ */
152
+ async speakText(text, abortSignal) {
153
+ if (this.disposed || !this.audioSource)
154
+ return;
155
+ const url = `https://api.deepgram.com/v1/speak?model=${encodeURIComponent(this.config.ttsModel)}&encoding=linear16&sample_rate=48000`;
156
+ const res = await fetch(url, {
157
+ method: "POST",
158
+ headers: {
159
+ Authorization: `Token ${this.config.deepgramApiKey}`,
160
+ "Content-Type": "application/json",
161
+ },
162
+ body: JSON.stringify({ text }),
163
+ signal: abortSignal,
164
+ });
165
+ if (!res.ok) {
166
+ this.log?.warn?.(`[voice-call:${this.callId}] TTS error: ${res.status} ${res.statusText}`);
167
+ return;
168
+ }
169
+ const arrayBuffer = await res.arrayBuffer();
170
+ if (abortSignal?.aborted)
171
+ return;
172
+ const pcmData = new Int16Array(arrayBuffer);
173
+ // Send audio in 20ms frames at 48kHz mono (48000 * 0.020 = 960 samples per frame)
174
+ const samplesPerFrame = 960;
175
+ for (let i = 0; i < pcmData.length; i += samplesPerFrame) {
176
+ if (abortSignal?.aborted || this.disposed)
177
+ return;
178
+ const end = Math.min(i + samplesPerFrame, pcmData.length);
179
+ const frameData = pcmData.slice(i, end);
180
+ const frame = new AudioFrame(frameData, 48000, 1, frameData.length);
181
+ await this.audioSource.captureFrame(frame);
182
+ }
183
+ }
184
+ /**
185
+ * Speak a full agent reply with sentence-level streaming.
186
+ * Splits text into sentences and speaks each one immediately for lower latency.
187
+ */
188
+ async speakReply(text) {
189
+ if (this.disposed)
190
+ return;
191
+ // Create abort controller for barge-in support
192
+ const abort = new AbortController();
193
+ this.currentTtsAbort = abort;
194
+ try {
195
+ const sentences = splitIntoSentences(text);
196
+ for (const sentence of sentences) {
197
+ if (abort.signal.aborted || this.disposed)
198
+ return;
199
+ await this.speakText(sentence, abort.signal);
200
+ }
201
+ }
202
+ catch (err) {
203
+ if (abort.signal.aborted)
204
+ return; // Expected on barge-in
205
+ throw err;
206
+ }
207
+ finally {
208
+ if (this.currentTtsAbort === abort) {
209
+ this.currentTtsAbort = null;
210
+ }
211
+ }
212
+ }
213
+ /**
214
+ * Cancel any in-progress TTS playback (barge-in).
215
+ */
216
+ cancelCurrentPlayback() {
217
+ if (this.currentTtsAbort) {
218
+ this.currentTtsAbort.abort();
219
+ this.currentTtsAbort = null;
220
+ }
221
+ // Clear any queued audio
222
+ this.audioSource?.clearQueue();
223
+ }
224
+ // --- Private methods ---
225
+ connectStt() {
226
+ const deepgram = createClient(this.config.deepgramApiKey);
227
+ const connection = deepgram.listen.live({
228
+ model: this.config.sttModel,
229
+ language: this.config.sttLanguage,
230
+ encoding: "linear16",
231
+ sample_rate: 16000,
232
+ channels: 1,
233
+ interim_results: true,
234
+ utterance_end_ms: this.config.utteranceEndMs,
235
+ endpointing: this.config.endpointing,
236
+ vad_events: true,
237
+ smart_format: true,
238
+ });
239
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
240
+ connection.on(LiveTranscriptionEvents.Transcript, (data) => {
241
+ const transcript = data.channel?.alternatives?.[0]?.transcript;
242
+ if (transcript && transcript.trim().length > 0) {
243
+ const isFinal = data.is_final ?? false;
244
+ if (isFinal) {
245
+ this.resetSilenceTimer();
246
+ this.log?.info?.(`[voice-call:${this.callId}] STT final: "${transcript.trim()}"`);
247
+ this.onTranscript(transcript.trim());
248
+ }
249
+ }
250
+ });
251
+ connection.on(LiveTranscriptionEvents.SpeechStarted, () => {
252
+ // Barge-in: user started speaking, cancel current playback
253
+ this.cancelCurrentPlayback();
254
+ });
255
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
256
+ connection.on(LiveTranscriptionEvents.Error, (err) => {
257
+ this.log?.warn?.(`[voice-call:${this.callId}] Deepgram STT error: ${String(err)}`);
258
+ });
259
+ this.deepgramConnection = connection;
260
+ // KeepAlive every 5s to prevent WebSocket timeout
261
+ this.keepAliveInterval = setInterval(() => {
262
+ try {
263
+ if (this.deepgramConnection) {
264
+ this.deepgramConnection.keepAlive();
265
+ }
266
+ }
267
+ catch {
268
+ // ignore
269
+ }
270
+ }, 5000);
271
+ }
272
+ handleTrackSubscribed(track, _publication, participant) {
273
+ if (track.kind !== TrackKind.KIND_AUDIO)
274
+ return;
275
+ this.startAudioPipeline(track, participant);
276
+ }
277
+ startAudioPipeline(track, _participant) {
278
+ if (this.disposed || !this.deepgramConnection)
279
+ return;
280
+ this.log?.info?.(`[voice-call:${this.callId}] subscribing to audio from participant`);
281
+ // Create audio stream resampled to 16kHz mono for Deepgram
282
+ const audioStream = new AudioStream(track, { sampleRate: 16000, numChannels: 1 });
283
+ const dgConn = this.deepgramConnection;
284
+ // Forward audio frames to Deepgram
285
+ void (async () => {
286
+ for await (const frame of audioStream) {
287
+ if (this.disposed || !this.deepgramConnection)
288
+ break;
289
+ try {
290
+ // Deepgram send() expects ArrayBufferLike — use the underlying ArrayBuffer
291
+ const data = frame.data;
292
+ const arrayBuffer = data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
293
+ dgConn.send(arrayBuffer);
294
+ }
295
+ catch {
296
+ // Connection may be closing
297
+ break;
298
+ }
299
+ }
300
+ })();
301
+ }
302
+ resetSilenceTimer() {
303
+ if (this.silenceTimer) {
304
+ clearTimeout(this.silenceTimer);
305
+ }
306
+ this.silenceTimer = setTimeout(() => {
307
+ this.log?.info?.(`[voice-call:${this.callId}] silence timeout (${this.config.silenceTimeoutSeconds}s), disconnecting`);
308
+ void this.disconnect();
309
+ }, this.config.silenceTimeoutSeconds * 1000);
310
+ }
311
+ }
312
+ /**
313
+ * Split text into sentences for streaming TTS.
314
+ * Detects sentence boundaries at . ! ? followed by whitespace or end of string.
315
+ */
316
+ function splitIntoSentences(text) {
317
+ const sentences = [];
318
+ const regex = /[^.!?]*[.!?]+[\s]*/g;
319
+ let match;
320
+ let lastIndex = 0;
321
+ while ((match = regex.exec(text)) !== null) {
322
+ sentences.push(match[0].trim());
323
+ lastIndex = regex.lastIndex;
324
+ }
325
+ // Remaining text without sentence-ending punctuation
326
+ const remainder = text.slice(lastIndex).trim();
327
+ if (remainder) {
328
+ sentences.push(remainder);
329
+ }
330
+ return sentences.length > 0 ? sentences : [text];
331
+ }
332
+ //# sourceMappingURL=voiceCall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voiceCall.js","sourceRoot":"","sources":["../../src/voiceCall.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,IAAI,EACJ,SAAS,EACT,eAAe,EACf,WAAW,EACX,WAAW,EACX,UAAU,EACV,SAAS,GAIV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBA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SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAChC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;IAC9B,CAAC;IAED,qDAAqD;IACrD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/C,IAAI,SAAS,EAAE,CAAC;QACd,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozaiya/openclaw-channel",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "description": "OpenClaw channel plugin for Ozaiya Chat",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -62,6 +62,8 @@
62
62
  "openclaw": ">=2026.0.0"
63
63
  },
64
64
  "dependencies": {
65
+ "@deepgram/sdk": "^4.11.0",
66
+ "@livekit/rtc-node": "^0.13.0",
65
67
  "libsodium-wrappers": "^0.7.15",
66
68
  "socket.io-client": "^4.8.1"
67
69
  },