@molecule/app-ide-panel-logic 1.3.1 → 1.4.0
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/README.md +277 -1
- package/dist/chatTimelineOrdering.d.ts +175 -1
- package/dist/chatTimelineOrdering.d.ts.map +1 -1
- package/dist/chatTimelineOrdering.js +192 -1
- package/dist/chatTimelineOrdering.js.map +1 -1
- package/dist/components/chat-card-event-utilities.d.ts +320 -0
- package/dist/components/chat-card-event-utilities.d.ts.map +1 -0
- package/dist/components/chat-card-event-utilities.js +198 -0
- package/dist/components/chat-card-event-utilities.js.map +1 -0
- package/dist/components/chat-composer-utilities.d.ts +472 -0
- package/dist/components/chat-composer-utilities.d.ts.map +1 -0
- package/dist/components/chat-composer-utilities.js +519 -0
- package/dist/components/chat-composer-utilities.js.map +1 -0
- package/dist/components/chat-dictation-controller.d.ts +376 -0
- package/dist/components/chat-dictation-controller.d.ts.map +1 -0
- package/dist/components/chat-dictation-controller.js +559 -0
- package/dist/components/chat-dictation-controller.js.map +1 -0
- package/dist/components/chat-effort-utilities.d.ts +24 -0
- package/dist/components/chat-effort-utilities.d.ts.map +1 -1
- package/dist/components/chat-effort-utilities.js +41 -0
- package/dist/components/chat-effort-utilities.js.map +1 -1
- package/dist/components/chat-format-utilities.d.ts +71 -0
- package/dist/components/chat-format-utilities.d.ts.map +1 -0
- package/dist/components/chat-format-utilities.js +192 -0
- package/dist/components/chat-format-utilities.js.map +1 -0
- package/dist/components/chat-models-utilities.d.ts +168 -0
- package/dist/components/chat-models-utilities.d.ts.map +1 -1
- package/dist/components/chat-models-utilities.js +253 -0
- package/dist/components/chat-models-utilities.js.map +1 -1
- package/dist/components/chat-settings-utilities.d.ts +153 -1
- package/dist/components/chat-settings-utilities.d.ts.map +1 -1
- package/dist/components/chat-settings-utilities.js +204 -1
- package/dist/components/chat-settings-utilities.js.map +1 -1
- package/dist/components/chat-stream-utilities.d.ts +165 -1
- package/dist/components/chat-stream-utilities.d.ts.map +1 -1
- package/dist/components/chat-stream-utilities.js +155 -1
- package/dist/components/chat-stream-utilities.js.map +1 -1
- package/dist/components/chat-tests-controller.d.ts +249 -0
- package/dist/components/chat-tests-controller.d.ts.map +1 -0
- package/dist/components/chat-tests-controller.js +504 -0
- package/dist/components/chat-tests-controller.js.map +1 -0
- package/dist/components/chat-timeline-utilities.d.ts +90 -0
- package/dist/components/chat-timeline-utilities.d.ts.map +1 -0
- package/dist/components/chat-timeline-utilities.js +71 -0
- package/dist/components/chat-timeline-utilities.js.map +1 -0
- package/dist/components/chat-ui-constants.d.ts +98 -0
- package/dist/components/chat-ui-constants.d.ts.map +1 -0
- package/dist/components/chat-ui-constants.js +146 -0
- package/dist/components/chat-ui-constants.js.map +1 -0
- package/dist/components/chat-undo-utilities.d.ts +47 -0
- package/dist/components/chat-undo-utilities.d.ts.map +1 -0
- package/dist/components/chat-undo-utilities.js +73 -0
- package/dist/components/chat-undo-utilities.js.map +1 -0
- package/dist/components/context-usage-utilities.d.ts +25 -3
- package/dist/components/context-usage-utilities.d.ts.map +1 -1
- package/dist/components/context-usage-utilities.js +42 -2
- package/dist/components/context-usage-utilities.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/panels.d.ts +6 -0
- package/dist/panels.d.ts.map +1 -1
- package/dist/panels.js +6 -0
- package/dist/panels.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chat panel's voice region (dictation) as framework-neutral behaviour.
|
|
3
|
+
*
|
|
4
|
+
* Every framework's chat panel drives the same dictation paths: the browser's
|
|
5
|
+
* Web Speech service when it works, the bonded on-device provider when it does
|
|
6
|
+
* not, and (when the app registers an engine catalog) whichever engine the
|
|
7
|
+
* person chose in the `/mic` picker. This controller owns that machinery — the
|
|
8
|
+
* recognition session, the restart/watchdog timers, the engine choice and the
|
|
9
|
+
* give-up detection — and reads every browser API it needs from its options:
|
|
10
|
+
* the Web Speech constructor, the ai-voice provider, the engine catalog lookup,
|
|
11
|
+
* storage, the clock and the timers. It performs no I/O when it is constructed;
|
|
12
|
+
* the host starts its work from the effects it already keeps in place.
|
|
13
|
+
*
|
|
14
|
+
* The host keeps the values it renders (the listening flag, the error/notice
|
|
15
|
+
* text, the dead-service flag, the picker and the chosen engine id) in its own
|
|
16
|
+
* state and passes the setters in, so the controller never owns view state and
|
|
17
|
+
* the rendered output does not move.
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
import type { TranslateFunction } from '@molecule/app-i18n';
|
|
22
|
+
/**
|
|
23
|
+
* A dictation engine option as this controller reads it: the identity it
|
|
24
|
+
* persists, how it runs, and the languages it covers. `@molecule/app-ai-voice`'s
|
|
25
|
+
* `VoiceEngineDef` is assignable to this shape.
|
|
26
|
+
*/
|
|
27
|
+
export interface DictationEngine {
|
|
28
|
+
/** Stable engine id (persisted as the user's choice). */
|
|
29
|
+
id: string;
|
|
30
|
+
/** How the engine runs: the browser's service or an on-device model. */
|
|
31
|
+
kind: 'native' | 'on-device';
|
|
32
|
+
/** Language coverage: 'all', or the ISO 639-1 codes the engine can transcribe. */
|
|
33
|
+
languages: 'all' | readonly string[];
|
|
34
|
+
}
|
|
35
|
+
/** A transcript (interim or final) as the on-device provider reports it. */
|
|
36
|
+
export interface DictationVoiceTranscriptEvent {
|
|
37
|
+
/** The recognized text. */
|
|
38
|
+
transcript: string;
|
|
39
|
+
/** Whether this is a final (stable) result or an interim (partial) result. */
|
|
40
|
+
isFinal: boolean;
|
|
41
|
+
/** Confidence score from 0 to 1. */
|
|
42
|
+
confidence: number;
|
|
43
|
+
}
|
|
44
|
+
/** A voice error as the on-device provider reports it. */
|
|
45
|
+
export interface DictationVoiceErrorEvent {
|
|
46
|
+
/** Machine-readable error code (e.g. 'not-allowed', 'no-speech', 'network'). */
|
|
47
|
+
code: string;
|
|
48
|
+
/** Human-readable error description. */
|
|
49
|
+
message: string;
|
|
50
|
+
}
|
|
51
|
+
/** The possible states of the on-device voice provider. */
|
|
52
|
+
export type DictationVoiceState = 'idle' | 'listening' | 'processing' | 'speaking' | 'error';
|
|
53
|
+
/** Options for an on-device recognition request. */
|
|
54
|
+
export interface DictationVoiceRecognitionOptions {
|
|
55
|
+
/** BCP-47 language code (e.g. 'en-US'). */
|
|
56
|
+
language?: string;
|
|
57
|
+
/** When true, recognition continues after the first final result. */
|
|
58
|
+
continuous?: boolean;
|
|
59
|
+
/** When true, interim (partial) results are reported. */
|
|
60
|
+
interimResults?: boolean;
|
|
61
|
+
/** Maximum number of alternative transcriptions to return. */
|
|
62
|
+
maxAlternatives?: number;
|
|
63
|
+
}
|
|
64
|
+
/** Event handlers for an on-device recognition request. */
|
|
65
|
+
export interface DictationVoiceEventHandlers {
|
|
66
|
+
/** Called when a transcript (interim or final) is available. */
|
|
67
|
+
onTranscript?: (event: DictationVoiceTranscriptEvent) => void;
|
|
68
|
+
/** Called when the voice state changes. */
|
|
69
|
+
onStateChange?: (state: DictationVoiceState) => void;
|
|
70
|
+
/** Called when an error occurs. */
|
|
71
|
+
onError?: (event: DictationVoiceErrorEvent) => void;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The part of a bonded ai-voice provider this controller uses.
|
|
75
|
+
* `@molecule/app-ai-voice`'s `AIVoiceProvider` is assignable to this shape.
|
|
76
|
+
*/
|
|
77
|
+
export interface DictationVoiceProvider {
|
|
78
|
+
/**
|
|
79
|
+
* Checks whether speech recognition (STT) is supported.
|
|
80
|
+
* @returns True when supported.
|
|
81
|
+
*/
|
|
82
|
+
isRecognitionSupported(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Starts speech recognition.
|
|
85
|
+
* @param options - Recognition options (language, continuous mode, etc.).
|
|
86
|
+
* @param handlers - Callbacks for transcript results, state changes, and errors.
|
|
87
|
+
*/
|
|
88
|
+
startListening(options?: DictationVoiceRecognitionOptions, handlers?: DictationVoiceEventHandlers): void;
|
|
89
|
+
/** Stops speech recognition. */
|
|
90
|
+
stopListening(): void;
|
|
91
|
+
}
|
|
92
|
+
/** One Web Speech recognition session, as the browser constructs it. */
|
|
93
|
+
export interface SpeechRecognitionSession {
|
|
94
|
+
/** Starts listening. */
|
|
95
|
+
start(): void;
|
|
96
|
+
/** Stops listening and may still deliver a final result. */
|
|
97
|
+
stop(): void;
|
|
98
|
+
/** Stops listening and discards pending results. */
|
|
99
|
+
abort(): void;
|
|
100
|
+
/** Called when the service started. */
|
|
101
|
+
onstart: (() => void) | null;
|
|
102
|
+
/** Called with each recognition result. */
|
|
103
|
+
onresult: ((event: unknown) => void) | null;
|
|
104
|
+
/** Called when the session ends. */
|
|
105
|
+
onend: (() => void) | null;
|
|
106
|
+
/** Called when the session fails. */
|
|
107
|
+
onerror: ((event: unknown) => void) | null;
|
|
108
|
+
/** Whether the session continues after the first result. */
|
|
109
|
+
continuous: boolean;
|
|
110
|
+
/** Whether interim (partial) results are reported. */
|
|
111
|
+
interimResults: boolean;
|
|
112
|
+
/** BCP-47 language tag of the session. */
|
|
113
|
+
lang: string;
|
|
114
|
+
}
|
|
115
|
+
/** The browser's Web Speech constructor (`SpeechRecognition`). */
|
|
116
|
+
export type SpeechRecognitionConstructor = new () => SpeechRecognitionSession;
|
|
117
|
+
/** The key/value store the controller reads and writes (a Web Storage area). */
|
|
118
|
+
export interface DictationStorage {
|
|
119
|
+
/**
|
|
120
|
+
* Reads a stored value.
|
|
121
|
+
* @param key - The storage key.
|
|
122
|
+
* @returns The stored value, or null.
|
|
123
|
+
*/
|
|
124
|
+
getItem(key: string): string | null;
|
|
125
|
+
/**
|
|
126
|
+
* Stores a value.
|
|
127
|
+
* @param key - The storage key.
|
|
128
|
+
* @param value - The value to store.
|
|
129
|
+
*/
|
|
130
|
+
setItem(key: string, value: string): void;
|
|
131
|
+
/**
|
|
132
|
+
* Removes a stored value.
|
|
133
|
+
* @param key - The storage key.
|
|
134
|
+
*/
|
|
135
|
+
removeItem(key: string): void;
|
|
136
|
+
}
|
|
137
|
+
/** An opaque scheduled-timer handle, as the platform's `setTimeout` returns it. */
|
|
138
|
+
export type DictationTimer = ReturnType<typeof setTimeout>;
|
|
139
|
+
/** Why an engine can't be used on this device, or null when it can. */
|
|
140
|
+
export type DictationEngineDisabledReason = 'browser' | 'language' | null;
|
|
141
|
+
/** Session-storage key remembering that the browser's Web Speech service proved dead. */
|
|
142
|
+
export declare const WEB_SPEECH_DEAD_STORAGE_KEY = "molecule.ide.webSpeechDead";
|
|
143
|
+
/** Local-storage key holding the user's chosen dictation engine id. */
|
|
144
|
+
export declare const MIC_ENGINE_STORAGE_KEY = "molecule.ide.voiceEngine";
|
|
145
|
+
/** What the controller reads from its host and its environment. */
|
|
146
|
+
export interface ChatDictationControllerOptions {
|
|
147
|
+
/** Translates the fallback messages the controller shows. */
|
|
148
|
+
translate: TranslateFunction;
|
|
149
|
+
/** The browser's Web Speech constructor, or undefined when the browser has none. */
|
|
150
|
+
speechRecognitionConstructor?: SpeechRecognitionConstructor;
|
|
151
|
+
/** The app's registered engine catalog (empty when the app offers no choice). */
|
|
152
|
+
engines?: readonly DictationEngine[];
|
|
153
|
+
/**
|
|
154
|
+
* Selects an engine by id: bonds its provider and remembers the choice.
|
|
155
|
+
* @param id - The engine id to select.
|
|
156
|
+
* @returns The selected engine, or null when the id is not registered.
|
|
157
|
+
*/
|
|
158
|
+
selectEngine: (id: string) => DictationEngine | null;
|
|
159
|
+
/**
|
|
160
|
+
* Checks whether an engine covers a BCP-47 language tag.
|
|
161
|
+
* @param engine - The engine to check.
|
|
162
|
+
* @param language - BCP-47 tag (e.g. 'en-US').
|
|
163
|
+
* @returns True when the engine can transcribe the language.
|
|
164
|
+
*/
|
|
165
|
+
engineCoversLanguage(engine: DictationEngine, language: string): boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Returns the bonded on-device provider, or null when none is wired.
|
|
168
|
+
* @returns The provider or null.
|
|
169
|
+
*/
|
|
170
|
+
getVoiceProvider: () => DictationVoiceProvider | null;
|
|
171
|
+
/**
|
|
172
|
+
* Reads the composer draft.
|
|
173
|
+
* @returns The current draft text.
|
|
174
|
+
*/
|
|
175
|
+
readInput: () => string;
|
|
176
|
+
/**
|
|
177
|
+
* Replaces the composer draft.
|
|
178
|
+
* @param value - The new draft text.
|
|
179
|
+
*/
|
|
180
|
+
writeInput: (value: string) => void;
|
|
181
|
+
/**
|
|
182
|
+
* Records a final transcript inserted into the current draft.
|
|
183
|
+
* @param transcript - The inserted transcript.
|
|
184
|
+
*/
|
|
185
|
+
pushDictatedSnippet: (transcript: string) => void;
|
|
186
|
+
/** Grows the composer to fit the inserted transcript. */
|
|
187
|
+
onTranscriptInserted: () => void;
|
|
188
|
+
/** Called when a dictation session begins (pauses the auto-fix countdown). */
|
|
189
|
+
onDictationStart: () => void;
|
|
190
|
+
/** Closes the sibling composer popups before the mic picker opens. */
|
|
191
|
+
closeSiblingPopups: () => void;
|
|
192
|
+
/** Opens the `/mic` engine picker for a mic-click-initiated choice. */
|
|
193
|
+
openMicPicker: () => void;
|
|
194
|
+
/** Closes the `/mic` engine picker. */
|
|
195
|
+
closeMicPicker: () => void;
|
|
196
|
+
/**
|
|
197
|
+
* Sets the rendered listening flag.
|
|
198
|
+
* @param listening - Whether a dictation session is active.
|
|
199
|
+
*/
|
|
200
|
+
setListening: (listening: boolean) => void;
|
|
201
|
+
/**
|
|
202
|
+
* Sets the rendered error message.
|
|
203
|
+
* @param message - The message, or null to clear it.
|
|
204
|
+
*/
|
|
205
|
+
setVoiceError: (message: string | null) => void;
|
|
206
|
+
/**
|
|
207
|
+
* Sets the rendered secondary notice.
|
|
208
|
+
* @param message - The notice, or null to clear it.
|
|
209
|
+
*/
|
|
210
|
+
setVoiceNotice: (message: string | null) => void;
|
|
211
|
+
/**
|
|
212
|
+
* Sets the rendered dead-service flag.
|
|
213
|
+
* @param dead - Whether the browser's speech service proved dead.
|
|
214
|
+
*/
|
|
215
|
+
setWebSpeechDead: (dead: boolean) => void;
|
|
216
|
+
/**
|
|
217
|
+
* Sets the rendered chosen-engine id.
|
|
218
|
+
* @param id - The engine id, or null when no engine is chosen.
|
|
219
|
+
*/
|
|
220
|
+
setCurrentVoiceEngineId: (id: string | null) => void;
|
|
221
|
+
/**
|
|
222
|
+
* Reads the current time. Defaults to `Date.now`.
|
|
223
|
+
* @returns Milliseconds since the epoch.
|
|
224
|
+
*/
|
|
225
|
+
now?: () => number;
|
|
226
|
+
/**
|
|
227
|
+
* Schedules a callback. Defaults to `setTimeout`.
|
|
228
|
+
* @param callback - The callback to run.
|
|
229
|
+
* @param delayMs - The delay in milliseconds.
|
|
230
|
+
* @returns The timer handle.
|
|
231
|
+
*/
|
|
232
|
+
setTimer?: (callback: () => void, delayMs: number) => DictationTimer;
|
|
233
|
+
/**
|
|
234
|
+
* Cancels a scheduled callback. Defaults to `clearTimeout`.
|
|
235
|
+
* @param timer - The timer handle to cancel.
|
|
236
|
+
*/
|
|
237
|
+
clearTimer?: (timer: DictationTimer) => void;
|
|
238
|
+
/**
|
|
239
|
+
* Reads the UI language. Defaults to `navigator.language`.
|
|
240
|
+
* @returns A BCP-47 language tag.
|
|
241
|
+
*/
|
|
242
|
+
getLanguage?: () => string;
|
|
243
|
+
/**
|
|
244
|
+
* Returns the session storage area, or undefined when unavailable.
|
|
245
|
+
* @returns The store or undefined.
|
|
246
|
+
*/
|
|
247
|
+
sessionStore?: () => DictationStorage | undefined;
|
|
248
|
+
/**
|
|
249
|
+
* Returns the local storage area, or undefined when unavailable.
|
|
250
|
+
* @returns The store or undefined.
|
|
251
|
+
*/
|
|
252
|
+
localStore?: () => DictationStorage | undefined;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* The voice region's behaviour (see the module docs). The host subscribes to
|
|
256
|
+
* nothing: it keeps the values it renders in its own state, hands the controller
|
|
257
|
+
* its setters, and calls {@link ChatDictationController.mount},
|
|
258
|
+
* {@link ChatDictationController.restoreSavedEngine} and
|
|
259
|
+
* {@link ChatDictationController.dispose} from the effects it already keeps in
|
|
260
|
+
* place, so the order of the host's requests and timers cannot move.
|
|
261
|
+
*/
|
|
262
|
+
export declare class ChatDictationController {
|
|
263
|
+
private readonly translate;
|
|
264
|
+
private readonly speechRecognitionConstructor;
|
|
265
|
+
private readonly hasSpeechRecognition;
|
|
266
|
+
private readonly engines;
|
|
267
|
+
private readonly selectEngine;
|
|
268
|
+
private readonly engineCoversLanguage;
|
|
269
|
+
private readonly getVoiceProvider;
|
|
270
|
+
private readonly readInput;
|
|
271
|
+
private readonly writeInput;
|
|
272
|
+
private readonly pushDictatedSnippet;
|
|
273
|
+
private readonly onTranscriptInserted;
|
|
274
|
+
private readonly onDictationStart;
|
|
275
|
+
private readonly closeSiblingPopups;
|
|
276
|
+
private readonly openMicPicker;
|
|
277
|
+
private readonly closeMicPicker;
|
|
278
|
+
private readonly setListening;
|
|
279
|
+
private readonly setVoiceError;
|
|
280
|
+
private readonly setVoiceNotice;
|
|
281
|
+
private readonly setWebSpeechDead;
|
|
282
|
+
private readonly setCurrentVoiceEngineId;
|
|
283
|
+
private readonly now;
|
|
284
|
+
private readonly setTimer;
|
|
285
|
+
private readonly clearTimer;
|
|
286
|
+
private readonly getLanguage;
|
|
287
|
+
private readonly sessionStore;
|
|
288
|
+
private readonly localStore;
|
|
289
|
+
private recognition;
|
|
290
|
+
private voiceErrorTimer;
|
|
291
|
+
private voiceRestartTimer;
|
|
292
|
+
private voiceWatchdogTimer;
|
|
293
|
+
private voiceIntent;
|
|
294
|
+
private voiceDiscard;
|
|
295
|
+
private voiceFailCount;
|
|
296
|
+
private voiceLastStart;
|
|
297
|
+
private useLocalVoice;
|
|
298
|
+
private webSpeechDead;
|
|
299
|
+
private engine;
|
|
300
|
+
/**
|
|
301
|
+
* Wires the controller. Performs no I/O: every API it needs is stored, not
|
|
302
|
+
* called, and the host's effects start the work.
|
|
303
|
+
*
|
|
304
|
+
* @param options - The host callbacks and the browser APIs the controller uses.
|
|
305
|
+
*/
|
|
306
|
+
constructor(options: ChatDictationControllerOptions);
|
|
307
|
+
/**
|
|
308
|
+
* Restores the session-scoped dead-service flag from storage. Called from the
|
|
309
|
+
* host's mount effect.
|
|
310
|
+
*/
|
|
311
|
+
mount(): void;
|
|
312
|
+
/**
|
|
313
|
+
* Restores the user's saved engine choice. Called from the host's
|
|
314
|
+
* engine-restore effect (a no-op when the app registers no catalog).
|
|
315
|
+
*/
|
|
316
|
+
restoreSavedEngine(): void;
|
|
317
|
+
/**
|
|
318
|
+
* Why an engine can't be used here, or null when it can: 'browser' = the
|
|
319
|
+
* native speech service is missing/proven dead in this browser; 'language'
|
|
320
|
+
* = the engine doesn't cover the UI language.
|
|
321
|
+
*
|
|
322
|
+
* @param def - The engine to check.
|
|
323
|
+
* @param webSpeechDead - Whether the rendered dead-service flag is set.
|
|
324
|
+
* @returns The reason, or null when the engine can be used.
|
|
325
|
+
*/
|
|
326
|
+
voiceEngineDisabledReason(def: DictationEngine, webSpeechDead: boolean): DictationEngineDisabledReason;
|
|
327
|
+
/**
|
|
328
|
+
* Shows an error message, replacing any current one and clearing it after
|
|
329
|
+
* {@link VOICE_ERROR_MS}.
|
|
330
|
+
*
|
|
331
|
+
* @param message - The message to show.
|
|
332
|
+
*/
|
|
333
|
+
showVoiceError(message: string): void;
|
|
334
|
+
/**
|
|
335
|
+
* Starts dictation through the bonded on-device provider. Returns false when
|
|
336
|
+
* no usable provider is wired, so the caller can fall through to the
|
|
337
|
+
* "dictation unavailable" path.
|
|
338
|
+
*
|
|
339
|
+
* @returns True when the provider started listening.
|
|
340
|
+
*/
|
|
341
|
+
startLocalVoice(): boolean;
|
|
342
|
+
/**
|
|
343
|
+
* Starts one Web Speech session, restarting it after a healthy end and giving
|
|
344
|
+
* up (delegating to the on-device provider or the unavailable path) when the
|
|
345
|
+
* service never answers or fails repeatedly.
|
|
346
|
+
*/
|
|
347
|
+
startRecognition(): void;
|
|
348
|
+
/** Begins a dictation session on whatever engine/path is active. */
|
|
349
|
+
beginDictation(): void;
|
|
350
|
+
/**
|
|
351
|
+
* Applies a picker choice: wires the engine, persists it, and (for a
|
|
352
|
+
* mic-click-initiated pick) starts dictating immediately.
|
|
353
|
+
*
|
|
354
|
+
* @param def - The engine the person chose.
|
|
355
|
+
* @param autoStart - Whether to start dictating right after choosing.
|
|
356
|
+
*/
|
|
357
|
+
chooseVoiceEngine(def: DictationEngine, autoStart: boolean): void;
|
|
358
|
+
/**
|
|
359
|
+
* Turns dictation on or off from the mic button.
|
|
360
|
+
*
|
|
361
|
+
* @param isListening - Whether a session is currently active (the host's state).
|
|
362
|
+
*/
|
|
363
|
+
toggleVoice(isListening: boolean): void;
|
|
364
|
+
/**
|
|
365
|
+
* Stops recognition when the composer submits: clears the intent and timers,
|
|
366
|
+
* and drops any trailing transcript from the provider so it does not land in
|
|
367
|
+
* the freshly-cleared composer. Called from the host's submit handler.
|
|
368
|
+
*/
|
|
369
|
+
stopForSubmit(): void;
|
|
370
|
+
/**
|
|
371
|
+
* Stops recognition and every timer on unmount. Called from the host's
|
|
372
|
+
* cleanup effect.
|
|
373
|
+
*/
|
|
374
|
+
dispose(): void;
|
|
375
|
+
}
|
|
376
|
+
//# sourceMappingURL=chat-dictation-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-dictation-controller.d.ts","sourceRoot":"","sources":["../../src/components/chat-dictation-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAE3D;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAA;IACV,wEAAwE;IACxE,IAAI,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC5B,kFAAkF;IAClF,SAAS,EAAE,KAAK,GAAG,SAAS,MAAM,EAAE,CAAA;CACrC;AAED,4EAA4E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