Add working Linux interaction engine (AT-SPI2 perception, X11 input, X11 capture) - #4
Open
devin-ai-integration[bot] wants to merge 5 commits into
Conversation
Co-Authored-By: Matthew Lam <minghinmatthew.lam@gmail.com>
Co-Authored-By: Matthew Lam <minghinmatthew.lam@gmail.com>
Co-Authored-By: Matthew Lam <minghinmatthew.lam@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Matthew Lam <minghinmatthew.lam@gmail.com>
Co-Authored-By: Matthew Lam <minghinmatthew.lam@gmail.com>
Author
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



What changed
Builds on #3 (Linux compile/test support) and replaces the fail-closed Linux stubs with a working interaction engine, so the server can actually perceive and drive apps on X11 Linux:
CAtSpisystem-library target (pkg-configatspi-2). The LinuxAXUIElementshim now wrapsAtspiAccessible*, implementing the AX attribute surface (role/title/value/children/parent/extents/enabled/focused/selected, actions) with AT-SPI role→AX-role mapping (push button→AXButton,entry→AXTextField, …). TreeBuilder/snapshots/locators work unchanged.NSWorkspace.runningApplicationsis backed by AT-SPI desktop children, solist_apps/app targeting resolve real apps.CX11system-library target (x11,xtst,png).deliverClick/deliverScroll(wheel buttons 4–7)/deliverDrag/deliverKey/typeUnicodeTextare real; Unicode text uses temporary spare-keycode remapping (keyboard-map lock + settle delays). Tiers are honest: XTest is global, so outcomes reporttier4-global-cursor/tier4-global-xtestwith anx11-global-inputfallback reason — no pretense of macOS-style background-safety.captureWindowdoes anXGetImageroot-window crop of the window frame, RGBA-converted and encoded with libpng, honoringScreenshotDetailscaling —get_app_statenow returns real screenshots on Linux.list_windows(AT-SPI frames/titles/focus), clipboard read/write via checkedxclip/xselsubprocess with verify-and-restore,wait_forvia AT-SPI tree polling,open_app(direct exec orgtk-launch),open_url(xdg-open).health_report --jsonnow reports AT-SPI2 accessibility granted, X11/XTest input availability, and X11 capture responsiveness; README's Linux boundary updated (Wayland, overlay, OCR, skills recorder remain unsupported/macOS-only).CAtSpi/CX11dependencies and linker settings are.when(platforms: [.linux])-gated; macOS build is untouched.Type of change
Verification
All on Ubuntu 22.04 (X11, Swift 6.0.3); macOS lane via hosted CI:
swift buildswift test— 398 tests passedversion,help,health_report --jsonscripts/preflight.py --bin .build/debug/computer-use-mcp— passedDISPLAY=:0):call list_appsshows real AT-SPI apps;get_app_statereturns a real element tree and a rendered 420x209 PNG screenshot (validated with ImageMagick)call clickon a GTK button → follow-up state shows the"clicked"label;type_textround trips ASCII and Unicode (hé☃) viaread_text;ctrl+a+ replacement verified modifier deliverywait_forobserved a live state change,open_applaunched gtk3-demo,list_windowsreturned real framesChecklist
docs/).Link to Devin session: https://app.devin.ai/sessions/5f22c5a8af704f368b963a71f94eb46f
Requested by: @minghinmatthewlam