@burdenoff/fe-libs 2026.1002.2 → 2026.1003.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/index.d.ts +1 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/prewarm.d.ts +71 -0
- package/dist/shared/assistant/prewarm.d.ts.map +1 -1
- package/dist/shared/assistant/prewarm.js +49 -2
- package/dist/shared/assistant/speech/speechFeed.d.ts +63 -0
- package/dist/shared/assistant/speech/speechFeed.d.ts.map +1 -0
- package/dist/shared/assistant/speech/speechFeed.js +40 -0
- package/dist/shared/assistant/turnTimeline.d.ts +22 -2
- package/dist/shared/assistant/turnTimeline.d.ts.map +1 -1
- package/dist/shared/assistant/turnTimeline.js +18 -1
- package/dist/shared/assistant/turnTimingReport.d.ts.map +1 -1
- package/dist/shared/assistant/turnTimingReport.js +5 -4
- package/dist/shared/assistant/ui/AssistantAvatar.d.ts +0 -21
- package/dist/shared/assistant/ui/AssistantAvatar.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantAvatar.js +13 -7
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +981 -931
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +8 -0
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageItem.js +60 -58
- package/dist/shared/assistant/ui/AssistantSpeechProvider.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +198 -169
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +117 -117
- package/dist/shared/assistant/ui/composer/AssistantVoiceButton.d.ts +8 -0
- package/dist/shared/assistant/ui/composer/AssistantVoiceButton.d.ts.map +1 -1
- package/dist/shared/assistant/ui/composer/AssistantVoiceButton.js +21 -16
- package/dist/shared/assistant/ui/useVoiceSession.d.ts +1 -4
- package/dist/shared/assistant/ui/useVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/useVoiceSession.js +171 -156
- package/dist/shared/assistant/ui/voice/AssistantVoiceOrb.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceOrb.js +16 -15
- package/dist/shared/assistant/ui/voice/VoiceCaption.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/VoiceCaption.js +1 -1
- package/dist/shared/assistant/ui/voice/VoiceMiniController.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/VoiceMiniController.js +35 -30
- package/dist/shared/assistant/ui/voice/VoiceStage.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/VoiceStage.js +38 -37
- package/dist/shared/assistant/ui/voice/VoiceWaveform.d.ts +6 -0
- package/dist/shared/assistant/ui/voice/VoiceWaveform.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/VoiceWaveform.js +40 -36
- package/dist/shared/assistant/voice/speakableText.d.ts +16 -1
- package/dist/shared/assistant/voice/speakableText.d.ts.map +1 -1
- package/dist/shared/assistant/voice/speakableText.js +116 -102
- package/dist/shared/assistant/voice/speechPlayback.d.ts +37 -19
- package/dist/shared/assistant/voice/speechPlayback.d.ts.map +1 -1
- package/dist/shared/assistant/voice/speechPlayback.js +11 -1
- package/dist/shared/assistant/voice/voiceSession.d.ts +12 -0
- package/dist/shared/assistant/voice/voiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceSession.js +6 -0
- package/dist/shared-assistant.js +151 -150
- package/package.json +1 -1
|
@@ -1,163 +1,176 @@
|
|
|
1
1
|
import { useVoiceInput as e } from "../voice/useVoiceInput.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { speechFeed as t } from "../speech/speechFeed.js";
|
|
3
|
+
import { INITIAL_SESSION as n, INTERRUPT_MAX_MS as ee, NOTHING_HEARD as r, SILENCE_SUBMIT_MS as te, advanceHeardClock as ne, isCapturing as i, isSubmittable as re, planListeningHold as ie, planReplyConsumption as ae, planVoiceAnnouncement as oe, spokenSoFar as a, voiceSessionReducer as se } from "../voice/voiceSession.js";
|
|
4
|
+
import { captionChunks as ce } from "../voice/speechPlayback.js";
|
|
5
|
+
import { turnClockMs as o } from "../turnTimeline.js";
|
|
6
|
+
import { useAssistantSpeech as le } from "./AssistantSpeechProvider.js";
|
|
7
|
+
import { useCallback as s, useEffect as c, useLayoutEffect as ue, useMemo as de, useReducer as fe, useRef as l, useState as u } from "react";
|
|
6
8
|
//#region src/shared/assistant/ui/useVoiceSession.ts
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, [
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
}, []),
|
|
9
|
+
var pe = 4e3, me = 2500, he = 5e3, ge = 12e3, _e = "data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA=";
|
|
10
|
+
function d({ onSubmit: d, latestReply: f, language: ve }) {
|
|
11
|
+
let p = l(null), [m, h] = fe(s((e, t) => se(e, t, p.current), []), n), g = le(), { setSessionSpeaking: _, setSessionMicOpen: v, speakingMessageId: y, stop: b } = g, x = l(g.toggle), S = g.toggle;
|
|
12
|
+
ue(() => {
|
|
13
|
+
x.current = S;
|
|
14
|
+
}, [S]);
|
|
15
|
+
let C = l(null), w = l({}), T = l(r), E = l(null), D = l(!1), O = l(null), [k, A] = u(null), [j, M] = u(!1), [N, P] = u(!1), F = l(m);
|
|
16
|
+
F.current = m;
|
|
17
|
+
let I = l([]), L = l(null), R = l(!1), z = s(() => {
|
|
18
|
+
I.current = [], L.current = null, R.current = !1;
|
|
19
|
+
}, []), B = s(() => {
|
|
18
20
|
for (;;) {
|
|
19
|
-
let e =
|
|
21
|
+
let e = I.current.shift();
|
|
20
22
|
if (!e) return !1;
|
|
21
23
|
if (!(e.stillWanted && !e.stillWanted())) {
|
|
22
|
-
|
|
24
|
+
L.current = e, p.current = p.current ? `${p.current} ${e.text}` : e.text;
|
|
23
25
|
try {
|
|
24
|
-
|
|
26
|
+
x.current(e.id, e.text, e.lang);
|
|
25
27
|
} catch {
|
|
26
|
-
|
|
28
|
+
L.current = null;
|
|
27
29
|
continue;
|
|
28
30
|
}
|
|
29
31
|
return !0;
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
|
-
}, []),
|
|
34
|
+
}, []), V = l(!1), H = s((e) => {
|
|
33
35
|
let t = ie({
|
|
34
36
|
requested: e,
|
|
35
|
-
held:
|
|
36
|
-
muted:
|
|
37
|
+
held: V.current,
|
|
38
|
+
muted: F.current.muted
|
|
37
39
|
});
|
|
38
|
-
|
|
40
|
+
V.current = t.held, t.mute !== null && h({
|
|
39
41
|
type: "mute",
|
|
40
42
|
muted: t.mute
|
|
41
43
|
});
|
|
42
|
-
}, []),
|
|
43
|
-
let t = oe(
|
|
44
|
-
t !== "drop" && (
|
|
45
|
-
}, []),
|
|
46
|
-
if (
|
|
47
|
-
|
|
44
|
+
}, []), U = s((e) => {
|
|
45
|
+
let t = oe(F.current);
|
|
46
|
+
t !== "drop" && (L.current?.id === e.id || I.current.some((t) => t.id === e.id) || (I.current.push(e), t === "start" && !R.current && (R.current = !0, h({ type: "announce" }))));
|
|
47
|
+
}, []), W = s((e) => {
|
|
48
|
+
if (F.current.phase !== "thinking") {
|
|
49
|
+
U(e);
|
|
48
50
|
return;
|
|
49
51
|
}
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
|
|
53
|
-
if (
|
|
54
|
-
|
|
52
|
+
I.current.push(e), R.current = !0, h({ type: "answered-locally" });
|
|
53
|
+
}, [U]), G = l(f);
|
|
54
|
+
G.current = f, c(() => {
|
|
55
|
+
if (m.phase === "speaking") {
|
|
56
|
+
let e = O.current;
|
|
57
|
+
p.current = e && E.current === e.id && f?.id !== e.id ? e.text : f?.text ?? null;
|
|
55
58
|
return;
|
|
56
59
|
}
|
|
57
|
-
if (
|
|
60
|
+
if (p.current === null) return;
|
|
58
61
|
let e = setTimeout(() => {
|
|
59
|
-
|
|
60
|
-
},
|
|
62
|
+
p.current = null;
|
|
63
|
+
}, me);
|
|
61
64
|
return () => clearTimeout(e);
|
|
62
|
-
}, [
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
+
}, [m.phase, f]);
|
|
66
|
+
let K = s((e, t) => {
|
|
67
|
+
h({
|
|
65
68
|
type: "speech",
|
|
66
69
|
transcript: e,
|
|
67
70
|
final: t
|
|
68
71
|
});
|
|
69
|
-
}, []),
|
|
70
|
-
|
|
71
|
-
}, [
|
|
72
|
-
onFinalize:
|
|
73
|
-
language:
|
|
72
|
+
}, []), q = l(0), J = s(() => {
|
|
73
|
+
z(), b(), q.current = Date.now(), M(!0), h({ type: "interrupt" });
|
|
74
|
+
}, [b, z]), Y = e({
|
|
75
|
+
onFinalize: s((e) => K(e, !0), [K]),
|
|
76
|
+
language: ve
|
|
74
77
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
if (
|
|
79
|
-
let e = setTimeout(() =>
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
speechEnded:
|
|
78
|
+
c(() => {
|
|
79
|
+
Y.interim && K(Y.interim, !1);
|
|
80
|
+
}, [Y.interim, K]), c(() => {
|
|
81
|
+
if (C.current && clearTimeout(C.current), P(!1), T.current = ne(T.current, m, o()), m.phase !== "listening" || m.muted || !re(a(m))) return;
|
|
82
|
+
let e = setTimeout(() => P(!0), 800), t = o();
|
|
83
|
+
return C.current = setTimeout(() => {
|
|
84
|
+
w.current = {
|
|
85
|
+
speechEnded: T.current.at ?? t,
|
|
83
86
|
graceStarted: t,
|
|
84
|
-
graceEnded:
|
|
85
|
-
},
|
|
87
|
+
graceEnded: o()
|
|
88
|
+
}, h({ type: "silence" });
|
|
86
89
|
}, te), () => {
|
|
87
|
-
clearTimeout(e),
|
|
90
|
+
clearTimeout(e), C.current && clearTimeout(C.current);
|
|
88
91
|
};
|
|
89
|
-
}, [
|
|
90
|
-
if (!
|
|
91
|
-
let e = Date.now() -
|
|
92
|
+
}, [m]), c(() => {
|
|
93
|
+
if (!j) return;
|
|
94
|
+
let e = Date.now() - q.current, t = Y.isListening ? Math.max(0, 500 - e) : Math.max(0, ee - e), n = setTimeout(() => M(!1), t);
|
|
92
95
|
return () => clearTimeout(n);
|
|
93
|
-
}, [
|
|
94
|
-
let
|
|
95
|
-
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
let e =
|
|
99
|
-
e &&
|
|
100
|
-
}, [
|
|
101
|
-
let e = ae(
|
|
102
|
-
e.claim && (
|
|
96
|
+
}, [j, Y.isListening]);
|
|
97
|
+
let X = l("");
|
|
98
|
+
m.phase === "listening" && (X.current = a(m)), c(() => {
|
|
99
|
+
if (m.phase !== "thinking") return;
|
|
100
|
+
v(!1), z();
|
|
101
|
+
let e = X.current.trim();
|
|
102
|
+
e && d(e, Z.current ?? `vs-orphan-${Date.now().toString(36)}`, w.current), w.current = {}, T.current = r;
|
|
103
|
+
}, [m.phase]), c(() => {
|
|
104
|
+
let e = ae(f?.id, m.phase, E.current);
|
|
105
|
+
e.claim && (E.current = f?.id ?? null, e.advance && f && h({
|
|
103
106
|
type: "reply",
|
|
104
|
-
text:
|
|
107
|
+
text: f.text
|
|
108
|
+
}));
|
|
109
|
+
}, [f, m.phase]), c(() => {
|
|
110
|
+
if (y === null || m.phase !== "thinking" || E.current === y) return;
|
|
111
|
+
let e = t.peek(y);
|
|
112
|
+
!e || e.channel !== "voice" || e.voiceSessionId === void 0 || e.voiceSessionId !== Z.current || (E.current = y, O.current = {
|
|
113
|
+
id: y,
|
|
114
|
+
text: e.text
|
|
115
|
+
}, h({
|
|
116
|
+
type: "reply-audio-started",
|
|
117
|
+
replyId: y
|
|
105
118
|
}));
|
|
106
|
-
}, [
|
|
107
|
-
let e =
|
|
108
|
-
|
|
109
|
-
}, [
|
|
110
|
-
|
|
111
|
-
}, [
|
|
112
|
-
if (
|
|
119
|
+
}, [y, m.phase]), c(() => {
|
|
120
|
+
let e = y !== null;
|
|
121
|
+
D.current && !e && (L.current = null, (F.current.phase !== "speaking" || !B()) && h({ type: "speech-ended" })), D.current = e;
|
|
122
|
+
}, [y, B]), c(() => {
|
|
123
|
+
m.phase !== "listening" && A((e) => e === "nothing-heard" ? null : e);
|
|
124
|
+
}, [m.phase]), c(() => {
|
|
125
|
+
if (m.phase !== "speaking" || y !== null) return;
|
|
113
126
|
let e = setTimeout(() => {
|
|
114
|
-
|
|
115
|
-
},
|
|
127
|
+
D.current || (z(), h({ type: "speech-ended" }));
|
|
128
|
+
}, pe);
|
|
116
129
|
return () => clearTimeout(e);
|
|
117
130
|
}, [
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
]),
|
|
122
|
-
let e =
|
|
123
|
-
|
|
131
|
+
m.phase,
|
|
132
|
+
y,
|
|
133
|
+
z
|
|
134
|
+
]), c(() => {
|
|
135
|
+
let e = i(m);
|
|
136
|
+
v(e), e ? Y.isActive || Y.start("auto") : Y.isActive && Y.stop();
|
|
124
137
|
}, [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
]),
|
|
129
|
-
|
|
130
|
-
}, [
|
|
131
|
-
|
|
138
|
+
m,
|
|
139
|
+
Y,
|
|
140
|
+
v
|
|
141
|
+
]), c(() => {
|
|
142
|
+
m.phase !== "speaking" || !R.current || (R.current = !1, B() || h({ type: "speech-ended" }));
|
|
143
|
+
}, [m.phase, B]), c(() => {
|
|
144
|
+
Y.error === "not-allowed" || Y.error === "audio-capture" ? h({
|
|
132
145
|
type: "fail",
|
|
133
146
|
error: "mic-denied"
|
|
134
|
-
}) :
|
|
147
|
+
}) : Y.error === "language-not-supported" ? h({
|
|
135
148
|
type: "fail",
|
|
136
149
|
error: "no-speech-support"
|
|
137
|
-
}) :
|
|
138
|
-
}, [
|
|
139
|
-
|
|
140
|
-
}, [
|
|
141
|
-
if (
|
|
142
|
-
let e = setTimeout(() =>
|
|
150
|
+
}) : Y.error === "network" ? A("network") : Y.error === "unknown" && A("recognition-failed");
|
|
151
|
+
}, [Y.error]), c(() => {
|
|
152
|
+
Y.error !== null || !Y.isListening || A((e) => e === "network" || e === "recognition-failed" ? null : e);
|
|
153
|
+
}, [Y.error, Y.isListening]), c(() => {
|
|
154
|
+
if (Y.isListening && A((e) => e === "not-capturing" ? null : e), !i(m) || Y.isListening) return;
|
|
155
|
+
let e = setTimeout(() => A("not-capturing"), he);
|
|
143
156
|
return () => clearTimeout(e);
|
|
144
|
-
}, [
|
|
145
|
-
if (
|
|
146
|
-
let e = setTimeout(() =>
|
|
157
|
+
}, [m, Y.isListening]), c(() => {
|
|
158
|
+
if (m.phase !== "listening" || m.muted || !Y.isListening || a(m) !== "") return;
|
|
159
|
+
let e = setTimeout(() => A("nothing-heard"), ge);
|
|
147
160
|
return () => clearTimeout(e);
|
|
148
|
-
}, [
|
|
149
|
-
|
|
150
|
-
}, [
|
|
151
|
-
let
|
|
152
|
-
if (
|
|
153
|
-
|
|
161
|
+
}, [m, Y.isListening]), c(() => {
|
|
162
|
+
a(m) !== "" && A(null);
|
|
163
|
+
}, [m]);
|
|
164
|
+
let Z = l(null), Q = s(() => {
|
|
165
|
+
if (M(!1), P(!1), z(), V.current = !1, !Y.isSupported) {
|
|
166
|
+
h({
|
|
154
167
|
type: "fail",
|
|
155
168
|
error: "no-speech-support"
|
|
156
169
|
});
|
|
157
170
|
return;
|
|
158
171
|
}
|
|
159
|
-
if (
|
|
160
|
-
|
|
172
|
+
if (g.isBlocked) {
|
|
173
|
+
h({
|
|
161
174
|
type: "fail",
|
|
162
175
|
error: "no-voice-support"
|
|
163
176
|
});
|
|
@@ -172,65 +185,67 @@ function u({ onSubmit: u, latestReply: d, language: _e }) {
|
|
|
172
185
|
} catch {}
|
|
173
186
|
try {
|
|
174
187
|
if (typeof window < "u" && typeof window.Audio == "function") {
|
|
175
|
-
let e = new window.Audio(
|
|
188
|
+
let e = new window.Audio(_e);
|
|
176
189
|
e.volume = 0, e.play().catch(() => {});
|
|
177
190
|
}
|
|
178
191
|
} catch {}
|
|
179
|
-
|
|
192
|
+
_(!0), A(null), E.current = G.current?.id ?? null, O.current = null, Z.current = `vs-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`, h({ type: "start" });
|
|
180
193
|
}, [
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
]),
|
|
186
|
-
|
|
194
|
+
Y.isSupported,
|
|
195
|
+
g.isBlocked,
|
|
196
|
+
_,
|
|
197
|
+
z
|
|
198
|
+
]), $ = s(() => {
|
|
199
|
+
M(!1), P(!1), z(), V.current = !1, Z.current = null, h({ type: "end" }), b(), _(!1);
|
|
187
200
|
}, [
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
]),
|
|
192
|
-
|
|
201
|
+
b,
|
|
202
|
+
_,
|
|
203
|
+
z
|
|
204
|
+
]), ye = s((e) => Z.current === e, []), be = s(() => {
|
|
205
|
+
h({
|
|
193
206
|
type: "mute",
|
|
194
|
-
muted: !
|
|
207
|
+
muted: !F.current.muted
|
|
195
208
|
});
|
|
196
209
|
}, []);
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}, [
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
210
|
+
c(() => () => {
|
|
211
|
+
_(!1), v(!1);
|
|
212
|
+
}, [_, v]);
|
|
213
|
+
let xe = ce(g.spokenChunks, m.phase, y);
|
|
214
|
+
return de(() => ({
|
|
215
|
+
session: m,
|
|
216
|
+
notice: k,
|
|
217
|
+
spokenChunks: xe,
|
|
218
|
+
capturing: Y.isListening,
|
|
219
|
+
active: m.phase !== "idle" && (m.phase !== "ended" || m.error !== null),
|
|
220
|
+
interrupting: j,
|
|
221
|
+
awaitingEndpoint: N,
|
|
222
|
+
available: Y.isSupported && !g.isBlocked,
|
|
223
|
+
start: Q,
|
|
224
|
+
end: $,
|
|
225
|
+
isCurrentSession: ye,
|
|
226
|
+
toggleMute: be,
|
|
227
|
+
interrupt: J,
|
|
228
|
+
announce: U,
|
|
229
|
+
holdListening: H,
|
|
230
|
+
answerLocally: W
|
|
216
231
|
}), [
|
|
217
|
-
|
|
218
|
-
D,
|
|
232
|
+
m,
|
|
219
233
|
k,
|
|
220
234
|
j,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
Z,
|
|
235
|
+
N,
|
|
236
|
+
Y.isListening,
|
|
237
|
+
Y.isSupported,
|
|
238
|
+
g.isBlocked,
|
|
239
|
+
xe,
|
|
227
240
|
Q,
|
|
228
241
|
$,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
242
|
+
ye,
|
|
243
|
+
be,
|
|
244
|
+
J,
|
|
245
|
+
U,
|
|
246
|
+
H,
|
|
247
|
+
W
|
|
233
248
|
]);
|
|
234
249
|
}
|
|
235
250
|
//#endregion
|
|
236
|
-
export {
|
|
251
|
+
export { d as useVoiceSession };
|
|
@@ -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;
|
|
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;AAIrE;;;;;;;;;;;;;;;;;;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,CAsGvC,CAAC"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { orbMode as e } from "../../voice/voiceSession.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { usePrefersReducedMotion as t } from "../usePrefersReducedMotion.js";
|
|
3
|
+
import { Mic as n, MicOff as r, Square as i } from "lucide-react";
|
|
4
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
5
|
//#region src/shared/assistant/ui/voice/AssistantVoiceOrb.tsx
|
|
5
|
-
var
|
|
6
|
-
let
|
|
7
|
-
return /* @__PURE__ */
|
|
6
|
+
var o = ({ session: o, compact: s = !1, onPress: c, label: l, connecting: u = !1 }) => {
|
|
7
|
+
let d = e(o), f = t(), { muted: p, phase: m, error: h } = o, g = m === "idle" || m === "ended" || h !== null || u, _ = p && m !== "speaking" ? "from-bg-elevated to-bg-elevated" : d === "listening" ? "from-action-primary-bg/80 to-action-primary-bg/20" : d === "thinking" ? "from-action-primary-bg/55 to-action-primary-bg/15" : d === "speaking" ? "from-action-primary-bg to-action-primary-bg/40" : "from-bg-elevated to-bg-elevated/40", v = f || p && m !== "speaking" ? "" : d === "listening" ? "motion-safe:animate-pulse" : d === "thinking" ? "motion-safe:animate-[pulse_1.6s_ease-in-out_infinite]" : d === "speaking" ? "motion-safe:animate-[pulse_0.9s_ease-in-out_infinite]" : "", y = s ? "h-16 w-40" : "h-24 w-56", b = s ? "size-6" : "size-8", x = m === "speaking" || m === "thinking" ? i : p ? r : n;
|
|
8
|
+
return /* @__PURE__ */ a("button", {
|
|
8
9
|
type: "button",
|
|
9
|
-
onClick:
|
|
10
|
-
disabled:
|
|
11
|
-
className: `flex ${
|
|
12
|
-
"aria-label":
|
|
13
|
-
"aria-pressed":
|
|
10
|
+
onClick: c,
|
|
11
|
+
disabled: g || !c,
|
|
12
|
+
className: `flex ${y} items-center justify-center rounded-full bg-gradient-to-b ${_} ${v} text-text-primary shadow-lg transition-colors duration-300 focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-default`,
|
|
13
|
+
"aria-label": l,
|
|
14
|
+
"aria-pressed": m === "speaking" || m === "thinking" ? void 0 : p,
|
|
14
15
|
"data-testid": "assistant-voice-orb",
|
|
15
|
-
"data-state":
|
|
16
|
-
"data-muted":
|
|
17
|
-
children: /* @__PURE__ */
|
|
18
|
-
className:
|
|
16
|
+
"data-state": d,
|
|
17
|
+
"data-muted": p || void 0,
|
|
18
|
+
children: /* @__PURE__ */ a(x, {
|
|
19
|
+
className: b,
|
|
19
20
|
"aria-hidden": "true"
|
|
20
21
|
})
|
|
21
22
|
});
|
|
22
23
|
};
|
|
23
24
|
//#endregion
|
|
24
|
-
export {
|
|
25
|
+
export { o as AssistantVoiceOrb };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceCaption.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/VoiceCaption.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,mDAAmD;IACnD,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"VoiceCaption.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/VoiceCaption.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,mDAAmD;IACnD,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,KAAK,CAwKlC,CAAC"}
|
|
@@ -16,7 +16,7 @@ var r = "data-caption-scroll", i = ({ text: i, role: a, expanded: o, spokenChunk
|
|
|
16
16
|
className: [
|
|
17
17
|
"w-full whitespace-pre-wrap break-words text-left",
|
|
18
18
|
o ? "max-w-[45rem]" : "max-w-md",
|
|
19
|
-
u ? "font-semibold text-text-primary" : "font-
|
|
19
|
+
u ? "font-semibold text-text-primary" : "font-semibold text-text-secondary",
|
|
20
20
|
u ? o ? "text-[clamp(1.625rem,2.5vw,2.25rem)] leading-[1.5]" : "text-[clamp(1.625rem,2vw,2rem)] leading-[1.5]" : o ? "text-[clamp(1.125rem,1.8vw,1.375rem)] leading-[1.5]" : "text-base leading-relaxed"
|
|
21
21
|
].join(" "),
|
|
22
22
|
role: "status",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceMiniController.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/VoiceMiniController.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"VoiceMiniController.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/VoiceMiniController.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAK3C,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AAEH,UAAU,KAAK;IACb,KAAK,EAAE,eAAe,CAAC;IACvB,uEAAuE;IACvE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mEAAmE;IACnE,OAAO,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,KAAK,CA8HzC,CAAC"}
|
|
@@ -1,56 +1,61 @@
|
|
|
1
1
|
import { showsAssistantCaption as e, waveformIsActive as t, waveformIsSettled as n } from "../../voice/voiceStageState.js";
|
|
2
2
|
import { showPreviousChunk as r } from "../../voice/miniCaptionBudget.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { isAwaitingFirstChunk as i } from "../../voice/speechPlayback.js";
|
|
4
|
+
import { VoiceWaveform as a } from "./VoiceWaveform.js";
|
|
5
|
+
import { VoiceStatusText as o } from "./VoiceStatusText.js";
|
|
6
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
7
|
//#region src/shared/assistant/ui/voice/VoiceMiniController.tsx
|
|
7
|
-
var
|
|
8
|
-
let
|
|
9
|
-
return /* @__PURE__ */
|
|
8
|
+
var u = ({ state: u, caption: d, spokenChunks: f = null, statusText: p, statusSuffix: m, rotateStatus: h, control: g, errorText: _ = null }) => {
|
|
9
|
+
let v = e(u), y = v && f && f.index >= 0 ? f : null, b = v && i(f);
|
|
10
|
+
return /* @__PURE__ */ l("div", {
|
|
10
11
|
className: "flex min-h-0 w-full flex-1 items-center gap-3 px-4",
|
|
11
12
|
"data-testid": "assistant-voice-mini",
|
|
12
|
-
"data-state":
|
|
13
|
-
children: [/* @__PURE__ */
|
|
13
|
+
"data-state": u,
|
|
14
|
+
children: [/* @__PURE__ */ l("div", {
|
|
14
15
|
className: "flex min-w-0 flex-1 flex-col gap-1.5",
|
|
15
|
-
children: [/* @__PURE__ */
|
|
16
|
+
children: [/* @__PURE__ */ l("div", {
|
|
16
17
|
className: "flex items-center gap-2",
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
-
active: t(
|
|
19
|
-
settled: n(
|
|
20
|
-
tone:
|
|
21
|
-
}), /* @__PURE__ */
|
|
18
|
+
children: [/* @__PURE__ */ c(a, {
|
|
19
|
+
active: t(u),
|
|
20
|
+
settled: n(u),
|
|
21
|
+
tone: u === "speaking" ? "speaking" : "listening"
|
|
22
|
+
}), /* @__PURE__ */ c(o, {
|
|
22
23
|
className: "truncate text-xs text-text-muted",
|
|
23
|
-
status:
|
|
24
|
-
suffix:
|
|
25
|
-
rotating:
|
|
24
|
+
status: p,
|
|
25
|
+
suffix: m,
|
|
26
|
+
rotating: h
|
|
26
27
|
})]
|
|
27
|
-
}),
|
|
28
|
+
}), u === "mic-error" ? /* @__PURE__ */ c("p", {
|
|
28
29
|
className: "line-clamp-2 text-xs text-status-warning",
|
|
29
30
|
role: "alert",
|
|
30
31
|
"data-testid": "assistant-voice-mini-error",
|
|
31
|
-
children:
|
|
32
|
-
}) :
|
|
33
|
-
className: [
|
|
32
|
+
children: _
|
|
33
|
+
}) : d ? /* @__PURE__ */ c("p", {
|
|
34
|
+
className: [
|
|
35
|
+
"line-clamp-3 break-words text-left text-sm leading-snug",
|
|
36
|
+
b ? "min-h-9" : "",
|
|
37
|
+
v ? "font-semibold text-text-primary" : "font-semibold text-text-secondary"
|
|
38
|
+
].join(" "),
|
|
34
39
|
role: "status",
|
|
35
40
|
"aria-live": "polite",
|
|
36
41
|
"data-testid": "assistant-voice-caption",
|
|
37
|
-
children:
|
|
42
|
+
children: y ? /* @__PURE__ */ l(s, { children: [r(y) ? /* @__PURE__ */ l("span", {
|
|
38
43
|
className: "text-text-muted transition-colors duration-300",
|
|
39
|
-
children: [
|
|
40
|
-
}) : null, /* @__PURE__ */
|
|
44
|
+
children: [y.chunks[y.index - 1], " "]
|
|
45
|
+
}) : null, /* @__PURE__ */ c("span", {
|
|
41
46
|
className: "text-text-primary",
|
|
42
47
|
"data-testid": "assistant-voice-caption-current",
|
|
43
|
-
children:
|
|
44
|
-
})] }) :
|
|
45
|
-
}) : /* @__PURE__ */
|
|
48
|
+
children: y.chunks[y.index]
|
|
49
|
+
})] }) : b ? null : d
|
|
50
|
+
}) : /* @__PURE__ */ c("div", {
|
|
46
51
|
className: "h-9",
|
|
47
52
|
"aria-hidden": "true"
|
|
48
53
|
})]
|
|
49
|
-
}), /* @__PURE__ */
|
|
54
|
+
}), /* @__PURE__ */ c("div", {
|
|
50
55
|
className: "shrink-0",
|
|
51
|
-
children:
|
|
56
|
+
children: g
|
|
52
57
|
})]
|
|
53
58
|
});
|
|
54
59
|
};
|
|
55
60
|
//#endregion
|
|
56
|
-
export {
|
|
61
|
+
export { u as VoiceMiniController };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceStage.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/VoiceStage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"VoiceStage.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/VoiceStage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAK3C,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AAEH,UAAU,KAAK;IACb,KAAK,EAAE,eAAe,CAAC;IACvB,mDAAmD;IACnD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,oCAAoC;IACpC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0CAA0C;IAC1C,OAAO,EAAE,SAAS,CAAC;IACnB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,+EAA+E;IAC/E,YAAY,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC3D;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,KAAK,CA6IhC,CAAC"}
|