lumiverse-spindle-types 0.4.12 → 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.12",
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 }
@@ -983,7 +988,7 @@ export type WorkerToHost =
983
988
  // ─── Text Editor (free tier) ───────────────────────────────────────
984
989
  | { type: "text_editor_open"; requestId: string; title?: string; value?: string; placeholder?: string; userId?: string }
985
990
  // ─── Modal (free tier) ────────────────────────────────────────────
986
- | { type: "modal_open"; requestId: string; title: string; items: SpindleModalItemDTO[]; width?: number; maxHeight?: number; persistent?: boolean; userId?: string }
991
+ | { type: "modal_open"; requestId: string; modalRequestId?: string; title: string; items: SpindleModalItemDTO[]; width?: number; maxHeight?: number; persistent?: boolean; userId?: string }
987
992
  | { type: "modal_close"; requestId: string; openRequestId: string; userId?: string }
988
993
  | { type: "confirm_open"; requestId: string; title: string; message: string; variant?: "info" | "warning" | "danger" | "success"; confirmLabel?: string; cancelLabel?: string; userId?: string }
989
994
  | { type: "input_prompt_open"; requestId: string; title: string; message?: string; placeholder?: string; defaultValue?: string; submitLabel?: string; cancelLabel?: string; multiline?: boolean; 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
  /**
@@ -724,6 +734,13 @@ export interface SpindleAPI {
724
734
  * Default: `false`.
725
735
  */
726
736
  persistent?: boolean;
737
+ /**
738
+ * Caller-provided request ID for the modal. When supplied, the host uses
739
+ * this value (instead of the internal correlation requestId) as the modal
740
+ * identity key, enabling programmatic close via `spindle.modal.close()`
741
+ * before the modal resolves.
742
+ */
743
+ modalRequestId?: string;
727
744
  /** For operator-scoped extensions only. */
728
745
  userId?: string;
729
746
  }): Promise<{