feat(browser): 完成 browser MCP 第四阶段输入能力

补齐 browser_click 的精细点击参数,并新增 browser_press_key 与 browser_scroll,继续扩展 browser MCP 的真实交互能力。
同步更新单测与浏览器自动化文档,确保 Phase 4 能力完成并通过验证。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
walker1211andClaude Opus 4.7 committed 2026-04-18 13:59:15 +08:00
1 parent cf2375e169
commit e92a2c11bf
3 files changed
+868 -25

No files matched your search

+8 -2
View File
@@ -1,6 +1,6 @@
# Browser Automation
Last Updated: 2026-04-17
Last Updated: 2026-04-18
CCS provides browser automation through two separate runtime paths:
@@ -23,7 +23,7 @@ enabled. A recent Chrome update alone is not sufficient.
The managed `ccs-browser` runtime currently exposes five tool groups:
- **Session inspection**: `browser_get_session_info`, `browser_get_url_and_title`, `browser_get_visible_text`, `browser_get_dom_snapshot`
- **Navigation and interaction**: `browser_navigate`, `browser_click`, `browser_type`, `browser_take_screenshot`
- **Navigation and interaction**: `browser_navigate`, `browser_click`, `browser_type`, `browser_press_key`, `browser_scroll`, `browser_take_screenshot`
- **Hover diagnostics**: `browser_hover`, `browser_query`, `browser_take_element_screenshot`
- **Readiness and page evaluation**: `browser_wait_for`, `browser_eval`
- **Event observation**: `browser_wait_for_event`
@@ -41,6 +41,12 @@ Phase 3 capability details:
- the same scoped-selector tools accept optional `pierceShadow: true` to search open shadow roots beneath the selected root
- `browser_wait_for_event` observes typed page or browser events for dialogs, navigation, requests, and downloads
Phase 4 capability details:
- `browser_click` also accepts optional `offsetX`, `offsetY`, `button`, and `clickCount` for more precise element-relative click control
- `browser_press_key` sends real browser-level key events, supports modifier combinations plus repeat counts, and covers a focused set of common special keys such as `Enter`, `Tab`, `Escape`, and arrow keys
- `browser_scroll` supports page-level `by-offset` scrolling and element-scoped `by-offset` or `into-view` scrolling, including same-origin iframe scoping
A common hover-debug workflow is:
1. call `browser_hover` to move the browser pointer onto the card or trigger