Expand description
UI action record: a short animated GIF of the caller’s own pane, for a task that changes the UI
(docs/specs/SPEC_KANBAN_TASK_MEDIA_2026_10_25.md §6, phase 2). start begins collecting frames; stop
(or the time limit) finishes the file and returns its path, which goes straight into files of
Tasks update/submit.
A frame is what screenshot returns: the host’s capture of the caller’s own pane (or a browser pane it
opened), cut to that pane, with the secret fields and the Vault the host found just before and just
after the capture blacked out here (screenshot_redact). So the target rules and the redaction are the
screenshot’s own, frame by frame: the pane is checked again before every capture, and a pane that has
gone to the user (a hand-off, an approval, a question, paused) ends the recording. A frame the host could
not check for secret fields is left out and counted, never kept. The host captures the whole viewport
and this crops it (a clipped capture in a visible page briefly changes its viewport and flickers the
window, which a recording would do for its whole length); the rest of the viewport is dropped here. Frames are encoded as they arrive, so memory stays at about the size of
the file, and the file is kept under the size one attached image may have.
Structs§
- Finished 🔒
- What a finished recording is.
- GifBuilder 🔒
- A GIF written one frame at a time. A frame’s delay is the time until the next one, so each is held back until its successor arrives (or the end), and then encoded.
- Recording 🔒
- One recording in progress, or ended and not yet collected.
- Shared
Buf 🔒 - A growable buffer the encoder writes into and the builder can measure and take back.
Constants§
- DEFAULT_
FPS 🔒 - FRAME_
TIMEOUT 🔒 - How long a host capture may take before the frame is given up on. A capture takes about 70 ms; a pane in a minimized or hidden window never answers.
- FRAME_
WIDTH 🔒 - Frames are scaled down to this width: a recording is for looking at a change, not for reading text.
- MAX_
BYTES 🔒 - The file stays under the size one attached image may have (task media:
MAX_IMAGE_BYTES; a GIF is an image). - MAX_
FAILED_ 🔒IN_ A_ ROW - How many frames in a row may fail before the recording ends with what it has.
- MAX_FPS 🔒
- The most frames a second (the spec’s limit), and what a call gets without asking.
- MAX_
SECONDS 🔒 - The longest recording, in seconds (the spec’s limit).
- MIN_
DELAY_ 🔒MS - The shortest a frame stays on screen: GIF counts in hundredths of a second and viewers treat less as slow.
- RETENTION 🔒
- Recordings in the temp folder older than this are removed when a new one is written.
Statics§
- RECORDINGS 🔒
- One recording a caller at a time.
Functions§
- capture_
frame 🔒 - One frame: the host’s capture of
block_idas JPEG, blacked out where it has secret fields. - crop_to 🔒
crop(x, y, width, height in CSS pixels) of a whole-viewportimgwhose page isviewport_widthCSS pixels wide.- dir 🔒
- frame_
from 🔒 - A host capture as a frame: decoded, scaled to
FRAME_WIDTHif wider, and opaque (GIF has no partial alpha). - frame_
of_ 🔒response - The host’s answer to one capture as a frame, with what the host found to hide blacked out first, exactly as
screenshotdoes. A capture the host could not check for secret fields is an error, so the frame is left out. - handle_
ui_ 🔒record POST /api/v1/ui/record— backsUIactionrecord.opstartbegins a recording of the caller’s own pane (or a browser pane it opened,pane);opstopends it and returns the file.- limits 🔒
fpsas asked for, held to the limits;secondslikewise.- prune_
old 🔒 - response 🔒
- response_
with 🔒 - As
response; withinlinethe file’s bytes go in the answer too, for a caller that cannot read this machine’s folders (a container agent). A file that cannot be read back is left out, and the answer still names it. - run 🔒
- The capture loop: a frame every
1/fpssecond until stopped, out of time, out of room, or failing. - scale_
frame 🔒 imgscaled toFRAME_WIDTHif wider, and opaque.