@burdenoff/fe-libs 2026.1117.3 → 2026.1117.5

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 (44) hide show
  1. package/dist/shared/assistant/i18nManifest.d.ts +21 -1
  2. package/dist/shared/assistant/i18nManifest.js +22 -2
  3. package/dist/shared/assistant/index.d.ts +8 -0
  4. package/dist/shared/assistant/ui/AIAssistantPanel.js +195 -194
  5. package/dist/shared/assistant/ui/AssistantChatArea.js +1339 -1332
  6. package/dist/shared/assistant/ui/compact/AssistantLanguagePill.d.ts +12 -0
  7. package/dist/shared/assistant/ui/compact/AssistantLanguagePill.js +13 -14
  8. package/dist/shared/assistant/ui/compact/AssistantWindowHeader.d.ts +8 -2
  9. package/dist/shared/assistant/ui/compact/AssistantWindowHeader.js +45 -39
  10. package/dist/shared/assistant/ui/compact/AssistantWindowWelcome.d.ts +44 -0
  11. package/dist/shared/assistant/ui/compact/AssistantWindowWelcome.js +110 -0
  12. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeCard.d.ts +29 -0
  13. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeCard.js +84 -0
  14. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeHero.d.ts +15 -0
  15. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeHero.js +64 -0
  16. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeSuggestions.d.ts +12 -0
  17. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeSuggestions.js +31 -0
  18. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeTips.d.ts +9 -0
  19. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeTips.js +37 -0
  20. package/dist/shared/assistant/ui/compact/windowTitle.d.ts +15 -0
  21. package/dist/shared/assistant/ui/compact/windowTitle.js +13 -0
  22. package/dist/shared/assistant/ui/compact/windowWelcome.d.ts +136 -0
  23. package/dist/shared/assistant/ui/compact/windowWelcome.js +119 -0
  24. package/dist/shared/assistant/ui/compact/windowWelcomeHooks.d.ts +49 -0
  25. package/dist/shared/assistant/ui/compact/windowWelcomeHooks.js +70 -0
  26. package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.d.ts +3 -1
  27. package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.js +27 -26
  28. package/dist/shared/assistant/ui/useVoiceSession.js +312 -301
  29. package/dist/shared/assistant/voice/handsFree.d.ts +16 -0
  30. package/dist/shared/assistant/voice/handsFree.js +2 -2
  31. package/dist/shared/assistant/voice/handsfree/audioTrackTransport.js +1 -0
  32. package/dist/shared/assistant/voice/handsfree/backendStreamTransport.d.ts +11 -0
  33. package/dist/shared/assistant/voice/handsfree/backendStreamTransport.js +118 -63
  34. package/dist/shared/assistant/voice/handsfree/bargeIn.d.ts +20 -1
  35. package/dist/shared/assistant/voice/handsfree/bargeIn.js +3 -3
  36. package/dist/shared/assistant/voice/handsfree/handsFreeController.d.ts +10 -1
  37. package/dist/shared/assistant/voice/handsfree/handsFreeController.js +103 -83
  38. package/dist/shared/assistant/voice/handsfree/sttTransport.d.ts +20 -0
  39. package/dist/shared/assistant/voice/handsfree/useHandsFreeInterrupt.d.ts +8 -0
  40. package/dist/shared/assistant/voice/handsfree/useHandsFreeInterrupt.js +31 -26
  41. package/dist/shared/assistant/voice/handsfree/webSpeechTransport.js +1 -0
  42. package/dist/shared-assistant.js +399 -391
  43. package/package.json +2 -1
  44. package/src/shared/tokens/tokens.css +523 -0
@@ -35,6 +35,13 @@ export interface SttTransportError {
35
35
  export interface SttTransportHandlers {
36
36
  onTranscript(transcript: TransportTranscript): void;
37
37
  onError(error: SttTransportError): void;
38
+ /**
39
+ * The recogniser is finished with this utterance: the stream said `done`, or
40
+ * dropped it (a retryable error naming it). Transports whose words arrive
41
+ * `after-utterance` call it; for them the controller judges "nothing heard"
42
+ * here (see `SttTransport.wordsArrive`).
43
+ */
44
+ onUtteranceDone(utteranceId: string): void;
38
45
  }
39
46
  export interface SttAudioGraph {
40
47
  context: AudioContext;
@@ -58,6 +65,19 @@ export interface SttTransport {
58
65
  readonly recognitionOwner: 'transport' | 'session-hook';
59
66
  /** Whether the words spoken BEFORE the onset was confirmed reach the recogniser. */
60
67
  readonly keepsOpeningWords: boolean;
68
+ /**
69
+ * When an utterance's first words can arrive (read only when
70
+ * `recognitionOwner` is `transport`):
71
+ * - `while-speaking`: the recogniser sends partial text as the person talks
72
+ * (Chrome's, with `interimResults`), so no words for `NOTHING_HEARD_MS`
73
+ * after a barge-in means nothing was heard;
74
+ * - `after-utterance`: the first words may come only once the utterance is
75
+ * finalised. Our stream on Google's `chirp_3` sends no partial text (alpha,
76
+ * 17 Nov: one final, 1.0 s after `end`), so a fixed timer would call every
77
+ * real interruption "nothing heard". The controller waits for
78
+ * `onUtteranceDone` instead.
79
+ */
80
+ readonly wordsArrive: 'while-speaking' | 'after-utterance';
61
81
  start(graph: SttAudioGraph | null, language: string, handlers: SttTransportHandlers): Promise<void>;
62
82
  openUtterance(utterance: OpenUtterance): void;
63
83
  /** A live 16 kHz frame while an utterance is open. */
@@ -51,5 +51,13 @@ export interface HandsFreeState {
51
51
  nothingHeard: boolean;
52
52
  /** Non-null exactly while `mode` is `notice`: what the notice's buttons do. */
53
53
  privacyNotice: HandsFreePrivacyNoticeActions | null;
54
+ /**
55
+ * The running transport sends an utterance's words only once it is finalised
56
+ * (our stream on chirp_3, BOFF-12936): the session times its pause from the
57
+ * last voiced frame instead of from the words.
58
+ */
59
+ wordsAfterUtterance: boolean;
60
+ /** On such a transport: words of this turn are still to come; nothing may be sent yet. */
61
+ wordsPending: boolean;
54
62
  }
55
63
  export declare function useHandsFreeInterrupt(options: UseHandsFreeInterruptOptions): HandsFreeState;
@@ -17,39 +17,41 @@ var y = (e) => e === "listening" || e === "thinking" || e === "speaking";
17
17
  function b(t) {
18
18
  let { enabled: r, phase: i, muted: b, language: x, streamNoticeAccepted: S } = t, C = m(t);
19
19
  C.current = t;
20
- let [w, T] = h(null), [E, D] = h(!1), [O, k] = h(!1), [A, j] = h(!1), M = m(!1), [N, P] = h(!1), F = g(u, l, l), I = p(() => v(x, F), [x, F]), L = I.kind;
20
+ let [w, T] = h(null), [E, D] = h(!1), [O, k] = h(!1), [A, j] = h(!1), [M, N] = h(!1), [P, F] = h(!1), I = m(!1), [L, R] = h(!1), z = g(u, l, l), B = p(() => v(x, z), [x, z]), V = B.kind;
21
21
  f(() => {
22
- S !== "google-stt-eu-1" && P(!1);
22
+ S !== "google-stt-eu-1" && R(!1);
23
23
  }, [S]), f(() => {
24
24
  (i === "idle" || i === "ended") && (T(null), D(!1));
25
25
  }, [i]), f(() => {
26
26
  if (!r || typeof document > "u") return;
27
27
  let e = null, t = () => {
28
- e !== null && clearTimeout(e), e = null, document.visibilityState === "hidden" ? e = setTimeout(() => k(!0), _) : k(!1);
28
+ e !== null && clearTimeout(e), e = null, document.visibilityState === "hidden" ? e = setTimeout(() => N(!0), _) : N(!1);
29
29
  };
30
30
  return document.addEventListener("visibilitychange", t), () => {
31
31
  document.removeEventListener("visibilitychange", t), e !== null && clearTimeout(e);
32
32
  };
33
33
  }, [r]);
34
- let R = r && I.supported && y(i) && !b && w === null && !O, z = L === "backend-stream" && !N && S !== "google-stt-eu-1", B = R && z, V = R && !z, H = d(() => {
35
- P(!0), C.current.onAcceptStreamNotice?.(c);
36
- }, []), U = d(() => {
34
+ let H = r && B.supported && y(i) && !b && w === null && !M, U = V === "backend-stream" && !L && S !== "google-stt-eu-1", W = H && U, G = H && !U, K = d(() => {
35
+ R(!0), C.current.onAcceptStreamNotice?.(c);
36
+ }, []), q = d(() => {
37
37
  T("notice-declined");
38
- }, []), W = p(() => ({
39
- accept: H,
40
- decline: U
41
- }), [H, U]);
38
+ }, []), J = p(() => ({
39
+ accept: K,
40
+ decline: q
41
+ }), [K, q]);
42
42
  f(() => {
43
- if (!V) return;
44
- let t = e({
43
+ if (!G) return;
44
+ let t = n(V);
45
+ k(t.recognitionOwner === "transport" && t.wordsArrive === "after-utterance");
46
+ let r = e({
45
47
  startCapture: o,
46
- transport: n(L),
48
+ transport: t,
47
49
  getSession: () => ({
48
50
  phase: C.current.phase,
49
51
  muted: C.current.muted
50
52
  }),
51
53
  getPlaybackSource: s,
52
- getHeadsetHint: () => M.current,
54
+ getHeadsetHint: () => I.current,
53
55
  language: () => C.current.language,
54
56
  onBargeIn: () => {
55
57
  D(!1), C.current.onBargeIn();
@@ -60,24 +62,27 @@ function b(t) {
60
62
  onSpeechFrame: (e) => C.current.onSpeechFrame?.(e),
61
63
  onFallback: T,
62
64
  onNothingHeard: () => D(!0),
65
+ onWordsPending: j,
63
66
  isEnabled: () => C.current.enabled
64
- }), r = !1;
65
- return t.start().then(() => {
66
- r || j(!0);
67
+ }), i = !1;
68
+ return r.start().then(() => {
69
+ i || F(!0);
67
70
  }), navigator.mediaDevices?.enumerateDevices().then((e) => {
68
- M.current = a(e.filter((e) => e.kind === "audiooutput").map((e) => e.label));
71
+ I.current = a(e.filter((e) => e.kind === "audiooutput").map((e) => e.label));
69
72
  }).catch(() => void 0), () => {
70
- r = !0, t.stop(), j(!1);
73
+ i = !0, r.stop(), F(!1), k(!1), j(!1);
71
74
  };
72
- }, [V, L]);
73
- let G = "off";
74
- return r && !I.supported ? G = "unavailable" : w === null ? B ? G = "notice" : V && (G = A ? "active" : "starting") : G = "fallback", {
75
- mode: G,
76
- transportKind: I.supported ? L : null,
77
- suppressWebSpeech: r && I.supported && L !== "web-speech" && w === null && y(i),
75
+ }, [G, V]);
76
+ let Y = "off";
77
+ return r && !B.supported ? Y = "unavailable" : w === null ? W ? Y = "notice" : G && (Y = P ? "active" : "starting") : Y = "fallback", {
78
+ mode: Y,
79
+ transportKind: B.supported ? V : null,
80
+ suppressWebSpeech: r && B.supported && V !== "web-speech" && w === null && y(i),
78
81
  fallbackReason: w,
79
82
  nothingHeard: E,
80
- privacyNotice: G === "notice" ? W : null
83
+ privacyNotice: Y === "notice" ? J : null,
84
+ wordsAfterUtterance: O,
85
+ wordsPending: A
81
86
  };
82
87
  }
83
88
  export { _ as HIDDEN_RELEASE_MS, b as useHandsFreeInterrupt };
@@ -4,6 +4,7 @@ function e() {
4
4
  kind: "web-speech",
5
5
  recognitionOwner: "session-hook",
6
6
  keepsOpeningWords: !1,
7
+ wordsArrive: "while-speaking",
7
8
  async start() {},
8
9
  openUtterance() {},
9
10
  pushFrame() {},