lumiverse-spindle-types 0.4.53 → 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 +1 -1
- package/src/api.ts +29 -0
- package/src/index.ts +8 -6
- package/src/permissions.ts +2 -0
- package/src/spindle-api.ts +16 -0
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -374,6 +374,29 @@ export interface ImageGenResultDTO {
|
|
|
374
374
|
imageUrl?: string;
|
|
375
375
|
}
|
|
376
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
|
+
|
|
377
400
|
// ─── Character DTOs ─────────────────────────────────────────────────────
|
|
378
401
|
|
|
379
402
|
/**
|
|
@@ -1854,6 +1877,12 @@ export type WorkerToHost =
|
|
|
1854
1877
|
| { type: "image_gen_connections_list"; requestId: string; userId?: string }
|
|
1855
1878
|
| { type: "image_gen_connections_get"; requestId: string; connectionId: string; userId?: string }
|
|
1856
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 }
|
|
1857
1886
|
// ─── Theme (gated: "app_manipulation") ──────────────────────────────────
|
|
1858
1887
|
| { type: "theme_apply"; requestId: string; overrides: ThemeOverrideDTO; userId?: string }
|
|
1859
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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,
|
package/src/permissions.ts
CHANGED
|
@@ -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;
|
package/src/spindle-api.ts
CHANGED
|
@@ -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).
|