@speeq/core 0.2.0 → 0.3.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/dist/index.d.cts CHANGED
@@ -205,8 +205,14 @@ interface LLMProvider {
205
205
  interface SpeechInputHandlers {
206
206
  /** Partial transcript while the user is speaking. */
207
207
  onInterim?(transcript: string): void;
208
- /** Final transcript of one utterance. */
208
+ /**
209
+ * Final transcript. In single-utterance mode this is called once when recognition ends. In
210
+ * {@link SpeechInputOptions.continuous} mode it is called for every finished phrase while
211
+ * recognition keeps running.
212
+ */
209
213
  onFinal(transcript: string): void;
214
+ /** Sound that looks like speech was detected (before any transcript exists). Optional. */
215
+ onSpeechStart?(): void;
210
216
  /** Recognition failed (no permission, no speech, network). */
211
217
  onError?(error: {
212
218
  code: "not-allowed" | "no-speech" | "network" | "aborted" | "unsupported" | "other";
@@ -221,6 +227,11 @@ interface SpeechInputOptions {
221
227
  language: string;
222
228
  /** Emit interim transcripts. Default `true`. */
223
229
  interimResults?: boolean;
230
+ /**
231
+ * Keep listening after a pause and deliver each finished phrase through `onFinal`. Used for
232
+ * hands-free calls. Default `false` (one utterance, then recognition ends).
233
+ */
234
+ continuous?: boolean;
224
235
  }
225
236
  /** Speech-to-text. The default implementation uses the browser Web Speech API. */
226
237
  interface SpeechInput {
@@ -247,6 +258,10 @@ interface SpeechOutput {
247
258
  speak(text: string, options: SpeakOptions): Promise<void>;
248
259
  /** Stops speaking and clears the queue. */
249
260
  cancel(): void;
261
+ /** Pauses the current utterance so that `resume()` can continue from the same spot. Optional. */
262
+ pause?(): void;
263
+ /** Continues after `pause()`. Optional. */
264
+ resume?(): void;
250
265
  }
251
266
 
252
267
  /** A tool call as recorded on an assistant message. */
package/dist/index.d.ts CHANGED
@@ -205,8 +205,14 @@ interface LLMProvider {
205
205
  interface SpeechInputHandlers {
206
206
  /** Partial transcript while the user is speaking. */
207
207
  onInterim?(transcript: string): void;
208
- /** Final transcript of one utterance. */
208
+ /**
209
+ * Final transcript. In single-utterance mode this is called once when recognition ends. In
210
+ * {@link SpeechInputOptions.continuous} mode it is called for every finished phrase while
211
+ * recognition keeps running.
212
+ */
209
213
  onFinal(transcript: string): void;
214
+ /** Sound that looks like speech was detected (before any transcript exists). Optional. */
215
+ onSpeechStart?(): void;
210
216
  /** Recognition failed (no permission, no speech, network). */
211
217
  onError?(error: {
212
218
  code: "not-allowed" | "no-speech" | "network" | "aborted" | "unsupported" | "other";
@@ -221,6 +227,11 @@ interface SpeechInputOptions {
221
227
  language: string;
222
228
  /** Emit interim transcripts. Default `true`. */
223
229
  interimResults?: boolean;
230
+ /**
231
+ * Keep listening after a pause and deliver each finished phrase through `onFinal`. Used for
232
+ * hands-free calls. Default `false` (one utterance, then recognition ends).
233
+ */
234
+ continuous?: boolean;
224
235
  }
225
236
  /** Speech-to-text. The default implementation uses the browser Web Speech API. */
226
237
  interface SpeechInput {
@@ -247,6 +258,10 @@ interface SpeechOutput {
247
258
  speak(text: string, options: SpeakOptions): Promise<void>;
248
259
  /** Stops speaking and clears the queue. */
249
260
  cancel(): void;
261
+ /** Pauses the current utterance so that `resume()` can continue from the same spot. Optional. */
262
+ pause?(): void;
263
+ /** Continues after `pause()`. Optional. */
264
+ resume?(): void;
250
265
  }
251
266
 
252
267
  /** A tool call as recorded on an assistant message. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speeq/core",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Types, Zod schemas, protocol, errors and utilities shared by every speeq package.",
5
5
  "license": "MIT",
6
6
  "type": "module",