lumiverse-spindle-types 0.6.38 → 0.6.39
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/dom.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/permissions.d.ts +3 -2
- package/dist/speech-to-text.d.ts +81 -0
- package/dist/speech-to-text.js +1 -0
- package/package.json +1 -1
package/dist/dom.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SpindleSTTAPI } from "./speech-to-text.js";
|
|
1
2
|
import type { ChatDTO, ChatMessageDTO, ChatUpdateDTO, ConnectionProfileDTO, LlmMessageDTO, PromptBlockDTO, PromptVariableValuesDTO, RequestInitDTO, TokenCountOptionsDTO, TokenCountResultDTO, WorldBookCreateDTO, WorldBookDTO, WorldBookEntryCreateDTO, WorldBookEntryDTO, WorldBookEntryUpdateDTO, WorldBookUpdateDTO } from "./api.js";
|
|
2
3
|
import type { SpindleComponentsHelper } from "./components.js";
|
|
3
4
|
import type { SpindleHostDescriptorV1, SpindleHostLocaleAPI } from "./host.js";
|
|
@@ -1033,6 +1034,8 @@ export interface SpindleRecentChatsPage<TRow = SpindleRecentChat> {
|
|
|
1033
1034
|
}
|
|
1034
1035
|
/** Context object provided to frontend extension modules */
|
|
1035
1036
|
export interface SpindleFrontendContext {
|
|
1037
|
+
/** Host-managed STT. Feature-detect speech-to-text-v1; unavailable on older hosts. */
|
|
1038
|
+
readonly stt?: SpindleSTTAPI;
|
|
1036
1039
|
/** Per-document routing identity, available with frontend-session-origin-v1. */
|
|
1037
1040
|
readonly frontendSessionId?: string;
|
|
1038
1041
|
/** Immutable host compatibility descriptor for this extension runtime. */
|
package/dist/index.d.ts
CHANGED
|
@@ -23,3 +23,5 @@ export type { EntityTypeDTO, EntityStatusDTO, MentionRoleDTO, RelationTypeDTO, R
|
|
|
23
23
|
export type { SpindleAPI, SpindleGenerateAPI, SpindleConnectionsAPI, SpindlePromptRegex, FrontendProcessHandle, BackendProcessHandle, SpindleBackendProcessContext, SpindleBackendProcessModule, SpindleEmbeddingDriver, SpindleTtsEngine, SpindleSttEngine, SpindleSidecarEndpoint, } from "./spindle-api.js";
|
|
24
24
|
export type { CouncilMember, CouncilMemberContext, SidecarConfig, CouncilSidecarConfig, CouncilToolsSettings, CouncilSettings, CouncilToolResult, CouncilExecutionResult, CachedCouncilResult, CouncilToolCategory, CouncilToolExecution, CouncilToolDefinition, } from "./council.js";
|
|
25
25
|
export { SIDECAR_DEFAULTS, COUNCIL_SIDECAR_DEFAULTS, COUNCIL_TOOLS_DEFAULTS, COUNCIL_SETTINGS_DEFAULTS, } from "./council.js";
|
|
26
|
+
export type { SpindleSTTProvider, SpindleSTTProviderOption, SpindleSTTStatus, SpindleSTTResult, SpindleSTTAudioFrame, SpindleSTTTranscript, SpindleSTTPcmAudio, SpindleSTTOptions, SpindleSTTStartOptions, SpindleSTTSession, SpindleSTTAPI, } from "./speech-to-text.js";
|
|
27
|
+
export { SPINDLE_STT_HOST_CAPABILITIES } from "./speech-to-text.js";
|
package/dist/index.js
CHANGED
|
@@ -7,3 +7,4 @@ export { SpindleEvent, CoreEventType } from "./events.js";
|
|
|
7
7
|
export { ALL_FRONTEND_RUNTIME_CAPABILITIES, isValidFrontendRuntimeCapability, } from "./frontend-capabilities.js";
|
|
8
8
|
export { PERMISSION_DENIED_PREFIX } from "./api.js";
|
|
9
9
|
export { SIDECAR_DEFAULTS, COUNCIL_SIDECAR_DEFAULTS, COUNCIL_TOOLS_DEFAULTS, COUNCIL_SETTINGS_DEFAULTS, } from "./council.js";
|
|
10
|
+
export { SPINDLE_STT_HOST_CAPABILITIES } from "./speech-to-text.js";
|
package/dist/permissions.d.ts
CHANGED
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
* - "memories" — CRUD on the Memory Cortex (entities, relations, vaults, chat
|
|
19
19
|
* links, consolidations) and long-term chat memory (vectorized
|
|
20
20
|
* chat-chunk retrieval, warmup, cache).
|
|
21
|
-
* - "media" — invoke the
|
|
22
|
-
* transcoding, muxing, and simple image+audio composition
|
|
21
|
+
* - "media" — invoke the host media pipeline for audio/video conversion,
|
|
22
|
+
* transcoding, muxing, and simple image+audio composition; frontend STT
|
|
23
|
+
* and microphone capture through ctx.stt (browser consent also required).
|
|
23
24
|
* - "macro_interceptor" — transform raw templates before macro parsing/dispatch
|
|
24
25
|
* - "web_search" — execute searches via the user's configured web search
|
|
25
26
|
* provider (e.g. SearXNG) and read the safe view of their
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/** Host-managed speech recognition for frontend Spindle extensions. */
|
|
2
|
+
export type SpindleSTTProvider = 'webspeech' | 'connection' | 'whistle';
|
|
3
|
+
export interface SpindleSTTProviderOption {
|
|
4
|
+
id: SpindleSTTProvider;
|
|
5
|
+
name: string;
|
|
6
|
+
/** Whistle runs entirely on the device. Web Speech behavior depends on the browser. */
|
|
7
|
+
onDevice: boolean;
|
|
8
|
+
available: boolean;
|
|
9
|
+
unavailableReason?: string;
|
|
10
|
+
supportsAudioTranscription: boolean;
|
|
11
|
+
languages?: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
export interface SpindleSTTStatus {
|
|
14
|
+
phase: 'loading' | 'listening' | 'processing';
|
|
15
|
+
progress?: number;
|
|
16
|
+
}
|
|
17
|
+
/** One engine update: final segments append; interim updates replace the pending segment. */
|
|
18
|
+
export interface SpindleSTTResult {
|
|
19
|
+
text: string;
|
|
20
|
+
isFinal: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface SpindleSTTAudioFrame {
|
|
23
|
+
amplitude: number;
|
|
24
|
+
peak: number;
|
|
25
|
+
frequencies: number[];
|
|
26
|
+
}
|
|
27
|
+
export interface SpindleSTTTranscript {
|
|
28
|
+
text: string;
|
|
29
|
+
provider: SpindleSTTProvider;
|
|
30
|
+
language?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Mono PCM for Whistle. Samples are copied; the caller's buffer is never detached. */
|
|
33
|
+
export interface SpindleSTTPcmAudio {
|
|
34
|
+
samples: Float32Array;
|
|
35
|
+
sampleRate: number;
|
|
36
|
+
}
|
|
37
|
+
export interface SpindleSTTOptions {
|
|
38
|
+
/** Defaults to the user's current Voice & Speech selection. */
|
|
39
|
+
provider?: SpindleSTTProvider;
|
|
40
|
+
language?: string;
|
|
41
|
+
/** Used only with the connection provider; defaults to the user's STT connection. */
|
|
42
|
+
connectionId?: string;
|
|
43
|
+
signal?: AbortSignal;
|
|
44
|
+
onStatus?(status: SpindleSTTStatus): void;
|
|
45
|
+
}
|
|
46
|
+
export interface SpindleSTTStartOptions extends SpindleSTTOptions {
|
|
47
|
+
/** Defaults to false: finish after confirmed speech followed by silence. */
|
|
48
|
+
continuous?: boolean;
|
|
49
|
+
/** Defaults to the user's interim-result preference. */
|
|
50
|
+
interimResults?: boolean;
|
|
51
|
+
onResult?(result: SpindleSTTResult): void;
|
|
52
|
+
onAudioFrame?(frame: SpindleSTTAudioFrame): void;
|
|
53
|
+
}
|
|
54
|
+
export interface SpindleSTTSession {
|
|
55
|
+
readonly provider: SpindleSTTProvider;
|
|
56
|
+
/** Resolves when capture starts. Call start() directly from a user gesture. */
|
|
57
|
+
readonly ready: Promise<void>;
|
|
58
|
+
/** Resolves after recording ends and the final transcription finishes. */
|
|
59
|
+
readonly result: Promise<SpindleSTTTranscript>;
|
|
60
|
+
/** Stops capture and waits for the final transcript; safe to call repeatedly. */
|
|
61
|
+
stop(): Promise<SpindleSTTTranscript>;
|
|
62
|
+
/** Releases the microphone immediately; ready/result reject with AbortError if pending. */
|
|
63
|
+
cancel(): void;
|
|
64
|
+
}
|
|
65
|
+
/** Host-managed frontend STT, available with speech-to-text-v1. No model installation needed. */
|
|
66
|
+
export interface SpindleSTTAPI {
|
|
67
|
+
/** Capability discovery is free and never requests microphone access. */
|
|
68
|
+
listProviders(): SpindleSTTProviderOption[];
|
|
69
|
+
/** Requires media. Prepares Whistle without requesting microphone access. */
|
|
70
|
+
prepare(options?: SpindleSTTOptions): Promise<void>;
|
|
71
|
+
/** Requires media and browser microphone permission. One extension capture per document. */
|
|
72
|
+
start(options?: SpindleSTTStartOptions): SpindleSTTSession;
|
|
73
|
+
/**
|
|
74
|
+
* Requires media. Whistle accepts a decodable audio Blob or mono PCM; connection accepts a Blob.
|
|
75
|
+
* Web Speech cannot transcribe supplied audio. Whistle is capped at ten minutes / 64 MiB.
|
|
76
|
+
*/
|
|
77
|
+
transcribe(audio: Blob | SpindleSTTPcmAudio, options?: SpindleSTTOptions): Promise<SpindleSTTTranscript>;
|
|
78
|
+
}
|
|
79
|
+
export declare const SPINDLE_STT_HOST_CAPABILITIES: Readonly<{
|
|
80
|
+
'speech-to-text-v1': 1;
|
|
81
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const SPINDLE_STT_HOST_CAPABILITIES = Object.freeze({ 'speech-to-text-v1': 1 });
|