Skip to main content

heartbit_core/browser/
mod.rs

1//! SOTA browser-bot harness: drive a real Chrome via the `chrome-devtools` MCP
2//! server, with the reliability and safety layer that makes a web agent actually
3//! work (per `tasks/browser-bot-sota-2026-05-31.md`).
4//!
5//! The browser-control problem ("how to call Chrome") is already solved: the MCP
6//! stdio client ([`crate::tool::mcp`]) turns the server's tools into
7//! `Arc<dyn Tool>`, and the bundled `chrome-devtools` preset
8//! ([`crate::connect_preset`]) spawns it with one call. This module adds the
9//! *agent-layer* capabilities the research found decisive — starting with
10//! observation distillation ([`distill`]) — built on the existing agent runner,
11//! dynamic-workflow combinators, structured output, guardrails, and memory.
12//!
13//! Built incrementally (spec §9, cheap reliability wins first):
14//! - **B1 (this):** [`distill`] — prune the a11y snapshot before it reaches the LLM.
15//! - B2+: stale-uid retry, post-action verification, settle, replan-loop,
16//!   completion judge, browser guardrails. (See the spec.)
17
18pub mod bench;
19pub mod builder;
20pub mod confirm;
21pub mod distill;
22pub mod distill_tool;
23pub mod guard;
24pub mod harness;
25pub mod inject;
26pub mod judge;
27pub mod plan;
28pub mod settle;
29pub mod verify;
30
31pub use bench::{BenchResult, BenchTask, Oracle, run_bench, scorecard};
32pub use builder::{
33    BROWSER_SYSTEM_PROMPT, BrowserAgentBuilder, browser_guardrails, filter_tools,
34    wrap_browser_tools,
35};
36pub use confirm::{ActionRisk, ConfirmActionTool, ConfirmPolicy, classify_label, label_for_uid};
37pub use distill::{DistillConfig, distill_snapshot, interactive_uids};
38pub use distill_tool::DistillingTool;
39pub use guard::DomainAllowlistGuard;
40pub use harness::ReliableInteractionTool;
41pub use inject::{InjectionRisk, scan_snapshot_for_injection};
42pub use judge::{CompletionVerdict, build_completion_prompt, parse_completion_verdict};
43pub use plan::{
44    Plan, PlanStep, ReplanAction, ReplanBudget, StepOutcome, StepStatus, replan_decision,
45};
46pub use settle::{Probe, SettleConfig, SettleOutcome, parse_dom_ready, settle};
47pub use verify::{ActionEffect, SnapshotSignature, diff, signature};