lumiverse-spindle-types 0.6.42 → 0.6.44
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 +4 -1
- package/dist/permissions.js +1 -0
- package/dist/spindle-api.d.ts +1 -1
- package/dist/system-audio.d.ts +60 -0
- package/dist/system-audio.js +8 -0
- package/package.json +1 -1
package/dist/dom.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SpindleSTTAPI } from "./speech-to-text.js";
|
|
2
|
+
import type { SpindleSystemAudioAPI } from "./system-audio.js";
|
|
2
3
|
import type { SpindleFileDownloadAPI } from "./file-transfers.js";
|
|
3
4
|
import type { ChatDTO, ChatMessageDTO, ChatUpdateDTO, ConnectionProfileDTO, LlmMessageDTO, PromptBlockDTO, PromptVariableValuesDTO, RequestInitDTO, TokenCountOptionsDTO, TokenCountResultDTO, WorldBookCreateDTO, WorldBookDTO, WorldBookEntryCreateDTO, WorldBookEntryDTO, WorldBookEntryUpdateDTO, WorldBookUpdateDTO } from "./api.js";
|
|
4
5
|
import type { SpindleComponentsHelper } from "./components.js";
|
|
@@ -1047,6 +1048,8 @@ export interface SpindleFrontendContext {
|
|
|
1047
1048
|
readonly files: SpindleFileDownloadAPI;
|
|
1048
1049
|
/** Host-managed STT. Feature-detect speech-to-text-v1; unavailable on older hosts. */
|
|
1049
1050
|
readonly stt?: SpindleSTTAPI;
|
|
1051
|
+
/** Host-managed system-audio analysis (spectrum only). Feature-detect system-audio-v1; desktop client only. */
|
|
1052
|
+
readonly systemAudio?: SpindleSystemAudioAPI;
|
|
1050
1053
|
/** Per-document routing identity, available with frontend-session-origin-v1. */
|
|
1051
1054
|
readonly frontendSessionId?: string;
|
|
1052
1055
|
/** Immutable host compatibility descriptor for this extension runtime. */
|
package/dist/index.d.ts
CHANGED
|
@@ -27,3 +27,5 @@ export type { CouncilMember, CouncilMemberContext, SidecarConfig, CouncilSidecar
|
|
|
27
27
|
export { SIDECAR_DEFAULTS, COUNCIL_SIDECAR_DEFAULTS, COUNCIL_TOOLS_DEFAULTS, COUNCIL_SETTINGS_DEFAULTS, } from "./council.js";
|
|
28
28
|
export type { SpindleSTTProvider, SpindleSTTProviderOption, SpindleSTTStatus, SpindleSTTResult, SpindleSTTAudioFrame, SpindleSTTTranscript, SpindleSTTPcmAudio, SpindleSTTOptions, SpindleSTTStartOptions, SpindleSTTSession, SpindleSTTAPI, } from "./speech-to-text.js";
|
|
29
29
|
export { SPINDLE_STT_HOST_CAPABILITIES } from "./speech-to-text.js";
|
|
30
|
+
export type { SpindleSystemAudioUnavailableReason, SpindleSystemAudioAvailability, SpindleSystemAudioFrame, SpindleSystemAudioEndReason, SpindleSystemAudioStartOptions, SpindleSystemAudioSession, SpindleSystemAudioAPI, } from "./system-audio.js";
|
|
31
|
+
export { SPINDLE_SYSTEM_AUDIO_HOST_CAPABILITIES } from "./system-audio.js";
|
package/dist/index.js
CHANGED
|
@@ -9,3 +9,4 @@ export { ALL_FRONTEND_RUNTIME_CAPABILITIES, isValidFrontendRuntimeCapability, }
|
|
|
9
9
|
export { PERMISSION_DENIED_PREFIX } from "./api.js";
|
|
10
10
|
export { SIDECAR_DEFAULTS, COUNCIL_SIDECAR_DEFAULTS, COUNCIL_TOOLS_DEFAULTS, COUNCIL_SETTINGS_DEFAULTS, } from "./council.js";
|
|
11
11
|
export { SPINDLE_STT_HOST_CAPABILITIES } from "./speech-to-text.js";
|
|
12
|
+
export { SPINDLE_SYSTEM_AUDIO_HOST_CAPABILITIES } from "./system-audio.js";
|
package/dist/permissions.d.ts
CHANGED
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
* - "providers.sidecar.register" — register a sidecar HTTP endpoint
|
|
38
38
|
* - "mcp_servers" — inspect/connect user MCP servers and invoke advertised tools
|
|
39
39
|
* - "mcp_servers.create" — add MCP server profiles for a user
|
|
40
|
+
* - "system_audio" — frontend ctx.systemAudio: a spectrum and levels of the audio the
|
|
41
|
+
* device is playing (never samples), desktop client only. Privileged;
|
|
42
|
+
* the host asks the user on every start.
|
|
40
43
|
*/
|
|
41
|
-
export type SpindlePermission = "screen_capture" | "screen_recording" | "generation" | "interceptor" | "tools" | "cors_proxy" | "context_handler" | "ephemeral_storage" | "chat_mutation" | "event_tracking" | "ui_panels" | "app_manipulation" | "oauth" | "characters" | "chats" | "presets" | "world_books" | "regex_scripts" | "regex_scripts_unrestricted" | "databanks" | "memories" | "media" | "personas" | "push_notification" | "image_gen" | "images" | "generation_parameters" | "macro_interceptor" | "web_search" | "unsafe_eval" | "final_response" | "providers.embedding.register" | "providers.tts.register" | "providers.stt.register" | "providers.sidecar.register" | "mcp_servers" | "mcp_servers.create";
|
|
44
|
+
export type SpindlePermission = "screen_capture" | "screen_recording" | "system_audio" | "generation" | "interceptor" | "tools" | "cors_proxy" | "context_handler" | "ephemeral_storage" | "chat_mutation" | "event_tracking" | "ui_panels" | "app_manipulation" | "oauth" | "characters" | "chats" | "presets" | "world_books" | "regex_scripts" | "regex_scripts_unrestricted" | "databanks" | "memories" | "media" | "personas" | "push_notification" | "image_gen" | "images" | "generation_parameters" | "macro_interceptor" | "web_search" | "unsafe_eval" | "final_response" | "providers.embedding.register" | "providers.tts.register" | "providers.stt.register" | "providers.sidecar.register" | "mcp_servers" | "mcp_servers.create";
|
|
42
45
|
export declare const ALL_PERMISSIONS: readonly SpindlePermission[];
|
|
43
46
|
export declare function isValidPermission(p: string): p is SpindlePermission;
|
package/dist/permissions.js
CHANGED
package/dist/spindle-api.d.ts
CHANGED
|
@@ -760,7 +760,7 @@ export interface SpindleAPI {
|
|
|
760
760
|
* For operator-scoped extensions, pass userId to scope to a specific user.
|
|
761
761
|
*/
|
|
762
762
|
images: {
|
|
763
|
-
/** Read original stored bytes, up to
|
|
763
|
+
/** Read original stored bytes, up to 100 MiB. Rejects missing, inaccessible, or oversized assets. */
|
|
764
764
|
readBinary(imageId: string, userId?: string): Promise<Uint8Array>;
|
|
765
765
|
list(options?: ImageListOptionsDTO): Promise<{
|
|
766
766
|
data: ImageDTO[];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host-managed analysis of the audio the device is playing, for frontend Spindle extensions.
|
|
3
|
+
*
|
|
4
|
+
* Extensions receive a spectrum and levels only (the same shape as `SpindleSTTAudioFrame`): never samples, a
|
|
5
|
+
* `MediaStream`, or anything else from which what was played could be reconstructed. Available only where the host
|
|
6
|
+
* has a native adapter (the desktop client); feature-detect `system-audio-v1` and call `isAvailable()`.
|
|
7
|
+
*/
|
|
8
|
+
/** Why system audio cannot be started right now. */
|
|
9
|
+
export type SpindleSystemAudioUnavailableReason =
|
|
10
|
+
/** This host or device has no system-audio adapter (every browser, and desktop platforms without one). */
|
|
11
|
+
'unsupported'
|
|
12
|
+
/** The user has not enabled system-audio analysis for this client. */
|
|
13
|
+
| 'disabled';
|
|
14
|
+
export interface SpindleSystemAudioAvailability {
|
|
15
|
+
available: boolean;
|
|
16
|
+
unavailableReason?: SpindleSystemAudioUnavailableReason;
|
|
17
|
+
}
|
|
18
|
+
/** One analysis frame. Every number is normalised to 0 – 1. */
|
|
19
|
+
export interface SpindleSystemAudioFrame {
|
|
20
|
+
/** Overall level (RMS). */
|
|
21
|
+
amplitude: number;
|
|
22
|
+
/** Loudest recent level. */
|
|
23
|
+
peak: number;
|
|
24
|
+
/** `bands` log-spaced magnitudes from about 40 Hz up to about 14 kHz, lowest first. */
|
|
25
|
+
frequencies: number[];
|
|
26
|
+
}
|
|
27
|
+
/** Why a session ended without the extension calling `stop()`. */
|
|
28
|
+
export type SpindleSystemAudioEndReason = 'revoked' | 'user-stopped' | 'source-lost' | 'host-disabled';
|
|
29
|
+
export interface SpindleSystemAudioStartOptions {
|
|
30
|
+
/** Number of bands in each frame, 8 – 64 (default 32). The host clamps out-of-range values. */
|
|
31
|
+
bands?: number;
|
|
32
|
+
/** Most frames per second, 1 – 30 (default 30). The host clamps out-of-range values. */
|
|
33
|
+
maxFps?: number;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
onFrame(frame: SpindleSystemAudioFrame): void;
|
|
36
|
+
/** Called once if the host ends the session (permission revoked, the user pressed Stop on the host's indicator, the device went away). */
|
|
37
|
+
onEnd?(reason: SpindleSystemAudioEndReason): void;
|
|
38
|
+
}
|
|
39
|
+
export interface SpindleSystemAudioSession {
|
|
40
|
+
/**
|
|
41
|
+
* Resolves when the user has approved the host's prompt and analysis has begun. Rejects with a `NotAllowedError`
|
|
42
|
+
* `DOMException` if the user declines, `NotSupportedError` if unavailable, and `AbortError` if cancelled first.
|
|
43
|
+
*/
|
|
44
|
+
readonly ready: Promise<void>;
|
|
45
|
+
/** Stops analysis immediately; safe to call repeatedly. */
|
|
46
|
+
stop(): void;
|
|
47
|
+
}
|
|
48
|
+
/** Host-managed system-audio analysis, available with `system-audio-v1`. */
|
|
49
|
+
export interface SpindleSystemAudioAPI {
|
|
50
|
+
/** Free. Never prompts, and never opens anything. */
|
|
51
|
+
isAvailable(): SpindleSystemAudioAvailability;
|
|
52
|
+
/**
|
|
53
|
+
* Requires `system_audio`. Call directly from a user gesture. The host asks the user for approval on every
|
|
54
|
+
* start and shows an indicator for as long as analysis runs. One session per extension at a time.
|
|
55
|
+
*/
|
|
56
|
+
start(options: SpindleSystemAudioStartOptions): SpindleSystemAudioSession;
|
|
57
|
+
}
|
|
58
|
+
export declare const SPINDLE_SYSTEM_AUDIO_HOST_CAPABILITIES: Readonly<{
|
|
59
|
+
'system-audio-v1': 1;
|
|
60
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host-managed analysis of the audio the device is playing, for frontend Spindle extensions.
|
|
3
|
+
*
|
|
4
|
+
* Extensions receive a spectrum and levels only (the same shape as `SpindleSTTAudioFrame`): never samples, a
|
|
5
|
+
* `MediaStream`, or anything else from which what was played could be reconstructed. Available only where the host
|
|
6
|
+
* has a native adapter (the desktop client); feature-detect `system-audio-v1` and call `isAvailable()`.
|
|
7
|
+
*/
|
|
8
|
+
export const SPINDLE_SYSTEM_AUDIO_HOST_CAPABILITIES = Object.freeze({ 'system-audio-v1': 1 });
|