@burdenoff/fe-libs 2026.1029.6 → 2026.1029.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/shared/assistant/index.d.ts +5 -0
- package/dist/shared/assistant/liveDeltas.d.ts +3 -0
- package/dist/shared/assistant/liveDeltas.js +17 -1
- package/dist/shared/assistant/liveOverlay.d.ts +4 -0
- package/dist/shared/assistant/liveOverlay.js +10 -1
- package/dist/shared/assistant/speech/appendSpeechQueue.d.ts +13 -0
- package/dist/shared/assistant/speech/appendSpeechQueue.js +75 -0
- package/dist/shared/assistant/speech/browserSpeechEngine.js +93 -46
- package/dist/shared/assistant/speech/hostedTtsSpeechEngine.js +173 -109
- package/dist/shared/assistant/speech/index.d.ts +1 -1
- package/dist/shared/assistant/speech/notifyCancellationSpeechEngine.js +53 -0
- package/dist/shared/assistant/speech/routingSpeechEngine.js +107 -23
- package/dist/shared/assistant/speech/speechFeed.d.ts +17 -2
- package/dist/shared/assistant/speech/speechFeed.js +35 -12
- package/dist/shared/assistant/speech/types.d.ts +20 -1
- package/dist/shared/assistant/turnTimeline.d.ts +3 -0
- package/dist/shared/assistant/turnTimeline.js +4 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +1410 -1393
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +351 -291
- package/dist/shared/assistant/ui/useVoiceSession.js +323 -288
- package/dist/shared/assistant/voice/livePhraseSpeech.d.ts +14 -0
- package/dist/shared/assistant/voice/livePhraseSpeech.js +72 -0
- package/dist/shared/assistant/voice/phraseGate.d.ts +11 -0
- package/dist/shared/assistant/voice/phraseGate.js +74 -0
- package/dist/shared/assistant/voice/phrasePlayback.d.ts +9 -0
- package/dist/shared/assistant/voice/phrasePlayback.js +78 -0
- package/dist/shared/assistant/voice/phraseSpeechConfig.d.ts +5 -0
- package/dist/shared/assistant/voice/phraseSpeechConfig.js +10 -0
- package/dist/shared/assistant/voice/speakableText.d.ts +1 -0
- package/dist/shared/assistant/voice/speakableText.js +1 -1
- package/dist/shared/assistant/voice/voiceSession.d.ts +5 -0
- package/dist/shared/assistant/voice/voiceSession.js +17 -1
- package/dist/shared-assistant.js +293 -288
- package/package.json +1 -1
|
@@ -34,13 +34,25 @@ export interface SpeechFeedItem {
|
|
|
34
34
|
text: string;
|
|
35
35
|
/** The turn's reply language, stamped on the message as `metadata.lang`. */
|
|
36
36
|
lang?: string | undefined;
|
|
37
|
-
/**
|
|
38
|
-
final:
|
|
37
|
+
/** False only for opted-in S7 text already written to the live overlay. */
|
|
38
|
+
final: boolean;
|
|
39
39
|
}
|
|
40
40
|
export type SpeechFeedEvent = {
|
|
41
41
|
type: 'publish';
|
|
42
42
|
messageId: string;
|
|
43
43
|
item: SpeechFeedItem;
|
|
44
|
+
} | {
|
|
45
|
+
type: 'append';
|
|
46
|
+
messageId: string;
|
|
47
|
+
item: SpeechFeedItem;
|
|
48
|
+
phrases: readonly string[];
|
|
49
|
+
} | {
|
|
50
|
+
type: 'retract';
|
|
51
|
+
messageId: string;
|
|
52
|
+
} | {
|
|
53
|
+
type: 'audio';
|
|
54
|
+
messageId: string;
|
|
55
|
+
state: 'queued' | 'started' | 'paused' | 'ended';
|
|
44
56
|
} | {
|
|
45
57
|
type: 'abort';
|
|
46
58
|
messageId: string;
|
|
@@ -48,6 +60,9 @@ export type SpeechFeedEvent = {
|
|
|
48
60
|
type Listener = (event: SpeechFeedEvent) => void;
|
|
49
61
|
export declare const speechFeed: {
|
|
50
62
|
publish(messageId: string, item: SpeechFeedItem): void;
|
|
63
|
+
append(messageId: string, item: SpeechFeedItem, phrases: readonly string[]): void;
|
|
64
|
+
retract(messageId: string): void;
|
|
65
|
+
audio(messageId: string, state: "queued" | "started" | "paused" | "ended"): void;
|
|
51
66
|
/** Forget a published message and tell the subscriber to stop speaking it. */
|
|
52
67
|
abort(messageId: string): void;
|
|
53
68
|
subscribe(listener: Listener): () => void;
|
|
@@ -5,17 +5,40 @@ function r(e) {
|
|
|
5
5
|
n(e);
|
|
6
6
|
} catch {}
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
function i(t, r) {
|
|
9
|
+
for (n.delete(t), n.set(t, r); n.size > e;) {
|
|
10
|
+
let e = n.keys().next();
|
|
11
|
+
if (e.done) break;
|
|
12
|
+
n.delete(e.value);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
var a = {
|
|
16
|
+
publish(e, t) {
|
|
17
|
+
i(e, t), r({
|
|
16
18
|
type: "publish",
|
|
17
|
-
messageId:
|
|
18
|
-
item:
|
|
19
|
+
messageId: e,
|
|
20
|
+
item: t
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
append(e, t, n) {
|
|
24
|
+
i(e, t), r({
|
|
25
|
+
type: "append",
|
|
26
|
+
messageId: e,
|
|
27
|
+
item: t,
|
|
28
|
+
phrases: n
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
retract(e) {
|
|
32
|
+
r({
|
|
33
|
+
type: "retract",
|
|
34
|
+
messageId: e
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
audio(e, t) {
|
|
38
|
+
r({
|
|
39
|
+
type: "audio",
|
|
40
|
+
messageId: e,
|
|
41
|
+
state: t
|
|
19
42
|
});
|
|
20
43
|
},
|
|
21
44
|
abort(e) {
|
|
@@ -33,8 +56,8 @@ var i = {
|
|
|
33
56
|
return n.get(e);
|
|
34
57
|
}
|
|
35
58
|
};
|
|
36
|
-
function
|
|
59
|
+
function o() {
|
|
37
60
|
t.clear(), n.clear();
|
|
38
61
|
}
|
|
39
62
|
//#endregion
|
|
40
|
-
export {
|
|
63
|
+
export { o as resetSpeechFeedForTest, a as speechFeed };
|
|
@@ -157,8 +157,14 @@ export interface SpeechOutputRefusal {
|
|
|
157
157
|
* played on the speakers. Only the live avatar's engine decorator reports it,
|
|
158
158
|
* and nothing re-speaks it.
|
|
159
159
|
*/
|
|
160
|
-
export type SpeechErrorReason = 'cancelled' | 'not-allowed' | 'unsupported' | 'unknown' | 'output-not-cleared' | 'output-left';
|
|
160
|
+
export type SpeechErrorReason = 'rate-limited' | 'cancelled' | 'not-allowed' | 'unsupported' | 'unknown' | 'output-not-cleared' | 'output-left';
|
|
161
161
|
export interface SpeechSpeakHandlers {
|
|
162
|
+
/** An open queue drained for now, but its producer has not ended it. */
|
|
163
|
+
onPause?: () => void;
|
|
164
|
+
/** Unplayed indices withdrawn by a tool start or a changed source message. */
|
|
165
|
+
onRetract?: (indices: readonly number[]) => void;
|
|
166
|
+
/** A piece finished; a bounded producer may append more. */
|
|
167
|
+
onChunkEnd?: (index: number) => void;
|
|
162
168
|
/**
|
|
163
169
|
* Audio has actually begun playing — not merely been requested.
|
|
164
170
|
*
|
|
@@ -204,6 +210,8 @@ export interface SpeechSpeakHandlers {
|
|
|
204
210
|
onDeviceFallback?: () => void;
|
|
205
211
|
}
|
|
206
212
|
export interface SpeechEngine {
|
|
213
|
+
/** Optional: engines/decorators without it retain completed-answer speech. */
|
|
214
|
+
open?(options: SpeechSpeakOptions, handlers?: SpeechSpeakHandlers): SpeechQueue;
|
|
207
215
|
/** Stable id, for logging and for telling engines apart in a future swap. */
|
|
208
216
|
readonly id: string;
|
|
209
217
|
/** False when the platform has no usable speech output at all. */
|
|
@@ -226,3 +234,14 @@ export interface SpeechEngine {
|
|
|
226
234
|
*/
|
|
227
235
|
wouldSpeakOnAvatar?(options: SpeechSpeakOptions): boolean;
|
|
228
236
|
}
|
|
237
|
+
/** One reply. Appends never pre-empt the piece currently playing. */
|
|
238
|
+
export interface SpeechQueue {
|
|
239
|
+
/** False means full or terminal; a producer must retain its unaccepted text. */
|
|
240
|
+
append(chunks: readonly string[]): boolean;
|
|
241
|
+
/** No more appends; onEnd follows the last piece and confirmed drain. */
|
|
242
|
+
end(): void;
|
|
243
|
+
/** Drop queued/unplayed work while the sounding piece finishes. */
|
|
244
|
+
retract(): void;
|
|
245
|
+
/** Hard stop, including pending synthesis. No end event. */
|
|
246
|
+
cancel(): void;
|
|
247
|
+
}
|
|
@@ -131,6 +131,9 @@ export interface TurnDimensions {
|
|
|
131
131
|
}
|
|
132
132
|
/** What one attempt found out. */
|
|
133
133
|
export interface TurnAttemptFacts {
|
|
134
|
+
/** S7 local diagnostics only: no text and no new metric labels. */
|
|
135
|
+
spokeNarration?: boolean;
|
|
136
|
+
speechDivergence?: boolean;
|
|
134
137
|
runtime?: TurnRuntime;
|
|
135
138
|
/** The model called at least one tool on the way to its answer. */
|
|
136
139
|
usedTools?: boolean;
|
|
@@ -84,6 +84,7 @@ function m(e, t) {
|
|
|
84
84
|
let n = i.get(e);
|
|
85
85
|
if (!n) return;
|
|
86
86
|
let r = !1;
|
|
87
|
+
for (let e of ["spokeNarration", "speechDivergence"]) t[e] === !0 && n[e] !== !0 && (n[e] = !0, r = !0);
|
|
87
88
|
t.runtime !== void 0 && n.runtime === void 0 && (n.runtime = t.runtime, r = !0), t.usedTools !== void 0 && n.usedTools === void 0 && (n.usedTools = t.usedTools, r = !0), t.deadSandboxProbe !== void 0 && n.deadSandboxProbe === void 0 && (n.deadSandboxProbe = t.deadSandboxProbe, r = !0), t.cacheProofFailed !== void 0 && n.cacheProofFailed === void 0 && (n.cacheProofFailed = t.cacheProofFailed, r = !0), t.prewarm !== void 0 && n.prewarm === void 0 && (n.prewarm = t.prewarm, r = !0), t.transport !== void 0 && n.transport === void 0 && (n.transport = t.transport, r = !0), t.live !== void 0 && n.live === void 0 && (n.live = t.live, r = !0), t.session !== void 0 && n.session === void 0 && (n.session = t.session, r = !0), t.outcome !== void 0 && n.outcome === void 0 && (n.outcome = t.outcome, r = !0), r && d(n);
|
|
88
89
|
}
|
|
89
90
|
function h(e, n = c()) {
|
|
@@ -97,7 +98,9 @@ function h(e, n = c()) {
|
|
|
97
98
|
let t = r.at[e];
|
|
98
99
|
t !== void 0 && (a.at[e] = t, delete r.at[e]);
|
|
99
100
|
}
|
|
100
|
-
r.runtime !== void 0 && (a.runtime = r.runtime), r.usedTools !== void 0 && (a.usedTools = r.usedTools), r.deadSandboxProbe !== void 0 && (a.deadSandboxProbe = r.deadSandboxProbe), r.cacheProofFailed !== void 0 && (a.cacheProofFailed = r.cacheProofFailed), r.prewarm !== void 0 && (a.prewarm = r.prewarm), r.transport !== void 0 && (a.transport = r.transport), r.live !== void 0 && (a.live = r.live), r.session !== void 0 && (a.session = r.session)
|
|
101
|
+
r.runtime !== void 0 && (a.runtime = r.runtime), r.usedTools !== void 0 && (a.usedTools = r.usedTools), r.deadSandboxProbe !== void 0 && (a.deadSandboxProbe = r.deadSandboxProbe), r.cacheProofFailed !== void 0 && (a.cacheProofFailed = r.cacheProofFailed), r.prewarm !== void 0 && (a.prewarm = r.prewarm), r.transport !== void 0 && (a.transport = r.transport), r.live !== void 0 && (a.live = r.live), r.session !== void 0 && (a.session = r.session);
|
|
102
|
+
for (let e of ["spokeNarration", "speechDivergence"]) r[e] !== void 0 && (a[e] = r[e]), delete r[e];
|
|
103
|
+
delete r.transport, delete r.live, delete r.session, delete r.runtime, delete r.usedTools, delete r.deadSandboxProbe, delete r.cacheProofFailed, delete r.prewarm, r.attempts = [...r.attempts ?? [], a], r.retried = !0, d(r);
|
|
101
104
|
}
|
|
102
105
|
function g(e) {
|
|
103
106
|
let t = i.get(e);
|