camoucore 0.3.0 → 0.6.0

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 (171) hide show
  1. package/LICENSE +4 -3
  2. package/dist/camoufox/__main__.d.ts +10 -0
  3. package/dist/camoufox/__main__.js +1175 -0
  4. package/dist/camoufox/__version__.d.ts +31 -0
  5. package/dist/camoufox/__version__.js +32 -0
  6. package/dist/camoufox/_humanize_playwright.d.ts +54 -0
  7. package/dist/camoufox/_humanize_playwright.js +429 -0
  8. package/dist/camoufox/addons.d.ts +21 -0
  9. package/dist/camoufox/addons.js +56 -0
  10. package/dist/camoufox/async_api.d.ts +9 -0
  11. package/dist/camoufox/async_api.js +9 -0
  12. package/dist/camoufox/browser-pin.d.ts +46 -0
  13. package/dist/camoufox/browser-pin.js +96 -0
  14. package/dist/camoufox/cli.d.ts +7 -0
  15. package/dist/camoufox/cli.js +20 -0
  16. package/dist/camoufox/coherence.d.ts +141 -0
  17. package/dist/camoufox/coherence.js +708 -0
  18. package/dist/camoufox/data-files/audio-output-latency.json +15 -0
  19. package/dist/camoufox/data-files/browser-pin.json +7 -0
  20. package/dist/camoufox/data-files/display-profiles.json +6 -0
  21. package/dist/camoufox/data-files/essential-fonts.json +5 -0
  22. package/dist/camoufox/data-files/fingerprint-presets-v150.json +14544 -0
  23. package/dist/camoufox/data-files/fingerprint-presets.json +5192 -0
  24. package/dist/camoufox/data-files/font-bases.json +1888 -0
  25. package/dist/camoufox/data-files/font-groups.json +716 -0
  26. package/dist/camoufox/data-files/font-prefs.json +1046 -0
  27. package/dist/camoufox/data-files/fonts.json +240 -0
  28. package/dist/camoufox/data-files/fpgen.yml +44 -0
  29. package/dist/camoufox/data-files/launcher-constants.json +136 -0
  30. package/dist/camoufox/data-files/media-devices.json +180 -0
  31. package/dist/camoufox/data-files/repos.yml +40 -0
  32. package/dist/camoufox/data-files/voice-manifests.json +1864 -0
  33. package/dist/camoufox/data-files/voice-uris.json +188 -0
  34. package/dist/camoufox/data-files/warnings.yml +146 -0
  35. package/dist/camoufox/display_profile.d.ts +21 -0
  36. package/dist/camoufox/display_profile.js +129 -0
  37. package/dist/camoufox/driver_defaults.d.ts +27 -0
  38. package/dist/camoufox/driver_defaults.js +119 -0
  39. package/dist/camoufox/exceptions.d.ts +68 -0
  40. package/dist/camoufox/exceptions.js +122 -0
  41. package/dist/camoufox/fingerprints.d.ts +434 -0
  42. package/dist/camoufox/fingerprints.js +1936 -0
  43. package/dist/camoufox/gpudisplay.d.ts +158 -0
  44. package/dist/camoufox/gpudisplay.js +695 -0
  45. package/dist/camoufox/host_rendering.d.ts +38 -0
  46. package/dist/camoufox/host_rendering.js +180 -0
  47. package/dist/camoufox/humanize.d.ts +89 -0
  48. package/dist/camoufox/humanize.js +143 -0
  49. package/dist/camoufox/index.d.ts +21 -0
  50. package/dist/camoufox/index.js +21 -0
  51. package/dist/camoufox/ip.d.ts +45 -0
  52. package/dist/camoufox/ip.js +114 -0
  53. package/dist/camoufox/multiversion.d.ts +131 -0
  54. package/dist/camoufox/multiversion.js +490 -0
  55. package/dist/camoufox/node-floor.d.ts +5 -0
  56. package/dist/camoufox/node-floor.js +17 -0
  57. package/dist/camoufox/paths.d.ts +45 -0
  58. package/dist/camoufox/paths.js +62 -0
  59. package/dist/camoufox/pkgman.d.ts +361 -0
  60. package/dist/camoufox/pkgman.js +1066 -0
  61. package/dist/camoufox/product.d.ts +8 -0
  62. package/dist/camoufox/product.js +8 -0
  63. package/dist/camoufox/pycompat.d.ts +97 -0
  64. package/dist/camoufox/pycompat.js +458 -0
  65. package/dist/camoufox/server.d.ts +36 -0
  66. package/dist/camoufox/server.js +82 -0
  67. package/dist/camoufox/sync_api.d.ts +77 -0
  68. package/dist/camoufox/sync_api.js +207 -0
  69. package/dist/camoufox/utils.d.ts +638 -0
  70. package/dist/camoufox/utils.js +2507 -0
  71. package/dist/camoufox/warnings.d.ts +16 -0
  72. package/dist/camoufox/warnings.js +65 -0
  73. package/dist/camoufox/webgl.d.ts +52 -0
  74. package/dist/camoufox/webgl.js +264 -0
  75. package/dist/camouwolf/__main__.d.ts +10 -0
  76. package/dist/camouwolf/__main__.js +1180 -0
  77. package/dist/camouwolf/__version__.d.ts +31 -0
  78. package/dist/camouwolf/__version__.js +32 -0
  79. package/dist/camouwolf/_humanize_playwright.d.ts +53 -0
  80. package/dist/camouwolf/_humanize_playwright.js +427 -0
  81. package/dist/camouwolf/addons.d.ts +42 -0
  82. package/dist/camouwolf/addons.js +113 -0
  83. package/dist/camouwolf/async_api.d.ts +9 -0
  84. package/dist/camouwolf/async_api.js +9 -0
  85. package/dist/camouwolf/browser-pin.d.ts +46 -0
  86. package/dist/camouwolf/browser-pin.js +96 -0
  87. package/dist/camouwolf/cli.d.ts +7 -0
  88. package/dist/camouwolf/cli.js +20 -0
  89. package/dist/camouwolf/clienthints.d.ts +61 -0
  90. package/dist/camouwolf/clienthints.js +176 -0
  91. package/dist/camouwolf/coherence.d.ts +152 -0
  92. package/dist/camouwolf/coherence.js +554 -0
  93. package/dist/camouwolf/data-files/browser-pin.json +7 -0
  94. package/dist/camouwolf/data-files/camouwolf.defaults.json +118 -0
  95. package/dist/camouwolf/data-files/data/bundle-fonts.json +1983 -0
  96. package/dist/camouwolf/data-files/data/chrome-languages.json +517 -0
  97. package/dist/camouwolf/data-files/data/properties.json +321 -0
  98. package/dist/camouwolf/data-files/data/system-colors.json +35 -0
  99. package/dist/camouwolf/data-files/data/ubo.json +6 -0
  100. package/dist/camouwolf/data-files/fpgen.yml +41 -0
  101. package/dist/camouwolf/data-files/launcher-constants.json +26 -0
  102. package/dist/camouwolf/data-files/repos.yml +23 -0
  103. package/dist/camouwolf/data-files/warnings.yml +96 -0
  104. package/dist/camouwolf/driver_defaults.d.ts +25 -0
  105. package/dist/camouwolf/driver_defaults.js +114 -0
  106. package/dist/camouwolf/exceptions.d.ts +95 -0
  107. package/dist/camouwolf/exceptions.js +150 -0
  108. package/dist/camouwolf/fingerprints.d.ts +227 -0
  109. package/dist/camouwolf/fingerprints.js +753 -0
  110. package/dist/camouwolf/gpudisplay.d.ts +171 -0
  111. package/dist/camouwolf/gpudisplay.js +711 -0
  112. package/dist/camouwolf/host_rendering.d.ts +18 -0
  113. package/dist/camouwolf/host_rendering.js +114 -0
  114. package/dist/camouwolf/humanize.d.ts +84 -0
  115. package/dist/camouwolf/humanize.js +128 -0
  116. package/dist/camouwolf/index.d.ts +22 -0
  117. package/dist/camouwolf/index.js +21 -0
  118. package/dist/camouwolf/multiversion.d.ts +131 -0
  119. package/dist/camouwolf/multiversion.js +491 -0
  120. package/dist/camouwolf/node-floor.d.ts +5 -0
  121. package/dist/camouwolf/node-floor.js +17 -0
  122. package/dist/camouwolf/paths.d.ts +34 -0
  123. package/dist/camouwolf/paths.js +58 -0
  124. package/dist/camouwolf/pkgman.d.ts +331 -0
  125. package/dist/camouwolf/pkgman.js +972 -0
  126. package/dist/camouwolf/product.d.ts +3 -0
  127. package/dist/camouwolf/product.js +3 -0
  128. package/dist/camouwolf/pycompat.d.ts +92 -0
  129. package/dist/camouwolf/pycompat.js +461 -0
  130. package/dist/camouwolf/server.d.ts +36 -0
  131. package/dist/camouwolf/server.js +81 -0
  132. package/dist/camouwolf/switches.d.ts +77 -0
  133. package/dist/camouwolf/switches.js +222 -0
  134. package/dist/camouwolf/sync_api.d.ts +84 -0
  135. package/dist/camouwolf/sync_api.js +173 -0
  136. package/dist/camouwolf/utils.d.ts +644 -0
  137. package/dist/camouwolf/utils.js +2057 -0
  138. package/dist/camouwolf/warnings.d.ts +14 -0
  139. package/dist/camouwolf/warnings.js +59 -0
  140. package/dist/camouwolf/webgl.d.ts +41 -0
  141. package/dist/camouwolf/webgl.js +198 -0
  142. package/dist/data.d.ts +1 -1
  143. package/dist/data.js +3 -3
  144. package/dist/download.js +1 -1
  145. package/dist/exceptions.d.ts +1 -1
  146. package/dist/exceptions.js +1 -1
  147. package/dist/geolocation.js +1 -1
  148. package/dist/host.js +1 -1
  149. package/dist/ip.js +1 -1
  150. package/dist/locales.js +1 -1
  151. package/dist/mcp/cli.d.ts +15 -0
  152. package/dist/mcp/cli.js +108 -0
  153. package/dist/mcp/index.d.ts +8 -0
  154. package/dist/mcp/index.js +8 -0
  155. package/dist/mcp/main.d.ts +2 -0
  156. package/dist/mcp/main.js +8 -0
  157. package/dist/mcp/secrets.d.ts +50 -0
  158. package/dist/mcp/secrets.js +193 -0
  159. package/dist/mcp/server.d.ts +48 -0
  160. package/dist/mcp/server.js +653 -0
  161. package/dist/mcp/tree.d.ts +10 -0
  162. package/dist/mcp/tree.js +36 -0
  163. package/dist/passthrough.d.ts +1 -1
  164. package/dist/product.js +1 -1
  165. package/dist/settings.js +1 -1
  166. package/dist/telemetry.d.ts +0 -1
  167. package/dist/telemetry.js +5 -4
  168. package/dist/virtdisplay.d.ts +1 -1
  169. package/dist/virtdisplay.js +1 -1
  170. package/dist/warnings.js +1 -1
  171. package/package.json +57 -13
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The browser build this copy of the library was released with.
3
+ *
4
+ * Twin of python/camoucore/src/camoucore/camoufox/browser_pin.py, reading the same
5
+ * `browser-pin.json` (a DATA_FILES entry). Every published package is stamped
6
+ * with the one browser release built from the same sources; by default the
7
+ * library fetches and launches exactly that build. An explicit user choice
8
+ * (`camoufox set ...`) is kept, with a warning at launch. A development
9
+ * checkout carries `{}` and pins nothing.
10
+ *
11
+ * The browser repository's pin wins: its `camoufox` npm package depends on
12
+ * exactly one release of this driver and ships `camoufox_pin/browser-pin.json`
13
+ * (exported at that subpath), naming the browser released with it. Without
14
+ * that package the driver reads its own file, which camoucore's release
15
+ * stamps with the browser its CI tested.
16
+ */
17
+ /** Test seam, like pkgmanDeps: where the pin is read from. */
18
+ export declare const browserPinDeps: {
19
+ /** The driver's own pin, read without the browser repository's package. */
20
+ file: string;
21
+ /** Where the browser repository's package is resolved from. */
22
+ resolveFrom: string;
23
+ };
24
+ /** The browser repository's pin when its package is installed, else the driver's. */
25
+ export declare function pinFile(): string;
26
+ export interface BrowserPin {
27
+ tag: string;
28
+ repo: string;
29
+ repoName: string;
30
+ version: string;
31
+ build: string;
32
+ }
33
+ /** `<firefox version>-<build>`, the form `camoufox set` and the cache use. */
34
+ export declare function pinSpec(pin: BrowserPin): string;
35
+ /** The stamped pin (pinFile()), or null for an unpinned (development) copy. */
36
+ export declare function loadPin(file?: string): BrowserPin | null;
37
+ /** The package pin, unless the user explicitly chose otherwise. */
38
+ export declare function effectivePin(config: {
39
+ channel?: string;
40
+ pinned?: string;
41
+ }): BrowserPin | null;
42
+ export declare function pinMatches(pin: BrowserPin, repoName: string, version: string, build: string): boolean;
43
+ /** Warn once when an explicitly chosen build is not the one this library pairs with. */
44
+ export declare function warnIfUnpaired(repoName: string, version: string, build: string): void;
45
+ /** Test hook: forget that the warning was already issued. */
46
+ export declare function resetUnpairedWarning(): void;
@@ -0,0 +1,96 @@
1
+ /**
2
+ * The browser build this copy of the library was released with.
3
+ *
4
+ * Twin of python/camoucore/src/camoucore/camoufox/browser_pin.py, reading the same
5
+ * `browser-pin.json` (a DATA_FILES entry). Every published package is stamped
6
+ * with the one browser release built from the same sources; by default the
7
+ * library fetches and launches exactly that build. An explicit user choice
8
+ * (`camoufox set ...`) is kept, with a warning at launch. A development
9
+ * checkout carries `{}` and pins nothing.
10
+ *
11
+ * The browser repository's pin wins: its `camoufox` npm package depends on
12
+ * exactly one release of this driver and ships `camoufox_pin/browser-pin.json`
13
+ * (exported at that subpath), naming the browser released with it. Without
14
+ * that package the driver reads its own file, which camoucore's release
15
+ * stamps with the browser its CI tested.
16
+ */
17
+ import * as fs from "node:fs";
18
+ import { createRequire } from "node:module";
19
+ import * as path from "node:path";
20
+ import { LOCAL_DATA } from "./paths.js";
21
+ import { warn } from "./warnings.js";
22
+ /** Test seam, like pkgmanDeps: where the pin is read from. */
23
+ export const browserPinDeps = {
24
+ /** The driver's own pin, read without the browser repository's package. */
25
+ file: path.join(LOCAL_DATA, "browser-pin.json"),
26
+ /** Where the browser repository's package is resolved from. */
27
+ resolveFrom: import.meta.url,
28
+ };
29
+ /** The browser repository's pin, in its `camoufox` package. */
30
+ const WRAPPER_PIN = "camoufox/camoufox_pin/browser-pin.json";
31
+ /** The browser repository's pin when its package is installed, else the driver's. */
32
+ export function pinFile() {
33
+ try {
34
+ const wrapper = createRequire(browserPinDeps.resolveFrom).resolve(WRAPPER_PIN);
35
+ if (fs.statSync(wrapper).isFile())
36
+ return wrapper;
37
+ }
38
+ catch {
39
+ // Not installed, or it does not export the pin: the driver's own.
40
+ }
41
+ return browserPinDeps.file;
42
+ }
43
+ /** `<firefox version>-<build>`, the form `camoufox set` and the cache use. */
44
+ export function pinSpec(pin) {
45
+ return `${pin.version}-${pin.build}`;
46
+ }
47
+ /** The stamped pin (pinFile()), or null for an unpinned (development) copy. */
48
+ export function loadPin(file = pinFile()) {
49
+ let data;
50
+ try {
51
+ data = JSON.parse(fs.readFileSync(file, "utf-8"));
52
+ }
53
+ catch {
54
+ return null;
55
+ }
56
+ if (!data?.tag)
57
+ return null;
58
+ return {
59
+ tag: data.tag,
60
+ repo: String(data.repo),
61
+ repoName: String(data.repo_name).toLowerCase(),
62
+ version: String(data.version),
63
+ build: String(data.build),
64
+ };
65
+ }
66
+ /** Whether the user chose a channel or a build themselves. */
67
+ function isExplicitChoice(config) {
68
+ return Boolean(config.channel || config.pinned);
69
+ }
70
+ /** The package pin, unless the user explicitly chose otherwise. */
71
+ export function effectivePin(config) {
72
+ const pin = loadPin();
73
+ return pin && !isExplicitChoice(config) ? pin : null;
74
+ }
75
+ export function pinMatches(pin, repoName, version, build) {
76
+ return (repoName.toLowerCase() === pin.repoName &&
77
+ version === pin.version &&
78
+ build === pin.build);
79
+ }
80
+ let warned = false;
81
+ /** Warn once when an explicitly chosen build is not the one this library pairs with. */
82
+ export function warnIfUnpaired(repoName, version, build) {
83
+ const pin = loadPin();
84
+ if (warned || pin === null || pinMatches(pin, repoName, version, build)) {
85
+ return;
86
+ }
87
+ warned = true;
88
+ warn(`Launching ${repoName.toLowerCase()} ${version}-${build}, which you selected explicitly. ` +
89
+ `This camoufox release was built and tested with ${pin.repoName} ${pinSpec(pin)} ` +
90
+ `(${pin.tag}); other builds may not be compatible. ` +
91
+ "Run `camoufox set --release` to go back to the paired build.");
92
+ }
93
+ /** Test hook: forget that the warning was already issued. */
94
+ export function resetUnpairedWarning() {
95
+ warned = false;
96
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * The `camoufox` command, the bin of the browser repository's `camoufox` package
4
+ * (RELEASING.md, "The wrapper packages"). `camoufox mcp ...` serves the browser
5
+ * over MCP; everything else is the CLI in __main__.ts.
6
+ */
7
+ import "./node-floor.js";
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * The `camoufox` command, the bin of the browser repository's `camoufox` package
4
+ * (RELEASING.md, "The wrapper packages"). `camoufox mcp ...` serves the browser
5
+ * over MCP; everything else is the CLI in __main__.ts.
6
+ */
7
+ // First: fail with the Node.js floor before any module needs it.
8
+ import "./node-floor.js";
9
+ if (process.argv[2] === "mcp") {
10
+ // Imported only here, and before the launcher: the server takes stdout for
11
+ // the protocol before anything the launcher loads can print to it.
12
+ const { serve } = await import("../mcp/cli.js");
13
+ await serve(process.argv.slice(3), {
14
+ launcher: new URL("./index.js", import.meta.url).href,
15
+ program: "camoufox mcp",
16
+ });
17
+ }
18
+ else {
19
+ await import("./__main__.js");
20
+ }
@@ -0,0 +1,141 @@
1
+ type Config = Record<string, any>;
2
+ /** Core counts Apple Silicon actually ships. */
3
+ export declare const APPLE_SILICON_CORES: ReadonlySet<number>;
4
+ /**
5
+ * devicePixelRatio by platform, ascending as in coherence.py: the
6
+ * nearest-step repair keeps the first of two equally near steps, so a tie
7
+ * goes to the lower one.
8
+ */
9
+ export declare const PLAUSIBLE_DPR: Readonly<Record<string, readonly number[]>>;
10
+ /**
11
+ * colorDepth: Firefox reports 24, or 30 on a deep-colour display. macOS
12
+ * defaults to deep colour, so a Mac reports 30, Intel or Apple Silicon.
13
+ */
14
+ export declare const PLAUSIBLE_COLOR_DEPTH: ReadonlySet<number>;
15
+ /** maxTouchPoints: consumer digitisers top out at 10 contacts. */
16
+ export declare const MAX_PLAUSIBLE_TOUCH_POINTS = 10;
17
+ /** The browser's own chrome height, in CSS pixels (a property of the binary). */
18
+ export declare const BROWSER_CHROME_HEIGHT = 86;
19
+ /** navigator.hardwareConcurrency on an Intel Mac, physical or logical. */
20
+ export declare const INTEL_MAC_IGP_CORES: ReadonlySet<number>;
21
+ /** A discrete GPU adds the desktops to those, up to the 2019 Mac Pro. */
22
+ export declare const INTEL_MAC_DGPU_CORES: ReadonlySet<number>;
23
+ /** Screens only Apple Silicon Macs have: the notched MacBooks, the 24" iMac. */
24
+ export declare const APPLE_SILICON_PANELS: ReadonlySet<string>;
25
+ export interface Violation {
26
+ rule: string;
27
+ detail: string;
28
+ /**
29
+ * The caller's own keys that the repair would have changed, and which were
30
+ * kept as passed instead. Absent when nothing of the caller's is involved.
31
+ */
32
+ kept?: string[];
33
+ }
34
+ export interface Rule {
35
+ name: string;
36
+ /** Returns a description of the breakage, or null when the identity holds. */
37
+ check: (config: Config, targetOs: string) => string | null;
38
+ /** Repairs the identity in place. null where no correct value is determined. */
39
+ repair: ((config: Config, targetOs: string) => void) | null;
40
+ /**
41
+ * Keys the repair only adjusts to stay consistent with what it repairs. A
42
+ * caller who set any of them keeps all of them as they were, the repair
43
+ * itself still runs, and they never block it.
44
+ */
45
+ adjusts?: readonly string[];
46
+ }
47
+ /**
48
+ * Whether this renderer string is one the OS can report. Used both to check
49
+ * a finished identity and to filter the WebGL pool before sampling.
50
+ */
51
+ export declare function gpuFitsOs(rendererString: string | null | undefined, targetOs: string): boolean;
52
+ /**
53
+ * The hardwareConcurrency values an Intel Mac with this GPU reports, or null
54
+ * when the renderer is not an Intel Mac's (none, or Apple Silicon).
55
+ */
56
+ export declare function intelMacCores(rendererString: unknown): ReadonlySet<number> | null;
57
+ /**
58
+ * Whether a machine with this GPU has these cores and this screen. Only Intel
59
+ * Macs are modelled; serves the WebGL draw and the finished-identity check.
60
+ */
61
+ export declare function gpuFitsMachine(rendererString: string | null | undefined, targetOs: string, cores?: unknown, width?: unknown, height?: unknown): boolean;
62
+ /** Python's round(): half to even, so both launchers draw the same geometry. */
63
+ export declare function roundHalfEven(v: number): number;
64
+ /**
65
+ * A devicePixelRatio no display mode of the OS offers: a browser zoom folded
66
+ * into the ratio, which scaled every CSS size with it.
67
+ */
68
+ export declare function isZoomedRatio(dpr: unknown, targetOs: string): boolean;
69
+ /**
70
+ * Move the ratio to the nearest display mode, rescaling the CSS geometry so
71
+ * the screen stays the display behind it.
72
+ */
73
+ export declare function repairDevicePixelRatio(config: Config, targetOs: string, target?: number): void;
74
+ export declare const CPU_ARCHES: readonly ["x86", "arm"];
75
+ export type CpuArch = (typeof CPU_ARCHES)[number];
76
+ export declare const CPU_MANUFACTURERS: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>>;
77
+ export declare const CPU_VENDORS: readonly ["intel", "amd"];
78
+ export type CpuVendor = (typeof CPU_VENDORS)[number];
79
+ /** The cpuManufacturers key for a launcher OS name (win, mac, lin, ...). */
80
+ export declare function cpuOs(targetOs: string): "windows" | "mac" | "linux";
81
+ export declare function cpuManufacturers(targetOs: string, arch: unknown): readonly string[];
82
+ /**
83
+ * Check a caller's `cpu` option and fill in what it implies, as
84
+ * coherence.resolve_cpu does. Throws ValueError for anything no real machine
85
+ * running `targetOs` is: an unknown key, architecture or manufacturer, or a
86
+ * pair such as an AMD Mac or an Apple x86 CPU. A manufacturer alone implies
87
+ * its architecture.
88
+ */
89
+ export declare function resolveCpu(cpu: unknown, targetOs: string): Record<string, string>;
90
+ /**
91
+ * The CPU architecture this GPU implies and the manufacturers it allows, as
92
+ * coherence.gpu_cpu. [null, []] when the GPU leaves both open. An empty list
93
+ * with an architecture means any maker of that architecture on `targetOs`.
94
+ */
95
+ export declare function gpuCpu(gpuRenderer: unknown, targetOs: string): [CpuArch | null, readonly string[]];
96
+ /** Whether a machine with this GPU can have this CPU. */
97
+ export declare function gpuFitsCpu(gpuRenderer: unknown, targetOs: string, arch: unknown, maker: unknown): boolean;
98
+ /** The x86 CPU vendor this GPU implies, or null when it leaves it open. */
99
+ export declare function gpuCpuVendor(gpuRenderer: unknown, targetOs: string): CpuVendor | null;
100
+ /** The x86 CPU vendor this navigator.hardwareConcurrency implies, or null. */
101
+ export declare function coresCpuVendor(cores: unknown): CpuVendor | null;
102
+ /**
103
+ * The [arch, manufacturer] the identity's GPU or, failing that, its core
104
+ * count implies.
105
+ */
106
+ export declare function hardwareCpu(config: Config, targetOs: string): [CpuArch | null, string | null];
107
+ /** The x86 CPU vendor the identity's GPU or, failing that, its core count implies. */
108
+ export declare function hardwareCpuVendor(config: Config, targetOs: string): CpuVendor | null;
109
+ /** Why the claimed CPU cannot sit in this machine, or null. */
110
+ export declare function cpuConflict(config: Config, targetOs: string): string | null;
111
+ export declare const RULES: readonly Rule[];
112
+ /** Whether the screen is one no desktop reports (portrait, or tiny). */
113
+ export declare function screenIsImplausible(config: Config): boolean;
114
+ /**
115
+ * Turn a portrait screen landscape, keeping the panel's own dimensions. Run
116
+ * before the window clamps, which then bound the window to the new screen.
117
+ */
118
+ export declare function repairScreenOrientation(config: Config): boolean;
119
+ /**
120
+ * Discard values a source supplied that this identity cannot keep (a preset's
121
+ * GPU pair its OS, or its final core count and screen, rule out), so the
122
+ * normal WebGL sampling draws a coherent one instead. Run after the core count
123
+ * and the screen are final. Only values another pool can replace are dropped.
124
+ * A GPU the caller passed (a key in `keep`) is never dropped: it is reported,
125
+ * with the keys it kept, instead.
126
+ */
127
+ export declare function dropIncoherentSourceValues(config: Config, targetOs: string, keep?: ReadonlySet<string>): Violation[];
128
+ /** Every invariant this identity breaks. Empty means coherent. */
129
+ export declare function validate(config: Config, targetOs: string): Violation[];
130
+ /**
131
+ * Repair what is determined, and report what is left. A rule with no repair
132
+ * cannot be corrected without inventing a machine, so it is returned for the
133
+ * caller to decide about.
134
+ *
135
+ * `keep` names the keys the caller set. A repair that would change one of
136
+ * them is not made: the caller's value stands, and the violation comes back
137
+ * with those keys in `kept` so the launcher can warn about it (#956). A repair
138
+ * that only touches other keys still runs.
139
+ */
140
+ export declare function apply(config: Config, targetOs: string, keep?: ReadonlySet<string>): Violation[];
141
+ export {};