A3: ui.screenshot answers with the absolute path and checks the file

A relative path is resolved against the app's working directory before
the capture, and the answer names that absolute path, so a file written
elsewhere than expected is visible. After writing, the file is read back
and a missing or short file is an error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-31 14:58:36 +01:00
parent af24899ac5
commit 3c80ab87c9
4 changed files with 36 additions and 10 deletions

View file

@ -12,6 +12,8 @@ pub const ENGINE_EXECUTE: &str = "engine.execute";
/// `engine.listCommands`: lists the engine's commands.
pub const ENGINE_LIST_COMMANDS: &str = "engine.listCommands";
/// `ui.screenshot`: writes a PNG of the main window without focusing it.
/// A relative `path` is resolved against the app's working directory; the
/// result names the absolute path written.
pub const UI_SCREENSHOT: &str = "ui.screenshot";
/// `events.subscribe`: streams engine events on this connection.
pub const EVENTS_SUBSCRIBE: &str = "events.subscribe";