agent-desktop-windows
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseagent-desktop-windows
agent-desktop-windows
The observe-act loop, ref system, JSON envelope, sessions and tracing are the
same on every platform. This file covers only what differs on Windows.
Requires Windows 10 1809+ / Windows Server 2019+ (x64 or ARM64). Run it in the
interactive desktop session of the signed-in user. Session 0 (services and
SYSTEM tasks), Server Core, the secure desktop (UAC prompts, the sign-in
screen), a locked desktop and another user's session are not supported:
observation, actions and capture there fail or return nothing.
observe-act 循环、ref 系统、JSON envelope、会话和追踪在所有平台上均完全相同。本文件仅介绍 Windows 上的差异。
要求 Windows 10 1809+ / Windows Server 2019+(x64 或 ARM64)。应在已登录用户的交互式桌面会话中运行。不支持 Session 0(服务和 SYSTEM 任务)、Server Core、secure desktop(UAC 提示和登录界面)、锁定的桌面及其他用户的会话:在这些环境中,观察、操作和捕获会失败或不返回任何内容。
Capability Table
功能表
| Group | Commands | Status on Windows |
|---|---|---|
| Observation | | Works. Surfaces are |
| Surfaces | | Works. Lists |
| Shell surfaces | | Works for |
| Ref interaction | | Works, semantic in headless and |
| Multi-click and focus | | Works with global |
| Keyboard and mouse | | Works. Cursor-moving input needs |
| Held input | | Fails closed on every platform with |
| App and window | | Works. First Contact covers the name |
| Displays | | Works |
| Clipboard | | Works; typed text and image content |
| Wait | | Works for ms, |
| Notifications | | Works over the Action Center. Pass |
| Cursor overlay | | Works. |
| System | | Works |
| 分组 | 命令 | Windows 上的状态 |
|---|---|---|
| 观察 | | 支持。可用的 surface 包括 |
| Surface | | 支持。按进程列出 |
| Shell surface | | 支持 |
| Ref 交互 | | 支持,在 headless 和 |
| 多击与焦点 | | 仅在全局使用 |
| 键盘与鼠标 | | 支持。需要移动光标的输入操作需要 |
| 按住输入 | | 在所有平台上均会 fail closed 并返回 |
| 应用与窗口 | | 支持。首次使用部分介绍了 |
| 显示器 | | 支持 |
| 剪贴板 | | 支持;可处理文本和图片内容 |
| 等待 | | 支持 ms、 |
| 通知 | | 支持通过 Action Center 操作。Action Center 关闭时需要传入 |
| 光标叠加层 | | 支持。 |
| 系统 | | 支持 |
First Contact
首次使用
- Quote every ref in PowerShell. PowerShell reads a bare as its splatting operator and deletes the argument before the binary sees it, so
@tokenfailsset-value @s8f3k2p9:e1 hi. WriteINVALID_ARGS. cmd.exe and bash need no quoting.set-value '@s8f3k2p9:e1' hi - A window behind another window is drivable. A minimized one is not.
Every element of a minimized window reports and ref actions fail. Run
offscreenand snapshot again. Do not userestore --app <image>by reflex: it steals the user's foreground.focus-window - No permission dialog exists. reports
permissionsasautomation. Elevation boundaries are the only access control.not_required - Chromium and Electron apps read thin before they settle. Pass a longer
to
--timeout-msinstead of concluding the tree is empty.snapshot - Blocked shortcuts. ,
alt+f4,win+l,win+d,alt+tab,win+r,win+x,win+eand their modifier supersets are refused withoutctrl+shift+esc. In combos,--forceandcmdare the Windows key, sometais a shell shortcut. Writemeta+cto copy.ctrl+c - needs
type. It is keystroke synthesis through--headed, so a strict-headlessSendInputreturnstype. UsePOLICY_DENIED, or passset-value. It ends--headed(delivered_unverified) when the field exposes no readable Text selection, and can verify when one is readable: confirm with a freshverification_scope: "unavailable".get - writes to the foreground queue with no per-process targeting. A headless press to a non-frontmost app fails closed. A non-interactive caller (service, scheduled task, CI job) gets
press --app.delivered_unverified - takes an absolute path or a bare name under System32 or the Windows directory, with or without
launch(.exeornotepad), not a display name. Usenotepad.exeto find a running app.list-apps - Notifications: with the Action Center closed needs
list-notifications. Single-item--headedanddismiss-notificationneednotification-actionand--headedor--expected-appfor the entry at INDEX.--expected-title - Surfaces: an open or context menu is the surface. Windows does not advertise a
menusurface.menubar - Commands that raise shell chrome take the foreground. Strict headless
refuses them with before anything is raised.
POLICY_DENIED - Stateful actions run once, then verify by re-reading. means the readback matched.
delivered_verifiedwithACTION_FAILEDmeans the action landed but the readback differs: readdetails.kind: "post_action_verification"and do not retry. Adetails.post_statethe app reformats reads as failed. Seeset-value.references/troubleshooting.md - Unsigned binary warnings are expected. See .
references/troubleshooting.md
- 在 PowerShell 中必须为每个 ref 加引号。 PowerShell 会将未加引号的 解析为 splatting 运算符,并在二进制程序收到参数前将其删除,因此
@token会因set-value @s8f3k2p9:e1 hi失败。应写成INVALID_ARGS。cmd.exe 和 bash 不需要加引号。set-value '@s8f3k2p9:e1' hi - 被其他窗口遮挡的窗口仍可操作,但最小化的窗口不可操作。 最小化窗口中的每个元素都会报告 ,ref 操作也会失败。请运行
offscreen并再次执行 snapshot。不要习惯性地调用restore --app <image>,因为它会抢占用户的前台窗口。focus-window - 不存在权限对话框。 会将
permissions报告为automation。权限提升边界是唯一的访问控制机制。not_required - Chromium 和 Electron 应用在稳定下来之前读取到的内容较少。 应为 传入更长的
snapshot,而不是直接判断 UI 树为空。--timeout-ms - 快捷键限制。 未使用 时,
--force、alt+f4、win+l、win+d、alt+tab、win+r、win+x、win+e及其包含修饰键的组合都会被拒绝。在组合键中,ctrl+shift+esc和cmd表示 Windows 键,因此meta属于 shell 快捷键。若要复制,请使用meta+c。ctrl+c - 需要
type。 它通过--headed合成按键,因此在严格 headless 模式下调用SendInput会返回type。请改用POLICY_DENIED,或传入set-value。当字段未暴露可读的 Text 选择内容时,操作结果为--headed(delivered_unverified);存在可读内容时可以验证,请使用新的verification_scope: "unavailable"确认结果。get - 会写入 foreground queue,不支持按进程指定目标。在 headless 模式下向非前台应用发送按键会 fail closed。非交互式调用方(服务、计划任务、CI job)会得到
press --app。delivered_unverified - 接受绝对路径,或接受位于 System32 或 Windows 目录下的名称,可以带或不带
launch(例如.exe或notepad),但不能使用应用的显示名称。请使用notepad.exe查找正在运行的应用。list-apps - 通知: Action Center 关闭时,需要
list-notifications。对 INDEX 位置的条目执行单项--headed或dismiss-notification时,需要同时传入notification-action以及--headed或--expected-app。--expected-title - Surface: 已打开的菜单或上下文菜单属于 surface。Windows 不会公开
menusurface。menubar - 调起 shell chrome 的命令会抢占前台。 严格 headless 模式会在调起任何界面前以 拒绝执行。
POLICY_DENIED - 有状态操作执行一次后,应通过重新读取进行验证。 表示 readback 与预期一致。出现
delivered_verified且ACTION_FAILED表示操作已经生效,但 readback 结果不同:请读取details.kind: "post_action_verification",不要重试。如果应用重新格式化了details.post_state设置的值,该操作会被判定为失败。参见set-value。references/troubleshooting.md - 未签名二进制文件的警告属于预期现象。 参见 。
references/troubleshooting.md
What differs on Windows
Windows 上的差异
- Ref actions are semantic UI Automation calls in headless and mode, except
--headed,right-click,double-click,triple-clickandtype, which are physical or take focus and needfocus.--headed - The cursor overlay plays its per-action travel only for headless semantic actions. A action moves the real cursor instead.
--headed
- 在 headless 和 模式下,Ref 操作均为语义化 UI Automation 调用;但
--headed、right-click、double-click、triple-click和type除外。这些操作属于物理输入操作或需要获取焦点,因此需要focus。--headed - 光标叠加层仅在 headless 语义操作期间播放逐次动作的移动效果。执行 操作时,它会改为移动真实光标。
--headed
References
参考资料
- : open it for
references/shell-and-overlay.md, tray and taskbar surfaces, notifications, the cursor overlay, hosted (UWP) window identity and menu detection coverage.open-system-surface - : integrity levels, UIPI, blocked combos, protected processes, the cross-process interaction lease.
references/permissions-and-elevation.md - : settle timing, covered-window hazard, WPF wrong-provider trap, unnamed web content.
references/chromium-and-electron.md - : symptom-to-cause map, action verification outcomes, saving a document headless, install warnings.
references/troubleshooting.md
Read any file from the binary:
.
agent-desktop skills get agent-desktop-windows references/troubleshooting.md- :用于查阅
references/shell-and-overlay.md、托盘和任务栏 surface、通知、光标叠加层、托管(UWP)窗口标识及菜单检测覆盖范围。open-system-surface - :用于查阅完整性级别、UIPI、受限制的组合键、受保护进程和跨进程交互租约。
references/permissions-and-elevation.md - :用于查阅稳定等待时序、窗口遮挡隐患、WPF 错误 provider 陷阱和未命名 Web 内容。
references/chromium-and-electron.md - :提供症状与原因对照表、操作验证结果、headless 模式下保存文档的方法及安装警告说明。
references/troubleshooting.md
可从二进制程序中读取任意文件:
。
agent-desktop skills get agent-desktop-windows references/troubleshooting.md