Skip to content

✨ feat: agent-browser parity for tap browser (phase 1)#24

Merged
vaayne merged 12 commits into
mainfrom
feat/agent-browser-parity
Jun 12, 2026
Merged

✨ feat: agent-browser parity for tap browser (phase 1)#24
vaayne merged 12 commits into
mainfrom
feat/agent-browser-parity

Conversation

@vaayne

@vaayne vaayne commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

Brings tap browser toward feature parity with agent-browser, implemented as six independent workstreams:

  • get / is queriesget text/html/value/attr/title/url/count/box/styles, is visible/enabled/checked; all accept CSS selectors or @eN snapshot refs
  • Interaction commandsdblclick, focus, check/uncheck (idempotent, React-compatible events), scrollintoview, upload, drag, mouse move/down/up/wheel, keyboard type/insert, keydown/keyup
  • Enhanced wait — plain durations, --text, --url glob, --load load|domcontentloaded|networkidle, --fn JS poll, --state visible|hidden|attached|detached; also fixes the open --wait-selector 2s-sleep stub
  • Semantic locators (find)role/text/label/placeholder/alt/title/testid/first/last/nth × click/fill/type/hover/focus/check/uncheck/text; role resolves via the accessibility tree, others via injected JS → backendNodeID
  • Storage & statestorage local|session get/set/clear; state save|load in Playwright storageState-compatible JSON (0600 perms)
  • Emulation (set)viewport/device/geo/offline/headers/media/useragent/clear. CDP overrides are per-connection and tap has no daemon, so settings persist on TabRecord and re-apply in resolveTarget on every invocation

Deliberately deferred (phase 2+)

Streaming/dashboard, chat, React DevTools/vitals, HAR/trace/video recording, auth vault, clipboard, iframe frame switching, batch execution — these need a persistent daemon or are separate product surfaces.

Verification

  • mise run lint — 0 issues; mise run test — all packages pass
  • Live Chrome smoke test: open → get/is → check → find label "Email" fillfind role button click --name Submitwait --text → storage set/get → state saveset viewport 800 600 confirmed persisting across separate CLI invocations (window.innerWidth = 800 in a fresh process)

Known limitations

  • wait --state hidden and detached both map to chromedp.WaitNotPresent (CDP has no built-in hidden-but-present waiter)
  • state save captures localStorage for the current tab's origin only (no daemon to enumerate origins); load warns on origin mismatch
  • networkidle uses a resource-count-stability heuristic (500ms quiet window)

vaayne added 8 commits June 11, 2026 23:59
get text/html/value/attr/title/url/count/box/styles and
is visible/enabled/checked, accepting CSS selectors or @en refs.
dblclick, focus, check/uncheck, scrollintoview, upload, drag,
mouse move/down/up/wheel, keyboard type/insert, keydown/keyup.
wait now supports plain durations, --text substring, --url glob,
--load load|domcontentloaded|networkidle, --fn JS polling, and
--state visible|hidden|attached|detached. Also replaces the
open --wait-selector 2s-sleep stub with a real visibility wait.
find role/text/label/placeholder/alt/title/testid/first/last/nth
with click/fill/type/hover/focus/check/uncheck/text actions.
role resolves via the accessibility tree; others via injected JS
to backendNodeID.
storage local/session get/set/clear via Runtime.evaluate, and
state save/load in Playwright storageState-compatible JSON
(cookies with full attributes + current-origin localStorage).
set viewport/device/geo/offline/headers/media/useragent/clear.
CDP overrides are per-connection and tap has no daemon, so
settings persist on TabRecord and re-apply in resolveTarget on
every invocation.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 11, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
tap 456086a Jun 12 2026, 04:08 AM

vaayne added 4 commits June 12, 2026 11:56
- find alt/title now reject fill/type instead of silently passing
  an empty value
- network intercept help documents that it blocks until interrupted
- click error message mentions @en refs (it always supported them)
- SKILL.md find nth synopsis includes the required <n> argument
- canonical ArgsUsage <selector|@en> and two standard missing-arg
  error strings (with/without @en support)
- fill in missing Descriptions/ArgsUsage (mouse move, cookies,
  snapshot, screenshot, pdf, dialog, forms, scroll, storage set/clear)
- keypress help no longer claims per-character typing; points to
  keyboard type
- top-level quick start shows the snapshot → @en workflow
- hover now accepts @en refs like the other element commands
Hidden 'tap docs' command walks the cli.Command tree and emits a
deterministic Markdown reference. 'mise run docs' writes docs/cli.md
and TestDocsDrift fails CI when the committed file is stale, so help
text stays the single source of truth.
- docs/cli.md generated via 'mise run docs', linked from README and
  docs/browser.md
- correct the --wait-selector wording (waits for visibility, 30s
  default; no subprocess involved)
- clarify --wait-js applies to fetch/site, not tap browser
@vaayne

vaayne commented Jun 12, 2026

Copy link
Copy Markdown
Owner Author

Follow-up commits from the post-merge audit:

  • P0 (5cf4c40): find alt/title reject fill/type instead of silently passing empty values; network intercept help documents its blocking behavior; stale click error message; SKILL.md find nth syntax.
  • P1 (109474a): unified <selector|@eN> terminology and missing-arg error strings across all browser commands; filled in ~12 weak help texts; keypress help no longer claims per-char typing; hover now accepts @en refs (verified against live Chrome); top-level help shows the snapshot → @en workflow.
  • P2 (ab923a6, 456086a): hidden tap docs command generates a full Markdown CLI reference from the command tree; mise run docs writes docs/cli.md and TestDocsDrift fails when it's stale — help text is now the single source of truth for reference docs.

@vaayne vaayne merged commit cb2bd9c into main Jun 12, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant