@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.
- package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.d.ts +8 -1
- package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.js +126 -123
- package/dist/shared/assistant/avatar/live/liveAvatarController.d.ts +7 -0
- package/dist/shared/assistant/avatar/live/liveAvatarController.js +3 -2
- package/dist/shared/assistant/index.d.ts +1 -0
- package/dist/shared/assistant/ui/AssistantAvatar.js +18 -14
- package/dist/shared/assistant/ui/AssistantChatArea.js +1 -0
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +5 -0
- package/dist/shared/assistant/ui/AssistantMessageItem.js +57 -56
- package/dist/shared/assistant/ui/AssistantMessageList.js +57 -44
- package/dist/shared/assistant/ui/AssistantTurnActivity.d.ts +2 -0
- package/dist/shared/assistant/ui/AssistantTurnActivity.js +20 -17
- package/dist/shared/assistant/ui/assistantLiveAvatarSeam.d.ts +26 -0
- package/dist/shared/assistant/ui/assistantLiveAvatarSeam.js +87 -79
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +5 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +348 -343
- package/dist/shared/assistant/ui/composer/AssistantDictation.js +57 -56
- package/dist/shared/assistant/ui/composer/AssistantHandsFreeInterruptToggle.d.ts +4 -0
- package/dist/shared/assistant/ui/composer/AssistantHandsFreeInterruptToggle.js +22 -22
- package/dist/shared/assistant/ui/composer/pageBoxClass.d.ts +13 -0
- package/dist/shared/assistant/ui/composer/pageBoxClass.js +5 -0
- package/dist/shared/assistant/ui/useVoiceSession.js +223 -223
- package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.js +41 -35
- package/dist/shared/assistant/ui/voice/AssistantVoiceSessionButton.js +13 -12
- package/dist/shared/assistant/ui/voice/LiveWaveform.js +28 -27
- package/dist/shared/assistant/voice/handsfree/handsFreeController.js +79 -79
- package/dist/shared/assistant/voice/handsfree/handsFreeSetting.d.ts +6 -1
- package/dist/shared/assistant/voice/handsfree/handsFreeSetting.js +2 -2
- package/dist/shared/assistant/voice/handsfree/playbackReference.d.ts +45 -3
- package/dist/shared/assistant/voice/handsfree/playbackReference.js +62 -15
- package/dist/shared-assistant.js +371 -370
- package/package.json +1 -1
- package/src/shared/styles/app-shell.css +5 -0
- package/src/shared/tokens/build/semantic.css +12 -0
- package/src/shared/tokens/build/tailwind.preset.js +5 -0
- package/src/shared/tokens/build/themes.css +14 -0
- package/src/shared/tokens/tokens.css +268 -0
|
@@ -8,56 +8,57 @@ import { AssistantRichContent as a } from "../openui/AssistantRichContent.js";
|
|
|
8
8
|
import { useAssistantGenerativeUi as o } from "../openui/generativeUi.js";
|
|
9
9
|
import { stripOpenUiBlocks as s } from "../openui/segments.js";
|
|
10
10
|
import { AssistantPendingWriteCard as ee } from "./AssistantPendingWriteCard.js";
|
|
11
|
-
import { AssistantMessageAttachments as
|
|
12
|
-
import { AssistantFocusBadge as
|
|
13
|
-
import { readMessageFocus as
|
|
14
|
-
import { AssistantSpeakButton as
|
|
15
|
-
import { useAssistantStorageFolders as
|
|
16
|
-
import { useAssistantSpeech as
|
|
17
|
-
import { AssistantToolActivity as
|
|
18
|
-
import { AssistantTurnActivity as
|
|
19
|
-
import { usePrefersReducedMotion as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
11
|
+
import { AssistantMessageAttachments as c } from "./AssistantMessageAttachments.js";
|
|
12
|
+
import { AssistantFocusBadge as te } from "./composer/AssistantFocusChip.js";
|
|
13
|
+
import { readMessageFocus as ne } from "../askAbout/focus.js";
|
|
14
|
+
import { AssistantSpeakButton as re } from "./AssistantSpeakButton.js";
|
|
15
|
+
import { useAssistantStorageFolders as ie } from "../product.js";
|
|
16
|
+
import { useAssistantSpeech as l } from "./AssistantSpeechProvider.js";
|
|
17
|
+
import { AssistantToolActivity as u, parseToolActivity as ae } from "./AssistantToolActivity.js";
|
|
18
|
+
import { AssistantTurnActivity as oe } from "./AssistantTurnActivity.js";
|
|
19
|
+
import { usePrefersReducedMotion as d } from "./usePrefersReducedMotion.js";
|
|
20
|
+
import { useAssistantPageLayout as f } from "./assistantPageLayout.js";
|
|
21
|
+
import { getAssistantDisplayContent as se, isAssistantMessageLive as ce } from "../displayContent.js";
|
|
22
|
+
import { downloadAssistantArtifact as p } from "../api.js";
|
|
23
|
+
import { useAssistantTr as le } from "../i18n.js";
|
|
24
|
+
import { useI18n as ue } from "../../providers/shell/I18nProvider.js";
|
|
25
|
+
import { languageConfirmationCopy as de } from "../appControls/languageReply.js";
|
|
26
|
+
import { copyToClipboard as fe } from "../clipboard.js";
|
|
27
|
+
import { useMemo as m, useRef as pe, useState as h } from "react";
|
|
28
|
+
import { Check as me, Copy as he, RotateCcw as g, Square as _ } from "lucide-react";
|
|
28
29
|
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
29
30
|
// src/shared/assistant/ui/AssistantMessageItem.tsx
|
|
30
|
-
function
|
|
31
|
+
function ge(e) {
|
|
31
32
|
return e.role === "assistant" ? e.metadata : void 0;
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function _e(e) {
|
|
34
35
|
return e?.artifacts ?? [];
|
|
35
36
|
}
|
|
36
37
|
function x(e) {
|
|
37
38
|
return window.atob(e);
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function ve(e, t, n) {
|
|
40
41
|
let r = x(e), i = new Uint8Array(r.length);
|
|
41
42
|
for (let e = 0; e < r.length; e += 1) i[e] = r.charCodeAt(e);
|
|
42
43
|
let a = new Blob([i], { type: n }), o = URL.createObjectURL(a), s = document.createElement("a");
|
|
43
44
|
s.href = o, s.download = t, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(o);
|
|
44
45
|
}
|
|
45
46
|
var S = () => {
|
|
46
|
-
let e =
|
|
47
|
+
let e = d(), t = f();
|
|
47
48
|
return /* @__PURE__ */ y("span", {
|
|
48
49
|
"aria-hidden": "true",
|
|
49
50
|
"data-testid": "assistant-streaming-caret",
|
|
50
|
-
className: "ms-0.5 inline-block h-4 w-1.5 rounded-sm bg-text-secondary align-middle" + (e ? "" : " motion-safe:animate-pulse")
|
|
51
|
+
className: t ? `ms-0.5 inline-block h-4 rounded-sm align-middle boff-caret-glow${e ? " boff-still" : ""}` : "ms-0.5 inline-block h-4 w-1.5 rounded-sm bg-text-secondary align-middle" + (e ? "" : " motion-safe:animate-pulse")
|
|
51
52
|
});
|
|
52
|
-
}, C = ({ onApprovePendingWrite:
|
|
53
|
-
let
|
|
53
|
+
}, C = ({ onApprovePendingWrite: d, approvingWriteRef: x = null, pendingWriteExpired: C = !1, pendingWriteApproved: ye = !1, pendingWriteGoAheadSent: be = !1, message: w, processing: T, isStreaming: E, isFailed: D, isLastAssistant: O, isNewestAssistant: k, onRetry: A, legacyWriteCardHidden: j = !1, writeProposals: M, uiOffers: N, onStopTurn: P, stopTurnLabel: xe = "Stop", entering: Se = !1 }) => {
|
|
54
|
+
let Ce = e(), we = f(), F = Se ? " boff-rise-sm" : "", I = le(), { locale: Te } = ue(), L = de(w, I), R = L ? L.translated ? Te : "en" : w.metadata?.lang, z = L ? `${w.id}:language:${R}` : w.id, B = pe(z), Ee = ie(), { getAccessToken: De, getWorkspaceToken: Oe } = t(), V = l(), [ke, H] = h(null), [Ae, U] = h(!1), W = w.role === "user", G = m(() => ge(w), [w]), K = m(() => _e(G), [G]), q = T === void 0 ? E ? {
|
|
54
55
|
status: "streaming",
|
|
55
56
|
messageId: w.id,
|
|
56
57
|
updatedAt: w.timestamp
|
|
57
|
-
} : null : T, J =
|
|
58
|
+
} : null : T, J = se(w, q, I), { steps: Y, text: X } = m(() => W ? {
|
|
58
59
|
steps: [],
|
|
59
60
|
text: w.content
|
|
60
|
-
} : J.kind === "output" ?
|
|
61
|
+
} : J.kind === "output" ? ae(J.text) : {
|
|
61
62
|
steps: [],
|
|
62
63
|
text: ""
|
|
63
64
|
}, [
|
|
@@ -65,21 +66,21 @@ var S = () => {
|
|
|
65
66
|
w.content,
|
|
66
67
|
J.kind,
|
|
67
68
|
J.text
|
|
68
|
-
]), Z = o(), Q =
|
|
69
|
-
|
|
69
|
+
]), Z = o(), Q = m(() => Z ? s(X) : X, [Z, X]), je = () => {
|
|
70
|
+
fe(X).then((e) => {
|
|
70
71
|
e && (U(!0), setTimeout(() => U(!1), 2e3));
|
|
71
72
|
});
|
|
72
|
-
},
|
|
73
|
+
}, Me = async (e) => {
|
|
73
74
|
if (!G?.sandboxId || !G.sessionId) return;
|
|
74
75
|
let t = new URLSearchParams(window.location.search).get("workspace") ?? "";
|
|
75
76
|
if (t) {
|
|
76
77
|
H(e.path);
|
|
77
78
|
try {
|
|
78
|
-
let n = await
|
|
79
|
-
accessToken:
|
|
80
|
-
workspaceToken:
|
|
79
|
+
let n = await p(G.sandboxId, t, G.sessionId, e.path, G.mode, {
|
|
80
|
+
accessToken: De(),
|
|
81
|
+
workspaceToken: Oe()
|
|
81
82
|
});
|
|
82
|
-
|
|
83
|
+
ve(n.contentBase64, n.filename, n.mimeType);
|
|
83
84
|
} finally {
|
|
84
85
|
H(null);
|
|
85
86
|
}
|
|
@@ -89,7 +90,7 @@ var S = () => {
|
|
|
89
90
|
minute: "2-digit"
|
|
90
91
|
});
|
|
91
92
|
if (w.role === "system") return /* @__PURE__ */ y("div", {
|
|
92
|
-
className:
|
|
93
|
+
className: `flex justify-center px-2 py-1${F}`,
|
|
93
94
|
"data-testid": "assistant-message-system",
|
|
94
95
|
children: w.metadata?.localAction?.kind === "navigate" ? /* @__PURE__ */ y("div", {
|
|
95
96
|
className: "max-w-[90%] break-words rounded-lg border border-border-subtle bg-bg-sunken/60 px-3 py-2 text-center text-xs leading-relaxed text-text-muted",
|
|
@@ -101,15 +102,15 @@ var S = () => {
|
|
|
101
102
|
})
|
|
102
103
|
});
|
|
103
104
|
if (W) {
|
|
104
|
-
let e = w.metadata?.attachments ?? [], t =
|
|
105
|
+
let e = w.metadata?.attachments ?? [], t = ne(w.metadata?.askAbout);
|
|
105
106
|
return /* @__PURE__ */ y("div", {
|
|
106
|
-
className:
|
|
107
|
+
className: `flex justify-end${F}`,
|
|
107
108
|
"data-testid": "assistant-message-user",
|
|
108
109
|
children: /* @__PURE__ */ b("div", {
|
|
109
110
|
className: "max-w-[85%]",
|
|
110
111
|
children: [
|
|
111
112
|
w.content && /* @__PURE__ */ y("div", {
|
|
112
|
-
className:
|
|
113
|
+
className: `rounded-2xl rounded-br-md bg-action-primary-bg/12 px-3.5 py-2.5 text-[15px] leading-relaxed text-text-primary${we ? " boff-tint-bubble" : ""}`,
|
|
113
114
|
children: /* @__PURE__ */ y("p", {
|
|
114
115
|
className: "whitespace-pre-wrap",
|
|
115
116
|
children: w.content
|
|
@@ -118,9 +119,9 @@ var S = () => {
|
|
|
118
119
|
t ? /* @__PURE__ */ y("div", {
|
|
119
120
|
className: "mt-1 flex justify-end",
|
|
120
121
|
"data-testid": "assistant-message-focus",
|
|
121
|
-
children: /* @__PURE__ */ y(
|
|
122
|
+
children: /* @__PURE__ */ y(te, { focus: t })
|
|
122
123
|
}) : null,
|
|
123
|
-
/* @__PURE__ */ y(
|
|
124
|
+
/* @__PURE__ */ y(c, { attachments: e }),
|
|
124
125
|
/* @__PURE__ */ y("div", {
|
|
125
126
|
className: "mt-1 pe-1 text-end text-[10px] text-text-muted",
|
|
126
127
|
children: $
|
|
@@ -130,22 +131,22 @@ var S = () => {
|
|
|
130
131
|
});
|
|
131
132
|
}
|
|
132
133
|
return /* @__PURE__ */ b("div", {
|
|
133
|
-
className:
|
|
134
|
+
className: `flex gap-2.5${F}`,
|
|
134
135
|
"data-testid": "assistant-message-assistant",
|
|
135
136
|
children: [/* @__PURE__ */ y(r, { active: E }), /* @__PURE__ */ b("div", {
|
|
136
137
|
className: "min-w-0 flex-1",
|
|
137
138
|
children: [
|
|
138
|
-
Y.length > 0 && /* @__PURE__ */ y(
|
|
139
|
+
Y.length > 0 && /* @__PURE__ */ y(u, {
|
|
139
140
|
steps: Y,
|
|
140
|
-
live:
|
|
141
|
+
live: ce(w, q)
|
|
141
142
|
}),
|
|
142
143
|
G?.pendingWrite && !j ? /* @__PURE__ */ y(ee, {
|
|
143
144
|
pendingWrite: G.pendingWrite,
|
|
144
|
-
onApprove:
|
|
145
|
+
onApprove: d,
|
|
145
146
|
approving: x !== null && x === G.pendingWrite.reference,
|
|
146
147
|
expired: C,
|
|
147
|
-
approved:
|
|
148
|
-
goAheadSent:
|
|
148
|
+
approved: ye,
|
|
149
|
+
goAheadSent: be,
|
|
149
150
|
awaitingTurn: !!E
|
|
150
151
|
}) : null,
|
|
151
152
|
M,
|
|
@@ -156,7 +157,7 @@ var S = () => {
|
|
|
156
157
|
streaming: !!E
|
|
157
158
|
})
|
|
158
159
|
}),
|
|
159
|
-
J.kind === "working" && /* @__PURE__ */ y(
|
|
160
|
+
J.kind === "working" && /* @__PURE__ */ y(oe, { processing: q }),
|
|
160
161
|
J.kind === "stopped" && /* @__PURE__ */ y("p", {
|
|
161
162
|
className: "text-[15px] leading-relaxed text-text-secondary",
|
|
162
163
|
"data-testid": "assistant-turn-stopped",
|
|
@@ -170,10 +171,10 @@ var S = () => {
|
|
|
170
171
|
onClick: P,
|
|
171
172
|
className: "flex items-center gap-1 rounded-md border border-border-subtle px-2 py-1 text-[11px] text-text-secondary transition-colors hover:bg-bg-elevated hover:text-text-primary",
|
|
172
173
|
"data-testid": "assistant-stop-turn",
|
|
173
|
-
children: [/* @__PURE__ */ y(
|
|
174
|
+
children: [/* @__PURE__ */ y(_, {
|
|
174
175
|
className: "size-3 fill-current",
|
|
175
176
|
"aria-hidden": "true"
|
|
176
|
-
}), /* @__PURE__ */ y("span", { children:
|
|
177
|
+
}), /* @__PURE__ */ y("span", { children: xe })]
|
|
177
178
|
})
|
|
178
179
|
}) : null,
|
|
179
180
|
N,
|
|
@@ -185,7 +186,7 @@ var S = () => {
|
|
|
185
186
|
}), /* @__PURE__ */ y("div", {
|
|
186
187
|
className: "flex flex-wrap gap-2",
|
|
187
188
|
children: K.map((e) => {
|
|
188
|
-
let t = `${e.name}${e.type === "directory" ? ".tar.gz" : ""}`, r =
|
|
189
|
+
let t = `${e.name}${e.type === "directory" ? ".tar.gz" : ""}`, r = ke === e.path;
|
|
189
190
|
return /* @__PURE__ */ y(n, {
|
|
190
191
|
label: t,
|
|
191
192
|
disabled: r,
|
|
@@ -197,8 +198,8 @@ var S = () => {
|
|
|
197
198
|
path: e.path,
|
|
198
199
|
filename: t
|
|
199
200
|
},
|
|
200
|
-
defaultFolderPath:
|
|
201
|
-
onDownload: () =>
|
|
201
|
+
defaultFolderPath: Ee.artifacts,
|
|
202
|
+
onDownload: () => Me(e)
|
|
202
203
|
}, e.path);
|
|
203
204
|
})
|
|
204
205
|
})]
|
|
@@ -208,16 +209,16 @@ var S = () => {
|
|
|
208
209
|
children: [
|
|
209
210
|
X && /* @__PURE__ */ y("button", {
|
|
210
211
|
type: "button",
|
|
211
|
-
onClick:
|
|
212
|
+
onClick: je,
|
|
212
213
|
className: "flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-text-muted transition-colors hover:bg-bg-elevated hover:text-text-secondary",
|
|
213
214
|
"aria-label": I("message.copy", "Copy message"),
|
|
214
215
|
"data-testid": "assistant-message-copy",
|
|
215
|
-
children:
|
|
216
|
+
children: Ae ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(me, { className: "size-3 text-status-success-text" }), /* @__PURE__ */ y("span", { children: I("message.copied", "Copied") })] }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(he, { className: "size-3" }), /* @__PURE__ */ y("span", { children: I("message.copyShort", "Copy") })] })
|
|
216
217
|
}),
|
|
217
218
|
Q.trim() && V.isSupported && (() => {
|
|
218
219
|
let e = V.blockedFor(z) ?? V.disabledReason, t = V.isSpeaking(w.id) || V.isSpeaking(B.current), n = !!e && !!k, r = n ? `speak-reason-${w.id}` : void 0, i = n ? null : V.deviceFallbackFor(z), a = i ? `speak-fallback-${w.id}` : void 0;
|
|
219
220
|
return /* @__PURE__ */ b(v, { children: [
|
|
220
|
-
/* @__PURE__ */ y(
|
|
221
|
+
/* @__PURE__ */ y(re, {
|
|
221
222
|
isSpeaking: t,
|
|
222
223
|
disabled: e !== null,
|
|
223
224
|
disabledReason: e,
|
|
@@ -247,7 +248,7 @@ var S = () => {
|
|
|
247
248
|
className: `flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-colors hover:bg-bg-elevated ${D ? "text-status-error-text" : "text-text-muted hover:text-text-secondary"}`,
|
|
248
249
|
"aria-label": I("message.retry", "Retry"),
|
|
249
250
|
"data-testid": "assistant-message-retry",
|
|
250
|
-
children: [/* @__PURE__ */ y(
|
|
251
|
+
children: [/* @__PURE__ */ y(g, { className: "size-3" }), /* @__PURE__ */ y("span", { children: I("message.retry", "Retry") })]
|
|
251
252
|
})
|
|
252
253
|
]
|
|
253
254
|
}),
|
|
@@ -258,7 +259,7 @@ var S = () => {
|
|
|
258
259
|
children: [
|
|
259
260
|
w.tokens.input + w.tokens.output,
|
|
260
261
|
" ",
|
|
261
|
-
|
|
262
|
+
Ce.tokens
|
|
262
263
|
]
|
|
263
264
|
})]
|
|
264
265
|
})
|
|
@@ -5,72 +5,85 @@ import { useLiveOverlay as r } from "../liveOverlay.js";
|
|
|
5
5
|
import { approvalFollowUpReplyIds as i, approvedPendingWriteIds as a, goAheadSentReplyIds as o } from "../liveTurns.js";
|
|
6
6
|
import { scrollToEndWithin as s } from "./scrollWithin.js";
|
|
7
7
|
import { PAGE_SCROLL_GUTTER as c, useAssistantPageLayout as l } from "./assistantPageLayout.js";
|
|
8
|
-
import { Fragment as u, useEffect as d, useRef as f } from "react";
|
|
9
|
-
import { jsx as
|
|
8
|
+
import { Fragment as u, useEffect as d, useRef as f, useState as p } from "react";
|
|
9
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
10
|
// src/shared/assistant/ui/AssistantMessageList.tsx
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
var g = 250;
|
|
12
|
+
function _(e) {
|
|
13
|
+
return new Set(e.map((e) => e.id));
|
|
14
|
+
}
|
|
15
|
+
var v = ({ onApprovePendingWrite: g, approvingWriteRef: v = null, approvableMessageId: y = null, retryableMessageId: b = null, messages: x, processing: S, streamingMessageId: C, failedMessageId: w, onRetry: T, renderWriteProposals: E, hidesLegacyWriteCard: D, renderUiOffers: O, onStopTurn: k, stopTurnLabel: A, decorate: j }) => {
|
|
16
|
+
let M = n(), N = l(), P = x[0]?.id ?? null, [F, I] = p(() => ({
|
|
17
|
+
firstMessageId: P,
|
|
18
|
+
ids: _(x)
|
|
19
|
+
}));
|
|
20
|
+
F.firstMessageId !== P && I({
|
|
21
|
+
firstMessageId: P,
|
|
22
|
+
ids: F.firstMessageId === null && x.length <= 2 ? F.ids : _(x)
|
|
23
|
+
});
|
|
24
|
+
let L = (() => {
|
|
25
|
+
for (let e = x.length - 1; e >= 0; --e) if (x[e].role === "assistant") return x[e].id;
|
|
14
26
|
return null;
|
|
15
|
-
})(),
|
|
27
|
+
})(), R = a(x), z = o(x), B = i(x), V = f(null);
|
|
16
28
|
d(() => {
|
|
17
|
-
let e =
|
|
29
|
+
let e = V.current;
|
|
18
30
|
if (e && e.scrollHeight - e.scrollTop - e.clientHeight < 100) {
|
|
19
31
|
let n = t();
|
|
20
32
|
s(e, { behavior: n ? "auto" : "smooth" });
|
|
21
33
|
}
|
|
22
|
-
}, [
|
|
23
|
-
let
|
|
34
|
+
}, [x, C]);
|
|
35
|
+
let H = r((e) => e.byMessageId), U = C === null ? null : H[C]?.content ?? null, W = j ? x.map((e, t) => j(e, t, x)) : null, G = W?.[W.length - 1]?.content ?? null, K = f(0), q = f(null), J = U ?? G;
|
|
24
36
|
return d(() => {
|
|
25
|
-
if (
|
|
37
|
+
if (J === null) return;
|
|
26
38
|
let e = () => {
|
|
27
|
-
|
|
28
|
-
let e =
|
|
39
|
+
q.current = null, K.current = Date.now();
|
|
40
|
+
let e = V.current;
|
|
29
41
|
e && e.scrollHeight - e.scrollTop - e.clientHeight < 100 && s(e, { behavior: "auto" });
|
|
30
|
-
}, t =
|
|
31
|
-
t <= 0 ? e() :
|
|
32
|
-
}, [
|
|
33
|
-
|
|
42
|
+
}, t = K.current + 250 - Date.now();
|
|
43
|
+
t <= 0 ? e() : q.current === null && (q.current = setTimeout(e, t));
|
|
44
|
+
}, [J]), d(() => () => {
|
|
45
|
+
q.current !== null && clearTimeout(q.current);
|
|
34
46
|
}, []), d(() => {
|
|
35
|
-
|
|
36
|
-
}, []), /* @__PURE__ */
|
|
37
|
-
ref:
|
|
38
|
-
className:
|
|
47
|
+
V.current && s(V.current, { behavior: "instant" });
|
|
48
|
+
}, []), /* @__PURE__ */ h("div", {
|
|
49
|
+
ref: V,
|
|
50
|
+
className: N ? `scrollbar-slim flex-1 space-y-4 overflow-y-auto py-3 ${c}` : "scrollbar-slim flex-1 space-y-4 overflow-y-auto p-3",
|
|
39
51
|
role: "log",
|
|
40
52
|
"aria-live": "polite",
|
|
41
53
|
"aria-relevant": "additions",
|
|
42
|
-
"aria-busy":
|
|
43
|
-
"aria-label":
|
|
44
|
-
children: [
|
|
45
|
-
let r =
|
|
54
|
+
"aria-busy": C !== null,
|
|
55
|
+
"aria-label": M("messageList.ariaLabel", "Conversation messages"),
|
|
56
|
+
children: [x.map((t, n) => {
|
|
57
|
+
let r = W?.[n], i = r?.content === void 0 ? t : {
|
|
46
58
|
...t,
|
|
47
59
|
content: r.content
|
|
48
|
-
}, a = r?.content === void 0 ?
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
onApprovePendingWrite: s ?
|
|
51
|
-
approvingWriteRef:
|
|
60
|
+
}, a = r?.content === void 0 ? U : null, o = R.has(i.id), s = !o && (i.id === y || i.id === C);
|
|
61
|
+
return /* @__PURE__ */ h(u, { children: [/* @__PURE__ */ m(e, {
|
|
62
|
+
onApprovePendingWrite: s ? g : void 0,
|
|
63
|
+
approvingWriteRef: v,
|
|
52
64
|
pendingWriteApproved: o,
|
|
53
|
-
pendingWriteGoAheadSent:
|
|
65
|
+
pendingWriteGoAheadSent: z.has(i.id),
|
|
54
66
|
pendingWriteExpired: !o && !s,
|
|
55
|
-
message: i.id ===
|
|
67
|
+
message: i.id === C && a !== null ? {
|
|
56
68
|
...i,
|
|
57
69
|
content: a
|
|
58
70
|
} : i,
|
|
59
|
-
processing:
|
|
60
|
-
isStreaming: i.id ===
|
|
61
|
-
isFailed: i.id ===
|
|
62
|
-
isLastAssistant: i.id ===
|
|
63
|
-
isNewestAssistant: i.id ===
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
processing: S,
|
|
72
|
+
isStreaming: i.id === C,
|
|
73
|
+
isFailed: i.id === w,
|
|
74
|
+
isLastAssistant: i.id === b,
|
|
75
|
+
isNewestAssistant: i.id === L,
|
|
76
|
+
entering: N && !F.ids.has(i.id),
|
|
77
|
+
onRetry: B.has(i.id) ? void 0 : T,
|
|
78
|
+
legacyWriteCardHidden: D?.(i) ?? !1,
|
|
79
|
+
writeProposals: E?.(i),
|
|
80
|
+
uiOffers: O?.(i),
|
|
81
|
+
...i.id === C && k !== void 0 ? {
|
|
82
|
+
onStopTurn: k,
|
|
83
|
+
stopTurnLabel: A
|
|
71
84
|
} : {}
|
|
72
85
|
}), r?.below] }, i.id);
|
|
73
|
-
}), /* @__PURE__ */
|
|
86
|
+
}), /* @__PURE__ */ m("div", {})]
|
|
74
87
|
});
|
|
75
88
|
};
|
|
76
|
-
export {
|
|
89
|
+
export { v as AssistantMessageList, g as LIVE_SCROLL_GAP_MS };
|
|
@@ -19,6 +19,8 @@ import { AssistantConversationProcessing } from '../conversation';
|
|
|
19
19
|
export declare const TurnActivityLine: FC<{
|
|
20
20
|
shown: string;
|
|
21
21
|
label: string;
|
|
22
|
+
/** ★ BOFF-14753: a light sweeps across the words until the first one arrives (M4). */
|
|
23
|
+
shimmer?: boolean;
|
|
22
24
|
}>;
|
|
23
25
|
/**
|
|
24
26
|
* What a live turn is doing, drawn from its processing state (BOFF-7277).
|
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
import { useAssistantTr as e } from "../i18n.js";
|
|
2
2
|
import { usePrefersReducedMotion as t } from "./usePrefersReducedMotion.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useAssistantPageLayout as n } from "./assistantPageLayout.js";
|
|
4
|
+
import { elapsedSince as r, startPhraseTicker as i, turnActivityCopy as a, turnActivityStage as o } from "../turnActivity.js";
|
|
5
|
+
import { useEffect as s, useState as c } from "react";
|
|
6
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
7
|
// src/shared/assistant/ui/AssistantTurnActivity.tsx
|
|
7
|
-
var
|
|
8
|
+
var d = ({ shown: e, label: t, shimmer: n = !1 }) => /* @__PURE__ */ u("p", {
|
|
8
9
|
className: "relative text-[15px] leading-relaxed text-text-secondary",
|
|
9
10
|
"data-testid": "assistant-turn-activity",
|
|
10
|
-
children: [/* @__PURE__ */
|
|
11
|
+
children: [/* @__PURE__ */ l("span", {
|
|
11
12
|
"aria-hidden": "true",
|
|
13
|
+
className: n ? "boff-shimmer-text" : void 0,
|
|
12
14
|
"data-testid": "assistant-turn-activity-shown",
|
|
13
15
|
children: e
|
|
14
|
-
}), /* @__PURE__ */
|
|
16
|
+
}), /* @__PURE__ */ l("span", {
|
|
15
17
|
className: "sr-only start-0 top-0",
|
|
16
18
|
"data-testid": "assistant-turn-activity-label",
|
|
17
19
|
children: t
|
|
18
20
|
})]
|
|
19
|
-
}),
|
|
20
|
-
let
|
|
21
|
-
return
|
|
22
|
-
shown:
|
|
23
|
-
label:
|
|
21
|
+
}), f = ({ processing: r }) => {
|
|
22
|
+
let i = e(), s = t(), c = n(), u = p(o(r) === "thinking" && !s && typeof r?.stageStartedAt == "number" ? r.stageStartedAt : null), f = a(i, r, u);
|
|
23
|
+
return f ? /* @__PURE__ */ l(d, {
|
|
24
|
+
shown: f.shown,
|
|
25
|
+
label: f.label,
|
|
26
|
+
shimmer: c && !s
|
|
24
27
|
}) : null;
|
|
25
28
|
};
|
|
26
|
-
function
|
|
27
|
-
let [t,
|
|
28
|
-
return
|
|
29
|
-
if (e !== null) return
|
|
30
|
-
}, [e]),
|
|
29
|
+
function p(e) {
|
|
30
|
+
let [t, n] = c(() => Date.now());
|
|
31
|
+
return s(() => {
|
|
32
|
+
if (e !== null) return i(e, n);
|
|
33
|
+
}, [e]), r(e, t);
|
|
31
34
|
}
|
|
32
|
-
export {
|
|
35
|
+
export { f as AssistantTurnActivity, d as TurnActivityLine };
|
|
@@ -31,6 +31,18 @@ export interface AssistantLiveAvatarSeam {
|
|
|
31
31
|
* it opens, and starts a paid session only on the person's Turn on.
|
|
32
32
|
*/
|
|
33
33
|
tab?: LiveAvatarTabSeam;
|
|
34
|
+
/**
|
|
35
|
+
* ★ P5 (BOFF-12936): let hands-free interrupt stay ON while the avatar is ON. Optional; DEFAULT OFF,
|
|
36
|
+
* and then the pilot rule holds exactly as before (`useLiveAvatarHandsFreeGuard`).
|
|
37
|
+
*
|
|
38
|
+
* When true, and only where this browser can route the avatar's received voice into the echo
|
|
39
|
+
* gate's reference (`isAvatarVoiceReferenceSupported`), the avatar's voice is metered like the
|
|
40
|
+
* hosted voice: the person can talk over the avatar to interrupt it, and the avatar's own voice is
|
|
41
|
+
* refused as an echo. Should the route fail at run time, the gate refuses every onset while the
|
|
42
|
+
* avatar is on (fail closed) and tap-to-interrupt stays. Hosts turn it on per environment, alpha
|
|
43
|
+
* first.
|
|
44
|
+
*/
|
|
45
|
+
handsFreeWithAvatar?: boolean;
|
|
34
46
|
}
|
|
35
47
|
/** Whether the Avatar tab may be offered, as a store read with `useSyncExternalStore`. STABLE. */
|
|
36
48
|
export interface LiveAvatarTabOfferedStore {
|
|
@@ -336,6 +348,16 @@ export declare function useLiveAvatarSpeechEngine(seam: AssistantLiveAvatarSeam
|
|
|
336
348
|
* voice, not its picture.
|
|
337
349
|
*/
|
|
338
350
|
export declare function useLiveAvatarOn(): boolean;
|
|
351
|
+
/**
|
|
352
|
+
* @internal Exported for the assistant's own hands-free wiring (`useVoiceSession`,
|
|
353
|
+
* `AssistantHandsFreeInterruptToggle`); not part of the module's public surface.
|
|
354
|
+
*
|
|
355
|
+
* P5 (BOFF-12936): whether the avatar's voice can serve as the echo gate's reference here, so
|
|
356
|
+
* hands-free may stay ON while the avatar is ON. True only when the host opted in
|
|
357
|
+
* (`handsFreeWithAvatar`) and this browser can route a received track into the reference bus.
|
|
358
|
+
* False without a seam, so every app that passes no `liveAvatar` reads exactly what it did.
|
|
359
|
+
*/
|
|
360
|
+
export declare function useLiveAvatarEchoReference(): boolean;
|
|
339
361
|
/**
|
|
340
362
|
* @internal Exported for `AssistantVoiceSession` alone; not part of the module's public surface.
|
|
341
363
|
*
|
|
@@ -360,6 +382,10 @@ export declare function useLiveAvatarOn(): boolean;
|
|
|
360
382
|
* the avatar stays ON, and goes with the last of them (a microtask late, so React's development
|
|
361
383
|
* double mount keeps it, as component state was kept before).
|
|
362
384
|
*
|
|
385
|
+
* ★ P5 (BOFF-12936): where the avatar's voice is the echo gate's reference
|
|
386
|
+
* (`useLiveAvatarEchoReference`), the rule is lifted: nothing is switched off and no notice is
|
|
387
|
+
* shown, and the person's own hands-free setting decides as it does without an avatar.
|
|
388
|
+
*
|
|
363
389
|
* Without a seam nothing here subscribes to, reads or writes anything.
|
|
364
390
|
*/
|
|
365
391
|
export declare function useLiveAvatarHandsFreeGuard(): boolean;
|