@framers/agentos 0.1.108 → 0.1.109
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/dist/voice-pipeline/AcousticEndpointDetector.d.ts +95 -20
- package/dist/voice-pipeline/AcousticEndpointDetector.d.ts.map +1 -1
- package/dist/voice-pipeline/AcousticEndpointDetector.js +110 -24
- package/dist/voice-pipeline/AcousticEndpointDetector.js.map +1 -1
- package/dist/voice-pipeline/HardCutBargeinHandler.d.ts +66 -15
- package/dist/voice-pipeline/HardCutBargeinHandler.d.ts.map +1 -1
- package/dist/voice-pipeline/HardCutBargeinHandler.js +65 -13
- package/dist/voice-pipeline/HardCutBargeinHandler.js.map +1 -1
- package/dist/voice-pipeline/HeuristicEndpointDetector.d.ts +116 -42
- package/dist/voice-pipeline/HeuristicEndpointDetector.d.ts.map +1 -1
- package/dist/voice-pipeline/HeuristicEndpointDetector.js +159 -52
- package/dist/voice-pipeline/HeuristicEndpointDetector.js.map +1 -1
- package/dist/voice-pipeline/SoftFadeBargeinHandler.d.ts +89 -24
- package/dist/voice-pipeline/SoftFadeBargeinHandler.d.ts.map +1 -1
- package/dist/voice-pipeline/SoftFadeBargeinHandler.js +74 -20
- package/dist/voice-pipeline/SoftFadeBargeinHandler.js.map +1 -1
- package/dist/voice-pipeline/VoiceInterruptError.d.ts +68 -10
- package/dist/voice-pipeline/VoiceInterruptError.d.ts.map +1 -1
- package/dist/voice-pipeline/VoiceInterruptError.js +53 -6
- package/dist/voice-pipeline/VoiceInterruptError.js.map +1 -1
- package/dist/voice-pipeline/VoicePipelineOrchestrator.d.ts +190 -39
- package/dist/voice-pipeline/VoicePipelineOrchestrator.d.ts.map +1 -1
- package/dist/voice-pipeline/VoicePipelineOrchestrator.js +266 -53
- package/dist/voice-pipeline/VoicePipelineOrchestrator.js.map +1 -1
- package/dist/voice-pipeline/WebSocketStreamTransport.d.ts +135 -43
- package/dist/voice-pipeline/WebSocketStreamTransport.d.ts.map +1 -1
- package/dist/voice-pipeline/WebSocketStreamTransport.js +109 -47
- package/dist/voice-pipeline/WebSocketStreamTransport.js.map +1 -1
- package/dist/voice-pipeline/index.d.ts +34 -1
- package/dist/voice-pipeline/index.d.ts.map +1 -1
- package/dist/voice-pipeline/index.js +41 -1
- package/dist/voice-pipeline/index.js.map +1 -1
- package/dist/voice-pipeline/types.d.ts +432 -106
- package/dist/voice-pipeline/types.d.ts.map +1 -1
- package/dist/voice-pipeline/types.js +21 -9
- package/dist/voice-pipeline/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,102 +5,186 @@
|
|
|
5
5
|
* TTS, barge-in handling, and the agent session into a coordinated real-time
|
|
6
6
|
* voice conversation loop.
|
|
7
7
|
*
|
|
8
|
-
* State transitions
|
|
8
|
+
* ## State transitions
|
|
9
|
+
*
|
|
9
10
|
* ```
|
|
10
|
-
* IDLE
|
|
11
|
-
* LISTENING
|
|
12
|
-
* PROCESSING
|
|
13
|
-
* SPEAKING
|
|
14
|
-
* SPEAKING
|
|
15
|
-
* ANY
|
|
11
|
+
* IDLE -----> startSession() ---------> LISTENING
|
|
12
|
+
* LISTENING -> turn_complete ----------> PROCESSING
|
|
13
|
+
* PROCESSING -> LLM tokens start -----> SPEAKING
|
|
14
|
+
* SPEAKING --> TTS flush_complete -----> LISTENING
|
|
15
|
+
* SPEAKING --> barge-in (cancel) ------> INTERRUPTING -> LISTENING
|
|
16
|
+
* ANY ------> transport disconnect ----> CLOSED
|
|
17
|
+
* ANY ------> stopSession() -----------> CLOSED
|
|
16
18
|
* ```
|
|
19
|
+
*
|
|
20
|
+
* ## Design notes
|
|
21
|
+
*
|
|
22
|
+
* - The orchestrator does NOT resolve providers from ExtensionManager yet.
|
|
23
|
+
* All components must be injected via {@link VoicePipelineOverrides}.
|
|
24
|
+
* ExtensionManager integration is a planned future task.
|
|
25
|
+
* - Event wiring is done once during {@link startSession} and never rewired.
|
|
26
|
+
* The transport/STT/TTS sessions are immutable for the session's lifetime.
|
|
27
|
+
* - A watchdog timer prevents the pipeline from staying in LISTENING forever
|
|
28
|
+
* if the user walks away (default 30 s). The watchdog resets after each
|
|
29
|
+
* completed turn.
|
|
17
30
|
*/
|
|
18
31
|
import { EventEmitter } from 'node:events';
|
|
19
32
|
import { randomUUID } from 'node:crypto';
|
|
33
|
+
// ============================================================================
|
|
34
|
+
// Orchestrator
|
|
35
|
+
// ============================================================================
|
|
20
36
|
/**
|
|
21
37
|
* VoicePipelineOrchestrator is the central state machine for the AgentOS
|
|
22
38
|
* streaming voice pipeline. It coordinates audio capture, speech recognition,
|
|
23
39
|
* endpoint detection, agent inference, text-to-speech synthesis, and barge-in
|
|
24
40
|
* handling into a seamless real-time conversation loop.
|
|
25
41
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
42
|
+
* ## Events emitted
|
|
43
|
+
*
|
|
44
|
+
* | Event | Payload |
|
|
45
|
+
* |-------------------|----------------------------------------------|
|
|
46
|
+
* | `'state_changed'` | `{ from: PipelineState, to: PipelineState }` |
|
|
47
|
+
* | `'turn_complete'` | {@link TurnCompleteEvent} |
|
|
48
|
+
*
|
|
49
|
+
* @see {@link VoicePipelineSession} for the public session interface returned by {@link startSession}.
|
|
28
50
|
*/
|
|
29
51
|
export class VoicePipelineOrchestrator extends EventEmitter {
|
|
30
|
-
|
|
52
|
+
// --------------------------------------------------------------------------
|
|
53
|
+
// Public getters
|
|
54
|
+
// --------------------------------------------------------------------------
|
|
55
|
+
/**
|
|
56
|
+
* Current pipeline state (read-only).
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* if (orchestrator.state === 'listening') {
|
|
61
|
+
* console.log('Waiting for user input...');
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
31
65
|
get state() {
|
|
32
66
|
return this._state;
|
|
33
67
|
}
|
|
68
|
+
// --------------------------------------------------------------------------
|
|
69
|
+
// Constructor
|
|
70
|
+
// --------------------------------------------------------------------------
|
|
71
|
+
/**
|
|
72
|
+
* Create a new orchestrator with the given pipeline configuration.
|
|
73
|
+
*
|
|
74
|
+
* The orchestrator starts in `'idle'` state. Call {@link startSession}
|
|
75
|
+
* to wire up components and transition to `'listening'`.
|
|
76
|
+
*
|
|
77
|
+
* @param config - Top-level pipeline configuration specifying providers and options.
|
|
78
|
+
*/
|
|
34
79
|
constructor(config) {
|
|
35
80
|
super();
|
|
36
81
|
this.config = config;
|
|
37
|
-
|
|
82
|
+
// --------------------------------------------------------------------------
|
|
83
|
+
// Private state
|
|
84
|
+
// --------------------------------------------------------------------------
|
|
85
|
+
/** Current pipeline state. Transitions are managed exclusively by {@link _setState}. */
|
|
38
86
|
this._state = 'idle';
|
|
39
|
-
/** Active
|
|
87
|
+
/** Active STT session created during {@link startSession}. Null when idle or closed. */
|
|
40
88
|
this._sttSession = null;
|
|
89
|
+
/** Active TTS session created during {@link startSession}. Null when idle or closed. */
|
|
41
90
|
this._ttsSession = null;
|
|
91
|
+
/** The endpoint detector wired during {@link startSession}. Null when idle or closed. */
|
|
42
92
|
this._endpointDetector = null;
|
|
93
|
+
/** The barge-in handler consulted when speech is detected during SPEAKING. Null when idle or closed. */
|
|
43
94
|
this._bargeinHandler = null;
|
|
95
|
+
/** The transport bound to this session. Null when idle or closed. */
|
|
44
96
|
this._transport = null;
|
|
97
|
+
/** The agent session adapter for turn-based conversation. Null when idle or closed. */
|
|
45
98
|
this._agentSession = null;
|
|
46
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* Watchdog timer ID for max turn duration. Fires a synthetic speech_end
|
|
101
|
+
* VAD event if the pipeline stays in LISTENING too long without a turn_complete.
|
|
102
|
+
*/
|
|
47
103
|
this._watchdogTimer = null;
|
|
48
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Tracks cumulative TTS text for barge-in context. Reset at the start
|
|
106
|
+
* of each agent response (PROCESSING -> SPEAKING transition).
|
|
107
|
+
*/
|
|
49
108
|
this._currentTTSText = '';
|
|
50
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* Tracks cumulative played duration (ms) for barge-in context.
|
|
111
|
+
* Incremented as each {@link EncodedAudioChunk} is forwarded to the transport.
|
|
112
|
+
*/
|
|
51
113
|
this._currentPlayedMs = 0;
|
|
52
114
|
}
|
|
115
|
+
// --------------------------------------------------------------------------
|
|
116
|
+
// Session lifecycle
|
|
117
|
+
// --------------------------------------------------------------------------
|
|
53
118
|
/**
|
|
54
119
|
* Start a voice session. Accepts pre-built components via overrides for testing.
|
|
55
|
-
* In production, components
|
|
120
|
+
* In production, components would be resolved from ExtensionManager (future task).
|
|
121
|
+
*
|
|
122
|
+
* This method:
|
|
123
|
+
* 1. Validates the orchestrator is in `'idle'` state.
|
|
124
|
+
* 2. Creates STT and TTS sub-sessions from the provided factories.
|
|
125
|
+
* 3. Wires all event handlers (transport -> STT -> endpoint -> agent -> TTS -> transport).
|
|
126
|
+
* 4. Transitions to `'listening'` and starts the watchdog timer.
|
|
127
|
+
* 5. Returns a {@link VoicePipelineSession} handle.
|
|
56
128
|
*
|
|
57
129
|
* @param transport - The bidirectional audio/text stream transport.
|
|
58
130
|
* @param agentSession - The agent session adapter for turn-based conversation.
|
|
59
131
|
* @param overrides - Optional pre-built components (for testing or manual wiring).
|
|
60
132
|
* @returns A live VoicePipelineSession object.
|
|
133
|
+
*
|
|
134
|
+
* @throws {Error} If the orchestrator is not in `'idle'` state.
|
|
135
|
+
* @throws {Error} If any required component (STT, TTS, endpoint, bargein) is missing.
|
|
61
136
|
*/
|
|
62
137
|
async startSession(transport, agentSession, overrides) {
|
|
138
|
+
// Guard: only one session per orchestrator instance
|
|
63
139
|
if (this._state !== 'idle') {
|
|
64
|
-
throw new Error(`Cannot start session in state '${this._state}'; expected 'idle'
|
|
140
|
+
throw new Error(`Cannot start session in state '${this._state}'; expected 'idle'. ` +
|
|
141
|
+
`Create a new VoicePipelineOrchestrator instance for a new session.`);
|
|
65
142
|
}
|
|
66
143
|
this._transport = transport;
|
|
67
144
|
this._agentSession = agentSession;
|
|
145
|
+
// Extract injected components from overrides
|
|
68
146
|
const stt = overrides?.streamingSTT;
|
|
69
147
|
const tts = overrides?.streamingTTS;
|
|
70
148
|
const endpointDetector = overrides?.endpointDetector;
|
|
71
149
|
const bargeinHandler = overrides?.bargeinHandler;
|
|
72
|
-
|
|
150
|
+
// All four core components are mandatory — fail fast with clear messages
|
|
151
|
+
if (!stt) {
|
|
73
152
|
throw new Error('streamingSTT is required (pass via overrides or wait for ExtensionManager support).');
|
|
74
|
-
|
|
153
|
+
}
|
|
154
|
+
if (!tts) {
|
|
75
155
|
throw new Error('streamingTTS is required (pass via overrides or wait for ExtensionManager support).');
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
156
|
+
}
|
|
157
|
+
if (!endpointDetector) {
|
|
158
|
+
throw new Error('endpointDetector is required. Pass a HeuristicEndpointDetector or AcousticEndpointDetector via overrides.');
|
|
159
|
+
}
|
|
160
|
+
if (!bargeinHandler) {
|
|
161
|
+
throw new Error('bargeinHandler is required. Pass a HardCutBargeinHandler or SoftFadeBargeinHandler via overrides.');
|
|
162
|
+
}
|
|
163
|
+
// Create provider sub-sessions with pipeline-level config
|
|
81
164
|
const sttSession = await stt.startSession({ language: this.config.language });
|
|
82
165
|
const ttsSession = await tts.startSession({
|
|
83
166
|
voice: this.config.voice,
|
|
84
167
|
format: this.config.format,
|
|
85
168
|
});
|
|
169
|
+
// Store references for use by wiring helpers and teardown
|
|
86
170
|
this._sttSession = sttSession;
|
|
87
171
|
this._ttsSession = ttsSession;
|
|
88
172
|
this._endpointDetector = endpointDetector;
|
|
89
173
|
this._bargeinHandler = bargeinHandler;
|
|
90
|
-
// Wire
|
|
174
|
+
// Wire the event pipeline: transport -> STT -> endpoint -> agent -> TTS -> transport
|
|
91
175
|
this._wireTransportToSTT(transport, sttSession);
|
|
92
176
|
this._wireSTTToEndpoint(sttSession, endpointDetector, transport);
|
|
93
177
|
this._wireTurnComplete(endpointDetector, transport, agentSession, ttsSession);
|
|
94
178
|
this._wireTTSToTransport(ttsSession, transport);
|
|
95
179
|
this._wireBargein(sttSession, ttsSession, bargeinHandler, transport, agentSession);
|
|
96
180
|
this._wireDisconnect(transport, sttSession, ttsSession);
|
|
97
|
-
//
|
|
181
|
+
// IDLE -> LISTENING: audio can now flow
|
|
98
182
|
this._setState('listening');
|
|
99
|
-
// Start watchdog
|
|
183
|
+
// Start the watchdog timer to prevent indefinite LISTENING
|
|
100
184
|
this._resetWatchdog();
|
|
101
|
-
// Build
|
|
185
|
+
// Build the public VoicePipelineSession facade
|
|
102
186
|
const sessionId = randomUUID();
|
|
103
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
187
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias -- needed for closure
|
|
104
188
|
const orchestrator = this;
|
|
105
189
|
const session = Object.assign(new EventEmitter(), {
|
|
106
190
|
sessionId,
|
|
@@ -112,24 +196,30 @@ export class VoicePipelineOrchestrator extends EventEmitter {
|
|
|
112
196
|
await orchestrator.stopSession(reason);
|
|
113
197
|
},
|
|
114
198
|
});
|
|
115
|
-
// Forward state_changed events to the session
|
|
199
|
+
// Forward internal state_changed events to the public session as state_change
|
|
116
200
|
this.on('state_changed', (evt) => session.emit('state_change', evt.to));
|
|
117
201
|
return session;
|
|
118
202
|
}
|
|
119
203
|
/**
|
|
120
204
|
* Stop the current session, tearing down all sub-sessions and timers.
|
|
121
205
|
*
|
|
206
|
+
* Safe to call multiple times -- subsequent calls after the first are no-ops.
|
|
207
|
+
*
|
|
122
208
|
* @param reason - Optional human-readable reason for diagnostics.
|
|
123
209
|
*/
|
|
124
210
|
async stopSession(reason) {
|
|
211
|
+
// Idempotent: already closed, nothing to do
|
|
125
212
|
if (this._state === 'closed')
|
|
126
213
|
return;
|
|
214
|
+
// Cancel the watchdog first to prevent it firing during teardown
|
|
127
215
|
this._clearWatchdog();
|
|
216
|
+
// Tear down sub-sessions (null-safe via optional chaining)
|
|
128
217
|
this._sttSession?.close();
|
|
129
218
|
this._ttsSession?.close();
|
|
130
219
|
this._transport?.close(1000, reason);
|
|
220
|
+
// Transition to terminal state
|
|
131
221
|
this._setState('closed');
|
|
132
|
-
//
|
|
222
|
+
// Release references to allow garbage collection of provider resources
|
|
133
223
|
this._sttSession = null;
|
|
134
224
|
this._ttsSession = null;
|
|
135
225
|
this._endpointDetector = null;
|
|
@@ -147,9 +237,9 @@ export class VoicePipelineOrchestrator extends EventEmitter {
|
|
|
147
237
|
* graph nodes (via VoiceTransportAdapter) can `await` user input without
|
|
148
238
|
* having to manage raw EventEmitter subscriptions themselves.
|
|
149
239
|
*
|
|
150
|
-
* Resolves with the first
|
|
240
|
+
* Resolves with the first {@link TurnCompleteEvent} fired after this call.
|
|
151
241
|
* If the session is closed before a turn completes, the Promise will never
|
|
152
|
-
* resolve
|
|
242
|
+
* resolve -- callers should race it against a session-close signal if needed.
|
|
153
243
|
*
|
|
154
244
|
* @returns A Promise that resolves with the completed turn event.
|
|
155
245
|
*
|
|
@@ -157,10 +247,13 @@ export class VoicePipelineOrchestrator extends EventEmitter {
|
|
|
157
247
|
* ```typescript
|
|
158
248
|
* const turn = await orchestrator.waitForUserTurn();
|
|
159
249
|
* console.log('User said:', turn.transcript);
|
|
250
|
+
* console.log('Reason:', turn.reason);
|
|
160
251
|
* ```
|
|
161
252
|
*/
|
|
162
253
|
async waitForUserTurn() {
|
|
163
254
|
return new Promise((resolve) => {
|
|
255
|
+
// `once` ensures the listener is auto-removed after the first emission,
|
|
256
|
+
// preventing memory leaks when waitForUserTurn is called repeatedly.
|
|
164
257
|
this.once('turn_complete', (event) => resolve(event));
|
|
165
258
|
});
|
|
166
259
|
}
|
|
@@ -175,7 +268,9 @@ export class VoicePipelineOrchestrator extends EventEmitter {
|
|
|
175
268
|
* without the caller needing a direct reference to the TTS session.
|
|
176
269
|
*
|
|
177
270
|
* @param text - A complete string, or an async iterable of string tokens.
|
|
178
|
-
*
|
|
271
|
+
*
|
|
272
|
+
* @throws {Error} If there is no active TTS session (i.e. session not started
|
|
273
|
+
* or already stopped).
|
|
179
274
|
*
|
|
180
275
|
* @example
|
|
181
276
|
* ```typescript
|
|
@@ -188,23 +283,34 @@ export class VoicePipelineOrchestrator extends EventEmitter {
|
|
|
188
283
|
*/
|
|
189
284
|
async pushToTTS(text) {
|
|
190
285
|
const ttsSession = this._ttsSession;
|
|
191
|
-
if (!ttsSession)
|
|
192
|
-
throw new Error('No active TTS session');
|
|
286
|
+
if (!ttsSession) {
|
|
287
|
+
throw new Error('No active TTS session. Ensure startSession() has been called and the session has not been stopped.');
|
|
288
|
+
}
|
|
193
289
|
if (typeof text === 'string') {
|
|
290
|
+
// Single string: push all at once
|
|
194
291
|
ttsSession.pushTokens(text);
|
|
195
292
|
}
|
|
196
293
|
else {
|
|
294
|
+
// Async iterable: push token-by-token as they arrive from the LLM
|
|
197
295
|
for await (const token of text) {
|
|
198
296
|
ttsSession.pushTokens(token);
|
|
199
297
|
}
|
|
200
298
|
}
|
|
299
|
+
// Signal end-of-utterance so the TTS provider can finalise synthesis
|
|
201
300
|
await ttsSession.flush();
|
|
202
301
|
}
|
|
203
302
|
// --------------------------------------------------------------------------
|
|
204
|
-
// Wiring helpers
|
|
303
|
+
// Wiring helpers -- each method connects one segment of the event pipeline
|
|
205
304
|
// --------------------------------------------------------------------------
|
|
206
305
|
/**
|
|
207
|
-
*
|
|
306
|
+
* Wire segment 1: Transport -> STT.
|
|
307
|
+
*
|
|
308
|
+
* Every inbound audio frame from the transport is forwarded directly to
|
|
309
|
+
* the STT session for recognition. No buffering or resampling is done here;
|
|
310
|
+
* the STT provider is expected to handle sample rate conversion internally.
|
|
311
|
+
*
|
|
312
|
+
* @param transport - The bidirectional transport receiving client audio.
|
|
313
|
+
* @param sttSession - The STT session that will process the audio.
|
|
208
314
|
*/
|
|
209
315
|
_wireTransportToSTT(transport, sttSession) {
|
|
210
316
|
transport.on('audio', (frame) => {
|
|
@@ -212,11 +318,22 @@ export class VoicePipelineOrchestrator extends EventEmitter {
|
|
|
212
318
|
});
|
|
213
319
|
}
|
|
214
320
|
/**
|
|
215
|
-
*
|
|
321
|
+
* Wire segment 2: STT -> Endpoint Detector + Transport.
|
|
322
|
+
*
|
|
323
|
+
* Every transcript event from STT is:
|
|
324
|
+
* 1. Forwarded to the endpoint detector for turn-boundary analysis.
|
|
325
|
+
* 2. Relayed to the transport so the client can display real-time captions.
|
|
326
|
+
*
|
|
327
|
+
* @param sttSession - The STT session emitting transcript events.
|
|
328
|
+
* @param endpointDetector - The detector analysing transcripts for turn boundaries.
|
|
329
|
+
* @param transport - The transport for relaying transcript events to the client.
|
|
216
330
|
*/
|
|
217
331
|
_wireSTTToEndpoint(sttSession, endpointDetector, transport) {
|
|
218
332
|
sttSession.on('transcript', (transcript) => {
|
|
333
|
+
// Feed the endpoint detector so it can check for terminal punctuation,
|
|
334
|
+
// backchannel phrases, etc.
|
|
219
335
|
endpointDetector.pushTranscript(transcript);
|
|
336
|
+
// Relay to the client for real-time caption display
|
|
220
337
|
transport.sendControl({
|
|
221
338
|
type: 'transcript',
|
|
222
339
|
text: transcript.text,
|
|
@@ -226,16 +343,35 @@ export class VoicePipelineOrchestrator extends EventEmitter {
|
|
|
226
343
|
});
|
|
227
344
|
}
|
|
228
345
|
/**
|
|
229
|
-
*
|
|
230
|
-
*
|
|
346
|
+
* Wire segment 3: Endpoint Detector -> Agent -> TTS.
|
|
347
|
+
*
|
|
348
|
+
* When the endpoint detector fires `turn_complete`, the orchestrator:
|
|
349
|
+
* 1. Transitions LISTENING -> PROCESSING.
|
|
350
|
+
* 2. Sends the transcript to the agent session.
|
|
351
|
+
* 3. Transitions PROCESSING -> SPEAKING as LLM tokens start arriving.
|
|
352
|
+
* 4. Pipes each token to the TTS session.
|
|
353
|
+
*
|
|
354
|
+
* The turn is only processed if the orchestrator is currently in LISTENING
|
|
355
|
+
* state, preventing duplicate processing from stale events.
|
|
356
|
+
*
|
|
357
|
+
* @param endpointDetector - The detector that fires turn_complete events.
|
|
358
|
+
* @param transport - For sending agent_thinking/agent_speaking control messages.
|
|
359
|
+
* @param agentSession - The agent session that generates the response.
|
|
360
|
+
* @param ttsSession - The TTS session that synthesises the response as audio.
|
|
231
361
|
*/
|
|
232
362
|
_wireTurnComplete(endpointDetector, transport, agentSession, ttsSession) {
|
|
233
363
|
endpointDetector.on('turn_complete', async (event) => {
|
|
364
|
+
// Guard: only process turn_complete when we're actively listening.
|
|
365
|
+
// This prevents processing stale events that arrive after a barge-in
|
|
366
|
+
// or transport disconnect has already moved us out of LISTENING.
|
|
234
367
|
if (this._state !== 'listening')
|
|
235
368
|
return;
|
|
369
|
+
// Stop the watchdog -- the user has finished speaking
|
|
236
370
|
this._clearWatchdog();
|
|
371
|
+
// LISTENING -> PROCESSING: agent is now generating a response
|
|
237
372
|
this._setState('processing');
|
|
238
373
|
transport.sendControl({ type: 'agent_thinking' });
|
|
374
|
+
// Build turn metadata for the agent so it can adapt its response
|
|
239
375
|
const metadata = {
|
|
240
376
|
speakers: [],
|
|
241
377
|
endpointReason: event.reason,
|
|
@@ -243,79 +379,130 @@ export class VoicePipelineOrchestrator extends EventEmitter {
|
|
|
243
379
|
wasInterrupted: false,
|
|
244
380
|
transcriptConfidence: event.confidence,
|
|
245
381
|
};
|
|
382
|
+
// Begin streaming the agent's response
|
|
246
383
|
const tokenStream = agentSession.sendText(event.transcript, metadata);
|
|
384
|
+
// PROCESSING -> SPEAKING: first tokens are about to flow
|
|
247
385
|
this._setState('speaking');
|
|
248
386
|
this._currentTTSText = '';
|
|
249
387
|
this._currentPlayedMs = 0;
|
|
250
388
|
transport.sendControl({ type: 'agent_speaking', text: '' });
|
|
389
|
+
// Stream each LLM token to the TTS session. The loop breaks early
|
|
390
|
+
// if a barge-in transitions us out of SPEAKING.
|
|
251
391
|
for await (const token of tokenStream) {
|
|
392
|
+
// Cast needed because TypeScript narrows `this._state` to the value
|
|
393
|
+
// at the top of the async function, not the current runtime value.
|
|
252
394
|
if (this._state !== 'speaking')
|
|
253
|
-
break;
|
|
395
|
+
break;
|
|
254
396
|
this._currentTTSText += token;
|
|
255
397
|
ttsSession.pushTokens(token);
|
|
256
398
|
}
|
|
399
|
+
// Only flush if we're still in SPEAKING -- a barge-in may have
|
|
400
|
+
// transitioned us to INTERRUPTING/LISTENING already.
|
|
257
401
|
if (this._state === 'speaking') {
|
|
258
402
|
await ttsSession.flush();
|
|
259
403
|
}
|
|
260
404
|
});
|
|
261
405
|
}
|
|
262
406
|
/**
|
|
263
|
-
*
|
|
407
|
+
* Wire segment 4: TTS -> Transport.
|
|
408
|
+
*
|
|
409
|
+
* Each audio chunk from TTS is forwarded to the transport for client playback.
|
|
410
|
+
* The `flush_complete` event signals that all tokens have been synthesised,
|
|
411
|
+
* triggering the SPEAKING -> LISTENING transition.
|
|
412
|
+
*
|
|
413
|
+
* @param ttsSession - The TTS session emitting audio chunks.
|
|
414
|
+
* @param transport - The transport delivering audio to the client.
|
|
264
415
|
*/
|
|
265
416
|
_wireTTSToTransport(ttsSession, transport) {
|
|
266
417
|
ttsSession.on('audio', (chunk) => {
|
|
418
|
+
// Only forward audio while we're in the SPEAKING state.
|
|
419
|
+
// Chunks arriving after a barge-in are silently dropped.
|
|
267
420
|
if (this._state === 'speaking') {
|
|
268
421
|
this._currentPlayedMs += chunk.durationMs;
|
|
269
422
|
transport.sendAudio(chunk);
|
|
270
423
|
}
|
|
271
424
|
});
|
|
272
425
|
ttsSession.on('flush_complete', () => {
|
|
426
|
+
// Only transition back to LISTENING if we're still SPEAKING.
|
|
427
|
+
// A barge-in may have already moved us to INTERRUPTING -> LISTENING.
|
|
273
428
|
if (this._state === 'speaking') {
|
|
429
|
+
// SPEAKING -> LISTENING: agent response fully delivered
|
|
274
430
|
this._setState('listening');
|
|
431
|
+
// Notify the client that the agent's response is complete
|
|
275
432
|
transport.sendControl({
|
|
276
433
|
type: 'agent_done',
|
|
277
434
|
text: this._currentTTSText,
|
|
278
435
|
durationMs: this._currentPlayedMs,
|
|
279
436
|
});
|
|
437
|
+
// Reset the endpoint detector for the next user turn
|
|
280
438
|
this._endpointDetector?.reset();
|
|
439
|
+
// Restart the watchdog for the next turn
|
|
281
440
|
this._resetWatchdog();
|
|
282
441
|
}
|
|
283
442
|
});
|
|
284
443
|
}
|
|
285
444
|
/**
|
|
286
|
-
* Wire
|
|
287
|
-
*
|
|
445
|
+
* Wire segment 5: Barge-in detection.
|
|
446
|
+
*
|
|
447
|
+
* When `speech_start` is detected (from the STT session) during the SPEAKING
|
|
448
|
+
* state, the barge-in handler is consulted. Depending on the handler's
|
|
449
|
+
* decision:
|
|
450
|
+
*
|
|
451
|
+
* - **cancel**: TTS is stopped, agent is aborted, state goes
|
|
452
|
+
* SPEAKING -> INTERRUPTING -> LISTENING.
|
|
453
|
+
* - **pause**: A control message is sent but state remains SPEAKING.
|
|
454
|
+
* - **ignore**: No action taken (e.g. lip smack below threshold).
|
|
455
|
+
*
|
|
456
|
+
* The `speech_start` and `speech_end` events are also forwarded to the
|
|
457
|
+
* endpoint detector as synthetic VAD events so it can track speech activity
|
|
458
|
+
* even when a dedicated VAD model is not present.
|
|
459
|
+
*
|
|
460
|
+
* @param sttSession - The STT session that re-emits speech_start/speech_end.
|
|
461
|
+
* @param ttsSession - The TTS session to cancel on barge-in.
|
|
462
|
+
* @param bargeinHandler - The policy handler deciding what to do.
|
|
463
|
+
* @param transport - For sending barge_in control messages.
|
|
464
|
+
* @param agentSession - The agent session to abort on cancel.
|
|
288
465
|
*/
|
|
289
466
|
_wireBargein(sttSession, ttsSession, bargeinHandler, transport, agentSession) {
|
|
290
467
|
sttSession.on('speech_start', async () => {
|
|
291
|
-
//
|
|
468
|
+
// Forward to endpoint detector as a synthetic VAD event so it can
|
|
469
|
+
// track turn boundaries even without a dedicated VAD model.
|
|
292
470
|
this._endpointDetector?.pushVadEvent({
|
|
293
471
|
type: 'speech_start',
|
|
294
472
|
timestamp: Date.now(),
|
|
295
473
|
source: 'stt',
|
|
296
474
|
});
|
|
475
|
+
// Barge-in is only relevant when TTS is actively playing
|
|
297
476
|
if (this._state === 'speaking') {
|
|
298
477
|
const action = await bargeinHandler.handleBargein({
|
|
478
|
+
// speechDurationMs is 0 because we detect the start of speech, not
|
|
479
|
+
// its duration. The handler's threshold logic determines whether
|
|
480
|
+
// this instant detection is enough to trigger a cancel.
|
|
299
481
|
speechDurationMs: 0,
|
|
300
482
|
interruptedText: this._currentTTSText,
|
|
301
483
|
playedDurationMs: this._currentPlayedMs,
|
|
302
484
|
});
|
|
303
485
|
if (action.type === 'cancel') {
|
|
486
|
+
// SPEAKING -> INTERRUPTING -> LISTENING (two rapid transitions)
|
|
304
487
|
this._setState('interrupting');
|
|
305
488
|
ttsSession.cancel();
|
|
306
489
|
agentSession.abort?.();
|
|
307
490
|
transport.sendControl({ type: 'barge_in', action });
|
|
491
|
+
// INTERRUPTING -> LISTENING: ready for the user's next turn
|
|
308
492
|
this._setState('listening');
|
|
309
493
|
this._endpointDetector?.reset();
|
|
310
494
|
this._resetWatchdog();
|
|
311
495
|
}
|
|
312
496
|
else if (action.type === 'pause') {
|
|
497
|
+
// Notify client of the pause but stay in SPEAKING state.
|
|
498
|
+
// The TTS audio fade-out is handled client-side.
|
|
313
499
|
transport.sendControl({ type: 'barge_in', action });
|
|
314
500
|
}
|
|
315
|
-
// 'ignore' and 'resume'
|
|
501
|
+
// 'ignore' and 'resume' actions require no pipeline-level response
|
|
316
502
|
}
|
|
317
503
|
});
|
|
318
504
|
sttSession.on('speech_end', () => {
|
|
505
|
+
// Forward to endpoint detector as a synthetic VAD event
|
|
319
506
|
this._endpointDetector?.pushVadEvent({
|
|
320
507
|
type: 'speech_end',
|
|
321
508
|
timestamp: Date.now(),
|
|
@@ -324,11 +511,22 @@ export class VoicePipelineOrchestrator extends EventEmitter {
|
|
|
324
511
|
});
|
|
325
512
|
}
|
|
326
513
|
/**
|
|
327
|
-
*
|
|
514
|
+
* Wire segment 6: Transport disconnect.
|
|
515
|
+
*
|
|
516
|
+
* When the transport closes (e.g. WebSocket disconnect, client navigation),
|
|
517
|
+
* all sub-sessions are torn down and the orchestrator transitions to CLOSED.
|
|
518
|
+
* This is a terminal state -- no further events are emitted.
|
|
519
|
+
*
|
|
520
|
+
* @param transport - The transport to monitor for closure.
|
|
521
|
+
* @param sttSession - The STT session to close on disconnect.
|
|
522
|
+
* @param ttsSession - The TTS session to close on disconnect.
|
|
328
523
|
*/
|
|
329
524
|
_wireDisconnect(transport, sttSession, ttsSession) {
|
|
330
525
|
transport.on('close', () => {
|
|
331
526
|
this._clearWatchdog();
|
|
527
|
+
// Transition to terminal state first, then tear down sub-sessions.
|
|
528
|
+
// This ordering ensures any event handlers see the CLOSED state
|
|
529
|
+
// before the sessions are destroyed.
|
|
332
530
|
this._setState('closed');
|
|
333
531
|
sttSession.close();
|
|
334
532
|
ttsSession.close();
|
|
@@ -338,10 +536,17 @@ export class VoicePipelineOrchestrator extends EventEmitter {
|
|
|
338
536
|
// State management
|
|
339
537
|
// --------------------------------------------------------------------------
|
|
340
538
|
/**
|
|
341
|
-
* Transition to a new pipeline state, emitting a `state_changed` event.
|
|
539
|
+
* Transition to a new pipeline state, emitting a `'state_changed'` event.
|
|
540
|
+
*
|
|
541
|
+
* No-ops if the target state equals the current state (idempotent).
|
|
542
|
+
* This is the ONLY method that mutates {@link _state}, ensuring all
|
|
543
|
+
* transitions are observable via the `'state_changed'` event.
|
|
544
|
+
*
|
|
545
|
+
* @param state - The target pipeline state.
|
|
342
546
|
*/
|
|
343
547
|
_setState(state) {
|
|
344
548
|
const from = this._state;
|
|
549
|
+
// Idempotent: skip if already in the target state
|
|
345
550
|
if (from === state)
|
|
346
551
|
return;
|
|
347
552
|
this._state = state;
|
|
@@ -351,14 +556,21 @@ export class VoicePipelineOrchestrator extends EventEmitter {
|
|
|
351
556
|
// Watchdog timer
|
|
352
557
|
// --------------------------------------------------------------------------
|
|
353
558
|
/**
|
|
354
|
-
* Reset the watchdog timer for max turn duration.
|
|
355
|
-
*
|
|
356
|
-
*
|
|
559
|
+
* Reset the watchdog timer for max turn duration.
|
|
560
|
+
*
|
|
561
|
+
* If the pipeline stays in LISTENING for longer than
|
|
562
|
+
* {@link VoicePipelineConfig.maxTurnDurationMs} (default 30 s) without a
|
|
563
|
+
* `turn_complete`, the watchdog fires a synthetic `speech_end` VAD event
|
|
564
|
+
* to trigger the endpoint detector's silence timeout logic. This prevents
|
|
565
|
+
* the pipeline from hanging indefinitely when the user walks away or
|
|
566
|
+
* the microphone captures no meaningful audio.
|
|
357
567
|
*/
|
|
358
568
|
_resetWatchdog() {
|
|
359
569
|
this._clearWatchdog();
|
|
360
570
|
const maxMs = this.config.maxTurnDurationMs ?? 30000;
|
|
361
571
|
this._watchdogTimer = setTimeout(() => {
|
|
572
|
+
// Only fire if we're still in LISTENING -- the user may have spoken
|
|
573
|
+
// or the session may have been closed while the timer was pending.
|
|
362
574
|
if (this._state === 'listening') {
|
|
363
575
|
this._endpointDetector?.pushVadEvent({
|
|
364
576
|
type: 'speech_end',
|
|
@@ -369,7 +581,8 @@ export class VoicePipelineOrchestrator extends EventEmitter {
|
|
|
369
581
|
}, maxMs);
|
|
370
582
|
}
|
|
371
583
|
/**
|
|
372
|
-
* Clear the watchdog timer if active.
|
|
584
|
+
* Clear the watchdog timer if one is active.
|
|
585
|
+
* Safe to call even when no timer is pending (no-op).
|
|
373
586
|
*/
|
|
374
587
|
_clearWatchdog() {
|
|
375
588
|
if (this._watchdogTimer !== null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoicePipelineOrchestrator.js","sourceRoot":"","sources":["../../src/voice-pipeline/VoicePipelineOrchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAuCzC;;;;;;;;GAQG;AACH,MAAM,OAAO,yBAA0B,SAAQ,YAAY;I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