pair-agent

AI 智能 社区 v0.1.0
解读按原文结构重写,命令、链接、术语均保留;右侧可核对作者原始 SKILL.md

设计思路

pair-agent 是 gstack 的「双 agent 配对」——把当前 Claude Code 的 browse daemon 通过 ngrok tunnel 暴露给另一个 agent(OpenClaw / Codex / Cursor),两边共享一个浏览器实例但各自在自己的 tab 里跑。每个 agent 拿到 scoped token——默认 read+write,敏感操作(JS 执行、cookie、storage)需要 --admin 显式提升;token 24 小时过期。

远程 agent 默认能做的

  • 跳 URL、点元素、填表、截屏
  • 读页面内容(text / HTML / snapshot)
  • 创建新 tab(每个 agent 拿自己的)
  • 不能:执行任意 JS、读 cookie、访问 storage

--admin 模式

解锁 JS 执行、cookie、storage——只给完全信任的 agent 用。

配置流程

Step 1-4:本端跑 $B tunnel start --pair <agent_name> 出 ngrok URL + 一段贴到对端的安装指令;如果 ngrok 没装,停下让用户装好再 /pair-agentStep 5:等用户在对端粘贴指令、连上后跑 $B status——能看到对端就告诉用户:「The remote agent is connected and has its own tab. 在 GStack Browser Side Panel 能看到它的 activity。」

平台差异

  • OpenClaw / AlphaClaw:用 exec 工具替代 Bash--local openclaw 时凭据写到 ~/.openclaw/skills/gstack/browse-remote.json
  • Codex:通过 codex exec 跑 shell;--local codex 写到 ~/.codex/skills/gstack/browse-remote.json
  • Cursor:AI 直接跑终端;--local cursor 写到 ~/.cursor/skills/gstack/browse-remote.json

排错指南

  • Tab not owned by your agent:远端动了不是它创建的 tab——让它先 newtab 自己开一个。
  • Domain not allowed:token 限了 domain,重 pair 给更宽 / 不限 domain。
  • Rate limit exceeded:> 10 req/s,看 Retry-After 自己降速。
  • Token expired:24 小时到了,重跑 /pair-agent 出新 setup key。
  • Agent can't reach the server:ngrok tunnel 没起(远程)或本地 browse server 挂(本地),分别 $B status 排查。

撤销访问

$B tunnel revoke AGENT_NAME    # 单个
$B tunnel rotate                # 一次撤销全部 + 轮换 root token

适合谁

  • 同时用 Claude Code 和 Cursor / Codex 想让两边共享浏览器状态的开发者
  • 让一个 agent 写代码、另一个 agent 跑 QA 的协作模式
  • 安全研究 / pen-test 想隔离权限分工的场景

不适合

  • 单 agent 完全够用——不必引入 tunnel 复杂度
  • 涉敏感凭据 / 内网——把 daemon 暴露给远端要谨慎,token 失效后及时 tunnel rotate

配套

open-gstack-browser(headed 模式让两边都看到)、browse(共用命令体系)、subagent-driven-development(多 agent 协作模式)、handoff(无浏览器场景的轻量交接)。

流狐档案 作者与许可取自来源;运行、权限和网络为流狐检测或估算
流狐分类
AI 智能
作者声明 Agent
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
作者 / 版本 / 许可
@garrytan · v0.1.0 · 未声明 license
流狐 Token 估算
较高消耗
流狐接入估算
需简单配置
是否需要外部 API Key
未发现要求
检测到的系统要求
macOS · Linux
底层运行要求
Bun
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
  • Shell 执行
检测到的网络行为
允许外网请求
安装命令数
无(仅作为资料)

档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。

需要注意: 未限定 allowed-tools,默认拥有全部工具权限。

输出预览 pair-agent.preview
# Writing Style (skip entirely if EXPLAINLEVEL: terse appears in the preamble echo OR the user's current message explicitly requests terse / no-explanations output)

- Gloss curated jargon on first use per skill invocation, even if the user pasted the term.
- Frame questions in outcome terms: what pain is avoided, what capability unlocks, what user experience changes.
- Use short sentences, concrete nouns, active voice.
- Close decisions with user impact: what the user sees, waits for, loses, or gains.
- User-turn override wins: if the current message asks for terse / no explanations / just the answer, skip this section.
- Terse mode (EXPLAIN_LEVEL: terse): no glosses, no outcome-framing layer, shorter responses.

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。