PinchTab Browser Ops
Use PinchTab as the default browser-control path.
Workflow
1. Start and verify PinchTab Navigate and snapshot page structure Operate elements by refs (click/fill/press) from fresh snapshots Verify outcome with text, URL, and key UI markers
1) Instance lifecycle policy (mandatory)
Always reuse existing running instance first.
Rules:
- Reuse current running instance/profile whenever it is operable. Launch a new instance only when no operable instance exists. Do not close browser instances after task completion. Keep the instance alive for subsequent tasks and state continuity.
Check state first:
CODEBLOCK0
Only if unavailable, start service/instance:
CODEBLOCK1
2) Navigate and map page
Open the target page:
CODEBLOCK2
Get actionable structure (preferred):
CODEBLOCK3
Use pinchtab find "<label>" if the page is large, then confirm with a fresh snap before action.
3) Operate safely by refs
Prefer deterministic commands:
CODEBLOCK4
Rules:
- Re-snapshot after each major state change (modal open, route change, submit, tab switch). Insert a short stabilization delay (1-2s) between critical actions on dynamic pages. Do not reuse stale refs after navigation or rerender. Retry at most 2 times with fresh snap; then ask for human intervention.
4) Verify and finish
Always validate completion using:
CODEBLOCK5
Check at least one concrete success signal (for example: “草稿箱(1)”, “保存成功”, changed URL, expected title).
Login/CAPTCHA policy
- Require user to complete login, QR scan, SMS code, CAPTCHA, or 2FA manually in local browser. Do not request, store, or relay one-time codes. Resume automation only after user confirms “已登录”.
Fallback policy
If strict nav/snap/find/click/fill/press/text cannot progress:
1. Recheck page state and auth state. Ask user for one manual step (focused unblock only). Use eval only when explicitly approved and only for short-lived unblock; revert to normal flow immediately.
Resource map
- 小红书长文发布标准流程(标题<=20、正文描述、话题、暂存离开): INLINECODE8
PinchTab 浏览器操作
使用 PinchTab 作为默认的浏览器控制路径。
工作流程
1. 启动并验证 PinchTab 导航并快照页面结构 基于最新快照通过引用操作元素(click/fill/press) 使用 text、URL 和关键 UI 标记验证结果
1) 实例生命周期策略(必选)
始终优先复用已有的运行实例。
规则:
- 只要当前运行实例/配置文件可操作,就复用该实例。 仅当没有可操作的实例时,才启动新实例。 任务完成后不要关闭浏览器实例。 保持实例存活,以便后续任务和状态连续性。
首先检查状态:
bash
pinchtab health
pinchtab instances
pinchtab tab list
仅当不可用时,启动服务/实例:
bash
pinchtab server
然后仅在需要时启动实例
2) 导航并映射页面
打开目标页面:
bash
pinchtab nav
或
pinchtab nav --new-tab
获取可操作的结构(推荐):
bash
pinchtab snap -i -c
如果页面较大,使用 pinchtab find ,然后在操作前用新的 snap 确认。
3) 通过引用安全操作
优先使用确定性命令:
bash
pinchtab click
pinchtab fill [ ...]
pinchtab press [ Enter]
规则:
- 每次重大状态变化后(弹窗打开、路由变化、提交、标签页切换)重新快照。 在动态页面的关键操作之间插入短暂的稳定延迟(1-2秒)。 导航或重新渲染后不要使用过时的引用。 最多重试 2 次,每次使用新的 snap;然后请求人工干预。
4) 验证并完成
始终使用以下命令验证完成情况:
bash
pinchtab text
pinchtab tab list
检查至少一个具体的成功信号(例如:草稿箱(1)、保存成功、URL 变化、预期标题)。
登录/验证码策略
- 要求用户在本地浏览器中手动完成登录、二维码扫描、短信验证码、图形验证码或双重认证。 不请求、存储或转发一次性验证码。 仅在用户确认已登录后恢复自动化操作。
回退策略
如果严格的 nav/snap/find/click/fill/press/text 无法推进:
1. 重新检查页面状态和认证状态。 请求用户执行一个手动步骤(仅针对特定阻塞点)。 仅在明确批准的情况下使用 eval,且仅用于短期解除阻塞;立即恢复为正常流程。
资源映射
- 小红书长文发布标准流程(标题<=20、正文描述、话题、暂存离开):references/xiaohongshu-longform.md