CUA 工具摘要在 Agent 已经通过 list_apps 观察到 App 身份、且后续调用显式携带 PID 时,
从执行开始阶段显示目标 App 名称和图标,降低连续 CUA 操作的辨识成本。
Computer Use 收成 node_repl 的 JS 面之后,模型可见的工具名只有 mcp__node_repl__js,
本文下面「事实来源与时序」「CUA Tool Call Group」两节依赖的 mcp__computer-use__* 工具名判据
全部失效,只对历史会话回放继续成立。新会话按本节投影。
Helper application_info / capture
|
v
producer 统一 wrapper 附加 _meta["zcode.cua/app-associations-v1"].primary
{ appKey, displayName?, icon? }
|
v broker 响应(沙箱不可见)
node-repl-host 主线程 CUA broker —— 唯一可信记录点(本次调用的账本)
|
v run 结果的可信槽位
node_repl 工具结果 _meta["zcode/nodeReplCuaApp"] = { appKey, displayName? }
|
v
Core display `node_repl_images.app`
|
v
Node REPL 工具卡 leading icon -> IPlatformService.getApplicationIcon(locator)
worker_threads 冒充 Worker 的结果消息伪造它,所以记录点移出了 Worker。
nodeRepl.setResponseMeta 与 nodeRepl.emitStructuredResult 都挂在模型可见的 sandbox
globals 上,因此经这两条通道到达的 zcode.cua/app-associations-v1 一律丢弃,不得参与展示
(同 zcode/nodeReplBrowserScreenshotContentIndices 的既有处置)。宿主自己写的
zcode/nodeReplCuaApp 是唯一被 Core 消费的键。primary 的 CUA 方法胜出,与 _meta 既有的
last-write-wins 语义一致。request_access、stop_computer_control 声明 none,
list_apps 声明 items,三者都不产生 primary,因此不会把前面的身份覆盖掉。appKey 按前缀派生 locator——darwin: → darwin-bundle-id,
windows-aumid: → windows-aumid,windows-exe: → windows-executable-path。
linux-exe: 没有对应 locator,与 Web/手机远控一样回退通用 Node REPL 图标。
producer _meta 里的内联 icon PNG 不投影:会话协议不承载 data URL(见下节「协议与展示」),
且同一个 app 的图标会在长会话里逐步重复几十次。app 名称不进摘要行(js 的 title 已由模型描述本次动作,再拼一次 App 名会
重复);list_apps 的 items 不投影(node_repl 下没有逐条列表卡);CUA Group 分组仍然只对
历史会话成立。本节及「CUA Tool Call Group」按
mcp__computer-use__*工具名分流,只对历史会话回放成立; 新会话见上节。
list_apps #1 success ── snapshot #1 ── pid tool ── pid tool
list_apps #2 success ── snapshot #2 ── pid tool ── ...
list_apps 成功结果整体替换快照;失败结果保留旧快照。app_ref.pid 查询当前快照;没有
PID 时,再以 bundle_id 完全相等查询。name 不作为查询键。app_ref / 等价 AppRef 位置同时接受结构化对象与可解析为对象的 JSON 字符串,与 CUA
执行层输入归一化保持一致;无效字符串不参与匹配。state_id 反查,不为摘要隐式调用 list_apps,也不猜测截图、等待等全局操作的 App。ToolCallRow 事实。ToolCallRow 可选携带:
cuaApp?: {
pid: number;
name: string;
bundleId?: string;
};
展示身份优先采用同一次工具完成结果中的 App,其次采用 scheduled 时固化的 cuaApp,最后
回退 Computer Use。匹配成功时显示 App Icon + App Name + Action;图标通过平台服务按
bundleId 异步解析,不把 data URL 写入会话协议。平台不支持、无 bundle id 或图标读取失败时
保留 CUA Icon,但仍显示 App 名称。
text-ui-sm,作为 App/动作正文的次级紧凑信息。left_click、right_click 和 type 完成后优先使用结果状态中目标元素的可读名称作为摘要 tag。[59] 59 (pressable) 后的“智谱 / 快速 / 订餐”显示为“智谱快速订餐”。pressable 或 editable 元素处停止,不能跨搜索结果拼接无关文本;无法得到可靠文本时继续回退到元素 index。元素 #57 / Element #57,
不直接裸露 57;已解析出的可读元素名称保持不变。pending / running 阶段只显示摘要,不提供展开入口,也不响应上层 forceOpen。CUA Group 是 V4 renderer-only 展示投影,但分组所需的 response 归属是协议事实。V4
ReasoningRow、AssistantTextRow 与 ToolCallRow 通过可选 assistantResponseId 指向 runtime 已有的
assistantMessageId;桌面 continuous 与手机 replayable 从同一有序 row 事实确定性构造 Group。
Assistant response start
── 创建稳定 ResponseEnvelope,正文正常 streaming
response 只含官方 CUA
── reasoning + message + CUA 加入或延续活动 Group
response 含非 CUA tool
── 关闭旧 Group;message/非 CUA 外置,CUA 从新 Group 开始
response 无 tool ── message 外置,response/turn 完成时关闭 Group
未分类 reasoning / message
── 外置显示,本身不关闭 Group
marker / status ── 外置显示,本身不关闭 Group
turn / work segment / user boundary
── 强制关闭 Group
assistantResponseId,不再锚定 tool call。tool-only response 才以第一条 CUA 作为视觉 fallback。CollapsibleContent、内边距或 work-items 容器。这保证
CUA 消费 message 或运行中工具延迟分类时,不会在 Group 外留下可占据间距的空 history 结构。request_access、list_apps 与其他官方 mcp__computer-use__* 一视同仁。第三方同名 MCP 按
非 CUA tool 处理。marker、todo/status 不加入且不主动关闭 Group。assistantResponseId 时只聚合 CUA tools,不猜相邻 reasoning/message,保持兼容降级。forceOpen,避免运行中被动自动展开,但不再禁用手动展开入口。<滚动内容> · N events[, M messages];完成后固定收敛为
<CUA Icon> Computer Use · N events, M messages,不再保留最后一次 App/动作内容。完成态始终
产品名走 locale,英文显示 Computer Use、中文显示 电脑控制;并显示 message 计数,包括 M=0。
N 统计 Group 内当前可见的 reasoning、CUA 与 Assistant
message;被“显示思考过程”隐藏的 reasoning 不计数,首条 reasoning 仍沿用全局可见性合同。
M 只统计 Assistant message;单复数和中文量词走 i18n。分隔点和计数不用空格字符拼接,
而是按独立布局节点展示。text-foreground-subtlest;完成态不再经过滚动摘要容器,避免空 primary slot 在产品名和分隔点
之间叠加额外间距。运行态 App/CUA icon 仍属于滚动内容,不参与文字渐变。CUA Icon + Computer Use + Action;有身份时
显示 App Icon + App Name + Action。Assistant message 不进入滚动候选、不触发滚动动画;它仍
计入 events/messages,并在展开时间线用次要文字色显示正文、不重复显示图标。App 图标
失败只回退图标,不丢失 App 名称。key 与 hold_key
在输入包含组合键时显示本地化动作加组合键 tag;list_windows 在完成结果可解析数量时
显示本地化窗口数量,任何渲染路径都不得向用户泄露 message id。shrink-0 size-4 flex items-center justify-center [&_svg]:size-4 容器:CUA fallback SVG
保持 size-4;真实 App Icon 由 CuaAppSummaryIcon 在 Group 投影时显式接收 size-5,
不使用父级 descendant selector 覆盖其默认 size-4。两者都不参与文字压缩;
图标容器与滚动文字之间使用 gap-2。size-5;
子 tool renderer 同时为图标增加 shrink-0 size-4 flex items-center justify-center
固定父容器,让 20px App Icon 以 16px 占位居中显示。普通独立 CUA tool 仍使用
默认 size-4,不额外包裹该容器;两者都不使用 CSS descendant selector 覆盖图片尺寸。in_progress 时,滚动摘要中的 App 名称与动作使用 CUA 专属旧版快速
宽光带:1s / 200% / 40%–60% 弱色带 / 0.5s delay。图标、分隔符、计数和失败状态不参与
动画;reduced-motion 下关闭滚动和渐变。success / error / cancelled 经 legacy adapter 分别对应
completed / failed / stopped。Assistant message 的 streaming、完成或失败状态都不产生滚动
key;其他活动 CUA 和 message 都不覆盖上一条终态工具摘要。events。兼容路径不能只传虚拟父节点,否则其中的 Assistant message 会在被
外层投影消费后从展开时间线消失。toolCall JSON,而不是只拆出 input/output;
toolId、工具名称、状态、raw.display、v4Status 和流式元数据属于排障所需事实。
完整数据放在二级 disclosure 中,默认保持折叠,避免影响常规详情的可读性。cuaApp 时保持现有摘要。bundle_id 可为空,名称仍可使用;Windows 的 bundle_id 可能是 AUMID。list_apps 之间被视为 Agent 最近观察到的事实;系统变化不会触发隐式刷新。