ZCode 的内置浏览器支持在桌面端把网页元素加入聊天上下文。
EmbeddedBrowserPane 通过 Electron webview.executeJavaScript 临时注入 picker。zcode:web-element-context-add-to-chat 事件。V4 不新增协议字段,web element context 仍然是 prompt 文本上下文;chip 只是 composer 与 transcript 的可视化外壳。
EmbeddedBrowserPane
-> zcode:web-element-context-add-to-chat
-> ConversationComposer/useWebElementContexts
workspaceKey = workspaceIdentity?.trim() || workspacePath
transient in-memory contexts[]
-> WebElementContextAttachmentChip
-> submit:
visible text + buildPromptWithWebElementContexts(...)
contextAttachmentCount > 0
-> SessionPane:
parseV4VisibleSlashCommand(..., { contextAttachmentCount })
contextAttachmentCount > 0 => do not consume /goal or /compact locally
-> createSession/sendText
-> ConversationRowView:
parsePromptWebElementContexts(row.text)
visible content + read-only WebElementContextAttachmentChip
contextAttachmentCount 只用于 app 侧 slash-command 保护,不进入 v4 protocol payload。row.text,因此 Markdown context block 不会丢失。webview 内,不经过 host process 或 service。workspaceIdentity?.trim() || workspacePath 归属当前 workspace。workspaceIdentity;禁止只按 workspacePath 过滤 context。All large text fields are truncated before entering the prompt.