lumiverse-spindle-types 0.4.62 → 0.4.64

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumiverse-spindle-types",
3
- "version": "0.4.62",
3
+ "version": "0.4.64",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
package/src/api.ts CHANGED
@@ -290,6 +290,8 @@ export interface RequestInitDTO {
290
290
  /** When `"arraybuffer"`, the response body is returned as a base64-encoded string
291
291
  * with `encoding: "base64"`. Used by the sandboxed-widget transparent proxy. */
292
292
  responseType?: "text" | "arraybuffer";
293
+ /** Restricts transparent binary proxy responses to a browser-renderable media class. */
294
+ mediaType?: "image" | "audio";
293
295
  }
294
296
 
295
297
  /**
@@ -689,7 +691,7 @@ export type WorldBookEntryUpdateDTO = WorldBookEntryCreateDTO;
689
691
  export type RegexPlacementDTO = "user_input" | "ai_output" | "world_info" | "reasoning";
690
692
  export type RegexScopeDTO = "global" | "character" | "chat";
691
693
  export type RegexTargetDTO = "prompt" | "response" | "display";
692
- export type RegexMacroModeDTO = "none" | "raw" | "escaped";
694
+ export type RegexMacroModeDTO = "none" | "raw" | "escaped" | "after";
693
695
 
694
696
  export interface RegexScriptDTO {
695
697
  id: string;
package/src/dom.ts CHANGED
@@ -190,6 +190,37 @@ export interface SpindleSandboxFrameHandle {
190
190
  destroy(): void;
191
191
  }
192
192
 
193
+ export interface SpindleSandboxMediaResource {
194
+ /** Object URL that can be assigned to sandbox-local media elements. */
195
+ url: string;
196
+ /** Response media type without parameters, e.g. `audio/mpeg`. */
197
+ contentType: string;
198
+ /** Downloaded media size in bytes. */
199
+ sizeBytes: number;
200
+ /** Revoke the object URL when it is no longer needed. */
201
+ revoke(): void;
202
+ }
203
+
204
+ export interface SpindleSandboxAudioOptions {
205
+ /** Request options passed to the permission-gated CORS proxy. */
206
+ request?: RequestInitDTO;
207
+ controls?: boolean;
208
+ loop?: boolean;
209
+ muted?: boolean;
210
+ preload?: "none" | "metadata" | "auto";
211
+ /** Clamped to the browser audio range `[0, 1]`. */
212
+ volume?: number;
213
+ }
214
+
215
+ export interface SpindleSandboxAudioHandle extends SpindleSandboxMediaResource {
216
+ /** Sandbox-local audio element backed by the fetched blob URL. */
217
+ element: HTMLAudioElement;
218
+ play(): Promise<void>;
219
+ pause(): void;
220
+ /** Pause playback, detach the element, and revoke the object URL. */
221
+ destroy(): void;
222
+ }
223
+
193
224
  /** API exposed inside the sandboxed iframe as `window.spindleSandbox`. */
194
225
  export interface SpindleSandboxAPI {
195
226
  postMessage(payload: unknown): void;
@@ -197,6 +228,10 @@ export interface SpindleSandboxAPI {
197
228
  requestResize(height?: number): void;
198
229
  /** Fetch a URL through the extension's CORS proxy. Requires the `cors_proxy` permission. */
199
230
  corsProxy(url: string, options?: RequestInitDTO): Promise<unknown>;
231
+ /** Fetch remote audio through the permission-gated proxy and expose it as a blob URL. */
232
+ fetchAudio(url: string, options?: RequestInitDTO): Promise<SpindleSandboxMediaResource>;
233
+ /** Fetch remote audio through the proxy and create a sandbox-local audio element. */
234
+ createAudio(url: string, options?: SpindleSandboxAudioOptions): Promise<SpindleSandboxAudioHandle>;
200
235
  }
201
236
 
202
237
  export interface SpindleUploadFile {
package/src/index.ts CHANGED
@@ -162,9 +162,12 @@ export type {
162
162
  SpindleAppMountHandle,
163
163
  SpindleInputBarActionOptions,
164
164
  SpindleInputBarActionHandle,
165
- SpindleSandboxFrameOptions,
166
- SpindleSandboxFrameHandle,
167
- SpindleSandboxAPI,
165
+ SpindleSandboxFrameOptions,
166
+ SpindleSandboxFrameHandle,
167
+ SpindleSandboxMediaResource,
168
+ SpindleSandboxAudioOptions,
169
+ SpindleSandboxAudioHandle,
170
+ SpindleSandboxAPI,
168
171
  SpindleContextMenuOptions,
169
172
  SpindleContextMenuItemDef,
170
173
  SpindleContextMenuResult,