rho-coding-agent 3.13.0

A fast Rust agent harness with a small footprint and opinionated defaults
Documentation
//! The browser rho's daemon runs for browser tools: the `[browser]` config,
//! the service that shares one browser among the daemon's sessions, and,
//! with the `browser` feature, how rho starts it and `rho browser install`.
//! Without the feature, [`Browsers::for_daemon`] makes no service, so no
//! session gets browser tools.

#[cfg(not(feature = "browser"))]
mod absent;
pub(crate) mod config;
#[cfg(feature = "browser")]
pub(crate) mod connect;
#[cfg(feature = "browser")]
pub(crate) mod drive;
#[cfg(feature = "browser")]
pub(crate) mod navigation;
#[cfg(feature = "browser")]
mod service;
#[cfg(feature = "browser")]
pub(crate) mod start;
pub(crate) mod view;
#[cfg(feature = "browser")]
mod watch;

#[cfg(not(feature = "browser"))]
pub(crate) use absent::{Browsers, SessionBrowser};

/// Reads `[browser]` as the daemon's config is now.
pub(crate) type ReadConfig =
    Box<dyn Fn() -> futures_util::future::BoxFuture<'static, config::BrowserConfig> + Send + Sync>;
#[cfg(feature = "browser")]
pub(crate) use service::{Browsers, SessionBrowser, WatchRefused};

/// Every tab's size: 1280 by 800 CSS pixels, a common laptop viewport. A
/// screenshot of it costs ⌈1280/28⌉ × ⌈800/28⌉ = 1,334 image tokens, and
/// fits the 1,568-pixel edge Claude takes without downscaling. A client
/// watching a tab gets frames of all of it.
#[cfg(feature = "browser")]
pub(crate) const VIEWPORT: rho_browser::tab::Viewport = rho_browser::tab::Viewport {
    width: 1280,
    height: 800,
};

/// `viewport` as the protocol carries it.
#[cfg(feature = "browser")]
pub(crate) fn wire_viewport(viewport: rho_browser::tab::Viewport) -> rho_protocol::BrowserViewport {
    rho_protocol::BrowserViewport::new(viewport.width, viewport.height)
}