给 Agent 一句“查一下《网络基础》有没有库存”,需要完成的是一串具体工作:打开书店,找到搜索框,填入书名,触发查询,再确认结果对应的是这本书。网页上的某次点击成功,只能证明一个动作完成了,距离回答用户的问题还差一次结果核对。
agent-browser 把观察网页和操作浏览器整理成了命令行接口。这篇借小界和小南的一次查询,把这些接口串成一个完整任务,再说明工具与 Agent 各自承担什么。漫画中的书店、库存和命令输出均为教学示意,不是实际业务执行记录。
一句话总结
agent-browser 的核心定位是面向 AI Agent 的浏览器自动化 CLI,提供网页观察、元素引用和浏览器动作;基础命令通常由上层 Agent 决策调用。实现需要按版本区分:0.19.0 默认走 Node.js + Playwright,0.41.1 默认 Chrome 路径走 Rust daemon + CDP。
理解这项分工,才能看清两个容易混淆的问题:@e1 为什么能指向一个控件,以及执行了 click 为什么还不能直接宣布任务成功。
本文按 2026 年 11 月 1 日核验的上游 0.41.1 版本与官方文档解释,默认讨论 Chrome / CDP 路径。已有系统若固定在旧版本,需要分别核对实现,不能把新版原理直接套到旧适配器上。版本依据
定位是 Agent 工具,实现要按版本区分
“SDK 还是 Agent”混合了两个问题:SDK、CLI 描述怎样接入,Agent 描述谁承担模型决策循环。agent-browser 的核心定位是面向 AI Agent 的浏览器自动化 CLI。通常由外部 Agent 理解目标、选择命令并核对结果,工具负责观察、动作和会话。官方定位
核心命令与可选 chat 模式
snapshot、click 等基础命令不靠 LLM 决定业务下一步。0.41.1 也提供可选的 agent-browser chat:配置模型后,将自然语言转成命令并执行。因此,不能把整个项目概括为“完全没有 Agent 能力”;本文的调用链对照主要解释基础工具层,可选 chat 在其上增加模型决策入口。AI Chat 说明
旧默认路径与新默认 Chrome 路径
0.19.0 默认 CLI 路径:
外部 Agent → Rust CLI → Node.js daemon → Playwright → 浏览器
0.41.1 默认 Chrome 路径:
外部 Agent → Rust CLI → Rust daemon → CDP → Chrome
这些箭头描述 CLI 入口。若项目通过 SDK 在 Node.js 进程内直接导入 BrowserManager,则可能绕过 CLI 和独立 daemon;确认本机 CLI 版本,不能替代确认 SDK 实际解析的依赖版本。
SDK 包版本与底层浏览器包版本也要分别看。2026 年 11 月 2 日核对 npm 发布信息时,@mastra/agent-browser 的稳定版为 0.6.0,其 dependencies 仍固定 agent-browser: "0.19.0"。因此,升级这个适配器并不自动切到上游 0.41.1 默认 Chrome 的 Rust 原生路径。Mastra 适配器 0.6.0 发布元数据
关键变化包括后台运行时和浏览器控制层,不能简化成“旧版是 Node CLI,新版才有 Rust CLI”:0.19.0 的默认 CLI 就已经是 Rust;该版本还提供实验性、需选择启用的 --native Rust daemon。上表比较的是两版指定的默认路径,不代表 0.19.0 只有 Playwright,也不把 0.41.1 的其他引擎都归成 Chrome。0.19.0 架构与 native 模式、0.41.1 运行要求
两个版本的快照也不能混讲。旧路径的 ARIA snapshot 由 Playwright 生成,再加工引用;本文核验的新 Chrome 路径直接请求浏览器的原生 AX 数据,再进行工具侧整理。后者仍包含 DOM 范围筛选和其他补充处理,不能推成纯 AX-only 系统。旧版快照源码、新版快照源码
还有一个容易误判的线索:旧版 Playwright 也能通过 connectOverCDP() 连接 Chrome。看到 CDP 地址、Chrome 进程或相同的 CLI 命令,都不足以认定已经使用新版 Rust 原生路径。需要同时检查依赖版本、所选运行模式、后台进程和实际调用链;本文不据此推断两版速度或成功率。旧版 CDP 连接实现
本地 fwork-agent 接的是哪条路径
2026 年 11 月 2 日本地核对中,升级前 cofliggy-server 的锁文件和已安装依赖均为 @mastra/agent-browser 0.4.1 → agent-browser 0.19.0。Mastra 适配器在 Node.js 进程内导入 BrowserManager,项目的 BrowserRuntime 使用该 AgentBrowser 并传入 CDP 地址。这条 SDK 适配路径不必经过上面的 CLI 与独立 daemon 链路,不能将通用 CLI 示意图当成项目的逐层执行记录。升级前依赖锁定、浏览器适配入口
随后按本轮要求,将适配器升级到 0.6.0。真实浏览器测试发现它使用的 resolveLaunchViewport 在原有 @mastra/core 1.50.1 中不存在;配套升级到 @mastra/core 1.81.0 后,9 组、60 项相关测试通过,其中包含真实浏览器合成页测试,后端构建也通过。升级后实际安装的底层仍为 agent-browser 0.19.0,属于旧版 Playwright 路径。
这是本地工作区升级与验证的结果,业务仓库依赖改动尚未提交或部署,也未核对线上运行版本;验证不涵盖独立的 page-dom 后端或真实业务任务效果。
Rust + CDP 的优势与代价,分别来自哪一层
比较仍限定为前面的两条默认路径:0.19.0 的 Node.js + Playwright 后台,以及 0.41.1 默认 Chrome 的 Rust + CDP 后台。能够确认的收益是控制层运行依赖减少;控制进程是否更省内存、整个任务是否更快,需要分别测量。Chrome 仍然运行页面,上层模型仍然选择动作。
部署少一组依赖,已有服务仍要运行
小南把控制器放进设备箱,提醒小界:“这个 Rust 后台不用 Node.js、Playwright。Chrome 还是要准备。”这是对 daemon 运行要求的解释,不是整套 Agent 系统的依赖清单。
独立部署浏览器工具时,少了需要随控制层维护的 Node.js、Playwright 运行依赖。若上层 Agent 本来就在 Node.js / Mastra 服务中运行,这个服务仍然存在;其他功能若继续使用 Playwright,其依赖也不能直接删除。浏览器安装、系统依赖和账号状态同样需要处理。0.41.1 运行要求
直接控制 CDP,快照设计与实现语言分开判断
小界整理 AX 卡片时说:“直接读 AX 数据、组织引用与动作。Playwright 也能发 CDP 命令。”原生路径让 agent-browser 自己组织协议调用、节点引用和动作处理,减少对 Playwright API 及其版本的依赖;相应行为也由项目自己负责维护。原生快照实现、原生元素处理
直接使用 CDP 属于控制层的实现选择,并非 Rust 独有。Playwright 提供的 CDPSession.send() 同样可以发送原始 CDP 命令。原生 AX 数据的读取方式、快照输出的筛选与压缩、控制器使用的语言,需要分别评价:模型 token 的节省主要取决于送入模型的观察内容,不能归因于“换成 Rust”。Playwright CDPSession
自动化封装的维护责任转给原生实现
漫画中按钮被弹窗挡住,小南先停下操作:“自动等待、定位和 frame 处理,原生实现也要持续维护。”Playwright 的 click() 会检查目标是否唯一、可见、稳定、能接收事件且已启用;这是长期维护的自动化封装,直接发出协议命令不能自动获得相同行为。Playwright 自动等待
agent-browser 原生路径已经实现了引用解析和可操作性处理,不能说它完全没有等待或定位能力。取舍在于这些行为由谁实现、覆盖哪些情况、如何处理浏览器升级:采用原生路径后,需要由 agent-browser 维护对应逻辑,接入方验证任务所需的行为。Playwright 的跨浏览器抽象与调试、测试工具也不能仅凭 Chrome / CDP 路径推定已经等价替代。Playwright 浏览器支持
把控制层收益与任务收益分别测出来
小界面对两套相同的查询页面,记录的是待测项目:“控制层可能更省资源。整条任务快多少,要实测。”漫画中的仪表没有数值,不代表已经完成性能对照。
已有系统若通过 SDK 在 Node.js 进程内调用浏览器管理器,改成通过 CLI 调用 Rust daemon 时,还要把命令进程启动、参数序列化和本地 IPC 纳入比较。不能拿“旧 CLI 后台换成 Rust”的收益,直接替代这类 SDK 接入方式的评估。页面加载和模型推理若占主要耗时,控制层优化对整条任务的收益可能有限;本文没有实测数据,不给出提速或降本比例。
第一幕:把“查库存”变成网页上的动作
小界拿到的是业务目标:“查《网络基础》的库存。”小南需要把这个目标落实到页面控件:哪个输入框接受书名,哪个按钮发起查询,哪里能读到结果。
打开网页之后,snapshot 返回一份带引用的紧凑无障碍语义快照。角色和名称帮助 Agent 判断控件用途,引用则用于后续命令。snapshot -i 偏向可引用的操作目标,适合先找输入框、链接和按钮;具体保留范围见后文的裁剪说明。快照选项
下面将漫画中的操作写成命令。book.example 是示意域名,引用编号也是示例;实际使用时必须换成目标页面,并读取真实快照。
agent-browser open https://book.example
agent-browser snapshot -i
假设快照里出现“搜索书名”输入框 @e1 和“搜索”按钮 @e2,接下来可以执行:
agent-browser fill @e1 "网络基础"
agent-browser click @e2
这里发生了两次不同的转换。Agent 根据角色、名称和任务目标,选择应该操作哪个控件;agent-browser 根据引用定位元素,再完成填写或点击。控件“叫什么”有助于决策,控件“指向哪里”支撑执行,二者缺一都会影响操作。
这也解释了语义信息的价值:页面若把搜索按钮暴露成一个有明确名称的 button,Agent 就有直接证据。若它只是一块没有名称的图形,单靠这份语义观察可能无法确定用途,需要补充截图、上下文或其他受控读取。
snapshot 内部:从 AX Tree 到可操作引用
snapshot 的采集、引用管理和格式整理由工具代码完成,工具不会调用 LLM 来生成页面语义。模型得到这份观察后,再决定下一步动作。下面八格漫画将这段过程拆开,仍以本文核验的 Chrome 原生路径为准。
AX 是 Accessibility(无障碍)的常用缩写,AX Tree 即 Accessibility Tree,无障碍树。浏览器根据 DOM、原生 HTML 语义、ARIA 属性及元素状态维护这份语义表示。工具通过 Accessibility.getFullAXTree 取得节点信息,再组织角色、名称、状态和层级。指定 -s 时,会结合目标 DOM 子树筛选范围。生成引用时,后台保留引用与节点、frame 和文档的关联;后续文本中出现的 @e1 因而能回到浏览器中的具体目标。固定版本快照源码
这些信息随后按输出选项整理成紧凑文本。-i 偏向交互目标,-c 压缩空的结构分支,-d 限制展示深度。它们控制观察的体积与范围,不负责理解库存、订单等业务含义。读取 AX Tree 也不代表整套工具只使用 AX 信息:当前实现还包含 DOM 范围解析、可点击线索补充等处理,不能把这张漫画理解为纯 AX-only 约束。
执行 click @e2 时,后台解析此前保存的引用,优先尝试关联的缓存节点,再进入元素定位和可操作性处理。节点替换或文档导航会影响这项关联;角色与名称恢复存在歧义时应停止动作。引用让观察和动作有了对应关系,业务对象与最终结果仍需调用方核对。固定版本引用解析源码
Playwright 同样提供 locator.ariaSnapshot();当前文档中的 mode: "ai" 还支持带引用的 AI 快照。因此,agent-browser 的价值主要在于把观察、引用、动作命令和跨命令会话管理配套提供。两套 API 的快照引用各自属于其工具上下文,不能拿一套工具生成的编号去调用另一套工具。Playwright 快照 API
所谓“DOM 剪枝”,实际裁剪的是页面观察
面对节点很多的页面,首先要区分三个对象:浏览器正在运行的 DOM、浏览器维护的 AX 语义树,以及最后送给模型的文本快照。本文这条路径更适合称为页面观察裁剪,具体包括语义投影、结构压缩和快照输出过滤。这些处理不会把网页里的 DOM 节点删除,也不会改变页面的业务状态。
这里继续以本文固定的 0.41.1 Chrome 原生实现为依据,补充核验日期为 2026 年 11 月 2 日。漫画中的卡片和书店结果都是教学示意。
先做语义投影,再压缩结构
从 DOM 换到 AX Tree,是把页面表达成角色、名称和状态等语义信息,不是逐字缩短 HTML。随后,工具跳过部分包装节点自身,继续遍历它们的孩子;压平符合条件的单子 generic 容器;合并连续 StaticText,清除空文本和部分父子重复文本。跳过包装仍须让有效子节点进入观察,不能把整个有用分支一起丢掉。结构整理与遍历源码
这些都是工具代码执行的规则。哪些内容对“查库存”有业务意义,需要上层根据任务选择观察范围和读取方式。
按范围和用途过滤,保留必要的上下文
官方文档把 -i 概括为交互元素模式。但本文固定源码用的是 has_ref 条件,表格单元格及部分具名标题、区域也能获得引用,因此不能将它理解为“严格只剩可点击控件”。普通文字仍可能被过滤;“快照没出现”不能证明“页面没有”。官方选项、引用分配、输出与紧凑处理
哪些信息不能因为“不能点击”就丢掉
假设书店把结果标题暴露为 heading,把库存暴露为普通文本,观察可以简化表示如下。编号和值均为说明风险的例子,不是实测输出:
- heading "网络基础(精装版)" [ref=e7]
- StaticText "库存:3 本"
- button "购买" [ref=e8]
过滤后即使标题和购买按钮都留下了,库存文字仍可能消失。按钮可以定位,只说明存在一个动作目标,不能据此回答“有货”。裁剪策略至少要保住当前任务需要的三类信息:
- 动作目标与上下文:输入框、按钮、关联标签及所属区域,避免同名控件之间失去区分。
- 业务对象身份:书名、版本、规格及结果行的对应关系,避免把其他对象的库存接到当前对象上。
- 结果与约束证据:库存、价格、加载状态、禁用或选中状态、错误提示及失败原因。保留哪些字段由任务决定,不要求每次把全部页面都读进来。
DOM 节点引用也不能替代第二类信息:列表可能复用同一个节点展示另一条记录。引用仍可解析时,业务对象仍需重新核对。
信息不足就展开,验证后再结束
对于这个示意书店,可以先读操作目标,再读取结果区域。以下假设已经确认结果容器的真实选择器是 #results:
agent-browser snapshot -i
# 填写、查询后重新观察;读取结果时不带 -i
agent-browser snapshot -s "#results" -c
# 若还缺证据,取消紧凑过滤或扩大范围
agent-browser snapshot -s "#results"
观察仍不完整时,再读取已确认的结果节点文本,或结合截图检查图标、遮挡与布局。任务相关性选择和扩大观察的决策属于上层执行循环,不能假定 agent-browser 会自动理解库存验收标准。
还要分别衡量采集成本与模型输入成本:本文固定实现读取 getFullAXTree 后再组织输出。-i/-c/-d 让快照变短,不代表浏览器采集成本同比下降。评价观察裁剪,应同时检查目标控件能否找到、业务证据是否完整、任务是否正确完成,再比较 token 和延迟。
@ref 绑定页面元素,业务身份仍需核对
引用省去了为每一步重新编写 selector 的工作,但它不是商品 ID、订单号,也不是跨页面永久有效的地址。
当前官方文档的规则是:仍然存在的 DOM 元素可以在后续快照和同一文档更新中保留引用;页面或 iframe 导航、元素替换会影响引用有效性。没有对应 DOM 节点的虚拟无障碍节点,其引用只适用于当前快照。导航之后必须重新读取快照,交互之后也应重新观察页面变化。引用生命周期
因此,稳定的节点引用也不能独立证明业务对象没变。列表可能复用同一个 DOM 容器展示另一条记录;“购买”按钮可能仍然存在,但页面当前商品已经不同。执行涉及具体对象的动作之前,还需要核对书名、商品规格、订单号等任务条件。
重新观察的目的包括获取可用引用,也包括更新决策证据。即使 @e1 仍然有效,页面条件也可能已经不允许继续执行原计划。
第二幕:点击之后,验证用户要的结果
查询触发后,下一步通常是读取结果。这里有一个实际影响验收的过滤条件:snapshot -i 偏向可引用的操作目标,“有货”这样的普通结果文字可能被排除;某些标题和表格单元格能够留下,也不保证所需字段完整。找动作目标时可以压缩观察,检查业务结果时则需要保留相关正文、状态或表格内容,不能把“交互快照里没出现”理解为“页面没有”。
漫画中重新读取完整快照,假设结果标题(heading)包含“网络基础:有货”,并获得引用 @e7,才继续读取它的文本。普通文本并不保证获得独立引用,实际使用时要依据快照中暴露的结果标题、区域或表格单元格定位内容:
agent-browser snapshot
agent-browser get text @e7
上层循环还需要把读取结果与任务对照:书名是否正确,是否区分版本,库存是否对应当前地区,结果是否已经加载完成。对于这个简化任务,“书名匹配且库存明确”可以构成完成条件;真实书店若按门店、配送地区或规格区分库存,就必须补齐这些条件。
截图提供另一类证据。screenshot --annotate 会在交互元素上叠加编号,编号 [N] 对应引用 @eN,用于结合视觉画面判断目标。带标注的截图
agent-browser screenshot --annotate page.png
截图能帮助判断图标、布局和视觉遮挡;是否将它作为模型输入、怎样结合语义结果,仍由调用方决定。给一个查询结果截了图,也不代表系统已经完成业务核验。
动作失败时同样需要观察。弹窗遮住按钮,应先确认弹窗内容并按任务允许的方式处理,再重新读取页面。若请求超时而动作效果未知,应先检查页面是否已经发生变化。尤其是提交、支付、删除等操作,不能仅凭未收到成功响应就重复执行。官方命令与超时说明
第三幕:Rust CLI、daemon 和 CDP 怎样分工
当前上游采用 client-daemon 架构。Rust CLI 解析命令并与 Rust daemon 通信,daemon 直接使用 CDP 驱动默认 Chrome 路径。后台在首次命令时自动启动,并在命令之间延续,避免把每条命令都处理成一次全新的浏览器任务。原生 daemon 运行时不需要 Node.js 或 Playwright;这句话描述的是当前实现,不代表所有基于 agent-browser 的历史封装也移除了这些依赖。官方架构说明
CDP 是 Chrome DevTools Protocol,即浏览器暴露的调试与控制协议。本文用它解释默认路径;不能据此推导所有浏览器后端都使用相同协议。
还要区分新旧实现。本站《只用 Accessibility Tree,浏览器 Agent 能走多远?》核验的是 @mastra/agent-browser 0.4.1 与 agent-browser 0.19.0 的组合,那条路径通过 Playwright ariaSnapshot() 生成工具快照。本文核验的上游 0.41.1 Chrome 原生路径直接读取 CDP AX Tree。工具名和命令相似,不能代替对依赖版本及真实调用链的检查。
会话延续、状态恢复与账号隔离要分别判断
漫画最后让任务收尾,是因为完成目标之后还要处理浏览器资源。同一会话可以延续此前的页面状态;使用命名会话时,后续操作也要保持相同的会话标识。
agent-browser --session books open https://example.com
agent-browser --session books snapshot
agent-browser --session books close
这组命令可以用于观察一个真实公开页面的会话操作,但不包含漫画中的库存查询逻辑。安装与浏览器准备应先按官方安装文档完成。
会话仍在运行、浏览器关闭后能恢复状态、两个账号完全隔离,是三个不同要求。官方说明,各会话分别启动浏览器时拥有独立状态;多个会话通过 --cdp 连接同一个 Chrome 时,不能仅靠不同会话名推断 Cookie 等状态完全隔离。跨次恢复则需要按实际需求配置 profile、保存状态或恢复机制。会话与隔离边界
接入多任务系统前,应先决定浏览器归谁管理、任务绑定哪个 tab、完成和异常时怎样释放,以及下次启动允许恢复哪些状态。复用一个有登录态的浏览器很方便,也意味着调用方需要了解它当前关联的账号与数据范围。
接入前,用四种变化检查执行循环
漫画展示的是简化任务。把它迁移到真实页面之前,可以用下面四类变化检查系统有没有保留足够的证据。这是建议的验收方法,不是本次已经完成的测试结果。
这些检查比单独记录“能不能点到按钮”更接近 Browser Agent 的任务质量。后续若比较速度、token 或费用,还需要固定任务、页面状态和完成条件,并将失败与恢复过程计入;本文没有进行这样的性能对照,不据此给出降本或提速比例。
我的判断框架
agent-browser 适合为已经具备命令调用能力的 Agent 提供统一的网页观察与操作接口。评估接入价值时,我会先看三项条件:页面语义是否足够表达目标,引用与页面状态能否持续对应,以及结果是否有可检查的完成标准。
如果任务需要根据页面实时变化选择下一步,这些接口能提供执行循环所需的基础。若流程长期固定、定位条件清晰、主要目标是回归测试,也可以继续使用现有自动化测试工具,不必为了引入 Agent 而改写成熟流程。
接入后的验收重点应落在具体对象和完成条件上:选中的是哪一本书,读到的是哪个地区的库存,失败后有没有重复产生副作用,以及任务结束后浏览器资源是否按约定处理。工具提供了观察与动作,可靠的任务交付需要把这些证据组织起来。
资料与核验范围
本文是基于官方文档与固定源码版本的机制解析,漫画为原创教学插画。未宣称执行真实书店查询,也未把本文内容视为小界项目已经接入该上游版本的证明。
本文使用 writting-skill 辅助写作,配图使用 better-imagegen 生成。项目已开源,欢迎在 GitHub 点个 Star。
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
One sentence to Agent, “Check whether the Web Foundation is in stock”, requires a set of specific tasks: opening the bookshop, finding a search box, filling in a book name, triggering a query and confirming that the results correspond to the book. One successful click on the web page could only prove that one action had been completed and that there was still one check of results that fell short of answering user questions.
Agent-browser organized the observation page and the operating browser into the command line interface. This piece uses a small-scale and Nam query to string these interfaces into a complete task, and to explain what each tool and Agent are doing. Bookshops, inventory and command output in comic books are teaching signs, not actual business execution records.
Summary
Agent-browser's core location is the Automation CLI of the browser for AI Agent, which provides web observations, element references and browser actions; basic commands are usually called by the Upper Agent decision. Achievement needs to be differentiated by version: 0.19.0 Default to go Node.js + Playwright, 0.41.1 Default to walk Rust daemon + CDP.
To understand this division of labour, two easily confusing issues can be identified: @e1 Why can you point to a control and why can't you just declare the mission successful?
This paper is interpreted as an upstream version of 0.41.1 from November 1, 2026 and as an official document. The existing system, if fixed in the old version, needs to be checked separately and the new version of the doctrine cannot be applied directly to the old adapter. Version by
Positioning is an Agent tool, and achieves a distinction by version
"SDK" or "Agent" mixes two questions: SDK, CLI describes how to access, and Agent describes who is responsible for model decision-making. The core location of ant-browser is the automated CLI browser for AI Agent. External Agent usually understands the target, selects the command and checks the results, and the tool is responsible for observation, action and session. Official positioning
Core Command and Optional Chat Mode
Base commands such as snapshot and click do not depend on LLM for operational next step. 0.41.1 An optional agent-browser Chat: The configuration model converts the natural language into a command and execution. Therefore, the entire project cannot be summed up as “no Agent capacity at all”; the call chain of this paper contrasts the main interpretation base layer, with the option of chat adding model decision-making portals to it. AI Chat Note
Old Default Path and New Default Chome Path
Default CLI path:
External → Rust CLI → Node.js daemon → Playwright → Browser
0.41.1 Default Chome Path:
External
These arrows describe the CLI entrance. If the project is imported directly into the Node.js process, the BrownerManager may be bypassed by CLI and independent daemon; confirming this CLI version is not a substitute for confirming a dependent version of the SDK actual resolution.
The SDK package version will also be viewed separately from the bottom browser package version. On November 2, 2026, when checking the npm publish information, the stable version of @mastra/agent-browser was 0.6.0 and its depentencies remained fixed anent-browser: "0.19.0". Therefore, upgrading this adapter does not automatically cut upstream 0.41.1 by default the Rust primary path of Chrome. Mastra adapter 0.6.0 publish metadata
Key changes include running backstage hours and browser controls, which cannot be simplified to "old version is Node CLI, new version has Rust CLI": the default CLI of 0.19.0 is Rust; the version also provides experimental, optional -- native Rust daemon. The above table compares the two versions of the specified default path, which does not represent 0.19.0 except Playwright, and does not attribute the other engines of 0.41.1 to Crome. 0.19.0 Structure and native mode, 0.41.1 running requirements
The snapshots of both versions cannot be mixed. The ARIA snapshot of the old path is generated by Playwright, reprocessing references; the new Chrome path verified here directly requests original AX data from the browser and then goes to the tool side. The latter still includes a DOM range filter and other additional processing, which cannot be extrapolated to a pure AX-only system. Old and new.
And there's another clue that can easily be miscalculated: the old Playwright can also be connected to Chrome via conectOverCDP(). Sees the CDP address, the Chome process, or the same CLI commands are not sufficient to conclude that a new version of Rust's original path has been used. There is a need to check both the dependent version, the selected mode of operation, the backstage process and the actual call chain; this paper does not extrapolate the speed of the two editions or success rate. Old version of CDP connection achieved
Which path to take local work-agent
In Japan's field check on November 2, 2026, prior to the upgrade, the lock files and installed depend on @mastra/agent-browser 0.4.1 @at-browser 0.19.0. The Mastra adapter imports BrownserManager within the Node.js process, and the Browner Runtime of the project uses the AgentBrowser and uploads the CDP address. This SDK adaptable path does not need to go through the above CLI link with the independent daemon, and the generic CLI diagram cannot be used as a layer-by-layer execution record. Prior to upgrade, rely on lock, browser adaptor portal
The adaptor is then upgraded to 0.6.0 as required in this cycle. The real browser test found that it used a resolve LaunchViewport that did not exist in the original @mastra/core 1.50.1; the package was upgraded to @mastra/core 1.81.0, and the relevant tests were passed for 9 groups, 60 related tests, which included a real browser synthesis page test and backend construction was passed. The floor of the upgrade actually installed is still agent-browser 0.19.0 and belongs to the old Playwright path.
This was the result of the upgrading and validation of the local workspace, which relied on changes that had not yet been submitted or deployed and did not check on-line operating versions; the validation did not cover independent page-dom backends or real-life tasks.
Rust + CDP strengths and costs, from which floors
Compares the two default paths that are still limited to the front: Node.js + Playwright backstage for 0.19.0 and Rust + CDP backstage for 0.41.1 default Chome. The identifiable benefits are reduced reliance on the operation of the control layer; whether the control process saves more memory and the entire task is faster, and needs to be measured separately. Chrome still runs the page and the upper model still selects action.
Deployment of a small group of dependents, with existing services still operational
Nam put the controller in the device box and reminded the small area: “This Rust backstage is not for Node.js, Playwright. Chrome still has to prepare." This is an explanation of the daemon running requirements, not the entire Agent dependency list.
The independent deployment of browser tools is less dependent on Node.js, Playwright operations that require maintenance with the control layer. This service still exists if the upper layer Agent is already operating in the Node.js / Mastra service; if other features continue to use Playwright, their dependence cannot be removed directly. The browser installation, system dependence and account status also require processing. 0.41.1 Operational requirements
Direct control of CDP, symmetrically separated from actual language
The small field organized the AX card and said, "Read directly AX data, organize references and actions. Playwright can also issue CDP commands." The primary path allows angent-browser to call, quote and act on his own organization protocol, reducing dependence on Playwright API and its version; the corresponding behaviour is also maintained by the project itself. Native snapshots, processing of raw elements
Direct use of CDP is a controlled level realization option and is not unique to Rust. Playwright provides CDPsession.send() which also sends original CDP commands. The language used for the reading of raw AX data, the filtering of snapshot output and compression, and the controller need to be evaluated separately: the savings of the model token depend primarily on the observations sent to the model and cannot be attributed to the “replacement of Rust”. Playwright CDPSsession
Transfer of maintenance responsibility for automated encapsulation to original realization
The buttons in the comic book are blocked by a bullet window and Nam stops operations: "Autowaiting, positioning, and frame processing, with continuous maintenance of the original." Playwright's click() check if the target is unique, visible, stable, able to receive an event and is enabled; this is an automated seal maintained for a long time, and direct agreement orders cannot automatically obtain the same behaviour. Playwright waits automatically
Angent-browser's original path has been referencing resolution and operationalization and cannot be said to have no waiting or positioning capability at all. The trade-off lies in who these acts are carried out, what they cover, how to handle browser upgrades: after the original path is adopted, it will be necessary to maintain a correspondence logic by an individual-browser and the accessor will verify the behaviour required for the mission. Playwright 's cross-browser abstract and debugged, test tool cannot be replaced by a mere Chrome/ CDP path presumption. Playwright Browser Support
I want you to measure the proceeds of the control layer and the mission.
The small interface is for two identical query pages, recording items to be tested: “The control layer may be more resource-efficient. How fast is the whole mission? There are no values in the caricatures, which does not mean that the performance is complete.
An existing system that calls the browser manager within the Node.js process to call Rust Daemon via the CLI also uses the command process to start, sequence and include local IPCs in the comparison. An assessment of this type of SDK access cannot be directly replaced by the return of the old CLI backstage to Rust. If page loading and model reasoning are mainly time-consuming, the benefits of control-level optimization for the entire task may be limited; this paper does not measure data, and does not give speed or drop ratios.
Act one: turn inventory into a web-based move
What the small community has is the operational objective: “Check the inventory of Web Foundation”. Nam needs to implement this target to the page control: which input box accepts the book name, which button initiates the query, and where the results can be read.
When you open the web page, snapshot returns a compact, accessible semantic snapshot with references. Roles and names help Agent judge the use of the control and references are used for subsequent commands. snapshot -i biass the action targets that can be cited and is suitable for first searching input boxes, links and buttons; the specific scope of the reservation is specified in the later crop description. Snapshot Options
The operations in the comics are written as commands below. Book.example is an indicative domain name, and the reference number is an example; it must be replaced with the target page and read the real snapshot.
agent-browser open https://book.example
agent-browser snapshot -i
Assuming that the search book name input box @e1 and the search button @e2 appear in the snapshot, you can execute:
@e1 "Web Foundation"
agent-browser click @e2
There have been two different conversions. Agent selects which controls should be operated by character, name and task target; angent-browser completes or clicks on the reference location element. The control's "whatever it is" helps to make decisions, and the control's "where it points" supports execution, and the absence of either affects the operation.
This explains the value of semantic information: if the page exposes the search button to a clearly named button, Agent has direct evidence. If it is only a graphic without a name, this semantic observation alone may not be able to determine its use and require additional interdiction, context or other controlled reading.
snapshot internal: from AX Tree to actionable reference
The collection, reference management and formatting of snapshot is done by a tool code that does not call LLM to generate page syntax. Once the model has this observation, it is decided to move next step. The following eight comic strips tear the process apart and continue to follow the Chrome original path verified here.
AX is the commonly used abbreviation for Accessibility, AX Tree, or Accessibility Tree. Browser maintains this semantic expression according to DOM, native HTML, ARIA properties and element status. The tool captures node information through Accessibility.getFullAXTree, reorganizing roles, names, status and hierarchy. When you specify -s, the target DOM subtree is selected. When generating a reference, the background maintains the reference to the node, frame and document; the @e1 appearing in the subsequent text returns the specific target in the browser. Fixed version of snapshot source code
This information is then organized into compact text by output options. -i Oppose interactive targets, --c compressed empty structural branches, --d limit depth of presentation. They control the volume and scope of observations and are not responsible for understanding business implications such as inventory, orders, etc. Reading AX Tree does not mean that only AX information is used for the whole set of tools: current realization also includes a DOM range resolution, click lines supplement, etc., which cannot be understood as a pure AX-only constraint.
When performing click@e2, the background parses previously saved references, giving priority to the associated cache node, and then enters the element positioning and operationalization. Node replacement or document navigation will affect this association; action should be stopped if there is a discrepancy between role and name restoration. Quoting allows for a correspondence between observation and action, and there is still a need to reconcile the target with the end result. Fixed version reference resolve source
Playwright also provides locator.ariaSnapshot(); the mode: "ai" in the current document also supports an AI snapshot with reference. Therefore, the value of angent-browser lies mainly in the provision of observation, quotation, action command and cross-command session management packages. Two sets of API snapshots refer to context, each of which belongs to their tool, and cannot call another set of tools with a number from one set of tools. Playwright, aPI.
The so-called "DOM Crop" is actually a page view.
Faced with a large number of pages, three objects are to be distinguished: the Dom that the browser is running, the AX semantic tree that the browser maintains, and the text snapshot that is finally sent to the model. This path is better known as page observation cropping, including semantic projection, structure compression and snapshot output filtering. These treatments do not remove the DOM node from the web page or change the business status of the page.
It continues to be based on the original realization of 0.41.1 Crome, which is fixed here, with a supplementary verification date of 2 November 2026. The cartoons and bookstore results are indicative.
A semantic projection, then a compressed structure.
The switch from DOM to AX Tree is to create syntax information about the role, name and status of the page sheet, not to shorten HTML word for word. Subsequently, the tool skips part of the packaging node itself and continues to travel through their children; flattens the eligible individual generic packagings; consolidates continuous StaticText and clears empty text and parts of the parent-child duplicate text. Skipping packagings must still allow valid subpoints to be observed and the entire useful branch cannot be lost together. Structure and Run Source
These are the rules of the tool code. What is of operational relevance to “check-in-the-stock” requires a mission-based choice of observation scope and mode of reading.
context as required by range and use
The official document summarizes -i as an interactive element mode. However, the text's fixed source code is used under the Has ref condition, and table cells and parts of the table can also be cited under the title and area, so it cannot be understood as "a strictly clickable control only". Normal text may still be filtered; " no snapshot " does not prove " no page ". Official options, reference distribution, output and compact processing
What information can't be lost because you can't click?
Assuming that the bookshop exposed the results to headings and exposed the inventory to normal text, observations could be simplified to indicate the following. Numbering and values are examples of risk and are not measured outputs:
- Heating "Web Foundation."
- StaticText.
- Button, buy.
Even if the title and the purchase button are left after filtering, the inventory text may disappear. Buttons can be located to indicate the existence of only one action target, which is not the basis for the answer " available ". The strategy should preserve at least three types of information required for the current mission:
- Action target and context: Enter boxes, buttons, associated labels and areas to which they belong, avoiding a loss of distinction between controls of the same name.
- The identity of the target audience: the title, the version, the specifications and the correspondence of the results line, avoiding the transfer of the inventory of other objects to the current object.
- Result and restraining evidence: inventory, price, loading status, disablement or selection status, error hint and cause of failure. Which fieldes are retained is determined by the task and does not require that all pages be read in each and every time.
The DOM node reference is not a substitute for the second type of information: the list may repeat another record with the same node. When references are still decipherable, the client needs to be re-reconciled.
If there's not enough information, go ahead and check it out.
For this signshop, the target can be read before the result area. The following assumption has been made that the result container's real chooser is #results:
agent-browser snapshot -i
# Filling in, re-observing after searching; without reading the results - i
agent-browser snapshot -s "#results" -c
# If there's still no evidence, cancel the filter or expand it
agent-browser snapshot -s "#results"
If the observation is still incomplete, read the confirmed result node text, or check the icon, mask and layout in conjunction with the screenshot. The choice of mission relevance and the decision to expand the observation belong to the upper implementation cycle, and it cannot be assumed that ant-browser automatically understands inventory acceptance criteria.
The cost of collecting and the cost of entering models are also measured separately: this paper fixes access to getFullAXTree before organizing the output. -i/-c/-d to make snapshots shorter, which does not mean that the cost of the browser collection is decreasing at the same time. The evaluation of the cut-off should be accompanied by an examination of the availability of the target control, the completeness of the business evidence, the correct completion of the task, the comparison of token and the delay.
@ref binding page elements, business identity still needs to be checked
The citation omitted the rewriting of the selfctor for each step, but it was not a commodity ID, an order number, or a permanent cross-page address.
The rule of the current official document is that the DOM elements that remain can be retained in a subsequent snapshot and in an update of the same document; the page or frame navigation, the replacement of elements, will affect the validity of the reference. There is no virtual accessibility node corresponding to the DOM node, and its reference only applies to current snapshots. After navigation, the snapshot must be read again, and after interaction, changes in the page should also be observed. Reference life cycle
Thus, a stable nodal reference cannot independently prove that the target audience has not changed. The list may be repeated in the same DOM container to display another record; the Purchase button may still exist, but the current product on the page is different. Task conditions such as book names, commodity specifications, order numbers, etc., also need to be checked before actions involving specific objects are carried out.
The purpose of the re-observation was to obtain available references and also to update the evidence for decision-making. Even if @e1 is still valid, the page conditions may no longer allow the plan to continue.
Act 2: After clicking, verify the results of the user
When a query is triggered, next step usually reads the result. Here is a filter condition that actually affects acceptance check: snapshot-i tends to favour actionable targets, and ordinary result text such as "with goods" may be excluded; certain headings and table cells can remain and do not guarantee the integrity of the required field. Action targets can be looked at in a condensed manner, and the results of operations need to be checked with the relevant text, status or table content and cannot be understood as " no interactive snapshot ".
The comic book rereads the full snapshot, assuming that the headline of the result (heating) includes “Web Foundation: There's a good deal” and is quoted @e7 to continue reading its text. Normal text does not guarantee an independent reference and is actually used to locate the contents of the result header, section or table cells exposed in the snapshot:
agent-browser snapshot
agent-browser get text @e7
The upper cycle also needs to compare the reading results with the mission: whether the book name is correct, whether the version is different, whether the inventory corresponds to the current area, and whether the results have been loaded. For this streamlined task, “book name matching and clear inventory” can constitute a condition for completion; if a real bookshop separates its inventory by door, distribution area or specification, these conditions must be filled.
The screenshot provides another type of evidence. The screenshot-annotate superimposes the numbering of the interactive elements, [N] corresponding to the reference @eN, which is used to judge the target with visual images. Interception with labels
agent-browser screenshot --annotate page.png
The screenshot helps judge icons, layouts and visual masks; whether or not to input them as models and how to combine semantic results is still determined by the caller. The fact that the results of a query were captured does not mean that the system has completed its operational verification.
The same needs to be observed when actions fail. The bullet window covers the button, after which the contents of the bullet window should be confirmed and processed in the manner permitted by the mission, before rereading the page. If timeout is requested for an unknown action, check if the page has changed. In particular, the processes of submission, payment, deletion and so on cannot be repeated simply by not receiving a successful response. Official orders and timeout statements
Act 3: Rust CLI, Daemon and CDP
The current upstream structure uses the cent-daemon structure. Rust CLI parsing command and communicating with Rust daemon, daemon directly using the CDP driver 's default Chrome path. The backstage automatically starts at the first command and continues between the commands, avoiding processing each command into a completely new browser task. Native daemon does not need Node.js or Playwright to run; this phrase describes current realization and does not mean that all historical encapsulations based on ant-browser remove these dependencies. Description of official structure
CDP is Chrome DevTools Protocol, the debugging and control protocol exposed to the browser. This document explains the default path; this does not induce all browser backends to use the same protocol.
There is also a distinction between old and new achievements. How far can it go? Checks the combination of @mastra/agent-browser 0.4.1 and anent-browser 0.19.0, the path produces tool snapshots via Playwright ariaSnapshot(). Upstream of this verification is 0.41.1 Crope, which is read directly by the CDP AX Tree. Toolnames are similar to commands and are not a substitute for checking on versions and authentic call chains.
The duration of the session, recovery and isolation of accounts are judged separately.
The comic book ended the task because of the browser's resources after the completion of the target. The same session can continue the previous page status; when a named session is used, the subsequent operation will maintain the same session identifier.
agent-browser --session books open https://example.com
agent-browser --session books snapshot
agent-browser --session books close
This group of commands can be used to observe a real open page session, but does not contain inventory search logic in comics. Installation and browsing preparation should be completed on the basis of official installed documents.
The sessions were still running, the browser was able to recover after closing, the accounts were completely isolated, and three different requirements were required. Officially, each session is independent when starting the browser separately; when multiple sessions are connected to the same Chrome via --cdp, it cannot be inferred that Cookie etc. is completely isolated by a different session name. Cross-restoration requires the configuration of the programme, storage or recovery mechanism according to actual needs. Meetings and separation of borders
Before accessing the multi-task system, it is important to decide who is managing the browser, which tab the task binds, how to release it when it is completed and unusual, and what status is allowed to return to next launch. Re-use of a login browser is easy and means that callers need to know the account number and range of data that they are currently associated with.
Check the cycle with four changes before accessing.
The comic book shows a simplified task. Before moving it to a real page, the following four types of changes can be used to check whether the system retains sufficient evidence. This is the recommended acceptance check methodology and is not the result of this completed test.
These checks are closer to the task quality of Browner Agent than the single recording of " Whether to click the button ". If you compare speed, token or cost, you also need to fix tasks, page status and completion conditions, and take failure and recovery into account; no such performance comparison is made in this paper, and no reduction or acceleration ratio is given.
My judgment framework.
Angent-browser is suitable for providing a unified web-based observation and operational interface for Agent, which already has command call capability. When assessing the value of access, I will first look at three conditions: whether the synonym of the page is sufficient to express the goal, whether the reference corresponds to the continued status of the page, and whether the result has a testable completion standard.
If the task requires the selection of next step on the basis of real-time changes on the page, these interfaces provide the basis needed to implement the cycle. If the process is long-term fixed, clearly positioned and the main objective is regression testing, existing automated testing tools can also be continued without the need to rewrite mature processes in order to introduce Agent.
The focus of acceptance check after access should be on specific objects and completion conditions: Which book was selected, which region was read, whether or not there were side effects of failure and whether the browser resources were treated as agreed after the mission. The tools provide observations and actions, and reliable mission delivery requires that the evidence be organized.
Information and scope of verification
This document is based on the analysis of the official document and the fixed source version, which is an original teaching illustration. There is no claim that the real bookstore search was carried out, nor is the content of the paper considered as evidence that the small boundary project had access to the upstream version.
This paper is written with writting-skill aids, and the map is generated with better-imagegen. The project is open and welcome to the GitHub point Star.
Auto-fetched and translated by AI Atlas. All rights belong to the original author.