@parcha/pi-browser 0.1.0-beta.34 → 0.1.0-beta.341
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/CHANGELOG.md +170 -0
- package/NOTICE +6 -1
- package/README.md +70 -60
- package/dist/core/contract.d.ts +9 -6
- package/dist/core/contract.js +12 -30
- package/dist/core/custody.d.ts +6 -0
- package/dist/core/custody.js +15 -3
- package/dist/core/downloads.d.ts +37 -3
- package/dist/core/downloads.js +81 -57
- package/dist/core/driving-guard.d.ts +1 -1
- package/dist/core/driving-guard.js +1 -1
- package/dist/core/evidence.d.ts +1 -1
- package/dist/core/files.d.ts +20 -2
- package/dist/core/files.js +161 -10
- package/dist/core/host.d.ts +18 -75
- package/dist/core/images.d.ts +32 -4
- package/dist/core/images.js +81 -16
- package/dist/core/lease.d.ts +2 -1
- package/dist/core/page-scan.d.ts +81 -2
- package/dist/core/page-scan.js +487 -13
- package/dist/core/public-fetch.d.ts +70 -9
- package/dist/core/public-fetch.js +348 -51
- package/dist/core/read-page-worker.js +5 -4
- package/dist/core/read-page.d.ts +23 -8
- package/dist/core/read-page.js +64 -20
- package/dist/core/redact.d.ts +0 -2
- package/dist/core/redact.js +0 -32
- package/dist/core/session-control.d.ts +0 -2
- package/dist/core/session-control.js +0 -5
- package/dist/core/tools.d.ts +23 -1
- package/dist/core/tools.js +46 -4
- package/dist/core/usage.d.ts +4 -3
- package/dist/core/usage.js +5 -4
- package/dist/core/vault.d.ts +0 -10
- package/dist/core/vault.js +0 -13
- package/dist/core/web.d.ts +2 -111
- package/dist/core/web.js +0 -443
- package/dist/driver/cdp.js +3 -3
- package/dist/driver/page-driver.js +7 -3
- package/dist/driver/stagehand.d.ts +3 -1
- package/dist/driver/stagehand.js +4 -2
- package/dist/durable/store.d.ts +14 -3
- package/dist/durable/store.js +204 -51
- package/dist/durable.d.ts +32 -16
- package/dist/durable.js +68 -95
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -3
- package/dist/live-view/index.d.ts +3 -1
- package/dist/live-view/index.js +4 -0
- package/dist/live-view/protocol.d.ts +1 -1
- package/dist/live-view/server.d.ts +30 -0
- package/dist/live-view/server.js +152 -25
- package/dist/providers/cdp.js +2 -2
- package/dist/providers/profiles.d.ts +1 -15
- package/dist/providers/profiles.js +1 -64
- package/dist/providers/shared.d.ts +1 -47
- package/dist/providers/shared.js +1 -82
- package/dist/providers/worker-extension.d.ts +14 -1
- package/dist/providers/worker-extension.js +69 -3
- package/dist/testing/backend.d.ts +6 -24
- package/dist/testing/backend.js +7 -30
- package/dist/vault-session.d.ts +4 -7
- package/dist/vault-session.js +26 -81
- package/dist/vendor/browser-use-pi/page.d.ts +3 -12
- package/dist/vendor/browser-use-pi/page.js +6 -19
- package/package.json +9 -22
- package/dist/core/sites.d.ts +0 -33
- package/dist/core/sites.js +0 -104
- package/dist/durable/web.d.ts +0 -47
- package/dist/durable/web.js +0 -41
- package/dist/providers/browserbase-net.d.ts +0 -12
- package/dist/providers/browserbase-net.js +0 -95
- package/dist/providers/browserbase.d.ts +0 -169
- package/dist/providers/browserbase.js +0 -319
- package/dist/providers/kernel.d.ts +0 -58
- package/dist/providers/kernel.js +0 -291
- /package/dist/{providers → core}/cdp-call.d.ts +0 -0
- /package/dist/{providers → core}/cdp-call.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,176 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.1.0-beta.290 (2026-12-05)
|
|
6
|
+
|
|
7
|
+
- A fal job priced by its input media's length now copies a file over 64 KB to fal's storage through a signed PUT: the meter asks fal's `upload_file` to prepare the upload (`prepare_upload` with the file's name and size), PUTs the bytes it measured to the `upload_url` fal signed, and sends the job naming the `file_url`. Before, every copy went as base64 `data`, which fal takes only up to 64 KB, so on a fal server under your own key such a job was refused under a spend cap. A file up to 64 KB still goes as `data`. <!-- changes/fal-copy-signed-put.md -->
|
|
8
|
+
- `@parcha/pi-browser` adds `publicUpload(url, bytes, options)`, the public-host guard's write: one PUT, https only, no redirect followed, dialled at the address it checked.
|
|
9
|
+
|
|
10
|
+
## 0.1.0-beta.273 (2026-12-05)
|
|
11
|
+
|
|
12
|
+
- `isPrivateAddress` (and so `publicFetch` and `web_fetch` without a fetch service) refuses Teredo, 2001::/32: a relay delivers a Teredo address to the IPv4 address its last 32 bits hide, which may be a private one. <!-- changes/pi-browser-teredo-refused.md -->
|
|
13
|
+
|
|
14
|
+
## 0.1.0-beta.118 (2026-12-02)
|
|
15
|
+
|
|
16
|
+
- `web_fetch` has a budget of new pages per destination host: 600 a minute and 6,000 an hour for one run, and 1,200 a minute and 12,000 an hour for one workspace's runs together. A read past it is refused before anything is sent, to a provider or to the host. The tool answers a failed page whose `refused` names the limit, the host and when it lifts, and the run goes on. A part of a page the run already holds is never counted, and other hosts are fetched as before. A model reading pages one call at a time never comes near the budget. What reaches it is a script or a wide map fetching one host as fast as it can, or a crawl of thousands of one site's pages. <!-- changes/web-fetch-host-budget.md -->
|
|
17
|
+
- A run in a process of its own asks its runner, which counts the claim's run and the workspace it reads from the store. A run cannot name another run's workspace. A run in no workspace is held to its own budget alone.
|
|
18
|
+
- Counts are kept in memory by each runner process. A host is its whole hostname, so a site's subdomains are counted apart.
|
|
19
|
+
- Each refusal is logged once as `web_fetch_budget`, with the run, the scope, the window, the limit and when it lifts. The line never carries the host or the URL.
|
|
20
|
+
- A redirect to another host is counted against that host before it is followed, once a read. A redirect to a host whose budget is spent is refused in the same words, and that host is never dialled.
|
|
21
|
+
- Where a run's tools run in the server's own process, a refusal's log line names the run's id, and a run's counts carry across its claims.
|
|
22
|
+
- `@parcha/agentrun-web`: `WebConfig.admit(host)` is asked before a fetch sends a read. Words refuse the read; a throw refuses it too, and so does no answer within `bounds.admitMs` (`ADMIT_MS`, 10 seconds). A URL no read sends (another port, a user name or password, an href past `URL_MAX`) is never asked about, so it spends no host's budget. `hostOf(url)` gives the host it is asked with. It is asked again before the direct fetch follows a redirect to a host the read was not admitted for.
|
|
23
|
+
- `@parcha/pi-browser`: `publicFetch` and `publicDownload` take `beforeRedirect(url)`, asked with each redirect's target once its checks pass and before it is dialled. What it throws ends the fetch there.
|
|
24
|
+
|
|
25
|
+
## 0.1.0-beta.106 (2026-12-02)
|
|
26
|
+
|
|
27
|
+
- web_fetch's direct fetch, web_save and a media tool's read of its input now send `User-Agent: AgentRun/<serve's version> (+https://github.com/Parcha-ai/agentrun)` on every hop, a redirect's included, where they sent `pi-browser`. A site's operator sees who fetched and where to read about it, and a robots.txt can name the `AgentRun` token. `publicFetch` and `publicDownload` take a `userAgent` option; without one they still send `pi-browser`. <!-- changes/fetch-user-agent.md -->
|
|
28
|
+
|
|
29
|
+
## 0.1.0-beta.83 (2026-12-02)
|
|
30
|
+
|
|
31
|
+
- `readPage` now bounds the links it resolves, and a read whose worker runs out of memory is refused instead of being read again on the caller's thread. A page's links stop at `READ_LINKS_MAX` (20,000) or once `READ_LINKS_MAX_CHARS` (4,000,000) characters of hrefs and their base have been resolved, duplicates included; the read then carries `links_truncated: true` and its first links, and its title and text are unchanged. Before, a page under the 1,000,000-character read cap with a long `<base href>` and many short relative anchors resolved to billions of characters: the worker ran out of its heap, and the plain-text fallback then resolved them again on the event loop, holding it for minutes and filling the process's heap. A worker that runs out of memory now rejects the read with `PageReadOutOfMemory` (`code` `PAGE_READ_OUT_OF_MEMORY`), which `web_fetch` answers as a failed fetch; a worker that times out or fails any other way still falls back to the plain-text read, which the same link caps now bound. `web_fetch`'s first part of a page whose links were cut says `links_truncated: true`, so a model knows its `links` and `links_omitted` cover only the page's first links. `ReadPageOptions.heapMb` sets the worker's heap (default `READ_WORKER_HEAP_MB`, 1024, at least 16). Pages within the caps read exactly as before. <!-- changes/read-page-link-caps.md -->
|
|
32
|
+
|
|
33
|
+
## 0.1.0-beta.82 (2026-12-02)
|
|
34
|
+
|
|
35
|
+
- A run's own process no longer chooses where the server connects for its browser viewer. The runner makes the viewer's listening socket (on loopback, or on its `AGENTRUN_RUNNER_LIVE_HOST` address) and hands it to the run's process on fd 5 (`AGENTRUN_VIEWER_FD`); each hand-over names that socket's port and the runner's own host, and the process supplies only the session's tag, the viewer's path id and its token. Before, the process named the port and host itself, so code in a run could point the server's viewer check and WebSocket proxy at another service on the runner's loopback or at another listed host. <!-- changes/viewer-listener-from-runner.md -->
|
|
36
|
+
- The server still dials only loopback, or the hosts and IPv4 blocks in `AGENTRUN_RUNNER_HOSTS`. A row that names any other host is now refused in words on the server's log (`live_host_refused`), once per host, instead of reading as a viewer that does not answer.
|
|
37
|
+
- pi-browser's `createLiveView` takes `listen: { fd, host }`: it serves on a listening socket its parent made and handed down, and the viewer's link names `host` and that socket's port. The process listens on that socket once: a later live view given the same `fd` (a run's pass rebuilt after a fault) takes it over, on the same port, and the earlier view's links answer 404.
|
|
38
|
+
- Live view of browser and desktop computers works as before, on one machine and with runners on other hosts. Desktop and phone viewers were already registered by the runner's own listener.
|
|
39
|
+
|
|
40
|
+
## 0.1.0-beta.80 (2026-12-01)
|
|
41
|
+
|
|
42
|
+
**Breaking:**
|
|
43
|
+
|
|
44
|
+
- A run's skills come from its revision alone: every claim, a follow-up's included, hands the harness the revision's skill text (a moved project's, its pinned snapshot's), never what is in the run folder's `.agents/skills/`. At every claim the server makes `.agents/skills/` the revision's exactly (a rewritten file written back, a moved project's with its snapshot's mode so an authored script stays executable, a file or skill folder the revision lacks removed, a link at a revision path replaced), and the run's `read` answers every path there from the claim's skills, never from the folder, so a rewrite by the run's computer mid-claim is never what the model reads. That holds for every harness that reads its skills on demand (pi, an ACP harness such as Goose, a moved project on any harness) and for a desktop's or a phone's own skill. A skill file whose name a case-folding disk reads as `SKILL.md` but is not exactly `SKILL.md` (`cite/skill.md`, `cite/SKILL.md.`) is never laid, listed or read. A browser download whose name starts with spaces and dots is filed without them, so it is never a hidden file. Skills are read on demand only with the `read` tool: a run with `bash` and no `read` now gets every `SKILL.md` inlined, and the on-demand line names the `read` tool, so a pi desktop run on Sonnet's first request through a gateway needs $0.056 (from $0.055; its byte bound 10,739 tokens); the documented $0.09 minimums do not change. A template eval case whose `files:` name a path under `.agents/` or `.claude/` is refused when the case is read. A run's file tools (write, edit, and every bridged file tool) and what files for it (web_save, a browser screenshot's save_as, the MCP's filed answers) refuse a path under `.agents/` with a refusal in words, in both modes, and a moved project's checkpoint keeps the baseline's `.agents/` and never carries a run's. An agent that wrote its own skills from inside a run changes them through its definition instead. <!-- changes/skills-from-revision-only.md -->
|
|
45
|
+
- A moved project's skill folders, an empty one such as a skill's `output/` included, are laid at every claim with their snapshot's mode and listed by the run's `read`; a grep over `.agents/skills/` runs in grep's worker as a folder's does, so it stops at its deadline and at `max`.
|
|
46
|
+
- A grep over the whole run folder never searches the folder's own `.agents/skills/` (a name that folds to it included), so lines the run's computer wrote there never take a project file's match's place under `max`.
|
|
47
|
+
|
|
48
|
+
## 0.1.0-beta.79 (2026-12-01)
|
|
49
|
+
|
|
50
|
+
**Breaking:**
|
|
51
|
+
|
|
52
|
+
- `createBrowserExtension`'s `workspace` option now returns a `DownloadsWorkspace` (read, stat, mkdir, write, writeNew, remove, each relative to the workspace), not a folder's path, and `fetchDownloads` takes one as its `workspace`. A host passes its own guarded workspace; a test can wrap a folder. `browser_upload` is listed only when the host passes `files`, since `workspace` no longer gives a default: pass `files: workspaceFiles(folder)` to keep it. A `downloads/manifest.json` that is a link, even to a file in the workspace, is now refused: replace it with the file itself. <!-- changes/downloads-workspace-option.md -->
|
|
53
|
+
|
|
54
|
+
**Changes:**
|
|
55
|
+
|
|
56
|
+
- `isPrivateAddress` counts the hosting cluster's internal ranges as private: the ranges in `CLUSTER_INTERNAL_CIDRS` (a comma list of CIDRs, an address alone being one host), or GKE's default Service range `34.118.224.0/20` when it is unset or blank. That range is public address space on paper, so a name that resolves into it from inside a cluster (an in-cluster service, the Kubernetes API) passed every outbound guard before. Every guard built on the classifier refuses it now, at the check and at the dial it pins: `publicFetch`, `publicDownload` and `publicCheck` (web_fetch, web_save), the server's outbound webhook at its save and at each try, and the MCP server, calendar and feed checks, where no owner's private-hosts list allows it. A value replaces the default. A value holding an entry that is not a CIDR, a CIDR with bits set past its prefix, or no entry at all (separators alone) refuses every address until it is fixed. Each process holds to its own environment: set it on the server and on each runner, and restart them to change it. <!-- changes/cluster-internal-ranges.md -->
|
|
57
|
+
- On a Mode 1 server, `browser_downloads`, a run's checkout and the delete of a run or an agent write and remove in the run's folder only through the run's Workspace, which follows no link and never waits on a FIFO. A computer that shares the folder can no longer send a download, the manifest or the lock outside it by swapping `downloads/` for a link while the call runs. <!-- changes/downloads-no-follow.md -->
|
|
58
|
+
- `downloads/` that is a link or a file is refused before anything is written, and the call says why. So is a `downloads/manifest.json` that is not a regular file (a FIFO, a link, a folder): it is opened without blocking, checked, and refused at once, never read through.
|
|
59
|
+
- Each file is placed under a name no other file holds, with no temporary file beside it. A name taken by other bytes gains the file's digest, as before.
|
|
60
|
+
- A Mode 1 checkout (`checkout: pull_request` or `repository`) is made in a private folder of the server's, then copied into `repo/` through the run's Workspace. A computer kept from an earlier claim can no longer send the checkout outside the run's folder by swapping `repo/` for a link while it lands. A link in the repository's tree is checked out as a plain file holding its target, with `core.symlinks` false in `repo/.git/config`. A `repo/` that is itself a link is left as it is, and the run is told there is no checkout. A stop, or the checkout's time running out, during the copy ends it before the next file and removes the partial `repo/`. Every git call of a checkout, in either mode, runs with no fsmonitor, no attributes file and no transport but the remote's own scheme, and stops its search for a repository at the folder it started in: an fsmonitor named in a `.git/config` planted before the checkout never runs. Mode 2's checkout is otherwise unchanged.
|
|
61
|
+
- Deleting a run or an agent removes its folders on this machine through held folders and follows no link. A DELETE that a computer still sharing the run's folder changes mid-way is `503`, and the next DELETE finishes it.
|
|
62
|
+
|
|
63
|
+
## 0.1.0-beta.75 (2026-11-30)
|
|
64
|
+
|
|
65
|
+
- A page web_fetch can't read whole now gives the agent its start and a way to the rest. A page whose body is over 5 MiB, fetched directly, used to answer `refused: the page is over 5 MiB` with no text at all; it now answers its first 5 MiB as the page's start, `cut_bytes` on every part, and the last part's line says the rest wasn't read. A page's text past the first 1,000,000 characters is still out of paging's reach, and every part that shows it now says so. An answer to an `objective` for such a page says its chunks are from the page's start alone. Of each, on a run granted `web_save`, the line tells the agent to save the page whole as a file with it and read that file. `publicFetch` takes `cut: true` for this; without it, and in `publicDownload` (web_save's), a body over the cap is refused as before. `webFetchText` takes the save tool's name as an optional third argument. <!-- changes/web-fetch-big-page.md -->
|
|
66
|
+
|
|
67
|
+
## 0.1.0-beta.73 (2026-11-29)
|
|
68
|
+
|
|
69
|
+
- The public-host guard (`publicFetch`, `publicDownload`, `publicCheck`) refuses a URL holding a user name or password itself, on the first hop and at every redirect, before that hop's name is resolved or anything is sent to it: `refused: the URL holds a user name or password`, or `refused: a redirect to a URL holding a user name or password`. The refusal never quotes the URL. Before, a redirect to such a URL was stopped only by undici's own `Request`, whose error quotes the URL whole, and a guard given another fetch followed it. Every hop now goes through the same checks, the first one's included: scheme, user name or password, then name, addresses and port. web_fetch's direct fetch, web_save's download and the server's fal file download answer such a redirect with the guard's refusal. <!-- changes/public-fetch-userinfo-every-hop.md -->
|
|
70
|
+
|
|
71
|
+
## 0.1.0-beta.70 (2026-11-29)
|
|
72
|
+
|
|
73
|
+
- A process that dies inside a browser run on a local Chrome is reattached at once. Before, Stagehand's extension kept the dead client's callback batch running until its own timeout (60 s by default) and held the new process's `Stagehand.create` behind it, so the reattach took about as long as Stagehand's 60 s init deadline and failed when the batch timeout was longer. The copy of the extension the cdp provider gives a local Chrome now aborts a gone client's running batches when the extension releases it. The copy carries Stagehand's LICENSE and a NOTICE saying what changed. A Stagehand release whose worker has moved the code the change rewrites is refused by name at launch. The change isn't applied to a browser that brings its own copy of the extension (Browserbase), which still waits until Stagehand fixes this upstream. A local launch with no private TMPDIR (Windows, or a host temp path too long for one) already runs Stagehand's own extension directory unconfined, so it doesn't get the change either and still waits, like Browserbase. pi-browser now pins Stagehand 4.4.0 exactly, the version the change was written against. <!-- changes/pi-browser-reattach-ends-dead-batch.md -->
|
|
74
|
+
- A host's `close` release of a conversation's browser (`BrowserExtensionHandle.release(…, "close")`) now waits up to 2 s for the conversation's drivers to close before it records the release, and only then ends the session at the provider. Before, the session's end started alongside the driver's close, so a Stagehand driver could send its close and detach to a Chrome that was already gone. If its socket never said so (a path that hides the far end's close), it waited out both of Stagehand's 10 s disconnect bounds. A driver that answers fast now gets both answered first. One that hasn't answered by 2 s (`DRIVER_ACK_BEFORE_KILL_MS`) is not waited for, so a wedged close holds up the session's end by 2 s at most, never its full 25 s close bound. Releases for any other reason are unchanged. <!-- changes/pi-browser-release-ack-before-kill.md -->
|
|
75
|
+
- `publicFetch` decodes a text page by the charset it declares, so a Latin-1 or Shift_JIS page reads as its words instead of U+FFFD. The charset is the Content-Type's `charset`, else (an HTML page) a `<meta charset>` or `<meta http-equiv="Content-Type">` in its first 1024 bytes, else UTF-8. A label no encoding goes by is passed over, and a `<meta>` naming UTF-16 reads as UTF-8, as a browser reads it. serve's default `web_fetch` reads pages through it. <!-- changes/public-fetch-page-charset.md -->
|
|
76
|
+
|
|
77
|
+
## 0.1.0-beta.69 (2026-11-28)
|
|
78
|
+
|
|
79
|
+
- `@parcha/pi-browser/driver/stagehand` exports `DEFAULT_BATCH_TIMEOUT_MS` (60 000), the batch deadline the Stagehand driver uses when it is given none. <!-- changes/pi-browser-default-batch-timeout-export.md -->
|
|
80
|
+
|
|
81
|
+
## 0.1.0-beta.66 (2026-11-27)
|
|
82
|
+
|
|
83
|
+
- The browser's `screenshot` tool takes an optional `save_as`: a path relative to the workspace, its folders separated by `/`, ending `.png`, `.jpg` or `.jpeg` (`shots/home.png`). The capture is filed as evidence as before, and the same bytes are also written to that path. Missing folders are created and an existing file is replaced. The answer gets a `saved: <path>` line, and its details get `save_as: { path, saved: true }`. A `.png` name captures a PNG. An absolute path, a `..` segment, a backslash, a name that is not an image, or a name whose format contradicts `type` is refused before the browser is called, so nothing is captured or filed. If the size budget retakes a PNG as a JPEG, the capture still comes back and is filed, but nothing is written under the `.png` name: the answer says `not saved: ...` and its details give `save_as: { path, saved: false, reason: "format_changed", message }`. Without `save_as`, the tool behaves as before. <!-- changes/browser-screenshot-save-as.md -->
|
|
84
|
+
- `WorkspaceFiles` (pi-browser's host port) gains an optional `write(rel, bytes)`. A host without one refuses `save_as`. pi-browser's own `workspaceFiles(root)` writes through no link, its parent folders and the file itself included, and replaces the file whole. It walks from the root one folder at a time, each opened through no link and held: on Linux every later name resolves inside a held folder, so a folder another process swaps for a link is never followed; elsewhere the held folders are checked (same folder, no link) before and after each step, and a swap seen is refused. serve writes through the run's Workspace, the same write the agent's write tool uses.
|
|
85
|
+
- On serve, the run's gate holds a browser screenshot that has `save_as` to `write`'s setting, as it already holds `computer_screenshot`'s. An agent not given `write` is refused, `write` set to deny refuses it, `write` set to ask asks a person, and a path inside a folder an MCP tool's file setting reserves is refused. A screenshot without `save_as` is held to the browser's setting alone.
|
|
86
|
+
- When serve lets a run's claim go (the run ends, is stopped, or parks), it now releases every cloud browser that carries the run's labels and the claim's epoch and that nothing the run holds names: not a session's browser by id, and not a browser whose session tag a held, not yet created session still owns. Before, a browser one create of a request made and then lost (its reply lost, its recovery keeping it because an older browser was answered) ran unheld until the vendor ended it, up to 6 hours on Browserbase and about 72 hours on Kernel: the janitor refuses vendor-lifetime providers, and a later claim's sweep releases only lower epochs. A browser another run made, or a later epoch's, is never touched. <!-- changes/browser-unheld-release.md -->
|
|
87
|
+
|
|
88
|
+
What the run holds is read after the vendor's list answers, and it counts every browser the run's custody held in that process, released or not: a browser the vendor still lists a moment after its own release is billed by its own record and never charged again. A browser whose create the process still has in flight is left to that create and named.
|
|
89
|
+
|
|
90
|
+
Each browser released this way is charged on the run from the time its vendor listing says it was made, through the same booking every other browser charge takes. The let-go records each browser on the run's root (its id, tag, when its vendor made it, and when its release went out) before its release is sent, and charges it, and says its release on the run's timeline, in one commit of its own once that release answers, before the next release is sent. A process that ends between a release and its charge, or a later release that does not answer within the let-go's bound, leaves each released browser charged and said, or recorded, and the next claim's open charges and says a recorded one: one that claim's own sweep of the run's older-epoch sessions released, to when that sweep answered (it ran until then); otherwise to when its release went out, or, where its vendor says it still runs, it releases it then and charges it to then. One whose status cannot be read stays recorded for the open after. The run's timeline and root record say so, one line per browser: `AgentRun: Released 1 browser a create race left running (<id>); this run did not hold it, and its time is booked on the run and absorbed, not billed.` A browser the release could not end is named too, as running to its vendor's lifetime. When a session's release by its tag ends such a browser beside the session's own, it is charged there under the same key (`unheld:<id>`), so it is charged once whichever release ends it, and a reopen books that charge once.
|
|
91
|
+
|
|
92
|
+
That time is booked and absorbed, never billed. The run's ledger books it, so its `cost.usd` and its usage's `total` hold it and the run's cost record is whole, but `GET /runs/{id}/usage` (`runusage/7`) puts it on a `browser_time` line of its own with `absorbed: "create_race"` and `billable: false`, and in `infra_usd`. A bill for the run's task is the billable lines, which leave it out; the run's own sessions' time stays billable. The run read leaves it out too, so no caller has to subtract it: `cost.tools_usd` (`toolsusd/4`) counts no absorbed line, and the new `cost.billable_usd` (`billable/1`) is `usd` less every absorbed line's cost, exactly `usd` for a run with none, and null only when `usd` is or an absorbed line's cost is unknown. While the run is at work, the absorbed cost it subtracts is read from the same journal records as `usd`, so a charge booked after the read is never subtracted from a `usd` that does not hold it.
|
|
93
|
+
|
|
94
|
+
`@parcha/agentrun-computer` adds `releaseUnheld(provider, run, epoch, held, { signal?, releasing?, released? })`, which lists the run's computers and releases each of that epoch the `held` predicate (sync or async, asked after the list) refuses, running `releasing(computer)` before each release is sent (one that throws holds that computer back, named in `failed`) and `released(computer)` once it answers, before the next is sent (`UnheldHooks`), and `ComputerInfo.createdAt`, which the Browserbase and Kernel listings now fill. Its README also names a gap it leaves: a create's lookup that answers a lost create's browser while a newer one runs, which that create's last read then releases; the lookup's holder loses one call and its page state, as its next call finds the browser ended and opens a fresh one. `@parcha/pi-browser` adds the `onRaceReleased` option, called with the ids a release by a session's tag ended besides that session's own, once a status read confirms each stopped: one whose release stopped it and then failed is kept with the release and told by the attempt, abort handler or reconcile that confirms it. A lost create's tag lookup tells the extra sessions it releases the same way. Each such id is saved on the session's inventory row (`InventoryRow.owed`, a new optional field) before its stop is sent, and stays there until a status read confirms its stop and it is told, across a restart: the session's own release confirms what its row owes, and a run open's reconcile what a lost row owes. A lost row's reconcile tells each session it confirms stopped even when another's release fails. A provider's `findByTag` may say when it made each session (`LeaseRef.madeAt`, a new optional field); that time is saved on the row beside the id (`InventoryRow.made`) and handed to `onRaceReleased` as `madeAt`, so a session told by a later process is charged from when it was made, not at an unknown amount. A browser a process charged and then was told again by a later one (its process ended before pi-browser's commit) is not charged again: serve reads the run's committed charges of such browsers once per process.
|
|
95
|
+
- A runner's graceful `close()` now resolves only after each live run's tool hosts have let go of what they hold, and their charges are booked under the claim the runner still holds. Before, the shutdown sealed the run's journal and aborted its ledger first, so a browser session's release charge was refused ("a tool host's beforeRelease failed: the loop stopped (shutdown)") and a priced computer's last stretch went unbooked. A shutdown's seal now lets the release hooks' commits through until they return; the claim's fence still refuses them once the claim is lost. On the run's cap, money already owed (a computer's time, a browser session's release) is booked after the run's stop, since nothing starts with it; every other step is still refused after a stop. <!-- changes/close-books-release.md -->
|
|
96
|
+
|
|
97
|
+
The wait is bounded, and the close's window now runs from its start:
|
|
98
|
+
- A run's release waits for its tool hosts up to a computer provider's cleanup bound (`cleanupMs`, 30 s by default) and a 5 s margin, never past the close's window. A host still going then is cut: each open browser session's time up to the cut is charged (pi-browser's `charge` handle), and the run's root records an `agentrun.release.cut` entry with the bound, the time taken and how many hosts finished. The session's release, when it lands (on this claim or the next one's), bills only the time after that charge. If the charge went past the release's own time, the release bills 0 s, and its `agentrun.browser_charged` entry carries `overbooked_s`. A reserve the cut claim left held is given back at the next claim's reopen. The cut reaches every conversation of the run, its subagents' included. pi-browser's `charge` now skips a session already charged through now, so a cut books no $0 charge under it.
|
|
99
|
+
- A lost create's recovery under way in the process (`recoveriesInFlight()`, new in `@parcha/agentrun-computer`, with `recoverCreate` now exported) is waited for at the close: each up to its own bound, or the drain, and the margin. A run's own process (`run-child`) waits for its own recoveries before it exits, and its runner gives that exit the release's bound.
|
|
100
|
+
- A person's stop gives a run's own process the release's bound and 5 s for the cut's booking on top of its 30 s stop, so a release that never answers is cut, charged and recorded before the process is ended. A release already under way when a shutdown arrives follows it: its cut is moved to the close's window, and the shutdown's seal lets the release's commits through. A run a person's stop already stops when the runner closes keeps that stop as its end, and its release is cut by the close's window too, in the runner's process or its own, so its cut is charged and recorded before the close ends.
|
|
101
|
+
- The close is now the drain plus the lease less its margin (31 s with the image's 6 s drain), or the cleanup bound and 10 s of margins from the close's start, whichever is longer: 40 s by default. Claims are renewed until the close returns. `startRunner` takes `cleanupMs` for a runner whose providers use a longer one.
|
|
102
|
+
- The deploy templates give a runner more time to stop: 45 s in `deploy/compose.yaml`, the Helm chart (`terminationGracePeriodSeconds`), Coolify and Dokploy, 45 s of Railway draining (`RAILWAY_DEPLOYMENT_DRAINING_SECONDS`), and 50 s on Fly (`kill_timeout`). A deployment of its own gives a runner at least 45 s, and at least `cleanupMs` + 15 s with a longer cleanup bound.
|
|
103
|
+
|
|
104
|
+
## 0.1.0-beta.63 (2026-11-26)
|
|
105
|
+
|
|
106
|
+
- `BrowserExtensionHandle.charge(conversation, context)` bills each open session of a conversation through now, not final. A session counts as open when it is live, held, or releasing (its release asked and not yet confirmed). The charge and the session's `chargedThrough` move in one commit, and it resolves to the number of sessions charged. A host that stops waiting on a session's release uses it to book the time known so far. The release's own charge, when it lands, bills only the time after that, so a cut charge followed by the final charge books what one uninterrupted session books, the provider's minimum included. A charge through a time before the session's `chargedThrough` bills nothing, never a negative amount, and reports the difference in seconds as `SessionCharge.overbookedS`. That happens when the release was confirmed before an earlier charge that billed past it. A session billed final is never billed again. <!-- changes/pi-browser-cut-charge.md -->
|
|
107
|
+
|
|
108
|
+
## 0.1.0-beta.57 (2026-11-24)
|
|
109
|
+
|
|
110
|
+
- `@parcha/agentrun-web` is new: the machinery behind `web_search` and `web_fetch`, moved out of `@parcha/agentrun-serve` with no change to what a model is sent or told. It holds the providers (Parallel, keyless Firecrawl, keyless Exa, a hosted search given as a function, and the direct fetch), a breaker per provider, the per-run page cache read in parts, and Parallel's prices. It imports no server, browser or vendor SDK code. The provider order, keys, public-host guard, run cap and refusal words come in through `WebConfig`. `createWeb(config)` answers a search or a fetch together with a receipt of the providers tried and the fees sent. `@parcha/agentrun-web/text-urls` exports the link finder alone. `@parcha/agentrun-serve` now depends on it and answers both tools through one `createWeb` per run, with pi-browser's `publicFetch` and `publicCheck` as the guard. `@parcha/pi-browser` exports `publicCheck(url, { lookup, signal })`, the check `publicFetch` makes on every hop, without dialling. Both refuse a loopback, `.local` or `.internal` name written with one or more trailing dots before any lookup, as they refuse it without them. <!-- changes/web-extract.md -->
|
|
111
|
+
|
|
112
|
+
Two things a server's users can see change:
|
|
113
|
+
|
|
114
|
+
- A workflow's call node that runs `web_search` now gets its answer held to 100,000 characters, as an agent's `web_search` already was. Past that, the least relevant results are left out and `omitted` counts them. Before, a call node got the whole answer.
|
|
115
|
+
- The MCP client keyless Firecrawl and keyless Exa are asked through now names itself `agentrun-web` in its `initialize` request, in place of `agentrun-serve`.
|
|
116
|
+
- A run with a spend cap can send fal's talking heads, `veed/fabric-1.0` at `"resolution": "480p"` or `"720p"` and `fal-ai/bytedance/omnihuman/v1.5`: each job is held at its voice's length, read before the call from the audio at its `audio_url` alone (on fal's own media, `fal.media` or a subdomain: a voice fal made, or one uploaded to fal; the URL written exactly as it parses, so `V3.fal.media`, a space, a `..` segment or `:443` is not priced), in whole seconds as fal bills them, at get_pricing's rate. The length is what the voice plays: every audio frame of an MP3 (a first frame holding a Xing, Info or VBRI header is skipped, as a decoder skips it), or a PCM WAV's samples at its sample rate, every byte after its data header counted. It is never read from the job's image, from a length its input states, or from a length the file's own header states (an MP3's Xing, Info or VBRI frame count, a WAV's byte rate or data size), which whoever made the file could write short. Only a voice on fal's own media is priced because fal fetches the `audio_url` again after this read, and another host could serve fal a longer voice than the one measured. The voice is read https only and following no redirect (fal.media serves its files directly), so a fal.media URL can't send the read to another host, through the same public-host guard as web_fetch and web_save, and at most 32 MiB. A job is still refused unsent under a cap, as before, when its voice can't be read (an `audio_url` that is not https or not on `fal.media`, a private host, over 32 MiB, a timeout, a WAV that is not integer PCM or float with one format chunk whose fields agree, an MP3 with bytes that are not frames, or any other format: an mp4 or m4a voice states its length only in its header), and for Fabric with no `resolution`: its resolution has no default, so send `"480p"` or `"720p"` (720p is held at $0.15 a second against 480p's $0.08, as fal bills it; see the fal setting tiers note). With no cap such a job runs, booked as an unknown charge, never $0. Fabric's reply states no length, so it is booked at its hold: the ledger books the voice's length, read before the call, not a length fal reports. OmniHuman settles at the length its reply states, in whole seconds. LatentSync, infinitalk and `ffmpeg-api/merge-audio-video` stay unpriceable under a cap. <!-- changes/fal-talking-head-price.md -->
|
|
117
|
+
`publicFetch` and `publicDownload` take `httpsOnly`, which refuses http on the first hop and at every redirect, and `maxRedirects` (a whole number from 0 to 5, default 5; with 0 any redirect is refused before its target is dialled; any other value is a `RangeError` before a lookup).
|
|
118
|
+
A job billed by length is priced from a length its input names only on the endpoints whose input sets the length fal bills, and only from that field: `duration` on Kling v2.5 turbo pro (text and image to video), Kling v3 pro image to video, Hailuo-02 standard text to video, Veo 3 fast, Veo 3.1 (fast, image to video) and ACE-Step; `seconds_total` on Stable Audio 2.5; `music_length_ms` or `composition_plan` on ElevenLabs Music. Before, any per-second or per-minute endpoint trusted a named `duration`, `duration_seconds`, `seconds_total` or `music_length_ms`, so a capped run could send `fal-ai/sync-lipsync/v2` with a 10 minute video and `duration: 0.001` and be held at about $0. Now dubbing, voice isolation, speech-to-text and sync-lipsync v2 are always priced from the media they are given, and any other endpoint billed by length (LatentSync, infinitalk, a merge, Fabric fast, OmniHuman v1, an endpoint this server doesn't know) is refused unsent under a cap, whatever length its input names. A listed endpoint that names no length, or another of the length fields, is refused unsent too.
|
|
119
|
+
An ElevenLabs Music job with a `composition_plan` is priced from its sections' `duration_ms`, never from a `music_length_ms` beside it: before, `music_length_ms` was read first, so a job naming 10 s beside a 10 minute plan was held at 10 s and billed for 10 minutes. A job naming both is refused unsent under a cap (send one: a plan sets the length, and `music_length_ms` goes only with a prompt), and so is a plan with `respect_sections_durations` other than `true` or left out (its default), since the model may then change the sections' lengths.
|
|
120
|
+
|
|
121
|
+
## 0.1.0-beta.50 (2026-11-20)
|
|
122
|
+
|
|
123
|
+
- `web_save {url, path}`, a new host tool, saves one public file (at most 200 MiB) into the run's `work/`, a bare name under `media/`. It downloads through `web_fetch`'s guard, never overwrites, and saves media only when the bytes, the declared type and the extension agree. An agent gets it by naming it. pi-browser adds `publicDownload`, the bytes version of `publicFetch`. A template eval's `web:` fixture takes an optional `save` section. <!-- changes/web-save-tool.md -->
|
|
124
|
+
|
|
125
|
+
## 0.1.0-beta.49 (2026-11-20)
|
|
126
|
+
|
|
127
|
+
- A session whose create answer was lost, and which the release task found later by its tag, is now told to the host's `onSession` at its release with the id that lookup found and the bill its release records. Before, the host heard it with `resourceId` null and nothing spent, because the release is told before the commit that records them. <!-- changes/pi-browser-release-found-id.md -->
|
|
128
|
+
|
|
129
|
+
## 0.1.0-beta.44 (2026-11-17)
|
|
130
|
+
|
|
131
|
+
- An agent whose computer is a browser can record its runs: `computer: {"kind": "browser", ..., "record": true}` makes a video of each browser session's page, `recordings/<computer>.mp4` with one file per session, under the same caps, pause and stop rules as a desktop's or a phone's, listed in the run read's `recordings` and served by the files route. A browser with `record: true` was refused with 422 before.
|
|
132
|
+
- The video is the live view's own CDP screencast of the session, shared with a person's viewer (one screencast per session, never a second); each frame is stamped as it comes, so a page that sits still does not shorten the video.
|
|
133
|
+
- `@parcha/pi-browser`'s live view takes a host's watch of a session's frames, with or without a viewer: `liveView.watch(tag, { frame, ended })`. A viewer that joins a stream already running is sent the page, any dialog and the newest frame.
|
|
134
|
+
|
|
135
|
+
## 0.1.0-beta.39 (2026-11-16)
|
|
136
|
+
|
|
137
|
+
- A template eval case can fake the web: `web: unavailable` in its `case.yaml` fails every `web_search` with the words a rate-limited free search answers with and every `web_fetch` as a page that never answers, and `web: <fixture file>` answers each search from the first answer whose `query` (a regular expression) matches and each page from the answer for its exact URL, else the fixture's default. No call reaches the network, the calls show in the run's timeline and the graders' tool calls, so `tool_used` counts them, and the fixture is checked whole before any run.
|
|
138
|
+
- The same fake holds on pi, claude-agent and codex: on claude-agent and codex a faked case's runs are never offered the harness's own web search, so the run's `web_search` is the one that answers.
|
|
139
|
+
- Only the eval's own in-process server honours `web`; no package field, API field, setting or environment variable turns it on, and a case with `web` refuses to run with `--server`.
|
|
140
|
+
- Fix: a guarded public fetch of a 2xx answer with no body (204, 205) reads as an empty page instead of failing with "Cannot read properties of null".
|
|
141
|
+
|
|
142
|
+
## 0.1.0-beta.38 (2026-11-14)
|
|
143
|
+
|
|
144
|
+
- web_fetch reads a site's feeds: a reply of type `application/<name>+xml` or `application/<name>+json` (`application/atom+xml`, `application/rss+xml`, `application/ld+json`) is text, read as it came.
|
|
145
|
+
- GitHub's `releases.atom` and `commits.atom` were refused as "not text", so an agent could not read a public repository's releases or commits that way. The rule is the same on every harness: claude-agent and codex run pi's web_fetch.
|
|
146
|
+
- Every other non-text type (a PDF, a zip, `application/octet-stream`, an `image/svg+xml`) is still refused.
|
|
147
|
+
|
|
148
|
+
## 0.1.0-beta.37 (2026-11-13)
|
|
149
|
+
|
|
150
|
+
- A run's live view (its browser, desktop or phone, watched and taken over) works when its runner is on another host than the server, as in the compose stack's server and runners. Breaking for a SQLite store: its schema version moves to 9, so a server refuses a SQLite store an earlier version made; start it on a fresh data directory. A Postgres store migrates itself (migration 0007). A runner names the host the server reaches it at (`AGENTRUN_RUNNER_LIVE_HOST`, listening there or on `AGENTRUN_RUNNER_LIVE_BIND`), and each viewer's row in the store carries that host (a new nullable `computer_viewers.host`). The server dials a row's host only when it is one of its runners' (`AGENTRUN_RUNNER_HOSTS`), and signs each request it makes of the viewer with an HMAC under a key derived from the seal key; a runner's viewer off loopback refuses, before any WebSocket, a request with no good, fresh proof for its own viewer, and the viewer's token still decides who watches. The hop between server and runner is plain HTTP, for a private network. With neither setting, every viewer stays on loopback as before. `@parcha/pi-browser`'s `createLiveView` takes `listen` (the address its own server listens on and the host its links name) and `admit` (a host's own check of every page request and upgrade).
|
|
151
|
+
- A desktop's or a phone's screen is watched and taken over live, as the browser's is. The runner opens its view as it claims the run's computer: `openComputerView` (computer-live.ts) starts the computer's viewer on loopback and hands it over in the store under the run's claim (`computer_viewers`, the token sealed); a stale claim is refused `fenced`, and an open that fails is refused `failed` in words with nothing left listening. Its WebSocket speaks the browser viewer's protocol: hello, ready with Take over, the screen's frames (JPEG or PNG) each sent once the viewer acked the one before (a frame held back for a slow viewer is replaced by a newer one, and the replaced frame is acked), and Take over and Hand back through the run's hold, the same take-over and hand-back the routes write. Input is mapped by one `createActionMapper` per take and reaches the computer only while the person holds it, as the run's own hold says at that moment, so input stops as soon as a take ends; otherwise it is answered `held` ("Take over to drive."), and what a desktop refuses (ctrl+alt+F1, ctrl+alt+Backspace) comes back in words. The mouse buttons a take holds are let go when the viewer loses focus, before a hand back, and once when a take ends on the run's side or the viewer goes. One viewer per computer; a viewer that goes mid-take hands the take back (`away`). The runner now journals the hold of every run's desktop or phone (computerForClaim hands it to the run's spec), so `GET /v2/runs/{id}/computer` answers live with `kind` `desktop` or `phone` and who drives, and the viewer's own page (Take over and Hand back; a phone's back, home and recents) is served under `/v2/runs/{id}/computer/live/`, its socket proxied to the runner's endpoint with the same checks as the browser's. `@parcha/pi-browser/live-view` exports its WebSocket server and token helpers for it. A desktop or phone run whose screen is not open answers `GET /v2/runs/{id}/computer` `none` with its kind, no longer `off` with "this run's agent has no computer" (#2170). The viewer types from a phone's or tablet's soft keyboard too (its `beforeinput` text, deletes and Enter), with a desktop's keys still sent once. Under `--faux`, a run on the faux desktop starts and is claimed by the runner (its start check and the runner's claim read `--faux`'s computers beside the package's), and its screen is watched and taken over through this same viewer; the faux desktop's old page under `/faux/desktops/` is gone.
|
|
152
|
+
- The pi family and Chord move from 1.5.0 to 1.5.2 together (pi-ai, pi-agent-core, pi-coding-agent, pi-codemode, pi-durable, chord). Pi's model catalog now lists `claude-fable-5-2`, so a pi run can use it. Chord's package root no longer exports `Context` or `JsonValue`; they come from `@earendil-works/chord/context` and `@earendil-works/chord/json`, which a host that imports them from the root must follow.
|
|
153
|
+
- `web_fetch`'s text (a page read directly, `readPage`) leaves out what the page hides from everyone who reads it: an element with the `hidden` attribute, an inline `display:none` or `visibility:hidden`, a closed `<dialog>`, a class the page's own `<style>` sets to `display:none` or `visibility:hidden`, and the common pop-up and display-none utility classes (`mfp-hide`, `modal`, `d-none`, `hidden`, `hide`, `invisible`, `is-hidden`, `u-hidden`). A record page's help pop-ups, hidden until a click, were read as the record, so an agent took their boilerplate ("notice of intent to dissolve") for the company's own. Text only a screen reader reads (`sr-only`, `visually-hidden`, `wb-inv`, `screen-reader-text`) and text marked `aria-hidden` stay in the text: each is shown to someone. Only the page's live style elements count (none in a comment, a script, a template or a noscript, and only those for the screen); a later declaration or rule that shows the element wins (inline over a class, an author `display` over the `hidden` attribute), and where the outcome is unclear (an `!important` mix, classes in conflict, a class a compound selector shows) the text is kept. An element hidden by visibility alone is kept whole when anything shown inside it is set visible again (visibility is inherited and a descendant can override it; one that is itself, or sits inside, a `display:none` element shows nothing); `display:none` is not, so its element always goes. A class or style value is read with its character references decoded. A hidden element that no end tag closes is still read. Pages read through Parallel's extract are unchanged.
|
|
154
|
+
|
|
155
|
+
## 0.1.0-beta.36 (2026-11-13)
|
|
156
|
+
|
|
157
|
+
- The browser tool has one stack: whether the agent's computer is a browser or the tool plane picks the vendor, every session is a browser computer of the computer registry's providers, made at the tool's call under the run's labels, and pi-browser's raw-CDP driver (`cdpDriver()`) drives it. Stagehand drives no run's browser now. Breaking: Browserbase and Kernel browsers now refuse run code and file uploads (browser_upload), and their snapshot is the raw-CDP list; every browser computer uses one driver. Breaking: pi-browser's `./providers/browserbase` and `./providers/kernel` exports and its `@browserbasehq/sdk` peer dependency are gone (a hosted browser is a browser computer provider of `@parcha/agentrun-computer`), and so are Browserbase's and Kernel's `create(spec, { settings })` vendor-field bag and its `BrowserbaseSessionSettings` and `KernelBrowserSettings` types (put a session's options in `spec.browser`).
|
|
158
|
+
- `@parcha/agentrun-computer`: a browser's own options ride the spec, `spec.browser` (`viewport`, `profile: { pointer, save }`, `stealth`, `headless`), and `capabilities().browser` declares what a provider's sessions offer (`timeout`, `profiles: { settleMs }`, `stealth`, `headless`, `downloads: { path }`). `check()` refuses an option the provider does not declare, in words. Browserbase and Kernel gain the optional `profiles { create, remove }` member, and Browserbase `downloads { list, read }`. Local Chrome declares `{ timeout: "wall-clock" }` and opens its window at the spec's viewport.
|
|
159
|
+
- `@parcha/pi-browser`: `ProviderCaps` is `profiles`, `sharedBrowser`, `settings`, `fixedSession` and `navigationAllow`; the session vault keeps a local Chrome's sessions alone. `cdpCall` is exported from the package root.
|
|
160
|
+
- agentrun-serve: on Browserbase and Kernel, the browser tool's `run` now takes actions only, as it does on Local Chrome (code is refused in words, and navigation is a `goto` action), its `snapshot` is the raw-CDP driver's, and `browser_upload` is refused (the driver sets no file input). A session carries the run's labels and its custody tag, as an agent's browser computer's does.
|
|
161
|
+
- `ScreenshotOptions.scale` (and `FakeScreenshotOptions.scale`) is a number, the fraction of the device-pixel capture to take, in place of `"css" | "device"`; a driver that passed `scale: "css"` passes `1 / devicePixelRatio`, and a custom `PageDriver.screenshot` honors a number below 1, else `captureWithinBudget` throws `ScreenshotBudgetError` for a capture over budget that it does not take smaller.
|
|
162
|
+
|
|
163
|
+
A screenshot over the 2,000 px long edge now shrinks to fit (CDP `clip.scale`) before its JPEG quality drops, so a long page on a device scale of 2 (stripe.com/pricing, a 2576x1248 viewport) comes back as a 1977x969 viewport in place of `ScreenshotBudgetError`; a full page whose fit would leave its short edge under 600 px is taken as the viewport, and the error is left for a browser that gives no capture that fits. On the runner, an image block in a tool's answer whose data is a PNG, JPEG, GIF or WebP of the type it names, with no held key in its bytes, is no longer cut to `[redacted]` by the run's key cut (any other `data` is cut as before) (which sent the model a `data:image/png;base64,[redacted]` URL and failed the run with a 400), and every image a model request carries is checked where it is attached: one with an unknown type, no data, data that is not base64, bytes of another type or a header that does not say its size goes as `[the image could not be attached: <why>]`.
|
|
164
|
+
- A run that asks its person a question with its browser open keeps that browser while it waits, for the person's window, `AGENTRUN_BROWSER_PERSON_WAIT_MIN` (15 minutes by default; the same setting now bounds a take-over with no input and an agent's hand-over ask). Before, the browser's own 3-minute idle release let it go while the run waited, so the page, the live view and Take over were gone just when the person might use them. At the window's end the browser is released with a timeline row saying so ("The browser was released after 15 min waiting for you"), and an answer after that opens a new browser. The Screen tab says the browser was released, and when, instead of "Waiting for the browser" (GET /v2/runs/{id}/computer's `none` carries `ended: {at, why}`). pi-browser's extension handle gains `keepForPerson(tag)`, which holds a session from its idle release until let go.
|
|
165
|
+
- The server and Pi browser READMEs state the Node minimum the packages enforce: 24.22.3 (the server image and the test suites run on it), not Node 22.
|
|
166
|
+
|
|
167
|
+
## 0.1.0-beta.35 (2026-11-11)
|
|
168
|
+
|
|
169
|
+
- The `use_website` tool is removed from the durable adapter: no host passed `sites`. Gone with it: `createBrowserExtension`'s `sites` option, the handle's `docs.Children`, the root exports `useWebsite`, `useWebsiteContract` and `localSites`, and the types `SiteInfo`, `SiteRunPort` and `ChildRunner`. A host that wants an agent to hand a task to another agent runs that agent itself.
|
|
170
|
+
- The durable adapter's own `web_fetch` and `web_search` are removed: no host used them (AgentRun's server runs its own web tools). Gone: `createWebExtension` and `WebExtensionOptions` (`/durable`); `createWebTools`, `WebBackup`, `FetchSource`, `SearchSource` and the rest of the web tools' exports (root); a provider's `fetch` and `search` (Browserbase's Fetch and Search APIs, the fake backend's `fetches` and `search` options) with `FetchRequest`, `FetchResult`, `SearchRequest`, `SearchResult` and `SearchHit`; the `web_fetch` and `web_search` tool contracts (`WEB_TOOLS`, `WEB_TOOL_NAMES`, `WEB_SEARCH_SNIPPET_MAX`, and the `fetch` and `search` values of a contract's `listedWhen`) and `web_fetch` as an `EvidenceTool`; `fetchUsage`, `searchUsage`, `scrubFetchedUrl`, and Browserbase's `SEARCH_QUERY_MAX` and `SEARCH_RESULTS_MAX`. The page-wall words a browser read uses (`WALLS`, `wallOf`, `wallFailure`, `pageNotice`, `INJECTION_THRESHOLD`) stay. A host that wants fetch or search gives its agent its own tool.
|
|
171
|
+
- A browser that opens with its agent's saved browser profile now says so before its tools. The prompt section's second line tells the model that a site the agent was signed in to there opens signed in, to use the browser rather than `web_fetch` for a page that needs a sign-in (`web_fetch` reads every page signed out), and that a sign-in page means this session has no sign-in for that site (a saved one may still exist, as when a restore failed). `run`'s description says the same. Before, the model was told only that the browser "keeps this agent's saved sign-ins", which didn't connect a signed-in page to the browser, so it fetched one with `web_fetch` and read the sign-in page. The line promises no sign-in, because an agent's first profile is new and holds none, and it names no site, profile id or account: a saved profile doesn't record which sites it covers. Nothing changes for a browser with no saved profile.
|
|
172
|
+
- A run whose files live on the run's Archil disk (Mode 2) can read what its browser saved. browser_read and screenshot file their evidence in the run's own folder on the disk, where the run's `read` opens it; before, they wrote to a local folder that a Mode 2 run never has, so the call failed. browser_upload chooses from the same folder, and refuses a path that would leave it. browser_downloads, which copies into a folder of the runner's machine, is offered only where the run's files are on that machine (Mode 1), so a Mode 2 run is never told a file was saved where it cannot open it.
|
|
173
|
+
pi-browser exports `uploadMime(name)`, the media type browser_upload gives a file by its name.
|
|
174
|
+
|
|
5
175
|
## 0.1.0-beta.34 (2026-11-11)
|
|
6
176
|
|
|
7
177
|
- The package keeps only what a host runs: the core, `/durable`, `/live-view`, `/driver/stagehand`, `/testing` and the providers (Browserbase, Kernel and the local Chrome). Three entries are removed, with no replacement shim:
|
package/NOTICE
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
AgentRun
|
|
2
2
|
Copyright 2026 Parcha Labs, Inc.
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
The boxd computer provider (packages/computer/src/boxd.ts) was contributed by Michiel Voortman.
|
|
5
|
+
|
|
6
|
+
This package contains three pieces of Stagehand (https://github.com/browserbase/stagehand), all under its MIT license,
|
|
5
7
|
whose text follows:
|
|
6
8
|
|
|
7
9
|
- The Chrome launch flags in src/providers/chrome-args.ts, copied from Stagehand 4.1.0's
|
|
@@ -9,6 +11,9 @@ whose text follows:
|
|
|
9
11
|
- The files in src/vendor/stagehand-facade (compiled to dist/vendor/stagehand-facade), copied from Stagehand 4.1.0's
|
|
10
12
|
packages/integrations/core/src/facade at commit cd7b230778cf92269e4cb90e80d97f5113781c51. UPSTREAM.json, shipped
|
|
11
13
|
beside them as src/vendor/stagehand-facade/UPSTREAM.json, records each file's upstream blob and SHA-256.
|
|
14
|
+
- The lines of Stagehand 4.4.0's dist/extension/service-worker.js that src/providers/worker-extension.ts quotes, and
|
|
15
|
+
rewrites in the copy of Stagehand's extension it gives a local Chrome. That copy carries Stagehand's LICENSE and a
|
|
16
|
+
NOTICE naming what changed in it.
|
|
12
17
|
|
|
13
18
|
MIT License
|
|
14
19
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Your agent gets its own browser, and you can take over and hand it back.
|
|
4
4
|
|
|
5
|
-
- **Its own browser.** The agent drives a Chrome of its own: a local Chrome, Browserbase
|
|
5
|
+
- **Its own browser.** The agent drives a Chrome of its own: a local Chrome, or a hosted browser its host provides (agentrun-serve's Browserbase and Kernel, through its computer providers). It reads pages, clicks, types and takes screenshots. A local Chrome needs no key.
|
|
6
6
|
- **You can take over and hand it back.** A host mounts the live view in a few lines, and then a person sees the agent's page, uses the mouse and keys, and lets the agent go on. While the person is driving, the agent's browser calls are refused. The agent can also ask a person for a step only a person can do, and wait for the answer. See [Take over and hand back](#take-over-and-hand-back). For now, use the live view with test accounts on practice sites only: the model's own page code can read what a person types there.
|
|
7
7
|
- **Credentials you register stay out of what the model sees.** Credentials you register, and keys of the common shapes, are replaced with `[redacted]` in every tool result, failure, filed page and log. See [Credentials](#credentials).
|
|
8
8
|
- **Every page the agent reads is filed as evidence.** The file holds the page's URL, its title and its SHA-256.
|
|
@@ -10,7 +10,7 @@ Your agent gets its own browser, and you can take over and hand it back.
|
|
|
10
10
|
|
|
11
11
|
If the process dies, a pi-durable host recovers the session and does not repeat an action. See [For hosts](#for-hosts).
|
|
12
12
|
|
|
13
|
-
Part of [AgentRun](https://github.com/Parcha-ai/agentrun). Node `>=22.
|
|
13
|
+
Part of [AgentRun](https://github.com/Parcha-ai/agentrun). Node `>=24.22.3`, pi 1.5.2 exactly (its
|
|
14
14
|
pi-durable and chord peers). ESM only: the
|
|
15
15
|
package has `import` entries and no `require` entry.
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ package has `import` entries and no `require` entry.
|
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
20
|
npm install @parcha/pi-browser@latest # the library: providers, driver, durable adapter
|
|
21
|
-
npm install @parcha/pi-browser@latest @earendil-works/pi-durable@1.5.
|
|
21
|
+
npm install @parcha/pi-browser@latest @earendil-works/pi-durable@1.5.2 @earendil-works/chord@1.5.2 @earendil-works/pi-ai@1.5.2 # a pi-durable host: its peers, pinned to 1.5.2
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Quick start
|
|
@@ -67,7 +67,7 @@ await backend.provider.release(session);
|
|
|
67
67
|
EOF
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
It prints the page's accessibility tree, the same text `snapshot` gives a model:
|
|
70
|
+
It prints the page's accessibility tree, the same text that `snapshot` gives a model:
|
|
71
71
|
|
|
72
72
|
```
|
|
73
73
|
[0] main
|
|
@@ -76,24 +76,23 @@ It prints the page's accessibility tree, the same text `snapshot` gives a model:
|
|
|
76
76
|
|
|
77
77
|
## Demos
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
Two runnable demos live in `examples/` in the repository. They are not in the npm package. Build once with `pnpm install --frozen-lockfile && pnpm run build`, then run one from the repository root. Each needs Chrome or Chromium (`CHROME_PATH` names it) except where it says otherwise.
|
|
80
80
|
|
|
81
81
|
| Demo | Run | What it shows |
|
|
82
82
|
|---|---|---|
|
|
83
|
-
| [`examples/one-script-three-providers.mjs`](examples/one-script-three-providers.mjs) | `node packages/pi-browser/examples/one-script-three-providers.mjs https://example.com` | The same script on a local Chrome, Browserbase or Kernel. `PI_BROWSER_PROVIDER=browserbase` needs `BROWSERBASE_API_KEY` and the Browserbase SDK; `kernel` needs `KERNEL_API_KEY`. The tests run the local Chrome path only. |
|
|
84
83
|
| [`examples/hold-an-irreversible-action.mjs`](examples/hold-an-irreversible-action.mjs) | `node packages/pi-browser/examples/hold-an-irreversible-action.mjs` | Under the `ask` policy a form post is held until a person approves it. The demo refuses, and the local server it posts to counts zero requests. |
|
|
85
84
|
| [`examples/crash-and-resume.mjs`](examples/crash-and-resume.mjs) | `node packages/pi-browser/examples/crash-and-resume.mjs`, twice | The first run sets a page title and kills itself with SIGKILL between two tool calls. The second recovers the same Chrome from the run's own store and reads the title back. A scripted model stands in for a real one. It uses the pi-durable packages the repository already installs. Delete `$TMPDIR/pi-browser-crash-demo` to start over. |
|
|
86
|
-
| [`examples/read-a-pdf.mjs`](examples/read-a-pdf.mjs) | `node packages/pi-browser/examples/read-a-pdf.mjs` | `web_fetch` on a PDF the fetch service cannot convert. It fetches the file raw and hands the bytes to your extractor, here poppler's `pdftotext` (needs poppler installed). The fetch service is a stand-in that answers HTTP 400 for a PDF, as Browserbase does. It does not need Chrome. |
|
|
87
85
|
|
|
88
86
|
## Providers
|
|
89
87
|
|
|
90
|
-
The same tools run on
|
|
88
|
+
The same tools run on any browser a `BrowserProvider` gives. The package carries the local one; a hosted browser is the
|
|
89
|
+
host's, through a provider of its own (agentrun-serve drives Browserbase and Kernel through its computer providers, so the
|
|
90
|
+
package names no vendor).
|
|
91
91
|
|
|
92
92
|
| Provider | What it is | What it needs |
|
|
93
93
|
|---|---|---|
|
|
94
94
|
| Local Chrome (`/providers/cdp`) | A Chrome the package starts and stops by exact pid, with its own profile directory and a free debugging port. It can also attach to a Chrome you already run, at a CDP endpoint. | Chrome or Chromium 137 or later. No key. |
|
|
95
|
-
|
|
|
96
|
-
| Kernel (`/providers/kernel`) | A Kernel browser, through its REST API. | `KERNEL_API_KEY`. No SDK. |
|
|
95
|
+
| A host's own (`BrowserProvider`, `core/host.ts`) | Any browser that answers CDP: the host makes, finds and releases its sessions and hands over a CDP URL. | Whatever the host's vendor needs. |
|
|
97
96
|
|
|
98
97
|
The local Chrome's options, in `cdpProvider({ chrome: { ... } })`:
|
|
99
98
|
|
|
@@ -104,7 +103,7 @@ The local Chrome's options, in `cdpProvider({ chrome: { ... } })`:
|
|
|
104
103
|
| `args` | Extra Chrome flags, added after the package's own. |
|
|
105
104
|
| `sandbox` | Chrome's own sandbox, on unless `false`. When absent, `PI_BROWSER_NO_SANDBOX=1` turns it off. Turn it off only where Chrome cannot start its sandbox (root, a container, restricted user namespaces), and only for pages you trust. A Chrome that exits before it opens its debugging port fails the create with its last lines of stderr, and with this hint when it aborted or named the sandbox. |
|
|
106
105
|
|
|
107
|
-
A host passes the provider it wants; see [For hosts](#for-hosts).
|
|
106
|
+
A host passes the provider it wants; see [For hosts](#for-hosts).
|
|
108
107
|
|
|
109
108
|
## Take over and hand back
|
|
110
109
|
|
|
@@ -146,7 +145,9 @@ token is 256 random bits in the fragment, so it reaches no server log, proxy or
|
|
|
146
145
|
nothing is accepted before it. The upgrade's `Origin` must be the viewer's own origin (behind a proxy, pass the upgrade through with `Origin` intact).
|
|
147
146
|
There is one authenticated viewer per session (a second is refused `viewer_in_use`); the token, the stream and the viewer's socket end at the session's release.
|
|
148
147
|
The page is served with `Referrer-Policy: no-referrer`, `default-src 'self'` and `frame-ancestors` set to `hostOrigin`. The viewer may send a page only to
|
|
149
|
-
http(s) addresses. Frames are held one at a time and acknowledged after they were sent;
|
|
148
|
+
http(s) addresses. Frames are held one at a time and acknowledged after they were sent; the live view writes none anywhere. A host may watch a
|
|
149
|
+
session's frames itself, with or without a viewer (`liveView.watch(tag, { frame, ended })`, which AgentRun's run video records): the viewer and the
|
|
150
|
+
watchers share the session's one screencast.
|
|
150
151
|
|
|
151
152
|
Every browser tool is a model call on its session's gate (`drivingGates`, shared by default between the live view and the toolset, so you pass nothing). To use your own
|
|
152
153
|
registry, pass the same one to both sides: `const gates = createDrivingGates({ idleMs: 5_000 }); createLiveView({ hostOrigin, gates }); createBrowserExtension({ ..., gates });`.
|
|
@@ -188,12 +189,11 @@ This section says where a profile's state lives. A host can ask for a browser pr
|
|
|
188
189
|
Where the profile lives:
|
|
189
190
|
|
|
190
191
|
- **Local Chrome:** a directory `.profiles/<name>` under the profile root you give the provider. A session that saves runs on that directory. A session that does not save runs on a copy, and the profile stays as it was.
|
|
191
|
-
- **
|
|
192
|
-
- **Kernel:** a Kernel profile of that name, created if it is not there.
|
|
192
|
+
- **A host's provider:** wherever its vendor keeps one (agentrun-serve opens a vendor's saved profile by the pointer it holds for the run's sign-in).
|
|
193
193
|
|
|
194
194
|
It is never your own browser's profile.
|
|
195
195
|
|
|
196
|
-
One session at a time may save to a profile in one process. A second saver is refused, and the message says why. Across processes, the last session to end wins.
|
|
196
|
+
One session at a time may save to a profile in one process. A second saver is refused, and the message says why. Across processes, the last session to end wins.
|
|
197
197
|
|
|
198
198
|
|
|
199
199
|
## The tools
|
|
@@ -206,22 +206,9 @@ One session at a time may save to a profile in one process. A second saver is re
|
|
|
206
206
|
| `run` | Act: code, or a batch of ref actions (`goto` takes a URL instead of an id). An AgentRun browser computer (raw CDP) takes actions only. | Never reruns. The model is told the call may have taken effect and where the page was, and the identical code is refused once (`effect_unknown`). |
|
|
207
207
|
| `browser_release`, `browser_relaunch` | End the session; end it and open another. | Idempotent. A create carries a tag, so a rerun finds its session. |
|
|
208
208
|
| `browser_request_handoff` | Hand the session to a person for a step only a human can do, and wait for the host's handoff port to say how it ended. While the person has it, every other call answers `waiting_for_human`. Listed only when the host gives a `handoff` port. | Reruns and waits on the same request; a request asked again carries the same `request_id`, which the port treats as one. |
|
|
209
|
-
| `
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
`web_search` hits carry a `snippet` when the search has one: an excerpt of the page with its markdown links reduced to
|
|
214
|
-
their text, whitespace collapsed and clipped to `WEB_SEARCH_SNIPPET_MAX` (500) characters, redacted with the rest of the
|
|
215
|
-
answer. A host's `searchSources` (`createWebExtension`) are tried in order before the provider's own search; one that
|
|
216
|
-
throws hands the call to the next, a cancelled call is never handed on, and the answer names the source in `via`. A
|
|
217
|
-
source's optional `available()` is asked at each call; one that answers false is skipped without counting as a failure.
|
|
218
|
-
`fetchSources` (`FetchSource`) are readers tried the same way before the provider's own fetch, for a markdown read: a
|
|
219
|
-
page one answers is filed exactly as the provider's is, under `via: <name>_fetch`, and a reader's failure never becomes
|
|
220
|
-
the call's own while the provider can still be tried.
|
|
221
|
-
|
|
222
|
-
`web_fetch` and `web_search` results carry their price as pi usage (the Browserbase provider's list prices; a search
|
|
223
|
-
source's answer at the usage it reports, else the list search price). Session
|
|
224
|
-
minutes are charged by the session meter (`core/usage.ts`, wired into custody): every session tool's result carries the
|
|
209
|
+
| `browser_upload` | Choose one workspace file in a file input on the page, as a person picking it would. Nothing is submitted; `run` submits the form afterwards. The durable adapter lists it only when the host supplies `files`. | Never reruns. An upload the page does not answer fails at 60 s as possibly applied, and the identical retry is refused until the agent has looked at the page. |
|
|
210
|
+
|
|
211
|
+
Session minutes are charged by the session meter (`core/usage.ts`, wired into custody): every session tool's result carries the
|
|
225
212
|
time since the last charge, and each released session's record carries its total. A host that books session time as spend
|
|
226
213
|
passes `onCharge` (below), which hears each charge in the commit that bills it.
|
|
227
214
|
|
|
@@ -273,33 +260,42 @@ Stagehand, undici, zod and the two HTML packages are dependencies. Three optiona
|
|
|
273
260
|
| Peer | Needed for |
|
|
274
261
|
|---|---|
|
|
275
262
|
| `@earendil-works/pi-durable` and `@earendil-works/chord` | `/durable`, the adapter for a pi-durable Harness. |
|
|
276
|
-
| `@browserbasehq/sdk` | the Browserbase provider. Kernel needs no SDK. |
|
|
277
263
|
|
|
278
|
-
The pi peers are `@earendil-works/pi-durable` and `chord` `1.5.
|
|
264
|
+
The pi peers are `@earendil-works/pi-durable` and `chord` `1.5.2` exactly. CI tests pi 1.5.2.
|
|
279
265
|
|
|
280
266
|
## Entries
|
|
281
267
|
|
|
282
268
|
- `@parcha/pi-browser`: the host-neutral core. The model contract (tool names, descriptions, JSON schemas, effect and
|
|
283
269
|
replay classes, the `browser` and `web` prompt sections), the typed failure envelope, the redactor, the screenshot
|
|
284
270
|
budget, the repeat guard, evidence and decision-hook types, usage and prices, `find` (chunking and ranking a long page),
|
|
285
|
-
`browser_downloads`, the opt-in request observer, and the provider interface. The public-host guard is here too: `publicFetch(url, { lookup?, fetchImpl?, signal?, maxBytes? })`
|
|
286
|
-
`
|
|
271
|
+
`browser_downloads`, the opt-in request observer, and the provider interface. The public-host guard is here too: `publicFetch(url, { lookup?, fetchImpl?, signal?, maxBytes?, cut?, beforeRedirect? })` (a text body over `maxBytes` refused, or with `cut` answered as its first `maxBytes`, `cut: true`, the rest never read; `beforeRedirect(url)` asked with each redirect's target once its checks pass, before it is dialled, what it throws ending the fetch there), its bytes
|
|
272
|
+
variant `publicDownload(url, { lookup?, fetchImpl?, signal?, maxBytes?, beforeRedirect? })` (one file of any type, `{ url, status,
|
|
273
|
+
contentType, bytes }`, `bytes` null for a status that is not 2xx; the same hops, checks and pinned dial as
|
|
274
|
+
`publicFetch`, a declared length over `maxBytes` refused before the body is read and a body over it refused as it is
|
|
275
|
+
read), its write `publicUpload(url, bytes, { lookup?, fetchImpl?, signal?, contentType?, userAgent? })` (one PUT of
|
|
276
|
+
`bytes`, `{ url, status }`, the answer's body unread; https only and no redirect followed, so the bytes go to the URL
|
|
277
|
+
given or nowhere, with `publicFetch`'s other checks and pinned dial), and `readPage(html, url, { deadlineMs?, heapMb?, signal? })`, with `isPrivateAddress` (which also counts the ranges in `CLUSTER_INTERNAL_CIDRS` as private, GKE's Service range
|
|
278
|
+
`34.118.224.0/20` when it is unset or blank) and `pinnedLookup`. `readPage` never holds
|
|
287
279
|
the event loop: it drops a page's script, style, svg, noscript and template blocks, cuts what is left at
|
|
288
280
|
`READ_MAX_CHARS` (`truncated`, with the page's length in `html_chars`), and converts it to markdown in a worker thread
|
|
289
|
-
within `READ_DEADLINE_MS`, falling back to the page's plain text (`converted: "text"`).
|
|
281
|
+
within `READ_DEADLINE_MS`, falling back to the page's plain text (`converted: "text"`). A worker that runs out of its
|
|
282
|
+
heap (`heapMb`, default `READ_WORKER_HEAP_MB`) is not followed by that fallback: the read rejects with
|
|
283
|
+
`PageReadOutOfMemory`. Its links stop at `READ_LINKS_MAX`, or once `READ_LINKS_MAX_CHARS` characters of hrefs and
|
|
284
|
+
their base are resolved (`links_truncated`). `browser_read`'s markdown goes
|
|
290
285
|
the same way (of the page's first article, else main, else body, with the browser's own text as its fallback), and
|
|
291
286
|
its frame scan reads the page's first 2,000,000 characters in steps that yield the loop. Outside Node's builtins and
|
|
292
287
|
undici it loads only node-html-parser and node-html-markdown, on demand and in that worker thread.
|
|
293
288
|
- `/durable`: the pi-durable adapter. `createBrowserExtension` is session custody in the run's own store (a create is
|
|
294
|
-
committed before the provider is called, release is a durable task, reconcile runs at run open).
|
|
295
|
-
`web_fetch` and `web_search`.
|
|
289
|
+
committed before the provider is called, release is a durable task, reconcile runs at run open).
|
|
296
290
|
- `/driver/stagehand`: `stagehandDriver()`, Stagehand v4 over upstream's facade, vendored unedited in
|
|
297
291
|
`src/vendor/stagehand-facade/`. `UPSTREAM.json` names the commit and each file's blob id and SHA-256;
|
|
298
292
|
`node scripts/vendor-facade.mjs --check` verifies them and `--commit SHA --release NAME` re-vendors. Stagehand is created
|
|
299
293
|
sealed: no inference, no cache, and no trace endpoint, so no trace is exported. Stagehand attaches one client to a browser
|
|
300
294
|
at a time: closing a driver disconnects it, so the next attach is allowed.
|
|
301
295
|
- `/driver/cdp`: `cdpDriver()`, the driver of every AgentRun browser computer (Browserbase's, Kernel's, or the computer
|
|
302
|
-
package's `local` provider's Chrome on this machine), over its CDP URL.
|
|
296
|
+
package's `local-chrome` provider's Chrome on this machine), over its CDP URL. Browserbase and Kernel browsers now
|
|
297
|
+
refuse run code and file uploads (`browser_upload`), and their snapshot is the raw-CDP list; every browser computer
|
|
298
|
+
uses one driver, this one, which runs no code and sets no file input. It is raw CDP: no Stagehand, and nothing loaded into the browser. `snapshot` is Chrome's
|
|
303
299
|
accessibility tree with the same "frame-node" ids (`[0-42]`: the frame's place, then Chrome's backend node id). `run`
|
|
304
300
|
takes actions only. Each action is scrolled into view, hit-tested at its centre, and pressed and released there, or
|
|
305
301
|
typed with inserted text and a real last key. Each answers one line: `[ok] click [0-42] button "Add" -> page changed`
|
|
@@ -307,9 +303,8 @@ The pi peers are `@earendil-works/pi-durable` and `chord` `1.5.0` exactly. CI te
|
|
|
307
303
|
`{"op":"goto","url":"https://..."}`. A frame another site runs in its own process (a cross-origin iframe) is not read:
|
|
308
304
|
the snapshot names each one it left out. Adapted from Browser Use Pi's `ax.ts`, `cdp.ts` and `page.ts` under its MIT
|
|
309
305
|
license, in `src/vendor/browser-use-pi/` (see NOTICE and that folder's `UPSTREAM.json`).
|
|
310
|
-
- `/providers/
|
|
311
|
-
|
|
312
|
-
Any CDP endpoint, or a local Chrome the provider starts and kills by exact pid.
|
|
306
|
+
- `/providers/cdp`: where the package's own browsers come from: any CDP endpoint, or a local Chrome the provider starts and
|
|
307
|
+
kills by exact pid. A hosted browser is the host's provider (agentrun-serve's, over its computer providers).
|
|
313
308
|
- `/providers/chrome-args`: `chromeArgs()`, the arguments the cdp provider starts a local Chrome with, and `extensionOrigin()`,
|
|
314
309
|
the one Origin its DevTools socket allows (Stagehand's extension). A host that starts its own Chrome for Stagehand takes them
|
|
315
310
|
from here rather than copying Stagehand's `--remote-allow-origins=*`. `findChrome()` finds the Chrome to start: the one
|
|
@@ -349,8 +344,8 @@ await browser.reconcile(harness, () => true, context); // settles what a dead
|
|
|
349
344
|
`createBrowserExtension` takes no key and sends nothing anywhere but the provider you give it. The options:
|
|
350
345
|
|
|
351
346
|
- `driver`: `stagehandDriver()`, or your own `DriverFactory`.
|
|
352
|
-
- `provider`:
|
|
353
|
-
|
|
347
|
+
- `provider`: the local Chrome (`cdpProvider`), or your own `BrowserProvider` over a hosted vendor, with your own metadata
|
|
348
|
+
stamped on every session.
|
|
354
349
|
- `evidence`: a sink that files each read where your receipts already are.
|
|
355
350
|
- `onSession`: the host channel. It receives each session's row and, only there, the live-view URLs. Nothing in the run log, a
|
|
356
351
|
result or a log line carries them.
|
|
@@ -360,8 +355,8 @@ await browser.reconcile(harness, () => true, context); // settles what a dead
|
|
|
360
355
|
- `signIns`: `true` when the plane's sessions open on the agent's saved sign-ins (your kept profile or context). `run`'s
|
|
361
356
|
description then tells the model the browser keeps them, for a page behind a sign-in; without it, it says only that the
|
|
362
357
|
browser keeps cookies across pages. Absent, it is whether a `sessionVault` is given.
|
|
363
|
-
- `workspace`:
|
|
364
|
-
- `files`: a `WorkspaceFiles` that resolves `browser_upload` paths.
|
|
358
|
+
- `workspace`: per conversation, the `DownloadsWorkspace` that `browser_downloads` writes through: the host's own file calls on its workspace (read, stat, mkdir, write, writeNew, remove), each path relative to the workspace and none following a link on the way or at its end, a read refusing anything but a regular file without waiting on it. Absent, `browser_downloads` is not listed.
|
|
359
|
+
- `files`: a `WorkspaceFiles` that resolves `browser_upload` paths (`workspaceFiles(folder)` is one). Absent, `browser_upload` is not listed.
|
|
365
360
|
- `handoff`: a `HandoffPort` that reaches a person (`request`, then `outcome` polled until done, cancelled or expired;
|
|
366
361
|
when a request expires is the port's to decide). Absent, `browser_request_handoff` is not listed.
|
|
367
362
|
- `prices`: your session price (for example from `BROWSERBASE_USD_PER_MINUTE`). It prices the session meter, so each session
|
|
@@ -370,8 +365,20 @@ await browser.reconcile(harness, () => true, context); // settles what a dead
|
|
|
370
365
|
final, state }`, called in the commit that writes it on the session's record, so a host that books it in `tx` books
|
|
371
366
|
exactly what the record bills: at a browser call (`call.callId`), what the session ran since its last charge; at its
|
|
372
367
|
release, or when custody gives up releasing it (`lost`) (`final`), the rest, topped up to `prices.sessionMinimumS`. A session already billed in full is never charged
|
|
373
|
-
again. `state` is `priced`, or `unpriced`/`invalid` with `usd` 0 (no price, not $0).
|
|
374
|
-
|
|
368
|
+
again. `state` is `priced`, or `unpriced`/`invalid` with `usd` 0 (no price, not $0). `overbookedS`, when present: an
|
|
369
|
+
earlier charge billed the session past this one's `at` (a `handle.charge` taken while its release was under way, the
|
|
370
|
+
release confirmed before it), by that many seconds; this charge bills none of it again and never a negative. It must
|
|
371
|
+
not throw: a throw fails the commit, and a call's charge is then carried by the session's next one.
|
|
372
|
+
- `onRaceReleased({ conversationId, tag, ids, madeAt })`: a release by a session's tag ended sessions besides that session's own
|
|
373
|
+
(a create retried behind the provider's API, or a create race of that tag, left them running), and no record bills
|
|
374
|
+
their time. Called with their ids once a status read confirms each stopped, including one whose release stopped it and
|
|
375
|
+
then failed. Each id is saved on the session's inventory row (`owed`) before its stop is sent, and stays there, across
|
|
376
|
+
a restart, until a read confirms its stop and it is told: the session's own release confirms the ones its row owes, and
|
|
377
|
+
a run open's reconcile those of a row that ended lost or that a release left owing. Called again for an id only when a
|
|
378
|
+
process ends between the call and the commit that takes it off the row, so a host books what they ran under one key
|
|
379
|
+
per id. `madeAt`, by id, is when the provider made each, where its tag lookup said (`LeaseRef.madeAt`): saved on the
|
|
380
|
+
row (`made`) with the id before its stop is sent, so a later process, whose lookups no longer list a stopped session,
|
|
381
|
+
hands it on too; absent when the lookup said for none. A throw here never fails the release.
|
|
375
382
|
|
|
376
383
|
Per conversation, the host writes a `BrowserConfig` (`label`, `run`, and the policy: proxies, verified, captcha, geolocation,
|
|
377
384
|
region, a raw context id, the session timeout, the idle release and the batch timeout; `DEFAULT_BROWSER_POLICY` holds the
|
|
@@ -379,7 +386,15 @@ package's defaults to spread and override) in the conversation's creating commit
|
|
|
379
386
|
selects the extensions for it, and calls `handle.release(conversation, "close", ctx)` when the conversation ends. Releases run
|
|
380
387
|
as background tasks, which `waitForIdle` skips and closing the harness aborts: before it closes, a host calls
|
|
381
388
|
`handle.drain(harness, ctx, signal?)`, which resolves once none is live. A host that closes with no drain after its `close`
|
|
382
|
-
releases gets them at the provider all the same: `handle.close()` waits, 30 s at most, for every one no drain since covered.
|
|
389
|
+
releases gets them at the provider all the same: `handle.close()` waits, 30 s at most, for every one no drain since covered.
|
|
390
|
+
A host that stops waiting on a release calls `handle.charge(conversation, ctx)` to book the time known so far: each session
|
|
391
|
+
still open (live, held, or releasing) is billed through now, not final, its `chargedThrough` moved in the same commit, and
|
|
392
|
+
the release's own charge, when it lands, bills only the time after it. A record with no session id yet (its create under
|
|
393
|
+
way, or its answer lost and the session not yet found by its tag) is not charged: its release's charge bills the whole
|
|
394
|
+
session once it is found. A session already charged through now gets no $0 charge. The row `onSession` is told at a
|
|
395
|
+
release is the session as its release confirmed it: a `handle.charge` taken after that confirm and before its commit
|
|
396
|
+
bills past it, and is in the charges (`onCharge`, the bill) but not in that row, whose `spent` is then short of the
|
|
397
|
+
record's by that charge. A release the store cannot record (a storage error)
|
|
383
398
|
is still made at the provider, and the record is left for the next run's reconcile; once the store has failed,
|
|
384
399
|
`handle.close()` releases every session the process still holds, and over a healthy store it releases nothing. At run open,
|
|
385
400
|
after the extensions are installed and
|
|
@@ -402,27 +417,22 @@ and `search`.
|
|
|
402
417
|
|
|
403
418
|
Two things to know before you give a model a browser:
|
|
404
419
|
|
|
405
|
-
- **What a model may reach is your decision.** `
|
|
406
|
-
|
|
407
|
-
their network goes. A host that must not let a model reach internal addresses restricts that network or the URLs it passes.
|
|
408
|
-
- **The Browserbase provider changes the process.** Its first call that needs the Browserbase client adds Browserbase's hosts to `NO_PROXY` and `no_proxy`, and
|
|
409
|
-
the first attach replaces `globalThis.WebSocket` with a wrapper that dials a bound credential proxy instead of the raw
|
|
410
|
-
connect URL. Both are process-wide. The wrapper passes every other URL through unchanged. Importing the package does
|
|
411
|
-
neither.
|
|
420
|
+
- **What a model may reach is your decision.** `publicFetch` refuses private addresses, but a driven browser goes
|
|
421
|
+
wherever its network goes. A host that must not let a model reach internal addresses restricts that network or the URLs it passes.
|
|
412
422
|
|
|
413
423
|
## Development
|
|
414
424
|
|
|
415
425
|
```sh
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
CHROME_PATH=/path/to/chrome
|
|
426
|
+
pnpm --filter @parcha/pi-browser run build
|
|
427
|
+
pnpm --filter @parcha/pi-browser test # everything but the real-Chrome suites
|
|
428
|
+
CHROME_PATH=/path/to/chrome pnpm --filter @parcha/pi-browser run test:chrome
|
|
419
429
|
```
|
|
420
430
|
|
|
421
431
|
The real-Chrome suites (`stagehand_real_chrome`, `cdp_local_chrome`, `effects-chrome`, `screenshot_clip_real_chrome`,
|
|
422
432
|
`readme_example`) skip with a typed reason where no Chrome can load Stagehand's extension, and fail instead under
|
|
423
433
|
`AGENTRUN_REQUIRE_LOCAL_CHROME=1`, which CI sets. The crash matrix (`test/custody.test.mjs`) SIGKILLs a child process at each
|
|
424
434
|
cut point of a session's life against the shared fake and reopens the run's SQLite file. The wire checks (`test/wire/`) plant
|
|
425
|
-
sentinel credentials in a fake provider and scan every byte a run produced. The suites run on Node 22
|
|
435
|
+
sentinel credentials in a fake provider and scan every byte a run produced. The suites run on Node 24.22.3, the minimum the package supports.
|
|
426
436
|
|
|
427
437
|
Apache-2.0. Copyright 2026 Parcha Labs, Inc. `NOTICE` records the Stagehand (MIT) code this package copies: the Chrome launch
|
|
428
438
|
flags and the vendored facade.
|