Backend commands
The Rust backend exposes 87 Tauri commands. The interface calls them through typed wrappers in src/lib/api.ts (api.<name>). In the browser preview, src/lib/mock-backend.ts handles the same calls.
Conventions
- Argument names are camelCase in TypeScript. Tauri converts them to snake_case in Rust.
- Every command returns
AppResult<T>. Errors reach TypeScript as a plain string. UseerrorMessage(e)fromapi.tsto normalise them. - Caller says which windows may call the command. C is the control window only. C+O is the control window and the output windows (audience, confidence, identify). See Security and permissions.
Workspace
| Command | Arguments | Returns | Caller | Notes |
|---|---|---|---|---|
workspace_info | {path, defaultPath, firstRun, version} | C | version comes from tauri.conf.json | |
workspace_open | path (absolute) | C | Opens or creates the workspace, runs migrations, remembers the path | |
workspace_reveal | C | Opens the folder in Explorer or Finder |
Library, services, settings and history
| Command | Arguments | Returns | Caller | Notes |
|---|---|---|---|---|
library_list | kind?, query?, includeArchived? (false), withData? (false), limit? (5000, clamped to 1–20000) | Resource[] | C | With query: FTS5 prefix search, ranked by bm25 with title weighted 10×. Otherwise sorted by title. Without withData, data is null. |
library_get | id | Resource | C | "Not found" if missing |
library_get_many | ids | Resource[] | C | Missing IDs are skipped |
library_save | resource, expectedRevision? | Resource | C | Upsert. If expectedRevision doesn't match: "was changed elsewhere (revision N); reload before saving". Bumps revision. May write the daily backup. |
library_save_batch | resources | Resource[] | C | Atomic upsert, no revision check, no backup |
library_delete | ids, permanent? (false) | C | Archives by default; permanent deletes the row | |
library_restore | id | C | Un-archives | |
library_counts | Record<kind, number> | C | Non-archived resources per kind | |
service_list | Service[] (no data) | C | Newest date first | |
service_get | id | Service | C | |
service_save | service | Service | C | Upsert, bumps revision (not checked). Name required. May write the daily backup. |
service_delete | id | C | Permanent | |
settings_get | key | JSON or null | C+O | |
settings_set | key, value | C | ||
history_list | limit? (200) | {id, at, serviceId?, command, sceneRevision, result}[] | C | Newest first |
Assets and files
| Command | Arguments | Returns | Caller | Notes |
|---|---|---|---|---|
asset_import | paths | {ok, path, asset?, error?}[] | C | One result per file; a failure doesn't stop the rest |
asset_import_bytes | raw body, header x-name | Asset | C | For pasted or generated files |
asset_list | kind?, includeArchived? | Asset[] | C | Newest first |
asset_get | hash | Asset or null | C+O | |
asset_update | hash, name?, meta? | C | meta is merged into the stored object | |
asset_archive | hash, archived | C | Soft delete. The file stays on disk. | |
asset_check | hashes | string[] | C | Hashes whose record or file is missing (used by preflight) |
read_text_file | path | string | C | Up to 50 MB. Strips a UTF-8 BOM, rejects invalid UTF-8. |
read_binary_file | path | bytes | C | Up to 50 MB |
write_text_file | path, contents | C | .json or .txt only, up to 20 MB. Used for the diagnostics export. No wrapper in api.ts. | |
write_pack_file | raw body, header x-path (percent-encoded) | C | Writes an exported lower-third pack. .altarlt only, up to 200 MB. |
Bible
| Command | Arguments | Returns | Caller | Notes |
|---|---|---|---|---|
bible_install | path | BiblePack | C | Up to 64 MB. Replaces a pack with the same id. |
bible_install_json | json | BiblePack | C | Same, from a string (used for the bundled KJV) |
bible_list | BiblePack[] | C | Sorted by name | |
bible_remove | id | C | Removes the pack, its verses and its search index | |
bible_passage | translation, book, chapter, start, end | VerseRow[] | C | |
bible_search | translation, query, limit? (100) | VerseRow[] | C | FTS5 keyword search |
BiblePack is {id, name, abbreviation, language, version, rights, structure: {books: [{id, name, verses: number[]}]}, installedAt}. VerseRow is {book, chapter, verse, text}.
Backups
| Command | Arguments | Returns | Caller | Notes |
|---|---|---|---|---|
backup_create | file name | C | manual-YYYYMMDD-HHMMSS.db | |
backup_list | {name, size, modified, kind}[] | C | Newest first. kind is the name before the first -. | |
backup_restore | name | C | Validates the copy, saves a pre-restore-* backup, then swaps the database |
Packages and documents
| Command | Arguments | Returns | Caller | Notes |
|---|---|---|---|---|
package_export | path, manifest, service, resources, assetHashes | {size, entries} | C | Writes a .altar file |
package_inspect | path | PackageInspect | C | Validates without importing |
package_import | path | PackageInspect | C | Imports the service, resources and media |
docx_extract | path, keepEmpty? (false) | DocBlock[] | C | {kind, level, text, locator, style?} |
pptx_import | path | PptxImport | C | {sourceHash, filename, width, height, slides, fonts, warnings} |
See Service package format for the package limits.
Live coordinator
| Command | Arguments | Returns | Caller | Notes |
|---|---|---|---|---|
live_state | LiveState | C | ||
live_frame | Frame | C+O | What an output window should draw | |
live_preview | target or null | preview revision | C | Validates. Never changes Live. |
live_go | commandId, target, transition?: {slide, durationMs}, autopilot? | revision | C | Commits live, optionally through a timed breaker (max 60 000 ms). autopilot is the requestId of an Autopilot request the control window is carrying out: Autopilot's rules apply instead of counting as the operator acting, and the call fails with the refusal's message if they don't allow it, or "Autopilot's request has expired". |
live_step | commandId, delta | {moved, revision, boundary?, reason?} | C | Holds at the item's first and last slide; refused during a transition |
live_goto | commandId, itemId, index | revision | C | Within the live item only. Cancels a transition. |
live_mode | "content", "black" or "logo" | revision | C | Black and Logo cancel a transition. Logo fails if no logo is set. |
live_clear_text | on | revision | C | |
live_set_logo | slide or null | C | Removing the logo while in Logo mode switches to Black | |
live_transition | "skip" or "stop" | revision | C | |
live_overlay | action, cue? | revision | C | show, hide, update, retrigger, hideAll, reorder. Up to 3 on air. |
live_hide_overlays | on | revision | C | |
live_media | action, value? | C | play, pause, stop, restart, volume (0–1), mute | |
live_countdown | seconds or null | C | ||
live_stage_message | message or null | C | Blank clears | |
live_clear | revision | C | Clears live content and lower thirds | |
output_ack | role, session, revision | C+O | An output window confirms it drew a revision |
Outputs
| Command | Arguments | Returns | Caller | Notes |
|---|---|---|---|---|
monitors_list | MonitorInfo[] | C | {key, index, name, width, height, x, y, scaleFactor, isPrimary, isControl, bounds} | |
output_open | role ("audience" or "confidence"), monitorKey | C | Replaces any window with that role. New session ID. | |
output_close | role | C | ||
output_identify | seconds? (4, clamped 1–30) | C | Numbered pattern on every display |
A monitor key is "<name>@<x>,<y>". When reopening a display, the backend looks for the exact key, then the same name, then the same position.
Listening
Listen's offline speech-to-text (speech.rs, on the shared altar-speech crate). Speech models are kept per computer in the app's local data folder, under speech-models, which Autopilot on the same computer shares. Results arrive as speech:* events.
| Command | Arguments | Returns | Caller | Notes |
|---|---|---|---|---|
speech_models | SpeechModel[] | C | Every model in the catalog and whether it's installed | |
speech_model_download | id | SpeechModel[] | C | Downloads and unpacks the model. Progress comes as speech:download. |
speech_model_cancel | C | Cancels a running download | ||
speech_model_install | path | SpeechModel[] | C | Installs a model from its release archive downloaded on another computer, for computers without internet |
speech_model_remove | id | SpeechModel[] | C | Refused while listening with that model |
speech_devices | InputDevice[] | C | {id, name, isDefault} | |
speech_status | SpeechStatus | C | ||
speech_start | model, device (null: the system default) | SpeechStatus | C | Replaces a session already running. Refused while Autopilot is on: "Autopilot is listening. Turn Autopilot off to use Listen." |
speech_stop | C | |||
speech_open_privacy | C | Opens the microphone privacy settings on macOS and Windows. Elsewhere it fails with "Check the microphone in your system's sound settings". |
SpeechModel is {id, name, description, downloadMb, installed, url}, where url is the release archive, for installing on a computer without internet. SpeechStatus is {session, state, model, device, input, message}. state is "off", "loading", "listening" or "error", session goes up on every start so late events from a stopped session can be ignored, and input names the input actually in use.
Autopilot
Altar Studio's side of Autopilot (autopilot.rs, autopilot_net.rs). Every command that changes something returns the new AutopilotStatus and also sends it as autopilot:status.
| Command | Arguments | Returns | Caller | Notes |
|---|---|---|---|---|
autopilot_status | AutopilotStatus | C | ||
autopilot_set | types: {word, songs}, model, device | AutopilotStatus | C | Each type is "off", "suggest" or "auto". Turning the first type on stops Listen and launches Autopilot on this computer; turning the last one off ends it. model and device are Listen's choices, offered to Autopilot as its starting point. |
autopilot_pause | paused | AutopilotStatus | C | While paused, Autopilot keeps listening but its commands are refused |
autopilot_show | C | Brings Autopilot's window to the front. Fails if Autopilot isn't connected yet. | ||
autopilot_restart | AutopilotStatus | C | Starts Autopilot again after it stopped or couldn't start. In network mode it does nothing: Autopilot reconnects by itself. | |
autopilot_request_done | requestId, previewed, refusal? | C | The control window finished an autopilot:request without sending it Live: it put it in Preview, or couldn't do it (refusal, such as "notFound") | |
autopilot_planned | itemId, scriptures | C | The scriptures planned in the live Word item, passed on to Autopilot | |
autopilot_allow | kind, allowed | AutopilotStatus | C | Lets a kind ("hymns", "songs" or "word") move Live in Auto without a track record, or takes that back |
autopilot_track_reset | kind | AutopilotStatus | C | Starts a kind's track record again: it suggests until it earns Auto anew |
autopilot_network | enabled | AutopilotStatus | C | true: Autopilot runs on another computer and connects here, so Altar Studio listens on the network and stops the Autopilot it launched. false: back to this computer. |
autopilot_pair_start | AutopilotStatus | C | Shows a six-digit pairing code for three minutes. Fails unless network mode is on. | |
autopilot_pair_cancel | AutopilotStatus | C | ||
autopilot_unpair | deviceId | AutopilotStatus | C | Forgets a paired computer, and disconnects it if it's connected |
AutopilotStatus is {phase, types, paused, message, peer, listening, downloadUrl, stats, track, auto, remote, network}:
| Field | Description |
|---|---|
phase | "off", "starting", "waiting" (network mode, no Autopilot connected yet), "connected", "disconnected" (it reconnects by itself), "stopped" (the app ended unexpectedly), "notInstalled" or "error" |
types, paused | As set by autopilot_set and autopilot_pause |
peer | The connected Autopilot: {host, version, local, deviceId} |
listening | Autopilot's own listening: {state, model, input, message, silent, recording, …}. recording shows REC in the Autopilot pill. |
stats | How Autopilot's suggestions went in this service, from the decision log |
track, auto | Each kind's track record, and the kinds that may move Live now (Auto mode and earned) |
remote, network | Network mode is on, and its state: {listening, port, name, addresses, discoverable, pairing, paired, message} |
Errors
| Variant | Message prefix |
|---|---|
Db | "Database error: " |
Io | "File error: " |
Json | "Data error: " |
Zip | "Archive error: " |
Invalid | The message as written, a complete sentence for the operator |
NotFound | "Not found: " |
Tauri | Tauri's message |
To add a command, see Add a backend command.