@parcha/pi-browser 0.1.0-beta.37 → 0.1.0-beta.38
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 +6 -0
- package/dist/core/public-fetch.js +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.1.0-beta.38 (2026-11-14)
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
- 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.
|
|
9
|
+
- Every other non-text type (a PDF, a zip, `application/octet-stream`, an `image/svg+xml`) is still refused.
|
|
10
|
+
|
|
5
11
|
## 0.1.0-beta.37 (2026-11-13)
|
|
6
12
|
|
|
7
13
|
- 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,7 @@ 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 (
|
|
118
|
+
if (!TEXT_TYPE.test(contentType))
|
|
115
119
|
throw refusedError(`refused: ${contentType || "an unknown content type"} is not text`);
|
|
116
120
|
const chunks = [];
|
|
117
121
|
let size = 0;
|