Repository navigation
feat(desktop-use): control engine pin, Atmos Desktop Use host, unified AppShot TCC #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
47524de
feat(desktop-use): pin control engine package under Atmos Desktop Use…
AruNi-01 613cee6
fix(desktop-use): serve via Atmos Desktop Use.app for unified TCC
AruNi-01 baa4f0f
fix(desktop-use): route AppShot capture through host engine when inst…
AruNi-01 cc55af2
fix(desktop-use): rustfmt + silence unused host_app on non-macOS
AruNi-01 6a46fe1
docs(desktop-use): clarify Electron capture is pre-ensure fallback only
AruNi-01 36fa5df
fix(desktop-use): lock 0.17.0 screenshot protocol and real PNG extract
AruNi-01 4a5c561
feat(desktop-use): polish control UX, agent chrome, and compliance no…
AruNi-01 6c6710c
feat(desktop-use): browser-use CDP surface, AX/pixel ladder, cursor-m…
AruNi-01 3e73468
fix(desktop-use): silence Linux Clippy and harden CLI/host capture
AruNi-01 876bf59
fix(desktop-use): address review quick-wins for install, capture, ove…
AruNi-01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,176 @@ | ||
| //! `atmos browser-use` — page CDP control (separate from Desktop Use). | ||
|
|
||
| use browser_use::{execute, BrowserAction, BrowserBackendKind, BrowserRequest}; | ||
| use clap::{Args, Subcommand}; | ||
| use serde_json::{json, Value}; | ||
|
|
||
| pub async fn execute_cmd(command: BrowserUseCommand) -> Result<Value, String> { | ||
| let req = match command { | ||
| BrowserUseCommand::Prepare(a) => BrowserRequest { | ||
| backend: parse_backend(&a.backend)?, | ||
| action: BrowserAction::Prepare, | ||
| pid: a.pid, | ||
| window_id: a.window_id, | ||
| session: a.session, | ||
| profile_strategy: a.strategy, | ||
| ..Default::default() | ||
| }, | ||
| BrowserUseCommand::State(a) => BrowserRequest { | ||
| backend: parse_backend(&a.backend)?, | ||
| action: BrowserAction::State, | ||
| pid: a.pid, | ||
| window_id: a.window_id, | ||
| target_id: a.target_id, | ||
| tab_id: a.tab_id, | ||
| session: a.session, | ||
| ..Default::default() | ||
| }, | ||
| BrowserUseCommand::Click(a) => BrowserRequest { | ||
| backend: parse_backend(&a.backend)?, | ||
| action: BrowserAction::Click, | ||
| target_id: Some(a.target_id), | ||
| tab_id: Some(a.tab_id), | ||
| element_ref: Some(a.element_ref), | ||
| session: a.session, | ||
| ..Default::default() | ||
| }, | ||
| BrowserUseCommand::Type(a) => BrowserRequest { | ||
| backend: parse_backend(&a.backend)?, | ||
| action: BrowserAction::Type, | ||
| target_id: Some(a.target_id), | ||
| tab_id: Some(a.tab_id), | ||
| text: Some(a.text), | ||
| element_ref: Some(a.element_ref), | ||
| session: a.session, | ||
| ..Default::default() | ||
| }, | ||
| BrowserUseCommand::Navigate(a) => BrowserRequest { | ||
| backend: parse_backend(&a.backend)?, | ||
| action: BrowserAction::Navigate, | ||
| target_id: Some(a.target_id), | ||
| tab_id: Some(a.tab_id), | ||
| url: Some(a.url), | ||
| session: a.session, | ||
| ..Default::default() | ||
| }, | ||
| }; | ||
| let res = execute(req); | ||
| serde_json::to_value(res).map_err(|e| e.to_string()) | ||
| } | ||
|
|
||
| fn parse_backend(s: &str) -> Result<BrowserBackendKind, String> { | ||
| BrowserBackendKind::parse(s).ok_or_else(|| { | ||
| format!( | ||
| "invalid --backend {:?} (use cua|external|embedded|atmos)", | ||
| s | ||
| ) | ||
| }) | ||
| } | ||
|
|
||
| #[derive(Debug, Subcommand)] | ||
| pub enum BrowserUseCommand { | ||
| /// Attach / prepare a browser CDP endpoint (CUA external Chromium). | ||
| Prepare(PrepareArgs), | ||
| /// Read browser state / tabs / snapshot refs. | ||
| State(StateArgs), | ||
| /// Click a page element by ref in a bound tab. | ||
| Click(ClickArgs), | ||
| /// Type into the bound tab (optional ref). | ||
| Type(TypeArgs), | ||
| /// Navigate a bound tab to a URL. | ||
| Navigate(NavigateArgs), | ||
| } | ||
|
|
||
| #[derive(Debug, Args)] | ||
| pub struct PrepareArgs { | ||
| /// Backend: cua (system Chromium) | embedded (Atmos webview stub until APP-053). | ||
| #[arg(long, default_value = "cua")] | ||
| pub backend: String, | ||
| #[arg(long)] | ||
| pub pid: Option<i32>, | ||
| /// Required when --strategy existing_profile (engine 0.17). | ||
| #[arg(long)] | ||
| pub window_id: Option<i64>, | ||
| #[arg(long)] | ||
| pub session: Option<String>, | ||
| /// existing_profile (needs --window-id) | isolated_new | isolated_named. Default: omit strategy. | ||
| #[arg(long)] | ||
| pub strategy: Option<String>, | ||
| } | ||
|
|
||
| #[derive(Debug, Args)] | ||
| pub struct StateArgs { | ||
| #[arg(long, default_value = "cua")] | ||
| pub backend: String, | ||
| /// Bind mode: native browser pid (with --window-id). | ||
| #[arg(long)] | ||
| pub pid: Option<i32>, | ||
| /// Bind mode: native window id (with --pid). | ||
| #[arg(long)] | ||
| pub window_id: Option<i64>, | ||
| /// Snapshot mode: opaque target id from prior bind. | ||
| #[arg(long)] | ||
| pub target_id: Option<String>, | ||
| /// Snapshot mode: opaque tab id from prior bind. | ||
| #[arg(long)] | ||
| pub tab_id: Option<String>, | ||
| #[arg(long)] | ||
| pub session: Option<String>, | ||
| } | ||
|
|
||
| #[derive(Debug, Args)] | ||
| pub struct ClickArgs { | ||
| #[arg(long, default_value = "cua")] | ||
| pub backend: String, | ||
| #[arg(long)] | ||
| pub target_id: String, | ||
| #[arg(long)] | ||
| pub tab_id: String, | ||
| #[arg(long = "ref")] | ||
| pub element_ref: String, | ||
| #[arg(long)] | ||
| pub session: Option<String>, | ||
| } | ||
|
|
||
| #[derive(Debug, Args)] | ||
| pub struct TypeArgs { | ||
| #[arg(long, default_value = "cua")] | ||
| pub backend: String, | ||
| #[arg(long)] | ||
| pub target_id: String, | ||
| #[arg(long)] | ||
| pub tab_id: String, | ||
| #[arg(long)] | ||
| pub text: String, | ||
| /// Required by engine 0.17 browser_type. | ||
| #[arg(long = "ref")] | ||
| pub element_ref: String, | ||
| #[arg(long)] | ||
| pub session: Option<String>, | ||
| } | ||
|
|
||
| #[derive(Debug, Args)] | ||
| pub struct NavigateArgs { | ||
| #[arg(long, default_value = "cua")] | ||
| pub backend: String, | ||
| #[arg(long)] | ||
| pub target_id: String, | ||
| #[arg(long)] | ||
| pub tab_id: String, | ||
| #[arg(long)] | ||
| pub url: String, | ||
| #[arg(long)] | ||
| pub session: Option<String>, | ||
| } | ||
|
|
||
| /// Helpful static note for agents (not a runtime command). | ||
| #[allow(dead_code)] | ||
| pub fn product_note() -> Value { | ||
| json!({ | ||
| "product": "Browser Use", | ||
| "no_mcp": true, | ||
| "desktop_use": "separate — OS windows / keys / AX", | ||
| "backends": ["cua", "embedded"], | ||
| "embedded": "stub until APP-053 / PR #203", | ||
| }) | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Correct the
Typehelp text:--refis required.The help text says the ref is optional.
TypeArgs.element_refat Line 147 is a requiredString, andcrates/browser-use/src/backends/cua.rsLine 129 also requires it. The text misleads users ofatmos browser-use type --help.📝 Proposed help-text fix
📝 Committable suggestion
🤖 Prompt for AI Agents