跳转至

屏幕

The screen tool lets an agent arrange the browser-based Control UI. It is a typed layout and navigation surface, not screenshot capture or browser automation.

The tool is exposed only when the originating client advertises the ui-commands capability. The selected person's requesting Control UI must still be connected when the tool runs; otherwise the Gateway returns UNAVAILABLE.

A client advertises ui-commands in the caps array it sends during the Gateway connect handshake (see Gateway protocol). The bundled Control UI advertises it already, so there is nothing to turn on there. A client that does not advertise it is never offered screen, so the tool is absent rather than failing at call time.

操作

操作 效果 可选输入
split_right 将目标会话窗格向右拆分 sessionKey(默认为当前会话)
split_down 将目标会话窗格向下拆分 sessionKey(默认为当前会话)
close_pane 关闭目标会话窗格 sessionKey(默认为当前会话)
focus 聚焦目标会话窗格 sessionKey(默认为当前会话)
navigate 打开目标会话 sessionKey(默认为当前会话)
sidebar_show / sidebar_hide 显示或隐藏主侧边栏 -
terminal_show / terminal_hide 显示或隐藏操作员终端面板 显示时 dock(bottom 或 right)
browser_show / browser_hide 显示或隐藏浏览器面板 显示时 dock(bottom 或 right)
desktop_show / desktop_hide 显示或隐藏远程桌面 environmentId、sessionKey、dock(默认 right)
portal_show / portal_hide 显示或隐藏 Web 应用门户 portalId、sessionKey、dock(默认 right)

每个操作都接受可选的 user,即 Control UI 消息会话上下文中该人员已验证的 requester_profile.id。 当多人已引导该回合时,user 为必填;代理会选择提出请求的人员,若不明确则询问他们。

对于运行在已附加环境上的原生应用,使用其 environmentId 调用 desktop_show。 对于 Web 应用,先为服务器端口打开一个门户,然后使用返回的 portalId 调用 portal_show。 所选视图会在该会话的侧边面板中打开。隐藏视图不会停止其应用、关闭门户或释放环境。

桌面面板和计算机工具指向同一环境。screen 仅负责呈现;计算机工具执行点击、输入和截图。

环境可能在配置完成前出现。桌面会显示启动进度,并在该特定机器可用时连接。 portal_show 可以在其应用启动期间接受 environmentId;就绪后替换为应用的 portalId。 待处理的门户不会从门户列表中打开另一个应用。

成功命令会在 Gateway 向请求浏览器发送类型化的 ui.command 事件后返回 { "ok": true }。

路由与安全

命令仅更改所选人员发起请求的 Control UI 连接。其他人的仪表板以及你的其他标签页保持当前视图。 sessionKey 选择要打开哪个会话;它不选择接收方。

Gateway 在接受消息时捕获浏览器目标,并将其与排队回合和工作线程执行一起保留。 如果该浏览器断开连接,或该回合没有 Control UI 目标,命令将以 UNAVAILABLE 失败。 请从已打开的 Control UI 重新请求;命令永远不会回退到广播。

具有匹配权限的人员可以引导同一回合。每个参与者保留自己捕获的浏览器目标; user 只能选择回合所有者或已接受的参与者。排队或被拒绝的引导不会添加参与者。 如果所选人员的访问权限已变更,他们必须重新请求。

之前使用 ui.command 进行广播的独立 RPC 和 MCP 调用方,必须从发起请求的 Control UI 连接 或在那里启动的代理回合中调用它。如果没有该浏览器目标,它们现在会收到 UNAVAILABLE, 即使其他仪表板已连接。这有意取代了旧版广播契约。

Gateway RPC 需要 operator.write。该工具只能更改呈现状态:它不能读取像素、截图、 点击任意页面内容,或绕过所选会话和操作员面板的权限。

本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 cl/openclaw