ant0-browser 0.0.0-stage → 0.1.1

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 (103) hide show
  1. package/LICENSE +35 -0
  2. package/README.md +100 -2
  3. package/dist/chromium-version.d.ts +22 -0
  4. package/dist/chromium-version.d.ts.map +1 -0
  5. package/dist/chromium-version.js +22 -0
  6. package/dist/chromium-version.js.map +1 -0
  7. package/dist/download.d.ts +22 -0
  8. package/dist/download.d.ts.map +1 -0
  9. package/dist/download.js +219 -0
  10. package/dist/download.js.map +1 -0
  11. package/dist/fingerprint.d.ts +213 -0
  12. package/dist/fingerprint.d.ts.map +1 -0
  13. package/dist/fingerprint.js +375 -0
  14. package/dist/fingerprint.js.map +1 -0
  15. package/dist/fontpack.d.ts +13 -0
  16. package/dist/fontpack.d.ts.map +1 -0
  17. package/dist/fontpack.js +149 -0
  18. package/dist/fontpack.js.map +1 -0
  19. package/dist/fonts.d.ts +15 -0
  20. package/dist/fonts.d.ts.map +1 -0
  21. package/dist/fonts.js +86 -0
  22. package/dist/fonts.js.map +1 -0
  23. package/dist/geoip.d.ts +45 -0
  24. package/dist/geoip.d.ts.map +1 -0
  25. package/dist/geoip.js +289 -0
  26. package/dist/geoip.js.map +1 -0
  27. package/dist/geometry.d.ts +28 -0
  28. package/dist/geometry.d.ts.map +1 -0
  29. package/dist/geometry.js +79 -0
  30. package/dist/geometry.js.map +1 -0
  31. package/dist/humanize.d.ts +20 -0
  32. package/dist/humanize.d.ts.map +1 -0
  33. package/dist/humanize.js +921 -0
  34. package/dist/humanize.js.map +1 -0
  35. package/dist/identity-persistence.d.ts +51 -0
  36. package/dist/identity-persistence.d.ts.map +1 -0
  37. package/dist/identity-persistence.js +301 -0
  38. package/dist/identity-persistence.js.map +1 -0
  39. package/dist/identity.d.ts +43 -0
  40. package/dist/identity.d.ts.map +1 -0
  41. package/dist/identity.js +197 -0
  42. package/dist/identity.js.map +1 -0
  43. package/dist/index.d.ts +234 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +593 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/launch-ticket.d.ts +87 -0
  48. package/dist/launch-ticket.d.ts.map +1 -0
  49. package/dist/launch-ticket.js +233 -0
  50. package/dist/launch-ticket.js.map +1 -0
  51. package/dist/launchopts.d.ts +133 -0
  52. package/dist/launchopts.d.ts.map +1 -0
  53. package/dist/launchopts.js +204 -0
  54. package/dist/launchopts.js.map +1 -0
  55. package/dist/motion.d.ts +106 -0
  56. package/dist/motion.d.ts.map +1 -0
  57. package/dist/motion.js +311 -0
  58. package/dist/motion.js.map +1 -0
  59. package/dist/motionscore.d.ts +57 -0
  60. package/dist/motionscore.d.ts.map +1 -0
  61. package/dist/motionscore.js +215 -0
  62. package/dist/motionscore.js.map +1 -0
  63. package/dist/persona-migration.d.ts +51 -0
  64. package/dist/persona-migration.d.ts.map +1 -0
  65. package/dist/persona-migration.js +95 -0
  66. package/dist/persona-migration.js.map +1 -0
  67. package/dist/persona-profile-v2.d.ts +155 -0
  68. package/dist/persona-profile-v2.d.ts.map +1 -0
  69. package/dist/persona-profile-v2.js +421 -0
  70. package/dist/persona-profile-v2.js.map +1 -0
  71. package/dist/population-model.d.ts +42 -0
  72. package/dist/population-model.d.ts.map +1 -0
  73. package/dist/population-model.js +224 -0
  74. package/dist/population-model.js.map +1 -0
  75. package/dist/release-fetch.d.ts +70 -0
  76. package/dist/release-fetch.d.ts.map +1 -0
  77. package/dist/release-fetch.js +392 -0
  78. package/dist/release-fetch.js.map +1 -0
  79. package/dist/release.d.ts +16 -0
  80. package/dist/release.d.ts.map +1 -0
  81. package/dist/release.js +26 -0
  82. package/dist/release.js.map +1 -0
  83. package/dist/render.d.ts +38 -0
  84. package/dist/render.d.ts.map +1 -0
  85. package/dist/render.js +104 -0
  86. package/dist/render.js.map +1 -0
  87. package/dist/shaderdialect.d.ts +33 -0
  88. package/dist/shaderdialect.d.ts.map +1 -0
  89. package/dist/shaderdialect.js +46 -0
  90. package/dist/shaderdialect.js.map +1 -0
  91. package/dist/template-selection.d.ts +14 -0
  92. package/dist/template-selection.d.ts.map +1 -0
  93. package/dist/template-selection.js +65 -0
  94. package/dist/template-selection.js.map +1 -0
  95. package/dist/warnings.d.ts +19 -0
  96. package/dist/warnings.d.ts.map +1 -0
  97. package/dist/warnings.js +159 -0
  98. package/dist/warnings.js.map +1 -0
  99. package/dist/widevine.d.ts +44 -0
  100. package/dist/widevine.d.ts.map +1 -0
  101. package/dist/widevine.js +202 -0
  102. package/dist/widevine.js.map +1 -0
  103. package/package.json +56 -4
package/LICENSE ADDED
@@ -0,0 +1,35 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Ant0 Browser contributors
4
+ Copyright (c) 2026, Clearcote Labs and the Clearcote contributors
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+
31
+ ---
32
+
33
+ The Clearcote notice above applies to source and patches imported into Ant0
34
+ Browser. Other upstream components (Chromium, ungoogled-chromium, and others)
35
+ are distributed under their respective licenses; see CREDITS.md.
package/README.md CHANGED
@@ -1,3 +1,101 @@
1
- # Temporary Holding Version
1
+ <img src="https://ant0.link/icon-192.png" width="64" alt="Ant0 Browser">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ # Ant0 Browser SDK for Node.js
4
+
5
+ A Playwright-compatible SDK for launching a separately installed Ant0 Browser engine from Node.js.
6
+
7
+ [Node.js SDK guide](https://docs.ant0.link/sdk#node) · [Support](https://ant0.link/contact)
8
+
9
+ The `ant0-browser` package contains the SDK, not the browser engine, an Ant0 account or licence, or synthetic-identity assets. SDK code is BSD-3-Clause licensed; the engine is installed and licensed separately.
10
+
11
+ ## Before you install
12
+
13
+ Direct SDK launches require all of the following:
14
+
15
+ 1. Install the Ant0 application and its licensed Ant0 Browser engine.
16
+ 2. Complete sign-in in the Ant0 application; its local `ant0d` daemon uses that signed-in, licensed state to provide launch tickets.
17
+ 3. Set `ANT0_BROWSER_BINARY` to the absolute path of that installation's engine executable before starting Node.js.
18
+
19
+ The SDK checks that the executable is an Ant0 build; stock Chrome or Chromium is not a substitute. SDK package version `0.1.1` and the installed engine release version are independent.
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ npm install ant0-browser@0.1.1
25
+ ```
26
+
27
+ Package metadata declares Node.js 18 or newer. See the qualification table below for tested environments.
28
+
29
+ ## Quick start
30
+
31
+ Save as `example.mjs` and run `node example.mjs`. The example uses native identity and needs no synthetic assets.
32
+
33
+ ```javascript
34
+ import { launch } from "ant0-browser";
35
+
36
+ const browser = await launch({ identity: { mode: "native" } });
37
+ try {
38
+ const page = await browser.newPage();
39
+ await page.goto("https://example.com");
40
+ console.log(await page.title());
41
+ } finally {
42
+ await browser.close();
43
+ }
44
+ ```
45
+
46
+ `launch()` creates a temporary profile by default and removes it when the browser closes or the process exits. Use `launchPersistentContext()` when you intentionally need a persistent profile.
47
+
48
+ ## API at a glance
49
+
50
+ | API | Use | Reference |
51
+ | --- | --- | --- |
52
+ | `launch(options?)` | Launch a Playwright browser with the selected identity. | [Node.js SDK](https://docs.ant0.link/sdk#node) |
53
+ | `launchPersistentContext(userDataDir, options?)` | Launch with an explicitly managed persistent profile. | [Node.js SDK](https://docs.ant0.link/sdk#node) |
54
+ | `serve(options?)` | Start the engine and expose a local CDP endpoint with process controls. | [Node.js SDK](https://docs.ant0.link/sdk#node) |
55
+ | `resolveGeo(proxy?, opts?)` | Optional exit-IP geolocation for identity settings. | [Network details](https://docs.ant0.link/sdk#network) |
56
+
57
+ Omitting `identity` selects native identity. Captured or synthetic identities and explicit overrides are also available; creating a new synthetic identity requires separately authorized local model or template assets. Those assets are not included in the package.
58
+
59
+ ## Proxy, network, and privacy
60
+
61
+ Proxy settings for browser launches are optional and follow Playwright's configuration. SOCKS5 username/password authentication is not supported by the engine; use an HTTP(S) proxy with credentials, an unauthenticated SOCKS5 proxy, or Ant0's local relay. GeoIP exit-IP lookups use an HTTP(S) proxy; SOCKS proxies are not supported for that lookup.
62
+
63
+ | Behavior | Network use |
64
+ | --- | --- |
65
+ | Launch-ticket handling | When needed, the SDK requests a ticket from the local `ant0d` daemon over loopback. |
66
+ | `resolveGeo()` | Only when called. The exit-IP lookup uses the configured proxy; GeoIP data may be fetched directly, and fallback providers may be contacted if the primary lookup is unavailable. |
67
+ | Release or optional assets | Only when the corresponding helper is used or an opt-in source is configured. |
68
+
69
+ See [SDK network details](https://docs.ant0.link/sdk#network) and the [Ant0 Privacy Policy](https://ant0.link/legal/privacy) for more information. `resolveGeo()` is optional; ordinary browser navigation follows the URLs your code opens.
70
+
71
+ ## Runtime and qualification
72
+
73
+ The package declares Node.js `>=18`. Qualification so far covers the combinations below; the declared minimum is not a claim that every minimum-version/platform combination has been tested.
74
+
75
+ | Platform | Tested runtime |
76
+ | --- | --- |
77
+ | Linux | Node.js 24 |
78
+ | Windows | Node.js 24 |
79
+
80
+ The engine used for native launch qualification was `154.0.8037.57-ant0.2`.
81
+
82
+ ## Troubleshooting
83
+
84
+ | Symptom | Check |
85
+ | --- | --- |
86
+ | Engine not found or rejected | Confirm `ANT0_BROWSER_BINARY` points to the executable in an installed Ant0 engine release, not stock Chromium. |
87
+ | Launch-ticket rejection (engine exit code 90) | Start Ant0, sign in, and confirm its local daemon can issue a ticket for the installed engine release. The SDK version is not the engine version. |
88
+ | Temporary profile or socket path is too long | Set `TMPDIR` (POSIX) or `TEMP`/`TMP` (Windows) to a short, writable local directory before starting Node.js. |
89
+ | SOCKS5 proxy credentials are rejected | Use an HTTP(S) proxy, an unauthenticated SOCKS5 endpoint, or Ant0's local relay. |
90
+
91
+ ## GeoIP attribution
92
+
93
+ Optional GeoIP uses the IP2Location LITE database ([ip2location.com](https://lite.ip2location.com)), includes GeoLite2 data created by MaxMind ([maxmind.com](https://www.maxmind.com/)), and includes IP geolocation by DB-IP ([db-ip.com](https://db-ip.com)). The merged `geoip-all-in-one` database is GPL-3.0; its data covers country, coordinates, and timezone.
94
+
95
+ ## More information
96
+
97
+ - [Node.js SDK guide and API reference](https://docs.ant0.link/sdk#node)
98
+ - [Identity options](https://docs.ant0.link/sdk#identity)
99
+ - [Network behavior](https://docs.ant0.link/sdk#network)
100
+ - [Support](https://ant0.link/contact)
101
+ - [Privacy Policy](https://ant0.link/legal/privacy)
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Single source of truth for the Chromium version this SDK targets.
3
+ *
4
+ * GENERATED FILE — do not edit by hand. Regenerate with:
5
+ *
6
+ * python3 scripts/sync_chromium_version.py
7
+ *
8
+ * The values come from the repository's `UPSTREAM_REVISION` pin. The SDK ships as a
9
+ * standalone package and cannot read that file at runtime, so the pin is baked in here
10
+ * and `scripts/sync_chromium_version.py --check` re-verifies it against `UPSTREAM_REVISION`
11
+ * (run by the patch-integrity gate), which is what keeps the copy honest.
12
+ *
13
+ * See docs/UPGRADING.md: a routine engine bump is "change UPSTREAM_REVISION, run the sync
14
+ * script, re-apply, rebuild".
15
+ */
16
+ /** Full pinned Chromium version, e.g. `"154.0.8037.57"`. */
17
+ export declare const CHROMIUM_VERSION = "154.0.8037.57";
18
+ /** Major of {@link CHROMIUM_VERSION}, e.g. `154`. The identity contract's `browser_major`. */
19
+ export declare const CHROMIUM_MAJOR = 154;
20
+ /** The UA-reduction form Chromium reports, e.g. `"154.0.0.0"`. */
21
+ export declare const CHROMIUM_UA_VERSION = "154.0.0.0";
22
+ //# sourceMappingURL=chromium-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chromium-version.d.ts","sourceRoot":"","sources":["../src/chromium-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,8FAA8F;AAC9F,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,cAAc,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Single source of truth for the Chromium version this SDK targets.
3
+ *
4
+ * GENERATED FILE — do not edit by hand. Regenerate with:
5
+ *
6
+ * python3 scripts/sync_chromium_version.py
7
+ *
8
+ * The values come from the repository's `UPSTREAM_REVISION` pin. The SDK ships as a
9
+ * standalone package and cannot read that file at runtime, so the pin is baked in here
10
+ * and `scripts/sync_chromium_version.py --check` re-verifies it against `UPSTREAM_REVISION`
11
+ * (run by the patch-integrity gate), which is what keeps the copy honest.
12
+ *
13
+ * See docs/UPGRADING.md: a routine engine bump is "change UPSTREAM_REVISION, run the sync
14
+ * script, re-apply, rebuild".
15
+ */
16
+ /** Full pinned Chromium version, e.g. `"154.0.8037.57"`. */
17
+ export const CHROMIUM_VERSION = "154.0.8037.57";
18
+ /** Major of {@link CHROMIUM_VERSION}, e.g. `154`. The identity contract's `browser_major`. */
19
+ export const CHROMIUM_MAJOR = 154;
20
+ /** The UA-reduction form Chromium reports, e.g. `"154.0.0.0"`. */
21
+ export const CHROMIUM_UA_VERSION = "154.0.0.0";
22
+ //# sourceMappingURL=chromium-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chromium-version.js","sourceRoot":"","sources":["../src/chromium-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEhD,8FAA8F;AAC9F,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAElC,kEAAkE;AAClE,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC"}
@@ -0,0 +1,22 @@
1
+ export declare function incompatibleBinaryError(exe: string): Error;
2
+ export interface DownloadOptions {
3
+ /** Override the legacy local cache directory. No network access is performed. */
4
+ cacheDir?: string;
5
+ /** Suppress cache diagnostics. */
6
+ quiet?: boolean;
7
+ }
8
+ export declare const MANIFEST = ".manifest.json";
9
+ export declare function writeManifest(base: string, browserDir: string): void;
10
+ export declare function verifyInstall(browserDir: string, base?: string, full?: boolean): string[];
11
+ export declare function brokenInstallError(browserDir: string, problems: string[], repairable?: boolean): Error;
12
+ export declare function checkInstall(exe: string): void;
13
+ export declare function cachedBinary(base: string, binary: string, quiet?: boolean): string | null;
14
+ /**
15
+ * Return the pinned-cache binary, installing it from a release store only when opted in.
16
+ *
17
+ * Without ANT0_BROWSER_RELEASE_URL this never touches the network. With it, a missing cache is
18
+ * filled from that store after the release signature and hashes verify; an existing cache is
19
+ * always used as-is (updates are an explicit action, see `installRelease`).
20
+ */
21
+ export declare function ensureBinary(opts?: DownloadOptions): Promise<string>;
22
+ //# sourceMappingURL=download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":"AAuDA,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAM1D;AAED,MAAM,WAAW,eAAe;IAC9B,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AA8BD,eAAO,MAAM,QAAQ,mBAAmB,CAAC;AAWzC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAcpE;AAkBD,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAYzF;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,UAAU,UAAO,GAAG,KAAK,CAWnG;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAS9C;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAkBzF;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAuB9E"}
@@ -0,0 +1,219 @@
1
+ // Offline Ant0 Browser binary discovery and install-integrity helpers.
2
+ import { closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync, } from "node:fs";
3
+ import os from "node:os";
4
+ import path from "node:path";
5
+ import { platformRelease } from "./release.js";
6
+ const ANT0_CAPABILITY = Buffer.from("ant0-browser-capabilities/persona-profile-v1");
7
+ const capabilityChecked = new Set();
8
+ function containsCapability(file) {
9
+ let fd;
10
+ try {
11
+ fd = openSync(file, "r");
12
+ const block = Buffer.allocUnsafe(1024 * 1024);
13
+ let previous = Buffer.alloc(0);
14
+ for (;;) {
15
+ const count = readSync(fd, block, 0, block.length, null);
16
+ if (!count)
17
+ return false;
18
+ const data = Buffer.concat([previous, block.subarray(0, count)]);
19
+ if (data.indexOf(ANT0_CAPABILITY) !== -1)
20
+ return true;
21
+ previous = data.subarray(Math.max(0, data.length - ANT0_CAPABILITY.length + 1));
22
+ }
23
+ }
24
+ catch {
25
+ return false;
26
+ }
27
+ finally {
28
+ if (fd !== undefined)
29
+ closeSync(fd);
30
+ }
31
+ }
32
+ function isAnt0Binary(exe) {
33
+ const resolved = realpathSync(exe);
34
+ const sibling = path.join(path.dirname(resolved), "chrome.dll");
35
+ const files = [resolved, ...(existsSync(sibling) ? [sibling] : [])];
36
+ const identity = files.map((file) => {
37
+ const stat = statSync(file, { bigint: true });
38
+ return `${file}:${stat.size}:${stat.mtimeNs}`;
39
+ }).join("|");
40
+ if (capabilityChecked.has(identity))
41
+ return true;
42
+ if (!files.some(containsCapability))
43
+ return false;
44
+ capabilityChecked.add(identity);
45
+ return true;
46
+ }
47
+ export function incompatibleBinaryError(exe) {
48
+ return new Error(`The selected executable is not a compatible Ant0 Browser build:\n ${exe}\n` +
49
+ "Required SDK capability persona-profile-v1 was not found. " +
50
+ "Refusing to launch arbitrary Chrome/Chromium.");
51
+ }
52
+ function defaultCacheRoot() {
53
+ if (process.env.ANT0_BROWSER_CACHE)
54
+ return process.env.ANT0_BROWSER_CACHE;
55
+ if (process.platform === "win32") {
56
+ return path.join(process.env.LOCALAPPDATA || path.join(os.homedir(), "AppData", "Local"), "ant0-browser", "Cache");
57
+ }
58
+ if (process.platform === "darwin")
59
+ return path.join(os.homedir(), "Library", "Caches", "ant0-browser");
60
+ return path.join(process.env.XDG_CACHE_HOME || path.join(os.homedir(), ".cache"), "ant0-browser");
61
+ }
62
+ function findFile(dir, name) {
63
+ const stack = [dir];
64
+ while (stack.length) {
65
+ const current = stack.pop();
66
+ let entries;
67
+ try {
68
+ entries = readdirSync(current, { withFileTypes: true });
69
+ }
70
+ catch {
71
+ continue;
72
+ }
73
+ for (const entry of entries) {
74
+ const target = path.join(current, entry.name);
75
+ if (entry.isDirectory())
76
+ stack.push(target);
77
+ else if (entry.name.toLowerCase() === name.toLowerCase())
78
+ return target;
79
+ }
80
+ }
81
+ return null;
82
+ }
83
+ export const MANIFEST = ".manifest.json";
84
+ const CRITICAL_FILES = {
85
+ win32: ["chrome.exe", "chrome.dll", "chrome_elf.dll", "icudtl.dat", "snapshot_blob.bin", "resources.pak"],
86
+ other: ["icudtl.dat", "snapshot_blob.bin", "resources.pak"],
87
+ };
88
+ const scanned = new Set();
89
+ function criticalNames() {
90
+ return CRITICAL_FILES[process.platform === "win32" ? "win32" : "other"];
91
+ }
92
+ export function writeManifest(base, browserDir) {
93
+ const files = {};
94
+ const walk = (current) => {
95
+ for (const entry of readdirSync(current, { withFileTypes: true })) {
96
+ const target = path.join(current, entry.name);
97
+ if (entry.isDirectory())
98
+ walk(target);
99
+ else
100
+ files[path.relative(browserDir, target).split(path.sep).join("/")] = statSync(target).size;
101
+ }
102
+ };
103
+ try {
104
+ walk(browserDir);
105
+ mkdirSync(base, { recursive: true });
106
+ writeFileSync(path.join(base, MANIFEST), JSON.stringify({ files }));
107
+ }
108
+ catch { /* a manifest is an optimization */ }
109
+ }
110
+ function checkNames(browserDir, names, sizes = {}) {
111
+ const problems = [];
112
+ for (const name of names) {
113
+ const target = path.join(browserDir, ...name.split("/"));
114
+ if (!existsSync(target)) {
115
+ problems.push(`${name} — missing`);
116
+ continue;
117
+ }
118
+ const got = statSync(target).size;
119
+ const want = sizes[name];
120
+ if (want !== undefined && got !== want)
121
+ problems.push(`${name} — ${got} bytes, expected ${want}`);
122
+ else if (want === undefined && got === 0)
123
+ problems.push(`${name} — empty (0 bytes)`);
124
+ }
125
+ return problems;
126
+ }
127
+ export function verifyInstall(browserDir, base, full) {
128
+ let problems = checkNames(browserDir, criticalNames());
129
+ if (problems.length)
130
+ return problems;
131
+ const manifest = path.join(base ?? path.dirname(browserDir), MANIFEST);
132
+ const key = path.resolve(browserDir).toLowerCase();
133
+ if (full === false || (full === undefined && scanned.has(key)) || !existsSync(manifest))
134
+ return problems;
135
+ try {
136
+ const sizes = JSON.parse(readFileSync(manifest, "utf8")).files ?? {};
137
+ problems = checkNames(browserDir, Object.keys(sizes), sizes);
138
+ if (!problems.length)
139
+ scanned.add(key);
140
+ }
141
+ catch { /* ignore an unreadable optional manifest */ }
142
+ return problems;
143
+ }
144
+ export function brokenInstallError(browserDir, problems, repairable = true) {
145
+ const shown = problems.slice(0, 8).map((problem) => ` ${problem}`).join("\n");
146
+ const more = problems.length > 8 ? `\n ... and ${problems.length - 8} more` : "";
147
+ const fix = repairable
148
+ ? `Delete the damaged local cache folder and point the SDK at a complete local build:\n ${path.dirname(browserDir)}`
149
+ : "Re-create this browser directory from a complete local build.";
150
+ return new Error(`Ant0 Browser browser install is incomplete or corrupted:\n ${browserDir}\n${shown}${more}\n\n${fix}\n` +
151
+ "Set executablePath or ANT0_BROWSER_BINARY to the resulting chrome executable.\n" +
152
+ "Common causes include antivirus quarantine, a full disk, or an interrupted copy.");
153
+ }
154
+ export function checkInstall(exe) {
155
+ if (!exe || !existsSync(exe) || !statSync(exe).isFile() || !isAnt0Binary(exe)) {
156
+ throw incompatibleBinaryError(exe);
157
+ }
158
+ const browserDir = path.dirname(path.resolve(exe));
159
+ const payload = criticalNames().filter((name) => !name.toLowerCase().startsWith("chrome.ex"));
160
+ if (!payload.some((name) => existsSync(path.join(browserDir, name))))
161
+ return;
162
+ const problems = verifyInstall(browserDir);
163
+ if (problems.length)
164
+ throw brokenInstallError(browserDir, problems, false);
165
+ }
166
+ export function cachedBinary(base, binary, quiet) {
167
+ if (!existsSync(path.join(base, ".verified")))
168
+ return null;
169
+ const browserDir = path.join(base, "browser");
170
+ const cached = findFile(browserDir, binary);
171
+ if (!cached)
172
+ return null;
173
+ if (!isAnt0Binary(cached)) {
174
+ rmSync(browserDir, { recursive: true, force: true });
175
+ rmSync(path.join(base, ".verified"), { force: true });
176
+ rmSync(path.join(base, MANIFEST), { force: true });
177
+ return null;
178
+ }
179
+ const problems = verifyInstall(browserDir, base);
180
+ if (!problems.length)
181
+ return cached;
182
+ if (!quiet)
183
+ process.stderr.write(`[ant0-browser] cached browser is damaged (${problems[0]}); removing it\n`);
184
+ rmSync(browserDir, { recursive: true, force: true });
185
+ rmSync(path.join(base, ".verified"), { force: true });
186
+ rmSync(path.join(base, MANIFEST), { force: true });
187
+ return null;
188
+ }
189
+ /**
190
+ * Return the pinned-cache binary, installing it from a release store only when opted in.
191
+ *
192
+ * Without ANT0_BROWSER_RELEASE_URL this never touches the network. With it, a missing cache is
193
+ * filled from that store after the release signature and hashes verify; an existing cache is
194
+ * always used as-is (updates are an explicit action, see `installRelease`).
195
+ */
196
+ export async function ensureBinary(opts = {}) {
197
+ const release = platformRelease();
198
+ const base = release ? path.join(opts.cacheDir || defaultCacheRoot(), release.tag) : undefined;
199
+ if (release && base) {
200
+ const cached = cachedBinary(base, release.binary, opts.quiet);
201
+ if (cached)
202
+ return cached;
203
+ }
204
+ const releaseUrl = process.env.ANT0_BROWSER_RELEASE_URL;
205
+ if (releaseUrl && base) {
206
+ const { installRelease } = await import("./release-fetch.js");
207
+ const exe = await installRelease(releaseUrl, base, {
208
+ quiet: opts.quiet,
209
+ version: process.env.ANT0_BROWSER_RELEASE_VERSION || undefined,
210
+ channel: process.env.ANT0_BROWSER_RELEASE_CHANNEL || undefined,
211
+ });
212
+ checkInstall(exe);
213
+ return exe;
214
+ }
215
+ throw new Error("No local Ant0 Browser binary was found. Build the browser first, then pass executablePath or " +
216
+ "set ANT0_BROWSER_BINARY to chrome/chrome.exe. To install a published release instead, set " +
217
+ "ANT0_BROWSER_RELEASE_URL to your release store.");
218
+ }
219
+ //# sourceMappingURL=download.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.js","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,OAAO,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;AACpF,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;AAE5C,SAAS,kBAAkB,CAAC,IAAY;IACtC,IAAI,EAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,EAAE,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACzB,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;QAC9C,IAAI,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC/B,SAAS,CAAC;YACR,MAAM,KAAK,GAAG,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACzD,IAAI,CAAC,KAAK;gBAAE,OAAO,KAAK,CAAC;YACzB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;YACjE,IAAI,IAAI,CAAC,OAA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