@burdenoff/fe-libs 2026.1002.2 → 2026.1003.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/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 +117 -114
- 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/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.js +124 -124
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceWaveform.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/VoiceWaveform.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"VoiceWaveform.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/VoiceWaveform.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,UAAU,KAAK;IACb,wDAAwD;IACxD,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4EAA4E;IAC5E,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAID,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,KAAK,CA0CnC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { usePrefersReducedMotion as e } from "../usePrefersReducedMotion.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
3
|
//#region src/shared/assistant/ui/voice/VoiceWaveform.tsx
|
|
3
|
-
var
|
|
4
|
+
var n = [
|
|
4
5
|
0,
|
|
5
6
|
1,
|
|
6
7
|
2,
|
|
@@ -8,38 +9,41 @@ var t = [
|
|
|
8
9
|
4,
|
|
9
10
|
5,
|
|
10
11
|
6
|
|
11
|
-
],
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
12
|
+
], r = ({ active: r, tone: i, settled: a = !1, expanded: o = !1 }) => {
|
|
13
|
+
let s = e();
|
|
14
|
+
return /* @__PURE__ */ t("div", {
|
|
15
|
+
className: `flex items-end justify-center ${o ? "h-8 gap-1.5" : "h-5 gap-1"}`,
|
|
16
|
+
"aria-hidden": "true",
|
|
17
|
+
"data-testid": "assistant-voice-waveform",
|
|
18
|
+
children: n.map((e) => /* @__PURE__ */ t("span", {
|
|
19
|
+
className: [
|
|
20
|
+
"inline-block rounded-full transition-[height,opacity] duration-300",
|
|
21
|
+
o ? "w-1.5" : "w-1",
|
|
22
|
+
i === "speaking" ? "bg-brand-primary" : "bg-text-muted",
|
|
23
|
+
r ? a ? s ? "opacity-70" : "motion-safe:animate-pulse [animation-duration:2.4s] opacity-70" : s ? "" : "motion-safe:animate-pulse" : "opacity-40"
|
|
24
|
+
].join(" "),
|
|
25
|
+
style: {
|
|
26
|
+
height: r ? `${(a ? [
|
|
27
|
+
25,
|
|
28
|
+
40,
|
|
29
|
+
55,
|
|
30
|
+
45,
|
|
31
|
+
55,
|
|
32
|
+
35,
|
|
33
|
+
22
|
|
34
|
+
] : [
|
|
35
|
+
40,
|
|
36
|
+
70,
|
|
37
|
+
100,
|
|
38
|
+
85,
|
|
39
|
+
100,
|
|
40
|
+
60,
|
|
41
|
+
35
|
|
42
|
+
])[e]}%` : "20%",
|
|
43
|
+
animationDelay: `${e * 90}ms`
|
|
44
|
+
}
|
|
45
|
+
}, e))
|
|
46
|
+
});
|
|
47
|
+
};
|
|
44
48
|
//#endregion
|
|
45
|
-
export {
|
|
49
|
+
export { r as VoiceWaveform };
|
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Playback state for the assistant's spoken reply (BOFF-6290).
|
|
3
|
-
*
|
|
4
|
-
* A reducer rather than a pile of `useState` calls, because the awkward part of
|
|
5
|
-
* speech playback is not "is it speaking" — it is that the engine's `end` and
|
|
6
|
-
* `error` events arrive AFTER the state has already moved on:
|
|
7
|
-
*
|
|
8
|
-
* - tapping speak on message B while A is talking cancels A, and A's `end`
|
|
9
|
-
* event lands a tick later. Without a guard it would clear B's speaking state
|
|
10
|
-
* and leave a button that says "stop" next to silence — or worse, silence
|
|
11
|
-
* next to a button that says "speak" while the voice keeps going;
|
|
12
|
-
* - closing the panel cancels playback, and the cancellation itself fires
|
|
13
|
-
* `error` on every queued utterance.
|
|
14
|
-
*
|
|
15
|
-
* Every transition therefore carries a monotonically increasing `requestId`, and
|
|
16
|
-
* a terminal event is only honoured when it belongs to the CURRENT request. That
|
|
17
|
-
* is the whole trick, and it is pure, so it is tested directly (the audio around
|
|
18
|
-
* it is not testable in this repo's node-environment vitest).
|
|
19
|
-
*/
|
|
1
|
+
import { VoiceSessionPhase } from './voiceSession';
|
|
20
2
|
export type SpeechPlaybackState = {
|
|
21
3
|
readonly status: "idle";
|
|
22
4
|
} | {
|
|
@@ -96,4 +78,40 @@ export declare function publishedChunks(state: SpeechPlaybackState, progress: {
|
|
|
96
78
|
chunks: string[];
|
|
97
79
|
index: number;
|
|
98
80
|
} | null;
|
|
81
|
+
/** The caption's chunk progress: what is being spoken, and the one sounding now. */
|
|
82
|
+
export interface CaptionChunks {
|
|
83
|
+
chunks: string[];
|
|
84
|
+
index: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* "The session is speaking, but no audio has started" — chunked, nothing
|
|
88
|
+
* sounding yet. A SINGLE shared value so the hook's memo does not churn.
|
|
89
|
+
*/
|
|
90
|
+
export declare const AWAITING_FIRST_CHUNK: CaptionChunks;
|
|
91
|
+
/** Is this progress "chunked, nothing audible yet"? */
|
|
92
|
+
export declare function isAwaitingFirstChunk(progress: CaptionChunks | null | undefined): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* The progress the LIVE CAPTION may follow (BOFF-8566, L4).
|
|
95
|
+
*
|
|
96
|
+
* ★★ The voice session enters `speaking` the moment the reply ARRIVES
|
|
97
|
+
* (`reply`), and the speech provider only publishes progress once playback has
|
|
98
|
+
* actually STARTED (`publishedChunks` is null while the engine is idle). In the
|
|
99
|
+
* gap between the two the caption saw "no chunk information" and took the
|
|
100
|
+
* documented fallback of rendering the WHOLE reply — so every spoken answer
|
|
101
|
+
* painted all of its text for 1-5 frames under "Speaking", then collapsed to one
|
|
102
|
+
* phrase. Measured on all four production apps (15 of 15 rounds in three).
|
|
103
|
+
*
|
|
104
|
+
* That fallback exists for ONE case: audio IS playing and the engine reports no
|
|
105
|
+
* per-chunk progress (`onChunkStart` is optional). It must not cover "nothing is
|
|
106
|
+
* playing yet", and the two are told apart by playback itself: `speakingMessageId`
|
|
107
|
+
* is non-null exactly while the engine plays. So a speaking session with nothing
|
|
108
|
+
* playing is reported as AWAITING the first chunk, which both captions already
|
|
109
|
+
* render as nothing.
|
|
110
|
+
*
|
|
111
|
+
* The window closes on its own: either playback starts and real progress takes
|
|
112
|
+
* over, or `SPEECH_START_GRACE_MS` hands the turn back and the phase leaves
|
|
113
|
+
* `speaking`. It also covers the trailing frame between playback ending and the
|
|
114
|
+
* session noticing, where the old fallback re-painted the whole reply.
|
|
115
|
+
*/
|
|
116
|
+
export declare function captionChunks(published: CaptionChunks | null, phase: VoiceSessionPhase, speakingMessageId: string | null): CaptionChunks | null;
|
|
99
117
|
//# sourceMappingURL=speechPlayback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechPlayback.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/voice/speechPlayback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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AAE,MAAM,GAAG,IAAI,GAC/B,aAAa,GAAG,IAAI,CAKtB"}
|
|
@@ -30,5 +30,15 @@ function i(e, t) {
|
|
|
30
30
|
index: t.index
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
+
var a = Object.freeze({
|
|
34
|
+
chunks: [],
|
|
35
|
+
index: -1
|
|
36
|
+
});
|
|
37
|
+
function o(e) {
|
|
38
|
+
return e != null && e.index < 0;
|
|
39
|
+
}
|
|
40
|
+
function s(e, t, n) {
|
|
41
|
+
return e || (t === "speaking" && n === null ? a : null);
|
|
42
|
+
}
|
|
33
43
|
//#endregion
|
|
34
|
-
export { e as IDLE_PLAYBACK, n as isSpeakingMessage, i as publishedChunks, r as requiresCancel, t as speechPlaybackReducer };
|
|
44
|
+
export { a as AWAITING_FIRST_CHUNK, e as IDLE_PLAYBACK, s as captionChunks, o as isAwaitingFirstChunk, n as isSpeakingMessage, i as publishedChunks, r as requiresCancel, t as speechPlaybackReducer };
|