lumiverse-spindle-types 0.5.21 → 0.5.23
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 +0 -2
- package/src/index.ts +2 -0
- 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
|
@@ -691,8 +691,6 @@ export interface SpindleDisplayResolverRegistry {
|
|
|
691
691
|
registerResolver(resolver: SpindleDisplayResolver): () => void;
|
|
692
692
|
/** Ask the host to invalidate cached display resolutions whose dependencies (a `<scope>:<name>` set) changed. */
|
|
693
693
|
invalidate(touchedVars: string[]): void;
|
|
694
|
-
/** Publish the set of character IDs whose display this extension owns. The host uses it to decide synchronously, at render time, whether a chat is owned by this resolver. */
|
|
695
|
-
setOwnedCharacters(characterIds: string[]): void;
|
|
696
694
|
}
|
|
697
695
|
|
|
698
696
|
/** Context object provided to frontend extension modules */
|
package/src/index.ts
CHANGED
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
|
/**
|