lumiverse-spindle-types 0.6.0 → 0.6.2
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 +67 -1
- package/src/index.ts +5 -0
- package/src/spindle-api.ts +26 -2
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -1481,6 +1481,70 @@ export interface LumiaItemDTO {
|
|
|
1481
1481
|
updated_at: number;
|
|
1482
1482
|
}
|
|
1483
1483
|
|
|
1484
|
+
/** A Loom item category included in a Lumia DLC pack. */
|
|
1485
|
+
export type LoomItemCategoryDTO = "narrative_style" | "loom_utility" | "retrofit";
|
|
1486
|
+
|
|
1487
|
+
/** A narrative style, utility, or retrofit included in a Lumia DLC pack. */
|
|
1488
|
+
export interface LoomItemDTO {
|
|
1489
|
+
id: string;
|
|
1490
|
+
pack_id: string;
|
|
1491
|
+
name: string;
|
|
1492
|
+
content: string;
|
|
1493
|
+
category: LoomItemCategoryDTO;
|
|
1494
|
+
author_name: string;
|
|
1495
|
+
version: string;
|
|
1496
|
+
sort_order: number;
|
|
1497
|
+
created_at: number;
|
|
1498
|
+
updated_at: number;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
/** A tool included in a Lumia DLC pack. */
|
|
1502
|
+
export interface LoomToolDTO {
|
|
1503
|
+
id: string;
|
|
1504
|
+
pack_id: string;
|
|
1505
|
+
tool_name: string;
|
|
1506
|
+
display_name: string;
|
|
1507
|
+
description: string;
|
|
1508
|
+
prompt: string;
|
|
1509
|
+
input_schema: Record<string, unknown>;
|
|
1510
|
+
result_variable: string;
|
|
1511
|
+
store_in_deliberation: boolean;
|
|
1512
|
+
author_name: string;
|
|
1513
|
+
version: string;
|
|
1514
|
+
sort_order: number;
|
|
1515
|
+
created_at: number;
|
|
1516
|
+
updated_at: number;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
/**
|
|
1520
|
+
* Extension-safe metadata for a pack in the user's Lumia DLC catalog.
|
|
1521
|
+
* Ownership and the arbitrary pack `extras` blob are intentionally omitted.
|
|
1522
|
+
*/
|
|
1523
|
+
export interface LumiaDlcPackDTO {
|
|
1524
|
+
id: string;
|
|
1525
|
+
name: string;
|
|
1526
|
+
author: string;
|
|
1527
|
+
cover_url: string | null;
|
|
1528
|
+
version: string;
|
|
1529
|
+
is_custom: boolean;
|
|
1530
|
+
source_url: string | null;
|
|
1531
|
+
created_at: number;
|
|
1532
|
+
updated_at: number;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
/**
|
|
1536
|
+
* All Lumia DLC content currently available to one user. Item `pack_id`
|
|
1537
|
+
* values refer to an entry in `packs`.
|
|
1538
|
+
*/
|
|
1539
|
+
export interface LumiaDlcCatalogDTO {
|
|
1540
|
+
packs: LumiaDlcPackDTO[];
|
|
1541
|
+
lumiaItems: LumiaItemDTO[];
|
|
1542
|
+
narrativeStyles: LoomItemDTO[];
|
|
1543
|
+
utilities: LoomItemDTO[];
|
|
1544
|
+
retrofits: LoomItemDTO[];
|
|
1545
|
+
tools: LoomToolDTO[];
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1484
1548
|
export interface PersonaDTO {
|
|
1485
1549
|
id: string;
|
|
1486
1550
|
name: string;
|
|
@@ -2760,7 +2824,7 @@ export type WorkerToHost =
|
|
|
2760
2824
|
keys: string[];
|
|
2761
2825
|
}
|
|
2762
2826
|
| { type: "cors_request"; requestId: string; url: string; options: RequestInitDTO }
|
|
2763
|
-
| { type: "register_context_handler"; priority?: number }
|
|
2827
|
+
| { type: "register_context_handler"; priority?: number; timeoutMs?: number }
|
|
2764
2828
|
| {
|
|
2765
2829
|
type: "context_handler_result";
|
|
2766
2830
|
requestId: string;
|
|
@@ -2909,6 +2973,8 @@ export type WorkerToHost =
|
|
|
2909
2973
|
| { type: "council_get_settings"; requestId: string; userId?: string }
|
|
2910
2974
|
| { type: "council_get_members"; requestId: string; userId?: string }
|
|
2911
2975
|
| { type: "council_get_available_lumia_items"; requestId: string; userId?: string }
|
|
2976
|
+
// ─── Lumia DLC (free tier, read-only) ──────────────────────────────
|
|
2977
|
+
| { type: "dlc_get_catalog"; requestId: string; userId?: string }
|
|
2912
2978
|
// ─── Activated World Info (gated: "world_books") ───────────────────
|
|
2913
2979
|
| { type: "world_books_get_activated"; requestId: string; chatId: string; userId?: string }
|
|
2914
2980
|
// ─── Global World Books (gated: "world_books") ───────────────────────
|
package/src/index.ts
CHANGED
|
@@ -97,6 +97,11 @@ export type {
|
|
|
97
97
|
GlobalAddonDTO,
|
|
98
98
|
GlobalAddonUpdateDTO,
|
|
99
99
|
LumiaItemDTO,
|
|
100
|
+
LoomItemCategoryDTO,
|
|
101
|
+
LoomItemDTO,
|
|
102
|
+
LoomToolDTO,
|
|
103
|
+
LumiaDlcPackDTO,
|
|
104
|
+
LumiaDlcCatalogDTO,
|
|
100
105
|
PersonaCreateDTO,
|
|
101
106
|
PersonaUpdateDTO,
|
|
102
107
|
ActivatedWorldInfoEntryDTO,
|
package/src/spindle-api.ts
CHANGED
|
@@ -50,6 +50,7 @@ import type {
|
|
|
50
50
|
GlobalAddonDTO,
|
|
51
51
|
GlobalAddonUpdateDTO,
|
|
52
52
|
LumiaItemDTO,
|
|
53
|
+
LumiaDlcCatalogDTO,
|
|
53
54
|
PersonaCreateDTO,
|
|
54
55
|
PersonaUpdateDTO,
|
|
55
56
|
ActivatedWorldInfoEntryDTO,
|
|
@@ -1196,6 +1197,15 @@ export interface SpindleAPI {
|
|
|
1196
1197
|
getAvailableLumiaItems(options?: { userId?: string }): Promise<LumiaItemDTO[]>;
|
|
1197
1198
|
};
|
|
1198
1199
|
|
|
1200
|
+
/**
|
|
1201
|
+
* Read-only Lumia DLC catalog (no permission declaration required).
|
|
1202
|
+
* Includes pack metadata, Lumias, narrative styles, Loom utilities,
|
|
1203
|
+
* retrofits, and Loom tools available to the effective user.
|
|
1204
|
+
*/
|
|
1205
|
+
dlc: {
|
|
1206
|
+
getCatalog(options?: { userId?: string }): Promise<LumiaDlcCatalogDTO>;
|
|
1207
|
+
};
|
|
1208
|
+
|
|
1199
1209
|
personas: {
|
|
1200
1210
|
list(options?: { limit?: number; offset?: number; userId?: string }): Promise<{ data: PersonaDTO[]; total: number }>;
|
|
1201
1211
|
get(personaId: string, userId?: string): Promise<PersonaDTO | null>;
|
|
@@ -1277,12 +1287,26 @@ export interface SpindleAPI {
|
|
|
1277
1287
|
/** Make a CORS-proxied HTTP request */
|
|
1278
1288
|
cors(url: string, options?: RequestInitDTO): Promise<unknown>;
|
|
1279
1289
|
|
|
1280
|
-
/**
|
|
1290
|
+
/**
|
|
1291
|
+
* Register a context handler for enriching generation context, awaited
|
|
1292
|
+
* before prompt assembly. The context carries `chatId`, `generationType`,
|
|
1293
|
+
* `dryRun` (tokenize/preview assemblies) and `userId`, returning it with
|
|
1294
|
+
* `cancelGeneration: true` stops the generation, and `opts.timeoutMs`
|
|
1295
|
+
* overrides the default 10s wall-clock budget (clamped to 1s-120s).
|
|
1296
|
+
*/
|
|
1281
1297
|
registerContextHandler(
|
|
1282
1298
|
handler: (context: unknown) => Promise<unknown>,
|
|
1283
|
-
priority?: number
|
|
1299
|
+
priority?: number,
|
|
1300
|
+
opts?: { timeoutMs?: number }
|
|
1284
1301
|
): void;
|
|
1285
1302
|
|
|
1303
|
+
/**
|
|
1304
|
+
* Host contract versions for feature detection, keyed by contract name.
|
|
1305
|
+
* `preAssemblyGenerationContext >= 1`: generation contexts carry
|
|
1306
|
+
* `dryRun`/`userId` and `cancelGeneration` is honored.
|
|
1307
|
+
*/
|
|
1308
|
+
contracts?: Readonly<Record<string, number>>;
|
|
1309
|
+
|
|
1286
1310
|
/**
|
|
1287
1311
|
* Register a macro interceptor (permission: `macro_interceptor`).
|
|
1288
1312
|
*
|