Skip to content

feat(web): turn web_research into a general read-only browser agent - #7

Merged
Verlintas merged 1 commit into
mainfrom
feat/web-agent-v2
Nov 7, 2026
Merged

Verlintas merged 1 commit into
mainfrom
feat/web-agent-v2

Conversation

@Verlintas

Copy link
Copy Markdown
Owner

目标

让 web_research 真正成为通用只读浏览器代理,而不是平台白名单。

能力

  • snapshot:开放 shadow DOM、同源 iframe、滚动/表单/frame 状态;元素带 inputType / disabled / checked / value / frameUrl。
  • 动作:open / snapshot / read / click / type / press / select / check / scroll / wait / back / forward / reload / network / show_to_user / hide。
  • 自动等待:open / click / type / back / forward / reload 后按 readyState + 文本/节点数稳定等待,SPA 不再依赖固定 sleep。
  • 状态提示:READY / LOGIN_REQUIRED / CAPTCHA / CONSENT_REQUIRED / BLOCKED / EMPTY,并给出下一步建议。
  • 正文提取:read 选择 article/main 等高文本密度区域,忽略导航/页脚。
  • network:列出最近 fetch/XHR/API URL,模型可以直接 open JSON/API URL 读取响应。
  • 只读守卫:按钮 / Enter / GET 链接命中发送、发布、购买、删除、关注等标签或路径时返回 Denied;普通链接和搜索仍允许。best-effort,不是浏览器沙箱。
  • DOM 边界:开放 shadow DOM 和同源 iframe 可读;跨域 iframe / closed shadow root 只列 URL。

验证

  • test / lintDebug / assembleDebug / assembleRelease、许可证头、三语 strings、58 工具 schema 全过。
  • API 35 模拟器本地套件:
    • shadow DOM 按钮、同源 iframe 链接 snapshot/click;
    • 搜索表单 type + Enter 提交;checkbox/select;back/forward/reload;
    • read 正文提取;network 列出 /api/data.json;wait 匹配延迟结果;
    • login/captcha/consent/blocked 状态识别;
    • 点击 Post、GET /like、/follow 均 Denied;密码输入/Enter 均 Denied;
    • 内部滚动容器 scroll ref=... 与窗口 scroll 均生效。
  • HN / Reddit 真站仍待回归;不把维护者账号或单一设备作为发布门槛。

说明

这是给所有用户的通用能力:任何用户用自己的账号登录;登录态只留在本机;设置 → 存储可一键清除网页数据。

Traverse open shadow DOM and same-origin iframes, report scroll/form/frame state, add press/select/check/history/network/article-read actions, auto-settle after navigation, emit semantic page states, and add a best-effort read-only guard for buttons, Enter and state-changing GET links. Add page-state tests and update the web research docs.
@Verlintas
Verlintas merged commit cfce20c into main Nov 7, 2026
1 check passed
@Verlintas
Verlintas deleted the feat/web-agent-v2 branch November 7, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant