lumiverse-spindle-types 0.4.41 → 0.4.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/package.json +1 -1
- package/src/api.ts +79 -0
- package/src/dom.ts +2 -0
- package/src/index.ts +8 -0
- package/src/permissions.ts +3 -0
- package/src/spindle-api.ts +27 -0
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -579,6 +579,71 @@ export interface WorldBookEntryCreateDTO {
|
|
|
579
579
|
|
|
580
580
|
export type WorldBookEntryUpdateDTO = WorldBookEntryCreateDTO;
|
|
581
581
|
|
|
582
|
+
// ─── Databank DTOs ───────────────────────────────────────────────────────
|
|
583
|
+
|
|
584
|
+
export type DatabankScopeDTO = "global" | "character" | "chat";
|
|
585
|
+
export type DatabankDocumentStatusDTO = "pending" | "processing" | "ready" | "error";
|
|
586
|
+
|
|
587
|
+
/** Safe representation of a databank exposed to extensions. */
|
|
588
|
+
export interface DatabankDTO {
|
|
589
|
+
id: string;
|
|
590
|
+
name: string;
|
|
591
|
+
description: string;
|
|
592
|
+
scope: DatabankScopeDTO;
|
|
593
|
+
scope_id: string | null;
|
|
594
|
+
enabled: boolean;
|
|
595
|
+
metadata: Record<string, unknown>;
|
|
596
|
+
document_count?: number;
|
|
597
|
+
created_at: number;
|
|
598
|
+
updated_at: number;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
export interface DatabankCreateDTO {
|
|
602
|
+
name: string;
|
|
603
|
+
description?: string;
|
|
604
|
+
scope: DatabankScopeDTO;
|
|
605
|
+
scope_id?: string | null;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
export interface DatabankUpdateDTO {
|
|
609
|
+
name?: string;
|
|
610
|
+
description?: string;
|
|
611
|
+
enabled?: boolean;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/** Safe representation of a databank document exposed to extensions. */
|
|
615
|
+
export interface DatabankDocumentDTO {
|
|
616
|
+
id: string;
|
|
617
|
+
databank_id: string;
|
|
618
|
+
name: string;
|
|
619
|
+
slug: string;
|
|
620
|
+
mime_type: string;
|
|
621
|
+
file_size: number;
|
|
622
|
+
content_hash: string;
|
|
623
|
+
total_chunks: number;
|
|
624
|
+
status: DatabankDocumentStatusDTO;
|
|
625
|
+
error_message: string | null;
|
|
626
|
+
metadata: Record<string, unknown>;
|
|
627
|
+
created_at: number;
|
|
628
|
+
updated_at: number;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
export interface DatabankDocumentCreateDTO {
|
|
632
|
+
/** Raw file bytes. */
|
|
633
|
+
data: Uint8Array;
|
|
634
|
+
/** Original filename including extension. */
|
|
635
|
+
filename: string;
|
|
636
|
+
/** Optional MIME type recorded on the document. */
|
|
637
|
+
mime_type?: string;
|
|
638
|
+
/** Optional display name override. Defaults to the filename without extension. */
|
|
639
|
+
name?: string;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export interface DatabankDocumentUpdateDTO {
|
|
643
|
+
/** Renames the document display name (and derived slug). */
|
|
644
|
+
name: string;
|
|
645
|
+
}
|
|
646
|
+
|
|
582
647
|
// ─── Persona DTOs ──────────────────────────────────────────────────────
|
|
583
648
|
|
|
584
649
|
/**
|
|
@@ -1528,6 +1593,20 @@ export type WorkerToHost =
|
|
|
1528
1593
|
| { type: "world_book_entries_create"; requestId: string; worldBookId: string; input: WorldBookEntryCreateDTO; userId?: string }
|
|
1529
1594
|
| { type: "world_book_entries_update"; requestId: string; entryId: string; input: WorldBookEntryUpdateDTO; userId?: string }
|
|
1530
1595
|
| { type: "world_book_entries_delete"; requestId: string; entryId: string; userId?: string }
|
|
1596
|
+
// ─── Databanks (gated: "databanks") ───────────────────────────────────
|
|
1597
|
+
| { type: "databanks_list"; requestId: string; limit?: number; offset?: number; scope?: DatabankScopeDTO; scopeId?: string | null; userId?: string }
|
|
1598
|
+
| { type: "databanks_get"; requestId: string; databankId: string; userId?: string }
|
|
1599
|
+
| { type: "databanks_create"; requestId: string; input: DatabankCreateDTO; userId?: string }
|
|
1600
|
+
| { type: "databanks_update"; requestId: string; databankId: string; input: DatabankUpdateDTO; userId?: string }
|
|
1601
|
+
| { type: "databanks_delete"; requestId: string; databankId: string; userId?: string }
|
|
1602
|
+
// ─── Databank Documents (gated: "databanks") ─────────────────────────
|
|
1603
|
+
| { type: "databank_documents_list"; requestId: string; databankId: string; limit?: number; offset?: number; userId?: string }
|
|
1604
|
+
| { type: "databank_documents_get"; requestId: string; documentId: string; userId?: string }
|
|
1605
|
+
| { type: "databank_documents_create"; requestId: string; databankId: string; input: DatabankDocumentCreateDTO; userId?: string }
|
|
1606
|
+
| { type: "databank_documents_update"; requestId: string; documentId: string; input: DatabankDocumentUpdateDTO; userId?: string }
|
|
1607
|
+
| { type: "databank_documents_delete"; requestId: string; documentId: string; userId?: string }
|
|
1608
|
+
| { type: "databank_documents_get_content"; requestId: string; documentId: string; userId?: string }
|
|
1609
|
+
| { type: "databank_documents_reprocess"; requestId: string; documentId: string; userId?: string }
|
|
1531
1610
|
// ─── Personas (gated: "personas") ────────────────────────────────────
|
|
1532
1611
|
| { type: "personas_list"; requestId: string; limit?: number; offset?: number; userId?: string }
|
|
1533
1612
|
| { type: "personas_get"; requestId: string; personaId: string; userId?: string }
|
package/src/dom.ts
CHANGED
|
@@ -87,6 +87,8 @@ export interface SpindleFloatWidgetHandle {
|
|
|
87
87
|
widgetId: string;
|
|
88
88
|
moveTo(x: number, y: number): void;
|
|
89
89
|
getPosition(): { x: number; y: number };
|
|
90
|
+
/** Update the widget's rendered width/height in the host container. */
|
|
91
|
+
setSize(width: number, height: number): void;
|
|
90
92
|
setVisible(visible: boolean): void;
|
|
91
93
|
isVisible(): boolean;
|
|
92
94
|
/** Toggle fullscreen mode. When enabled the host resizes the widget to
|
package/src/index.ts
CHANGED
|
@@ -41,6 +41,14 @@ export type {
|
|
|
41
41
|
WorldBookEntryDTO,
|
|
42
42
|
WorldBookEntryCreateDTO,
|
|
43
43
|
WorldBookEntryUpdateDTO,
|
|
44
|
+
DatabankScopeDTO,
|
|
45
|
+
DatabankDocumentStatusDTO,
|
|
46
|
+
DatabankDTO,
|
|
47
|
+
DatabankCreateDTO,
|
|
48
|
+
DatabankUpdateDTO,
|
|
49
|
+
DatabankDocumentDTO,
|
|
50
|
+
DatabankDocumentCreateDTO,
|
|
51
|
+
DatabankDocumentUpdateDTO,
|
|
44
52
|
PersonaDTO,
|
|
45
53
|
LumiaItemDTO,
|
|
46
54
|
PersonaCreateDTO,
|
package/src/permissions.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - "characters" — CRUD on character cards
|
|
14
14
|
* - "chats" — CRUD on chat sessions
|
|
15
15
|
* - "personas" — CRUD on personas
|
|
16
|
+
* - "databanks" — CRUD on databanks and their documents
|
|
16
17
|
* - "macro_interceptor" — transform raw templates before macro parsing/dispatch
|
|
17
18
|
*/
|
|
18
19
|
export type SpindlePermission =
|
|
@@ -30,6 +31,7 @@ export type SpindlePermission =
|
|
|
30
31
|
| "characters"
|
|
31
32
|
| "chats"
|
|
32
33
|
| "world_books"
|
|
34
|
+
| "databanks"
|
|
33
35
|
| "personas"
|
|
34
36
|
| "push_notification"
|
|
35
37
|
| "image_gen"
|
|
@@ -51,6 +53,7 @@ export const ALL_PERMISSIONS: readonly SpindlePermission[] = [
|
|
|
51
53
|
"characters",
|
|
52
54
|
"chats",
|
|
53
55
|
"world_books",
|
|
56
|
+
"databanks",
|
|
54
57
|
"personas",
|
|
55
58
|
"push_notification",
|
|
56
59
|
"image_gen",
|
package/src/spindle-api.ts
CHANGED
|
@@ -27,6 +27,12 @@ import type {
|
|
|
27
27
|
WorldBookEntryDTO,
|
|
28
28
|
WorldBookEntryCreateDTO,
|
|
29
29
|
WorldBookEntryUpdateDTO,
|
|
30
|
+
DatabankDTO,
|
|
31
|
+
DatabankCreateDTO,
|
|
32
|
+
DatabankUpdateDTO,
|
|
33
|
+
DatabankDocumentDTO,
|
|
34
|
+
DatabankDocumentCreateDTO,
|
|
35
|
+
DatabankDocumentUpdateDTO,
|
|
30
36
|
PersonaDTO,
|
|
31
37
|
LumiaItemDTO,
|
|
32
38
|
PersonaCreateDTO,
|
|
@@ -630,6 +636,27 @@ export interface SpindleAPI {
|
|
|
630
636
|
getActivated(chatId: string, userId?: string): Promise<ActivatedWorldInfoEntryDTO[]>;
|
|
631
637
|
};
|
|
632
638
|
|
|
639
|
+
/**
|
|
640
|
+
* Databank CRUD (permission: "databanks").
|
|
641
|
+
* Manage databanks plus the documents they contain.
|
|
642
|
+
*/
|
|
643
|
+
databanks: {
|
|
644
|
+
list(options?: { limit?: number; offset?: number; scope?: "global" | "character" | "chat"; scopeId?: string | null; userId?: string }): Promise<{ data: DatabankDTO[]; total: number }>;
|
|
645
|
+
get(databankId: string, userId?: string): Promise<DatabankDTO | null>;
|
|
646
|
+
create(input: DatabankCreateDTO, userId?: string): Promise<DatabankDTO>;
|
|
647
|
+
update(databankId: string, input: DatabankUpdateDTO, userId?: string): Promise<DatabankDTO>;
|
|
648
|
+
delete(databankId: string, userId?: string): Promise<boolean>;
|
|
649
|
+
documents: {
|
|
650
|
+
list(databankId: string, options?: { limit?: number; offset?: number; userId?: string }): Promise<{ data: DatabankDocumentDTO[]; total: number }>;
|
|
651
|
+
get(documentId: string, userId?: string): Promise<DatabankDocumentDTO | null>;
|
|
652
|
+
create(databankId: string, input: DatabankDocumentCreateDTO, userId?: string): Promise<DatabankDocumentDTO>;
|
|
653
|
+
update(documentId: string, input: DatabankDocumentUpdateDTO, userId?: string): Promise<DatabankDocumentDTO>;
|
|
654
|
+
delete(documentId: string, userId?: string): Promise<boolean>;
|
|
655
|
+
getContent(documentId: string, userId?: string): Promise<{ content: string } | null>;
|
|
656
|
+
reprocess(documentId: string, userId?: string): Promise<{ success: true; status: "processing" }>;
|
|
657
|
+
};
|
|
658
|
+
};
|
|
659
|
+
|
|
633
660
|
/**
|
|
634
661
|
* Personas CRUD (permission: "personas").
|
|
635
662
|
* Manage user personas (identity profiles).
|