YUCONG-28/dsh-skills-plugins--plugins-dsh-computer-use0

dsh-computer-use

DSH Computer Use 插件:为 Agent 提供类似 Codex Computer Use 的 macOS 桌面操控能力——先观察再动作、动作后新鲜状态验证,含 TCC 权限检测、按应用授权、敏感动作一次性确认与陈旧状态拒绝。

包名
dsh-computer-use
版本
0.1.0
许可证
MIT
最近更新
2026年8月18日

安装

此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗

配置(cordis.patch.yml 的 computer-use: config)

字段默认说明
enabledtrue总开关
announceToAgenttrue是否向模型通告本插件
observationTtlMs0observation 允许复用的生命周期(0=不过期,上限 24h)
confirmationTtlMs60000一次性确认 token 生命周期
actionTimeoutMs30000helper 单次调用硬超时
settleMs250动作后重观察前的延迟
maxNodes / maxDepth300 / 24Accessibility 树遍历上限
screenshot.artifactRootcomputer-useworkspace 内截图目录
interaction.focusPolicypreservepreserve(默认不激活目标)| activate
interaction.keyboardPolicypreserve键盘是否先激活目标应用
interaction.pointerInputPolicytargetedtargeted(定向指针)| deny(禁用坐标/滚动/拖拽)
helper.path''显式外部 helper 可执行路径
allowAllAppsfalse向所有应用授予 read/control
grants[]精确 bundle-id 授权:[{bundleId, read, control}]

使用示例

  1. 加载 Skill:/computer-use
  2. 列出应用:computer_list_apps
  3. 观察:computer_observe({ pid: 42128, screenshot: true })
  4. 点击:computer_click({ observationId: "obs-...", handle: "0.3.7" })
  5. 输入(敏感):computer_confirm({ observationId, handle, action: "computer_type_text", reason: "在搜索框输入关键词" }) → 用返回的 token 执行 computer_type_text
  6. 验证:读动作返回的 diff 与新 observation;必要时截图交给视觉模型

配置补充说明

  • interaction.keyboardPolicy
    • preserve(默认):不激活目标应用,键盘事件定向投递(postToPid)——不干扰用户,但后台应用可能丢字符,适合只读/低交互场景;
    • activate:键盘输入前激活目标应用,确认其为前台后用全局键盘(CGEventPost,逐字符 12ms 间隔)——可靠但会短暂抢焦点,适合真实输入任务。
  • 语义输入优先:文本类输入建议优先 computer_set_value(AX value 整值写入,不受输入法/焦点影响,可写中文);键盘输入(computer_type_text)用于需要真实按键语义的场景,且应提供 handle 让插件先点击聚焦目标控件,并确保系统输入法为 ASCII(ABC/English)。