Skip to content

Backend API

Your backend module runs in an isolated Bun worker thread. The spindle global is automatically available — no imports needed.

For TypeScript support, add this at the top of your backend file:

declare const spindle: import('lumiverse-spindle-types').SpindleAPI

API Surface

Category Permission Description
Events Free Subscribe to Lumiverse lifecycle events
Macros Free Register custom {{macros}} for prompts
Interceptors interceptor Modify the prompt before it reaches the LLM
Prompt Regex Ownership Free Apply target:prompt regex yourself for chats you own
Context Handlers context_handler Enrich the generation context before assembly
Macro Interceptor macro_interceptor Transform raw templates before macro parsing/dispatch
World Info Interceptor generation Disable world info entries or override their content before activation
Message Content Processor chat_mutation Transform message content before it is written to the database
LLM Tools tools Register function-calling tools + Council-eligible tools
Generation generation Fire LLM generations + inspect connections
Decision Models decisions Evaluate typed questions using saved Decision connections
Embeddings embeddings Embed text with the user's embedding connections
Image Generation image_gen Generate images via image gen connection profiles
Images images Read, upload, filter, and delete stored image/video assets
Media media Convert audio/video, transcode with custom parameters, mux tracks, and compose still-image videos
Theme app_manipulation Apply CSS variable overrides on top of the user's theme
Storage Free Scoped file storage (extension + per-user)
Shared RPC Pool Free Cross-extension latest-state and on-demand reads across the worker isolation boundary
Ephemeral Storage ephemeral_storage Temporary storage with TTL and quotas
Variables Free Local (chat-scoped) and global variable access
Runtime State Per operation Read combined chat state and correlate mutation acknowledgements with events
Tokens Free Count text, message arrays, or stored chats against an explicit model or the main/sidecar model
Uploads Free Receive large files via a resumable tus endpoint, then read them in the worker by id
Large Files and Archives cors_proxy for downloads; local operations free Stage binary downloads, consume ZIP64 archives, and stream exports to the browser
Characters characters CRUD on character cards
Chats chats CRUD on chat sessions + active chat
Presets presets CRUD on user presets, prompt blocks, and category groups
World Books world_books CRUD on world books and entries
Regex Scripts regex_scripts CRUD on regex scripts (find/replace rules)
Databanks databanks CRUD on databanks and their documents
Memories memories Memory Cortex (entities, relations, vaults, consolidations) + long-term chat memory CRUD
Personas personas CRUD on personas + active switching + attached world books
Council Free Read the active council members and configuration
Chat Mutation chat_mutation Read and modify chat messages
Event Tracking event_tracking Structured telemetry and analytics
Secure Enclave Free Encrypted secret storage
CORS Proxy cors_proxy Server-side HTTP requests
OAuth oauth OAuth callback handler registration
Logging Free Server console logging
Toast Notifications Free Show success/warning/error/info toasts in the frontend
Text Editor Free Open the full-screen text editor modal with macro highlighting
Modal Free Open a system-themed modal overlay with structured content
Input Prompt Free Present a text input modal and await the user's response
Push Notifications push_notification Send OS-level push notifications to user devices
Web Search web_search Run searches via the user's configured search provider (SearXNG) and read the safe view of their web search settings
User Context Free Check user visibility and read extension-facing user roles
Frontend Communication Free Message passing to/from frontend
Frontend Process Lifecycle Free Spawn and supervise long-lived frontend-side controllers
Backend Process Lifecycle Free Spawn and supervise isolated backend subprocesses
Commands Free Register custom commands in the command palette (Cmd/Ctrl+K)
UI Automation Free Enumerate drawer / settings tabs and navigate the user to a specific surface
Version Free Read the backend and frontend semantic versions
UUIDs Free Generate UUID v4 or v7 strings through the backend