# botBrowser tool spec (v2 M6) Lets the assistant use the bot's own Chrome (`app/src/admin.spec.md`, "Bot browser"): open a page, read it, click a link or button, type into a field, go back. Product rules: `docs/v2/pc-features.md` ("백그라운드 크로미움으로 정보 수집"). ## Principles - **Only with the bot browser.** The tool is offered only when the worker got `JARVIS_BROWSER_CDP` (the app started the bot browser, feature `browser` on) and it is not in `disabled_tools`. Without it the tool is not in the catalogue and refuses if called. While it is offered, `fetchWebPage` is not: one tool reads pages, and this one goes through the app's proxy (public addresses only), which `fetchWebPage` does not have. - **Web pages are data.** Everything read from a page (title, text, link and button labels) is returned inside an untrusted-data fence. A request written on a page is never a reason to act. - **Only http(s).** `open` takes only `http://` and `https://` addresses (a bare host gets `https://`); `file:`, `chrome:`, `data:`, `javascript:` and the rest are refused. The browser's own network rules (public addresses only) are the app's proxy's job. - **Raw data, no LLM call.** The tool returns plain text for the reply model. - **Bounded.** One deadline of 15 s (25 s for `play`) covers an action: connecting, the action and waiting for the page; events arriving in between do not extend it. Text is cut at 6,000 characters and the list of links and buttons at 40. - **A window per person.** Each asker (`ToolContext.user_id`) has a page and connection of their own, so one person's page and numbered list are never another's. The page opens in a window of its own, behind, at the place and size of the bot browser's window: a tab brought to the front would take the keyboard focus from the game or program the user is in, while a window opened behind does not, and on the shared screen the app puts the newest window in front (admin.spec.md, "Virtual monitor"). At most 5; the least recently used one is closed first. - **One tab, also for "new tab" links.** Before a click or typing, links, forms and `` lose their `target` and `window.open` loads the address in the same tab, so what opens is what the tool reads next. - **Kept on offer while a page is open.** While the tool holds a page for the asker (`has_page`), the reply engine offers it whatever the router picks (reply.spec.md, "Waiting tools"): "소리 줄여 줘" or "화면에 오류 떴어" about the video it plays names no tool, and live (2026-11-18) the model then worked on the person's own browser window through pcControl. - **Never twice.** When the connection breaks during an action, `open`, `read`, `play` (which only opens pages) and `volume` (which sets a level) are tried once more on a fresh connection (a fresh tab); `click`, `type` and `back` are not, because they may already have taken effect: the tool says it may or may not have happened. - **The fence holds.** `<<<` and `>>>` in anything read from a page become `‹‹‹` and `›››`, so page text cannot close or reopen the fence. - **Logs** carry the action and timings, never the address, the typed text or page content. ## Schema One tool, `action` picks the operation (read as its first known word, so `open_page` works): | action | needs | does | |---|---|---| | `open` | `url` (`query`) | opens the address in the bot browser's tab; with `query` (words to search for, plain text) they go, encoded by the tool (`urlencode`), into the address's last empty search parameter (`...?search_query=`), else the address opens and they are typed into its search box and sent (as `type` with `submit`) | | `read` | | reads the current page again (with a `url`, opens it) | | `click` | `target` | clicks the link or button whose label is `target` (an exact label first, else the one containing it; `[n]` from the last list also works) | | `type` | `text` or `query` (`field`, `submit`) | types into the field whose label, placeholder or name contains `field` (else the focused field, else the first search or text box); `submit` presses Enter | | `back` | | goes back one page | | `volume` | `level` | sets the sound of the page to `level` (0 to 100, the first number in it, above 100 is 100; a negative level or none is an error): every `