capiumbrowser 1.1.3 → 1.1.5

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/lib/channels.json CHANGED
@@ -1,27 +1,27 @@
1
1
  {
2
2
  "_comment": "SINGLE SOURCE OF TRUTH for the current stable Capium browser build per OS/arch. Each OS reaches stable independently -- edit one entry without touching the others. This file ships inside the wheel (the SDK reads it to pick each host's stable build) AND is published to the download server by the release pipeline. `version` is the Chromium version (what the browser reports to the customer -- unchanged by the revision); `revision` is our packaging counter -- the served R2 folder is chromium-v<version>.<revision>/, ALWAYS dotted-suffixed starting at 1 (chromium-v<version>.1/ is the first build, .2/ a same-engine re-spin), so publishing a re-spin never overwrites the artifact older SDKs still fetch. `published: false` means the tag is declared but no artifact exists yet -- the SDK raises a clear 'not published yet' error instead of a raw 404.",
3
3
  "schema": 1,
4
- "updated": "2026-09-29",
4
+ "updated": "2026-09-30",
5
5
  "channels": {
6
6
  "stable": {
7
7
  "windows-x64": {
8
8
  "version": "153.0.8010.53",
9
9
  "engine_version": "153.0.8010.52",
10
- "revision": 3,
11
- "sha256": "af8ca122fe5ba572c985ee83869371505aba4e9cf6696c9385c68b28001c43ef",
10
+ "revision": 4,
11
+ "sha256": "a3c92c3a726ed350f23864a10ed671d2bae302334185fe05d5218c0d2f79e23a",
12
12
  "published": true
13
13
  },
14
14
  "macos-arm64": {
15
15
  "version": "153.0.8010.53",
16
16
  "engine_version": "153.0.8010.52",
17
- "revision": 3,
18
- "sha256": "4f41a66c792781e86bff653cd91adb3d41733c67d350d70c5c7c4287621a679f",
17
+ "revision": 4,
18
+ "sha256": "26aa45865098fd528b8d88ff82135ecbba1fa23397f892bd77734d1ed1109582",
19
19
  "published": true
20
20
  },
21
21
  "linux-x64": {
22
22
  "version": "153.0.8010.52",
23
- "revision": 2,
24
- "sha256": "bb6f88b874f41718250cc26f50976c6cd27167a7583b5169fbcac99619d0eafc",
23
+ "revision": 3,
24
+ "sha256": "51e7d68ad521b14f81cf60440eb37a6546d0f5e7b7fb96619c9546433931ad89",
25
25
  "published": true
26
26
  },
27
27
  "linux-arm64": {
package/lib/download.js CHANGED
@@ -106,6 +106,17 @@ function destRoot() {
106
106
  return process.env.CAPIUM_HOME || path.join(os.homedir(), '.capium');
107
107
  }
108
108
 
109
+ /**
110
+ * True if `binPath` lives under the canonical install root (~/.capium or CAPIUM_HOME). A
111
+ * same-version binary found OUTSIDE it (a legacy install elsewhere) is NOT reused -- we reinstall
112
+ * into the root so everything lands under one folder next to the license.
113
+ */
114
+ function inRoot(binPath, root) {
115
+ const d = path.resolve(path.dirname(binPath));
116
+ const r = path.resolve(root);
117
+ return d === r || d.startsWith(r + path.sep);
118
+ }
119
+
109
120
  /**
110
121
  * Extract a distro archive, sniffing gzip/zip/tar so the server can ship any of them.
111
122
  *
@@ -334,12 +345,13 @@ async function ensureBinary({ version = null, licenseKey = null, server = null }
334
345
  else revision = binaryRevisionFor(tag);
335
346
  const bid = buildId(version, revision);
336
347
 
337
- // Reuse the cached binary ONLY if it's already this exact build (version + revision). A
338
- // different build -- e.g. after `npm install capiumbrowser@latest` bumps this OS's pinned build
339
- // or re-spin -- falls through to fetch the new one and drop the old.
348
+ // Reuse the cached binary ONLY if it's already this exact build (version + revision) AND it
349
+ // lives in the canonical root (~/.capium or CAPIUM_HOME). A different build -- or a same-build
350
+ // binary in a LEGACY location -- falls through so we (re)install into ~/.capium, keeping the
351
+ // browser under one folder next to the license.
340
352
  try {
341
353
  const existing = config.findBinary();
342
- if (readInstalledVersion(existing) === bid) return existing;
354
+ if (readInstalledVersion(existing) === bid && inRoot(existing, destRoot())) return existing;
343
355
  } catch {}
344
356
 
345
357
  let url;
@@ -407,6 +419,7 @@ module.exports = {
407
419
  downloadTag,
408
420
  distroPath,
409
421
  destRoot,
422
+ inRoot,
410
423
  ensureBinary,
411
424
  installedVersion,
412
425
  expectedBuildId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capiumbrowser",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "Drop-in stealth browser SDK on top of Playwright or Puppeteer (Capium Chromium).",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Capzy (https://capzy.ai)",
package/playwright.js CHANGED
@@ -20,6 +20,7 @@
20
20
  */
21
21
  'use strict';
22
22
 
23
+ const path = require('path');
23
24
  const config = require('./lib/config');
24
25
  const download = require('./lib/download');
25
26
  const human = require('./lib/human');
@@ -50,11 +51,19 @@ async function resolveBinary(binary, licenseKey) {
50
51
  const want = download.expectedBuildId();
51
52
  try {
52
53
  const found = config.findBinary();
54
+ if (want === null) return found; // can't determine target (unsupported/manifest) -- trust it
53
55
  const have = download.installedVersion(found);
54
- if (want === null || have === want) return found;
55
- process.stderr.write(
56
- `capium: ignoring stale binary at ${found} (build ${have}; current target ${want}) and ` +
57
- `fetching the current build. Delete it or set CAPIUM_BINARY to silence this.\n`);
56
+ const atRoot = download.inRoot(found, download.destRoot());
57
+ if (have === want && atRoot) return found;
58
+ if (have === want && !atRoot) {
59
+ process.stderr.write(
60
+ `capium: moving the browser out of ${path.dirname(found)} into ~/.capium (the shared ` +
61
+ `capium home). Set CAPIUM_BINARY to pin a location.\n`);
62
+ } else {
63
+ process.stderr.write(
64
+ `capium: ignoring stale binary at ${found} (build ${have}; current target ${want}) and ` +
65
+ `fetching the current build. Delete it or set CAPIUM_BINARY to silence this.\n`);
66
+ }
58
67
  } catch (e) {
59
68
  if (e.code !== 'ENOENT') throw e;
60
69
  }
package/puppeteer.js CHANGED
@@ -24,6 +24,7 @@
24
24
  */
25
25
  'use strict';
26
26
 
27
+ const path = require('path');
27
28
  const config = require('./lib/config');
28
29
  const download = require('./lib/download');
29
30
  const human = require('./lib/human');
@@ -53,11 +54,19 @@ async function resolveBinary(binary, licenseKey) {
53
54
  const want = download.expectedBuildId();
54
55
  try {
55
56
  const found = config.findBinary();
57
+ if (want === null) return found; // can't determine target (unsupported/manifest) -- trust it
56
58
  const have = download.installedVersion(found);
57
- if (want === null || have === want) return found;
58
- process.stderr.write(
59
- `capium: ignoring stale binary at ${found} (build ${have}; current target ${want}) and ` +
60
- `fetching the current build. Delete it or set CAPIUM_BINARY to silence this.\n`);
59
+ const atRoot = download.inRoot(found, download.destRoot());
60
+ if (have === want && atRoot) return found;
61
+ if (have === want && !atRoot) {
62
+ process.stderr.write(
63
+ `capium: moving the browser out of ${path.dirname(found)} into ~/.capium (the shared ` +
64
+ `capium home). Set CAPIUM_BINARY to pin a location.\n`);
65
+ } else {
66
+ process.stderr.write(
67
+ `capium: ignoring stale binary at ${found} (build ${have}; current target ${want}) and ` +
68
+ `fetching the current build. Delete it or set CAPIUM_BINARY to silence this.\n`);
69
+ }
61
70
  } catch (e) {
62
71
  if (e.code !== 'ENOENT') throw e;
63
72
  }