lumiverse-spindle-types 0.6.41 → 0.6.43
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/api.d.ts +1 -1
- package/dist/dom.d.ts +6 -0
- package/dist/file-transfers.d.ts +157 -0
- package/dist/file-transfers.js +10 -0
- package/dist/host.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/permissions.d.ts +4 -1
- package/dist/permissions.js +1 -0
- package/dist/spindle-api.d.ts +5 -0
- package/dist/system-audio.d.ts +60 -0
- package/dist/system-audio.js +8 -0
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -3333,7 +3333,7 @@ export interface ProviderManager {
|
|
|
3333
3333
|
key: ProviderKeyDTO;
|
|
3334
3334
|
}) => void): () => void;
|
|
3335
3335
|
}
|
|
3336
|
-
export type WorkerToHost = import("./desktop-capture.js").DesktopCaptureWorkerMessage | {
|
|
3336
|
+
export type WorkerToHost = import("./file-transfers.js").FileTransferWorkerMessage | import("./desktop-capture.js").DesktopCaptureWorkerMessage | {
|
|
3337
3337
|
type: "subscribe_event";
|
|
3338
3338
|
event: string;
|
|
3339
3339
|
} | {
|
package/dist/dom.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { SpindleSTTAPI } from "./speech-to-text.js";
|
|
2
|
+
import type { SpindleSystemAudioAPI } from "./system-audio.js";
|
|
3
|
+
import type { SpindleFileDownloadAPI } from "./file-transfers.js";
|
|
2
4
|
import type { ChatDTO, ChatMessageDTO, ChatUpdateDTO, ConnectionProfileDTO, LlmMessageDTO, PromptBlockDTO, PromptVariableValuesDTO, RequestInitDTO, TokenCountOptionsDTO, TokenCountResultDTO, WorldBookCreateDTO, WorldBookDTO, WorldBookEntryCreateDTO, WorldBookEntryDTO, WorldBookEntryUpdateDTO, WorldBookUpdateDTO } from "./api.js";
|
|
3
5
|
import type { SpindleComponentsHelper } from "./components.js";
|
|
4
6
|
import type { SpindleHostDescriptorV1, SpindleHostLocaleAPI } from "./host.js";
|
|
@@ -1042,8 +1044,12 @@ export interface SpindleRecentChatsPage<TRow = SpindleRecentChat> {
|
|
|
1042
1044
|
}
|
|
1043
1045
|
/** Context object provided to frontend extension modules */
|
|
1044
1046
|
export interface SpindleFrontendContext {
|
|
1047
|
+
/** Native downloads of completed backend files. Available with file-transfers-v1. */
|
|
1048
|
+
readonly files: SpindleFileDownloadAPI;
|
|
1045
1049
|
/** Host-managed STT. Feature-detect speech-to-text-v1; unavailable on older hosts. */
|
|
1046
1050
|
readonly stt?: SpindleSTTAPI;
|
|
1051
|
+
/** Host-managed system-audio analysis (spectrum only). Feature-detect system-audio-v1; desktop client only. */
|
|
1052
|
+
readonly systemAudio?: SpindleSystemAudioAPI;
|
|
1047
1053
|
/** Per-document routing identity, available with frontend-session-origin-v1. */
|
|
1048
1054
|
readonly frontendSessionId?: string;
|
|
1049
1055
|
/** Immutable host compatibility descriptor for this extension runtime. */
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/** Maximum bytes in a worker read/write chunk; process one chunk at a time. */
|
|
2
|
+
export declare const SPINDLE_FILE_CHUNK_BYTES: number;
|
|
3
|
+
/** Per-file and per-installation/user aggregate staged storage ceiling. */
|
|
4
|
+
export declare const SPINDLE_FILE_MAX_BYTES: number;
|
|
5
|
+
/** Default disk reservation for downloads, generated files, and ZIP output. */
|
|
6
|
+
export declare const SPINDLE_FILE_DEFAULT_MAX_BYTES: number;
|
|
7
|
+
/** Inactivity lifetime; active readers and archive inputs are pinned. */
|
|
8
|
+
export declare const SPINDLE_FILE_TTL_MS: number;
|
|
9
|
+
/** Maximum staged file count per installation/user and archive entry count. */
|
|
10
|
+
export declare const SPINDLE_FILE_MAX_COUNT = 10000;
|
|
11
|
+
/** Opaque host-owned file reference. Paths and complete archive bytes stay on the host. */
|
|
12
|
+
export interface SpindleFileRef {
|
|
13
|
+
fileId: string;
|
|
14
|
+
fileName: string;
|
|
15
|
+
size: number;
|
|
16
|
+
mimeType: string;
|
|
17
|
+
}
|
|
18
|
+
/** A completed staged file or tus upload owned by this extension and user. */
|
|
19
|
+
export type SpindleFileSource = {
|
|
20
|
+
fileId: string;
|
|
21
|
+
} | {
|
|
22
|
+
uploadId: string;
|
|
23
|
+
};
|
|
24
|
+
export interface FileOperationOptions {
|
|
25
|
+
/** Required for operator-scoped extensions; inferred for user-scoped extensions. */
|
|
26
|
+
userId?: string;
|
|
27
|
+
/** Cancels the producer and cleans up partial output; rejects with AbortError. */
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
}
|
|
30
|
+
export interface FileFetchOptions extends FileOperationOptions {
|
|
31
|
+
headers?: Record<string, string>;
|
|
32
|
+
/** Default: download.bin. */
|
|
33
|
+
fileName?: string;
|
|
34
|
+
/** Maximum actual response bytes and disk reservation. Default: 5 GiB; maximum: 100 GiB. */
|
|
35
|
+
maxBytes?: number;
|
|
36
|
+
/** Default: 30 minutes; maximum: 1 hour. Includes body consumption. */
|
|
37
|
+
timeoutMs?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface SpindleFileCreateInput {
|
|
40
|
+
fileName: string;
|
|
41
|
+
/** Exact final byte length. Specify size or maxBytes, never both. */
|
|
42
|
+
size?: number;
|
|
43
|
+
/** Output budget for unknown-length producers. Default: 5 GiB. */
|
|
44
|
+
maxBytes?: number;
|
|
45
|
+
mimeType?: string;
|
|
46
|
+
userId?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface SpindleFileChunk {
|
|
49
|
+
data: Uint8Array;
|
|
50
|
+
offset: number;
|
|
51
|
+
/** Total file length, not the length of this chunk. */
|
|
52
|
+
size: number;
|
|
53
|
+
eof: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface SpindleArchiveEntry {
|
|
56
|
+
/** Safe relative ZIP file name. Directory records and duplicate names reject. */
|
|
57
|
+
name: string;
|
|
58
|
+
source: SpindleFileSource;
|
|
59
|
+
/** Skip compression for already compressed assets. */
|
|
60
|
+
store?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface ArchiveCreateOptions extends FileOperationOptions {
|
|
63
|
+
/** Default: export.zip. */
|
|
64
|
+
fileName?: string;
|
|
65
|
+
/** Output budget. Default: 5 GiB; maximum: 100 GiB. */
|
|
66
|
+
maxBytes?: number;
|
|
67
|
+
}
|
|
68
|
+
export interface ArchiveExtractOptions extends FileOperationOptions {
|
|
69
|
+
/** Exact ZIP file names to extract. Omit for all files; an empty list extracts none. */
|
|
70
|
+
entries?: string[];
|
|
71
|
+
/** Total expansion limit and disk reservation. Default/maximum: 20 GiB. */
|
|
72
|
+
maxDecompressedBytes?: number;
|
|
73
|
+
}
|
|
74
|
+
export interface SpindleArchiveExtractedEntry {
|
|
75
|
+
/** Original relative entry name, including its archive directories. */
|
|
76
|
+
name: string;
|
|
77
|
+
file: SpindleFileRef;
|
|
78
|
+
}
|
|
79
|
+
/** Available with file-transfers-v1. All files are scoped to the installation, user, and worker lifetime. */
|
|
80
|
+
export interface SpindleFilesAPI {
|
|
81
|
+
/** GET through the host to disk. Requires cors_proxy; rejects non-success HTTP statuses. */
|
|
82
|
+
fetch(url: string, options?: FileFetchOptions): Promise<SpindleFileRef>;
|
|
83
|
+
/** Reserve a byte budget and create an incomplete file for sequential writes. */
|
|
84
|
+
create(input: SpindleFileCreateInput): Promise<SpindleFileRef>;
|
|
85
|
+
/** Write 1–SPINDLE_FILE_CHUNK_BYTES bytes at the current offset. Returns the next offset. */
|
|
86
|
+
writeChunk(fileId: string, offset: number, data: Uint8Array, userId?: string): Promise<number>;
|
|
87
|
+
/** Verify the byte budget/exact size, release unused capacity, and make the file immutable. */
|
|
88
|
+
finish(fileId: string, userId?: string): Promise<SpindleFileRef>;
|
|
89
|
+
/** Read at most SPINDLE_FILE_CHUNK_BYTES from a completed file or upload. */
|
|
90
|
+
readChunk(source: SpindleFileSource, offset: number, userId?: string): Promise<SpindleFileChunk>;
|
|
91
|
+
/** Delete an idle file. Unknown/expired/foreign ids return false; active files reject. */
|
|
92
|
+
delete(fileId: string, userId?: string): Promise<boolean>;
|
|
93
|
+
/** Relative attachment URL requiring the owning user's session cookie. */
|
|
94
|
+
getDownloadUrl(fileId: string, userId?: string): Promise<string>;
|
|
95
|
+
}
|
|
96
|
+
/** Host-side ZIP/ZIP64 processing with bounded memory and disk-backed output. */
|
|
97
|
+
export interface SpindleArchivesAPI {
|
|
98
|
+
create(entries: SpindleArchiveEntry[], options?: ArchiveCreateOptions): Promise<SpindleFileRef>;
|
|
99
|
+
/** Validate safe names, expansion, entry sizes, and CRC32; return staged file references. */
|
|
100
|
+
extract(source: SpindleFileSource, options?: ArchiveExtractOptions): Promise<SpindleArchiveExtractedEntry[]>;
|
|
101
|
+
}
|
|
102
|
+
export interface SpindleFileDownloadAPI {
|
|
103
|
+
/** Start a native browser/WebView attachment download without assembling a JavaScript Blob. */
|
|
104
|
+
download(fileId: string): void;
|
|
105
|
+
}
|
|
106
|
+
/** Signals stay in the worker; cancellation crosses the wire by operation id. */
|
|
107
|
+
export type FileTransferWorkerMessage = {
|
|
108
|
+
type: "files_fetch";
|
|
109
|
+
requestId: string;
|
|
110
|
+
url: string;
|
|
111
|
+
options: Omit<FileFetchOptions, "signal">;
|
|
112
|
+
} | {
|
|
113
|
+
type: "files_create";
|
|
114
|
+
requestId: string;
|
|
115
|
+
input: SpindleFileCreateInput;
|
|
116
|
+
} | {
|
|
117
|
+
type: "files_write_chunk";
|
|
118
|
+
requestId: string;
|
|
119
|
+
fileId: string;
|
|
120
|
+
offset: number;
|
|
121
|
+
data: Uint8Array;
|
|
122
|
+
userId?: string;
|
|
123
|
+
} | {
|
|
124
|
+
type: "files_finish";
|
|
125
|
+
requestId: string;
|
|
126
|
+
fileId: string;
|
|
127
|
+
userId?: string;
|
|
128
|
+
} | {
|
|
129
|
+
type: "files_delete";
|
|
130
|
+
requestId: string;
|
|
131
|
+
fileId: string;
|
|
132
|
+
userId?: string;
|
|
133
|
+
} | {
|
|
134
|
+
type: "files_download_url";
|
|
135
|
+
requestId: string;
|
|
136
|
+
fileId: string;
|
|
137
|
+
userId?: string;
|
|
138
|
+
} | {
|
|
139
|
+
type: "files_read_chunk";
|
|
140
|
+
requestId: string;
|
|
141
|
+
source: SpindleFileSource;
|
|
142
|
+
offset: number;
|
|
143
|
+
userId?: string;
|
|
144
|
+
} | {
|
|
145
|
+
type: "archives_create";
|
|
146
|
+
requestId: string;
|
|
147
|
+
entries: SpindleArchiveEntry[];
|
|
148
|
+
options: Omit<ArchiveCreateOptions, "signal">;
|
|
149
|
+
} | {
|
|
150
|
+
type: "archives_extract";
|
|
151
|
+
requestId: string;
|
|
152
|
+
source: SpindleFileSource;
|
|
153
|
+
options: Omit<ArchiveExtractOptions, "signal">;
|
|
154
|
+
} | {
|
|
155
|
+
type: "files_cancel";
|
|
156
|
+
operationId: string;
|
|
157
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Maximum bytes in a worker read/write chunk; process one chunk at a time. */
|
|
2
|
+
export const SPINDLE_FILE_CHUNK_BYTES = 1024 * 1024;
|
|
3
|
+
/** Per-file and per-installation/user aggregate staged storage ceiling. */
|
|
4
|
+
export const SPINDLE_FILE_MAX_BYTES = 100 * 1024 ** 3;
|
|
5
|
+
/** Default disk reservation for downloads, generated files, and ZIP output. */
|
|
6
|
+
export const SPINDLE_FILE_DEFAULT_MAX_BYTES = 5 * 1024 ** 3;
|
|
7
|
+
/** Inactivity lifetime; active readers and archive inputs are pinned. */
|
|
8
|
+
export const SPINDLE_FILE_TTL_MS = 30 * 60 * 1000;
|
|
9
|
+
/** Maximum staged file count per installation/user and archive entry count. */
|
|
10
|
+
export const SPINDLE_FILE_MAX_COUNT = 10_000;
|
package/dist/host.js
CHANGED
|
@@ -11,6 +11,7 @@ export const SPINDLE_HOST_CAPABILITIES = Object.freeze({
|
|
|
11
11
|
"frontend-extensibility-v2": 1,
|
|
12
12
|
"frontend-runtime-capabilities-v1": 1,
|
|
13
13
|
"mcp-servers-v1": 1,
|
|
14
|
+
"file-transfers-v1": 1,
|
|
14
15
|
});
|
|
15
16
|
/** Structured error code returned when host compatibility validation fails. */
|
|
16
17
|
export const SPINDLE_COMPATIBILITY_ERROR_CODE = "SPINDLE_COMPATIBILITY_ERROR";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export type { SpindleManifest, SpindlePermission, SpindleCapability, } from "./manifest.js";
|
|
2
2
|
export { IDENTIFIER_PATTERN, validateIdentifier, } from "./manifest.js";
|
|
3
3
|
export type { SpindleHostDescriptorV1, SpindleHostLocale, SpindleHostLocaleAPI, } from "./host.js";
|
|
4
|
+
export type { SpindleFileRef, SpindleFileSource, FileOperationOptions, FileFetchOptions, SpindleFileCreateInput, SpindleFileChunk, SpindleArchiveEntry, ArchiveCreateOptions, ArchiveExtractOptions, SpindleArchiveExtractedEntry, SpindleFilesAPI, SpindleArchivesAPI, SpindleFileDownloadAPI, FileTransferWorkerMessage, } from "./file-transfers.js";
|
|
5
|
+
export { SPINDLE_FILE_CHUNK_BYTES, SPINDLE_FILE_MAX_BYTES, SPINDLE_FILE_DEFAULT_MAX_BYTES, SPINDLE_FILE_TTL_MS, SPINDLE_FILE_MAX_COUNT, } from "./file-transfers.js";
|
|
4
6
|
export { SPINDLE_HOST_CAPABILITIES, SPINDLE_COMPATIBILITY_ERROR_CODE, } from "./host.js";
|
|
5
7
|
export type { SpindleThemeAsset, SpindleThemeAssetUploadOptions, SpindleThemeAssetUpdate, SpindleThemePackComponentDraft, SpindleThemePackDraft, SpindleThemePackImportResult, SpindleThemePackInstallOptions, SpindleThemePackInstallResult, SpindleThemeComponentCatalogEntry, SpindleThemeVariableCatalogEntry, SpindleThemeEditorTarget, SpindleThemeEditorOptions, SpindleThemeAuthoringAPI, } from "./theme.js";
|
|
6
8
|
export { SPINDLE_THEME_AUTHORING_HOST_CAPABILITIES } from "./theme.js";
|
|
@@ -25,3 +27,5 @@ export type { CouncilMember, CouncilMemberContext, SidecarConfig, CouncilSidecar
|
|
|
25
27
|
export { SIDECAR_DEFAULTS, COUNCIL_SIDECAR_DEFAULTS, COUNCIL_TOOLS_DEFAULTS, COUNCIL_SETTINGS_DEFAULTS, } from "./council.js";
|
|
26
28
|
export type { SpindleSTTProvider, SpindleSTTProviderOption, SpindleSTTStatus, SpindleSTTResult, SpindleSTTAudioFrame, SpindleSTTTranscript, SpindleSTTPcmAudio, SpindleSTTOptions, SpindleSTTStartOptions, SpindleSTTSession, SpindleSTTAPI, } from "./speech-to-text.js";
|
|
27
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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { IDENTIFIER_PATTERN, validateIdentifier, } from "./manifest.js";
|
|
2
|
+
export { SPINDLE_FILE_CHUNK_BYTES, SPINDLE_FILE_MAX_BYTES, SPINDLE_FILE_DEFAULT_MAX_BYTES, SPINDLE_FILE_TTL_MS, SPINDLE_FILE_MAX_COUNT, } from "./file-transfers.js";
|
|
2
3
|
export { SPINDLE_HOST_CAPABILITIES, SPINDLE_COMPATIBILITY_ERROR_CODE, } from "./host.js";
|
|
3
4
|
export { SPINDLE_THEME_AUTHORING_HOST_CAPABILITIES } from "./theme.js";
|
|
4
5
|
export { ALL_PERMISSIONS, isValidPermission } from "./permissions.js";
|
|
@@ -8,3 +9,4 @@ export { ALL_FRONTEND_RUNTIME_CAPABILITIES, isValidFrontendRuntimeCapability, }
|
|
|
8
9
|
export { PERMISSION_DENIED_PREFIX } from "./api.js";
|
|
9
10
|
export { SIDECAR_DEFAULTS, COUNCIL_SIDECAR_DEFAULTS, COUNCIL_TOOLS_DEFAULTS, COUNCIL_SETTINGS_DEFAULTS, } from "./council.js";
|
|
10
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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SpindleManifest } from "./manifest.js";
|
|
2
2
|
import type { SpindleHostDescriptorV1 } from "./host.js";
|
|
3
3
|
import type { SpindleDesktopAPI } from "./desktop-capture.js";
|
|
4
|
+
import type { SpindleFilesAPI, SpindleArchivesAPI } from "./file-transfers.js";
|
|
4
5
|
import type { SpindleTextEditorOptions, SpindleTextEditorResult } from "./dom.js";
|
|
5
6
|
import type { CouncilMemberContext, CouncilSettings } from "./council.js";
|
|
6
7
|
import type { LlmMessageDTO, InterceptorDisposer, InterceptorHandler, InterceptorRegistrationMatchOptions, InterceptorRegistrationOptions, MacroDefinitionDTO, MacroResolveOptionsDTO, MacroResolveResultDTO, ToolRegistrationDTO, GenerationRequestDTO, ChatAppendMessageOptionsDTO, RequestInitDTO, ConnectionProfileDTO, ConnectionDispatchDescriptorDTO, PermissionDeniedDetail, PermissionChangedDetail, CharacterDTO, CharacterCreateDTO, CharacterAvatarUploadDTO, CharacterUpdateDTO, ChatDTO, ChatUpdateDTO, UserPresetDTO, UserPresetCreateDTO, UserPresetUpdateDTO, PromptBlockSnapshotDTO, PromptBlockCreateDTO, PromptBlockUpdateDTO, PromptBlockCategoryGroupDTO, WorldBookDTO, WorldBookCreateDTO, WorldBookUpdateDTO, WorldBookEntryDTO, WorldBookEntryCreateDTO, WorldBookEntryUpdateDTO, RegexScriptDTO, RegexScriptCreateDTO, RegexScriptUpdateDTO, RegexScriptListOptionsDTO, RegexScriptActiveOptionsDTO, ActivationPatternsOptions, ActivationPatternsResult, DatabankDTO, DatabankCreateDTO, DatabankUpdateDTO, DatabankDocumentDTO, DatabankDocumentCreateDTO, DatabankDocumentUpdateDTO, PersonaDTO, GlobalAddonDTO, GlobalAddonUpdateDTO, LumiaItemDTO, LumiaDlcCatalogDTO, PersonaCreateDTO, PersonaUpdateDTO, ActivatedWorldInfoEntryDTO, DryRunRequestDTO, DryRunResultDTO, SavedBreakdownDTO, AssembleRequestDTO, AssembleResultDTO, BoundAssembleRequestDTO, BoundAssemblyOutcomeDTO, QuietTrackedRequestDTO, QuietTrackedResultDTO, BrokerRequest, BrokerResponse, ChatMemoryResultDTO, ProviderManager, ImageGenRequestDTO, ImageGenResultDTO, ImageGenNativeRequestDTO, ImageGenNativeResultDTO, ImageGenPromptPresetsResultDTO, ImageGenStreamRequestDTO, ImageGenStreamEventDTO, ImageGenConnectionDTO, ImageGenProviderDTO, ImageGetOptionsDTO, ImageDTO, ImageListOptionsDTO, ImageUploadDTO, ImageUploadFromDataUrlOptionsDTO, MediaConvertAudioRequestDTO, MediaConvertVideoRequestDTO, MediaTranscodeVideoRequestDTO, MediaRemoveAudioFromVideoRequestDTO, MediaAddAudioToVideoRequestDTO, MediaCreateVideoFromImageAndAudioRequestDTO, MediaTransformResultDTO, ThemeOverrideDTO, ThemeInfoDTO, ThemePaletteConfigDTO, ThemeVariablesConfigDTO, ColorExtractionResult, SpindleUserRoleDTO, SpindleModalItemDTO, SpindleCommandDTO, SpindleCommandContextDTO, SpindleUIDrawerTabDTO, SpindleUISettingsTabDTO, FrontendProcessSpawnOptionsDTO, FrontendProcessListOptionsDTO, FrontendProcessInfoDTO, FrontendProcessLifecycleEventDTO, FrontendProcessStopOptionsDTO, BackendProcessSpawnOptionsDTO, BackendProcessListOptionsDTO, BackendProcessInfoDTO, BackendProcessLifecycleEventDTO, BackendProcessStopOptionsDTO, ChatChangedPayloadDTO, ChatForkedPayloadDTO, ChatMessageDTO, GenerationStartedPayloadDTO, StreamTokenPayloadDTO, GenerationEndedPayloadDTO, GenerationStoppedPayloadDTO, GenerationObserver, MessageSwipedPayloadDTO, SwipeEditedPayloadDTO, ToolInvocationPayloadDTO, StreamChunkDTO, TokenCountOptionsDTO, TokenCountResultDTO, SpindleUploadDTO, MacroInterceptorCtxDTO, MacroInterceptorResultDTO, WorldInfoInterceptorCtxDTO, WorldInfoInterceptorResultDTO, MessageContentProcessorCtxDTO, MessageContentProcessorResultDTO, SharedRpcRequestContextDTO, SharedRpcEndpointPolicyDTO, WebSearchRequestDTO, WebSearchResponseDTO, WebSearchSettingsDTO, McpServerDTO, McpServerCreateDTO, McpServerStatusDTO, McpToolDTO, McpToolCallOptionsDTO } from "./api.js";
|
|
@@ -133,6 +134,10 @@ export interface SpindleConnectionsAPI {
|
|
|
133
134
|
}
|
|
134
135
|
/** The global `spindle` object available in backend extension workers */
|
|
135
136
|
export interface SpindleAPI {
|
|
137
|
+
/** Disk-backed downloads and bounded reads/writes. Available with file-transfers-v1. */
|
|
138
|
+
readonly files: SpindleFilesAPI;
|
|
139
|
+
/** Streaming ZIP64 creation and validated disk-backed extraction. */
|
|
140
|
+
readonly archives: SpindleArchivesAPI;
|
|
136
141
|
readonly desktop: SpindleDesktopAPI;
|
|
137
142
|
/** Immutable host compatibility descriptor for this extension runtime. */
|
|
138
143
|
readonly host: SpindleHostDescriptorV1;
|
|
@@ -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 });
|