@burdenoff/fe-libs 2026.908.2 → 2026.909.2
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/turnState.d.ts +46 -0
- package/dist/shared/assistant/turnState.d.ts.map +1 -1
- package/dist/shared/assistant/turnState.js +10 -1
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +232 -213
- package/dist/shared/assistant/ui/AssistantSpeechProvider.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +151 -154
- package/dist/shared/assistant/ui/voice/AssistantVoiceOrb.d.ts +1 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceOrb.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceOrb.js +2 -2
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +67 -67
- package/dist/shared/assistant/voice/speechPlayback.d.ts +32 -0
- package/dist/shared/assistant/voice/speechPlayback.d.ts.map +1 -1
- package/dist/shared/assistant/voice/speechPlayback.js +7 -1
- package/dist/shared/assistant/voice/voiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceSession.js +1 -1
- package/dist/shared/assistant/voice/voiceStageState.d.ts +16 -1
- package/dist/shared/assistant/voice/voiceStageState.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceStageState.js +1 -1
- package/dist/shared-assistant.js +59 -59
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantSpeechProvider.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantSpeechProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EASL,KAAK,EAAE,EACP,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AA2B/D,OAAO,EAQL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantSpeechProvider.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantSpeechProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EASL,KAAK,EAAE,EACP,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AA2B/D,OAAO,EAQL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAkB/B,MAAM,WAAW,2BAA2B;IAC1C,gFAAgF;IAChF,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,iBAAiB,CAAC;IAChC;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;;;;OAMG;IACH,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACjD;;;;OAIG;IACH,YAAY,EAAE,SAAS,eAAe,EAAE,CAAC;IACzC,8EAA8E;IAC9E;;;;;;OAMG;IACH,YAAY,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACzD,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;;;;;;OAQG;IACH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mEAAmE;IACnE,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IAC3C;;;;;;;OAOG;IACH,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3E,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;;;;;;;;;;;;OAaG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C;;;;;;;;;;;;;OAaG;IACH,iBAAiB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,kFAAkF;IAClF,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AA4BD,wBAAgB,kBAAkB,IAAI,2BAA2B,CAEhE;AAED,UAAU,KAAK;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,KAAK,CAsyB7C,CAAC"}
|
|
@@ -9,12 +9,12 @@ import { resolveLanguagePair as te } from "../voice/languagePair.js";
|
|
|
9
9
|
import { useAssistantTr as ne } from "../i18n.js";
|
|
10
10
|
import { speechLabelsFor as re } from "../voice/speechLabels.js";
|
|
11
11
|
import { resolveSpeechLocale as ie } from "../voice/replyLanguage.js";
|
|
12
|
-
import { IDLE_PLAYBACK as ae, isSpeakingMessage as oe,
|
|
12
|
+
import { IDLE_PLAYBACK as ae, isSpeakingMessage as oe, publishedChunks as se, speechPlaybackReducer as ce } from "../voice/speechPlayback.js";
|
|
13
13
|
import { useAssistantStore as p } from "../store.js";
|
|
14
|
-
import { isTurnInFlight as
|
|
15
|
-
import { parseToolActivity as
|
|
14
|
+
import { isTurnInFlight as le } from "../turnState.js";
|
|
15
|
+
import { parseToolActivity as ue } from "./AssistantToolActivity.js";
|
|
16
16
|
import "../speech/index.js";
|
|
17
|
-
import { createContext as
|
|
17
|
+
import { createContext as m, useCallback as h, useContext as g, useEffect as _, useMemo as v, useReducer as de, useRef as y, useState as b } from "react";
|
|
18
18
|
import { jsx as fe } from "react/jsx-runtime";
|
|
19
19
|
//#region src/shared/assistant/ui/AssistantSpeechProvider.tsx
|
|
20
20
|
var pe = {
|
|
@@ -26,7 +26,7 @@ var pe = {
|
|
|
26
26
|
emailAt: "at",
|
|
27
27
|
emailDot: "dot",
|
|
28
28
|
nestedItem: ""
|
|
29
|
-
}, me = 4e3,
|
|
29
|
+
}, me = 4e3, x = m({
|
|
30
30
|
isSupported: !1,
|
|
31
31
|
availability: "unsupported",
|
|
32
32
|
isBlocked: !0,
|
|
@@ -48,265 +48,262 @@ var pe = {
|
|
|
48
48
|
setSessionMicOpen: () => {},
|
|
49
49
|
previewVoice: () => {}
|
|
50
50
|
});
|
|
51
|
-
function
|
|
52
|
-
return
|
|
51
|
+
function S() {
|
|
52
|
+
return g(x);
|
|
53
53
|
}
|
|
54
|
-
var
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
var C = ({ children: m, visible: g = !0, engine: S = n() }) => {
|
|
55
|
+
let C = ne(), { locale: w } = e(), [T, E] = de(ce, ae), [D, O] = b(() => S.listVoices()), [k, he] = b(!1), [ge, A] = b(() => /* @__PURE__ */ new Map()), j = y(0), M = y(null);
|
|
56
|
+
_(() => () => {
|
|
57
|
+
M.current !== null && clearTimeout(M.current);
|
|
58
58
|
}, []);
|
|
59
|
-
let [
|
|
60
|
-
|
|
61
|
-
}, []), R = p((e) => e.autoSpeakEnabled), z = p((e) => e.setAutoSpeak), [B,
|
|
59
|
+
let [N, P] = b(null), F = y(null), I = y(() => {}), L = h(() => {
|
|
60
|
+
F.current?.(), F.current = null;
|
|
61
|
+
}, []), R = p((e) => e.autoSpeakEnabled), z = p((e) => e.setAutoSpeak), [B, _e] = b(!1), V = y(!1), H = h((e) => {
|
|
62
62
|
V.current = e;
|
|
63
|
-
}, []),
|
|
64
|
-
|
|
63
|
+
}, []), ve = p((e) => e.activeConversationId), U = v(() => S.isSupported(), [S]);
|
|
64
|
+
_(() => {
|
|
65
65
|
if (!U) return;
|
|
66
66
|
let e = () => {
|
|
67
|
-
|
|
67
|
+
O(S.listVoices()), A((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
|
|
68
68
|
};
|
|
69
|
-
return e(),
|
|
70
|
-
}, [
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
]),
|
|
69
|
+
return e(), S.subscribeVoices(e);
|
|
70
|
+
}, [S, U]);
|
|
71
|
+
let ye = p((e) => e.assistantLanguage), be = p((e) => e.replyLanguage), W = p((e) => e.preferredVoices), xe = p((e) => e.setPreferredVoice), G = v(() => te(ye, be, w).reply, [
|
|
72
|
+
ye,
|
|
73
|
+
be,
|
|
74
|
+
w
|
|
75
|
+
]), K = G.code, q = h((e) => f(e)?.tag ?? s(e), []), Se = h((e) => f(e)?.rate ?? .9, []), J = v(() => c(U, D, G.tag, k), [
|
|
76
76
|
U,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
]),
|
|
81
|
-
codeBlock:
|
|
82
|
-
image:
|
|
83
|
-
link:
|
|
84
|
-
largeTable:
|
|
85
|
-
truncated:
|
|
86
|
-
nestedItem:
|
|
87
|
-
emailAt:
|
|
88
|
-
emailDot:
|
|
89
|
-
}), [
|
|
90
|
-
L(),
|
|
91
|
-
}, [L,
|
|
92
|
-
let t =
|
|
93
|
-
t && (X(),
|
|
77
|
+
D,
|
|
78
|
+
G,
|
|
79
|
+
k
|
|
80
|
+
]), Y = v(() => ({
|
|
81
|
+
codeBlock: C("speech.codeBlock", "Code block"),
|
|
82
|
+
image: C("speech.image", "image"),
|
|
83
|
+
link: C("speech.link", "link"),
|
|
84
|
+
largeTable: C("speech.largeTable", "Table with {{rows}} rows and {{columns}} columns"),
|
|
85
|
+
truncated: C("speech.truncated", "The rest of this message is not read aloud"),
|
|
86
|
+
nestedItem: C("speech.nestedItem", "Sub-item {{ordinal}}"),
|
|
87
|
+
emailAt: C("speech.emailAt", "at"),
|
|
88
|
+
emailDot: C("speech.emailDot", "dot")
|
|
89
|
+
}), [C]), X = h(() => {
|
|
90
|
+
L(), S.cancel(), E({ type: "stop" });
|
|
91
|
+
}, [L, S]), Ce = h((e) => {
|
|
92
|
+
let t = S.listVoices().find((t) => t.name === e) ?? null;
|
|
93
|
+
t && (X(), S.speak([d(K)], {
|
|
94
94
|
voice: t,
|
|
95
|
-
lang:
|
|
95
|
+
lang: q(K)
|
|
96
96
|
}));
|
|
97
97
|
}, [
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
S,
|
|
99
|
+
K,
|
|
100
100
|
X,
|
|
101
|
-
|
|
102
|
-
]),
|
|
101
|
+
q
|
|
102
|
+
]), we = h((e) => ge.get(e) ?? null, [ge]), Te = h((e, t, n) => {
|
|
103
103
|
L();
|
|
104
104
|
let i = !1, a = () => {}, o = (r) => {
|
|
105
105
|
if (!i) {
|
|
106
|
-
if (i = !0,
|
|
107
|
-
|
|
106
|
+
if (i = !0, F.current = null, clearTimeout(s), a(), r.length === 0) {
|
|
107
|
+
he(!0);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
O(r), I.current(e, t, r, n);
|
|
111
111
|
}
|
|
112
|
-
}, s = setTimeout(() => o(
|
|
113
|
-
a =
|
|
114
|
-
i || (i = !0, clearTimeout(s), a(),
|
|
112
|
+
}, s = setTimeout(() => o(S.listVoices()), r);
|
|
113
|
+
a = S.subscribeVoices(() => o(S.listVoices())), F.current = () => {
|
|
114
|
+
i || (i = !0, clearTimeout(s), a(), F.current = null);
|
|
115
115
|
};
|
|
116
|
-
}, [L,
|
|
116
|
+
}, [L, S]), Z = h((e, t, n, r) => {
|
|
117
117
|
let s = n;
|
|
118
118
|
if (s.length === 0) {
|
|
119
|
-
let e =
|
|
120
|
-
e.length > 0 && (s = e,
|
|
119
|
+
let e = S.listVoices();
|
|
120
|
+
e.length > 0 && (s = e, O(e));
|
|
121
121
|
}
|
|
122
|
-
let l =
|
|
122
|
+
let l = q(r), u = o(c(!0, s, r, k));
|
|
123
123
|
if (u === "block") {
|
|
124
|
-
let t =
|
|
125
|
-
|
|
124
|
+
let t = C("speech.noVoiceForReply", "This reply is in {{language}}, and no {{language}} voice is installed on this device.", { language: i(l, w) });
|
|
125
|
+
A((n) => new Map(n).set(e, t));
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
if (u === "wait-for-voices") {
|
|
129
|
-
|
|
129
|
+
Te(e, t, r);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
A((t) => {
|
|
133
133
|
if (!t.has(e)) return t;
|
|
134
134
|
let n = new Map(t);
|
|
135
135
|
return n.delete(e), n;
|
|
136
136
|
});
|
|
137
|
-
let d =
|
|
138
|
-
|
|
137
|
+
let d = j.current + 1;
|
|
138
|
+
j.current = d, E({
|
|
139
139
|
type: "start",
|
|
140
140
|
messageId: e,
|
|
141
141
|
requestId: d
|
|
142
142
|
});
|
|
143
143
|
let f = ee(t);
|
|
144
|
-
|
|
144
|
+
P({
|
|
145
145
|
requestId: d,
|
|
146
146
|
chunks: f,
|
|
147
147
|
index: -1
|
|
148
|
-
}),
|
|
149
|
-
|
|
150
|
-
}, me),
|
|
151
|
-
voice: a(s, l,
|
|
148
|
+
}), M.current !== null && clearTimeout(M.current), M.current = setTimeout(() => {
|
|
149
|
+
P((e) => e?.requestId === d && e.index < 0 ? null : e);
|
|
150
|
+
}, me), S.speak(f, {
|
|
151
|
+
voice: a(s, l, W[r]),
|
|
152
152
|
lang: l,
|
|
153
|
-
rate:
|
|
153
|
+
rate: Se(r)
|
|
154
154
|
}, {
|
|
155
155
|
onChunkStart: (e) => {
|
|
156
|
-
|
|
156
|
+
j.current === d && M.current !== null && (clearTimeout(M.current), M.current = null), P((t) => t?.requestId === d ? {
|
|
157
157
|
...t,
|
|
158
158
|
index: e
|
|
159
|
-
} :
|
|
159
|
+
} : j.current === d ? {
|
|
160
160
|
requestId: d,
|
|
161
161
|
chunks: f,
|
|
162
162
|
index: e
|
|
163
163
|
} : t);
|
|
164
164
|
},
|
|
165
|
-
onEnd: () =>
|
|
165
|
+
onEnd: () => E({
|
|
166
166
|
type: "finished",
|
|
167
167
|
requestId: d
|
|
168
168
|
}),
|
|
169
|
-
onError: () =>
|
|
169
|
+
onError: () => E({
|
|
170
170
|
type: "failed",
|
|
171
171
|
requestId: d
|
|
172
172
|
})
|
|
173
173
|
});
|
|
174
174
|
}, [
|
|
175
|
-
x,
|
|
176
|
-
C,
|
|
177
|
-
G,
|
|
178
|
-
be,
|
|
179
|
-
J,
|
|
180
175
|
S,
|
|
181
|
-
|
|
182
|
-
|
|
176
|
+
w,
|
|
177
|
+
W,
|
|
178
|
+
Se,
|
|
179
|
+
q,
|
|
180
|
+
C,
|
|
181
|
+
k,
|
|
182
|
+
Te
|
|
183
183
|
]);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}, [
|
|
187
|
-
let
|
|
184
|
+
_(() => {
|
|
185
|
+
I.current = Z;
|
|
186
|
+
}, [Z]);
|
|
187
|
+
let Q = h((e, t, n) => {
|
|
188
188
|
if (!U) return;
|
|
189
|
-
let r = ie(u(t, { labels: pe }), n ??
|
|
190
|
-
i &&
|
|
189
|
+
let r = ie(u(t, { labels: pe }), n ?? K), i = u(t, { labels: re(r, Y) });
|
|
190
|
+
i && Z(e, i, D, r);
|
|
191
191
|
}, [
|
|
192
192
|
U,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
]),
|
|
198
|
-
if (oe(
|
|
193
|
+
Y,
|
|
194
|
+
K,
|
|
195
|
+
Z,
|
|
196
|
+
D
|
|
197
|
+
]), Ee = h((e, t, n) => {
|
|
198
|
+
if (oe(T, e)) {
|
|
199
199
|
X();
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
|
-
|
|
202
|
+
Q(e, t, n);
|
|
203
203
|
}, [
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
T,
|
|
205
|
+
Q,
|
|
206
206
|
X
|
|
207
207
|
]);
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}, [
|
|
211
|
-
X(),
|
|
212
|
-
}, [
|
|
213
|
-
|
|
214
|
-
}, [
|
|
215
|
-
|
|
216
|
-
}, [
|
|
208
|
+
_(() => {
|
|
209
|
+
g || X();
|
|
210
|
+
}, [g, X]), _(() => {
|
|
211
|
+
X(), A(/* @__PURE__ */ new Map());
|
|
212
|
+
}, [ve, X]), _(() => {
|
|
213
|
+
A((e) => e.size === 0 ? e : /* @__PURE__ */ new Map()), X();
|
|
214
|
+
}, [K, X]), _(() => () => {
|
|
215
|
+
F.current?.(), F.current = null, S.cancel();
|
|
216
|
+
}, [S]), _(() => {
|
|
217
217
|
if (typeof window > "u") return;
|
|
218
|
-
let e = () =>
|
|
218
|
+
let e = () => S.cancel();
|
|
219
219
|
return window.addEventListener("pagehide", e), () => window.removeEventListener("pagehide", e);
|
|
220
|
-
}, [
|
|
220
|
+
}, [S]), _(() => {
|
|
221
221
|
if (typeof document > "u" || !U) return;
|
|
222
222
|
let e = () => {
|
|
223
223
|
if (document.visibilityState !== "visible") return;
|
|
224
|
-
let e =
|
|
225
|
-
e.length > 0 && L(),
|
|
224
|
+
let e = S.listVoices();
|
|
225
|
+
e.length > 0 && L(), O(e), he(!1), A((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
|
|
226
226
|
};
|
|
227
227
|
return document.addEventListener("visibilitychange", e), window.addEventListener("focus", e), () => {
|
|
228
228
|
document.removeEventListener("visibilitychange", e), window.removeEventListener("focus", e);
|
|
229
229
|
};
|
|
230
230
|
}, [
|
|
231
231
|
L,
|
|
232
|
-
|
|
232
|
+
S,
|
|
233
233
|
U
|
|
234
234
|
]);
|
|
235
|
-
let
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}, [
|
|
239
|
-
if (!(!R && !B || !
|
|
235
|
+
let De = y(Q);
|
|
236
|
+
_(() => {
|
|
237
|
+
De.current = Q;
|
|
238
|
+
}, [Q]), _(() => {
|
|
239
|
+
if (!(!R && !B || !g || !U)) return p.subscribe((e, n) => {
|
|
240
240
|
let r = e.activeConversationId;
|
|
241
241
|
if (!r || r !== n.activeConversationId) return;
|
|
242
242
|
let i = e.processingByConversationId[r], a = n.processingByConversationId[r];
|
|
243
|
-
if (i?.status !== "complete" || !
|
|
243
|
+
if (i?.status !== "complete" || !le(a?.status)) return;
|
|
244
244
|
let o = i.messageId ?? a?.messageId ?? null;
|
|
245
245
|
if (!o) return;
|
|
246
246
|
let s = e.conversations.find((e) => e.id === r)?.messages.find((e) => e.id === o);
|
|
247
247
|
if (!s || s.role !== "assistant" || t(s) !== B || V.current) return;
|
|
248
|
-
let { text: c } =
|
|
249
|
-
c.trim() &&
|
|
248
|
+
let { text: c } = ue(s.content);
|
|
249
|
+
c.trim() && De.current(o, c, s.metadata?.lang);
|
|
250
250
|
});
|
|
251
251
|
}, [
|
|
252
252
|
R,
|
|
253
253
|
B,
|
|
254
254
|
U,
|
|
255
|
-
|
|
255
|
+
g
|
|
256
256
|
]);
|
|
257
|
-
let
|
|
258
|
-
|
|
259
|
-
K,
|
|
257
|
+
let Oe = v(() => l(D, G.tag), [D, G]), $ = v(() => a(D, G.tag, W[K]), [
|
|
258
|
+
D,
|
|
260
259
|
G,
|
|
261
|
-
|
|
262
|
-
|
|
260
|
+
W,
|
|
261
|
+
K
|
|
262
|
+
]), ke = v(() => ({
|
|
263
263
|
isSupported: U,
|
|
264
|
-
availability:
|
|
265
|
-
isBlocked:
|
|
266
|
-
disabledReason:
|
|
267
|
-
blockedFor:
|
|
268
|
-
voiceChoices:
|
|
269
|
-
spokenChunks:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
speakingMessageId: w.status === "speaking" ? w.messageId : null,
|
|
277
|
-
isSpeaking: (e) => oe(w, e),
|
|
278
|
-
toggle: we,
|
|
264
|
+
availability: J,
|
|
265
|
+
isBlocked: J === "no-voices",
|
|
266
|
+
disabledReason: J === "no-voices" ? C("speech.noVoicesOnDevice", "This device has no speech voices installed. Add one in your device speech or accessibility settings.") : null,
|
|
267
|
+
blockedFor: we,
|
|
268
|
+
voiceChoices: Oe,
|
|
269
|
+
spokenChunks: se(T, N),
|
|
270
|
+
activeVoiceName: $?.name ?? null,
|
|
271
|
+
preferredVoiceName: W[K] ?? null,
|
|
272
|
+
setVoice: (e) => xe(K, e),
|
|
273
|
+
speakingMessageId: T.status === "speaking" ? T.messageId : null,
|
|
274
|
+
isSpeaking: (e) => oe(T, e),
|
|
275
|
+
toggle: Ee,
|
|
279
276
|
stop: X,
|
|
280
277
|
autoSpeakEnabled: R,
|
|
281
278
|
setAutoSpeak: z,
|
|
282
279
|
sessionSpeaking: B,
|
|
283
|
-
setSessionSpeaking:
|
|
280
|
+
setSessionSpeaking: _e,
|
|
284
281
|
setSessionMicOpen: H,
|
|
285
|
-
previewVoice:
|
|
282
|
+
previewVoice: Ce
|
|
286
283
|
}), [
|
|
287
284
|
U,
|
|
288
|
-
|
|
289
|
-
Z,
|
|
290
|
-
Ee,
|
|
291
|
-
De,
|
|
292
|
-
G,
|
|
293
|
-
ye,
|
|
294
|
-
q,
|
|
295
|
-
w,
|
|
285
|
+
J,
|
|
296
286
|
we,
|
|
287
|
+
Oe,
|
|
288
|
+
$,
|
|
289
|
+
W,
|
|
290
|
+
xe,
|
|
291
|
+
K,
|
|
292
|
+
T,
|
|
293
|
+
Ee,
|
|
297
294
|
X,
|
|
298
295
|
R,
|
|
299
296
|
z,
|
|
300
297
|
B,
|
|
301
298
|
H,
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
299
|
+
Ce,
|
|
300
|
+
C,
|
|
301
|
+
N
|
|
305
302
|
]);
|
|
306
|
-
return /* @__PURE__ */ fe(
|
|
307
|
-
value:
|
|
308
|
-
children:
|
|
303
|
+
return /* @__PURE__ */ fe(x.Provider, {
|
|
304
|
+
value: ke,
|
|
305
|
+
children: m
|
|
309
306
|
});
|
|
310
307
|
};
|
|
311
308
|
//#endregion
|
|
312
|
-
export {
|
|
309
|
+
export { C as AssistantSpeechProvider, S as useAssistantSpeech };
|
|
@@ -13,7 +13,7 @@ import { VoiceSessionSnapshot } from '../../voice/voiceSession';
|
|
|
13
13
|
* - listening -> mute (Mic)
|
|
14
14
|
* - muted -> unmute (MicOff)
|
|
15
15
|
* - speaking -> interrupt (Square — the stop glyph, not a microphone)
|
|
16
|
-
* - thinking ->
|
|
16
|
+
* - thinking -> interrupt (Square — stop the answer being generated)
|
|
17
17
|
*
|
|
18
18
|
* Interruption living here is deliberate: it is the biggest target on screen,
|
|
19
19
|
* and it replaced barge-in when the microphone had to be closed during playback
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantVoiceOrb.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/AssistantVoiceOrb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGrE;;;;;;;;;;;;;;;;;;GAkBG;AACH,UAAU,KAAK;IACb,OAAO,EAAE,oBAAoB,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"AssistantVoiceOrb.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/AssistantVoiceOrb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGrE;;;;;;;;;;;;;;;;;;GAkBG;AACH,UAAU,KAAK;IACb,OAAO,EAAE,oBAAoB,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,KAAK,CAkGvC,CAAC"}
|
|
@@ -3,14 +3,14 @@ import { Mic as t, MicOff as n, Square as r } from "lucide-react";
|
|
|
3
3
|
import { jsx as i } from "react/jsx-runtime";
|
|
4
4
|
//#region src/shared/assistant/ui/voice/AssistantVoiceOrb.tsx
|
|
5
5
|
var a = ({ session: a, compact: o = !1, onPress: s, label: c, connecting: l = !1 }) => {
|
|
6
|
-
let u = e(a), { muted: d, phase: f, error: p } = a, m = f === "
|
|
6
|
+
let u = e(a), { muted: d, phase: f, error: p } = a, m = f === "idle" || f === "ended" || p !== null || l, h = d && f !== "speaking" ? "from-bg-elevated to-bg-elevated" : u === "listening" ? "from-action-primary-bg/80 to-action-primary-bg/20" : u === "thinking" ? "from-action-primary-bg/55 to-action-primary-bg/15" : u === "speaking" ? "from-action-primary-bg to-action-primary-bg/40" : "from-bg-elevated to-bg-elevated/40", g = d && f !== "speaking" ? "" : u === "listening" ? "motion-safe:animate-pulse" : u === "thinking" ? "motion-safe:animate-[pulse_1.6s_ease-in-out_infinite]" : u === "speaking" ? "motion-safe:animate-[pulse_0.9s_ease-in-out_infinite]" : "", _ = o ? "h-16 w-40" : "h-24 w-56", v = o ? "size-6" : "size-8", y = f === "speaking" || f === "thinking" ? r : d ? n : t;
|
|
7
7
|
return /* @__PURE__ */ i("button", {
|
|
8
8
|
type: "button",
|
|
9
9
|
onClick: s,
|
|
10
10
|
disabled: m || !s,
|
|
11
11
|
className: `flex ${_} items-center justify-center rounded-full bg-gradient-to-b ${h} ${g} text-text-primary shadow-lg transition-colors duration-300 focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-default`,
|
|
12
12
|
"aria-label": c,
|
|
13
|
-
"aria-pressed": f === "speaking" ? void 0 : d,
|
|
13
|
+
"aria-pressed": f === "speaking" || f === "thinking" ? void 0 : d,
|
|
14
14
|
"data-testid": "assistant-voice-orb",
|
|
15
15
|
"data-state": u,
|
|
16
16
|
"data-muted": d || void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantVoiceSession.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/AssistantVoiceSession.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAI1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantVoiceSession.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/AssistantVoiceSession.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAI1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAW7D,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,gFAAgF;AAChF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAElD,UAAU,KAAK;IACb,OAAO,EAAE,oBAAoB,CAAC;IAC9B,iEAAiE;IACjE,KAAK,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAC3C,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACnC,gEAAgE;IAChE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACpC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IACjD,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0EAA0E;IAC1E,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,4DAA4D;IAC5D,YAAY,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,KAAK,CAukB3C,CAAC"}
|