lumiverse-spindle-types 0.5.26 → 0.5.28
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 +2 -1
- package/src/api.ts +21 -0
- package/src/dom.ts +53 -0
- package/src/index.ts +7 -0
- package/src/spindle-api.ts +8 -0
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -1353,6 +1353,23 @@ export interface PersonaUpdateDTO {
|
|
|
1353
1353
|
metadata?: Record<string, unknown>;
|
|
1354
1354
|
}
|
|
1355
1355
|
|
|
1356
|
+
export interface GlobalAddonDTO {
|
|
1357
|
+
id: string;
|
|
1358
|
+
label: string;
|
|
1359
|
+
content: string;
|
|
1360
|
+
sort_order: number;
|
|
1361
|
+
metadata: Record<string, unknown>;
|
|
1362
|
+
created_at: number;
|
|
1363
|
+
updated_at: number;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
export interface GlobalAddonUpdateDTO {
|
|
1367
|
+
label?: string;
|
|
1368
|
+
content?: string;
|
|
1369
|
+
sort_order?: number;
|
|
1370
|
+
metadata?: Record<string, unknown>;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1356
1373
|
// ─── Activated World Info DTOs ─────────────────────────────────────────
|
|
1357
1374
|
|
|
1358
1375
|
/**
|
|
@@ -2683,6 +2700,10 @@ export type WorkerToHost =
|
|
|
2683
2700
|
| { type: "personas_delete"; requestId: string; personaId: string; userId?: string }
|
|
2684
2701
|
| { type: "personas_switch"; requestId: string; personaId: string | null; userId?: string }
|
|
2685
2702
|
| { type: "personas_get_world_book"; requestId: string; personaId: string; userId?: string }
|
|
2703
|
+
// ─── Global Add-ons (gated: "personas") ──────────────────────────
|
|
2704
|
+
| { type: "global_addons_list"; requestId: string; limit?: number; offset?: number; userId?: string }
|
|
2705
|
+
| { type: "global_addons_get"; requestId: string; addonId: string; userId?: string }
|
|
2706
|
+
| { type: "global_addons_update"; requestId: string; addonId: string; input: GlobalAddonUpdateDTO; userId?: string }
|
|
2686
2707
|
// ─── Council (free tier, read-only) ──────────────────────────────
|
|
2687
2708
|
| { type: "council_get_settings"; requestId: string; userId?: string }
|
|
2688
2709
|
| { type: "council_get_members"; requestId: string; userId?: string }
|
package/src/dom.ts
CHANGED
|
@@ -151,6 +151,57 @@ export interface SpindleDrawerTabHandle {
|
|
|
151
151
|
onActivate(handler: () => void): () => void;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
// ── Character Editor Tab ──
|
|
155
|
+
|
|
156
|
+
export interface SpindleCharacterEditorTabOptions {
|
|
157
|
+
/** Unique tab identifier within the current extension. */
|
|
158
|
+
id: string;
|
|
159
|
+
/** Label shown in the character editor tab bar. */
|
|
160
|
+
title: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface SpindleCharacterEditorTabHandle {
|
|
164
|
+
root: HTMLElement;
|
|
165
|
+
tabId: string;
|
|
166
|
+
setTitle(title: string): void;
|
|
167
|
+
activate(): void;
|
|
168
|
+
destroy(): void;
|
|
169
|
+
/** Register a callback fired when the active character-editor tab switches to this tab. */
|
|
170
|
+
onActivate(handler: () => void): () => void;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface SpindleCharacterEditorState {
|
|
174
|
+
/** Whether the character editor modal is currently open. */
|
|
175
|
+
open: boolean;
|
|
176
|
+
/** Character currently being edited, or `null` when the modal is closed. */
|
|
177
|
+
characterId: string | null;
|
|
178
|
+
/** Active built-in or extension tab id inside the editor modal. */
|
|
179
|
+
activeTabId: string | null;
|
|
180
|
+
/** Current draft extensions blob visible to the editor. */
|
|
181
|
+
extensions: Record<string, any>;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface SpindleCharacterEditorSaveOptions {
|
|
185
|
+
/** Persist immediately instead of using the host's debounced save path. */
|
|
186
|
+
immediate?: boolean;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface SpindleCharacterEditorHelper {
|
|
190
|
+
/** Read the current editor snapshot. */
|
|
191
|
+
getState(): SpindleCharacterEditorState;
|
|
192
|
+
/** Subscribe to editor open/close, tab, character, and extensions changes. */
|
|
193
|
+
onChange(handler: (state: SpindleCharacterEditorState) => void): () => void;
|
|
194
|
+
/** Replace the draft extensions object shown in the editor. */
|
|
195
|
+
setExtensions(extensions: Record<string, any>, options?: SpindleCharacterEditorSaveOptions): void;
|
|
196
|
+
/** Atomically derive the next draft extensions object from the current one. */
|
|
197
|
+
updateExtensions(
|
|
198
|
+
mutator: (extensions: Record<string, any>) => Record<string, any>,
|
|
199
|
+
options?: SpindleCharacterEditorSaveOptions,
|
|
200
|
+
): void;
|
|
201
|
+
/** Immediately persist any pending draft extension changes. */
|
|
202
|
+
flush(): Promise<void>;
|
|
203
|
+
}
|
|
204
|
+
|
|
154
205
|
// ── Float Widget ──
|
|
155
206
|
|
|
156
207
|
export interface SpindleFloatWidgetOptions {
|
|
@@ -711,6 +762,8 @@ export interface SpindleFrontendContext {
|
|
|
711
762
|
events: SpindleUIEventsHelper;
|
|
712
763
|
mount(point: SpindleMountPoint): Element;
|
|
713
764
|
registerDrawerTab(options: SpindleDrawerTabOptions): SpindleDrawerTabHandle;
|
|
765
|
+
registerCharacterEditorTab(options: SpindleCharacterEditorTabOptions): SpindleCharacterEditorTabHandle;
|
|
766
|
+
characterEditor: SpindleCharacterEditorHelper;
|
|
714
767
|
createFloatWidget(options?: SpindleFloatWidgetOptions): SpindleFloatWidgetHandle;
|
|
715
768
|
requestDockPanel(options: SpindleDockPanelOptions): SpindleDockPanelHandle;
|
|
716
769
|
mountApp(options?: SpindleAppMountOptions): SpindleAppMountHandle;
|
package/src/index.ts
CHANGED
|
@@ -94,6 +94,8 @@ export type {
|
|
|
94
94
|
DatabankDocumentCreateDTO,
|
|
95
95
|
DatabankDocumentUpdateDTO,
|
|
96
96
|
PersonaDTO,
|
|
97
|
+
GlobalAddonDTO,
|
|
98
|
+
GlobalAddonUpdateDTO,
|
|
97
99
|
LumiaItemDTO,
|
|
98
100
|
PersonaCreateDTO,
|
|
99
101
|
PersonaUpdateDTO,
|
|
@@ -193,6 +195,11 @@ export type {
|
|
|
193
195
|
SpindleFrontendModule,
|
|
194
196
|
SpindleDrawerTabOptions,
|
|
195
197
|
SpindleDrawerTabHandle,
|
|
198
|
+
SpindleCharacterEditorTabOptions,
|
|
199
|
+
SpindleCharacterEditorTabHandle,
|
|
200
|
+
SpindleCharacterEditorState,
|
|
201
|
+
SpindleCharacterEditorSaveOptions,
|
|
202
|
+
SpindleCharacterEditorHelper,
|
|
196
203
|
SpindleFloatWidgetOptions,
|
|
197
204
|
SpindleFloatWidgetHandle,
|
|
198
205
|
SpindleDockEdge,
|
package/src/spindle-api.ts
CHANGED
|
@@ -47,6 +47,8 @@ import type {
|
|
|
47
47
|
DatabankDocumentCreateDTO,
|
|
48
48
|
DatabankDocumentUpdateDTO,
|
|
49
49
|
PersonaDTO,
|
|
50
|
+
GlobalAddonDTO,
|
|
51
|
+
GlobalAddonUpdateDTO,
|
|
50
52
|
LumiaItemDTO,
|
|
51
53
|
PersonaCreateDTO,
|
|
52
54
|
PersonaUpdateDTO,
|
|
@@ -1163,6 +1165,12 @@ export interface SpindleAPI {
|
|
|
1163
1165
|
getWorldBook(personaId: string, userId?: string): Promise<WorldBookDTO | null>;
|
|
1164
1166
|
};
|
|
1165
1167
|
|
|
1168
|
+
global_addons: {
|
|
1169
|
+
list(options?: { limit?: number; offset?: number; userId?: string }): Promise<{ data: GlobalAddonDTO[]; total: number }>;
|
|
1170
|
+
get(addonId: string, userId?: string): Promise<GlobalAddonDTO | null>;
|
|
1171
|
+
update(addonId: string, input: GlobalAddonUpdateDTO, userId?: string): Promise<GlobalAddonDTO>;
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1166
1174
|
permissions: {
|
|
1167
1175
|
getGranted(): Promise<string[]>;
|
|
1168
1176
|
/**
|