Workspace folder (.lightair)
The files inside a .lightair workspace folder, the journal that saves every change, the format version, and the copies Lightair makes to move a show.
In short
- A workspace is a folder ending in
.lightair, holding plain JSON files, one per scene, and a journal of changes. workspace.jsonis the manifest: it carriesformatVersion(2 today), the canvases, the scene order and the scene on air.- Every change is appended to
journal/current.logand folded into the JSON files about once a minute. There is no Save button. - Stream keys and passwords are never in these files; they stay in the system's credential store.
In the appFile › New Workspace…File › Open Workspace…File › Export Workspace with Packages…
A workspace is one show: its canvases, sources, scenes, audio, outputs and the packages it uses. On
disk it’s a folder whose name ends in .lightair. New workspaces go in the Workspaces folder:
| Platform | Folder |
|---|---|
| macOS | ~/Library/Application Support/Lightair/Workspaces/ |
| Windows | %APPDATA%\Lightair\Workspaces\ |
File › Open Workspace… opens a .lightair folder from anywhere.
The files
Section titled “The files”My Show.lightair/├─ workspace.json the manifest: format version, id, name, canvases, scene order├─ sources.json every source: cameras, captures, images, browsers, widgets…├─ audio.json the mixer's tracks and their effects├─ mixer.json buses, mixes and the master├─ outputs.json recording and streaming settings (no secrets)├─ scenes/<id>.json one file per scene├─ journal/current.log changes since the files were last written├─ assets/ prefabs, images, video and sound kept with the show├─ packages.json the packages the show needs├─ packages-lock.json the exact version and checksum of each├─ edits/<id>.json projects made in the Editor├─ checkouts.json takes being edited on a paired phone or tablet└─ recordings/ ├─ index.json the Library's list of recordings, takes, clips and exports └─ thumbnails/ a still for eachEvery file is JSON. A workspace needs workspace.json, sources.json and a scene file for each
id the manifest lists; Lightair reads a missing audio.json, mixer.json or outputs.json as
the defaults.
The other files and folders appear once the show needs them.
Every entity (the workspace, canvases, sources, scenes, objects, tracks) has a UUIDv7 id. Files
refer to each other by id, never by name, so renaming anything breaks nothing.
workspace.json
Section titled “workspace.json”The manifest. It’s written last when Lightair saves, so the scene files it lists are always complete.
{ "formatVersion": 2, "id": "0193a2c4-5e1f-7b3a-9c2d-4f8e6a1b2c3d", "name": "My Show", "canvases": [ { "id": "0193a2c4-5e1f-7b3a-9c2d-000000000001", "name": "Landscape", "width": 1920, "height": 1080, "fps_num": 60, "fps_den": 1 } ], "program": "0193a2c4-5e1f-7b3a-9c2d-000000000010", "scenes": ["0193a2c4-5e1f-7b3a-9c2d-000000000010"], "transition": { "kind": "Move", "duration_ms": 500, "direction": "left" }, "stinger": null}| Field | Meaning |
|---|---|
formatVersion |
The format the files are in. See Format version. |
id, name |
The workspace’s id and name. |
canvases |
The output canvases, the first being the primary one: id, name, width, height and the frame rate as fps_num / fps_den. |
program |
The id of the scene on air. |
scenes |
Scene ids in the order the app lists them. Each scene’s contents are in scenes/<id>.json. |
transition |
How scene switches look: kind, duration_ms and direction. |
stinger |
The stinger video the Stinger transition plays, or null. |
show |
Present when used: overlays drawn over every scene, the soundboard’s pads, the rundown, PTZ cameras and the scene the Scene transition plays. |
journal |
Present after a save that included rotated journals (see below). |
sources.json
Section titled “sources.json”An array of sources. Each has an id, a name, a kind, its settings as a JSON object in that
kind’s own shape, and effects, the effects applied wherever the source appears. Scenes place
sources; the same source can appear in several scenes.
scenes/<id>.json
Section titled “scenes/<id>.json”One file per scene, named by its id. A scene has an id, a name and objects, bottom first.
Each object points at a source by id and has a layout for each canvas it appears in (a canvas
with no layout hides it there). A scene can also carry its own transitions and stinger. One file
per scene keeps changes easy to read in a diff, so a workspace works well in git.
When a scene is deleted, its file is removed at the next save.
packages.json and packages-lock.json
Section titled “packages.json and packages-lock.json”Written when the show uses something from a package:
packages.jsonlists what the show needs:{"format": 1, "packages": {"<id>": "<version range>"}}. Ranges use Cargo’s operators (^1.2,~1.2,=1.2.0,>=1.0, <2,*).packages-lock.jsonpins what it resolved to: for each package (and each dependency) itsversion,sha256content checksum,source(where it was installed from) andsize.
When the workspace opens on another computer, Lightair uses these to say which packages are missing and where they came from.
How saving works
Section titled “How saving works”There’s no Save button. Each change is a command, and every committed command is appended as one
line of JSON to journal/current.log.
- About once a second, what’s been appended is made durable on disk.
- About once a minute, after 200 changes, and when you quit, Lightair compacts: it writes the JSON files again and empties the journal. Each file is written to a temporary file and renamed into place, so a crash never leaves half a file.
- To compact without blocking new changes, the journal is first renamed to
journal/<n>.logand a newcurrent.logstarts. The manifest’sjournalfield then records that the snapshot includes the journals up to<n>, and those are deleted.
When a workspace opens, Lightair reads the JSON files, then replays any journal the snapshot doesn’t include, in order. That’s how a crash is recovered: nothing committed is lost and nothing is applied twice. A last line cut short by the crash is ignored.
Format version
Section titled “Format version”formatVersion in workspace.json is the format the files are written in. This version of
Lightair writes and reads up to 2.
- An older workspace is upgraded when it opens, one version at a time, and saved in the current format.
- A workspace from a newer Lightair is refused with the message “this workspace was saved by a newer Lightair (format n, this version reads up to 2)”. Nothing in it is changed.
Secrets
Section titled “Secrets”Stream keys, tokens and passwords are never written to a workspace. They live in the system’s credential store (Keychain on macOS, Credential Manager on Windows), keyed by the destination’s id. A workspace folder can be copied, shared or put in git without exposing them; on another computer you enter them again.
Copies of a workspace
Section titled “Copies of a workspace”With its packages
Section titled “With its packages”File › Export Workspace with Packages… copies the open workspace’s folder to a new
.lightair folder (on the Desktop unless you choose otherwise) and adds a Packages/ folder
holding an .airpkg file, <id>-<version>.airpkg, for each package in its lock file. Opened on
another computer, the copy offers to install the packages from there, whatever has happened to
their authors’ releases since.
Portable copy
Section titled “Portable copy”When a paired phone or tablet asks for a workspace, Lightair sends a portable copy, made fresh each time:
- the workspace as it is now, its journal replayed into the files (the copy has no
journal/); - every file a setting points at outside the workspace, collected into
assets/, the setting rewritten toassets/<file>(a second file with the same name becomeslogo 2.png); - no secrets: any setting whose name contains
password,passwd,passphrase,secret,token,stream_key,streamkey,api_key,apikeyorauth, or is exactlykey, is removed, and so is any such parameter in a web address’s query string.
Recordings, Editor projects and other files in the folder aren’t part of a portable copy.