screenshot
Save-state frame capture over the pixelflux computer-use endpoint.
Save-state frame capture over the pixelflux computer-use endpoint.
Selkies serves the Anthropic Computer Use HTTP spec on a loopback port when
PIXELFLUX_CU names one, and its screenshot action answers with the whole
framebuffer as a base64 PNG. The broker shares the container, so the port is
fixed rather than configured. The frame is scaled down here to the thumbnail
RomM files beside a state.
attributelog= logging.getLogger(__name__)attributeCU_URL= 'http://127.0.0.1:5000/computer-use'The computer-use endpoint selkies binds inside the container.
attributeCU_TIMEOUT= 5.0Seconds a screenshot request gets; on Wayland it forces a one-frame GPU readback.
funccapture_frame() -> Optional[bytes]Grab the streamed desktop as it is right now, scaled for a state thumbnail.
Never raises: the frame is taken on the way into a save, and a missing preview must not read as a failed save.
Returns
typing.OptionalPNG bytes bounded to STATE_SCREENSHOT_SIZE on the longest side, or
func_thumbnail(raw) -> Optional[bytes]Scale a captured frame to the thumbnail size and re-encode it as PNG.
paramrawbytesThe full-size frame as the endpoint returned it.
Returns
typing.OptionalPNG bytes bounded to STATE_SCREENSHOT_SIZE on the longest side, or