lumiverse-spindle-types 0.5.22 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumiverse-spindle-types",
3
- "version": "0.5.22",
3
+ "version": "0.5.23",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
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/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,
@@ -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
  /**