wip: checkpoint 2026-03-29 runtime work

This commit is contained in:
zyl
2026-03-29 22:44:30 +08:00
parent 7d9036b2d4
commit e294fbb9b1
30 changed files with 6759 additions and 161 deletions

View File

@@ -0,0 +1,36 @@
use crate::runtime::RuntimeProfile;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ToolPolicy {
pub requires_browser_surface: bool,
pub may_use_non_browser_tools: bool,
pub allowed_tools: Vec<String>,
}
impl ToolPolicy {
pub fn for_profile(profile: RuntimeProfile) -> Self {
match profile {
RuntimeProfile::BrowserAttached => Self {
requires_browser_surface: false,
may_use_non_browser_tools: true,
allowed_tools: vec![
"superrpa_browser".to_string(),
"browser_action".to_string(),
],
},
RuntimeProfile::BrowserHeavy => Self {
requires_browser_surface: true,
may_use_non_browser_tools: true,
allowed_tools: vec![
"superrpa_browser".to_string(),
"browser_action".to_string(),
],
},
RuntimeProfile::GeneralAssistant => Self {
requires_browser_surface: false,
may_use_non_browser_tools: true,
allowed_tools: Vec::new(),
},
}
}
}