agent-first-http 0.7.0

Give an AI agent its own isolated browser to actually open a URL — running JavaScript when the page needs it and returning the page as files the agent can read — so it works from the real page instead of a search guess, an empty app shell, or a login wall, all without touching the browser you use every day.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Post-JS DOM serialized to HTML, emitted via CDP
//! `DOM.getOuterHTML` on the document node when a browser was used.

use std::path::PathBuf;

use crate::sdk::fetch::writer;
use crate::shared::artifacts::{Artifact, ArtifactPaths};
use crate::shared::error::Error;

pub async fn write(paths: &ArtifactPaths, html: &str) -> Result<PathBuf, Error> {
    let target = paths.file_for(Artifact::RenderedHtml);
    writer::write_bytes(&target, html.as_bytes()).await?;
    Ok(target)
}