@voicethere/agent 0.6.0 → 0.7.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/dist/agent.js +63 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/protocol.d.ts +99 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +4 -0
- package/dist/protocol.js.map +1 -1
- package/dist/runtime.d.ts +45 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +230 -0
- package/dist/runtime.js.map +1 -1
- package/dist/templates/echo/agent.js +61 -2
- package/dist/templates/echo-dc/agent.js +61 -2
- package/dist/templates/game-sync/agent.js +61 -2
- package/dist/templates/positional-tts/agent.js +810 -0
- package/dist/templates/recording-consent/agent.js +61 -2
- package/dist/templates/registry.d.ts.map +1 -1
- package/dist/templates/registry.js +16 -0
- package/dist/templates/registry.js.map +1 -1
- package/dist/templates/voice-showcase/agent.js +61 -2
- package/dist/templates/voice-starter/agent.js +61 -2
- package/dist/templates/webhooks/agent.js +61 -2
- package/dist/templates/webhooks-redis/agent.js +61 -2
- package/package.json +4 -4
- package/templates/README.md +10 -4
- package/templates/mix-smoke.ts +224 -0
- package/templates/positional-tts/agent.ts +115 -0
- package/templates/positional-tts/orbit.ts +11 -0
package/dist/agent.js
CHANGED
|
@@ -135,6 +135,16 @@ function isRecordingControlAckMessage(value) {
|
|
|
135
135
|
const msg = value;
|
|
136
136
|
return msg.type === "recording_control_ack" && typeof msg.requestId === "string";
|
|
137
137
|
}
|
|
138
|
+
function isMixControlAckMessage(value) {
|
|
139
|
+
if (!value || typeof value !== "object") return false;
|
|
140
|
+
const msg = value;
|
|
141
|
+
return msg.type === "mix_control_ack" && typeof msg.requestId === "string";
|
|
142
|
+
}
|
|
143
|
+
function isSttControlAckMessage(value) {
|
|
144
|
+
if (!value || typeof value !== "object") return false;
|
|
145
|
+
const msg = value;
|
|
146
|
+
return msg.type === "stt_control_ack" && typeof msg.requestId === "string";
|
|
147
|
+
}
|
|
138
148
|
function isWebhookMessage(value) {
|
|
139
149
|
if (!value || typeof value !== "object") return false;
|
|
140
150
|
const msg = value;
|
|
@@ -171,7 +181,7 @@ function normalizeWebhookHeaders(value) {
|
|
|
171
181
|
function isParentMessage(value) {
|
|
172
182
|
if (!value || typeof value !== "object") return false;
|
|
173
183
|
const msg = value;
|
|
174
|
-
return msg.type === "session_start" || msg.type === "speech_event" || msg.type === "session_end" || msg.type === "data_channel_message" || msg.type === "data_channel_binary" || msg.type === "idle_timeout" || msg.type === "recording_control_ack" || msg.type === "webhook";
|
|
184
|
+
return msg.type === "session_start" || msg.type === "speech_event" || msg.type === "session_end" || msg.type === "data_channel_message" || msg.type === "data_channel_binary" || msg.type === "idle_timeout" || msg.type === "recording_control_ack" || msg.type === "mix_control_ack" || msg.type === "stt_control_ack" || msg.type === "webhook";
|
|
175
185
|
}
|
|
176
186
|
function isSessionScopedParentMessage(value) {
|
|
177
187
|
return isParentMessage(value) && !isWebhookMessage(value);
|
|
@@ -185,8 +195,12 @@ function parseDataChannelPayload(raw) {
|
|
|
185
195
|
}
|
|
186
196
|
var peerEnvBySessionId = /* @__PURE__ */ new Map();
|
|
187
197
|
var recordingAvailableBySessionId = /* @__PURE__ */ new Map();
|
|
198
|
+
var mixAvailableBySessionId = /* @__PURE__ */ new Map();
|
|
199
|
+
var ttsPoseAvailableBySessionId = /* @__PURE__ */ new Map();
|
|
188
200
|
var endedSessionIds = /* @__PURE__ */ new Set();
|
|
189
201
|
var pendingRecordingAcks = /* @__PURE__ */ new Map();
|
|
202
|
+
var pendingMixAcks = /* @__PURE__ */ new Map();
|
|
203
|
+
var pendingSttAcks = /* @__PURE__ */ new Map();
|
|
190
204
|
function handleRecordingControlAck(message) {
|
|
191
205
|
const pending = pendingRecordingAcks.get(message.requestId);
|
|
192
206
|
if (!pending) return;
|
|
@@ -198,6 +212,28 @@ function handleRecordingControlAck(message) {
|
|
|
198
212
|
requestId: message.requestId
|
|
199
213
|
});
|
|
200
214
|
}
|
|
215
|
+
function handleMixControlAck(message) {
|
|
216
|
+
const pending = pendingMixAcks.get(message.requestId);
|
|
217
|
+
if (!pending) return;
|
|
218
|
+
clearTimeout(pending.timer);
|
|
219
|
+
pendingMixAcks.delete(message.requestId);
|
|
220
|
+
pending.resolve({
|
|
221
|
+
ok: message.ok,
|
|
222
|
+
reason: message.reason,
|
|
223
|
+
requestId: message.requestId
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
function handleSttControlAck(message) {
|
|
227
|
+
const pending = pendingSttAcks.get(message.requestId);
|
|
228
|
+
if (!pending) return;
|
|
229
|
+
clearTimeout(pending.timer);
|
|
230
|
+
pendingSttAcks.delete(message.requestId);
|
|
231
|
+
pending.resolve({
|
|
232
|
+
ok: message.ok,
|
|
233
|
+
reason: message.reason,
|
|
234
|
+
requestId: message.requestId
|
|
235
|
+
});
|
|
236
|
+
}
|
|
201
237
|
function clearPendingRecordingAcksForSession(sessionId, reason) {
|
|
202
238
|
for (const [requestId, pending] of pendingRecordingAcks) {
|
|
203
239
|
if (pending.sessionId !== sessionId) continue;
|
|
@@ -253,6 +289,11 @@ function allowOutboundForSession(sessionId) {
|
|
|
253
289
|
return queue.isLive(sessionId);
|
|
254
290
|
}
|
|
255
291
|
function sendParentMessage(message) {
|
|
292
|
+
const msgType = message && typeof message === "object" && "type" in message ? message.type : void 0;
|
|
293
|
+
if (msgType === "mix_control" || msgType === "stt_control") {
|
|
294
|
+
process.send?.(message);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
256
297
|
const sessionId = message && typeof message === "object" && "sessionId" in message && typeof message.sessionId === "string" ? message.sessionId : void 0;
|
|
257
298
|
if (!allowOutboundForSession(sessionId)) return;
|
|
258
299
|
process.send?.(message);
|
|
@@ -336,6 +377,14 @@ async function handleParentMessage(message, handlers) {
|
|
|
336
377
|
message.sessionId,
|
|
337
378
|
message.recordingAvailable ?? false
|
|
338
379
|
);
|
|
380
|
+
mixAvailableBySessionId.set(
|
|
381
|
+
message.sessionId,
|
|
382
|
+
message.mixAvailable ?? false
|
|
383
|
+
);
|
|
384
|
+
ttsPoseAvailableBySessionId.set(
|
|
385
|
+
message.sessionId,
|
|
386
|
+
message.ttsPoseAvailable ?? false
|
|
387
|
+
);
|
|
339
388
|
const sessionStartInitDelayMs = resolveSessionStartInitDelayMs();
|
|
340
389
|
if (sessionStartInitDelayMs > 0) {
|
|
341
390
|
await new Promise(
|
|
@@ -345,7 +394,9 @@ async function handleParentMessage(message, handlers) {
|
|
|
345
394
|
await (handlers.onClientJoin ?? handlers.onSessionStart)?.({
|
|
346
395
|
sessionId: message.sessionId,
|
|
347
396
|
env: message.env,
|
|
348
|
-
recordingAvailable: message.recordingAvailable ?? false
|
|
397
|
+
recordingAvailable: message.recordingAvailable ?? false,
|
|
398
|
+
mixAvailable: message.mixAvailable ?? false,
|
|
399
|
+
ttsPoseAvailable: message.ttsPoseAvailable ?? false
|
|
349
400
|
});
|
|
350
401
|
sendParentMessage({
|
|
351
402
|
type: "session_start_ack",
|
|
@@ -386,6 +437,8 @@ async function handleParentMessage(message, handlers) {
|
|
|
386
437
|
clearPendingRecordingAcksForSession(message.sessionId, "session_ended");
|
|
387
438
|
peerEnvBySessionId.delete(message.sessionId);
|
|
388
439
|
recordingAvailableBySessionId.delete(message.sessionId);
|
|
440
|
+
mixAvailableBySessionId.delete(message.sessionId);
|
|
441
|
+
ttsPoseAvailableBySessionId.delete(message.sessionId);
|
|
389
442
|
await (handlers.onClientLeave ?? handlers.onSessionEnd)?.({
|
|
390
443
|
sessionId: message.sessionId
|
|
391
444
|
});
|
|
@@ -405,6 +458,14 @@ function defineAgent(handlers) {
|
|
|
405
458
|
handleRecordingControlAck(message);
|
|
406
459
|
return;
|
|
407
460
|
}
|
|
461
|
+
if (isMixControlAckMessage(message)) {
|
|
462
|
+
handleMixControlAck(message);
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
if (isSttControlAckMessage(message)) {
|
|
466
|
+
handleSttControlAck(message);
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
408
469
|
if (isWebhookMessage(message)) {
|
|
409
470
|
void agentStartReady.then(() => handleWebhookMessage(message, handlers));
|
|
410
471
|
return;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { SpeechEvent, SpeechEventListener, SpeechEventName, SpeechEventType, } from "@node-webrtc-rust/sdk/voice";
|
|
2
|
-
export { ALLOWED_CHILD_ENV_KEYS, type AgentErrorMessage, type AgentLogLevel, type AgentLogMessage, type AllowedChildEnvKey, type ChildToParentMessage, type ParentToChildMessage, type SessionEndMessage, type SessionStartMessage, type SendToClientMessage, type DataChannelMessageMessage, type DataChannelBinaryMessage, type DataChannelKind, type DisconnectClientMessage, type IdleTimeoutDoneMessage, type IdleTimeoutMessage, type RecordingControlMessage, type RecordingControlAckMessage, type RecordingControlAction, type RecordingControlResult, type SendBinaryToClientMessage, type SpeakMessage, type SpeechEventMessage, type WebhookMessage, } from "./protocol.js";
|
|
3
|
-
export { agentLog, defineAgent, disconnectClient, parseChatText, pauseRecording, resumeRecording, sendToClient, sendBinaryToClient, speak, startRecording, stopRecording, isRecordingAvailable, broadcastToClients, type AgentHandlers, type AgentErrorContext, type AgentStartContext, type DataChannelContext, type IdleTimeoutContext, type SessionContext, type SpeechContext, type SpeechEventContext, type WebhookContext, } from "./runtime.js";
|
|
2
|
+
export { ALLOWED_CHILD_ENV_KEYS, MIX_REQUIRES_VOICE_PLUS_DATA, TTS_POSE_REQUIRES_VOICE, type AgentErrorMessage, type AgentLogLevel, type AgentLogMessage, type AllowedChildEnvKey, type ChildToParentMessage, type ParentToChildMessage, type SessionEndMessage, type SessionStartMessage, type SendToClientMessage, type DataChannelMessageMessage, type DataChannelBinaryMessage, type DataChannelKind, type DisconnectClientMessage, type IdleTimeoutDoneMessage, type IdleTimeoutMessage, type RecordingControlMessage, type RecordingControlAckMessage, type RecordingControlAction, type RecordingControlResult, type MixControlMessage, type MixControlAckMessage, type MixControlAction, type MixControlResult, type MixPlacement, type MixPose, type SttControlMessage, type SttControlAckMessage, type SttControlResult, type SendBinaryToClientMessage, type SpeakMessage, type SpeechEventMessage, type WebhookMessage, } from "./protocol.js";
|
|
3
|
+
export { agentLog, addClientToMix, createMixGroup, defineAgent, disconnectClient, isMixAvailable, isTtsPoseAvailable, parseChatText, pauseRecording, removeClientFromMix, resumeRecording, sendToClient, sendBinaryToClient, setClientPose, setDefaultMixPlacement, setPositionalMixing, setSttEnabled, setTtsMixPlacement, setTtsPose, clearTtsPose, speak, startRecording, stopRecording, isRecordingAvailable, broadcastToClients, type AgentHandlers, type AgentErrorContext, type AgentStartContext, type DataChannelContext, type IdleTimeoutContext, type SessionContext, type SpeechContext, type SpeechEventContext, type WebhookContext, } from "./runtime.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,eAAe,GAChB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,cAAc,GACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,KAAK,EACL,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,cAAc,GACpB,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,eAAe,GAChB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,cAAc,GACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,KAAK,EACL,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,cAAc,GACpB,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ALLOWED_CHILD_ENV_KEYS, } from "./protocol.js";
|
|
2
|
-
export { agentLog, defineAgent, disconnectClient, parseChatText, pauseRecording, resumeRecording, sendToClient, sendBinaryToClient, speak, startRecording, stopRecording, isRecordingAvailable, broadcastToClients, } from "./runtime.js";
|
|
1
|
+
export { ALLOWED_CHILD_ENV_KEYS, MIX_REQUIRES_VOICE_PLUS_DATA, TTS_POSE_REQUIRES_VOICE, } from "./protocol.js";
|
|
2
|
+
export { agentLog, addClientToMix, createMixGroup, defineAgent, disconnectClient, isMixAvailable, isTtsPoseAvailable, parseChatText, pauseRecording, removeClientFromMix, resumeRecording, sendToClient, sendBinaryToClient, setClientPose, setDefaultMixPlacement, setPositionalMixing, setSttEnabled, setTtsMixPlacement, setTtsPose, clearTtsPose, speak, startRecording, stopRecording, isRecordingAvailable, broadcastToClients, } from "./runtime.js";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,uBAAuB,GAiCxB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,KAAK,EACL,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,kBAAkB,GAUnB,MAAM,cAAc,CAAC"}
|
package/dist/protocol.d.ts
CHANGED
|
@@ -16,13 +16,13 @@ export type { SpeechEvent } from "@node-webrtc-rust/sdk/voice";
|
|
|
16
16
|
* Register handlers via {@link defineAgent} in `@voicethere/agent` — do not read
|
|
17
17
|
* `process.on('message')` directly in customer bundles.
|
|
18
18
|
*/
|
|
19
|
-
export type ParentToChildMessage = SessionStartMessage | SpeechEventMessage | SessionEndMessage | DataChannelMessageMessage | DataChannelBinaryMessage | IdleTimeoutMessage | RecordingControlAckMessage | WebhookMessage;
|
|
19
|
+
export type ParentToChildMessage = SessionStartMessage | SpeechEventMessage | SessionEndMessage | DataChannelMessageMessage | DataChannelBinaryMessage | IdleTimeoutMessage | RecordingControlAckMessage | MixControlAckMessage | SttControlAckMessage | WebhookMessage;
|
|
20
20
|
/**
|
|
21
21
|
* Messages the customer child may send back to the runner parent.
|
|
22
22
|
*
|
|
23
23
|
* Prefer {@link speak}, {@link startRecording}, {@link sendToClient}, {@link sendBinaryToClient}, and {@link agentLog} helpers over raw `process.send`.
|
|
24
24
|
*/
|
|
25
|
-
export type ChildToParentMessage = SessionStartAckMessage | SpeakMessage | RecordingControlMessage | AgentLogMessage | AgentErrorMessage | SendToClientMessage | SendBinaryToClientMessage | IdleTimeoutDoneMessage | DisconnectClientMessage | WebhookHandledMessage;
|
|
25
|
+
export type ChildToParentMessage = SessionStartAckMessage | SpeakMessage | RecordingControlMessage | MixControlMessage | SttControlMessage | AgentLogMessage | AgentErrorMessage | SendToClientMessage | SendBinaryToClientMessage | IdleTimeoutDoneMessage | DisconnectClientMessage | WebhookHandledMessage;
|
|
26
26
|
/** Which WebRTC data channel carried a binary IPC payload. */
|
|
27
27
|
export type DataChannelKind = "control" | "sync";
|
|
28
28
|
/**
|
|
@@ -45,6 +45,16 @@ export interface SessionStartMessage {
|
|
|
45
45
|
* Absent on older runners — treat as `false`.
|
|
46
46
|
*/
|
|
47
47
|
recordingAvailable?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* When `true`, the runner session is Voice+Data and positional mix APIs are available.
|
|
50
|
+
* Absent on older runners or voice/data-only sessions — treat as `false`.
|
|
51
|
+
*/
|
|
52
|
+
mixAvailable?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* When `true`, TTS pose / listener pose / positional panning APIs are available
|
|
55
|
+
* (voice or Voice+Data). Absent on data-only or older runners — treat as `false`.
|
|
56
|
+
*/
|
|
57
|
+
ttsPoseAvailable?: boolean;
|
|
48
58
|
}
|
|
49
59
|
/**
|
|
50
60
|
* Forwards one speech lifecycle event from the parent Sherpa/VAD/STT/TTS pipeline.
|
|
@@ -144,6 +154,93 @@ export type RecordingControlResult = {
|
|
|
144
154
|
reason?: string;
|
|
145
155
|
requestId: string;
|
|
146
156
|
};
|
|
157
|
+
/** Named stereo placement when positional mixing is off (and for TTS panning). */
|
|
158
|
+
export type MixPlacement = "center" | "left" | "right" | "front" | "behind" | "below" | "above";
|
|
159
|
+
/** 6DOF pose for positional mixing (world position + unit quaternion). */
|
|
160
|
+
export interface MixPose {
|
|
161
|
+
position: {
|
|
162
|
+
x: number;
|
|
163
|
+
y: number;
|
|
164
|
+
z: number;
|
|
165
|
+
};
|
|
166
|
+
orientation: {
|
|
167
|
+
x: number;
|
|
168
|
+
y: number;
|
|
169
|
+
z: number;
|
|
170
|
+
w: number;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
export type MixControlAction = "create_group" | "add_client" | "remove_client" | "set_pose" | "set_positional" | "set_default_placement" | "set_tts_placement" | "set_tts_pose" | "clear_tts_pose";
|
|
174
|
+
/**
|
|
175
|
+
* Ask the runner parent to change mix groups, poses, or placement settings.
|
|
176
|
+
*
|
|
177
|
+
* Mix runs in the runner parent — use {@link createMixGroup}, {@link setClientPose},
|
|
178
|
+
* and related helpers instead of raw `process.send`. Requires Voice+Data
|
|
179
|
+
* ({@link SessionStartMessage.mixAvailable}).
|
|
180
|
+
*/
|
|
181
|
+
export interface MixControlMessage {
|
|
182
|
+
type: "mix_control";
|
|
183
|
+
action: MixControlAction;
|
|
184
|
+
/** Correlates with {@link MixControlAckMessage.requestId}. */
|
|
185
|
+
requestId: string;
|
|
186
|
+
groupId?: string;
|
|
187
|
+
/** Peer/session ids (orchestrator session id). */
|
|
188
|
+
clientIds?: string[];
|
|
189
|
+
/** Single peer/session id for add/remove/pose actions. */
|
|
190
|
+
clientId?: string;
|
|
191
|
+
pose?: MixPose;
|
|
192
|
+
enabled?: boolean;
|
|
193
|
+
placement?: MixPlacement;
|
|
194
|
+
}
|
|
195
|
+
/** Runner acknowledgement for a {@link MixControlMessage}. */
|
|
196
|
+
export interface MixControlAckMessage {
|
|
197
|
+
type: "mix_control_ack";
|
|
198
|
+
action: MixControlAction;
|
|
199
|
+
requestId: string;
|
|
200
|
+
ok: boolean;
|
|
201
|
+
reason?: "applied" | "unsupported" | "local_mock" | "timeout" | string;
|
|
202
|
+
}
|
|
203
|
+
/** Result returned by mix control helpers. */
|
|
204
|
+
export type MixControlResult = {
|
|
205
|
+
ok: boolean;
|
|
206
|
+
reason?: string;
|
|
207
|
+
requestId: string;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Ask the runner parent to enable or disable STT for one client or all clients.
|
|
211
|
+
*
|
|
212
|
+
* `clientId` omitted targets every connected client. `clientId` is the same id as
|
|
213
|
+
* {@link SessionContext.sessionId} (orchestrator/browser peer id).
|
|
214
|
+
*/
|
|
215
|
+
export interface SttControlMessage {
|
|
216
|
+
type: "stt_control";
|
|
217
|
+
requestId: string;
|
|
218
|
+
enabled: boolean;
|
|
219
|
+
/** When set, only this peer/session is affected. */
|
|
220
|
+
clientId?: string;
|
|
221
|
+
/**
|
|
222
|
+
* Optional scope hint for the runner (same id as `clientId` when targeting one peer).
|
|
223
|
+
* Omitted when toggling all clients.
|
|
224
|
+
*/
|
|
225
|
+
sessionId?: string;
|
|
226
|
+
}
|
|
227
|
+
/** Runner acknowledgement for a {@link SttControlMessage}. */
|
|
228
|
+
export interface SttControlAckMessage {
|
|
229
|
+
type: "stt_control_ack";
|
|
230
|
+
requestId: string;
|
|
231
|
+
ok: boolean;
|
|
232
|
+
reason?: "applied" | "unsupported" | "local_mock" | "timeout" | string;
|
|
233
|
+
}
|
|
234
|
+
/** Result returned by {@link setSttEnabled}. */
|
|
235
|
+
export type SttControlResult = {
|
|
236
|
+
ok: boolean;
|
|
237
|
+
reason?: string;
|
|
238
|
+
requestId: string;
|
|
239
|
+
};
|
|
240
|
+
/** Thrown by mix group helpers when {@link SessionStartMessage.mixAvailable} is not `true`. */
|
|
241
|
+
export declare const MIX_REQUIRES_VOICE_PLUS_DATA = "Mix APIs require sessionMode 'voice+data' (voice tracks and a sync data channel)";
|
|
242
|
+
/** Thrown by TTS pose helpers when {@link SessionStartMessage.ttsPoseAvailable} is not `true`. */
|
|
243
|
+
export declare const TTS_POSE_REQUIRES_VOICE = "TTS pose APIs require voice or voice+data (not data-only)";
|
|
147
244
|
/** Log severity forwarded to the runner parent process. */
|
|
148
245
|
export type AgentLogLevel = "debug" | "info" | "warn" | "error";
|
|
149
246
|
/**
|
package/dist/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAC5B,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,yBAAyB,GACzB,wBAAwB,GACxB,kBAAkB,GAClB,0BAA0B,GAC1B,cAAc,CAAC;AAEnB;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAC5B,sBAAsB,GACtB,YAAY,GACZ,uBAAuB,GACvB,eAAe,GACf,iBAAiB,GACjB,mBAAmB,GACnB,yBAAyB,GACzB,sBAAsB,GACtB,uBAAuB,GACvB,qBAAqB,CAAC;AAE1B,8DAA8D;AAC9D,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,MAAM,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,CAAC;IACtB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,MA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E,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,iGAOzB,CAAC;AAEX,0CAA0C;AAC1C,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/protocol.js
CHANGED
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
*/
|
|
11
|
+
/** Thrown by mix group helpers when {@link SessionStartMessage.mixAvailable} is not `true`. */
|
|
12
|
+
export const MIX_REQUIRES_VOICE_PLUS_DATA = "Mix APIs require sessionMode 'voice+data' (voice tracks and a sync data channel)";
|
|
13
|
+
/** Thrown by TTS pose helpers when {@link SessionStartMessage.ttsPoseAvailable} is not `true`. */
|
|
14
|
+
export const TTS_POSE_REQUIRES_VOICE = "TTS pose APIs require voice or voice+data (not data-only)";
|
|
11
15
|
/**
|
|
12
16
|
* Environment variable names the runner may inject into {@link SessionStartMessage.env}.
|
|
13
17
|
*
|
package/dist/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA6RH,+FAA+F;AAC/F,MAAM,CAAC,MAAM,4BAA4B,GACvC,kFAAkF,CAAC;AAErF,kGAAkG;AAClG,MAAM,CAAC,MAAM,uBAAuB,GAClC,2DAA2D,CAAC;AAwH9D;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,kBAAkB;IAClB,wEAAwE;IACxE,wBAAwB;CAChB,CAAC"}
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SpeechEvent } from "@node-webrtc-rust/sdk/voice";
|
|
2
|
-
import type { AgentLogLevel, DataChannelKind, RecordingControlResult } from "./protocol.js";
|
|
2
|
+
import type { AgentLogLevel, DataChannelKind, MixControlResult, MixPlacement, MixPose, RecordingControlResult, SttControlResult } from "./protocol.js";
|
|
3
3
|
export declare const SESSION_START_INIT_DELAY_ENABLED_ENV = "AGENT_SESSION_START_INIT_DELAY_ENABLED";
|
|
4
4
|
export declare const SESSION_START_INIT_DELAY_MS_ENV = "AGENT_SESSION_START_INIT_DELAY_MS";
|
|
5
5
|
export interface SessionContext {
|
|
@@ -7,6 +7,10 @@ export interface SessionContext {
|
|
|
7
7
|
env: Record<string, string>;
|
|
8
8
|
/** `true` when the runner advertises conversation recording for this project. */
|
|
9
9
|
recordingAvailable: boolean;
|
|
10
|
+
/** `true` when the runner session is Voice+Data and mix group APIs are available. */
|
|
11
|
+
mixAvailable: boolean;
|
|
12
|
+
/** `true` when TTS pose / listener pose APIs are available (voice or Voice+Data). */
|
|
13
|
+
ttsPoseAvailable: boolean;
|
|
10
14
|
}
|
|
11
15
|
export interface SpeechContext {
|
|
12
16
|
sessionId: string;
|
|
@@ -129,6 +133,46 @@ export declare function resetAgentIpcStateForTests(): void;
|
|
|
129
133
|
export declare function speak(sessionId: string, text: string): void;
|
|
130
134
|
/** True when {@link SessionStartMessage.recordingAvailable} was set for the session. */
|
|
131
135
|
export declare function isRecordingAvailable(ctx: SessionContext): boolean;
|
|
136
|
+
/** True when {@link SessionStartMessage.mixAvailable} was set for the session. */
|
|
137
|
+
export declare function isMixAvailable(ctx: SessionContext): boolean;
|
|
138
|
+
/** True when {@link SessionStartMessage.ttsPoseAvailable} was set for the session. */
|
|
139
|
+
export declare function isTtsPoseAvailable(ctx: SessionContext): boolean;
|
|
140
|
+
/** Create a mix group with initial members (Voice+Data only). */
|
|
141
|
+
export declare function createMixGroup(options: {
|
|
142
|
+
id: string;
|
|
143
|
+
clientIds: string[];
|
|
144
|
+
}): Promise<MixControlResult>;
|
|
145
|
+
/**
|
|
146
|
+
* Move a client into a mix group (exclusive — removed from any previous group).
|
|
147
|
+
* `clientId` is the orchestrator/browser peer id ({@link SessionContext.sessionId}).
|
|
148
|
+
*/
|
|
149
|
+
export declare function addClientToMix(groupId: string, clientId: string): Promise<MixControlResult>;
|
|
150
|
+
/** Remove a client from a mix group (ungrouped — hears nobody). */
|
|
151
|
+
export declare function removeClientFromMix(groupId: string, clientId: string): Promise<MixControlResult>;
|
|
152
|
+
/** Update a client's 6DOF pose for positional mixing. */
|
|
153
|
+
export declare function setClientPose(clientId: string, pose: MixPose): Promise<MixControlResult>;
|
|
154
|
+
/** Enable or disable live pose-based panning (voice or Voice+Data). */
|
|
155
|
+
export declare function setPositionalMixing(enabled: boolean): Promise<MixControlResult>;
|
|
156
|
+
/** Set named placement for client sources when positional mixing is off. */
|
|
157
|
+
export declare function setDefaultMixPlacement(placement: MixPlacement): Promise<MixControlResult>;
|
|
158
|
+
/** Set named placement for agent TTS in the mix output. */
|
|
159
|
+
export declare function setTtsMixPlacement(placement: MixPlacement): Promise<MixControlResult>;
|
|
160
|
+
/** Set a live world-space pose for the TTS speaker (positional mixing on). */
|
|
161
|
+
export declare function setTtsPose(sessionId: string, pose: MixPose): Promise<MixControlResult>;
|
|
162
|
+
/** Clear the live TTS pose for one client; named placement applies again. */
|
|
163
|
+
export declare function clearTtsPose(sessionId: string): Promise<MixControlResult>;
|
|
164
|
+
/**
|
|
165
|
+
* Enable or disable STT for one client or all connected clients.
|
|
166
|
+
*
|
|
167
|
+
* When `clientId` is omitted, the runner applies the change to every client.
|
|
168
|
+
* `clientId` matches {@link SessionContext.sessionId}. Optional `sessionId` is
|
|
169
|
+
* forwarded to the runner when provided (same peer id for single-client scope).
|
|
170
|
+
*/
|
|
171
|
+
export declare function setSttEnabled(options: {
|
|
172
|
+
enabled: boolean;
|
|
173
|
+
clientId?: string;
|
|
174
|
+
sessionId?: string;
|
|
175
|
+
}): Promise<SttControlResult>;
|
|
132
176
|
/** Ask the runner parent to start conversation recording for the session. */
|
|
133
177
|
export declare function startRecording(sessionId: string): Promise<RecordingControlResult>;
|
|
134
178
|
/** Ask the runner parent to pause an in-progress recording for the session. */
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG/D,OAAO,KAAK,EACV,aAAa,EAEb,eAAe,EAIf,sBAAsB,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG/D,OAAO,KAAK,EACV,aAAa,EAEb,eAAe,EAIf,gBAAgB,EAChB,YAAY,EACZ,OAAO,EAIP,sBAAsB,EAEtB,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AAOvB,eAAO,MAAM,oCAAoC,2CACP,CAAC;AAC3C,eAAO,MAAM,+BAA+B,sCACP,CAAC;AAGtC,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;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