@burdenoff/fe-libs 2026.925.6 → 2026.925.7
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/chrome/MobileTabBar.js +6 -6
- package/dist/chrome/ProductSideNav.js +9 -9
- package/dist/chrome/sideNavigation/useSideNavigationState.js +3 -3
- package/dist/chrome.js +8 -8
- package/dist/shared/assistant/autoRouting.d.ts +3 -0
- package/dist/shared/assistant/autoRouting.d.ts.map +1 -1
- package/dist/shared/assistant/autoRouting.js +1 -1
- package/dist/shared/assistant/conversation.d.ts +20 -0
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.d.ts +11 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +11 -0
- package/dist/shared/assistant/index.d.ts +2 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommandCopy.d.ts +26 -0
- package/dist/shared/assistant/localUiCommandCopy.d.ts.map +1 -0
- package/dist/shared/assistant/localUiCommandCopy.js +37 -0
- package/dist/shared/assistant/localUiCommands.d.ts +124 -0
- package/dist/shared/assistant/localUiCommands.d.ts.map +1 -0
- package/dist/shared/assistant/localUiCommands.js +173 -0
- package/dist/shared/assistant/product.d.ts +13 -1
- package/dist/shared/assistant/product.d.ts.map +1 -1
- package/dist/shared/assistant/product.js +8 -6
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +615 -524
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +6 -0
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageItem.js +3 -3
- package/dist/shared/assistant/ui/AssistantMessageList.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageList.js +14 -7
- package/dist/shared/assistant/ui/AssistantSpeechProvider.d.ts +9 -0
- package/dist/shared/assistant/ui/AssistantSpeechProvider.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +243 -196
- package/dist/shared/assistant/ui/useVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/useVoiceSession.js +44 -43
- package/dist/shared/assistant/voice/captionText.d.ts.map +1 -1
- package/dist/shared/assistant/voice/captionText.js +1 -1
- package/dist/shared/assistant/voice/speakableText.d.ts.map +1 -1
- package/dist/shared/assistant/voice/speakableText.js +63 -62
- package/dist/shared/hooks/shell/index.d.ts +1 -1
- package/dist/shared/hooks/shell/index.d.ts.map +1 -1
- package/dist/shared/providers/shell/ThemeProvider.d.ts +6 -0
- package/dist/shared/providers/shell/ThemeProvider.d.ts.map +1 -1
- package/dist/shared/providers/shell/ThemeProvider.js +28 -25
- package/dist/shared-assistant.js +16 -14
- package/dist/shared-hooks-shell.js +12 -12
- package/package.json +1 -1
|
@@ -9,16 +9,16 @@ import { findAssistantLanguage as m } from "../voice/languages.js";
|
|
|
9
9
|
import { resolveLanguagePair as te } from "../voice/languagePair.js";
|
|
10
10
|
import { speechLabelsFor as ne } from "../voice/speechLabels.js";
|
|
11
11
|
import { resolveSpeechLocale as re } from "../voice/replyLanguage.js";
|
|
12
|
-
import { IDLE_PLAYBACK as ie, isSpeakingMessage as
|
|
13
|
-
import { useAssistantStore as
|
|
14
|
-
import { isTurnInFlight as
|
|
15
|
-
import { parseToolActivity as
|
|
12
|
+
import { IDLE_PLAYBACK as ie, isSpeakingMessage as ae, publishedChunks as oe, speechPlaybackReducer as se } from "../voice/speechPlayback.js";
|
|
13
|
+
import { useAssistantStore as h } from "../store.js";
|
|
14
|
+
import { isTurnInFlight as ce } from "../turnState.js";
|
|
15
|
+
import { parseToolActivity as le } from "./AssistantToolActivity.js";
|
|
16
16
|
import "../speech/index.js";
|
|
17
|
-
import { markTurn as
|
|
18
|
-
import { createContext as
|
|
19
|
-
import { jsx as
|
|
17
|
+
import { markTurn as ue } from "../turnTimeline.js";
|
|
18
|
+
import { createContext as de, useCallback as g, useContext as _, useEffect as v, useMemo as y, useReducer as fe, useRef as b, useState as x, useSyncExternalStore as pe } from "react";
|
|
19
|
+
import { jsx as me } from "react/jsx-runtime";
|
|
20
20
|
//#region src/shared/assistant/ui/AssistantSpeechProvider.tsx
|
|
21
|
-
var
|
|
21
|
+
var he = {
|
|
22
22
|
codeBlock: "",
|
|
23
23
|
image: "",
|
|
24
24
|
link: "",
|
|
@@ -27,7 +27,7 @@ var pe = {
|
|
|
27
27
|
emailAt: "at",
|
|
28
28
|
emailDot: "dot",
|
|
29
29
|
nestedItem: ""
|
|
30
|
-
},
|
|
30
|
+
}, ge = 4e3, _e = de({
|
|
31
31
|
isSupported: !1,
|
|
32
32
|
availability: "unsupported",
|
|
33
33
|
isBlocked: !0,
|
|
@@ -47,144 +47,145 @@ var pe = {
|
|
|
47
47
|
sessionSpeaking: !1,
|
|
48
48
|
setSessionSpeaking: () => {},
|
|
49
49
|
setSessionMicOpen: () => {},
|
|
50
|
+
speakFinishedReply: () => {},
|
|
50
51
|
previewVoice: () => {}
|
|
51
52
|
});
|
|
52
|
-
function
|
|
53
|
-
return
|
|
53
|
+
function ve() {
|
|
54
|
+
return _(_e);
|
|
54
55
|
}
|
|
55
|
-
var
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
var ye = ({ children: de, visible: _ = !0, engine: ve }) => {
|
|
57
|
+
let ye = pe(d, u, u), S = ve ?? ye, C = t(), { locale: w } = e(), [T, E] = fe(se, ie), [D, O] = x(() => S.listVoices()), [k, be] = x(!1), [xe, A] = x(() => /* @__PURE__ */ new Map()), j = b(0), M = b(null), N = b(null);
|
|
58
|
+
v(() => () => {
|
|
59
|
+
N.current !== null && clearTimeout(N.current);
|
|
59
60
|
}, []);
|
|
60
|
-
let [
|
|
61
|
-
|
|
62
|
-
}, []),
|
|
63
|
-
|
|
64
|
-
}, []),
|
|
65
|
-
|
|
66
|
-
if (!
|
|
61
|
+
let [Se, P] = x(null), F = b(null), Ce = b(() => {}), I = g(() => {
|
|
62
|
+
F.current?.(), F.current = null;
|
|
63
|
+
}, []), L = h((e) => e.autoSpeakEnabled), we = h((e) => e.setAutoSpeak), [R, Te] = x(!1), Ee = b(!1), z = g((e) => {
|
|
64
|
+
Ee.current = e;
|
|
65
|
+
}, []), B = h((e) => e.activeConversationId), V = y(() => S.isSupported(), [S]);
|
|
66
|
+
v(() => {
|
|
67
|
+
if (!V) return;
|
|
67
68
|
let e = () => {
|
|
68
|
-
|
|
69
|
+
O(S.listVoices()), A((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
|
|
69
70
|
};
|
|
70
|
-
return e(),
|
|
71
|
-
}, [
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
]),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
]),
|
|
82
|
-
codeBlock:
|
|
83
|
-
image:
|
|
84
|
-
link:
|
|
85
|
-
largeTable:
|
|
86
|
-
truncated:
|
|
87
|
-
nestedItem:
|
|
88
|
-
emailAt:
|
|
89
|
-
emailDot:
|
|
90
|
-
}), [
|
|
91
|
-
|
|
92
|
-
}, [
|
|
93
|
-
let t =
|
|
71
|
+
return e(), S.subscribeVoices(e);
|
|
72
|
+
}, [S, V]);
|
|
73
|
+
let De = h((e) => e.assistantLanguage), Oe = h((e) => e.replyLanguage), H = h((e) => e.preferredVoices), ke = h((e) => e.setPreferredVoice), U = y(() => te(De, Oe, w).reply, [
|
|
74
|
+
De,
|
|
75
|
+
Oe,
|
|
76
|
+
w
|
|
77
|
+
]), W = U.code, G = g((e) => m(e)?.tag ?? s(e), []), Ae = g((e) => m(e)?.rate ?? .9, []), K = y(() => c(V, D, U.tag, k), [
|
|
78
|
+
V,
|
|
79
|
+
D,
|
|
80
|
+
U,
|
|
81
|
+
k
|
|
82
|
+
]), je = y(() => ({
|
|
83
|
+
codeBlock: C("speech.codeBlock", "Code block"),
|
|
84
|
+
image: C("speech.image", "image"),
|
|
85
|
+
link: C("speech.link", "link"),
|
|
86
|
+
largeTable: C("speech.largeTable", "Table with {{rows}} rows and {{columns}} columns"),
|
|
87
|
+
truncated: C("speech.truncated", "The rest of this message is not read aloud"),
|
|
88
|
+
nestedItem: C("speech.nestedItem", "Sub-item {{ordinal}}"),
|
|
89
|
+
emailAt: C("speech.emailAt", "at"),
|
|
90
|
+
emailDot: C("speech.emailDot", "dot")
|
|
91
|
+
}), [C]), q = g(() => {
|
|
92
|
+
I(), M.current = null, S.cancel(), E({ type: "stop" });
|
|
93
|
+
}, [I, S]), Me = g((e) => {
|
|
94
|
+
let t = S.listVoices().find((t) => t.name === e) ?? null;
|
|
94
95
|
if (t) {
|
|
95
|
-
|
|
96
|
+
q();
|
|
96
97
|
try {
|
|
97
|
-
|
|
98
|
+
S.speak([p(W)], {
|
|
98
99
|
voice: t,
|
|
99
|
-
lang:
|
|
100
|
+
lang: G(W),
|
|
100
101
|
fallback: !1
|
|
101
102
|
});
|
|
102
103
|
} catch {}
|
|
103
104
|
}
|
|
104
105
|
}, [
|
|
105
|
-
|
|
106
|
+
S,
|
|
107
|
+
W,
|
|
106
108
|
q,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
V();
|
|
109
|
+
G
|
|
110
|
+
]), Ne = g((e) => xe.get(e) ?? null, [xe]), Pe = g((e, t, n, i) => {
|
|
111
|
+
I();
|
|
111
112
|
let a = !1, o = () => {}, s = (r) => {
|
|
112
113
|
if (!a) {
|
|
113
|
-
if (a = !0,
|
|
114
|
-
|
|
114
|
+
if (a = !0, F.current = null, clearTimeout(c), o(), r.length === 0) {
|
|
115
|
+
be(!0);
|
|
115
116
|
return;
|
|
116
117
|
}
|
|
117
|
-
|
|
118
|
+
O(r), Ce.current(e, t, r, n, i);
|
|
118
119
|
}
|
|
119
|
-
}, c = setTimeout(() => s(
|
|
120
|
-
o =
|
|
121
|
-
a || (a = !0, clearTimeout(c), o(),
|
|
120
|
+
}, c = setTimeout(() => s(S.listVoices()), r);
|
|
121
|
+
o = S.subscribeVoices(() => s(S.listVoices())), F.current = () => {
|
|
122
|
+
a || (a = !0, clearTimeout(c), o(), F.current = null);
|
|
122
123
|
};
|
|
123
|
-
}, [
|
|
124
|
+
}, [I, S]), J = g((e, t, n, r, s = !1) => {
|
|
124
125
|
let l = n;
|
|
125
126
|
if (l.length === 0) {
|
|
126
|
-
let e =
|
|
127
|
-
e.length > 0 && (l = e,
|
|
127
|
+
let e = S.listVoices();
|
|
128
|
+
e.length > 0 && (l = e, O(e));
|
|
128
129
|
}
|
|
129
|
-
let u =
|
|
130
|
+
let u = G(r), d = o(c(!0, l, r, k));
|
|
130
131
|
if (d === "block") {
|
|
131
|
-
let t =
|
|
132
|
-
|
|
132
|
+
let t = C("speech.noVoiceForReply", "This reply is in {{language}}, and no {{language}} voice is installed on this device.", { language: i(u, w) });
|
|
133
|
+
A((n) => new Map(n).set(e, t));
|
|
133
134
|
return;
|
|
134
135
|
}
|
|
135
136
|
if (d === "wait-for-voices") {
|
|
136
|
-
|
|
137
|
+
Pe(e, t, r, s);
|
|
137
138
|
return;
|
|
138
139
|
}
|
|
139
|
-
|
|
140
|
+
A((t) => {
|
|
140
141
|
if (!t.has(e)) return t;
|
|
141
142
|
let n = new Map(t);
|
|
142
143
|
return n.delete(e), n;
|
|
143
|
-
}),
|
|
144
|
-
let f =
|
|
145
|
-
|
|
144
|
+
}), I();
|
|
145
|
+
let f = j.current + 1;
|
|
146
|
+
j.current = f, E({
|
|
146
147
|
type: "start",
|
|
147
148
|
messageId: e,
|
|
148
149
|
requestId: f
|
|
149
|
-
}),
|
|
150
|
+
}), M.current = s ? f : null, s && ue(e, "ttsStarted");
|
|
150
151
|
let p = ee(t);
|
|
151
|
-
|
|
152
|
+
P({
|
|
152
153
|
requestId: f,
|
|
153
154
|
chunks: p,
|
|
154
155
|
index: -1
|
|
155
|
-
}),
|
|
156
|
-
|
|
157
|
-
},
|
|
156
|
+
}), N.current !== null && clearTimeout(N.current), N.current = setTimeout(() => {
|
|
157
|
+
P((e) => e?.requestId === f && e.index < 0 ? null : e);
|
|
158
|
+
}, ge);
|
|
158
159
|
let m = () => {
|
|
159
|
-
|
|
160
|
+
j.current === f && N.current !== null && (clearTimeout(N.current), N.current = null), E({
|
|
160
161
|
type: "failed",
|
|
161
162
|
requestId: f
|
|
162
163
|
});
|
|
163
164
|
};
|
|
164
165
|
try {
|
|
165
|
-
|
|
166
|
-
voice: a(l, u,
|
|
166
|
+
S.speak(p, {
|
|
167
|
+
voice: a(l, u, H[r]),
|
|
167
168
|
lang: u,
|
|
168
|
-
rate:
|
|
169
|
+
rate: Ae(r)
|
|
169
170
|
}, {
|
|
170
171
|
onStart: () => {
|
|
171
|
-
|
|
172
|
+
j.current === f && M.current === f && ue(e, "firstAudio");
|
|
172
173
|
},
|
|
173
174
|
onChunkStart: (e) => {
|
|
174
|
-
|
|
175
|
+
j.current === f && N.current !== null && (clearTimeout(N.current), N.current = null), P((t) => t?.requestId === f ? {
|
|
175
176
|
...t,
|
|
176
177
|
index: e
|
|
177
|
-
} :
|
|
178
|
+
} : j.current === f ? {
|
|
178
179
|
requestId: f,
|
|
179
180
|
chunks: p,
|
|
180
181
|
index: e
|
|
181
182
|
} : t);
|
|
182
183
|
},
|
|
183
|
-
onEnd: () =>
|
|
184
|
+
onEnd: () => E({
|
|
184
185
|
type: "finished",
|
|
185
186
|
requestId: f
|
|
186
187
|
}),
|
|
187
|
-
onError: () =>
|
|
188
|
+
onError: () => E({
|
|
188
189
|
type: "failed",
|
|
189
190
|
requestId: f
|
|
190
191
|
})
|
|
@@ -193,141 +194,187 @@ var T = ({ children: _, visible: y = !0, engine: he }) => {
|
|
|
193
194
|
m();
|
|
194
195
|
}
|
|
195
196
|
}, [
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
I,
|
|
198
|
+
S,
|
|
199
|
+
w,
|
|
200
|
+
H,
|
|
201
|
+
Ae,
|
|
199
202
|
G,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
N,
|
|
204
|
-
Ae
|
|
203
|
+
C,
|
|
204
|
+
k,
|
|
205
|
+
Pe
|
|
205
206
|
]);
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}, [
|
|
209
|
-
let
|
|
210
|
-
if (!
|
|
211
|
-
let i = re(f(t, { labels:
|
|
212
|
-
a &&
|
|
207
|
+
v(() => {
|
|
208
|
+
Ce.current = J;
|
|
209
|
+
}, [J]);
|
|
210
|
+
let Y = g((e, t, n, r) => {
|
|
211
|
+
if (!V) return;
|
|
212
|
+
let i = re(f(t, { labels: he }), n ?? W), a = f(t, { labels: ne(i, je) });
|
|
213
|
+
a && J(e, a, D, i, r?.auto === !0);
|
|
213
214
|
}, [
|
|
215
|
+
V,
|
|
216
|
+
je,
|
|
214
217
|
W,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
if (h(k, e)) {
|
|
221
|
-
Z();
|
|
218
|
+
J,
|
|
219
|
+
D
|
|
220
|
+
]), X = g((e, t, n) => {
|
|
221
|
+
if (ae(T, e)) {
|
|
222
|
+
q();
|
|
222
223
|
return;
|
|
223
224
|
}
|
|
224
|
-
|
|
225
|
+
Y(e, t, n);
|
|
225
226
|
}, [
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
T,
|
|
228
|
+
Y,
|
|
229
|
+
q
|
|
229
230
|
]);
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}, [
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
231
|
+
v(() => {
|
|
232
|
+
_ || q();
|
|
233
|
+
}, [_, q]);
|
|
234
|
+
let Fe = b({
|
|
235
|
+
autoSpeakEnabled: L,
|
|
236
|
+
sessionSpeaking: R,
|
|
237
|
+
visible: _,
|
|
238
|
+
isSupported: V
|
|
239
|
+
});
|
|
240
|
+
v(() => {
|
|
241
|
+
Fe.current = {
|
|
242
|
+
autoSpeakEnabled: L,
|
|
243
|
+
sessionSpeaking: R,
|
|
244
|
+
visible: _,
|
|
245
|
+
isSupported: V
|
|
246
|
+
};
|
|
247
|
+
}, [
|
|
248
|
+
L,
|
|
249
|
+
R,
|
|
250
|
+
_,
|
|
251
|
+
V
|
|
252
|
+
]);
|
|
253
|
+
let Ie = b(null), Z = b(null), Le = b(() => {});
|
|
254
|
+
v(() => {
|
|
255
|
+
q(), A(/* @__PURE__ */ new Map()), Ie.current = B;
|
|
256
|
+
let e = Z.current;
|
|
257
|
+
Z.current = null, e && e.conversationId === B && Le.current(e.conversationId, e.messageId);
|
|
258
|
+
}, [B, q]), v(() => {
|
|
259
|
+
A((e) => e.size === 0 ? e : /* @__PURE__ */ new Map()), q();
|
|
260
|
+
}, [W, q]), v(() => () => {
|
|
261
|
+
F.current?.(), F.current = null, S.cancel();
|
|
262
|
+
}, [S]), v(() => {
|
|
239
263
|
if (typeof window > "u") return;
|
|
240
|
-
let e = () =>
|
|
264
|
+
let e = () => S.cancel();
|
|
241
265
|
return window.addEventListener("pagehide", e), () => window.removeEventListener("pagehide", e);
|
|
242
|
-
}, [
|
|
243
|
-
if (typeof document > "u" || !
|
|
266
|
+
}, [S]), v(() => {
|
|
267
|
+
if (typeof document > "u" || !V) return;
|
|
244
268
|
let e = () => {
|
|
245
269
|
if (document.visibilityState !== "visible") return;
|
|
246
|
-
let e =
|
|
247
|
-
e.length > 0 &&
|
|
270
|
+
let e = S.listVoices();
|
|
271
|
+
e.length > 0 && I(), O(e), be(!1), A((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
|
|
248
272
|
};
|
|
249
273
|
return document.addEventListener("visibilitychange", e), window.addEventListener("focus", e), () => {
|
|
250
274
|
document.removeEventListener("visibilitychange", e), window.removeEventListener("focus", e);
|
|
251
275
|
};
|
|
252
276
|
}, [
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
277
|
+
I,
|
|
278
|
+
S,
|
|
279
|
+
V
|
|
256
280
|
]);
|
|
257
|
-
let
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}, [
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
281
|
+
let Re = b(Y);
|
|
282
|
+
v(() => {
|
|
283
|
+
Re.current = Y;
|
|
284
|
+
}, [Y]);
|
|
285
|
+
let Q = g((e, t) => {
|
|
286
|
+
if (n(e) !== t || Ee.current) return;
|
|
287
|
+
let { text: r } = le(e.content);
|
|
288
|
+
if (r.trim()) try {
|
|
289
|
+
Re.current(e.id, r, e.metadata?.lang, { auto: !0 });
|
|
290
|
+
} catch {}
|
|
291
|
+
}, []), $ = g((e, t) => {
|
|
292
|
+
if (e !== Ie.current) {
|
|
293
|
+
h.getState().activeConversationId === e && (Z.current = {
|
|
294
|
+
conversationId: e,
|
|
295
|
+
messageId: t
|
|
296
|
+
});
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
let n = Fe.current;
|
|
300
|
+
if (!n.autoSpeakEnabled && !n.sessionSpeaking || !n.visible || !n.isSupported) return;
|
|
301
|
+
let r = h.getState();
|
|
302
|
+
if (r.activeConversationId !== e) return;
|
|
303
|
+
let i = r.conversations.find((t) => t.id === e)?.messages.find((e) => e.id === t);
|
|
304
|
+
!i || i.role !== "assistant" || Q(i, n.sessionSpeaking);
|
|
305
|
+
}, [Q]);
|
|
306
|
+
v(() => {
|
|
307
|
+
Le.current = $;
|
|
308
|
+
}, [$]), v(() => {
|
|
309
|
+
if (!(!L && !R || !_ || !V)) return h.subscribe((e, t) => {
|
|
310
|
+
let n = e.activeConversationId;
|
|
311
|
+
if (!n || n !== t.activeConversationId) return;
|
|
312
|
+
let r = e.processingByConversationId[n], i = t.processingByConversationId[n];
|
|
313
|
+
if (r?.status !== "complete" || !ce(i?.status)) return;
|
|
314
|
+
let a = r.messageId ?? i?.messageId ?? null;
|
|
315
|
+
if (!a) return;
|
|
316
|
+
let o = e.conversations.find((e) => e.id === n)?.messages.find((e) => e.id === a);
|
|
317
|
+
!o || o.role !== "assistant" || Q(o, R);
|
|
274
318
|
});
|
|
275
319
|
}, [
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
320
|
+
L,
|
|
321
|
+
R,
|
|
322
|
+
V,
|
|
323
|
+
_,
|
|
324
|
+
Q
|
|
280
325
|
]);
|
|
281
|
-
let
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
]),
|
|
287
|
-
isSupported:
|
|
288
|
-
availability:
|
|
289
|
-
isBlocked:
|
|
290
|
-
disabledReason:
|
|
291
|
-
blockedFor:
|
|
292
|
-
voiceChoices:
|
|
293
|
-
spokenChunks:
|
|
294
|
-
activeVoiceName:
|
|
295
|
-
preferredVoiceName:
|
|
296
|
-
setVoice: (e) =>
|
|
297
|
-
speakingMessageId:
|
|
298
|
-
isSpeaking: (e) =>
|
|
299
|
-
toggle:
|
|
300
|
-
stop:
|
|
301
|
-
autoSpeakEnabled:
|
|
302
|
-
setAutoSpeak:
|
|
303
|
-
sessionSpeaking:
|
|
304
|
-
setSessionSpeaking:
|
|
305
|
-
setSessionMicOpen:
|
|
306
|
-
|
|
326
|
+
let ze = y(() => l(D, U.tag), [D, U]), Be = y(() => a(D, U.tag, H[W]), [
|
|
327
|
+
D,
|
|
328
|
+
U,
|
|
329
|
+
H,
|
|
330
|
+
W
|
|
331
|
+
]), Ve = y(() => ({
|
|
332
|
+
isSupported: V,
|
|
333
|
+
availability: K,
|
|
334
|
+
isBlocked: K === "no-voices",
|
|
335
|
+
disabledReason: K === "no-voices" ? C("speech.noVoicesOnDevice", "This device has no speech voices installed. Add one in your device speech or accessibility settings.") : null,
|
|
336
|
+
blockedFor: Ne,
|
|
337
|
+
voiceChoices: ze,
|
|
338
|
+
spokenChunks: oe(T, Se),
|
|
339
|
+
activeVoiceName: Be?.name ?? null,
|
|
340
|
+
preferredVoiceName: H[W] ?? null,
|
|
341
|
+
setVoice: (e) => ke(W, e),
|
|
342
|
+
speakingMessageId: T.status === "speaking" ? T.messageId : null,
|
|
343
|
+
isSpeaking: (e) => ae(T, e),
|
|
344
|
+
toggle: X,
|
|
345
|
+
stop: q,
|
|
346
|
+
autoSpeakEnabled: L,
|
|
347
|
+
setAutoSpeak: we,
|
|
348
|
+
sessionSpeaking: R,
|
|
349
|
+
setSessionSpeaking: Te,
|
|
350
|
+
setSessionMicOpen: z,
|
|
351
|
+
speakFinishedReply: $,
|
|
352
|
+
previewVoice: Me
|
|
307
353
|
}), [
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
ke,
|
|
354
|
+
V,
|
|
355
|
+
K,
|
|
311
356
|
Ne,
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
Ee,
|
|
315
|
-
q,
|
|
316
|
-
k,
|
|
317
|
-
je,
|
|
318
|
-
Z,
|
|
357
|
+
ze,
|
|
358
|
+
Be,
|
|
319
359
|
H,
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
360
|
+
ke,
|
|
361
|
+
W,
|
|
362
|
+
T,
|
|
363
|
+
X,
|
|
364
|
+
q,
|
|
365
|
+
L,
|
|
366
|
+
we,
|
|
367
|
+
R,
|
|
368
|
+
z,
|
|
369
|
+
$,
|
|
370
|
+
Me,
|
|
371
|
+
C,
|
|
372
|
+
Se
|
|
326
373
|
]);
|
|
327
|
-
return /* @__PURE__ */
|
|
328
|
-
value:
|
|
329
|
-
children:
|
|
374
|
+
return /* @__PURE__ */ me(_e.Provider, {
|
|
375
|
+
value: Ve,
|
|
376
|
+
children: de
|
|
330
377
|
});
|
|
331
378
|
};
|
|
332
379
|
//#endregion
|
|
333
|
-
export {
|
|
380
|
+
export { ye as AssistantSpeechProvider, ve as useAssistantSpeech };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVoiceSession.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/useVoiceSession.ts"],"names":[],"mappings":"AASA,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAcL,KAAK,oBAAoB,EAE1B,MAAM,uBAAuB,CAAC;AAsC/B;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAC5B,SAAS,GAAG,eAAe,GAAG,eAAe,GAAG,oBAAoB,CAAC;AAMvE,UAAU,OAAO;IACf,+EAA+E;IAC/E;;;;;;;OAOG;IACH,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM;IACtB;;;OAGG;IACH,MAAM,EAAE,eAAe,KACpB,IAAI,CAAC;IACV;;;;OAIG;IACH,WAAW,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjD,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,OAAO;;
|
|
1
|
+
{"version":3,"file":"useVoiceSession.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/useVoiceSession.ts"],"names":[],"mappings":"AASA,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAcL,KAAK,oBAAoB,EAE1B,MAAM,uBAAuB,CAAC;AAsC/B;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAC5B,SAAS,GAAG,eAAe,GAAG,eAAe,GAAG,oBAAoB,CAAC;AAMvE,UAAU,OAAO;IACf,+EAA+E;IAC/E;;;;;;;OAOG;IACH,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM;IACtB;;;OAGG;IACH,MAAM,EAAE,eAAe,KACpB,IAAI,CAAC;IACV;;;;OAIG;IACH,WAAW,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjD,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,OAAO;;IA0kBtE,qEAAqE;;IAErE;;;;;;;OAOG;;;;;IAEH,+DAA+D;;IAE/D;;;;;;;OAOG;;IAIH,0EAA0E;;IAE1E,6DAA6D;;IAE7D,sDAAsD;;;;;;EA4B3D"}
|