unbrowse 8.3.0-preview.0 → 8.3.0-preview.2

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/bin/unbrowse.js CHANGED
@@ -4,14 +4,17 @@
4
4
  * Auditable runtime launcher.
5
5
  *
6
6
  * The package ships a READABLE, UNSIGNED runtime at `runtime/cli.js` (an
7
- * unminified Bun bundle of the source) and runs it here. The source IS the
8
- * runtime, so the client including the zk/crypto verification path is fully
9
- * auditable on disk. There is nothing to hide: every secret is wallet-sealed
10
- * (AES-GCM under a key only the holder derives), so reverse-engineering the
11
- * client yields nothing. Security lives in the wallet, not in obfuscation.
7
+ * unminified bundle of the source, built `--target=node`) and runs it here under
8
+ * the same Node that launched this script. The source IS the runtime, so the
9
+ * client including the zk/crypto verification path is fully auditable on disk.
10
+ * There is nothing to hide: every secret is wallet-sealed (AES-GCM under a key only
11
+ * the holder derives), so reverse-engineering the client yields nothing. Security
12
+ * lives in the wallet, not in obfuscation.
12
13
  *
13
- * The runtime requires Bun. If a compiled binary was downloaded post-install,
14
- * the wrapper runs that instead and never reaches this launcher.
14
+ * No Bun is required at the user's runtime: the bundle runs on plain Node (>= 22.5,
15
+ * for the built-in `node:sqlite` driver the route graph uses). If a compiled
16
+ * single-file binary was injected via UNBROWSE_INSTALL_BINARY_PATH, the wrapper runs
17
+ * that instead and never reaches this launcher.
15
18
  */
16
19
 
17
20
  import { existsSync } from "node:fs";
@@ -27,33 +30,21 @@ function fail(msg, code = 1) {
27
30
  process.exit(code);
28
31
  }
29
32
 
30
- function findBun() {
31
- const candidates = [
32
- process.env.UNBROWSE_BUN_BIN,
33
- "bun",
34
- join(process.env.HOME || "", ".bun", "bin", "bun"),
35
- ].filter(Boolean);
36
- for (const candidate of candidates) {
37
- try {
38
- const probe = spawnSync(candidate, ["--version"], { stdio: "ignore" });
39
- if (probe.status === 0) return candidate;
40
- } catch {
41
- /* try the next candidate */
42
- }
43
- }
44
- return null;
45
- }
46
-
47
33
  if (!existsSync(runtime)) {
48
34
  fail("readable runtime missing (runtime/cli.js). Reinstall: npm install -g unbrowse@latest");
49
35
  }
50
36
 
51
- const bun = findBun();
52
- if (!bun) {
53
- fail("this build runs on Bun. Install it from https://bun.sh, then re-run (or set UNBROWSE_BUN_BIN).");
37
+ // The route graph uses Node's built-in node:sqlite (Node >= 22.5). Fail clearly,
38
+ // not with a cryptic module error, when the host Node is too old.
39
+ const [maj, min] = process.versions.node.split(".").map(Number);
40
+ if (maj < 22 || (maj === 22 && min < 5)) {
41
+ fail(
42
+ `unbrowse needs Node >= 22.5 (you have ${process.versions.node}). ` +
43
+ `Upgrade Node (e.g. via nvm or https://nodejs.org), then re-run.`,
44
+ );
54
45
  }
55
46
 
56
- const child = spawnSync(bun, [runtime, ...process.argv.slice(2)], {
47
+ const child = spawnSync(process.execPath, [runtime, ...process.argv.slice(2)], {
57
48
  stdio: "inherit",
58
49
  cwd: process.cwd(),
59
50
  env: process.env,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unbrowse",
3
- "version": "8.3.0-preview.0",
3
+ "version": "8.3.0-preview.2",
4
4
  "description": "Reverse-engineer any website into reusable API skills. Zero-dep single binary with embedded browser engine.",
5
5
  "mcpName": "io.github.unbrowse-ai/unbrowse",
6
6
  "type": "module",
@@ -25,6 +25,7 @@
25
25
  "vendor/utls-proxy",
26
26
  "scripts/release-assets.mjs",
27
27
  "scripts/postinstall.mjs",
28
+ "scripts/prune-foreign-binaries.mjs",
28
29
  "scripts/postinstall-ping.mjs",
29
30
  "scripts/verify-release-assets.mjs",
30
31
  "README.md",
@@ -42,22 +43,21 @@
42
43
  },
43
44
  "dependencies": {
44
45
  "@fastify/cors": "^11.2.0",
45
- "@fastify/rate-limit": "^10.3.0",
46
- "@solana/kit": "^6.6.0",
47
- "@x402/fetch": "^2.9.0",
48
46
  "bs58": "^6.0.0",
49
47
  "cheerio": "^1.2.0",
50
48
  "dotenv": "^17.3.1",
51
49
  "fastify": "^5.7.4",
52
50
  "nanoid": "^5.1.6",
53
- "tsx": "^4.20.6",
54
51
  "ws": "^8.19.0"
55
52
  },
56
53
  "optionalDependencies": {
57
- "keytar": "^7.9.0",
58
- "@faremeter/flex-solana": "^0.2.1"
54
+ "keytar": "^7.9.0"
59
55
  },
60
56
  "devDependencies": {
61
- "@types/node": "^24.6.1"
57
+ "@types/node": "^24.6.1",
58
+ "tsx": "^4.20.6"
59
+ },
60
+ "engines": {
61
+ "node": ">=22.5"
62
62
  }
63
63
  }