@burdenoff/fe-libs 2026.1014.4 → 2026.1015.1

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 (46) hide show
  1. package/dist/shared/assistant/avatar/avatarPreferences.d.ts +61 -14
  2. package/dist/shared/assistant/avatar/avatarPreferences.js +54 -21
  3. package/dist/shared/assistant/avatar/live/LiveAvatarTabView.d.ts +33 -0
  4. package/dist/shared/assistant/avatar/live/LiveAvatarTabView.js +278 -0
  5. package/dist/shared/assistant/avatar/live/avatarSessionClient.d.ts +5 -0
  6. package/dist/shared/assistant/avatar/live/avatarSessionClient.js +25 -6
  7. package/dist/shared/assistant/avatar/live/avatarVoice.d.ts +43 -0
  8. package/dist/shared/assistant/avatar/live/avatarVoice.js +45 -0
  9. package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.d.ts +21 -1
  10. package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.js +74 -24
  11. package/dist/shared/assistant/avatar/live/liveAvatarController.d.ts +47 -8
  12. package/dist/shared/assistant/avatar/live/liveAvatarController.js +244 -161
  13. package/dist/shared/assistant/avatar/live/liveAvatarStatus.d.ts +2 -2
  14. package/dist/shared/assistant/avatar/live/liveAvatarStatus.js +11 -4
  15. package/dist/shared/assistant/avatar/useAvatarCopy.d.ts +52 -21
  16. package/dist/shared/assistant/avatar/useAvatarCopy.js +93 -48
  17. package/dist/shared/assistant/i18nManifest.d.ts +24 -2
  18. package/dist/shared/assistant/i18nManifest.js +24 -2
  19. package/dist/shared/assistant/index.d.ts +5 -0
  20. package/dist/shared/assistant/speech/hostedVoiceCatalogue.d.ts +19 -0
  21. package/dist/shared/assistant/speech/hostedVoiceCatalogue.js +25 -18
  22. package/dist/shared/assistant/ui/AIAssistantPanel.js +136 -103
  23. package/dist/shared/assistant/ui/AssistantAvatarTabs.d.ts +10 -0
  24. package/dist/shared/assistant/ui/AssistantAvatarTabs.js +48 -0
  25. package/dist/shared/assistant/ui/AssistantChatArea.js +1260 -1199
  26. package/dist/shared/assistant/ui/assistantLiveAvatarSeam.d.ts +165 -5
  27. package/dist/shared/assistant/ui/assistantLiveAvatarSeam.js +141 -59
  28. package/dist/shared/assistant/ui/avatar/AssistantAvatarTab.d.ts +13 -0
  29. package/dist/shared/assistant/ui/avatar/AssistantAvatarTab.js +70 -0
  30. package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +18 -0
  31. package/dist/shared/assistant/ui/composer/AssistantComposer.js +121 -102
  32. package/dist/shared/assistant/ui/composer/AssistantHandsFreeInterruptToggle.d.ts +9 -0
  33. package/dist/shared/assistant/ui/composer/AssistantHandsFreeInterruptToggle.js +28 -14
  34. package/dist/shared/assistant/ui/panelOverlays.d.ts +24 -3
  35. package/dist/shared/assistant/ui/panelOverlays.js +11 -10
  36. package/dist/shared/assistant/ui/useVoiceSession.js +234 -233
  37. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +6 -0
  38. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +161 -149
  39. package/dist/shared/assistant/ui/voice/VoiceMiniController.js +7 -7
  40. package/dist/shared/assistant/ui/voice/VoiceStage.js +7 -7
  41. package/dist/shared/assistant/ui/voice/voiceStartGate.d.ts +57 -0
  42. package/dist/shared/assistant/ui/voice/voiceStartGate.js +9 -0
  43. package/dist/shared/assistant/voice/handsfree/handsFreeSetting.d.ts +7 -1
  44. package/dist/shared/assistant/voice/handsfree/handsFreeSetting.js +2 -2
  45. package/dist/shared-assistant.js +259 -254
  46. package/package.json +1 -1
@@ -4,120 +4,153 @@ import { useAssistantPageLabel as n } from "../product.js";
4
4
  import { useAssistantTr as r } from "../i18n.js";
5
5
  import { useAssistantStore as i } from "../store.js";
6
6
  import { AssistantSpeechProvider as a } from "./AssistantSpeechProvider.js";
7
- import { AssistantPreviewProvider as o } from "../preview/context.js";
8
- import { useAssistantPreviewBridge as s } from "../preview/useAssistantPreviewBridge.js";
9
- import { AssistantConnectSourceProvider as c } from "./composer/connectSource.js";
10
- import { hasAssistantPreviewSurface as l } from "../preview/types.js";
11
- import { ASSISTANT_OVERLAY_ATTR as u, ASSISTANT_PANEL_ATTR as d, activePanelOverlay as f, escapeDismisses as p, nextPanelOverlays as ee } from "./panelOverlays.js";
12
- import { panelOwnedPreviewBridge as te, useHostedAssistantPreviewBridge as ne } from "../preview/bridgeHostContext.js";
13
- import { AssistantPreviewOverlay as re } from "../preview/AssistantPreviewOverlay.js";
14
- import { LiveAvatarSeamProvider as ie, useLiveAvatarSpeechEngine as ae } from "./assistantLiveAvatarSeam.js";
15
- import { AssistantHeader as m } from "./AssistantHeader.js";
16
- import { AssistantConversationList as h } from "./AssistantConversationList.js";
17
- import { AssistantConversationDeleteDialogProvider as g } from "./conversationDeleteDialog.js";
18
- import { AssistantControlConfirmProvider as _ } from "./controlConfirmDialog.js";
19
- import { AssistantLeaveConfirmNavigateProvider as v } from "./leaveConfirm.js";
20
- import { useAssistantServerHistory as y } from "../history/useAssistantServerHistory.js";
21
- import { useFilesServiceWarmup as b } from "../../../storage/warmFilesService.js";
22
- import { useAssistantHeartbeat as x } from "../useAssistantHeartbeat.js";
23
- import { useAssistantKeyboardShortcuts as S } from "../useAssistantKeyboardShortcuts.js";
24
- import { AssistantChatArea as C } from "./AssistantChatArea.js";
25
- import { useMemo as w, useRef as T, useState as E } from "react";
26
- import { jsx as D, jsxs as O } from "react/jsx-runtime";
7
+ import { ASSISTANT_OVERLAY_ATTR as o, ASSISTANT_PANEL_ATTR as s, activePanelOverlay as c, escapeDismisses as l, nextPanelOverlays as u } from "./panelOverlays.js";
8
+ import { LiveAvatarSeamProvider as d, LiveAvatarTabContext as ee, useLiveAvatarSpeechEngine as te, useLiveAvatarTabOffered as ne } from "./assistantLiveAvatarSeam.js";
9
+ import { AssistantPreviewProvider as re } from "../preview/context.js";
10
+ import { useAssistantPreviewBridge as ie } from "../preview/useAssistantPreviewBridge.js";
11
+ import { AssistantConnectSourceProvider as ae } from "./composer/connectSource.js";
12
+ import { hasAssistantPreviewSurface as oe } from "../preview/types.js";
13
+ import { panelOwnedPreviewBridge as se, useHostedAssistantPreviewBridge as ce } from "../preview/bridgeHostContext.js";
14
+ import { AssistantPreviewOverlay as le } from "../preview/AssistantPreviewOverlay.js";
15
+ import { AssistantHeader as ue } from "./AssistantHeader.js";
16
+ import { AssistantConversationList as de } from "./AssistantConversationList.js";
17
+ import { AssistantConversationDeleteDialogProvider as fe } from "./conversationDeleteDialog.js";
18
+ import { AssistantControlConfirmProvider as pe } from "./controlConfirmDialog.js";
19
+ import { AssistantLeaveConfirmNavigateProvider as me } from "./leaveConfirm.js";
20
+ import { useAssistantServerHistory as he } from "../history/useAssistantServerHistory.js";
21
+ import { useFilesServiceWarmup as ge } from "../../../storage/warmFilesService.js";
22
+ import { AssistantAvatarTabs as f } from "./AssistantAvatarTabs.js";
23
+ import { useAssistantHeartbeat as p } from "../useAssistantHeartbeat.js";
24
+ import { useAssistantKeyboardShortcuts as m } from "../useAssistantKeyboardShortcuts.js";
25
+ import { AssistantChatArea as h } from "./AssistantChatArea.js";
26
+ import { useCallback as g, useId as _, useMemo as v, useRef as y, useState as b } from "react";
27
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
27
28
  //#region src/shared/assistant/ui/AIAssistantPanel.tsx
28
- var k = ({ onClose: k, visible: A, docked: j, onToggleDock: M, writeAccess: N, onNavigate: oe, isShellLessTarget: P, connectSourceHref: F, onConnectSource: I, preview: L, liveAvatar: R, serverHistory: z = !1 }) => {
29
- let B = r(), V = ae(R);
30
- y(z);
31
- let [H, U] = E(!1), W = l(L);
32
- H && !W && U(!1);
33
- let G = H && W;
34
- s(te(L, ne()));
35
- let K = T(null);
36
- e(K);
37
- let { conversations: q, activeConversationId: se, conversationListOpen: J, setConversationListOpen: Y, createConversation: ce } = i(), X = J || G, Z = f({
38
- historyOpen: J,
39
- previewOpen: G
29
+ var C = ({ onClose: C, visible: w, docked: T, onToggleDock: E, writeAccess: D, onNavigate: O, isShellLessTarget: k, connectSourceHref: A, onConnectSource: j, preview: M, liveAvatar: N, serverHistory: P = !1 }) => {
30
+ let F = r(), _e = te(N);
31
+ he(P);
32
+ let [I, L] = b(!1), R = oe(M);
33
+ I && !R && L(!1);
34
+ let z = I && R;
35
+ ie(se(M, ce()));
36
+ let B = y(null);
37
+ e(B);
38
+ let { conversations: ve, activeConversationId: ye, conversationListOpen: V, setConversationListOpen: H, createConversation: be } = i(), U = V || z, W = N?.tab, xe = ne(W), [G, K] = b(!1);
39
+ G && (!W || w === !1) && K(!1);
40
+ let q = W !== void 0 && (xe || G), J = _(), Y = v(() => q ? {
41
+ chatTab: `${J}-chat-tab`,
42
+ avatarTab: `${J}-avatar-tab`,
43
+ chatPanel: `${J}-chat-panel`,
44
+ avatarPanel: `${J}-avatar-panel`,
45
+ leaveHint: `${J}-avatar-leave`
46
+ } : null, [q, J]), X = g(() => K(!1), []), Se = v(() => ({
47
+ open: G,
48
+ close: X,
49
+ ids: Y,
50
+ covered: U
51
+ }), [
52
+ G,
53
+ X,
54
+ Y,
55
+ U
56
+ ]), Ce = (e) => K(e === "avatar"), Z = c({
57
+ historyOpen: V,
58
+ previewOpen: z,
59
+ avatarOpen: G
40
60
  }), Q = (e) => {
41
- let t = ee({
42
- historyOpen: J,
43
- previewOpen: G
61
+ let t = u({
62
+ historyOpen: V,
63
+ previewOpen: z
44
64
  }, e);
45
- Y(t.historyOpen), U(t.previewOpen);
65
+ H(t.historyOpen), L(t.previewOpen);
46
66
  };
47
- t("assistant.history", w(() => ({ run: () => J ? { status: "already" } : (Y(!0), U(!1), { status: "done" }) }), [J, Y])), t("assistant.preview", w(() => W ? {
67
+ t("assistant.history", v(() => ({ run: () => V ? { status: "already" } : (H(!0), L(!1), { status: "done" }) }), [V, H])), t("assistant.preview", v(() => R ? {
48
68
  surface: "panel",
49
- run: () => G ? { status: "already" } : (Y(!1), U(!0), { status: "done" }),
50
- close: () => G ? (U(!1), { status: "done" }) : { status: "already" }
69
+ run: () => z ? { status: "already" } : (H(!1), L(!0), { status: "done" }),
70
+ close: () => z ? (L(!1), { status: "done" }) : { status: "already" }
51
71
  } : null, [
52
- W,
53
- G,
54
- Y
72
+ R,
73
+ z,
74
+ H
55
75
  ]));
56
- let $ = q.find((e) => e.id === se);
57
- x($?.backendSessionId ?? null, $?.mode ?? null, A ?? !0), b(A ?? !0);
58
- let le = n(A !== !1);
59
- return S({
60
- panelRef: K,
76
+ let $ = ve.find((e) => e.id === ye);
77
+ p($?.backendSessionId ?? null, $?.mode ?? null, w ?? !0), ge(w ?? !0);
78
+ let we = n(w !== !1);
79
+ return m({
80
+ panelRef: B,
61
81
  onClose: () => {
62
- if (p({
63
- historyOpen: J,
64
- previewOpen: G
65
- }) === "overlay") {
66
- Y(!1), U(!1);
82
+ let e = l({
83
+ historyOpen: V,
84
+ previewOpen: z,
85
+ avatarOpen: G
86
+ });
87
+ if (e === "overlay") {
88
+ H(!1), L(!1);
67
89
  return;
68
90
  }
69
- k();
91
+ if (e === "tab") {
92
+ K(!1), Y && document.getElementById(Y.chatTab)?.focus();
93
+ return;
94
+ }
95
+ C();
70
96
  }
71
- }), /* @__PURE__ */ D(a, {
72
- visible: A ?? !0,
73
- engine: V,
74
- children: /* @__PURE__ */ D(ie, {
75
- value: R,
76
- children: /* @__PURE__ */ D(o, {
77
- value: L,
78
- children: /* @__PURE__ */ D(v, {
79
- navigate: oe,
80
- isShellLessTarget: P,
81
- children: /* @__PURE__ */ D(c, {
82
- value: F,
83
- onOpen: I,
84
- children: /* @__PURE__ */ D(g, { children: /* @__PURE__ */ D(_, { children: /* @__PURE__ */ O("div", {
85
- ref: K,
86
- className: "relative flex h-full w-full flex-col bg-bg-surface",
87
- role: "complementary",
88
- "aria-label": B("panel.ariaLabel", "AI Assistant"),
89
- "data-testid": "ai-assistant-panel",
90
- [d]: "",
91
- ...Z ? { [u]: Z } : {},
92
- tabIndex: -1,
93
- children: [
94
- /* @__PURE__ */ D("div", {
95
- className: "contents",
96
- inert: X || void 0,
97
- children: /* @__PURE__ */ D(m, {
98
- contextLabel: le,
99
- onNewConversation: () => ce(),
100
- onOpenHistory: () => Q("history"),
101
- historyOpen: J,
102
- onTogglePreview: () => Q("preview"),
103
- previewOpen: G,
104
- onClose: k,
105
- docked: j,
106
- onToggleDock: M
107
- })
108
- }),
109
- J && /* @__PURE__ */ D(h, {}),
110
- G && /* @__PURE__ */ D(re, { onClose: () => U(!1) }),
111
- /* @__PURE__ */ D("div", {
112
- className: "contents",
113
- inert: X || void 0,
114
- children: /* @__PURE__ */ D(C, {
115
- visible: A ?? !0,
116
- writeAccess: N
97
+ }), /* @__PURE__ */ x(a, {
98
+ visible: w ?? !0,
99
+ engine: _e,
100
+ children: /* @__PURE__ */ x(d, {
101
+ value: N,
102
+ children: /* @__PURE__ */ x(ee.Provider, {
103
+ value: Se,
104
+ children: /* @__PURE__ */ x(re, {
105
+ value: M,
106
+ children: /* @__PURE__ */ x(me, {
107
+ navigate: O,
108
+ isShellLessTarget: k,
109
+ children: /* @__PURE__ */ x(ae, {
110
+ value: A,
111
+ onOpen: j,
112
+ children: /* @__PURE__ */ x(fe, { children: /* @__PURE__ */ x(pe, { children: /* @__PURE__ */ S("div", {
113
+ ref: B,
114
+ className: "relative flex h-full w-full flex-col bg-bg-surface",
115
+ role: "complementary",
116
+ "aria-label": F("panel.ariaLabel", "AI Assistant"),
117
+ "data-testid": "ai-assistant-panel",
118
+ [s]: "",
119
+ ...Z ? { [o]: Z } : {},
120
+ tabIndex: -1,
121
+ children: [
122
+ /* @__PURE__ */ S("div", {
123
+ className: "contents",
124
+ inert: U || void 0,
125
+ children: [/* @__PURE__ */ x(ue, {
126
+ contextLabel: we,
127
+ onNewConversation: () => be(),
128
+ onOpenHistory: () => Q("history"),
129
+ historyOpen: V,
130
+ onTogglePreview: () => Q("preview"),
131
+ previewOpen: z,
132
+ onClose: C,
133
+ docked: T,
134
+ onToggleDock: E
135
+ }), Y ? /* @__PURE__ */ x(f, {
136
+ selected: G ? "avatar" : "chat",
137
+ onSelect: Ce,
138
+ ids: Y
139
+ }) : null]
140
+ }),
141
+ V && /* @__PURE__ */ x(de, {}),
142
+ z && /* @__PURE__ */ x(le, { onClose: () => L(!1) }),
143
+ /* @__PURE__ */ x("div", {
144
+ className: "contents",
145
+ inert: U || void 0,
146
+ children: /* @__PURE__ */ x(h, {
147
+ visible: w ?? !0,
148
+ writeAccess: D
149
+ })
117
150
  })
118
- })
119
- ]
120
- }) }) })
151
+ ]
152
+ }) }) })
153
+ })
121
154
  })
122
155
  })
123
156
  })
@@ -125,4 +158,4 @@ var k = ({ onClose: k, visible: A, docked: j, onToggleDock: M, writeAccess: N, o
125
158
  });
126
159
  };
127
160
  //#endregion
128
- export { k as AIAssistantPanel };
161
+ export { C as AIAssistantPanel };
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ import { LiveAvatarTabIds } from './assistantLiveAvatarSeam';
3
+ /** The two views of the panel when the live avatar offers its tab. */
4
+ export type AssistantPanelView = "chat" | "avatar";
5
+ export interface AssistantAvatarTabsProps {
6
+ readonly selected: AssistantPanelView;
7
+ readonly onSelect: (view: AssistantPanelView) => void;
8
+ readonly ids: LiveAvatarTabIds;
9
+ }
10
+ export declare const AssistantAvatarTabs: FC<AssistantAvatarTabsProps>;
@@ -0,0 +1,48 @@
1
+ import { useAvatarCopy as e } from "../avatar/useAvatarCopy.js";
2
+ import { tabForArrowKey as t } from "../preview/entity/entityPreviewState.js";
3
+ import { useRef as n } from "react";
4
+ import { MessageSquare as r, Video as i } from "lucide-react";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ //#region src/shared/assistant/ui/AssistantAvatarTabs.tsx
7
+ var s = ["chat", "avatar"], c = ({ selected: c, onSelect: l, ids: u }) => {
8
+ let d = e(), f = n({}), p = (e, n) => {
9
+ let r = getComputedStyle(e.currentTarget).direction === "rtl", i = t(e.key, s, n, r), a = s.find((e) => e === i);
10
+ a !== void 0 && (e.preventDefault(), f.current[a]?.focus());
11
+ };
12
+ return /* @__PURE__ */ a("div", {
13
+ role: "tablist",
14
+ "aria-label": d.tabsLabel,
15
+ className: "flex shrink-0 border-b border-border-subtle",
16
+ "data-testid": "assistant-avatar-tabs",
17
+ children: s.map((e) => {
18
+ let t = e === c, n = e === "chat";
19
+ return /* @__PURE__ */ o("button", {
20
+ ref: (t) => {
21
+ f.current[e] = t;
22
+ },
23
+ type: "button",
24
+ role: "tab",
25
+ id: n ? u.chatTab : u.avatarTab,
26
+ "aria-selected": t,
27
+ "aria-controls": n ? u.chatPanel : u.avatarPanel,
28
+ "aria-describedby": n && c === "avatar" ? u.leaveHint : void 0,
29
+ tabIndex: t ? 0 : -1,
30
+ onClick: () => {
31
+ t || l(e);
32
+ },
33
+ onKeyDown: (t) => p(t, e),
34
+ className: `inline-flex min-h-11 min-w-0 flex-1 items-center justify-center gap-2 border-b-2 px-3 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-border-strong ${t ? "border-action-primary-bg text-text-primary" : "border-transparent text-text-muted hover:text-text-primary"}`,
35
+ "data-testid": n ? "assistant-tab-chat" : "assistant-tab-avatar",
36
+ children: [a(n ? r : i, {
37
+ className: "size-4 shrink-0",
38
+ "aria-hidden": "true"
39
+ }), /* @__PURE__ */ a("span", {
40
+ className: "truncate",
41
+ children: n ? d.tabChat : d.tabAvatar
42
+ })]
43
+ }, e);
44
+ })
45
+ });
46
+ };
47
+ //#endregion
48
+ export { c as AssistantAvatarTabs };