@voicethere/agent 0.7.1 → 0.7.2

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@voicethere/agent",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "VoiceThere customer agent SDK — IPC types and runtime helpers for sandboxed child bundles",
5
5
  "type": "module",
6
6
  "exports": {
@@ -10,12 +10,16 @@
10
10
  * - `{ type: "mix", action: "set_global_mute", clientId, muted, sttEnabled? }`
11
11
  * - `{ type: "mix", action: "set_listener_mute", listenerId, targetId, muted }`
12
12
  * - `{ type: "mix", action: "get_status", clientId? }`
13
+ * - `{ type: "mix", action: "set_tts_pose", clientId, pose }`
14
+ * - `{ type: "mix", action: "speak", clientId, text }`
15
+ * - `{ type: "mix", action: "clear_tts_pose", clientId }`
13
16
  *
14
17
  * Acks: `{ type: "mix_ack", action, ok: true, statuses?, ... }` or `{ ok: false, error }`.
15
- * Ignores `ping` / chat strings (voice-control readiness). No TTS during smoke.
18
+ * Ignores `ping` / chat strings (voice-control readiness).
16
19
  */
17
20
  import {
18
21
  MIX_REQUIRES_VOICE_PLUS_DATA,
22
+ clearTtsPose,
19
23
  createMixGroup,
20
24
  defineAgent,
21
25
  getClientMixStatus,
@@ -24,6 +28,8 @@ import {
24
28
  setGlobalMute,
25
29
  setListenerMute,
26
30
  setPositionalMixing,
31
+ setTtsPose,
32
+ speak,
27
33
  } from "@voicethere/agent";
28
34
 
29
35
  /** E2E fixture marker — rewritten before each fixture upload when needed. */
@@ -59,7 +65,10 @@ export type MixCommand =
59
65
  targetId: string;
60
66
  muted: boolean;
61
67
  }
62
- | { type: "mix"; action: "get_status"; clientId?: string };
68
+ | { type: "mix"; action: "get_status"; clientId?: string }
69
+ | { type: "mix"; action: "set_tts_pose"; clientId: string; pose: MixPose }
70
+ | { type: "mix"; action: "speak"; clientId: string; text: string }
71
+ | { type: "mix"; action: "clear_tts_pose"; clientId: string };
63
72
 
64
73
  export type MixClientStatus = {
65
74
  clientId?: string;
@@ -161,6 +170,30 @@ export function isMixCommand(message: unknown): message is MixCommand {
161
170
  typeof status.clientId === "string" && status.clientId.trim().length > 0
162
171
  );
163
172
  }
173
+ case "set_tts_pose": {
174
+ const ttsPose = message as { clientId?: unknown; pose?: unknown };
175
+ return (
176
+ typeof ttsPose.clientId === "string" &&
177
+ ttsPose.clientId.trim().length > 0 &&
178
+ isMixPose(ttsPose.pose)
179
+ );
180
+ }
181
+ case "speak": {
182
+ const speakMsg = message as { clientId?: unknown; text?: unknown };
183
+ return (
184
+ typeof speakMsg.clientId === "string" &&
185
+ speakMsg.clientId.trim().length > 0 &&
186
+ typeof speakMsg.text === "string" &&
187
+ speakMsg.text.trim().length > 0
188
+ );
189
+ }
190
+ case "clear_tts_pose": {
191
+ const clearMsg = message as { clientId?: unknown };
192
+ return (
193
+ typeof clearMsg.clientId === "string" &&
194
+ clearMsg.clientId.trim().length > 0
195
+ );
196
+ }
164
197
  default:
165
198
  return false;
166
199
  }
@@ -327,6 +360,32 @@ async function handleMixCommand(
327
360
  });
328
361
  return;
329
362
  }
363
+ case "set_tts_pose": {
364
+ if (!requireMix(sessionId, action)) return;
365
+ const result = await setTtsPose(command.clientId, command.pose);
366
+ if (!result.ok) {
367
+ ackError(sessionId, action, result.reason ?? "set_tts_pose failed");
368
+ return;
369
+ }
370
+ ackOk(sessionId, action);
371
+ return;
372
+ }
373
+ case "speak": {
374
+ if (!requireMix(sessionId, action)) return;
375
+ speak(command.clientId, command.text);
376
+ ackOk(sessionId, action);
377
+ return;
378
+ }
379
+ case "clear_tts_pose": {
380
+ if (!requireMix(sessionId, action)) return;
381
+ const result = await clearTtsPose(command.clientId);
382
+ if (!result.ok) {
383
+ ackError(sessionId, action, result.reason ?? "clear_tts_pose failed");
384
+ return;
385
+ }
386
+ ackOk(sessionId, action);
387
+ return;
388
+ }
330
389
  default:
331
390
  ackError(sessionId, "unknown", "unsupported mix action");
332
391
  }