agent_first_http/sdk/fetch/artifacts/screenshot.rs
1//! Full-page PNG via CDP `Page.captureScreenshot { format: png, captureBeyondViewport: true }`.
2
3use std::path::PathBuf;
4
5use crate::sdk::fetch::writer;
6use crate::shared::artifacts::{Artifact, ArtifactPaths};
7use crate::shared::error::Error;
8
9pub async fn write(paths: &ArtifactPaths, png: &[u8]) -> Result<PathBuf, Error> {
10 let target = paths.file_for(Artifact::Screenshot);
11 writer::write_bytes(&target, png).await?;
12 Ok(target)
13}