Browser pane
The browser pane shows the app you're building beside the agent. The agent drives the page with commands, you use it with the mouse, and you can point at an element to send it to the agent.
browser is a pane showing a web page that you drive with browser.* commands and the person uses with the mouse and keyboard, both on the same page: check the app you're building the way the person sees it. Pages run in an installed Chrome, Chromium, Edge or Brave, headless, with Woolshed's own profile (data/browser/profile: sign-ins to the app you're testing stay; the person's own browser profile is never touched); WOOLSHED_BROWSER names another Chromium-family browser. The browser starts on the first command and quits with Woolshed.
woolshed do browser.open --url localhost:5173 # the pane beside the focused one (or the page it shows)
woolshed do browser.tree # what's on it: roles, names, states, [ref=N]
woolshed do browser.click --ref 18 # or --text "Sign in", --selector "#go", --x 40 --y 300
woolshed do browser.type --into Email --text sam@example.com --submit true
woolshed do browser.wait --text "Welcome" # until it shows (or --selector, --url; --gone true)
woolshed do browser.console --level error # what went wrong, with file:line
woolshed do browser.shot # a PNG of the view: prints its path; look at it
woolshed do browser.open --url localhost:5173 --place none --new true # a page of your own, no pane
- Pages have ids (
browser.ls); every command takesidand otherwise uses the page last used or shown.browser.openwith noidreuses the page a pane shows, so you and the person look at the same one;new: truemakes another. A link that opens a new window opens a new page, and the pane follows it. browser.textandbrowser.treeprint plain text fromwoolshed do; the rest print JSON. Refs are good until the page changes: read the tree again after it does.- Clicks, keys and typing are a person's own (trusted events), at the element's middle after scrolling it into view; a page they load is waited for. A dialog (
alert,confirm,prompt) is answered OK at once and noted in the console. - The console keeps the last 1000 entries: console calls, uncaught errors, resources that failed to load. Pass
since(the last answer'snext) to see only what's new. - The page is the pane's size, at the screen's sharpness; with no pane it's 1280×800.
browser.viewport --width 390 --height 844 --mobile truechecks a phone layout (touch events too) until--fit true. - Pointing at an element. The pane's ⌖ (Pick) lets the person point at an element: the page highlights what's under the pointer, a click picks it, and a box under the page sends it with their words to the agent in that tab (
hc send): what they want changed, then the element's selector, the component and source file:line where a dev build of React, Vue or Svelte says, and a screenshot path (read it).woolshed do browser.pickasks the person to pick one and waits (2 minutes unlesstimeout): it answers withselector,tag,text,html,box,style,component,source,shotandurl. Use it when "this button" or "that gap" is ambiguous. - Props:
{ id?, url? }:woolshed do pane.split --direction right --mod browser --props '{"url":"localhost:3000"}'. It's focusable; keys go to the page while it has focus, except the app's own shortcuts (Command/Control with anything but A, C, V, X, Z). Shared"browser.last"keeps each page's last address, so a pane opens it again after a restart. - Mods read and drive pages with
browser(id),nextBrowserChange(id, version)andbrowserInput(id, event)(see thewoolshedmodule).
Your agents read these same words: Woolshed writes this guide to ~/.config/woolshed/AGENTS.md on every start. In it, “you” is the agent and “the person” is you.