@burdenoff/fe-libs 2026.1115.10 → 2026.1115.12

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.
Files changed (37) hide show
  1. package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.d.ts +8 -1
  2. package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.js +126 -123
  3. package/dist/shared/assistant/avatar/live/liveAvatarController.d.ts +7 -0
  4. package/dist/shared/assistant/avatar/live/liveAvatarController.js +3 -2
  5. package/dist/shared/assistant/index.d.ts +1 -0
  6. package/dist/shared/assistant/ui/AssistantAvatar.js +18 -14
  7. package/dist/shared/assistant/ui/AssistantChatArea.js +1 -0
  8. package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +5 -0
  9. package/dist/shared/assistant/ui/AssistantMessageItem.js +57 -56
  10. package/dist/shared/assistant/ui/AssistantMessageList.js +57 -44
  11. package/dist/shared/assistant/ui/AssistantTurnActivity.d.ts +2 -0
  12. package/dist/shared/assistant/ui/AssistantTurnActivity.js +20 -17
  13. package/dist/shared/assistant/ui/assistantLiveAvatarSeam.d.ts +26 -0
  14. package/dist/shared/assistant/ui/assistantLiveAvatarSeam.js +87 -79
  15. package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +5 -0
  16. package/dist/shared/assistant/ui/composer/AssistantComposer.js +348 -343
  17. package/dist/shared/assistant/ui/composer/AssistantDictation.js +57 -56
  18. package/dist/shared/assistant/ui/composer/AssistantHandsFreeInterruptToggle.d.ts +4 -0
  19. package/dist/shared/assistant/ui/composer/AssistantHandsFreeInterruptToggle.js +22 -22
  20. package/dist/shared/assistant/ui/composer/pageBoxClass.d.ts +13 -0
  21. package/dist/shared/assistant/ui/composer/pageBoxClass.js +5 -0
  22. package/dist/shared/assistant/ui/useVoiceSession.js +223 -223
  23. package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.js +41 -35
  24. package/dist/shared/assistant/ui/voice/AssistantVoiceSessionButton.js +13 -12
  25. package/dist/shared/assistant/ui/voice/LiveWaveform.js +28 -27
  26. package/dist/shared/assistant/voice/handsfree/handsFreeController.js +79 -79
  27. package/dist/shared/assistant/voice/handsfree/handsFreeSetting.d.ts +6 -1
  28. package/dist/shared/assistant/voice/handsfree/handsFreeSetting.js +2 -2
  29. package/dist/shared/assistant/voice/handsfree/playbackReference.d.ts +45 -3
  30. package/dist/shared/assistant/voice/handsfree/playbackReference.js +62 -15
  31. package/dist/shared-assistant.js +371 -370
  32. package/package.json +1 -1
  33. package/src/shared/styles/app-shell.css +5 -0
  34. package/src/shared/tokens/build/semantic.css +12 -0
  35. package/src/shared/tokens/build/tailwind.preset.js +5 -0
  36. package/src/shared/tokens/build/themes.css +14 -0
  37. package/src/shared/tokens/tokens.css +268 -0
@@ -46,6 +46,13 @@ export interface LiveAvatarSeamOptions {
46
46
  * plan checkout, `controller.checkMinutesPurchase()` (the tab then says "Checking your plan…" while it checks).
47
47
  */
48
48
  readonly minutesPurchase?: LiveAvatarMinutesPurchase;
49
+ /**
50
+ * ★ P5 (BOFF-12936): let hands-free interrupt stay ON while the avatar is ON, so a person can talk over the avatar to
51
+ * interrupt it, and the avatar's own voice is refused as an echo (it becomes the echo gate's reference). DEFAULT OFF: then
52
+ * the BOFF-8822 pilot rule holds as before (hands-free OFF while the avatar is ON). Turn it on per environment, alpha
53
+ * first; it takes effect only where the browser can route the avatar's received voice (`isAvatarVoiceReferenceSupported`).
54
+ */
55
+ readonly handsFreeWithAvatar?: boolean;
49
56
  readonly onLog?: (event: LiveAvatarLogEvent) => void;
50
57
  /** Overrides, for tests and for hosts with their own plumbing. Each defaults to the assistant's own. */
51
58
  readonly client?: () => AvatarSessionClient | null;
@@ -58,7 +65,7 @@ export interface LiveAvatarSeamOptions {
58
65
  readonly avatarVoiceStore?: LiveAvatarVoiceStore;
59
66
  readonly scheduler?: AvatarScheduler;
60
67
  readonly browserSupported?: () => boolean;
61
- readonly controller?: Partial<Pick<LiveAvatarControllerDeps, 'createAudioElement' | 'releaseAudioElement' | 'startMeter' | 'decode' | 'now' | 'newIdempotencyKey' | 'subscribeWorkspaceChange' | 'subscribePageHide' | 'subscribePageHidden' | 'endOnHide' | 'subscribeUserGesture' | 'isPageVisible' | 'subscribePageVisible' | 'subscribePageShow' | 'idleMs' | 'endBeforeDeadlineMs' | 'connectTimeoutMs' | 'trackerConfig' | 'maxDrainMs' | 'stallMs' | 'readinessProbe'>>;
68
+ readonly controller?: Partial<Pick<LiveAvatarControllerDeps, 'createAudioElement' | 'releaseAudioElement' | 'startMeter' | 'decode' | 'now' | 'newIdempotencyKey' | 'subscribeWorkspaceChange' | 'subscribePageHide' | 'subscribePageHidden' | 'endOnHide' | 'subscribeUserGesture' | 'isPageVisible' | 'subscribePageVisible' | 'subscribePageShow' | 'idleMs' | 'endBeforeDeadlineMs' | 'connectTimeoutMs' | 'trackerConfig' | 'maxDrainMs' | 'stallMs' | 'readinessProbe' | 'registerVoiceReference'>>;
62
69
  }
63
70
  /** The seam, plus what a host or a test may need of it. */
64
71
  export interface LiveAvatarSeamHandle extends AssistantLiveAvatarSeam {
@@ -1,46 +1,47 @@
1
1
  import { ensureWorkspaceToken as e, getStoredAuthToken as t, getStoredWorkspaceId as n, resolveGatewayUrl as r } from "../../../graphql/fetch.js";
2
2
  import { readSpeechEngineConfig as i } from "../../speech/createSpeechEngine.js";
3
- import { isOutputRefusal as a } from "../../speech/pieceSink.js";
4
- import { useAvatarPreferencesStore as o } from "../avatarPreferences.js";
5
- import { decodeMp3ToPcm16k as s } from "./avatarAudioDecode.js";
6
- import { startAvatarAudioMeter as c } from "./avatarAudioMeter.js";
7
- import { sanitizeAvatarImages as l } from "./avatarFaces.js";
8
- import { AVATAR_SAMPLE_RATE as u } from "./avatarPcm16.js";
9
- import { realAvatarScheduler as d } from "./avatarPorts.js";
10
- import { avatarApiBaseFromTtsEndpoint as f, avatarIdempotencyKey as p, createAvatarSessionClient as m } from "./avatarSessionClient.js";
11
- import { LiveAvatarStageView as ee } from "./LiveAvatarStage.js";
12
- import { LiveAvatarCompactView as h } from "./LiveAvatarCompactView.js";
13
- import { LiveAvatarSettings as g } from "./LiveAvatarSettings.js";
14
- import { LiveAvatarTabView as _ } from "./LiveAvatarTabView.js";
15
- import { createLiveAvatarController as v } from "./liveAvatarController.js";
16
- import { openLiveKitAvatarRoom as y } from "./liveKitAvatarRoom.js";
17
- import { liveAvatarAskState as b } from "./liveAvatarStatus.js";
18
- import { avatarSpeakerFor as x, hostedAvatarVoice as S, liveAvatarVoicesFrom as C, restoreVoiceWhenOutputLeaves as w } from "./avatarVoice.js";
19
- import { jsx as T } from "react/jsx-runtime";
3
+ import { registerAvatarVoice as a } from "../../voice/handsfree/playbackReference.js";
4
+ import { isOutputRefusal as o } from "../../speech/pieceSink.js";
5
+ import { useAvatarPreferencesStore as s } from "../avatarPreferences.js";
6
+ import { decodeMp3ToPcm16k as c } from "./avatarAudioDecode.js";
7
+ import { startAvatarAudioMeter as l } from "./avatarAudioMeter.js";
8
+ import { sanitizeAvatarImages as u } from "./avatarFaces.js";
9
+ import { AVATAR_SAMPLE_RATE as d } from "./avatarPcm16.js";
10
+ import { realAvatarScheduler as f } from "./avatarPorts.js";
11
+ import { avatarApiBaseFromTtsEndpoint as p, avatarIdempotencyKey as m, createAvatarSessionClient as h } from "./avatarSessionClient.js";
12
+ import { LiveAvatarStageView as g } from "./LiveAvatarStage.js";
13
+ import { LiveAvatarCompactView as _ } from "./LiveAvatarCompactView.js";
14
+ import { LiveAvatarSettings as ee } from "./LiveAvatarSettings.js";
15
+ import { LiveAvatarTabView as v } from "./LiveAvatarTabView.js";
16
+ import { createLiveAvatarController as y } from "./liveAvatarController.js";
17
+ import { openLiveKitAvatarRoom as b } from "./liveKitAvatarRoom.js";
18
+ import { liveAvatarAskState as x } from "./liveAvatarStatus.js";
19
+ import { avatarSpeakerFor as S, hostedAvatarVoice as C, liveAvatarVoicesFrom as w, restoreVoiceWhenOutputLeaves as T } from "./avatarVoice.js";
20
+ import { jsx as E } from "react/jsx-runtime";
20
21
  // src/shared/assistant/avatar/live/createLiveAvatarSeam.tsx
21
- var E = /* @__PURE__ */ new WeakMap();
22
- function D(e = globalThis) {
23
- let t = E.get(e);
22
+ var D = /* @__PURE__ */ new WeakMap();
23
+ function O(e = globalThis) {
24
+ let t = D.get(e);
24
25
  if (t !== void 0) return t;
25
- let n = O(e);
26
- return E.set(e, n), n;
26
+ let n = k(e);
27
+ return D.set(e, n), n;
27
28
  }
28
- function O(e) {
29
+ function k(e) {
29
30
  if (typeof e.RTCPeerConnection != "function" || typeof e.AudioContext != "function" || typeof e.MediaStream != "function" || typeof e.OfflineAudioContext != "function") return !1;
30
31
  try {
31
- return new e.OfflineAudioContext(1, 1, u), !0;
32
+ return new e.OfflineAudioContext(1, 1, d), !0;
32
33
  } catch {
33
34
  return !1;
34
35
  }
35
36
  }
36
- function k() {
37
+ function A() {
37
38
  let e = i().getHeaders?.() ?? {};
38
39
  for (let [t, n] of Object.entries(e)) if (t.toLowerCase() === "authorization" && typeof n == "string" && n.trim() !== "") return n.trim();
39
40
  let n = t();
40
41
  return n ? `Bearer ${n}` : null;
41
42
  }
42
- async function A(t) {
43
- let i = n(), a = k(), o = a?.replace(/^Bearer\s+/i, "") ?? null;
43
+ async function j(t) {
44
+ let i = n(), a = A(), o = a?.replace(/^Bearer\s+/i, "") ?? null;
44
45
  if (!i || !o) return null;
45
46
  let s = t.refused?.replace(/^Bearer\s+/i, ""), c = await e({
46
47
  url: r("workspace"),
@@ -49,40 +50,40 @@ async function A(t) {
49
50
  currentQuery: "liveAvatarSession",
50
51
  ...t.fresh ? { issuanceGuard: {
51
52
  identityKey: "liveAvatarSession",
52
- isCurrent: () => n() === i && k() === a,
53
+ isCurrent: () => n() === i && A() === a,
53
54
  accepts: (e, t) => e !== s && t === i
54
55
  } } : {}
55
56
  });
56
57
  return c ? `Bearer ${c}` : null;
57
58
  }
58
- function j() {
59
+ function M() {
59
60
  let e = null;
60
61
  return () => {
61
- let t = typeof location > "u" ? void 0 : location.href, n = f(i().endpoint, t);
62
+ let t = typeof location > "u" ? void 0 : location.href, n = p(i().endpoint, t);
62
63
  return n === null ? null : (e?.base !== n && (e = {
63
64
  base: n,
64
- client: m({
65
+ client: h({
65
66
  baseUrl: n,
66
- getAuthorization: k,
67
- getWorkspaceAuthorization: A
67
+ getAuthorization: A,
68
+ getWorkspaceAuthorization: j
68
69
  })
69
70
  }), e.client);
70
71
  };
71
72
  }
72
- var M = {
73
- getState: () => o.getState(),
74
- setAvatarEnabled: (e) => o.getState().setAvatarEnabled(e),
75
- setAvatarId: (e) => o.getState().setAvatarId(e),
76
- subscribe: (e) => o.subscribe(() => e())
77
- }, N = {
78
- getState: () => o.getState(),
79
- subscribe: (e) => o.subscribe(() => e()),
80
- setVoiceMode: (e) => o.getState().setVoiceMode(e),
81
- setAvatarSpeaker: (e) => o.getState().setAvatarSpeaker(e)
73
+ var N = {
74
+ getState: () => s.getState(),
75
+ setAvatarEnabled: (e) => s.getState().setAvatarEnabled(e),
76
+ setAvatarId: (e) => s.getState().setAvatarId(e),
77
+ subscribe: (e) => s.subscribe(() => e())
78
+ }, P = {
79
+ getState: () => s.getState(),
80
+ subscribe: (e) => s.subscribe(() => e()),
81
+ setVoiceMode: (e) => s.getState().setVoiceMode(e),
82
+ setAvatarSpeaker: (e) => s.getState().setAvatarSpeaker(e)
82
83
  };
83
- function P(e, t) {
84
+ function F(e, t) {
84
85
  let n = (e) => {
85
- a(e) || t();
86
+ o(e) || t();
86
87
  };
87
88
  return {
88
89
  write: (t, r, i) => {
@@ -97,20 +98,20 @@ function P(e, t) {
97
98
  cancel: () => e.cancel()
98
99
  };
99
100
  }
100
- function F(e) {
101
+ function I(e) {
101
102
  if (e === void 0) return;
102
103
  let { access: t } = e;
103
104
  return { access: () => t.call(e) };
104
105
  }
105
- function I() {
106
+ function L() {
106
107
  if (typeof document > "u") return null;
107
108
  let e = document.createElement("audio");
108
109
  return e.autoplay = !0, e.hidden = !0, e.setAttribute("data-testid", "assistant-live-avatar-audio"), document.body.appendChild(e), e;
109
110
  }
110
- function L(e) {
111
+ function R(e) {
111
112
  if (typeof window < "u") return (t) => (window.addEventListener(e, t), () => window.removeEventListener(e, t));
112
113
  }
113
- function R() {
114
+ function z() {
114
115
  if (typeof document > "u" || typeof document.addEventListener != "function") return;
115
116
  let e = () => document.visibilityState !== "hidden";
116
117
  return {
@@ -135,10 +136,10 @@ function R() {
135
136
  }
136
137
  };
137
138
  }
138
- function z(e = globalThis) {
139
+ function B(e = globalThis) {
139
140
  return typeof e.matchMedia == "function" && e.matchMedia("(hover: none) and (pointer: coarse)").matches;
140
141
  }
141
- function B(e = typeof document > "u" ? null : document) {
142
+ function V(e = typeof document > "u" ? null : document) {
142
143
  if (e !== null && typeof e.addEventListener == "function") return (t) => {
143
144
  let n = (e) => {
144
145
  e.isTrusted && t();
@@ -151,7 +152,7 @@ function B(e = typeof document > "u" ? null : document) {
151
152
  };
152
153
  };
153
154
  }
154
- function V() {
155
+ function H() {
155
156
  if (typeof window < "u" && typeof document < "u") return (e) => {
156
157
  let t = window, n = document, r = () => {
157
158
  n.visibilityState === "visible" && e();
@@ -161,32 +162,32 @@ function V() {
161
162
  };
162
163
  };
163
164
  }
164
- function H(e) {
165
+ function U(e) {
165
166
  return e === "starting" || e === "connecting" || e === "ready";
166
167
  }
167
- function U(e = {}) {
168
- let t = e.preferences ?? M, n = e.controller ?? {}, r = n.subscribeWorkspaceChange ?? L("burdenoff:workspace-changed"), i = n.subscribePageHide ?? L("pagehide"), a = R(), o = n.isPageVisible ?? a?.isVisible, u = n.subscribePageVisible ?? a?.onShown, f = n.subscribePageHidden ?? a?.onHidden, m = n.endOnHide ?? z, E = n.subscribeUserGesture ?? B(), O = n.subscribePageShow ?? V(), k = n.now ?? (() => Date.now()), A = v({
169
- client: e.client ?? j(),
170
- openRoom: e.openRoom ?? y,
171
- scheduler: e.scheduler ?? d,
168
+ function W(e = {}) {
169
+ let t = e.preferences ?? N, n = e.controller ?? {}, r = n.subscribeWorkspaceChange ?? R("burdenoff:workspace-changed"), i = n.subscribePageHide ?? R("pagehide"), o = z(), s = n.isPageVisible ?? o?.isVisible, d = n.subscribePageVisible ?? o?.onShown, p = n.subscribePageHidden ?? o?.onHidden, h = n.endOnHide ?? B, D = n.subscribeUserGesture ?? V(), k = n.subscribePageShow ?? H(), A = n.now ?? (() => Date.now()), j = y({
170
+ client: e.client ?? M(),
171
+ openRoom: e.openRoom ?? b,
172
+ scheduler: e.scheduler ?? f,
172
173
  preferences: t,
173
- decode: n.decode ?? ((e, t) => s(e, { signal: t })),
174
- createAudioElement: n.createAudioElement ?? I,
174
+ decode: n.decode ?? ((e, t) => c(e, { signal: t })),
175
+ createAudioElement: n.createAudioElement ?? L,
175
176
  releaseAudioElement: n.releaseAudioElement ?? ((e) => {
176
177
  e.srcObject = null, e.remove();
177
178
  }),
178
- startMeter: n.startMeter ?? ((e, t) => typeof MediaStream > "u" ? null : c(new MediaStream([e]), t)),
179
- browserSupported: e.browserSupported ?? (() => D()),
180
- now: k,
181
- newIdempotencyKey: n.newIdempotencyKey ?? (() => p()),
179
+ startMeter: n.startMeter ?? ((e, t) => typeof MediaStream > "u" ? null : l(new MediaStream([e]), t)),
180
+ browserSupported: e.browserSupported ?? (() => O()),
181
+ now: A,
182
+ newIdempotencyKey: n.newIdempotencyKey ?? (() => m()),
182
183
  ...r ? { subscribeWorkspaceChange: r } : {},
183
184
  ...i ? { subscribePageHide: i } : {},
184
- ...o ? { isPageVisible: o } : {},
185
- ...u ? { subscribePageVisible: u } : {},
186
- ...f ? { subscribePageHidden: f } : {},
187
- endOnHide: m,
188
- ...E ? { subscribeUserGesture: E } : {},
189
- ...O ? { subscribePageShow: O } : {},
185
+ ...s ? { isPageVisible: s } : {},
186
+ ...d ? { subscribePageVisible: d } : {},
187
+ ...p ? { subscribePageHidden: p } : {},
188
+ endOnHide: h,
189
+ ...D ? { subscribeUserGesture: D } : {},
190
+ ...k ? { subscribePageShow: k } : {},
190
191
  ...n.idleMs === void 0 ? {} : { idleMs: n.idleMs },
191
192
  ...n.endBeforeDeadlineMs === void 0 ? {} : { endBeforeDeadlineMs: n.endBeforeDeadlineMs },
192
193
  ...n.connectTimeoutMs === void 0 ? {} : { connectTimeoutMs: n.connectTimeoutMs },
@@ -194,33 +195,34 @@ function U(e = {}) {
194
195
  ...n.maxDrainMs === void 0 ? {} : { maxDrainMs: n.maxDrainMs },
195
196
  ...n.stallMs === void 0 ? {} : { stallMs: n.stallMs },
196
197
  ...n.readinessProbe === void 0 ? {} : { readinessProbe: n.readinessProbe },
198
+ ...n.registerVoiceReference === void 0 ? e.handsFreeWithAvatar === !0 ? { registerVoiceReference: a } : {} : { registerVoiceReference: n.registerVoiceReference },
197
199
  ...e.onLog ? { onLog: e.onLog } : {}
198
- }), U = C(e.avatarVoices), W = e.avatarImages === void 0 ? null : l(e.avatarImages), G = e.avatarVoiceStore ?? N, K = () => G.getState(), q = F(e.minutesPurchase), J = (n, r) => {
199
- let i = x(K(), {
200
- avatarVoices: U,
200
+ }), W = w(e.avatarVoices), G = e.avatarImages === void 0 ? null : u(e.avatarImages), K = e.avatarVoiceStore ?? P, q = () => K.getState(), J = I(e.minutesPurchase), Y = (n, r) => {
201
+ let i = S(q(), {
202
+ avatarVoices: W,
201
203
  avatarId: t.getState().avatarId,
202
204
  ...e.defaultAvatarVoiceMode ? { hostDefault: e.defaultAvatarVoiceMode } : {}
203
205
  });
204
- return i === null ? null : S(i, n, r.listVoices());
205
- }, Y = (e, t) => {
206
+ return i === null ? null : C(i, n, r.listVoices());
207
+ }, X = (e, t) => {
206
208
  let n = {
207
209
  ...e,
208
210
  voice: t
209
211
  };
210
- return n.audioOutput = w(A.createOutput(), () => {
212
+ return n.audioOutput = T(j.createOutput(), () => {
211
213
  n.voice = e.voice;
212
- }, (e) => A.subscribe(() => {
213
- A.getSnapshot().phase !== "ready" && e();
214
+ }, (e) => j.subscribe(() => {
215
+ j.getSnapshot().phase !== "ready" && e();
214
216
  })), n;
215
- }, X = (e) => {
217
+ }, Z = (e) => {
216
218
  let t = (t) => {
217
- let n = J(t.lang, e), r = n === null ? t : {
219
+ let n = Y(t.lang, e), r = n === null ? t : {
218
220
  ...t,
219
221
  voice: n
220
222
  };
221
223
  return {
222
224
  voice: n,
223
- target: A.route(r, e)
225
+ target: j.route(r, e)
224
226
  };
225
227
  }, n = null, r = () => {
226
228
  let e = n;
@@ -231,9 +233,9 @@ function U(e = {}) {
231
233
  }, l = () => !o && (o = !0, c(), !0), u = () => {
232
234
  a && l() && (e.cancel(), i?.onError?.("output-left"));
233
235
  };
234
- s = A.subscribe(() => {
235
- A.getSnapshot().phase !== "ready" && u();
236
- }), n = c, r.audioOutput &&= P(r.audioOutput, u), r.fallback = !1, e.speak(t, r, {
236
+ s = j.subscribe(() => {
237
+ j.getSnapshot().phase !== "ready" && u();
238
+ }), n = c, r.audioOutput &&= F(r.audioOutput, u), r.fallback = !1, e.speak(t, r, {
237
239
  ...i,
238
240
  onEnd: () => {
239
241
  l() && i?.onEnd?.();
@@ -262,85 +264,86 @@ function U(e = {}) {
262
264
  }
263
265
  let l = s === null ? {
264
266
  ...a,
265
- audioOutput: A.createOutput()
266
- } : Y(a, s);
267
+ audioOutput: j.createOutput()
268
+ } : X(a, s);
267
269
  a.avatarOnly === !0 ? i(n, l, o) : e.speak(n, l, o);
268
270
  },
269
271
  cancel: () => {
270
272
  r(), e.cancel();
271
273
  }
272
274
  };
273
- }, Z = ({ expanded: t, fallback: n }) => /* @__PURE__ */ T(ee, {
274
- controller: A,
275
+ }, Q = ({ expanded: t, fallback: n }) => /* @__PURE__ */ E(g, {
276
+ controller: j,
275
277
  expanded: t,
276
278
  fallback: n,
277
279
  ...e.avatarNames ? { avatarNames: e.avatarNames } : {}
278
- }), Q = {
280
+ }), te = {
279
281
  subscribe: (e) => t.subscribe(e),
280
282
  getSnapshot: () => t.getState().avatarEnabled,
281
- switchOff: () => A.switchOff(),
282
- voiceLive: (e) => A.setVoiceLive(e)
283
+ switchOff: () => j.switchOff(),
284
+ voiceLive: (e) => j.setVoiceLive(e)
283
285
  }, $ = {
284
286
  subscribe: (e) => t.subscribe(e),
285
287
  getSnapshot: () => t.getState().avatarId
286
288
  };
287
289
  return {
288
- decorateSpeechEngine: X,
289
- Stage: Z,
290
- enabled: Q,
290
+ decorateSpeechEngine: Z,
291
+ Stage: Q,
292
+ enabled: te,
291
293
  tab: {
292
294
  offered: {
293
- subscribe: (e) => A.subscribe(e),
294
- getSnapshot: () => A.getSnapshot().tabOffered
295
+ subscribe: (e) => j.subscribe(e),
296
+ getSnapshot: () => j.getSnapshot().tabOffered
295
297
  },
296
298
  ask: {
297
- subscribe: (e) => A.subscribe(e),
298
- getSnapshot: () => b(A.getSnapshot(), k())
299
+ subscribe: (e) => j.subscribe(e),
300
+ getSnapshot: () => x(j.getSnapshot(), A())
299
301
  },
300
302
  running: {
301
- subscribe: (e) => A.subscribe(e),
302
- getSnapshot: () => H(A.getSnapshot().phase)
303
+ subscribe: (e) => j.subscribe(e),
304
+ getSnapshot: () => U(j.getSnapshot().phase)
303
305
  },
304
306
  endsOnLeave: {
305
- subscribe: (e) => A.subscribe(e),
307
+ subscribe: (e) => j.subscribe(e),
306
308
  getSnapshot: () => {
307
- let e = A.getSnapshot();
308
- return H(e.phase) && !e.heldByVoice;
309
+ let e = j.getSnapshot();
310
+ return U(e.phase) && !e.heldByVoice;
309
311
  }
310
312
  },
311
- setOpen: (e, t) => A.setTabOpen(e, t),
312
- heldByVoice: () => A.getSnapshot().heldByVoice,
313
- CompactView: (t) => /* @__PURE__ */ T(h, {
313
+ setOpen: (e, t) => j.setTabOpen(e, t),
314
+ heldByVoice: () => j.getSnapshot().heldByVoice,
315
+ CompactView: (t) => /* @__PURE__ */ E(_, {
314
316
  ...t,
315
- controller: A,
317
+ controller: j,
316
318
  savedAvatar: $,
317
319
  ...e.avatarNames ? { avatarNames: e.avatarNames } : {},
318
- ...W ? { avatarImages: W } : {}
320
+ ...G ? { avatarImages: G } : {}
319
321
  }),
320
- View: (t) => /* @__PURE__ */ T(_, {
322
+ View: (t) => /* @__PURE__ */ E(v, {
321
323
  ...t,
322
- controller: A,
323
- avatarVoices: U,
324
- voiceStore: G,
324
+ controller: j,
325
+ avatarVoices: W,
326
+ voiceStore: K,
325
327
  ...e.avatarNames ? { avatarNames: e.avatarNames } : {},
326
- ...W ? { avatarImages: W } : {},
328
+ ...G ? { avatarImages: G } : {},
327
329
  ...e.defaultAvatarVoiceMode ? { defaultAvatarVoiceMode: e.defaultAvatarVoiceMode } : {},
328
- ...q ? { minutesPurchase: q } : {}
330
+ ...J ? { minutesPurchase: J } : {}
329
331
  }),
330
- SettingsView: (t) => /* @__PURE__ */ T(g, {
332
+ SettingsView: (t) => /* @__PURE__ */ E(ee, {
331
333
  ...t,
332
- controller: A,
334
+ controller: j,
333
335
  savedAvatar: $,
334
- avatarVoices: U,
335
- voiceStore: G,
336
+ avatarVoices: W,
337
+ voiceStore: K,
336
338
  ...e.avatarNames ? { avatarNames: e.avatarNames } : {},
337
- ...W ? { avatarImages: W } : {},
339
+ ...G ? { avatarImages: G } : {},
338
340
  ...e.defaultAvatarVoiceMode ? { defaultAvatarVoiceMode: e.defaultAvatarVoiceMode } : {},
339
- ...q ? { minutesPurchase: q } : {}
341
+ ...J ? { minutesPurchase: J } : {}
340
342
  })
341
343
  },
342
- controller: A,
343
- dispose: () => A.dispose()
344
+ controller: j,
345
+ ...e.handsFreeWithAvatar === !0 ? { handsFreeWithAvatar: !0 } : {},
346
+ dispose: () => j.dispose()
344
347
  };
345
348
  }
346
- export { U as createLiveAvatarSeam, B as documentUserGesture, D as isLiveAvatarBrowserSupported, z as isTouchFirstDevice, k as liveAvatarAuthorization, A as liveAvatarWorkspaceAuthorization };
349
+ export { W as createLiveAvatarSeam, V as documentUserGesture, O as isLiveAvatarBrowserSupported, B as isTouchFirstDevice, A as liveAvatarAuthorization, j as liveAvatarWorkspaceAuthorization };
@@ -1,4 +1,5 @@
1
1
  import { SpeechEngine, SpeechSpeakOptions } from '../../speech/types';
2
+ import { AvatarVoiceRegistration } from '../../voice/handsfree/playbackReference';
2
3
  import { AvatarProblem } from '../useAvatarCopy';
3
4
  import { AvatarMeterHandle } from './avatarAudioMeter';
4
5
  import { AvatarRoom, AvatarScheduler } from './avatarPorts';
@@ -161,6 +162,12 @@ export interface LiveAvatarControllerDeps {
161
162
  readonly releaseAudioElement: (element: HTMLAudioElement) => void;
162
163
  /** A level meter on the avatar's received audio; null when none can be built (the output then cannot prove silence). */
163
164
  readonly startMeter: (track: MediaStreamTrack, onChange: (audible: boolean) => void) => AvatarMeterHandle | null;
165
+ /**
166
+ * P5 (BOFF-12936): register each connected avatar's voice as hands-free's echo reference (the process-wide playback
167
+ * reference's `registerAvatarVoice`). Given only where the host opted in (`handsFreeWithAvatar`); absent, nothing is
168
+ * registered and everything is exactly as before.
169
+ */
170
+ readonly registerVoiceReference?: () => AvatarVoiceRegistration;
164
171
  /** The browser can show the avatar at all: what it needs is there (any browser or phone since BOFF-9696). */
165
172
  readonly browserSupported: () => boolean;
166
173
  /**
@@ -194,7 +194,7 @@ function m(s) {
194
194
  De.leave();
195
195
  let e = b;
196
196
  if (b = null, e !== null) {
197
- if (e.unsubscribe?.(), e.meter !== null) {
197
+ if (e.unsubscribe?.(), e.voiceReference?.release(), e.meter !== null) {
198
198
  if (e.meterAudible) {
199
199
  e.meterAudible = !1;
200
200
  for (let t of [...e.meterListeners]) t(!1);
@@ -507,6 +507,7 @@ function m(s) {
507
507
  meterListeners: f,
508
508
  videoTrack: null,
509
509
  unsubscribe: null,
510
+ voiceReference: s.registerVoiceReference?.() ?? null,
510
511
  port: ee({
511
512
  transport: d,
512
513
  isEnabled: () => g && !_,
@@ -523,7 +524,7 @@ function m(s) {
523
524
  token: u.participantToken,
524
525
  audioElement: p.audioElement,
525
526
  onAvatarAudio: (e) => {
526
- if (e.mediaStreamTrack !== null && p.meter === null) try {
527
+ if (p.voiceReference?.setTrack(e.mediaStreamTrack), e.mediaStreamTrack !== null && p.meter === null) try {
527
528
  p.meter = s.startMeter(e.mediaStreamTrack, (e) => {
528
529
  p.meterAudible = e;
529
530
  for (let t of [...f]) t(e);
@@ -186,6 +186,7 @@ export * from './ui/composer/AssistantModeSelector';
186
186
  export * from './ui/composer/AssistantModeMenu';
187
187
  export * from './ui/composer/modeMenuKeys';
188
188
  export * from './ui/composer/modeSwitchPlan';
189
+ export * from './ui/composer/pageBoxClass';
189
190
  export * from './ui/composer/imeEnter';
190
191
  export * from './ui/composer/AssistantVoiceButton';
191
192
  export * from './ui/composer/AssistantVoiceSelector';
@@ -1,20 +1,24 @@
1
1
  import { usePrefersReducedMotion as e } from "./usePrefersReducedMotion.js";
2
- import { Sparkles as t } from "lucide-react";
3
- import { jsx as n } from "react/jsx-runtime";
2
+ import { useAssistantPageLayout as t } from "./assistantPageLayout.js";
3
+ import { Sparkles as n } from "lucide-react";
4
+ import { jsx as r } from "react/jsx-runtime";
4
5
  // src/shared/assistant/ui/AssistantAvatar.tsx
5
- var r = "mt-0.5 flex size-6 flex-shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-action-primary-bg/25 to-action-primary-bg/5 text-action-primary-bg", i = () => {
6
- let i = e();
7
- return /* @__PURE__ */ n("div", {
6
+ var i = "mt-0.5 flex size-6 flex-shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-action-primary-bg/25 to-action-primary-bg/5 text-action-primary-bg", a = " boff-orb boff-orb--avatar", o = ({ pageLayout: t }) => {
7
+ let o = e();
8
+ return /* @__PURE__ */ r("div", {
8
9
  "aria-hidden": "true",
9
10
  "data-testid": "assistant-avatar",
10
11
  "data-active": "true",
11
- className: r + (i ? "" : " motion-safe:animate-pulse"),
12
- children: /* @__PURE__ */ n(t, { className: "size-3.5" })
12
+ className: i + (o ? "" : " motion-safe:animate-pulse") + (t ? `${a}${o ? "" : " boff-pulse boff-ripple"}` : ""),
13
+ children: /* @__PURE__ */ r(n, { className: "size-3.5" })
13
14
  });
14
- }, a = ({ active: e = !1 }) => e ? /* @__PURE__ */ n(i, {}) : /* @__PURE__ */ n("div", {
15
- "aria-hidden": "true",
16
- "data-testid": "assistant-avatar",
17
- className: r,
18
- children: /* @__PURE__ */ n(t, { className: "size-3.5" })
19
- });
20
- export { a as AssistantAvatar };
15
+ }, s = ({ active: e = !1 }) => {
16
+ let s = t();
17
+ return e ? /* @__PURE__ */ r(o, { pageLayout: s }) : /* @__PURE__ */ r("div", {
18
+ "aria-hidden": "true",
19
+ "data-testid": "assistant-avatar",
20
+ className: i + (s ? a : ""),
21
+ children: /* @__PURE__ */ r(n, { className: "size-3.5" })
22
+ });
23
+ };
24
+ export { s as AssistantAvatar };
@@ -2923,6 +2923,7 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
2923
2923
  onSelect: F ? nd : Gu
2924
2924
  } : void 0,
2925
2925
  suspendDictation: J || F && !ya,
2926
+ entrance: I && dd,
2926
2927
  onVoiceStateChange: q.ids || Ma ? hu : void 0,
2927
2928
  modeReadOnly: Ma || void 0,
2928
2929
  voiceSessionActive: F ? $.active : void 0,
@@ -76,6 +76,11 @@ interface Props {
76
76
  onStopTurn?: () => void;
77
77
  /** The platform shell label for the Stop control (`assistantChrome.stopTurn`). */
78
78
  stopTurnLabel?: string;
79
+ /**
80
+ * ★ BOFF-14753: a message that arrived while the page was open rises in (M5).
81
+ * Set by the list on the /assistant page only; history never animates.
82
+ */
83
+ entering?: boolean;
79
84
  }
80
85
  /**
81
86
  * Purely decorative "still typing" caret: hidden from assistive tech (the list's