@burdenoff/fe-libs 2026.1013.10 → 2026.1013.11
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/i18nManifest.d.ts +1 -0
- package/dist/shared/assistant/i18nManifest.js +1 -0
- package/dist/shared/assistant/speech/hostedTtsSpeechEngine.js +86 -81
- package/dist/shared/assistant/speech/pieceSink.d.ts +15 -7
- package/dist/shared/assistant/speech/pieceSink.js +55 -49
- package/dist/shared/assistant/speech/routingSpeechEngine.js +47 -37
- package/dist/shared/assistant/speech/types.d.ts +34 -3
- package/dist/shared/assistant/speech/types.js +2 -2
- package/dist/shared/assistant/ui/AssistantSpeechProvider.d.ts +11 -0
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +255 -250
- package/dist/shared/assistant/ui/useVoiceSession.d.ts +7 -1
- package/dist/shared/assistant/ui/useVoiceSession.js +253 -245
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +157 -145
- package/dist/shared-assistant.js +240 -240
- package/package.json +1 -1
|
@@ -47,8 +47,20 @@ export interface SpeechSpeakOptions {
|
|
|
47
47
|
* still ends with `onEnd`. Switching it off never goes through the engine's
|
|
48
48
|
* `cancel()`, which silences the reply, nor through `retract()`.
|
|
49
49
|
*
|
|
50
|
+
* ★★ Refusing is neither leaving nor failing (operator decision D7 b). When the
|
|
51
|
+
* output cannot show that what it played BEFORE this reply has stopped (its
|
|
52
|
+
* drain bound ran out while that audio may still be heard), it must not start
|
|
53
|
+
* this reply anywhere: it writes nothing, unmutes nothing, and rejects the
|
|
54
|
+
* pending `write` or `drain` (or the next one, if none is pending) and every
|
|
55
|
+
* later one with a `SpeechOutputRefusal`. The engine then silences it, plays
|
|
56
|
+
* NOTHING on the speakers, and ends the reply with
|
|
57
|
+
* `onError('output-not-cleared')`, which no fallback re-speaks. A `drain()`
|
|
58
|
+
* with nothing written yet is no exception: the engine drains before it
|
|
59
|
+
* reports a failure of its own, and a drain that resolves lets the device
|
|
60
|
+
* voice speak the reply.
|
|
61
|
+
*
|
|
50
62
|
* One object serves exactly one reply: attach a fresh one to each, so neither
|
|
51
|
-
* a leave nor the hard stop carries over to the next reply.
|
|
63
|
+
* a leave, a refusal nor the hard stop carries over to the next reply.
|
|
52
64
|
*/
|
|
53
65
|
export interface SpeechAudioOutput {
|
|
54
66
|
/**
|
|
@@ -88,15 +100,34 @@ export interface SpeechAudioOutput {
|
|
|
88
100
|
}
|
|
89
101
|
/**
|
|
90
102
|
* The `reason` a `SpeechAudioOutput` rejects with once it has LEFT the reply
|
|
91
|
-
* (switched off while the reply goes on). Any other rejection is a failure
|
|
103
|
+
* (switched off while the reply goes on). Any other rejection is a failure,
|
|
104
|
+
* except a refusal (`SPEECH_OUTPUT_REFUSE_AUDIBLE`).
|
|
92
105
|
*/
|
|
93
106
|
export declare const SPEECH_OUTPUT_LEFT = "left";
|
|
107
|
+
/**
|
|
108
|
+
* The `reason` a `SpeechAudioOutput` rejects with to REFUSE the reply
|
|
109
|
+
* (operator decision D7 b): what it played before could not be shown to have
|
|
110
|
+
* stopped, so nothing of this reply may be heard, on the output, on the
|
|
111
|
+
* speakers or on any other voice. Exported so that an output cannot misspell it
|
|
112
|
+
* and silently turn a refusal into a failure the speakers take over.
|
|
113
|
+
*/
|
|
114
|
+
export declare const SPEECH_OUTPUT_REFUSE_AUDIBLE = "refuse-audible";
|
|
115
|
+
/** What a `SpeechAudioOutput` rejects with to refuse the reply (`SPEECH_OUTPUT_REFUSE_AUDIBLE`). */
|
|
116
|
+
export interface SpeechOutputRefusal {
|
|
117
|
+
readonly reason: typeof SPEECH_OUTPUT_REFUSE_AUDIBLE;
|
|
118
|
+
}
|
|
94
119
|
/**
|
|
95
120
|
* Why playback stopped. `cancelled` is not a failure: it is what every queued
|
|
96
121
|
* utterance reports when we deliberately cancel (new playback, panel close,
|
|
97
122
|
* conversation switch), and the UI must stay silent about it.
|
|
123
|
+
*
|
|
124
|
+
* `output-not-cleared` is a failure that must NEVER be heard (BOFF-8822,
|
|
125
|
+
* operator decision D7 b): the reply's audio output refused it because what it
|
|
126
|
+
* played before could not be shown to have stopped. Nothing re-speaks it, the
|
|
127
|
+
* device voice included, and its text stays where it is. Only a reply with an
|
|
128
|
+
* `audioOutput` can end this way.
|
|
98
129
|
*/
|
|
99
|
-
export type SpeechErrorReason = 'cancelled' | 'not-allowed' | 'unsupported' | 'unknown';
|
|
130
|
+
export type SpeechErrorReason = 'cancelled' | 'not-allowed' | 'unsupported' | 'unknown' | 'output-not-cleared';
|
|
100
131
|
export interface SpeechSpeakHandlers {
|
|
101
132
|
/**
|
|
102
133
|
* Audio has actually begun playing — not merely been requested.
|
|
@@ -54,6 +54,17 @@ export interface AssistantSpeechContextValue {
|
|
|
54
54
|
setVoice: (voiceName: string | null) => void;
|
|
55
55
|
/** The message currently being spoken, if any. */
|
|
56
56
|
speakingMessageId: string | null;
|
|
57
|
+
/**
|
|
58
|
+
* ★★ The reply an audio output REFUSED (BOFF-8822, operator decision D7 b;
|
|
59
|
+
* reason `output-not-cleared`): what it played before could not be shown to
|
|
60
|
+
* have stopped, so the reply was never heard, on any voice. It ended as a
|
|
61
|
+
* failure like any other (playback is idle and its text is untouched); this
|
|
62
|
+
* says WHICH reply, so the voice session can explain the silence. A new
|
|
63
|
+
* object per refusal; null until one happens, which needs an audio output.
|
|
64
|
+
*/
|
|
65
|
+
outputNotCleared: {
|
|
66
|
+
readonly messageId: string;
|
|
67
|
+
} | null;
|
|
57
68
|
isSpeaking: (messageId: string) => boolean;
|
|
58
69
|
/**
|
|
59
70
|
* Speak this message, or stop if it is already the one speaking.
|