lumiverse-spindle-types 0.6.54 → 0.6.55

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.ts CHANGED
@@ -31,7 +31,7 @@ export type { EntityTypeDTO, EntityStatusDTO, MentionRoleDTO, RelationTypeDTO, R
31
31
  export type { SpindleAPI, SpindleGenerateAPI, SpindleConnectionsAPI, SpindlePromptRegex, FrontendProcessHandle, BackendProcessHandle, SpindleBackendProcessContext, SpindleBackendProcessModule, SpindleEmbeddingDriver, SpindleTtsEngine, SpindleSttEngine, SpindleSidecarEndpoint, } from "./spindle-api.js";
32
32
  export type { CouncilMember, CouncilMemberContext, SidecarConfig, CouncilSidecarConfig, CouncilToolsSettings, CouncilSettings, CouncilToolResult, CouncilExecutionResult, CachedCouncilResult, CouncilToolCategory, CouncilToolExecution, CouncilToolDefinition, } from "./council.js";
33
33
  export { SIDECAR_DEFAULTS, COUNCIL_SIDECAR_DEFAULTS, COUNCIL_TOOLS_DEFAULTS, COUNCIL_SETTINGS_DEFAULTS, } from "./council.js";
34
- export type { SpindleSTTProvider, SpindleSTTProviderOption, SpindleSTTStatus, SpindleSTTResult, SpindleSTTAudioFrame, SpindleSTTTranscript, SpindleSTTPcmAudio, SpindleSTTOptions, SpindleSTTStartOptions, SpindleSTTSession, SpindleSTTAPI, } from "./speech-to-text.js";
34
+ export type { SpindleSTTProvider, SpindleSTTProviderOption, SpindleSTTStatus, SpindleSTTResult, SpindleSTTAudioFrame, SpindleSTTTranscript, SpindleSTTPcmAudio, SpindleSTTOptions, SpindleSTTStartOptions, SpindleSTTSession, SpindleSTTAPI, SpindleSTTWord, SpindleSTTTranscribeOptions, } from "./speech-to-text.js";
35
35
  export { SPINDLE_STT_HOST_CAPABILITIES } from "./speech-to-text.js";
36
36
  export type { SpindleSystemAudioUnavailableReason, SpindleSystemAudioAvailability, SpindleSystemAudioFrame, SpindleSystemAudioChannelFrame, SpindleSystemAudioEndReason, SpindleSystemAudioStartOptions, SpindleSystemAudioSession, SpindleSystemAudioAPI, } from "./system-audio.js";
37
37
  export { SPINDLE_SYSTEM_AUDIO_HOST_CAPABILITIES } from "./system-audio.js";
@@ -24,10 +24,20 @@ export interface SpindleSTTAudioFrame {
24
24
  peak: number;
25
25
  frequencies: number[];
26
26
  }
27
+ /** One recognized word. Times are seconds from the start of the supplied audio. */
28
+ export interface SpindleSTTWord {
29
+ word: string;
30
+ start: number;
31
+ end: number;
32
+ /** Decoder confidence for this word, from 0 to 1. */
33
+ probability: number;
34
+ }
27
35
  export interface SpindleSTTTranscript {
28
36
  text: string;
29
37
  provider: SpindleSTTProvider;
30
38
  language?: string;
39
+ /** Present when `words: true` was requested and the provider supports it (Whistle only). */
40
+ words?: SpindleSTTWord[];
31
41
  }
32
42
  /** Mono PCM for Whistle. Samples are copied; the caller's buffer is never detached. */
33
43
  export interface SpindleSTTPcmAudio {
@@ -43,6 +53,17 @@ export interface SpindleSTTOptions {
43
53
  signal?: AbortSignal;
44
54
  onStatus?(status: SpindleSTTStatus): void;
45
55
  }
56
+ /** Options for transcribe(). Available with speech-to-text-options-v1. */
57
+ export interface SpindleSTTTranscribeOptions extends SpindleSTTOptions {
58
+ /**
59
+ * Names and words to favour during recognition, e.g. character names. Whistle only;
60
+ * other providers ignore them. At most 500 entries of 1-100 characters after trimming,
61
+ * without line breaks or NUL characters.
62
+ */
63
+ keywords?: readonly string[];
64
+ /** Also return each word with its timing and probability. Whistle only; other providers omit `words`. */
65
+ words?: boolean;
66
+ }
46
67
  export interface SpindleSTTStartOptions extends SpindleSTTOptions {
47
68
  /** Defaults to false: finish after confirmed speech followed by silence. */
48
69
  continuous?: boolean;
@@ -74,8 +95,18 @@ export interface SpindleSTTAPI {
74
95
  * Requires media. Whistle accepts a decodable audio Blob or mono PCM; connection accepts a Blob.
75
96
  * Web Speech cannot transcribe supplied audio. Whistle is capped at ten minutes / 64 MiB.
76
97
  */
77
- transcribe(audio: Blob | SpindleSTTPcmAudio, options?: SpindleSTTOptions): Promise<SpindleSTTTranscript>;
98
+ transcribe(audio: Blob | SpindleSTTPcmAudio, options?: SpindleSTTTranscribeOptions): Promise<SpindleSTTTranscript>;
99
+ /**
100
+ * Free. Calls the listener when the host's own chat microphone (the composer's speech
101
+ * button) starts or stops a session, including its final transcription. Recordings
102
+ * started by extensions through start() are not reported. Returns an unsubscribe
103
+ * function. Available with speech-to-text-options-v1.
104
+ */
105
+ onHostActivity?(listener: (active: boolean) => void): () => void;
106
+ /** Free. True while the host's own chat microphone session is active. Available with speech-to-text-options-v1. */
107
+ isHostCapturing?(): boolean;
78
108
  }
79
109
  export declare const SPINDLE_STT_HOST_CAPABILITIES: Readonly<{
80
110
  'speech-to-text-v1': 1;
111
+ 'speech-to-text-options-v1': 1;
81
112
  }>;
@@ -1 +1 @@
1
- export const SPINDLE_STT_HOST_CAPABILITIES = Object.freeze({ 'speech-to-text-v1': 1 });
1
+ export const SPINDLE_STT_HOST_CAPABILITIES = Object.freeze({ 'speech-to-text-v1': 1, 'speech-to-text-options-v1': 1 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumiverse-spindle-types",
3
- "version": "0.6.54",
3
+ "version": "0.6.55",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "keywords": [