lumiverse-spindle-types 0.3.9 → 0.4.1

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.3.9",
3
+ "version": "0.4.1",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
package/src/api.ts CHANGED
@@ -617,10 +617,54 @@ export interface ThemeInfoDTO {
617
617
  radiusScale: number;
618
618
  /** Font size multiplier (1.0 = default) */
619
619
  fontScale: number;
620
+ /** Full UI zoom multiplier (1.0 = default, affects all elements via CSS zoom) */
621
+ uiScale: number;
620
622
  /** Whether the theme dynamically adapts to the active character's avatar */
621
623
  characterAware: boolean;
622
624
  }
623
625
 
626
+ /**
627
+ * Input config for `spindle.theme.generateVariables()`.
628
+ *
629
+ * Mirrors the inputs that Lumiverse's theme engine uses to produce the full
630
+ * set of ~80+ CSS variables. Extensions can use the result as a complete,
631
+ * coherent override set for `spindle.theme.apply()`.
632
+ */
633
+ export interface ThemeVariablesConfigDTO {
634
+ /** Primary accent color in HSL. */
635
+ accent: { h: number; s: number; l: number };
636
+ /** Resolved color mode. */
637
+ mode: "dark" | "light";
638
+ /** Enable glassmorphic backdrop-filter tokens (default: `true`). */
639
+ enableGlass?: boolean;
640
+ /** Border radius multiplier (default: `1`). */
641
+ radiusScale?: number;
642
+ /** Font size multiplier (default: `1`). */
643
+ fontScale?: number;
644
+ /** Full UI zoom multiplier (default: `1`). */
645
+ uiScale?: number;
646
+ /** Optional base color overrides. Each value is a CSS color string. */
647
+ baseColors?: {
648
+ primary?: string;
649
+ secondary?: string;
650
+ background?: string;
651
+ text?: string;
652
+ danger?: string;
653
+ success?: string;
654
+ warning?: string;
655
+ /** Dialogue / speech color override. */
656
+ speech?: string;
657
+ /** Italic / thoughts color override. */
658
+ thoughts?: string;
659
+ };
660
+ /** Status color overrides (danger, success, warning). */
661
+ statusColors?: {
662
+ danger?: string;
663
+ success?: string;
664
+ warning?: string;
665
+ };
666
+ }
667
+
624
668
  // ─── Modal content items (used by backend-initiated modals) ─────────────
625
669
 
626
670
  /**
@@ -931,6 +975,8 @@ export type WorkerToHost =
931
975
  | { type: "theme_get_current"; requestId: string; userId?: string }
932
976
  // ─── Color Extraction (gated: "app_manipulation") ─────────────────────
933
977
  | { type: "color_extract"; requestId: string; imageId: string; userId?: string }
978
+ // ─── Theme Variable Generation (gated: "app_manipulation") ────────────
979
+ | { type: "theme_generate_variables"; requestId: string; config: ThemeVariablesConfigDTO }
934
980
  // ─── Commands (free tier) ──────────────────────────────────────────────
935
981
  | { type: "commands_register"; commands: SpindleCommandDTO[] }
936
982
  | { type: "commands_unregister"; commandIds: string[] };
package/src/council.ts CHANGED
@@ -59,6 +59,10 @@ export interface CouncilToolsSettings {
59
59
  allowUserControl: boolean;
60
60
  /** Word limit per tool response (0 = unlimited). */
61
61
  maxWordsPerTool: number;
62
+ /** When true, council tools are NOT re-executed on regenerations and swipes.
63
+ * Instead, the last successful council results (cached in chat metadata) are
64
+ * reused. Tools still fire for fresh sends, continues, impersonations, etc. */
65
+ retainResultsForRegens?: boolean;
62
66
  /**
63
67
  * @deprecated Sidecar config is now stored as a top-level `sidecarSettings`
64
68
  * user setting. This field is read as a fallback for backwards compatibility.
@@ -94,6 +98,18 @@ export interface CouncilExecutionResult {
94
98
  totalDurationMs: number;
95
99
  }
96
100
 
101
+ /** Cached council results persisted in `chat.metadata.last_council_results`.
102
+ * Used when `retainResultsForRegens` is enabled to skip re-execution on
103
+ * regenerations and swipes. */
104
+ export interface CachedCouncilResult {
105
+ results: CouncilToolResult[];
106
+ deliberationBlock: string;
107
+ /** Named result variables extracted from tool definitions with `resultVariable`. */
108
+ namedResults: Record<string, string>;
109
+ /** Unix epoch ms when this cache was written. */
110
+ cachedAt: number;
111
+ }
112
+
97
113
  // ---- Tool Definition ----
98
114
 
99
115
  export type CouncilToolCategory =
@@ -146,6 +162,7 @@ export const COUNCIL_TOOLS_DEFAULTS: CouncilToolsSettings = {
146
162
  includeWorldInfo: true,
147
163
  allowUserControl: false,
148
164
  maxWordsPerTool: 250,
165
+ retainResultsForRegens: false,
149
166
  };
150
167
 
151
168
  export const COUNCIL_SETTINGS_DEFAULTS: CouncilSettings = {
package/src/index.ts CHANGED
@@ -53,6 +53,7 @@ export type {
53
53
  ImageGenResultDTO,
54
54
  ThemeOverrideDTO,
55
55
  ThemeInfoDTO,
56
+ ThemeVariablesConfigDTO,
56
57
  ColorExtractionResult,
57
58
  ColorRGB,
58
59
  ColorHSL,
@@ -108,6 +109,7 @@ export type {
108
109
  CouncilSettings,
109
110
  CouncilToolResult,
110
111
  CouncilExecutionResult,
112
+ CachedCouncilResult,
111
113
  CouncilToolCategory,
112
114
  CouncilToolDefinition,
113
115
  } from "./council";
@@ -32,6 +32,7 @@ import type {
32
32
  ImageGenProviderDTO,
33
33
  ThemeOverrideDTO,
34
34
  ThemeInfoDTO,
35
+ ThemeVariablesConfigDTO,
35
36
  ColorExtractionResult,
36
37
  SpindleModalItemDTO,
37
38
  SpindleCommandDTO,
@@ -635,6 +636,27 @@ export interface SpindleAPI {
635
636
  * @param imageId - ID of an image in the images table
636
637
  */
637
638
  extractColors(imageId: string, userId?: string): Promise<ColorExtractionResult>;
639
+ /**
640
+ * Generate the full set of Lumiverse CSS variables from a theme config.
641
+ *
642
+ * Returns a `Record<string, string>` containing every CSS variable the
643
+ * theme engine would produce — primary accent variants, backgrounds,
644
+ * borders, text, glass tokens, shadows, radii, prose tokens, and more
645
+ * (~80+ variables). The result can be passed directly to `apply()` for a
646
+ * complete, coherent theme override.
647
+ *
648
+ * @example
649
+ * ```ts
650
+ * // Extract palette from an image, then generate + apply a full theme
651
+ * const palette = await spindle.theme.extractColors(imageId)
652
+ * const vars = await spindle.theme.generateVariables({
653
+ * accent: palette.dominantHsl,
654
+ * mode: 'dark',
655
+ * })
656
+ * await spindle.theme.apply({ variables: vars })
657
+ * ```
658
+ */
659
+ generateVariables(config: ThemeVariablesConfigDTO): Promise<Record<string, string>>;
638
660
  };
639
661
 
640
662
  /**