A User composition is a Film (ADR-0068 §3, film-format.md). GUI authors and agents read and write the same standalone gfx-film@1 document through the local user store. The store API is the supported interchange boundary; the files in the store are internal { meta, film } records and are not standalone documents (film-format.md).
The local server is always http://localhost:7263. All examples below operate on the same User compositions listed on the GFX home screen.
This whole surface is development-only. PUBLIC_GFX_COMPOSITION_STORE picks which store a build serves: origin is the disk-backed store documented here, and browser is the Public demo session, which keeps every composition in the visitor's own browser and never sends one to the origin (ADR-0053). A build configured for browser answers 404 to every request below, so none of these commands is a way to read or write a visitor's work on the public origin. In the browser-scoped store the same compositions are reached through the GUI and through the WebMCP session and composition families, which act on exactly the store the GUI does.
A Film holds one or more Scenes, played in order with a hard cut between them. Each Scene is an owned copy of the Preset it was seeded from, and its origin records that Preset's slug. Nothing links back: editing a corpus Preset never changes a Film.
- Open a Starter, try things, then choose Add to Film.
/p/<corpus-slug>always shows the corpus Preset, and its page never saves. Edits change only the open document, with full undo and redo, and leaving the page discards them. Add to Film in the top bar opens a menu. Its first entry, New Film, stores the open document, edits included, as a new Film under a new slug and replaces the URL with/p/<new-slug>. The slug comes from the document's name and is numbered past every stored slug and every corpus slug:lower-thirdbecomeslower-third-2, thenlower-third-3. - Add to Film, then a Film. Below New Film the menu lists your stored Films, each with its poster and Scene count. Choosing one adds the open document, edits included, as that Film's last Scene, saves the Film, and opens it on the new Scene at
/p/<film-slug>. The Scene takes the Film's Pack, orientation, rate, and format, and keeps its own duration. - New composition on the home screen stores a Film seeded from the
blankPreset, named Untitled, asuntitled,untitled-2, and so on. - Import JSON on the home screen stores a new Film from a standalone document (see GUI interchange).
- Agents use
gfx_composition_create_film_from_open(the open Starter with its edits),gfx_composition_create_from_starter(a pristine Starter by slug),gfx_composition_create_blank, andgfx_composition_import_json. Each receipt reports the new slug.gfx_composition_create_film_from_openis registered only while the open document is an unsaved corpus Preset.gfx_composition_add_open_to_filmadds that open document to a stored Film by slug; it is registered only while an unsaved corpus Preset is open and the session holds a Film.
Nothing is ever stored under a corpus Preset's slug. Both stores refuse a create or a save there (the disk store answers 409). There is no fork of a Starter and no revert to one. To discard a Film, delete it from the home screen.
A stored Film autosaves every edit to its own slug.
A stored Film shows a Scene strip above the Timeline: one segment per Scene, in order, each as wide as its share of the Film. An unsaved Film of more than one Scene shows it too, without +: a built-in transition fixture opens as two Scenes, and what is changed there stays in memory. An unsaved one-Scene Starter has no strip.
- Open a Scene: click its segment. The Timeline below shows that Scene on its own clock; the transport above shows the time and frame of the whole Film.
- Add a Scene: the
+at the end of the strip opens the Starters as poster cards with a search field. Choosing one adds it as the last Scene. - Reorder: drag a segment along the strip.
- Remove: the
×on the open Scene's segment, or Delete or Backspace with that segment focused. A Film keeps at least one Scene.
Adding, removing, and reordering are each one undo step. Opening a Scene is not an edit.
Agents use gfx_composition_add_scene_from_starter, gfx_composition_remove_scene, gfx_composition_reorder_scene, and gfx_composition_select_scene. gfx_composition_inspect lists the Scene ids, and each boundary with its kind, duration, and params. Every other family's tools act on the Scene that is open.
Between two neighbouring segments of the strip is their junction, the Scene boundary (film-format.md). A new Scene arrives with a cut.
- What it shows. A cut is the line between two segments. A fade or a transition effect is a band over the frames the two Scenes share.
- Select it: click the junction, or reach it with the arrow keys from a segment and press Enter. Its fields open in the inspector: Kind (Cut, Fade, or a transition effect), Duration in milliseconds, and the effect's own parameters.
- Change it: pick another kind, type a duration, or move a parameter. Each change is one undo step. A cut made a fade or an effect starts at 1000 ms. A duration the two Scenes have no room for is refused, and the reason shows where a save error does.
- Look at it: a click inside the band parks the playhead on that Film frame. Paused inside a boundary, the canvas shows both Scenes composited exactly as an export does, and it does so again after the boundary is changed. While the Film plays, a boundary is a cut at its midpoint; pause to see the real frame. After an edit to a Scene, the canvas shows that Scene alone until the playhead next arrives.
- Hear it: in an export, the outgoing Scene's sound fades out across the boundary and the incoming Scene's fades in.
- Carry an Overlay across it (magic move): when both Scenes hold an Overlay with the same id and the same Overlay type, a fade or an effect lists a switch named for that Overlay. Switched on, the Overlay travels from its place in the outgoing Scene to its place in the incoming Scene while the rest of the frame fades or runs the effect. Pause inside the boundary to see it; playback does not show it. A cut lists no switch. An Overlay drawn by its own shader pass, and any Overlay of a Scene with a depth stage, cannot be carried and is not listed.
Agents use gfx_motion_set_scene_boundary, in the motion family, with the id of the Scene the boundary follows: { outgoingSceneId, kind, durationMs?, params? }. durationMs left out keeps the boundary's duration; a param left out keeps its value, or takes the effect's default when the kind changes. The tool is offered while the Film has more than one Scene.
For a magic move agents use two more motion tools, offered while a boundary of the Film is a fade or an effect. gfx_motion_inspect_boundary_magic_move takes { outgoingSceneId } and returns the pairs the boundary carries, its ease, and suggestedPairs. gfx_motion_set_boundary_magic_move takes { outgoingSceneId, pairs, ease? }, where pairs is the whole list, each { from: { kind: "overlay", id }, to: { kind: "overlay", id } }; an empty list removes the magic move. An agent may pair two Overlays whose ids differ, as long as they are the same Overlay type; the GUI offers only the suggested pairs.
Older records. A record an older build saved as a standalone Preset ({ meta, preset }) still opens: it is read as a one-Scene Film whose origin is the Starter the record was forked from. Reading never rewrites it. The first save writes it as a Film. A record whose Preset states the legacy two-endpoint transition is read as a two-Scene Film of the two corpus Presets it names, with the transition as the boundary between them, and is saved as that Film (ADR-0068 §3; film-format.md).
A Film with several Scenes opens on its first Scene. The listing shows it by that Scene: its poster, Surface type, and media.
The retired fork-on-edit model saved an edited Starter under the Starter's own slug. Such a record can no longer be opened, because /p/<corpus-slug> shows the Starter. A one-time script re-keys them in a disk store:
# Print the plan as JSON. Changes nothing.
npx tsx scripts/migrate-user-composition-shadow-records.ts "<store-directory>" --dry-run
# Apply it.
npx tsx scripts/migrate-user-composition-shadow-records.ts "<store-directory>"The store directory is always given explicitly; the primary one is ~/Library/Application Support/GFX/compositions. The script takes no backup. Back the store up first.
For every record whose slug equals a corpus Preset slug, the script:
- picks the first free slug of the form
<slug>-2,<slug>-3, …, free against every corpus slug and every stored slug; - writes the record there as
{ meta, film }, with the Scene'sorigin.slugset to the corpus slug it shadowed andmeta(includingforkedFromandsavedAt) unchanged; a record that states a legacytransitionis written as the two-Scene Film it reads as, each Scene naming its own endpoint; - moves the old file into the store's trash directory, beside the store. Nothing is deleted.
It prints each move, and each record it skipped with the reason: a record this engine cannot read is left exactly where it is. A second run finds nothing to do. It refuses a directory that holds no stored record or holds other JSON. No sidecar needs moving: the slug index is rebuilt from the directory by a running server, and posters are keyed by content, not by slug. Restart the server afterwards so its index is fresh.
The browser-scoped store of a Public demo session is not migrated: a record a visitor's browser holds under a corpus slug stays listed on the home screen and can be deleted there, but its card opens the corpus Preset and the store will not save over it.
List User composition metadata:
curl -fsS http://localhost:7263/api/user-compositionsExport one standalone Film:
curl -fsS http://localhost:7263/api/user-compositions/my-composition > my-composition.jsonCreate or replace a User composition with a standalone document:
curl -fsS \
-X PUT \
-H 'Content-Type: application/json' \
--data-binary @my-composition.json \
http://localhost:7263/api/user-compositions/my-compositionDelete one User composition:
curl -fsS -X DELETE http://localhost:7263/api/user-compositions/my-compositionGET /api/user-compositions/<slug> returns the exact standalone gfx-film@1 document accepted by PUT: annotation bodies and chat messages are strings, not the engine's transformed runtime structures. This symmetry is the agent edit loop: GET, edit JSON, PUT, reopen in the GUI. Invalid JSON, schema fields, Packs, Pipeline variants, Effect parameters, assets, or cross-references are rejected before persistence with a path-qualified response message.
PUT also accepts a standalone gfx@1 Preset and stores it as a one-Scene Film, so a Preset file still imports. POST /api/user-compositions takes { "slug": "...", "film": {…} } (or "preset") to create one. A slug that is a corpus Preset's is refused with 409. GET always returns a Film; a stored legacy transition record is returned as the two-Scene Film it reads as.
A slug the store holds nothing for is null, not an error. A stored composition this engine will not accept — because a schema field or an authoring rule tightened after it was saved — is 409 with every finding named; the store read fine, so this reports the author's work going stale rather than a failure of this origin, and it stays a log line instead of a Sentry issue (sentry-dev-flow.md: 4xx = log, 5xx = issue). Only a file that is not a store document at all is a 500.
Media asset bytes live separately from Preset JSON in the installation-wide local content-addressed asset store. Ingest an MP4, MOV, or WebM before adding a composition-scoped Media library entry that references the returned url:
curl -fsS \
-X POST \
-H 'Content-Type: video/mp4' \
--data-binary @episode.mp4 \
http://localhost:7263/api/user-assets \
> episode-asset.jsonThe response includes the immutable URL plus a volatile probe of duration, display dimensions, rotation, average frame rate, video/audio codecs, and audio layout:
{
"url": "/api/user-assets/<sha256>.mp4",
"mime": "video/mp4",
"sizeBytes": 123456,
"durationSeconds": 18.4,
"displayWidth": 1920,
"displayHeight": 1080,
"rotation": 0,
"averageFrameRate": 59.94,
"videoCodec": "h264",
"hasAudio": true,
"audioCodec": "aac",
"audioChannels": 2,
"audioSampleRate": 48000
}Re-uploading identical bytes returns the same URL. Large uploads stream to disk while hashing and probing; stored media supports HTTP byte ranges so the browser decoder can seek without loading the whole asset into memory. The API is the asset-ingest automation command: it accepts bytes directly and returns the complete descriptor, so the CLI does not add a second ingest path. Probe fields are observations, not composition truth: do not copy duration, dimensions, rotation, rate, codec, audio layout, byte size, readiness, or errors into the Preset.
Write that returned url into a Media library entry and reference it from a Video clip. The Preset remains the complete render contract; do not pass media, rate, duration, or format as render overrides:
Import it into the same User composition store the GUI opens, then render that slug through the Workspace seam:
curl -fsS \
-X PUT \
-H 'Content-Type: application/json' \
--data-binary @episode-title.json \
http://localhost:7263/api/user-compositions/episode-title
npm run gfx -- render --preset episode-title --out ./out/episode-title.movGET, PUT, GUI JSON import/export, New Film, and CLI file-Preset import all preserve each Scene's state.media. IDs, names, URLs, clip placement, Source time, and clip audio are stable composition data. Readiness and probe details are computed from bytes when listing/opening and are not written into state.media. GET remains available when previously stored referenced bytes go missing so the composition can be repaired; writes and export reject a referenced missing or undecodable Media asset. An unused Media library entry may remain in the composition, including while unavailable, because it does not participate in rendering.
Standalone JSON does not embed or copy video bytes. It is standalone composition data, not a media bundle or Project artifact. Moving a composition to another local GFX workspace therefore requires ingesting each Media asset there and updating the corresponding library entry's assetUrl to the content address returned by that workspace. Multiple compositions or entries may reference one deduplicated URL; removing membership never deletes those shared bytes.
A website-screenshot Surface takes exactly one capture source. The GUI's capture (the Surface inspector's capture action, or POST /api/website-capture) stores the PNG in the same content-addressed asset store and writes its /api/user-assets/<sha256>.png URL into content.imageUrl; that is the User composition path and it stays workspace-local like every other asset. A corpus deliverable must render from a clean checkout, so it references a bundled capture instead: content.captureAsset names an entry of the registry in src/lib/platform/capture-assets.ts, whose PNG lives in src/lib/assets/captures/ and is authored once with scripts/capture-website.ts <url> --out src/lib/assets/captures/<slug>.png --scale 2 --width 2560 --height 2000. The two are mutually exclusive; validation rejects a Surface that sets both or neither, and an unregistered captureAsset name.
The home screen's Import JSON action accepts a standalone gfx-film@1 Film, or a gfx@1 Preset (including a Legacy Supers one), which is lifted to a one-Scene Film. It stores a new Film under a slug derived from the document's name, numbered past every stored and corpus slug, and never replaces an existing composition. Schema and semantic errors block persistence and are listed under the action; static-linter warnings and errors do not, because a valid agent-authored document must be able to enter the GUI for repair. Its linter findings appear live in the composition inspector after import.
The composition inspector's Export JSON action downloads the current standalone Film as <slug>.json. Verify runs the structural schema, registry-derived semantic validation, deliverable static linter, and current rendered visual audit in one action. Static issues remain live in the inspector while editing; the rendered audit is refreshed only by Verify.
The existing right rail has two modes: Inspector and Media. Media mode lists composition-scoped Media library entries, uploads local MP4/MOV/WebM bytes transactionally, shows volatile probe/readiness details, and supplies drag payloads for clip creation. Upload and probe complete before membership changes; failures preserve the last confirmed composition. Removing an entry is allowed only when no Video clip references it, and never deletes shared bytes. This is a mode of the existing rail, not a left panel or permanent fourth workspace zone.
A Type Field starts on a plain Surface through the Timeline Add menu's Kinetic Word entry. Adding the first word creates the valid field and its first phrase in one undoable operation. Each word appears as a full-composition Block row with channel diamonds. Select its row or canvas text to edit the one-token content, display/support hierarchy, ink/accent role, position, start/centre/end horizontal anchor, scale, and rotation. Placement edits go to the shared placement unless the Placement section's Customize horizontal / vertical is on for the active orientation. At frame zero, canvas drag and Arrow-key nudge edit that resting placement. At a nonzero playhead they upsert the active orientation's X/Y keys in one undo entry instead of silently moving rest geometry; horizontal and vertical may carry complete geometry and spatial-track replacements without creating another Preset.
The Kinetic Word inspector also edits phrase membership, semantic reading order, focal word, phrase order, and phrase add/remove. Those semantics do not move or duplicate pixels. Shared Motion authors opacity, the masked reveal offset, spatial deltas/values, normalized weight, and em tracking; the Glyph Stagger section sets the per-glyph delay and order that reveal plays with. The active orientation's Reflow Motion section authors a complete X/Y/scale/rotation replacement group; opacity and weight always remain shared. Each channel holds at most 24 ordered keys and uses the same four constrained eases. A focal word must belong to its phrase and use display hierarchy. Removing a word is refused while any phrase or Cascade anchor still references it; clear those references explicitly first. Removing the final word removes the parent Type Field atomically, and changing away from plain is refused while a field exists.
Agents prepare the owning family and use gfx_layer_add_kinetic_word / gfx_layer_remove_kinetic_word, gfx_content_set_kinetic_word_text / gfx_content_set_kinetic_phrases, gfx_placement_set_kinetic_word_placement, and gfx_appearance_set_kinetic_word_appearance. The motion family exposes the same generalized set/clear-channel operation for Kinetic Word Block ids gfx_motion_set_kinetic_word_position_keyframe for atomic X/Y playhead edits, and gfx_motion_set_kinetic_word_glyph_stagger for the per-glyph reveal delay. They take the observed Composition revision and return the same receipt, focus movement, validation, and shared undo entry as the GUI path. No tool clicks the Timeline or patches the Preset directly.
Beats are named moments the kinetic type is timed to. Add one at the playhead with + Beat in the Composition inspector's Beats section, where each beat also has its time in milliseconds, a sound (None by default), and ×. Each beat shows as a flag in the Timeline ruler: drag it to move the beat and every key bound to it, or click it to jump there. Keyframes and the playhead snap to a beat when dragged close to it, and a Kinetic Word key dropped on a beat binds to it.
In a Kinetic Word's inspector, each phrase's Beat sets the moment that phrase must be readable, and On Beat copies a ready-made move onto the word at the chosen beat: arrive (rises into its mask and lands with a weight hit), leave (exits up through its mask), or strike (a weight pulse). The keys are ordinary keys bound to the beat and stay editable. Removing a beat a phrase reads at is refused until the phrase is set to another beat; bound keys stay at their times. Agents use gfx_motion_add_motion_beat, gfx_motion_set_motion_beat, gfx_motion_remove_motion_beat, and gfx_motion_land_kinetic_word_on_beat.
Kinetic Word rows sit under one Type Field header on the Timeline; click it to collapse the words into one row of keyframe ticks, and selecting a word opens the group again. Shift-click several words on the canvas to align or distribute them with the alignment toolbar, in the orientation on screen.
Every value that can differ between the wide and tall frames uses one control: Customize horizontal or Customize vertical, for the orientation on screen, in the header of the section that holds the values. That covers Overlay position, Diagram geometry, Kinetic Word placement, the captions band, the chart frame, the checklist card, optical Effect regions (in the Effect row), the filmed page anchor (beside its fields), and the Stage camera (tall frame only). Turning it on copies what that orientation shows now into its own complete copy; edits then change only that orientation. Turning it off deletes the copy, and the orientation shows the shared values again. Each change is one undo step.
An Overlay's inspector, and the inspector of a node, label, or stat-callout Diagram primitive, carries two keyframe sections: Keyframes for the shared channels, and the active orientation's Reflow Motion for a complete x/y/scale/rotation group that replaces the shared path in that orientation only (ADR-0039 §4). The first key in Reflow Motion creates the group, seeded from the shared path and the orientation's own placement; opacity stays shared. The Timeline shows the active orientation's diamonds. Deleting the last key of any track in the group, or clearing one of its channels, removes the whole group and returns that orientation to the shared path. Agents pass scope: 'horizontal' | 'vertical' to gfx_motion_set_keyframe_channel and gfx_motion_clear_keyframe_channel, exactly as for a Kinetic Word. The fixture diagram-orientation-motion-fixture shows a diagram that slides along a row in the wide frame and rises into a column in the tall one.
The checklist card sits on the right half of the wide frame and the bottom half of the tall one until you place it. Drag the card by its padding or title row to move it, or drag its right-edge handle to change its width; the Surface inspector's Card section has Custom for a shared placement, Customize horizontal / vertical for the orientation on screen, and X, Centre Y, and Width once a placement exists. The card enters from the side of the frame it sits on. Agents call gfx_placement_set_checklist_card. The fixture checklist-card-orientation-fixture puts the card on the left of the wide frame and in the upper band of the tall one.
A Chart Block fills the title-safe area until it has a frame. Select the chart on the canvas to drag its frame or resize it from the bottom-right corner, or open the Chart inspector's Frame section: Custom starts a shared frame from the area the chart fills now, and Customize horizontal / vertical gives the active orientation its own complete frame. Edits go to the active orientation's frame when it has one and to the shared frame otherwise. Type sizes do not change with the frame. Agents call gfx_placement_set_chart_frame with target: 'shared' | 'horizontal' | 'vertical' and a rect, or null to remove it. The fixture chart-frame-orientation-fixture sits the chart on the right of the wide frame and in the upper part of the tall one.
Every numeric param in an Effect's inspector rows is a keyframe row (ADR-0063), the same row the Surface, Overlays, and Blocks use: the value at the playhead, then ◀ ◆ ▶, and the ease into the keyframe the playhead sits on. Without a track, typing a value edits the static param. The ◆ starts a track at the playhead from the current value, and from then on a typed value edits the keyframe at the playhead. Seeds and simulation inputs are frozen and show no ◆. An Effect with a channel or a Cascade weld gets its own Timeline row, labelled with the Effect's name. Its diamonds retime and delete like an Overlay's. An unwelded bar does not drag, because an Effect track counts from composition start; a welded bar drags its Cascade offset. Every row edit and drag is one undoable step.
Agents use the same motion operations with subject: { kind: 'effect', effectId }: gfx_motion_set_keyframe_channel, gfx_motion_clear_keyframe_channel, gfx_motion_set_cascade_anchor, and gfx_motion_clear_cascade_anchor. gfx_capability_inspect_vocabulary with section: 'effect-type' and an effectType lists that Effect's channels with their bounds and integer flag. gfx_appearance_set_effect_params refuses to change a param that carries keyframes and names the motion operations instead.
The one primary Video track lives beneath all five Layers in the Timeline. Drag a Media library entry there to create a Video clip. Clip body drag moves it; left trim changes Timeline start, duration, and Source start by the same frame delta; right trim changes duration; Alt/Option-drag inside slips Source time without moving the clip. Every commit lands on an integer output frame and clamps to composition bounds, neighboring half-open clips, and source coverage. The Timeline is the only surface for temporal creation, move, trim, slip, snapping, and Source-range feedback. Selecting a clip exposes only audio enabled/gain and removal in the Inspector; no duplicate numeric timing fields live in the rail. Video is not a sixth Layer and never appears in Add layer.
gfx render and gfx batch drive the Workspace's existing CompositionExportController, so command-line rendering uses the same frame request seam, exact rational frame stepping, native target size, audio mix, and encoder as GUI export. An export is the whole Film: every Scene in order, with one sound track, in one file (film-format.md).
The command never starts a server or browser. Before running it, the existing dev server must answer at port 7263, and the sanctioned CanvasDrawElement browser must answer at CDP port 9223 (scripts/launch-cdp-chrome.sh starts or confirms that browser).
Render a corpus or User composition slug:
npm run gfx -- render --preset lower-third --out ./out/lower-third.webmRender a standalone Preset file. The command imports it under a temporary User composition slug, renders it, then removes the temporary store entry:
npm run gfx -- render --preset ./inputs/title.json --out ./out/title.movThe Preset owns format, duration, rate, and orientation. --out only selects the destination path.
The output extension must agree with state.transport.format: webm requires .webm; prores requires .mov. The CLI validates this before invoking Workspace export. A standalone file Preset is removed from the User composition store after success, format rejection, browser decode failure, or render failure.
Batch jobs run serially through one reused browser page. Relative paths resolve from the manifest's directory:
[
{ "preset": "./inputs/title.json", "out": "./out/title.mov" },
{ "preset": "lower-third", "out": "./out/lower-third.webm" }
]npm run gfx -- batch ./render-manifest.jsonThe batch continues after a failed job and exits non-zero with every failed input listed. WebM output can vary at the encoder byte level; deterministic verification belongs at rendered frame timestamps or in the ProRes lane.
Jobs may reference different Media assets, multiple Video clips, repeated assets, and gaps. Batch still runs serially through one reused Workspace page; every referenced clip asset in each Preset's state.media is confirmed before export.
GUI and CLI exports use the same local export-session protocol. The browser uploads the optional final WAV in ordered parts, then one indexed PNG at a time; each request waits for ffmpeg stdin backpressure before the next frame is rendered. Only a successfully closed disk output becomes downloadable. Abort, encoder/request failure, explicit cancellation, inactivity expiry, download cancellation/completion, and dev-server startup orphan cleanup kill live ffmpeg where applicable and remove the private session directory. The browser never retains an all-frame array or downloads the complete output through response.blob().
{ "schema": "gfx@1", "name": "Episode title", "pack": "syntax", "kind": "deliverable", "state": { "transport": { "orientation": "horizontal", "durationSeconds": 8, "fps": 59.94, "format": "prores" }, "media": { "assets": [ { "id": "episode-camera", "kind": "video", "name": "Episode camera", "assetUrl": "/api/user-assets/<sha256>.mp4" } ], "videoTrack": { "clips": [ { "id": "opening", "assetId": "episode-camera", "timelineStartFrame": 0, "durationFrames": 480, "sourceStartSeconds": 4.25, "audio": { "enabled": true, "gain": 1 } } ] } } // typography, marks, Surface, Blocks, Annotations, Overlays, and Effects } }