在原有只读抓取 (browser_fetch_page) 基础上,新增 observe→act 循环, 让 Agent 能在用户的 Chrome 中实际操作网页:点击/输入/滚动/等待/页内跳转。 后端: - 新工具 browser_act,按 session 复用标签页,返回带编号的可交互元素清单+正文 - browser_context 任务队列扩展 kind/session_id/action 与 observation 结果 - /api/browser-context 路由下发 act 任务、接收 observation - BrowserContextConfig 增加 actions_enabled 等开关,tools.py 两级门控 - 接线 app.py 路由挂载、app_config.py 配置字段、config.yaml 工具注册 前端: - ChatPage 处理「发送当前页」回跳的 browser_context query 参数并自动提交 扩展 (browser-extension/deer-web-clipper): - shared.js 自包含注入函数 deerObservePage / deerPerformAction - background.js 按 kind 分发任务,session→tab 映射存 chrome.storage.session 测试:tests/test_browser_act.py(队列往返 + 工具校验 + 模拟扩展成功路径,8 passed) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
25 lines
672 B
JSON
25 lines
672 B
JSON
{
|
|
"manifest_version": 3,
|
|
"name": "zncm Web Clipper",
|
|
"version": "0.2.0",
|
|
"description": "Send pages to zncm and execute browser-backed fetch tasks.",
|
|
"permissions": ["activeTab", "alarms", "cookies", "scripting", "storage", "tabs"],
|
|
"host_permissions": ["<all_urls>"],
|
|
"background": {
|
|
"service_worker": "background.js"
|
|
},
|
|
"action": {
|
|
"default_title": "zncm Web Clipper",
|
|
"default_popup": "popup.html"
|
|
},
|
|
"options_page": "options.html",
|
|
"content_scripts": [
|
|
{
|
|
"matches": ["http://*/*", "https://*/*"],
|
|
"js": ["config.js", "shared.js", "content.js"],
|
|
"run_at": "document_idle",
|
|
"all_frames": false
|
|
}
|
|
]
|
|
}
|