lumiverse-spindle-types 0.4.13 → 0.4.14

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.4.13",
3
+ "version": "0.4.14",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
package/src/api.ts CHANGED
@@ -933,6 +933,11 @@ export type WorkerToHost =
933
933
  | { type: "vars_delete_global"; requestId: string; key: string; userId?: string }
934
934
  | { type: "vars_list_global"; requestId: string; userId?: string }
935
935
  | { type: "vars_has_global"; requestId: string; key: string; userId?: string }
936
+ | { type: "vars_get_chat"; requestId: string; chatId: string; key: string }
937
+ | { type: "vars_set_chat"; requestId: string; chatId: string; key: string; value: string }
938
+ | { type: "vars_delete_chat"; requestId: string; chatId: string; key: string }
939
+ | { type: "vars_list_chat"; requestId: string; chatId: string }
940
+ | { type: "vars_has_chat"; requestId: string; chatId: string; key: string }
936
941
  // ─── Characters (gated: "characters") ──────────────────────────────
937
942
  | { type: "characters_list"; requestId: string; limit?: number; offset?: number; userId?: string }
938
943
  | { type: "characters_get"; requestId: string; characterId: string; userId?: string }
@@ -307,8 +307,9 @@ export interface SpindleAPI {
307
307
  };
308
308
 
309
309
  /**
310
- * Local (chat-scoped) and global variable access (free tier — no permission needed).
311
- * Uses the same storage as built-in {{getvar}}/{{setgvar}} macros.
310
+ * Local (transient), global (user-scoped), and chat (persisted) variable access
311
+ * (free tier no permission needed).
312
+ * Uses the same storage as built-in {{getvar}}/{{setgvar}}/{{getchatvar}} macros.
312
313
  */
313
314
  variables: {
314
315
  local: {
@@ -325,6 +326,15 @@ export interface SpindleAPI {
325
326
  list(userId?: string): Promise<Record<string, string>>;
326
327
  has(key: string, userId?: string): Promise<boolean>;
327
328
  };
329
+ /** Chat-scoped persisted variables — stored in chat.metadata.chat_variables.
330
+ * Persists across generations within the same chat. */
331
+ chat: {
332
+ get(chatId: string, key: string): Promise<string>;
333
+ set(chatId: string, key: string, value: string): Promise<void>;
334
+ delete(chatId: string, key: string): Promise<void>;
335
+ list(chatId: string): Promise<Record<string, string>>;
336
+ has(chatId: string, key: string): Promise<boolean>;
337
+ };
328
338
  };
329
339
 
330
340
  /**