lumiverse-spindle-types 0.4.52 → 0.4.54

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.52",
3
+ "version": "0.4.54",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
package/src/api.ts CHANGED
@@ -278,6 +278,9 @@ export interface RequestInitDTO {
278
278
  method?: string;
279
279
  headers?: Record<string, string>;
280
280
  body?: string;
281
+ /** When `"arraybuffer"`, the response body is returned as a base64-encoded string
282
+ * with `encoding: "base64"`. Used by the sandboxed-widget transparent proxy. */
283
+ responseType?: "text" | "arraybuffer";
281
284
  }
282
285
 
283
286
  /**
@@ -371,6 +374,29 @@ export interface ImageGenResultDTO {
371
374
  imageUrl?: string;
372
375
  }
373
376
 
377
+ // ─── Image DTOs ─────────────────────────────────────────────────────────
378
+
379
+ /** Safe representation of an image exposed to extensions. */
380
+ export interface ImageDTO {
381
+ id: string;
382
+ original_filename: string;
383
+ mime_type: string;
384
+ width: number | null;
385
+ height: number | null;
386
+ has_thumbnail: boolean;
387
+ created_at: number;
388
+ }
389
+
390
+ /** Upload payload for `spindle.images.upload()` */
391
+ export interface ImageUploadDTO {
392
+ /** Raw image bytes. */
393
+ data: Uint8Array;
394
+ /** Optional filename used to preserve the extension/MIME when storing the image. */
395
+ filename?: string;
396
+ /** Optional content type. Defaults to image/png when not inferable. */
397
+ mime_type?: string;
398
+ }
399
+
374
400
  // ─── Character DTOs ─────────────────────────────────────────────────────
375
401
 
376
402
  /**
@@ -1851,6 +1877,12 @@ export type WorkerToHost =
1851
1877
  | { type: "image_gen_connections_list"; requestId: string; userId?: string }
1852
1878
  | { type: "image_gen_connections_get"; requestId: string; connectionId: string; userId?: string }
1853
1879
  | { type: "image_gen_models"; requestId: string; connectionId: string; userId?: string }
1880
+ // ─── Images (gated: "images") ────────────────────────────────────────
1881
+ | { type: "images_list"; requestId: string; limit?: number; offset?: number; userId?: string }
1882
+ | { type: "images_get"; requestId: string; imageId: string; userId?: string }
1883
+ | { type: "images_upload"; requestId: string; input: ImageUploadDTO; userId?: string }
1884
+ | { type: "images_upload_from_data_url"; requestId: string; dataUrl: string; originalFilename?: string; userId?: string }
1885
+ | { type: "images_delete"; requestId: string; imageId: string; userId?: string }
1854
1886
  // ─── Theme (gated: "app_manipulation") ──────────────────────────────────
1855
1887
  | { type: "theme_apply"; requestId: string; overrides: ThemeOverrideDTO; userId?: string }
1856
1888
  | { type: "theme_apply_palette"; requestId: string; palette: ThemePaletteConfigDTO | null; userId?: string }
package/src/index.ts CHANGED
@@ -63,12 +63,14 @@ export type {
63
63
  DryRunTokenCountDTO,
64
64
  ChatMemoryChunkDTO,
65
65
  ChatMemoryResultDTO,
66
- ImageGenConnectionDTO,
67
- ImageGenParameterSchemaDTO,
68
- ImageGenProviderDTO,
69
- ImageGenRequestDTO,
70
- ImageGenResultDTO,
71
- ThemeOverrideDTO,
66
+ ImageGenConnectionDTO,
67
+ ImageGenParameterSchemaDTO,
68
+ ImageGenProviderDTO,
69
+ ImageGenRequestDTO,
70
+ ImageGenResultDTO,
71
+ ImageDTO,
72
+ ImageUploadDTO,
73
+ ThemeOverrideDTO,
72
74
  ThemeInfoDTO,
73
75
  ThemePaletteConfigDTO,
74
76
  ThemeVariablesConfigDTO,
@@ -35,6 +35,7 @@ export type SpindlePermission =
35
35
  | "personas"
36
36
  | "push_notification"
37
37
  | "image_gen"
38
+ | "images"
38
39
  | "generation_parameters"
39
40
  | "macro_interceptor";
40
41
 
@@ -57,6 +58,7 @@ export const ALL_PERMISSIONS: readonly SpindlePermission[] = [
57
58
  "personas",
58
59
  "push_notification",
59
60
  "image_gen",
61
+ "images",
60
62
  "generation_parameters",
61
63
  "macro_interceptor",
62
64
  ] as const;
@@ -45,6 +45,8 @@ import type {
45
45
  ImageGenResultDTO,
46
46
  ImageGenConnectionDTO,
47
47
  ImageGenProviderDTO,
48
+ ImageDTO,
49
+ ImageUploadDTO,
48
50
  ThemeOverrideDTO,
49
51
  ThemeInfoDTO,
50
52
  ThemePaletteConfigDTO,
@@ -633,6 +635,20 @@ export interface SpindleAPI {
633
635
  getModels(connectionId: string, userId?: string): Promise<Array<{ id: string; label: string }>>;
634
636
  };
635
637
 
638
+ /**
639
+ * Image CRUD (permission: "images").
640
+ * Manage images stored in Lumiverse's image system on behalf of the user.
641
+ * For user-scoped extensions, userId is inferred from the extension owner.
642
+ * For operator-scoped extensions, pass userId to scope to a specific user.
643
+ */
644
+ images: {
645
+ list(options?: { limit?: number; offset?: number; userId?: string }): Promise<{ data: ImageDTO[]; total: number }>;
646
+ get(imageId: string, userId?: string): Promise<ImageDTO | null>;
647
+ upload(input: ImageUploadDTO, userId?: string): Promise<ImageDTO>;
648
+ uploadFromDataUrl(dataUrl: string, originalFilename?: string, userId?: string): Promise<ImageDTO>;
649
+ delete(imageId: string, userId?: string): Promise<boolean>;
650
+ };
651
+
636
652
  /**
637
653
  * Local (transient), global (user-scoped), and chat (persisted) variable access
638
654
  * (free tier — no permission needed).
@@ -921,6 +937,8 @@ export interface SpindleAPI {
921
937
  list(filter?: FrontendProcessListOptionsDTO): Promise<FrontendProcessInfoDTO[]>;
922
938
  /** Get a single tracked process by ID. Returns `null` if it no longer exists. */
923
939
  get(processId: string): Promise<FrontendProcessInfoDTO | null>;
940
+ /** Send a message to a specific frontend process */
941
+ send(processId: string, payload: unknown, userId?: string): void;
924
942
  /** Request graceful termination of a tracked process. */
925
943
  stop(processId: string, options?: FrontendProcessStopOptionsDTO): Promise<void>;
926
944
  /** Subscribe to lifecycle transitions (`starting`, `running`, `timed_out`, etc.). */
@@ -951,6 +969,8 @@ export interface SpindleAPI {
951
969
  list(filter?: BackendProcessListOptionsDTO): Promise<BackendProcessInfoDTO[]>;
952
970
  /** Get a single tracked subprocess by ID. Returns `null` if it no longer exists. */
953
971
  get(processId: string): Promise<BackendProcessInfoDTO | null>;
972
+ /** Send a message to a specific backend process */
973
+ send(processId: string, payload: unknown, userId?: string): void;
954
974
  /** Request graceful termination of a tracked subprocess. */
955
975
  stop(processId: string, options?: BackendProcessStopOptionsDTO): Promise<void>;
956
976
  /** Subscribe to lifecycle transitions (`starting`, `running`, `timed_out`, etc.). */