ghostfox 0.8.2 → 0.8.3

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.
Files changed (2) hide show
  1. package/bin/ghostfox.js +15 -2
  2. package/package.json +1 -1
package/bin/ghostfox.js CHANGED
@@ -81,8 +81,21 @@ async function install() {
81
81
  if (!fs.existsSync(path.join(ENGINE, "ghostfox-bin"))) {
82
82
  const platform = os.platform() === "linux" ? "lin" : os.platform() === "darwin" ? "mac" : "win";
83
83
  const arch = os.arch() === "arm64" ? "arm64" : "x86_64";
84
- const asset = Object.keys(assets).find((n) => n.includes(`${platform}.${arch}`) && n.endsWith(".zip"));
85
- if (!asset) throw new Error(`no prebuilt engine for ${platform}-${arch} on the latest release`);
84
+ const want = (a) => a.includes(`${platform}.${arch}`) && a.endsWith(".zip");
85
+ let asset = Object.keys(assets).find(want);
86
+ // Engine builds land ~2h after a release; when the latest release is
87
+ // still engine-less (runtime-only), fall back to the most recent
88
+ // release that HAS the engine zip.
89
+ if (!asset) {
90
+ log("engine zip not on the latest release yet — checking previous releases...");
91
+ const rels = await fetchJson(`https://api.github.com/repos/${REPO}/releases?per_page=10`);
92
+ for (const rel of rels) {
93
+ const prevAssets = Object.fromEntries(rel.assets.map((a) => [a.name, a.browser_download_url]));
94
+ const hit = Object.keys(prevAssets).find(want);
95
+ if (hit) { asset = hit; assets[asset] = prevAssets[hit]; log(`using ${asset} from ${rel.tag_name}`); break; }
96
+ }
97
+ }
98
+ if (!asset) throw new Error(`no prebuilt engine for ${platform}-${arch} on any release`);
86
99
  log(`downloading engine (${asset}) — this is ~650MB...`);
87
100
  const tmp = path.join(os.tmpdir(), "ghostfox-engine.zip");
88
101
  await download(assets[asset], tmp);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghostfox",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "The agent-native stealth browser with 8 captcha solver families + debug cortex \u2014 MCP launcher + installer for Ghostfox (fingerprint-coherent Firefox engine + Rust MCP runtime).",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "repository": {