@parcha/pi-browser 0.1.0-beta.37 → 0.1.0-beta.39

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 CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.1.0-beta.39 (2026-11-16)
6
+
7
+ - 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.
8
+ - 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.
9
+ - 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`.
10
+ - 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".
11
+
12
+ ## 0.1.0-beta.38 (2026-11-14)
13
+
14
+ - 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.
15
+ - 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.
16
+ - Every other non-text type (a PDF, a zip, `application/octet-stream`, an `image/svg+xml`) is still refused.
17
+
5
18
  ## 0.1.0-beta.37 (2026-11-13)
6
19
 
7
20
  - 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).
@@ -69,6 +69,10 @@ function untilAborted(work, signal) {
69
69
  work().then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));
70
70
  });
71
71
  }
72
+ /** The content types read as text: any text/*, application/json and application/xml, and any application/<name>+xml
73
+ * or application/<name>+json (atom, rss, xhtml, ld+json), so a site's feed reads like its pages. Anything else (a PDF,
74
+ * a zip, octet-stream, an image/svg+xml) is refused. */
75
+ const TEXT_TYPE = /^(text\/|application\/(json|xml|[\w.!#$&^-]+\+(xml|json)\b))/i;
72
76
  /**
73
77
  * Fetches `url` from a public host, following at most 5 redirects, each hop resolved, checked and dialled at the
74
78
  * address checked. A 2xx answer of a text type is read whole, up to `maxBytes`; another status comes back without its
@@ -111,7 +115,10 @@ export async function publicFetch(url, options = {}) {
111
115
  const contentType = res.headers.get("content-type") ?? "";
112
116
  if (!res.ok)
113
117
  return { url: target.href, status: res.status, contentType, body: null };
114
- if (!/^(text\/|application\/(xhtml\+xml|json|xml))/i.test(contentType))
118
+ // A 2xx with no body at all (204, 205) is an empty page, whatever type it names.
119
+ if (!res.body)
120
+ return { url: target.href, status: res.status, contentType, body: "" };
121
+ if (!TEXT_TYPE.test(contentType))
115
122
  throw refusedError(`refused: ${contentType || "an unknown content type"} is not text`);
116
123
  const chunks = [];
117
124
  let size = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/pi-browser",
3
- "version": "0.1.0-beta.37",
3
+ "version": "0.1.0-beta.39",
4
4
  "description": "Your agent gets its own browser, and you can take over and hand it back.",
5
5
  "keywords": [
6
6
  "pi-durable",