Skip to content

feat: answer dialogs, force quit, hide, unhide and maximize - #38

Merged
iamnbutler merged 1 commit into
mainfrom
feat/dialogs-app-controls
Oct 17, 2026
Merged

iamnbutler merged 1 commit into
mainfrom
feat/dialogs-app-controls

Conversation

@iamnbutler

@iamnbutler iamnbutler commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Adds dialog handling and more app and window controls. That takes the tool count from 25 to 30. No Peekaboo patch was needed: the runtime only allowlists more Bridge operations (hideApplication, maximizeWindow, targetedDialogListElements, prepareDialogAction, exactDialogClickButton, exactDialogEnterText).

Tools

  • desktop_dialog reads the dialog or sheet in an exact app or window target. It lists the buttons (enabled, default), text fields (index, value, placeholder), static texts, and the resolved window target with its signed receipt.
  • desktop_dialog_answer does one of two things:
    • Presses one button by its exact, unique, enabled title. It uses the targeted inventory first, then prepare/perform; the result is completed only on a confirmed change.
    • Replaces one text field's value by index, using exact background AXValue entry with a readback.
    • Each answer verifies the signed receipt's process generation and window before reporting.
  • desktop_quit gains force: true. It is bound to the process generation, and the description warns that all unsaved work is lost. A normal quit that leaves the app running now points the agent at desktop_dialog.
  • desktop_hide / desktop_unhide use the targeted, generation-checked variants. Unhide is exact activation, because the Bridge refuses background unhide.
  • desktop_maximize zooms one exact window to the visible screen area. It does not enter full screen.

docs/tools.md is updated. "Dialog answers, force quit" is gone from Not supported. "No automatic retries" stays as a deliberate design note, and file-panel path choosing is listed as unsupported.

Verified live

Signed dev build on a separate socket via CFFIXED_USER_HOME, before #37 landed; /Applications was not replaced. The branch is rebased onto #37, so later dev testing can use DESKTOP_TOOLS_STATE instead.

  • Normal quit: quitting a TextEdit with an unsaved document returned unknown with terminated: false. The Save sheet was open.
  • desktop_dialog: listed the Delete, Cancel and Save buttons and both text fields.
  • Text entry: setting field 0 to dialog-test.rtf completed, with the value verified.
  • Refusals: the buttons delete (wrong case) and default were refused, and the refusal named the available buttons.
  • Delete: pressing it completed with a confirmed change, and the app quit.
  • Hide and unhide: both completed, and is_hidden flipped each time.
  • Maximize: completed, and the window went from 603x505 to 2560x1410. A repeat with the stale bounds was refused.
  • Force quit: completed with terminated: true. A repeat with the old generation was refused, and force on close was refused.

Caveats

  • No path choosing in file panels. dialogHandleFile is legacy and keyed only by app name, so it can't be made exact without a patch.
  • Text entry checks the generation after dispatch. The signed receipt's generation is verified after the entry is sent. The inventory preflight before it is generation-checked.
  • No dialog open. Reading a dialog when none is open returns the native error "No dialog matched the selected target."
  • The live app needs replacing. The new operations need a new runtime, so /Applications/Desktop Tools.app must be replaced with a build of this branch before the tools work in the installed MCP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant