lumiverse-spindle-types 0.4.53 → 0.4.55

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.53",
3
+ "version": "0.4.55",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
package/src/api.ts CHANGED
@@ -359,6 +359,10 @@ export interface ImageGenRequestDTO {
359
359
  model?: string;
360
360
  /** Provider-specific parameters. Merged with the connection's default_parameters. */
361
361
  parameters?: Record<string, unknown>;
362
+ /** Optional character ownership tag for the persisted result image. */
363
+ owner_character_id?: string;
364
+ /** Optional chat ownership tag for the persisted result image. */
365
+ owner_chat_id?: string;
362
366
  /** For operator-scoped extensions. */
363
367
  userId?: string;
364
368
  }
@@ -374,6 +378,79 @@ export interface ImageGenResultDTO {
374
378
  imageUrl?: string;
375
379
  }
376
380
 
381
+ // ─── Image DTOs ─────────────────────────────────────────────────────────
382
+
383
+ export type ImageSpecificityDTO = "full" | "sm" | "lg";
384
+
385
+ export interface ImageListOptionsDTO {
386
+ limit?: number;
387
+ offset?: number;
388
+ /** Which image URL size should be returned in each DTO. */
389
+ specificity?: ImageSpecificityDTO;
390
+ /** Restrict results to images created by the current extension. */
391
+ onlyOwned?: boolean;
392
+ /** Restrict results to images tagged to a specific character. */
393
+ characterId?: string;
394
+ /** Restrict results to images tagged to a specific chat. */
395
+ chatId?: string;
396
+ /** For operator-scoped extensions. */
397
+ userId?: string;
398
+ }
399
+
400
+ export interface ImageGetOptionsDTO {
401
+ /** Which image URL size should be returned in the DTO. */
402
+ specificity?: ImageSpecificityDTO;
403
+ /** Restrict lookup to images created by the current extension. */
404
+ onlyOwned?: boolean;
405
+ /** Restrict lookup to images tagged to a specific character. */
406
+ characterId?: string;
407
+ /** Restrict lookup to images tagged to a specific chat. */
408
+ chatId?: string;
409
+ /** For operator-scoped extensions. */
410
+ userId?: string;
411
+ }
412
+
413
+ /** Safe representation of an image exposed to extensions. */
414
+ export interface ImageDTO {
415
+ id: string;
416
+ original_filename: string;
417
+ mime_type: string;
418
+ width: number | null;
419
+ height: number | null;
420
+ has_thumbnail: boolean;
421
+ /** Relative authenticated URL for this image, already sized to `specificity`. */
422
+ url: string;
423
+ specificity: ImageSpecificityDTO;
424
+ owner_extension_identifier: string | null;
425
+ owner_character_id: string | null;
426
+ owner_chat_id: string | null;
427
+ created_at: number;
428
+ }
429
+
430
+ /** Upload payload for `spindle.images.upload()` */
431
+ export interface ImageUploadDTO {
432
+ /** Raw image bytes. */
433
+ data: Uint8Array;
434
+ /** Optional filename used to preserve the extension/MIME when storing the image. */
435
+ filename?: string;
436
+ /** Optional content type. Defaults to image/png when not inferable. */
437
+ mime_type?: string;
438
+ /** Optional character ownership tag for the persisted image. */
439
+ owner_character_id?: string;
440
+ /** Optional chat ownership tag for the persisted image. */
441
+ owner_chat_id?: string;
442
+ }
443
+
444
+ export interface ImageUploadFromDataUrlOptionsDTO {
445
+ originalFilename?: string;
446
+ /** Optional character ownership tag for the persisted image. */
447
+ owner_character_id?: string;
448
+ /** Optional chat ownership tag for the persisted image. */
449
+ owner_chat_id?: string;
450
+ /** For operator-scoped extensions. */
451
+ userId?: string;
452
+ }
453
+
377
454
  // ─── Character DTOs ─────────────────────────────────────────────────────
378
455
 
379
456
  /**
@@ -1854,6 +1931,39 @@ export type WorkerToHost =
1854
1931
  | { type: "image_gen_connections_list"; requestId: string; userId?: string }
1855
1932
  | { type: "image_gen_connections_get"; requestId: string; connectionId: string; userId?: string }
1856
1933
  | { type: "image_gen_models"; requestId: string; connectionId: string; userId?: string }
1934
+ // ─── Images (gated: "images") ────────────────────────────────────────
1935
+ | {
1936
+ type: "images_list";
1937
+ requestId: string;
1938
+ limit?: number;
1939
+ offset?: number;
1940
+ specificity?: ImageSpecificityDTO;
1941
+ onlyOwned?: boolean;
1942
+ characterId?: string;
1943
+ chatId?: string;
1944
+ userId?: string;
1945
+ }
1946
+ | {
1947
+ type: "images_get";
1948
+ requestId: string;
1949
+ imageId: string;
1950
+ specificity?: ImageSpecificityDTO;
1951
+ onlyOwned?: boolean;
1952
+ characterId?: string;
1953
+ chatId?: string;
1954
+ userId?: string;
1955
+ }
1956
+ | { type: "images_upload"; requestId: string; input: ImageUploadDTO; userId?: string }
1957
+ | {
1958
+ type: "images_upload_from_data_url";
1959
+ requestId: string;
1960
+ dataUrl: string;
1961
+ originalFilename?: string;
1962
+ owner_character_id?: string;
1963
+ owner_chat_id?: string;
1964
+ userId?: string;
1965
+ }
1966
+ | { type: "images_delete"; requestId: string; imageId: string; userId?: string }
1857
1967
  // ─── Theme (gated: "app_manipulation") ──────────────────────────────────
1858
1968
  | { type: "theme_apply"; requestId: string; overrides: ThemeOverrideDTO; userId?: string }
1859
1969
  | { type: "theme_apply_palette"; requestId: string; palette: ThemePaletteConfigDTO | null; userId?: string }
package/src/index.ts CHANGED
@@ -63,12 +63,18 @@ 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
+ ImageGetOptionsDTO,
72
+ ImageDTO,
73
+ ImageListOptionsDTO,
74
+ ImageSpecificityDTO,
75
+ ImageUploadDTO,
76
+ ImageUploadFromDataUrlOptionsDTO,
77
+ ThemeOverrideDTO,
72
78
  ThemeInfoDTO,
73
79
  ThemePaletteConfigDTO,
74
80
  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,11 @@ import type {
45
45
  ImageGenResultDTO,
46
46
  ImageGenConnectionDTO,
47
47
  ImageGenProviderDTO,
48
+ ImageGetOptionsDTO,
49
+ ImageDTO,
50
+ ImageListOptionsDTO,
51
+ ImageUploadDTO,
52
+ ImageUploadFromDataUrlOptionsDTO,
48
53
  ThemeOverrideDTO,
49
54
  ThemeInfoDTO,
50
55
  ThemePaletteConfigDTO,
@@ -633,6 +638,22 @@ export interface SpindleAPI {
633
638
  getModels(connectionId: string, userId?: string): Promise<Array<{ id: string; label: string }>>;
634
639
  };
635
640
 
641
+ /**
642
+ * Image CRUD (permission: "images").
643
+ * Manage images stored in Lumiverse's image system on behalf of the user.
644
+ * For user-scoped extensions, userId is inferred from the extension owner.
645
+ * For operator-scoped extensions, pass userId to scope to a specific user.
646
+ */
647
+ images: {
648
+ list(options?: ImageListOptionsDTO): Promise<{ data: ImageDTO[]; total: number }>;
649
+ get(imageId: string, userId?: string): Promise<ImageDTO | null>;
650
+ get(imageId: string, options?: ImageGetOptionsDTO): Promise<ImageDTO | null>;
651
+ upload(input: ImageUploadDTO, userId?: string): Promise<ImageDTO>;
652
+ uploadFromDataUrl(dataUrl: string, originalFilename?: string, userId?: string): Promise<ImageDTO>;
653
+ uploadFromDataUrl(dataUrl: string, options?: ImageUploadFromDataUrlOptionsDTO): Promise<ImageDTO>;
654
+ delete(imageId: string, userId?: string): Promise<boolean>;
655
+ };
656
+
636
657
  /**
637
658
  * Local (transient), global (user-scoped), and chat (persisted) variable access
638
659
  * (free tier — no permission needed).