lumiverse-spindle-types 0.5.22 → 0.5.24
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 +25 -0
- package/src/dom.ts +20 -0
- package/src/index.ts +4 -1
- package/src/spindle-api.ts +21 -0
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -1175,6 +1175,8 @@ export interface WorldInfoInterceptorEntryDTO {
|
|
|
1175
1175
|
readonly delay_until_recursion: boolean;
|
|
1176
1176
|
readonly scan_depth: number | null;
|
|
1177
1177
|
readonly order_value: number;
|
|
1178
|
+
/** Attachment scope that contributed the entry's book to this chat. */
|
|
1179
|
+
readonly book_source?: WorldBookSourceDTO;
|
|
1178
1180
|
}
|
|
1179
1181
|
|
|
1180
1182
|
/**
|
|
@@ -1353,6 +1355,13 @@ export interface PersonaUpdateDTO {
|
|
|
1353
1355
|
|
|
1354
1356
|
// ─── Activated World Info DTOs ─────────────────────────────────────────
|
|
1355
1357
|
|
|
1358
|
+
/**
|
|
1359
|
+
* Which attachment scope contributed a world book to prompt assembly.
|
|
1360
|
+
* When a book is attached at multiple scopes the narrowest one wins:
|
|
1361
|
+
* character → persona → chat → global.
|
|
1362
|
+
*/
|
|
1363
|
+
export type WorldBookSourceDTO = "character" | "persona" | "chat" | "global";
|
|
1364
|
+
|
|
1356
1365
|
/**
|
|
1357
1366
|
* Lightweight summary of an activated world info entry.
|
|
1358
1367
|
* Safe subset — no raw entry content or internal fields exposed.
|
|
@@ -1363,6 +1372,17 @@ export interface ActivatedWorldInfoEntryDTO {
|
|
|
1363
1372
|
keys: string[];
|
|
1364
1373
|
source: "keyword" | "vector";
|
|
1365
1374
|
score?: number;
|
|
1375
|
+
/** ID of the world book the entry belongs to. */
|
|
1376
|
+
bookId?: string;
|
|
1377
|
+
/** Attachment scope that contributed the entry's book. */
|
|
1378
|
+
bookSource?: WorldBookSourceDTO;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
/** Payload of the `WORLD_INFO_ACTIVATED` event. */
|
|
1382
|
+
export interface WorldInfoActivatedEventDTO {
|
|
1383
|
+
chatId: string;
|
|
1384
|
+
entries: ActivatedWorldInfoEntryDTO[];
|
|
1385
|
+
stats?: Record<string, unknown>;
|
|
1366
1386
|
}
|
|
1367
1387
|
|
|
1368
1388
|
// ─── Dry Run DTOs ──────────────────────────────────────────────────────
|
|
@@ -2669,6 +2689,11 @@ export type WorkerToHost =
|
|
|
2669
2689
|
| { type: "council_get_available_lumia_items"; requestId: string; userId?: string }
|
|
2670
2690
|
// ─── Activated World Info (gated: "world_books") ───────────────────
|
|
2671
2691
|
| { type: "world_books_get_activated"; requestId: string; chatId: string; userId?: string }
|
|
2692
|
+
// ─── Global World Books (gated: "world_books") ───────────────────────
|
|
2693
|
+
| { type: "world_books_get_global"; requestId: string; userId?: string }
|
|
2694
|
+
| { type: "world_books_set_global"; requestId: string; worldBookIds: string[]; userId?: string }
|
|
2695
|
+
| { type: "world_books_activate_global"; requestId: string; worldBookId: string; userId?: string }
|
|
2696
|
+
| { type: "world_books_deactivate_global"; requestId: string; worldBookId: string; userId?: string }
|
|
2672
2697
|
// ─── Regex Scripts (gated: "regex_scripts") ────────────────────────
|
|
2673
2698
|
| { type: "regex_scripts_list"; requestId: string; scope?: RegexScopeDTO; scopeId?: string; target?: RegexTargetDTO; limit?: number; offset?: number; userId?: string }
|
|
2674
2699
|
| { type: "regex_scripts_get"; requestId: string; scriptId: string; userId?: string }
|
package/src/dom.ts
CHANGED
|
@@ -212,6 +212,13 @@ export interface SpindleDockPanelHandle {
|
|
|
212
212
|
onVisibilityChange(handler: (visible: boolean) => void): () => void;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
+
// ── Tab Mobility ──
|
|
216
|
+
|
|
217
|
+
/** Where a built-in drawer tab currently lives. */
|
|
218
|
+
export type SpindleTabLocation =
|
|
219
|
+
| { kind: "main-drawer" }
|
|
220
|
+
| { kind: "container"; containerId: string };
|
|
221
|
+
|
|
215
222
|
// ── App Mount ──
|
|
216
223
|
|
|
217
224
|
export interface SpindleAppMountOptions {
|
|
@@ -752,6 +759,12 @@ export interface SpindleFrontendContext {
|
|
|
752
759
|
* ```
|
|
753
760
|
*/
|
|
754
761
|
showConfirm(options: SpindleConfirmOptions): Promise<SpindleConfirmResult>;
|
|
762
|
+
/** Request a tab move to a specific drawer location. */
|
|
763
|
+
requestTabLocation(tabId: string, location: SpindleTabLocation): void;
|
|
764
|
+
/** Get the display title of a built-in drawer tab by its id. */
|
|
765
|
+
getBuiltInTabTitle(tabId: string): string | undefined;
|
|
766
|
+
/** Get the root HTMLElement of a built-in drawer tab by its id, or undefined if not mounted. */
|
|
767
|
+
getBuiltInTabRoot(tabId: string): HTMLElement | undefined;
|
|
755
768
|
};
|
|
756
769
|
/**
|
|
757
770
|
* Mount instances of Lumiverse's first-party shared UI components (form
|
|
@@ -761,6 +774,13 @@ export interface SpindleFrontendContext {
|
|
|
761
774
|
* {@link SpindleComponentsHelper} for the full surface.
|
|
762
775
|
*/
|
|
763
776
|
components: SpindleComponentsHelper;
|
|
777
|
+
/** Register or unregister passive DOM containers that can receive tab roots. */
|
|
778
|
+
containers: {
|
|
779
|
+
/** Register a container element with a stable id. Tabs routed to this id via `requestTabLocation` will be reparented into `element`. Idempotent on id collision. */
|
|
780
|
+
registerContainer(entry: { id: string; side: 'left' | 'right' | 'top' | 'bottom'; element: HTMLElement }): void;
|
|
781
|
+
/** Remove a previously registered container. Tabs still pointing to this id will fall back to the main drawer. */
|
|
782
|
+
unregisterContainer(id: string): void;
|
|
783
|
+
};
|
|
764
784
|
uploads: {
|
|
765
785
|
pickFile(options?: {
|
|
766
786
|
accept?: string[];
|
package/src/index.ts
CHANGED
|
@@ -98,6 +98,8 @@ export type {
|
|
|
98
98
|
PersonaCreateDTO,
|
|
99
99
|
PersonaUpdateDTO,
|
|
100
100
|
ActivatedWorldInfoEntryDTO,
|
|
101
|
+
WorldBookSourceDTO,
|
|
102
|
+
WorldInfoActivatedEventDTO,
|
|
101
103
|
DryRunRequestDTO,
|
|
102
104
|
DryRunResultDTO,
|
|
103
105
|
AssemblyBreakdownEntryDTO,
|
|
@@ -231,7 +233,8 @@ export type {
|
|
|
231
233
|
SpindleDisplayScriptsArgs,
|
|
232
234
|
SpindleDisplayResolveResult,
|
|
233
235
|
SpindleDisplayTemplatesResult,
|
|
234
|
-
|
|
236
|
+
SpindleTabLocation,
|
|
237
|
+
} from "./dom";
|
|
235
238
|
|
|
236
239
|
export type {
|
|
237
240
|
SpindleMountedComponent,
|
package/src/spindle-api.ts
CHANGED
|
@@ -877,6 +877,27 @@ export interface SpindleAPI {
|
|
|
877
877
|
};
|
|
878
878
|
/** Get activated world info entries (keyword + vector) for a chat. */
|
|
879
879
|
getActivated(chatId: string, userId?: string): Promise<ActivatedWorldInfoEntryDTO[]>;
|
|
880
|
+
/**
|
|
881
|
+
* Get the IDs of the user's globally-active world books (the
|
|
882
|
+
* "globalWorldBooks" setting). Global books apply to every chat.
|
|
883
|
+
*/
|
|
884
|
+
getGlobal(userId?: string): Promise<string[]>;
|
|
885
|
+
/**
|
|
886
|
+
* Replace the set of globally-active world books. IDs that don't
|
|
887
|
+
* resolve to an existing world book are dropped. Returns the applied
|
|
888
|
+
* ID list.
|
|
889
|
+
*/
|
|
890
|
+
setGlobal(worldBookIds: string[], userId?: string): Promise<string[]>;
|
|
891
|
+
/**
|
|
892
|
+
* Activate a single world book globally (atomic add). Throws if the
|
|
893
|
+
* book does not exist. Returns the updated global ID list.
|
|
894
|
+
*/
|
|
895
|
+
activateGlobal(worldBookId: string, userId?: string): Promise<string[]>;
|
|
896
|
+
/**
|
|
897
|
+
* Deactivate a single globally-active world book (atomic remove).
|
|
898
|
+
* No-op if the book wasn't active. Returns the updated global ID list.
|
|
899
|
+
*/
|
|
900
|
+
deactivateGlobal(worldBookId: string, userId?: string): Promise<string[]>;
|
|
880
901
|
};
|
|
881
902
|
|
|
882
903
|
/**
|