Skip to content

desktop: window inventory and focus tools #151

Closed

Description

@ElbertePlinio

Agents drive native apps by clicking screenshot coordinates only. There is no tool to list windows or move focus: desktop_type and desktop_key go to whatever window is focused, waitWindow matches a title substring, and a newly launched client can steal focus (packages/mcp-server/src/tools/desktop.ts launch gating comment). listWindows in packages/desktop-linux/src/apps.ts already wraps xdotool search.

  • desktop_windows (MCP) and desktop windows (CLI): id, name, class, geometry and whether the window is focused, using existing listWindows plus xdotool getactivewindow and getwindowgeometry
  • desktop_focus / desktop focus: activate a window by id or exact name, gated by the agent permit like other input, recorded in the evidence journal as an interaction with the window identity as target
  • Bounded wait after activation until the window is reported focused; error record on timeout
  • Tests with a fake xdotool and one live Xvfb test using two zenity windows
  • Separate final reviewer

Part of #118. Refs #22.

Implementation, local checks and independent review are complete. #172 awaits required PR CI before merge. Actual two-zenity managed-Xvfb focus passed locally; full native-app acceptance remains #156.

Activity

  1. ElbertePlinio commented on Sep 15, 2026

    @ElbertePlinio
    MemberAuthor

    Implementation started from the merged #150 foundation. Scope is window inventory, explicit focus selection, bounded focus confirmation, existing agent-permit gating and recorded interactions, with fake-command and real two-zenity-window coverage. Existing managed Xvfb sessions have no window manager, so implementation will verify that behavior rather than assume EWMH activation works. No host-desktop use, Wayland implementation or release publication. Separate review and required PR CI precede merge.

  2. added a commit that references this issue on Sep 15, 2026
    0fe9e8f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions