@53able/pi-agent-browser 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja-JP.md +1 -1
- package/README.md +1 -1
- package/index.ts +8 -3
- package/package.json +1 -1
- package/skills/agent-browser/SKILL.md +6 -0
package/README.ja-JP.md
CHANGED
|
@@ -164,7 +164,7 @@ https://example.com をブラウザ経由で読み、outputs/browser/example.md
|
|
|
164
164
|
すべての操作を無人で任せるべきではありません。適切なタイミングで人間に操作を戻すためのツールが3つあります。
|
|
165
165
|
|
|
166
166
|
- **安全な境界線** — `agent_browser_handoff` は、AI自身では対応できない・すべきでない操作(2FA/OTPの入力、CAPTCHA、本人確認)の直前でエージェントを一時停止させます。スクリーンショットで状況を記録したあと、実際のUIダイアログでブロックし、人間が「対応完了」または「中止」を選ぶまで待ちます。`agent_browser_read` / `agent_browser_snapshot` も簡易なキーワード検知を行い、こうしたチェックポイントらしき内容を出力に警告として付加します(この警告自体は停止ではなく、`agent_browser_handoff` を呼ぶきっかけとして扱ってください)。
|
|
167
|
-
- **インタラクティブなログイン** — `agent_browser_login_handoff` は、Google や OAuth など多くのプロバイダで sign-in がブロックされる問題を解決します。これは、agent-browser が使われた時点でオートメーション検出が起きるため、ログイン中に拒否されるというもの。このツールは CDP が接続されていない無人 Chrome プロセスを起動して人間が正常にログインできるようにし、ログイン成功後に、**そのブラウザはセッションに結合され、閉じられるまで生存し続けます**—リモートデバッグポートが開いたまま表示されます。Google や OAuth の sign-in フローが期待されるタスクでは、`agent_browser_open`
|
|
167
|
+
- **インタラクティブなログイン** — `agent_browser_login_handoff` は、Google や OAuth など多くのプロバイダで sign-in がブロックされる問題を解決します。これは、agent-browser が使われた時点でオートメーション検出が起きるため、ログイン中に拒否されるというもの。このツールは CDP が接続されていない無人 Chrome プロセスを起動して人間が正常にログインできるようにし、ログイン成功後に、**そのブラウザはセッションに結合され、閉じられるまで生存し続けます**—リモートデバッグポートが開いたまま表示されます。Google や OAuth の sign-in フローが期待されるタスクでは、`agent_browser_open` ではなく必ずこちらを使ってください。エージェントは、そのセッションが不要になった時点で速やかに `agent_browser_close` を呼ぶべきで、デバッグポートを無期限に開けたままにするべきではありません。
|
|
168
168
|
- **Commit前の停止** — `agent_browser_commit` は、決済・削除・投稿・送信といった「やり直しのきかない操作」専用の確認ゲートです。証跡を保存し、クリックの前に必ず人間の明示的な確認を求め、承認されない限りクリックは実行されません。対話的なUIが利用できない場合は、クリックせずにそのまま拒否します。こうした操作の最終確認クリックには `agent_browser_click` ではなく必ずこちらを使ってください。
|
|
169
169
|
|
|
170
170
|
3つのツールすべてが対話的なセッション(TUI、またはUI対応のRPC)を必要とします。無人・headless実行では、黙って進めるのではなく拒否します。
|
package/README.md
CHANGED
|
@@ -164,7 +164,7 @@ Clear all saved states only when intentionally resetting everything:
|
|
|
164
164
|
Not every step should run unattended. Three tools hand control back to a human at the right moments:
|
|
165
165
|
|
|
166
166
|
- **Safe boundaries** — `agent_browser_handoff` pauses the agent for steps it cannot or should not perform itself: 2FA/OTP entry, CAPTCHA, identity verification. It captures a screenshot for context, then blocks on a real confirmation dialog until a human resumes or aborts. `agent_browser_read` and `agent_browser_snapshot` also run a lightweight keyword scan and flag likely checkpoints in their output as a nudge to call this tool.
|
|
167
|
-
- **Interactive login flows** — `agent_browser_login_handoff` solves the problem that Google, OAuth, and similar providers block sign-in when agent-browser is used, because automation detection happens during the login step itself. This tool spawns an unattended Chrome process (with no CDP attached) so the human can log in normally. After login succeeds, the still-running browser is live-attached to the named session and **kept open as the permanent backing browser**—it remains visible on screen with an open remote-debugging port until closed with `agent_browser_close`. Use this instead of `agent_browser_open` whenever a task is expected to hit an interactive Google or OAuth sign-in flow.
|
|
167
|
+
- **Interactive login flows** — `agent_browser_login_handoff` solves the problem that Google, OAuth, and similar providers block sign-in when agent-browser is used, because automation detection happens during the login step itself. This tool spawns an unattended Chrome process (with no CDP attached) so the human can log in normally. After login succeeds, the still-running browser is live-attached to the named session and **kept open as the permanent backing browser**—it remains visible on screen with an open remote-debugging port until closed with `agent_browser_close`. Use this instead of `agent_browser_open` whenever a task is expected to hit an interactive Google or OAuth sign-in flow. Agents should call `agent_browser_close` as soon as the session is no longer needed, rather than leaving the debugging port open indefinitely.
|
|
168
168
|
- **Stop before commit** — `agent_browser_commit` is a dedicated gate for irreversible actions: payment, deletion, publishing, sending. It captures evidence, requires explicit human confirmation before clicking, and refuses outright (without clicking) if no interactive UI is available to ask. Use it instead of `agent_browser_click` for the final confirming step of any such action.
|
|
169
169
|
|
|
170
170
|
All three tools require an interactive session (TUI or RPC with UI support); in headless/unattended runs they refuse rather than proceed silently.
|
package/index.ts
CHANGED
|
@@ -790,7 +790,9 @@ export default function agentBrowserExtension(pi: ExtensionAPI) {
|
|
|
790
790
|
].filter(Boolean).join("\n"),
|
|
791
791
|
}],
|
|
792
792
|
details: { ok: resumed, command: "handoff", args: [category], stdout: choice ?? "", stderr: "", exitCode: resumed ? 0 : 1, signal: null, durationMs: 0, artifactPaths: artifacts },
|
|
793
|
-
|
|
793
|
+
// Only force a stop-and-wait turn on abort -- a genuine dead end needing a human/
|
|
794
|
+
// operator decision. On resume the checkpoint is cleared, so continue immediately.
|
|
795
|
+
...(resumed ? {} : { terminate: true }),
|
|
794
796
|
};
|
|
795
797
|
},
|
|
796
798
|
});
|
|
@@ -804,7 +806,8 @@ export default function agentBrowserExtension(pi: ExtensionAPI) {
|
|
|
804
806
|
"Never attempt an interactive Google/OAuth-style login via agent_browser_open, agent_browser_click, or agent_browser_fill — those attach CDP immediately, and Google blocks sign-in for CDP-attached sessions regardless of profile or cookies.",
|
|
805
807
|
"Call this tool instead whenever a task is expected to require signing into a Google account or a similarly automation-hostile login flow.",
|
|
806
808
|
"After this tool reports success, take a fresh agent_browser_snapshot before continuing — do not assume page state.",
|
|
807
|
-
"On success the login browser stays open and IS the session's live backing browser; drive it with the normal agent_browser_* tools by session name
|
|
809
|
+
"On success the login browser stays open and IS the session's live backing browser; drive it with the normal agent_browser_* tools by session name.",
|
|
810
|
+
"Once the current task no longer needs this session (no further browser-driven steps planned), call agent_browser_close for it before finishing — it holds an open remote-debugging port on localhost until closed, and leaving it open is a real, unnecessary security exposure. Only skip closing it when the user's task explicitly spans multiple steps/turns that will keep reusing this same session.",
|
|
808
811
|
"If this tool reports no interactive UI, a decline, or a failure, stop the task and report back; do not retry via agent_browser_open.",
|
|
809
812
|
],
|
|
810
813
|
parameters: LoginHandoffSchema,
|
|
@@ -993,7 +996,9 @@ export default function agentBrowserExtension(pi: ExtensionAPI) {
|
|
|
993
996
|
].filter(Boolean).join("\n"),
|
|
994
997
|
}],
|
|
995
998
|
details: { ...result, artifactPaths: [] },
|
|
996
|
-
terminate:
|
|
999
|
+
// No terminate:true here (unlike the failure/abort/no-UI paths above): login
|
|
1000
|
+
// succeeded and the session is immediately usable, so the agent should continue
|
|
1001
|
+
// the original task right away instead of forcing a stop-and-wait-for-the-user turn.
|
|
997
1002
|
};
|
|
998
1003
|
},
|
|
999
1004
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@53able/pi-agent-browser",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Typed Pi tools for browser automation, rendered-page context extraction, screenshots, and saved session state via agent-browser.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,6 +36,8 @@ Two tools exist so the agent stops and hands control back to a human instead of
|
|
|
36
36
|
|
|
37
37
|
`agent_browser_read` and `agent_browser_snapshot` also run a lightweight heuristic scan for 2FA/CAPTCHA/identity-verification keywords and prepend a warning to their output when detected — treat that warning as a signal to call `agent_browser_handoff` next, not as a blocker by itself.
|
|
38
38
|
|
|
39
|
+
On resume, `agent_browser_handoff` does not force the agent to stop and wait for a new user turn — the checkpoint is cleared, so continue the original task right away (after a fresh `agent_browser_snapshot`). Only abort ends the turn, since that's a genuine dead end needing a human/operator decision.
|
|
40
|
+
|
|
39
41
|
### If the human can't find the browser window
|
|
40
42
|
|
|
41
43
|
`agent_browser_open` records whether each named session was launched with `headed: true`. When `agent_browser_handoff` runs for a session that was not opened headed, it automatically prepends a warning naming the session and the exact `agent_browser_open` arguments (including the last known URL) needed to reopen it visibly, instead of leaving the human to guess. Prefer `headed: true` from the start for any task that might hit a login, 2FA, CAPTCHA, or identity-verification step — a human can only intervene through `agent_browser_handoff` if a visible window already exists. Note that some verification challenges are single-use or session-bound, so reopening may require restarting the login flow rather than resuming mid-challenge.
|
|
@@ -64,12 +66,16 @@ After the human confirms login is complete, subsequent `agent_browser_open`, `ag
|
|
|
64
66
|
|
|
65
67
|
**Security note:** The login browser's `--remote-debugging-port` remains open on localhost for as long as the session is alive. This gives any local process full browser control — the same caveat agent-browser's own docs give about `--remote-debugging-port`. Call `agent_browser_close` when done with a session that went through login handoff, rather than leaving it open indefinitely. `agent_browser_close` will terminate the tracked login Chrome process and clean up its debugging port.
|
|
66
68
|
|
|
69
|
+
Agents should call `agent_browser_close` for the session as soon as the current task no longer needs it (no further browser-driven steps planned) — don't wait for the user to ask. Only leave it open when the task explicitly spans multiple steps or turns that will keep reusing the same session.
|
|
70
|
+
|
|
67
71
|
Run `agent_browser_doctor` to see which sessions still have live login browsers open. It reports any that are still running (session name, process ID, debugging port, and last known URL) with a reminder to call `agent_browser_close`. Stale tracking entries for processes no longer running are cleaned up silently with no user notification.
|
|
68
72
|
|
|
69
73
|
`agent_browser_login_handoff` also surfaces this automatically: its success message names any *other* sessions that still have a live login browser open (session name and process ID), so you don't have to run `agent_browser_doctor` separately just to notice one was left open.
|
|
70
74
|
|
|
71
75
|
Re-running `agent_browser_login_handoff` for the same session name will terminate any previous live login browser for that session before spawning a new one.
|
|
72
76
|
|
|
77
|
+
On a successful login, the tool does not force the agent to stop and wait for a new user turn — the session is immediately usable, so continue the original task right away (after a fresh `agent_browser_snapshot`). Only the failure/abort/no-UI paths end the turn, since those genuinely need a human or operator decision before anything else can happen.
|
|
78
|
+
|
|
73
79
|
## Common examples
|
|
74
80
|
|
|
75
81
|
Read a public page:
|