@unbrowse/sdk 11.1.1 → 11.1.6
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/README.md +40 -192
- package/dist/client.d.ts +117 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +385 -0
- package/dist/client.js.map +1 -0
- package/dist/contracts.d.ts +541 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +2 -0
- package/dist/contracts.js.map +1 -0
- package/dist/errors.d.ts +27 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +47 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime.d.ts +78 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +339 -0
- package/dist/runtime.js.map +1 -0
- package/package.json +3 -4
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local-binary lifecycle for `@unbrowse/sdk`.
|
|
3
|
+
*
|
|
4
|
+
* The SDK talks to a co-located `unbrowse` runtime over loopback HTTP.
|
|
5
|
+
* `runtime.ts` owns the contract for locating, probing, and spawning that
|
|
6
|
+
* runtime so `client.ts` can stay a pure HTTP transport.
|
|
7
|
+
*
|
|
8
|
+
* Tree-shaking note: heavy Node-only imports (`child_process`) are pulled
|
|
9
|
+
* in lazily inside `spawnUnbrowseRuntime`. Callers that only use
|
|
10
|
+
* `Unbrowse.connect` never pay for them.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Handle returned by a successful spawn. `owned` distinguishes processes the
|
|
14
|
+
* SDK forked (kill on `.close()`) from processes the SDK adopted via probe
|
|
15
|
+
* (leave running on `.close()`).
|
|
16
|
+
*/
|
|
17
|
+
export interface RuntimeHandle {
|
|
18
|
+
/** Base URL the running runtime listens on, e.g. "http://127.0.0.1:6969". */
|
|
19
|
+
baseUrl: string;
|
|
20
|
+
/** OS process id; -1 if the runtime was adopted via probe. */
|
|
21
|
+
pid: number;
|
|
22
|
+
/** Stops the runtime if `owned`; no-op otherwise. */
|
|
23
|
+
kill(): Promise<void>;
|
|
24
|
+
/** Resolves once the runtime answers `/health` with 200. */
|
|
25
|
+
ready: Promise<void>;
|
|
26
|
+
/** True iff this SDK started the process and is responsible for tearing it down. */
|
|
27
|
+
owned: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Options for `spawnUnbrowseRuntime`. Every field has a sensible default,
|
|
31
|
+
* so the zero-arg call is the documented happy path.
|
|
32
|
+
*/
|
|
33
|
+
export interface SpawnRuntimeOptions {
|
|
34
|
+
/** Preferred port; default 6969. If already alive, adopts that runtime. */
|
|
35
|
+
port?: number;
|
|
36
|
+
/** Working directory for the child; default = current process cwd. */
|
|
37
|
+
cwd?: string;
|
|
38
|
+
/** Extra env vars layered onto the child's inherited env. */
|
|
39
|
+
env?: Record<string, string>;
|
|
40
|
+
/** Explicit path to the binary; overrides `locateUnbrowseBinary`. */
|
|
41
|
+
binaryPath?: string;
|
|
42
|
+
/** Milliseconds to wait for `/health` readiness; default 10_000. */
|
|
43
|
+
readyTimeoutMs?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Probe an already-running runtime by hitting `/health`. Returns true iff
|
|
47
|
+
* the response status is 2xx. Never throws — connection refused, timeout,
|
|
48
|
+
* DNS failures, and non-2xx all resolve to `false`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function probeUnbrowseRuntime(baseUrl: string, timeoutMs?: number): Promise<boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* Locate the `unbrowse` binary by walking, in order:
|
|
53
|
+
* 1. `UNBROWSE_BIN` env var
|
|
54
|
+
* 2. `require.resolve('unbrowse/package.json')` -> derived `bin/unbrowse-wrapper.mjs`
|
|
55
|
+
* 3. `Bun.which('unbrowse')` if running under Bun
|
|
56
|
+
* Returns null when nothing is wired.
|
|
57
|
+
*/
|
|
58
|
+
export declare function locateUnbrowseBinary(): string | null;
|
|
59
|
+
/**
|
|
60
|
+
* Spawn (or adopt) a co-located `unbrowse` runtime and wait for it to
|
|
61
|
+
* answer `/health`. Returns a `RuntimeHandle` whose `.kill()` tears the
|
|
62
|
+
* child down. Throws `RuntimeUnavailableError` on failure modes.
|
|
63
|
+
*
|
|
64
|
+
* Concurrency: if two callers race on the same port, only one spawn is
|
|
65
|
+
* launched. The second caller awaits the first's promise and gets an
|
|
66
|
+
* adopted (`owned=false`) view of the same handle so it cannot
|
|
67
|
+
* double-kill the child.
|
|
68
|
+
*/
|
|
69
|
+
export declare function spawnUnbrowseRuntime(opts?: SpawnRuntimeOptions): Promise<RuntimeHandle>;
|
|
70
|
+
/**
|
|
71
|
+
* Always activate the auth-proxy bridge when spawning via the SDK — same default as
|
|
72
|
+
* the CLI. "auto" makes the runtime attempt the bridge and degrade safely to direct
|
|
73
|
+
* egress when no proxy creds resolve (so it never re-introduces the v9.3.4 ERR_TUNNEL
|
|
74
|
+
* breakage of forcing a proxy default). An explicit UNBROWSE_KURI_PROXY (incl. "0"/
|
|
75
|
+
* "false" — the emergency disable) is preserved. Pure + exported for unit tests.
|
|
76
|
+
*/
|
|
77
|
+
export declare function applyBridgeDefault(env: Record<string, string>): Record<string, string>;
|
|
78
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAaH;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,4DAA4D;IAC5D,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,oFAAoF;IACpF,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAMD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,MAAiC,GAC3C,OAAO,CAAC,OAAO,CAAC,CAYlB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,IAAI,CAoCpD;AA2BD;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,GAAE,mBAAwB,GAC7B,OAAO,CAAC,aAAa,CAAC,CA8BxB;AAgLD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKtF"}
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local-binary lifecycle for `@unbrowse/sdk`.
|
|
3
|
+
*
|
|
4
|
+
* The SDK talks to a co-located `unbrowse` runtime over loopback HTTP.
|
|
5
|
+
* `runtime.ts` owns the contract for locating, probing, and spawning that
|
|
6
|
+
* runtime so `client.ts` can stay a pure HTTP transport.
|
|
7
|
+
*
|
|
8
|
+
* Tree-shaking note: heavy Node-only imports (`child_process`) are pulled
|
|
9
|
+
* in lazily inside `spawnUnbrowseRuntime`. Callers that only use
|
|
10
|
+
* `Unbrowse.connect` never pay for them.
|
|
11
|
+
*/
|
|
12
|
+
import { RuntimeUnavailableError } from "./errors.js";
|
|
13
|
+
import { createRequire } from "node:module";
|
|
14
|
+
// Under Node ESM (`"type": "module"` + tsc `module: ESNext`), bare `require`
|
|
15
|
+
// is undefined and the lazy `require("node:fs")` / `require("node:path")`
|
|
16
|
+
// calls below would throw `ReferenceError`, get swallowed by their try/catch,
|
|
17
|
+
// and silently return false/null. Bind a CommonJS-style require to this
|
|
18
|
+
// module's URL so all the lazy `require(...)` sites in this file resolve.
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
+
const require = createRequire(import.meta.url);
|
|
21
|
+
const DEFAULT_PORT = 6969;
|
|
22
|
+
const DEFAULT_READY_TIMEOUT_MS = 10_000;
|
|
23
|
+
const DEFAULT_PROBE_TIMEOUT_MS = 1_000;
|
|
24
|
+
/**
|
|
25
|
+
* Probe an already-running runtime by hitting `/health`. Returns true iff
|
|
26
|
+
* the response status is 2xx. Never throws — connection refused, timeout,
|
|
27
|
+
* DNS failures, and non-2xx all resolve to `false`.
|
|
28
|
+
*/
|
|
29
|
+
export async function probeUnbrowseRuntime(baseUrl, timeoutMs = DEFAULT_PROBE_TIMEOUT_MS) {
|
|
30
|
+
const url = `${baseUrl.replace(/\/+$/, "")}/health`;
|
|
31
|
+
const controller = new AbortController();
|
|
32
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
33
|
+
try {
|
|
34
|
+
const res = await fetch(url, { method: "GET", signal: controller.signal });
|
|
35
|
+
return res.ok;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
clearTimeout(timer);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Locate the `unbrowse` binary by walking, in order:
|
|
46
|
+
* 1. `UNBROWSE_BIN` env var
|
|
47
|
+
* 2. `require.resolve('unbrowse/package.json')` -> derived `bin/unbrowse-wrapper.mjs`
|
|
48
|
+
* 3. `Bun.which('unbrowse')` if running under Bun
|
|
49
|
+
* Returns null when nothing is wired.
|
|
50
|
+
*/
|
|
51
|
+
export function locateUnbrowseBinary() {
|
|
52
|
+
// 1. Explicit env override.
|
|
53
|
+
const fromEnv = readEnv("UNBROWSE_BIN");
|
|
54
|
+
if (fromEnv && fileExists(fromEnv))
|
|
55
|
+
return fromEnv;
|
|
56
|
+
// 2. require.resolve('unbrowse/package.json') -> bin/unbrowse-wrapper.mjs.
|
|
57
|
+
// Only honor this when the resolved package looks like a real install
|
|
58
|
+
// (the wrapper has a sibling native binary or compiled launcher). A
|
|
59
|
+
// bare workspace tree with no postinstall artifacts would set us up to
|
|
60
|
+
// spawn-and-fail; fall through to PATH lookup in that case.
|
|
61
|
+
try {
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
63
|
+
const { createRequire } = require("node:module");
|
|
64
|
+
const requireFn = createRequire(import.meta.url);
|
|
65
|
+
const pkgPath = requireFn.resolve("unbrowse/package.json");
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
67
|
+
const path = require("node:path");
|
|
68
|
+
const binDir = path.join(path.dirname(pkgPath), "bin");
|
|
69
|
+
const wrapper = path.join(binDir, "unbrowse-wrapper.mjs");
|
|
70
|
+
if (fileExists(wrapper) && hasNativeSibling(binDir))
|
|
71
|
+
return wrapper;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// peer dep not installed — fall through
|
|
75
|
+
}
|
|
76
|
+
// 3. Bun.which / PATH lookup. Bun gives us a one-liner; under raw Node
|
|
77
|
+
// we do the PATH walk ourselves so `npx node smoke.mjs` against a
|
|
78
|
+
// globally-installed `unbrowse` works the same as `bun smoke.ts`.
|
|
79
|
+
const bunWhich = globalThis.Bun?.which;
|
|
80
|
+
if (typeof bunWhich === "function") {
|
|
81
|
+
const onPath = bunWhich("unbrowse");
|
|
82
|
+
if (onPath && fileExists(onPath))
|
|
83
|
+
return onPath;
|
|
84
|
+
}
|
|
85
|
+
const fromPath = findOnPath("unbrowse");
|
|
86
|
+
if (fromPath)
|
|
87
|
+
return fromPath;
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
function hasNativeSibling(binDir) {
|
|
91
|
+
try {
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
93
|
+
const fs = require("node:fs");
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
95
|
+
const path = require("node:path");
|
|
96
|
+
return fs.existsSync(path.join(binDir, "unbrowse"))
|
|
97
|
+
|| fs.existsSync(path.join(binDir, "unbrowse.exe"));
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* In-flight spawn promises keyed by port. When two callers race to spawn on
|
|
105
|
+
* the same port, the second one awaits the first's promise instead of
|
|
106
|
+
* launching a competing child that would lose the bind and exit with code=1.
|
|
107
|
+
*
|
|
108
|
+
* Each caller gets its own `RuntimeHandle` view: the *winner* of the race
|
|
109
|
+
* keeps `owned=true` so its `.close()` actually kills the child; subsequent
|
|
110
|
+
* `Unbrowse.local()` callers that joined the in-flight wait get an adopted
|
|
111
|
+
* (`owned=false`) handle so they don't double-kill the shared child.
|
|
112
|
+
*/
|
|
113
|
+
const inFlightSpawns = new Map();
|
|
114
|
+
/**
|
|
115
|
+
* Spawn (or adopt) a co-located `unbrowse` runtime and wait for it to
|
|
116
|
+
* answer `/health`. Returns a `RuntimeHandle` whose `.kill()` tears the
|
|
117
|
+
* child down. Throws `RuntimeUnavailableError` on failure modes.
|
|
118
|
+
*
|
|
119
|
+
* Concurrency: if two callers race on the same port, only one spawn is
|
|
120
|
+
* launched. The second caller awaits the first's promise and gets an
|
|
121
|
+
* adopted (`owned=false`) view of the same handle so it cannot
|
|
122
|
+
* double-kill the child.
|
|
123
|
+
*/
|
|
124
|
+
export async function spawnUnbrowseRuntime(opts = {}) {
|
|
125
|
+
const port = opts.port ?? DEFAULT_PORT;
|
|
126
|
+
// If another caller is mid-spawn on this port, join their promise
|
|
127
|
+
// instead of competing for the bind. The joiner receives an adopted
|
|
128
|
+
// view (owned=false) so the winner's .close() / .kill() is the only
|
|
129
|
+
// one that actually tears the child down.
|
|
130
|
+
const existing = inFlightSpawns.get(port);
|
|
131
|
+
if (existing) {
|
|
132
|
+
const winner = await existing;
|
|
133
|
+
return {
|
|
134
|
+
baseUrl: winner.baseUrl,
|
|
135
|
+
pid: winner.pid,
|
|
136
|
+
kill: async () => { },
|
|
137
|
+
ready: Promise.resolve(),
|
|
138
|
+
owned: false,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
const spawnPromise = spawnUnbrowseRuntimeInternal(opts);
|
|
142
|
+
inFlightSpawns.set(port, spawnPromise);
|
|
143
|
+
try {
|
|
144
|
+
return await spawnPromise;
|
|
145
|
+
}
|
|
146
|
+
finally {
|
|
147
|
+
// Clear the slot once the spawn settles (success or failure) so a
|
|
148
|
+
// subsequent .close()-then-spawn cycle re-enters the spawn path.
|
|
149
|
+
if (inFlightSpawns.get(port) === spawnPromise) {
|
|
150
|
+
inFlightSpawns.delete(port);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
async function spawnUnbrowseRuntimeInternal(opts) {
|
|
155
|
+
const port = opts.port ?? DEFAULT_PORT;
|
|
156
|
+
const baseUrl = `http://127.0.0.1:${port}`;
|
|
157
|
+
const readyTimeoutMs = opts.readyTimeoutMs ?? DEFAULT_READY_TIMEOUT_MS;
|
|
158
|
+
// 1. If a runtime is already alive on the requested port, adopt it.
|
|
159
|
+
if (await probeUnbrowseRuntime(baseUrl, DEFAULT_PROBE_TIMEOUT_MS)) {
|
|
160
|
+
return {
|
|
161
|
+
baseUrl,
|
|
162
|
+
pid: -1,
|
|
163
|
+
kill: async () => { },
|
|
164
|
+
ready: Promise.resolve(),
|
|
165
|
+
owned: false,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
// 2. Locate the binary.
|
|
169
|
+
const binary = opts.binaryPath ?? locateUnbrowseBinary();
|
|
170
|
+
if (!binary || !fileExists(binary)) {
|
|
171
|
+
throw new RuntimeUnavailableError(`unbrowse binary not found${opts.binaryPath ? ` at ${opts.binaryPath}` : ""}. Install with: npm i -g unbrowse`, "binary_missing", port);
|
|
172
|
+
}
|
|
173
|
+
// 3. Spawn via Node's child_process (cross-runtime; Bun shims this).
|
|
174
|
+
// Lazy import keeps the connect-only path tree-shakeable.
|
|
175
|
+
const childProcess = await import("node:child_process");
|
|
176
|
+
const env = applyBridgeDefault({
|
|
177
|
+
...sanitizeEnv(process.env),
|
|
178
|
+
...(opts.env ?? {}),
|
|
179
|
+
PORT: String(port),
|
|
180
|
+
HOST: "127.0.0.1",
|
|
181
|
+
});
|
|
182
|
+
// `unbrowse-wrapper.mjs` is a node script; the global `unbrowse` binary
|
|
183
|
+
// may be a wrapper or a compiled single-binary. Pass `serve` as argv[0]
|
|
184
|
+
// either way — `src/single-binary.ts:106` keys on it, and the wrapper
|
|
185
|
+
// forwards argv unchanged.
|
|
186
|
+
const isJsLauncher = binary.endsWith(".mjs") || binary.endsWith(".js");
|
|
187
|
+
const command = isJsLauncher ? process.execPath : binary;
|
|
188
|
+
const args = isJsLauncher ? [binary, "serve"] : ["serve"];
|
|
189
|
+
// `detached: true` puts the child in its own process group so we can
|
|
190
|
+
// signal the entire group at teardown. The unbrowse wrapper fork-execs
|
|
191
|
+
// a node grandchild that wouldn't otherwise receive our SIGTERM.
|
|
192
|
+
const isPosix = process.platform !== "win32";
|
|
193
|
+
const child = childProcess.spawn(command, args, {
|
|
194
|
+
cwd: opts.cwd,
|
|
195
|
+
env,
|
|
196
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
197
|
+
detached: isPosix,
|
|
198
|
+
});
|
|
199
|
+
// Prevent the detached child from keeping the parent event loop alive.
|
|
200
|
+
if (isPosix)
|
|
201
|
+
child.unref();
|
|
202
|
+
const signalGroup = (signal) => {
|
|
203
|
+
if (child.pid && isPosix) {
|
|
204
|
+
try {
|
|
205
|
+
process.kill(-child.pid, signal);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
catch { /* fall through */ }
|
|
209
|
+
}
|
|
210
|
+
try {
|
|
211
|
+
child.kill(signal);
|
|
212
|
+
}
|
|
213
|
+
catch { /* ignore */ }
|
|
214
|
+
};
|
|
215
|
+
// 4. Poll readiness up to readyTimeoutMs.
|
|
216
|
+
const ready = (async () => {
|
|
217
|
+
const deadline = Date.now() + readyTimeoutMs;
|
|
218
|
+
while (Date.now() < deadline) {
|
|
219
|
+
if (child.exitCode !== null) {
|
|
220
|
+
throw new RuntimeUnavailableError(`unbrowse exited (code=${child.exitCode}) before reaching ready state on port ${port}`, "spawn_failed", port);
|
|
221
|
+
}
|
|
222
|
+
if (await probeUnbrowseRuntime(baseUrl, 250))
|
|
223
|
+
return;
|
|
224
|
+
await sleep(100);
|
|
225
|
+
}
|
|
226
|
+
// Timeout — tear the orphan down and surface the failure.
|
|
227
|
+
signalGroup("SIGTERM");
|
|
228
|
+
throw new RuntimeUnavailableError(`unbrowse runtime on port ${port} did not become ready within ${readyTimeoutMs}ms`, "spawn_failed", port);
|
|
229
|
+
})();
|
|
230
|
+
try {
|
|
231
|
+
await ready;
|
|
232
|
+
}
|
|
233
|
+
catch (e) {
|
|
234
|
+
if (child.exitCode === null)
|
|
235
|
+
signalGroup("SIGTERM");
|
|
236
|
+
throw e;
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
baseUrl,
|
|
240
|
+
pid: child.pid ?? -1,
|
|
241
|
+
kill: async () => {
|
|
242
|
+
if (child.exitCode !== null)
|
|
243
|
+
return;
|
|
244
|
+
signalGroup("SIGTERM");
|
|
245
|
+
// Wait up to 2s for graceful exit; fastify close + browser shutdown
|
|
246
|
+
// can take a moment.
|
|
247
|
+
for (let i = 0; i < 20; i++) {
|
|
248
|
+
if (child.exitCode !== null)
|
|
249
|
+
return;
|
|
250
|
+
await sleep(100);
|
|
251
|
+
}
|
|
252
|
+
if (child.exitCode === null) {
|
|
253
|
+
signalGroup("SIGKILL");
|
|
254
|
+
// Give the kernel a beat to release the listener.
|
|
255
|
+
await sleep(100);
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
ready: Promise.resolve(),
|
|
259
|
+
owned: true,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
// ---- internal helpers ----
|
|
263
|
+
function readEnv(name) {
|
|
264
|
+
const p = globalThis.process;
|
|
265
|
+
if (!p?.env)
|
|
266
|
+
return undefined;
|
|
267
|
+
const v = p.env[name];
|
|
268
|
+
return typeof v === "string" && v.length > 0 ? v : undefined;
|
|
269
|
+
}
|
|
270
|
+
function fileExists(p) {
|
|
271
|
+
try {
|
|
272
|
+
// Lazy require keeps this file safe in non-Node runtimes that import
|
|
273
|
+
// only the type definitions. `node:fs` is available wherever spawn
|
|
274
|
+
// matters, so this branch is gated by the caller.
|
|
275
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
276
|
+
const fs = require("node:fs");
|
|
277
|
+
return fs.existsSync(p);
|
|
278
|
+
}
|
|
279
|
+
catch {
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* PATH walk for raw Node (no Bun.which). Walks `process.env.PATH`, joins each
|
|
285
|
+
* entry with `name` (+ `.exe` on Windows), and returns the first hit. Honors
|
|
286
|
+
* `PATHEXT` on Windows so `unbrowse.cmd` / `unbrowse.bat` resolve too.
|
|
287
|
+
*/
|
|
288
|
+
function findOnPath(name) {
|
|
289
|
+
try {
|
|
290
|
+
const proc = globalThis.process;
|
|
291
|
+
const pathEnv = proc?.env?.PATH ?? proc?.env?.Path;
|
|
292
|
+
if (!pathEnv)
|
|
293
|
+
return null;
|
|
294
|
+
const path = require("node:path");
|
|
295
|
+
const isWin = proc?.platform === "win32";
|
|
296
|
+
const sep = isWin ? ";" : ":";
|
|
297
|
+
const exts = isWin
|
|
298
|
+
? (proc?.env?.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").map((e) => e.toLowerCase())
|
|
299
|
+
: [""];
|
|
300
|
+
for (const dir of pathEnv.split(sep)) {
|
|
301
|
+
if (!dir)
|
|
302
|
+
continue;
|
|
303
|
+
for (const ext of exts) {
|
|
304
|
+
const candidate = path.join(dir, name + ext);
|
|
305
|
+
if (fileExists(candidate))
|
|
306
|
+
return candidate;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return null;
|
|
310
|
+
}
|
|
311
|
+
catch {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function sleep(ms) {
|
|
316
|
+
return new Promise((r) => setTimeout(r, ms));
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Always activate the auth-proxy bridge when spawning via the SDK — same default as
|
|
320
|
+
* the CLI. "auto" makes the runtime attempt the bridge and degrade safely to direct
|
|
321
|
+
* egress when no proxy creds resolve (so it never re-introduces the v9.3.4 ERR_TUNNEL
|
|
322
|
+
* breakage of forcing a proxy default). An explicit UNBROWSE_KURI_PROXY (incl. "0"/
|
|
323
|
+
* "false" — the emergency disable) is preserved. Pure + exported for unit tests.
|
|
324
|
+
*/
|
|
325
|
+
export function applyBridgeDefault(env) {
|
|
326
|
+
if (env.UNBROWSE_KURI_PROXY == null || env.UNBROWSE_KURI_PROXY === "") {
|
|
327
|
+
return { ...env, UNBROWSE_KURI_PROXY: "auto" };
|
|
328
|
+
}
|
|
329
|
+
return env;
|
|
330
|
+
}
|
|
331
|
+
function sanitizeEnv(env) {
|
|
332
|
+
const out = {};
|
|
333
|
+
for (const [k, v] of Object.entries(env)) {
|
|
334
|
+
if (typeof v === "string")
|
|
335
|
+
out[k] = v;
|
|
336
|
+
}
|
|
337
|
+
return out;
|
|
338
|
+
}
|
|
339
|
+
//# sourceMappingURL=runt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ED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAA2B;IAC5D,IAAI,GAAG,CAAC,mBAAmB,IAAI,IAAI,IAAI,GAAG,CAAC,mBAAmB,KAAK,EAAE,EAAE,CAAC;QACtE,OAAO,EAAE,GAAG,GAAG,EAAE,mBAAmB,EAAE,MAAM,EAAE,CAAC;IACjD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,WAAW,CAAC,GAAsB;IACzC,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,IAAI,OAAO,CAAC,KAAK,QAAQ;YAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unbrowse/sdk",
|
|
3
|
-
"version": "11.1.
|
|
4
|
-
"description": "TypeScript SDK for Unbrowse
|
|
3
|
+
"version": "11.1.6",
|
|
4
|
+
"description": "TypeScript SDK for Unbrowse 11.1.6: local runtime control, truthful health, and public stats.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"exports": {
|
|
@@ -31,8 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"optionalDependencies": {
|
|
34
|
-
"unbrowse": "
|
|
35
|
-
"@faremeter/flex-solana": "^0.2.1"
|
|
34
|
+
"unbrowse": ">=9.3.15"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
37
|
"@types/node": "^22.10.0",
|