feat: add dialog detection and document dialog commands (#999)

Fixes #992

When a JavaScript dialog (alert/confirm/prompt) blocks the page, agents
had no way to detect it — all commands just timed out with generic errors.

- Add `dialog status` command to check for pending dialogs
- Track dialog state via CDP Page.javascriptDialogOpening/Closed events
- Auto-inject `warning` field into all command responses when a dialog is
  pending, so agents can distinguish dialog-blocked timeouts from other issues
- Document dialog commands in SKILL.md (was missing entirely), README.md,
  docs site, and --help output

Co-authored-by: ctate <366502+ctate@users.noreply.github.com>
This commit is contained in:
Chris Tate
2026-03-24 11:38:23 -05:00
committed by GitHub
co-authored by ctate
parent 780edb2c45
commit 32ffd8f3c4
8 changed files with 155 additions and 11 deletions
+3
View File
@@ -300,8 +300,11 @@ agent-browser frame main # Back to main frame
```bash
agent-browser dialog accept [text] # Accept (with optional prompt text)
agent-browser dialog dismiss # Dismiss
agent-browser dialog status # Check if a dialog is currently open
```
When a JavaScript dialog is pending, all command responses include a `warning` field with the dialog type and message.
### Diff
```bash