agent-desktop-macos
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseagent-desktop on macOS
macOS 上的 agent-desktop
Read the core skill first () for the observe, act, verify loop. This skill covers only what is different on macOS. Symptoms and fixes are in references/troubleshooting.md.
agent-desktop skills get desktop先阅读核心 skill(),了解 observe(观察)、act(操作)、verify(验证)循环。本 skill 仅涵盖 macOS 上存在差异的部分。症状和修复方法见 references/troubleshooting.md。
agent-desktop skills get desktopRequirements
环境要求
- macOS 13 or later, Intel or Apple Silicon.
- Accessibility permission for the app that launches agent-desktop (Terminal, iTerm2, Warp, VS Code, Codex). macOS 27 and later name this list Device Control and Data Access. If System Settings lists the binary separately, grant it too.
agent-desktop - Screen Recording permission, only for and for
screenshotartifacts.session start --screenshots - Automation permission for System Events, only where a command reports it missing.
- macOS 13 或更高版本,支持 Intel 或 Apple Silicon。
- 为启动 agent-desktop 的应用(Terminal、iTerm2、Warp、VS Code、Codex)授予 Accessibility 权限。在 macOS 27 及更高版本中,macOS 将此列表命名为 Device Control and Data Access。如果 System Settings 中单独列出了 二进制文件,也请为其授予权限。
agent-desktop - 授予 Screen Recording 权限;仅在使用 或
screenshot生成产物(artifacts)时需要。session start --screenshots - 为 System Events 授予 Automation 权限,但仅在命令报告缺少该权限时需要。
First contact
首次使用
- Run .
agent-desktop permissions - If a permission is denied, run . It opens the correct System Settings page with a panel that shows the user which app to drag into the list. The user confirms with Touch ID or a password, and the panel moves to the next missing permission by itself. The command returns at once with
agent-desktop permissions --guide,"guide": "started"or"already_running"."not_needed"shows the system prompts instead.agent-desktop permissions --request - If the guide cannot run, open System Settings > Privacy & Security > Accessibility (Device Control and Data Access on macOS 27 and later). Add the launching app and turn it on.
- Run to confirm
agent-desktop permissions. The next agent-desktop call sees a new grant, so the launching app does not need a restart.granted - Run to confirm. It reads the focused app.
agent-desktop snapshot -ireturnssnapshot --app Finder -iwhen Finder has no open window.WINDOW_NOT_FOUND
permissionspermissions --requestpermissions --guideunknown- 运行 。
agent-desktop permissions - 如果某项权限被拒绝,运行 。它会打开正确的 System Settings 页面,并显示一个面板,告知用户需要将哪个应用拖入列表。用户通过 Touch ID 或密码确认后,面板会自动移至下一项缺失的权限。该命令会立即返回
agent-desktop permissions --guide、"guide": "started"或"already_running"。"not_needed"则会显示系统权限提示。agent-desktop permissions --request - 如果无法运行该指南,请打开 System Settings > Privacy & Security > Accessibility(macOS 27 及更高版本为 Device Control and Data Access)。添加启动 agent-desktop 的应用并开启权限。
- 运行 ,确认状态为
agent-desktop permissions。下一次调用 agent-desktop 时即可看到新授予的权限,因此无需重启用于启动它的应用。granted - 运行 进行确认。它会读取当前获得焦点的应用。
agent-desktop snapshot -i在 Finder 没有打开任何窗口时会返回snapshot --app Finder -i。WINDOW_NOT_FOUND
permissionspermissions --requestpermissions --guideunknownWhat differs on macOS
macOS 上的差异
Headed is physical first for , , , and . Core focuses the exact window of the ref. The adapter then sends a real click, key or wheel event to the verified point. , , , , , , , and stay semantic under . Double-click, triple-click, and need . Raw input never changes focus.
clickright-clicktypeclearscrollexpandcollapseset-valueselecttogglecheckuncheckfocusscroll-to--headedhoverdrag--headed--xyJudge delivery by observation. AX return codes do not prove an effect. Finder returns success from an that does nothing. Snapshot again or use and to check the result.
AXConfirmgetisSurfaces. Use for File, Edit and View menus and for menu bar apps (status items). While a menu, sheet, alert or popover is open, refs from the window tree behind it are the wrong target.
--surface menubarMenus. headless uses . If the menu opened but the app returned with , do not retry. Inspect the menu with . For combo boxes and menu buttons, use . needs a closed-to-open menu transition, so dismiss any open menu first.
right-clickAXShowMenuAPP_UNRESPONSIVEretry: unsafe--surface menuselect @ref "Option"selectNotification Center. The notification commands drive Notification Center through accessibility, with the rules in the core reference. When agent-desktop opens the center, it closes it afterwards and restores the previous app focus. Pass both and on a single dismiss or action, because the stack shifts. Use for banners that vanish before you list them.
commands-system--expected-app--expected-titlewait --notification --app "App"Chromium and Electron. agent-desktop switches on the web accessibility of a Chromium renderer automatically when it needs it. For a dense running app, use , then drill with .
snapshot --skeleton -i --compact--root @refIdentity. accepts a display name () or a bundle ID (). Other commands take the display name through . Window IDs such as stay valid for the life of the window. Find them with .
launch"System Settings"com.apple.systempreferences--appw-4521list-windowsKeys. The primary modifier is : , . Quit shortcuts such as , , , and return unless you pass . To quit an app, use . Punctuation keys work in combos, as the symbol ( ) or by name (, , , , , , , , , , ). Each one is sent with the key that types it in the active keyboard layout, so opens Settings on ANSI and JIS keyboards alike.
cmdpress cmd+cpress cmd+scmd+qcmd+shift+qcmd+alt+escctrl+cmd+qcmd+shift+deletePOLICY_DENIED--forceclose-app,./;'[]\-=`commaperiodslashsemicolonquoteleftbracketrightbracketbackslashminusequalgravepress cmd+,Cursor overlay. draws the agent cursor in a click-through window. It never moves the OS pointer or activates an app. The macOS motion and image limits are in the core reference.
cursor-overlay enablecommands-systemHeaded 以物理操作为先。 对于 、、、 和 ,headed 模式会优先执行物理操作。Core 会将焦点置于 ref 对应的准确窗口,随后 Adapter 将真实的点击、按键或滚轮事件发送到已验证的位置。在 下,、、、、、、、 和 仍保持语义化操作。、、 和 需要使用 。直接使用 输入时,焦点绝不会改变。
clickright-clicktypeclearscroll--headedexpandcollapseset-valueselecttogglecheckuncheckfocusscroll-todouble-clicktriple-clickhoverdrag--headed--xy通过观察判断操作是否送达。 AX 返回码不能证明操作已生效。Finder 的 即使未执行任何操作,也会返回成功。请再次 snapshot,或使用 和 检查结果。
AXConfirmgetis界面层(Surfaces)。 对于 File、Edit 和 View 菜单以及菜单栏应用(状态项),使用 。当 menu、sheet、alert 或 popover 处于打开状态时,来自后方窗口树中的 ref 是错误的操作目标。
--surface menubar菜单(Menus)。 headless 模式下的 使用 。如果菜单已经打开,但应用返回 且带有 ,不要重试。使用 检查菜单。对于组合框(combo box)和菜单按钮(menu button),使用 。 需要菜单经历一次从关闭到打开的状态转换,因此请先关闭任何已打开的菜单。
right-clickAXShowMenuAPP_UNRESPONSIVEretry: unsafe--surface menuselect @ref "Option"selectNotification Center。 notification 命令通过 Accessibility 控制 Notification Center,并遵循核心 reference 中的规则。agent-desktop 打开通知中心后,会将其关闭并恢复之前的应用焦点。由于界面栈会发生变化,请在单次 dismiss 或 action 操作中同时传入 和 。对于在列出之前就会消失的横幅通知,使用 。
commands-system--expected-app--expected-titlewait --notification --app "App"Chromium 与 Electron。 agent-desktop 会在需要时自动开启 Chromium renderer 的 web accessibility。对于界面内容密集且正在运行的应用,使用 ,然后使用 逐层定位。
snapshot --skeleton -i --compact--root @ref标识(Identity)。 接受显示名称()或 bundle ID()。其他命令通过 传入显示名称。窗口 ID(如 )在窗口生命周期内始终有效。可使用 查找这些 ID。
launch"System Settings"com.apple.systempreferences--appw-4521list-windows按键(Keys)。 主修饰键是 :、。退出快捷键(如 、、、 和 )除非传入 ,否则会返回 。若要退出应用,请使用 。标点键可与组合键配合使用,既可使用符号( ),也可使用名称(、、、、、、、、、、)。每个标点都会通过当前活动键盘布局中能够输入该符号的按键发送,因此 在 ANSI 和 JIS 键盘上都能打开 Settings。
cmdpress cmd+cpress cmd+scmd+qcmd+shift+qcmd+alt+escctrl+cmd+qcmd+shift+delete--forcePOLICY_DENIEDclose-app,./;'[]\\-=`commaperiodslashsemicolonquoteleftbracketrightbracketbackslashminusequalgravepress cmd+,光标叠加层(Cursor overlay)。 会在 click-through 窗口中绘制 agent cursor。它绝不会移动 OS pointer,也不会激活应用。macOS 的 motion 和 image 限制见核心 reference。
cursor-overlay enablecommands-systemNext step
下一步
When a command fails, find the symptom in references/troubleshooting.md.
命令执行失败时,请在 references/troubleshooting.md 中查找对应症状。