@voicethere/agent 0.7.10 → 0.7.11

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.
@@ -1417,6 +1417,7 @@ function startOrbitDemo(sessionId, state) {
1417
1417
  );
1418
1418
  emitOrbitPose(sessionId, state);
1419
1419
  }, ORBIT_TICK_MS);
1420
+ emitOrbitPose(sessionId, state);
1420
1421
  speak(sessionId, "I'll circle around you.");
1421
1422
  }
1422
1423
  function broadcastRoomStateIfChanged() {
@@ -1581,13 +1582,13 @@ async function handleJoin(sessionId, demo, assetOrigin) {
1581
1582
  return;
1582
1583
  }
1583
1584
  state.inProximityRoom = true;
1585
+ startProximityRoomBroadcast(sessionId, state);
1584
1586
  speak(sessionId, "Welcome to the proximity room.");
1585
1587
  await safeMixCall(
1586
1588
  sessionId,
1587
1589
  "setTtsPose",
1588
1590
  () => setTtsPose(sessionId, poseAt(0, 0))
1589
1591
  );
1590
- startProximityRoomBroadcast(sessionId, state);
1591
1592
  break;
1592
1593
  }
1593
1594
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voicethere/agent",
3
- "version": "0.7.10",
3
+ "version": "0.7.11",
4
4
  "description": "VoiceThere customer agent SDK — IPC types and runtime helpers for sandboxed child bundles",
5
5
  "type": "module",
6
6
  "exports": {
@@ -143,7 +143,10 @@ async function safeMixCall(
143
143
  }
144
144
  }
145
145
 
146
- function defaultSessionState(demo: ShowcaseDemo, assetOrigin?: string): SessionState {
146
+ function defaultSessionState(
147
+ demo: ShowcaseDemo,
148
+ assetOrigin?: string,
149
+ ): SessionState {
147
150
  return {
148
151
  demo,
149
152
  assetOrigin,
@@ -162,7 +165,11 @@ function clearRoomStateTimer(state: SessionState): void {
162
165
  }
163
166
  }
164
167
 
165
- function clearLoopPad(sessionId: string, state: SessionState, playId: string): void {
168
+ function clearLoopPad(
169
+ sessionId: string,
170
+ state: SessionState,
171
+ playId: string,
172
+ ): void {
166
173
  const timer = state.loopPollTimers.get(playId);
167
174
  if (timer) {
168
175
  clearInterval(timer);
@@ -201,7 +208,8 @@ function emitOrbitPose(sessionId: string, state: SessionState): void {
201
208
  state.lastOrbitPoseEmitMs = now;
202
209
  const elapsedSec = (now - state.orbitStartMs) / 1000;
203
210
  const pose = orbitTtsPose(elapsedSec, state.orbit);
204
- const angleRad = (2 * Math.PI * elapsedSec) / (state.orbit.periodSec ?? 2 * Math.PI);
211
+ const angleRad =
212
+ (2 * Math.PI * elapsedSec) / (state.orbit.periodSec ?? 2 * Math.PI);
205
213
  sendToClient(sessionId, {
206
214
  type: "orbit_pose",
207
215
  angleDeg: (angleRad * 180) / Math.PI,
@@ -223,6 +231,7 @@ function startOrbitDemo(sessionId: string, state: SessionState): void {
223
231
  );
224
232
  emitOrbitPose(sessionId, state);
225
233
  }, ORBIT_TICK_MS);
234
+ emitOrbitPose(sessionId, state);
226
235
  speak(sessionId, "I'll circle around you.");
227
236
  }
228
237
 
@@ -250,7 +259,10 @@ function broadcastRoomStateIfChanged(): void {
250
259
  }
251
260
  }
252
261
 
253
- function startProximityRoomBroadcast(sessionId: string, state: SessionState): void {
262
+ function startProximityRoomBroadcast(
263
+ sessionId: string,
264
+ state: SessionState,
265
+ ): void {
254
266
  clearRoomStateTimer(state);
255
267
  state.roomStateTimer = setInterval(() => {
256
268
  broadcastRoomStateIfChanged();
@@ -421,11 +433,11 @@ async function handleJoin(
421
433
  return;
422
434
  }
423
435
  state.inProximityRoom = true;
436
+ startProximityRoomBroadcast(sessionId, state);
424
437
  speak(sessionId, "Welcome to the proximity room.");
425
438
  await safeMixCall(sessionId, "setTtsPose", () =>
426
439
  setTtsPose(sessionId, poseAt(0, 0)),
427
440
  );
428
- startProximityRoomBroadcast(sessionId, state);
429
441
  break;
430
442
  }
431
443
  }