feat(app): the bot browser's window on a virtual monitor to share in Discord

- features.browserShare (봇용 크롬창 화면공유 선택 표시, off by default) and a driver card on the
  features screen: the Virtual Display Driver 25.7.23 (MIT, SignPath-signed) ships in
  display-driver/ (hash-checked by package.sh); install and uninstall run jarvis.exe elevated
  once (--display-driver), settings in %ProgramData%\JarvisBot\display-driver, another
  program's copy of the driver is left alone
- the monitor is on the desktop only while the bot browser uses it, at the rightmost real
  monitor's bottom-right corner; the stop closes Chrome first, then takes the monitor off
- Chrome starts with no window and the app opens it over CDP in the background, so it never
  takes the focus; the window is a tool window (no Alt+Tab, no taskbar button), fills the
  monitor's work area and keeps drawing when covered; without a monitor it runs headless with
  the reason on the dashboard
- Chrome runs with --do-not-de-elevate on Windows: started by an app running as administrator
  it restarted itself as the user and the app lost hold of it
- checked on the win-ci Windows VM from install to uninstall (focus kept while typing, no
  taskbar button, no Chrome left, nothing left after uninstall) and on Linux with a real Chrome

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-14 02:43:32 +09:00
parent 56212c06dc
commit 1bd7defbb4
17 changed files with 884 additions and 43 deletions

View File

@@ -95,6 +95,9 @@ pub struct FeatureSettings {
pub collect: bool,
/// The bot browser (admin.spec.md, "Bot browser").
pub browser: bool,
/// The bot browser's window on a virtual monitor to share in Discord (admin.spec.md, "Virtual
/// monitor"); off by default.
pub browser_share: bool,
}
/// Background collection (admin.spec.md, "Background collection"); no targets by default.
@@ -186,7 +189,7 @@ impl Default for Settings {
response: PolicySettings::default(),
memory: Map::new(),
llm: LlmSettings { url: None, port: 8080, context: 32768 },
features: FeatureSettings { weather: true, web_search: true, meals: true, collect: true, browser: true },
features: FeatureSettings { weather: true, web_search: true, meals: true, collect: true, browser: true, browser_share: false },
mcp_servers: vec![],
collect: CollectSettings { keep_days: 30, targets: vec![] },
}
@@ -508,6 +511,7 @@ pub fn parse_settings(raw: &Value) -> Result<Settings, SettingsError> {
meals: get_bool(f, "meals", "features", d.features.meals)?,
collect: get_bool(f, "collect", "features", d.features.collect)?,
browser: get_bool(f, "browser", "features", d.features.browser)?,
browser_share: get_bool(f, "browserShare", "features", d.features.browser_share)?,
}
},
mcp_servers: parse_mcp_servers(raw)?,
@@ -807,13 +811,13 @@ mod tests {
#[test]
fn features_and_mcp_servers_are_read_and_checked() {
let s = parse_settings(&json!({}));
assert_eq!(s.unwrap().features, FeatureSettings { weather: true, web_search: true, meals: true, collect: true, browser: true });
assert_eq!(s.unwrap().features, FeatureSettings { weather: true, web_search: true, meals: true, collect: true, browser: true, browser_share: false });
let s = parse_settings(&json!({
"features": {"weather": false, "meals": false},
"features": {"weather": false, "meals": false, "browserShare": true},
"mcpServers": [{"name": "brave", "command": "npx", "args": ["-y", "brave"], "env": ["BRAVE_API_KEY", " "]},
{"name": "time-2", "command": "uvx", "enabled": false}]
})).unwrap();
assert_eq!(s.features, FeatureSettings { weather: false, web_search: true, meals: false, collect: true, browser: true });
assert_eq!(s.features, FeatureSettings { weather: false, web_search: true, meals: false, collect: true, browser: true, browser_share: true });
assert_eq!(s.mcp_servers, vec![
McpServerSettings { name: "brave".into(), command: "npx".into(), args: vec!["-y".into(), "brave".into()],
env: vec!["BRAVE_API_KEY".into()], enabled: true },