@plurnk/plurnk-schemes-http 0.16.4 → 0.17.0
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/.env.example +30 -0
- package/SPEC.md +2 -2
- package/dist/Browser.d.ts.map +1 -1
- package/dist/Browser.js +21 -22
- package/dist/Browser.js.map +1 -1
- package/package.json +4 -3
package/.env.example
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @plurnk/plurnk-schemes-http — operator config reference.
|
|
2
|
+
#
|
|
3
|
+
# Family-namespaced per the metaproject env convention: every knob this package
|
|
4
|
+
# reads is PLURNK_SCHEMES_HTTP_*. The three numeric knobs are REQUIRED on the
|
|
5
|
+
# render path and read with no in-code default — an unset/invalid value fails
|
|
6
|
+
# hard at first use, naming the var (fail-hard contract; no silent fallbacks).
|
|
7
|
+
# A byte-fetch-only deployment (no HTML rendering) never reads them. The
|
|
8
|
+
# consuming service copies the vars it needs into its own .env; this file is
|
|
9
|
+
# the authoritative list of what the http scheme reads.
|
|
10
|
+
|
|
11
|
+
# ── Required (render path) ───────────────────────────────────────────────────
|
|
12
|
+
# Navigation/render timeout in ms (page.goto networkidle budget).
|
|
13
|
+
PLURNK_SCHEMES_HTTP_FETCH_TIMEOUT=30000
|
|
14
|
+
# Salvage threshold in body-text chars: a networkidle timeout whose DOM already
|
|
15
|
+
# holds at least this much innerText is the chatty-page case (long-poll, ad
|
|
16
|
+
# refresh) — the render is kept; below it the timeout propagates.
|
|
17
|
+
PLURNK_SCHEMES_HTTP_SALVAGE_MIN_BODY_CHARS=200
|
|
18
|
+
# Warm-chromium idle teardown in ms: the browser process closes after this long
|
|
19
|
+
# with no render activity, and relaunches on the next render.
|
|
20
|
+
PLURNK_SCHEMES_HTTP_IDLE_TIMEOUT=900000
|
|
21
|
+
|
|
22
|
+
# ── Optional (absence is a mode, not a default) ──────────────────────────────
|
|
23
|
+
# Remote CDP endpoint (shared chromium / Lightpanda / browserless). Unset →
|
|
24
|
+
# launch chromium locally via playwright.
|
|
25
|
+
# PLURNK_SCHEMES_HTTP_PLAYWRIGHT_WS=ws://localhost:9222
|
|
26
|
+
# "1" adds --no-sandbox to the local chromium launch (containers without
|
|
27
|
+
# user-namespace support). Unset → sandboxed.
|
|
28
|
+
# PLURNK_SCHEMES_HTTP_NO_SANDBOX=1
|
|
29
|
+
# Chromium JS heap cap in MB (--max-old-space-size). Unset → chromium default.
|
|
30
|
+
# PLURNK_SCHEMES_HTTP_CHROMIUM_HEAP_MB=2048
|
package/SPEC.md
CHANGED
|
@@ -65,7 +65,7 @@ Error results carry a `scheme:http` `TelemetryEvent` (via `Results.error`).
|
|
|
65
65
|
|
|
66
66
|
The **byte path** is dependency-free: `fetch` / `AbortController` / `TextDecoder` / `ReadableStream` are Node ≥25 built-ins.
|
|
67
67
|
|
|
68
|
-
The **render path** takes one runtime dependency, `playwright`, **lazy-imported** (`Browser.ts`) so only an actual render pays for it — a byte fetch never loads it. The chromium binary is optional: set `
|
|
68
|
+
The **render path** takes one runtime dependency, `playwright`, **lazy-imported** (`Browser.ts`) so only an actual render pays for it — a byte fetch never loads it. The chromium binary is optional: set `PLURNK_SCHEMES_HTTP_PLAYWRIGHT_WS` to drive a remote CDP endpoint (shared chromium / Lightpanda / browserless) instead of launching locally. This is the conscious, scoped inversion of the original "no runtime deps" stance — rendering is acquisition, and acquisition is this scheme's job.
|
|
69
69
|
|
|
70
70
|
## §6 Render lifecycle
|
|
71
71
|
|
|
@@ -74,5 +74,5 @@ The **render path** takes one runtime dependency, `playwright`, **lazy-imported*
|
|
|
74
74
|
- **Gate:** a GET whose response `Content-Type` is `text/html` / `application/xhtml+xml` renders; the probe-fetch body is discarded and the browser does its own navigation. POST never renders.
|
|
75
75
|
- **Render:** warm chromium (one per `Browser`), per-run `BrowserContext` keyed on `ctx.runId`, navigate with `waitUntil: "networkidle"` + a salvage path (timed-out-but-rendered pages with substantive body text), serialize the final DOM via `page.content()`.
|
|
76
76
|
- **Body:** the serialized DOM is delivered as one `body` chunk labelled `text/html`; the mimetype layer projects everything (`content`/`symbols`/`deepXml`/embedding) off it. http never cleans or extracts — the body is the faithful, final page (schemes-http#1).
|
|
77
|
-
- **Config:** `
|
|
77
|
+
- **Config:** `.env.example` is the authoritative list (family-namespaced `PLURNK_SCHEMES_HTTP_*`). Required render-path numerics — `FETCH_TIMEOUT`, `SALVAGE_MIN_BODY_CHARS`, `IDLE_TIMEOUT` — fail hard when unset (no in-code defaults). Optional modes: `PLAYWRIGHT_WS`, `NO_SANDBOX`, `CHROMIUM_HEAP_MB`.
|
|
78
78
|
- **Cancel:** the composed `AbortSignal` / SEND[499] handle aborts the render by closing the page (in-flight `goto` rejects promptly).
|
package/dist/Browser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Browser.d.ts","sourceRoot":"","sources":["../src/Browser.ts"],"names":[],"mappings":"AAmBA,UAAU,UAAU;IAChB,MAAM,IAAI,MAAM,CAAC;IACjB,UAAU,IAAI,MAAM,CAAC;IACrB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AACD,UAAU,MAAM;IACZ,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,SAAS,EAAE,aAAa,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACnG,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3B,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACrC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AACD,UAAU,SAAS;IACf,OAAO,IAAI,OAA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zB;AAoBD,MAAM,CAAC,OAAO,OAAO,OAAO;;gBAWZ,OAAO,GAAE,eAAgC;IAO/C,MAAM,CACR,GAAG,EAAE,MAAM,EACX,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAA4D,EAAE,EACpF;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAClH,OAAO,CAAC,YAAY,CAAC;IA+FxB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAe3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ/B"}
|
package/dist/Browser.js
CHANGED
|
@@ -13,18 +13,15 @@
|
|
|
13
13
|
// a minimal structural seam (`ChromiumEngine`) so it can be injected — fakes
|
|
14
14
|
// in unit tests, and a remote CDP endpoint (Lightpanda/browserless/shared
|
|
15
15
|
// chromium) swapped in via env with zero code change.
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
const
|
|
22
|
-
const IDLE_TIMEOUT_MS = 15 * 60 * 1000;
|
|
23
|
-
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
24
|
-
const numEnv = (key, fallback) => {
|
|
16
|
+
// Required numeric knob — `.env.example` is the canonical list (metaproject
|
|
17
|
+
// env rule: every magic number lives there; no in-code default hides one). An
|
|
18
|
+
// unset or non-numeric value fails hard at first use, naming the var. All
|
|
19
|
+
// three numerics are render-path-only, so a byte-fetch-only deployment never
|
|
20
|
+
// pays them — but a rendering one must configure them.
|
|
21
|
+
const requireNumEnv = (key) => {
|
|
25
22
|
const raw = process.env[key];
|
|
26
23
|
if (raw === undefined)
|
|
27
|
-
|
|
24
|
+
throw new Error(`Browser: required env ${key} is unset — see .env.example`);
|
|
28
25
|
const n = Number(raw);
|
|
29
26
|
if (Number.isNaN(n))
|
|
30
27
|
throw new Error(`Browser: ${key}=${raw} is not a number`);
|
|
@@ -49,7 +46,7 @@ export default class Browser {
|
|
|
49
46
|
// Render a URL to its final serialized DOM. Opens a page in the run's
|
|
50
47
|
// context, navigates with the settle+salvage strategy, serializes, closes
|
|
51
48
|
// the page. Throws on navigation failure (the caller maps it to a status).
|
|
52
|
-
async render(url, { runId, signal, headers, timeout =
|
|
49
|
+
async render(url, { runId, signal, headers, timeout = requireNumEnv("PLURNK_SCHEMES_HTTP_FETCH_TIMEOUT") }) {
|
|
53
50
|
const context = await this.#getContext(runId);
|
|
54
51
|
const page = await context.newPage();
|
|
55
52
|
// Request headers (auth/accept) apply to the navigation too, so an authed
|
|
@@ -85,8 +82,10 @@ export default class Browser {
|
|
|
85
82
|
// already rendered substantive body text is the chatty-page case: the
|
|
86
83
|
// content is there even though the network never settled. readyState is
|
|
87
84
|
// unreliable (a never-ending stream stays `loading` forever); the load-
|
|
88
|
-
// bearing signal is the body's innerText length
|
|
89
|
-
//
|
|
85
|
+
// bearing signal is the body's innerText length — below the salvage
|
|
86
|
+
// threshold we discard (too little to be sure the DOM rendered the article
|
|
87
|
+
// rather than a skeleton). Returns the Response on normal completion, null
|
|
88
|
+
// on salvage, and re-throws every other error.
|
|
90
89
|
async #safeGoto(page, url, timeout) {
|
|
91
90
|
try {
|
|
92
91
|
return await page.goto(url, { waitUntil: "networkidle", timeout });
|
|
@@ -97,29 +96,29 @@ export default class Browser {
|
|
|
97
96
|
const bodyLen = await page
|
|
98
97
|
.evaluate(() => document?.body?.innerText?.length ?? 0)
|
|
99
98
|
.catch(() => 0);
|
|
100
|
-
if (bodyLen <
|
|
99
|
+
if (bodyLen < requireNumEnv("PLURNK_SCHEMES_HTTP_SALVAGE_MIN_BODY_CHARS"))
|
|
101
100
|
throw err;
|
|
102
101
|
return null;
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
104
|
// Get-or-launch the warm chromium. Connects to a remote CDP endpoint via
|
|
106
|
-
//
|
|
107
|
-
// else launches locally. Single browser across all runs;
|
|
108
|
-
// is at the context layer. Relaunches if chromium dies
|
|
109
|
-
// teardown) leaves the handle stale.
|
|
105
|
+
// PLURNK_SCHEMES_HTTP_PLAYWRIGHT_WS if set (shared / Lightpanda /
|
|
106
|
+
// browserless), else launches locally. Single browser across all runs;
|
|
107
|
+
// per-run isolation is at the context layer. Relaunches if chromium dies
|
|
108
|
+
// (OOM/segfault/WS teardown) leaves the handle stale.
|
|
110
109
|
async #getBrowser() {
|
|
111
110
|
this.#touchIdle();
|
|
112
111
|
if (this.#browser)
|
|
113
112
|
return this.#browser;
|
|
114
113
|
this.#launching ??= (async () => {
|
|
115
114
|
const chromium = await this.#factory();
|
|
116
|
-
const ws = process.env.
|
|
115
|
+
const ws = process.env.PLURNK_SCHEMES_HTTP_PLAYWRIGHT_WS;
|
|
117
116
|
if (ws)
|
|
118
117
|
return chromium.connect(ws);
|
|
119
118
|
const args = [];
|
|
120
|
-
if (process.env.
|
|
119
|
+
if (process.env.PLURNK_SCHEMES_HTTP_NO_SANDBOX === "1")
|
|
121
120
|
args.push("--no-sandbox");
|
|
122
|
-
const heapMb = process.env.
|
|
121
|
+
const heapMb = process.env.PLURNK_SCHEMES_HTTP_CHROMIUM_HEAP_MB;
|
|
123
122
|
if (heapMb)
|
|
124
123
|
args.push(`--js-flags=--max-old-space-size=${heapMb}`);
|
|
125
124
|
return chromium.launch({ headless: true, args });
|
|
@@ -159,7 +158,7 @@ export default class Browser {
|
|
|
159
158
|
#touchIdle() {
|
|
160
159
|
if (this.#idleTimer)
|
|
161
160
|
clearTimeout(this.#idleTimer);
|
|
162
|
-
this.#idleTimer = setTimeout(() => { this.close().catch(() => { }); },
|
|
161
|
+
this.#idleTimer = setTimeout(() => { this.close().catch(() => { }); }, requireNumEnv("PLURNK_SCHEMES_HTTP_IDLE_TIMEOUT"));
|
|
163
162
|
this.#idleTimer.unref?.();
|
|
164
163
|
}
|
|
165
164
|
// Tear everything down: per-run contexts then the browser. In CDP mode
|
package/dist/Browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Browser.js","sourceRoot":"","sources":["../src/Browser.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,sEAAsE;AACtE,4EAA4E;AAC5E,8EAA8E;AAC9E,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,8EAA8E;AAC9E,2CAA2C;AAC3C,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,0EAA0E;AAC1E,sDAAsD;AA4CtD,8EAA8E;AAC9E,
|
|
1
|
+
{"version":3,"file":"Browser.js","sourceRoot":"","sources":["../src/Browser.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,sEAAsE;AACtE,4EAA4E;AAC5E,8EAA8E;AAC9E,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,8EAA8E;AAC9E,2CAA2C;AAC3C,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,0EAA0E;AAC1E,sDAAsD;AA4CtD,4EAA4E;AAC5E,8EAA8E;AAC9E,0EAA0E;AAC1E,6EAA6E;AAC7E,uDAAuD;AACvD,MAAM,aAAa,GAAG,CAAC,GAAW,EAAU,EAAE;IAC1C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,GAAG,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,8BAA8B,CAAC,CAAC;IACnG,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,YAAY,GAAG,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAC/E,OAAO,CAAC,CAAC;AACb,CAAC,CAAC;AAEF,g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AAG,UAAU,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,kCAAkC,CAAC,CAAC,CAAC;QACzH,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC;IAC9B,CAAC;IAED,uEAAuE;IACvE,yEAAyE;IACzE,KAAK,CAAC,KAAK;QACP,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QAAC,CAAC;QAC/E,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACvB,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACzD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAAC,CAAC;QACzF,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IAC3B,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurnk/plurnk-schemes-http",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "http(s):// URI scheme handler for the plurnk agent runtime — fetch + streaming response body.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plurnk",
|
|
@@ -39,14 +39,15 @@
|
|
|
39
39
|
},
|
|
40
40
|
"files": [
|
|
41
41
|
"dist/**/*",
|
|
42
|
+
".env.example",
|
|
42
43
|
"docs/**/*",
|
|
43
44
|
"README.md",
|
|
44
45
|
"SPEC.md"
|
|
45
46
|
],
|
|
46
47
|
"scripts": {
|
|
47
48
|
"test:lint": "tsc --noEmit",
|
|
48
|
-
"test:unit": "node --test src/**/*.test.ts",
|
|
49
|
-
"test:integration": "node --test test/integration/**/*.test.ts",
|
|
49
|
+
"test:unit": "node --test --env-file=.env.example src/**/*.test.ts",
|
|
50
|
+
"test:integration": "node --test --env-file=.env.example test/integration/**/*.test.ts",
|
|
50
51
|
"test": "npm run test:lint && npm run test:unit",
|
|
51
52
|
"build:dist": "tsc -p tsconfig.build.json",
|
|
52
53
|
"build": "npm run build:dist",
|