camoucore 0.2.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.
- package/LICENSE +4 -3
- package/dist/camoufox/__main__.d.ts +10 -0
- package/dist/camoufox/__main__.js +1175 -0
- package/dist/camoufox/__version__.d.ts +31 -0
- package/dist/camoufox/__version__.js +32 -0
- package/dist/camoufox/_humanize_playwright.d.ts +54 -0
- package/dist/camoufox/_humanize_playwright.js +429 -0
- package/dist/camoufox/addons.d.ts +21 -0
- package/dist/camoufox/addons.js +56 -0
- package/dist/camoufox/async_api.d.ts +9 -0
- package/dist/camoufox/async_api.js +9 -0
- package/dist/camoufox/browser-pin.d.ts +46 -0
- package/dist/camoufox/browser-pin.js +96 -0
- package/dist/camoufox/cli.d.ts +7 -0
- package/dist/camoufox/cli.js +20 -0
- package/dist/camoufox/coherence.d.ts +141 -0
- package/dist/camoufox/coherence.js +708 -0
- package/dist/camoufox/data-files/audio-output-latency.json +15 -0
- package/dist/camoufox/data-files/browser-pin.json +7 -0
- package/dist/camoufox/data-files/display-profiles.json +6 -0
- package/dist/camoufox/data-files/essential-fonts.json +5 -0
- package/dist/camoufox/data-files/fingerprint-presets-v150.json +14544 -0
- package/dist/camoufox/data-files/fingerprint-presets.json +5192 -0
- package/dist/camoufox/data-files/font-bases.json +1888 -0
- package/dist/camoufox/data-files/font-groups.json +716 -0
- package/dist/camoufox/data-files/font-prefs.json +1046 -0
- package/dist/camoufox/data-files/fonts.json +240 -0
- package/dist/camoufox/data-files/fpgen.yml +44 -0
- package/dist/camoufox/data-files/launcher-constants.json +136 -0
- package/dist/camoufox/data-files/media-devices.json +180 -0
- package/dist/camoufox/data-files/repos.yml +40 -0
- package/dist/camoufox/data-files/voice-manifests.json +1864 -0
- package/dist/camoufox/data-files/voice-uris.json +188 -0
- package/dist/camoufox/data-files/warnings.yml +146 -0
- package/dist/camoufox/display_profile.d.ts +21 -0
- package/dist/camoufox/display_profile.js +129 -0
- package/dist/camoufox/driver_defaults.d.ts +27 -0
- package/dist/camoufox/driver_defaults.js +119 -0
- package/dist/camoufox/exceptions.d.ts +68 -0
- package/dist/camoufox/exceptions.js +122 -0
- package/dist/camoufox/fingerprints.d.ts +434 -0
- package/dist/camoufox/fingerprints.js +1936 -0
- package/dist/camoufox/gpudisplay.d.ts +158 -0
- package/dist/camoufox/gpudisplay.js +695 -0
- package/dist/camoufox/host_rendering.d.ts +38 -0
- package/dist/camoufox/host_rendering.js +180 -0
- package/dist/camoufox/humanize.d.ts +89 -0
- package/dist/camoufox/humanize.js +143 -0
- package/dist/camoufox/index.d.ts +21 -0
- package/dist/camoufox/index.js +21 -0
- package/dist/camoufox/ip.d.ts +45 -0
- package/dist/camoufox/ip.js +114 -0
- package/dist/camoufox/multiversion.d.ts +131 -0
- package/dist/camoufox/multiversion.js +490 -0
- package/dist/camoufox/node-floor.d.ts +5 -0
- package/dist/camoufox/node-floor.js +17 -0
- package/dist/camoufox/paths.d.ts +45 -0
- package/dist/camoufox/paths.js +62 -0
- package/dist/camoufox/pkgman.d.ts +361 -0
- package/dist/camoufox/pkgman.js +1066 -0
- package/dist/camoufox/product.d.ts +8 -0
- package/dist/camoufox/product.js +8 -0
- package/dist/camoufox/pycompat.d.ts +97 -0
- package/dist/camoufox/pycompat.js +458 -0
- package/dist/camoufox/server.d.ts +36 -0
- package/dist/camoufox/server.js +82 -0
- package/dist/camoufox/sync_api.d.ts +77 -0
- package/dist/camoufox/sync_api.js +207 -0
- package/dist/camoufox/utils.d.ts +638 -0
- package/dist/camoufox/utils.js +2507 -0
- package/dist/camoufox/warnings.d.ts +16 -0
- package/dist/camoufox/warnings.js +65 -0
- package/dist/camoufox/webgl.d.ts +52 -0
- package/dist/camoufox/webgl.js +264 -0
- package/dist/camouwolf/__main__.d.ts +10 -0
- package/dist/camouwolf/__main__.js +1180 -0
- package/dist/camouwolf/__version__.d.ts +31 -0
- package/dist/camouwolf/__version__.js +32 -0
- package/dist/camouwolf/_humanize_playwright.d.ts +53 -0
- package/dist/camouwolf/_humanize_playwright.js +427 -0
- package/dist/camouwolf/addons.d.ts +42 -0
- package/dist/camouwolf/addons.js +113 -0
- package/dist/camouwolf/async_api.d.ts +9 -0
- package/dist/camouwolf/async_api.js +9 -0
- package/dist/camouwolf/browser-pin.d.ts +46 -0
- package/dist/camouwolf/browser-pin.js +96 -0
- package/dist/camouwolf/cli.d.ts +7 -0
- package/dist/camouwolf/cli.js +20 -0
- package/dist/camouwolf/clienthints.d.ts +61 -0
- package/dist/camouwolf/clienthints.js +176 -0
- package/dist/camouwolf/coherence.d.ts +152 -0
- package/dist/camouwolf/coherence.js +554 -0
- package/dist/camouwolf/data-files/browser-pin.json +7 -0
- package/dist/camouwolf/data-files/camouwolf.defaults.json +118 -0
- package/dist/camouwolf/data-files/data/bundle-fonts.json +1983 -0
- package/dist/camouwolf/data-files/data/chrome-languages.json +517 -0
- package/dist/camouwolf/data-files/data/properties.json +321 -0
- package/dist/camouwolf/data-files/data/system-colors.json +35 -0
- package/dist/camouwolf/data-files/data/ubo.json +6 -0
- package/dist/camouwolf/data-files/fpgen.yml +41 -0
- package/dist/camouwolf/data-files/launcher-constants.json +26 -0
- package/dist/camouwolf/data-files/repos.yml +23 -0
- package/dist/camouwolf/data-files/warnings.yml +96 -0
- package/dist/camouwolf/driver_defaults.d.ts +25 -0
- package/dist/camouwolf/driver_defaults.js +114 -0
- package/dist/camouwolf/exceptions.d.ts +95 -0
- package/dist/camouwolf/exceptions.js +150 -0
- package/dist/camouwolf/fingerprints.d.ts +227 -0
- package/dist/camouwolf/fingerprints.js +753 -0
- package/dist/camouwolf/gpudisplay.d.ts +171 -0
- package/dist/camouwolf/gpudisplay.js +711 -0
- package/dist/camouwolf/host_rendering.d.ts +18 -0
- package/dist/camouwolf/host_rendering.js +114 -0
- package/dist/camouwolf/humanize.d.ts +84 -0
- package/dist/camouwolf/humanize.js +128 -0
- package/dist/camouwolf/index.d.ts +22 -0
- package/dist/camouwolf/index.js +21 -0
- package/dist/camouwolf/multiversion.d.ts +131 -0
- package/dist/camouwolf/multiversion.js +491 -0
- package/dist/camouwolf/node-floor.d.ts +5 -0
- package/dist/camouwolf/node-floor.js +17 -0
- package/dist/camouwolf/paths.d.ts +34 -0
- package/dist/camouwolf/paths.js +58 -0
- package/dist/camouwolf/pkgman.d.ts +331 -0
- package/dist/camouwolf/pkgman.js +972 -0
- package/dist/camouwolf/product.d.ts +3 -0
- package/dist/camouwolf/product.js +3 -0
- package/dist/camouwolf/pycompat.d.ts +92 -0
- package/dist/camouwolf/pycompat.js +461 -0
- package/dist/camouwolf/server.d.ts +36 -0
- package/dist/camouwolf/server.js +81 -0
- package/dist/camouwolf/switches.d.ts +77 -0
- package/dist/camouwolf/switches.js +222 -0
- package/dist/camouwolf/sync_api.d.ts +84 -0
- package/dist/camouwolf/sync_api.js +173 -0
- package/dist/camouwolf/utils.d.ts +644 -0
- package/dist/camouwolf/utils.js +2057 -0
- package/dist/camouwolf/warnings.d.ts +14 -0
- package/dist/camouwolf/warnings.js +59 -0
- package/dist/camouwolf/webgl.d.ts +41 -0
- package/dist/camouwolf/webgl.js +198 -0
- package/dist/data-files/antibot-rules.json +146 -0
- package/dist/data.d.ts +1 -1
- package/dist/data.js +4 -3
- package/dist/download.js +1 -1
- package/dist/exceptions.d.ts +1 -1
- package/dist/exceptions.js +1 -1
- package/dist/geolocation.js +1 -1
- package/dist/host.d.ts +2 -0
- package/dist/host.js +17 -1
- package/dist/ip.js +1 -1
- package/dist/locales.js +1 -1
- package/dist/mcp/cli.d.ts +15 -0
- package/dist/mcp/cli.js +108 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/index.js +8 -0
- package/dist/mcp/main.d.ts +2 -0
- package/dist/mcp/main.js +8 -0
- package/dist/mcp/secrets.d.ts +50 -0
- package/dist/mcp/secrets.js +193 -0
- package/dist/mcp/server.d.ts +48 -0
- package/dist/mcp/server.js +653 -0
- package/dist/mcp/tree.d.ts +10 -0
- package/dist/mcp/tree.js +36 -0
- package/dist/passthrough.d.ts +16 -0
- package/dist/passthrough.js +50 -0
- package/dist/product.js +1 -1
- package/dist/settings.d.ts +12 -0
- package/dist/settings.js +95 -0
- package/dist/telemetry.d.ts +127 -0
- package/dist/telemetry.js +426 -0
- package/dist/virtdisplay.d.ts +1 -1
- package/dist/virtdisplay.js +1 -1
- package/dist/warnings.js +1 -1
- package/package.json +57 -13
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { LeakWarning, type RecordedWarning, recordWarnings, warn, } from "../warnings.js";
|
|
2
|
+
/** warnings.yml, loaded once. */
|
|
3
|
+
export declare function loadWarnings(): Record<string, string>;
|
|
4
|
+
/**
|
|
5
|
+
* Emitted when part of an identity could not be drawn and a substitute was used.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FallbackWarning extends Error {
|
|
8
|
+
constructor(message: string);
|
|
9
|
+
/**
|
|
10
|
+
* Warns that `what` failed with `error` and the identity uses `instead`,
|
|
11
|
+
* with a block of versions and the error for the user to paste into an issue.
|
|
12
|
+
*/
|
|
13
|
+
static warn(what: string, instead: string, error: unknown, identity?: string | null): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Camouwolf's warning messages (warnings.yml) and FallbackWarning.
|
|
3
|
+
*
|
|
4
|
+
* The channel itself (warn, recordWarnings, LeakWarning) is camoucore's, so
|
|
5
|
+
* one recorder catches what the core and this launcher emit.
|
|
6
|
+
*/
|
|
7
|
+
import * as os from "node:os";
|
|
8
|
+
import { warn } from "../warnings.js";
|
|
9
|
+
import { LIBRARY_VERSION } from "./__version__.js";
|
|
10
|
+
import { CamouwolfNotInstalled } from "./exceptions.js";
|
|
11
|
+
import { loadDataFile } from "./paths.js";
|
|
12
|
+
import { installedVerStr } from "./pkgman.js";
|
|
13
|
+
export { LeakWarning, recordWarnings, warn, } from "../warnings.js";
|
|
14
|
+
let warningsData;
|
|
15
|
+
/** warnings.yml, loaded once. */
|
|
16
|
+
export function loadWarnings() {
|
|
17
|
+
warningsData ??= loadDataFile("warnings.yml");
|
|
18
|
+
return warningsData;
|
|
19
|
+
}
|
|
20
|
+
function browserVersion() {
|
|
21
|
+
try {
|
|
22
|
+
return installedVerStr();
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
if (error instanceof CamouwolfNotInstalled)
|
|
26
|
+
return "not installed";
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Emitted when part of an identity could not be drawn and a substitute was used.
|
|
32
|
+
*/
|
|
33
|
+
export class FallbackWarning extends Error {
|
|
34
|
+
constructor(message) {
|
|
35
|
+
super(message);
|
|
36
|
+
this.name = "FallbackWarning";
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Warns that `what` failed with `error` and the identity uses `instead`,
|
|
40
|
+
* with a block of versions and the error for the user to paste into an issue.
|
|
41
|
+
*/
|
|
42
|
+
static warn(what, instead, error, identity) {
|
|
43
|
+
const lines = [
|
|
44
|
+
`camouwolf: ${LIBRARY_VERSION} (npm)`,
|
|
45
|
+
`browser: ${browserVersion()}`,
|
|
46
|
+
`os: ${os.type()}-${os.release()}-${os.arch()}`,
|
|
47
|
+
`node: ${process.versions.node}`,
|
|
48
|
+
`error: ${error instanceof Error ? `${error.name}: ${error.message}` : String(error)}`,
|
|
49
|
+
];
|
|
50
|
+
if (identity)
|
|
51
|
+
lines.push(`identity: ${identity}`);
|
|
52
|
+
const values = {
|
|
53
|
+
what,
|
|
54
|
+
instead,
|
|
55
|
+
report: lines.map((line) => ` ${line}`).join("\n"),
|
|
56
|
+
};
|
|
57
|
+
warn(loadWarnings().fallback.replace(/\{(what|instead|report)\}/g, (_, key) => values[key]), "FallbackWarning");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { PyFloat } from "./pycompat.js";
|
|
2
|
+
export type Scalar = number | PyFloat | bigint;
|
|
3
|
+
/**
|
|
4
|
+
* Whether Chrome on `targetOs` ('win', 'mac', 'lin', or the OS name) can
|
|
5
|
+
* report this renderer.
|
|
6
|
+
*/
|
|
7
|
+
export declare function backendMatchesOs(renderer: string | null | undefined, targetOs: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether an identity may claim fpgen's `gpu` value: a real device, on a
|
|
10
|
+
* backend the OS uses.
|
|
11
|
+
*/
|
|
12
|
+
export declare function usableGpu(gpu: unknown, targetOs?: string | null): boolean;
|
|
13
|
+
/** The device limits one recorded context reports: pname -> value. */
|
|
14
|
+
export declare function webglParameters(context: unknown): Record<string, Scalar | Scalar[]>;
|
|
15
|
+
type PrecisionFormat = {
|
|
16
|
+
rangeMin: number;
|
|
17
|
+
rangeMax: number;
|
|
18
|
+
precision: number;
|
|
19
|
+
};
|
|
20
|
+
/** A recorded getShaderPrecisionFormat table, keyed "<shaderType>,<precisionType>". */
|
|
21
|
+
export declare function shaderPrecisionFormats(context: unknown): Record<string, PrecisionFormat>;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the record's WebGL1 and WebGL2 readouts are both of `renderer`.
|
|
24
|
+
* fpgen occasionally pairs one device's GPU with another's readout, or with
|
|
25
|
+
* none; an identity drawn from such a record has no limits for its renderer.
|
|
26
|
+
*/
|
|
27
|
+
export declare function readoutNames(fingerprint: Record<string, any>, renderer: unknown): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The webGl:* and webGl2:* keys of the record's WebGL1 and WebGL2 contexts,
|
|
30
|
+
* claimed only from a readout of `renderer` (readoutNames).
|
|
31
|
+
*/
|
|
32
|
+
export declare function webglIdentity(fingerprint: Record<string, any>, renderer: unknown): Record<string, unknown>;
|
|
33
|
+
/**
|
|
34
|
+
* Every [vendor, renderer] fpgen has seen Chrome report on this OS, that an
|
|
35
|
+
* identity may claim.
|
|
36
|
+
*
|
|
37
|
+
* A GPU outside this set has no recorded device behind it, so an identity
|
|
38
|
+
* naming it could only borrow another machine's limits, screen and fonts.
|
|
39
|
+
*/
|
|
40
|
+
export declare function chromeGpus(targetOs: string): Array<[string, string]>;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebGL identities, from the Chrome devices fpgen has recorded.
|
|
3
|
+
*
|
|
4
|
+
* Chrome reports its GPU through ANGLE, and the renderer string names the
|
|
5
|
+
* ANGLE backend: Direct3D 11 on Windows, Metal (or OpenGL 4.1 on older Macs)
|
|
6
|
+
* on macOS, desktop OpenGL or Vulkan on Linux. A renderer whose backend the
|
|
7
|
+
* claimed OS never uses is a contradiction a page reads in one call, so every
|
|
8
|
+
* identity's renderer is checked against its OS (backendMatchesOs).
|
|
9
|
+
*
|
|
10
|
+
* A device's WebGL identity is more than its renderer string: the limits, the
|
|
11
|
+
* shader precision table and the extension lists are the backend's signature
|
|
12
|
+
* (Direct3D 11 reports ALIASED_LINE_WIDTH_RANGE [1, 1] and MAX_VIEWPORT_DIMS
|
|
13
|
+
* [32767, 32767] whatever the card), so they are claimed from the same record
|
|
14
|
+
* (webglIdentity). The browser answers them before its own lookup
|
|
15
|
+
* (browser/patches/0007-webgl-spoofing.patch); an extension it lacks cannot be
|
|
16
|
+
* added, only one the claimed device lacks hidden.
|
|
17
|
+
*
|
|
18
|
+
* TypeScript twin of python/camoucore/src/camoucore/camouwolf/webgl.py.
|
|
19
|
+
*/
|
|
20
|
+
import { trace } from "fpgen-js";
|
|
21
|
+
import { FPGEN_OS, isSoftwareRenderer, OS_KEYS } from "./fingerprints.js";
|
|
22
|
+
import { isPlainObject, KeyError, PyFloat, pyStrRepr } from "./pycompat.js";
|
|
23
|
+
/** The ANGLE backends Chrome uses on each OS, as they appear in the renderer. */
|
|
24
|
+
const BACKENDS = {
|
|
25
|
+
win: /Direct3D11|D3D11/i,
|
|
26
|
+
mac: /Metal|OpenGL 4\.1/i,
|
|
27
|
+
lin: /OpenGL|Mesa|Vulkan/i,
|
|
28
|
+
};
|
|
29
|
+
function osKey(targetOs) {
|
|
30
|
+
const lowered = targetOs.toLowerCase();
|
|
31
|
+
return Object.hasOwn(OS_KEYS, lowered) ? OS_KEYS[lowered] : lowered;
|
|
32
|
+
}
|
|
33
|
+
function backend(targetOs) {
|
|
34
|
+
const key = osKey(targetOs);
|
|
35
|
+
if (!Object.hasOwn(BACKENDS, key))
|
|
36
|
+
throw new KeyError(pyStrRepr(key));
|
|
37
|
+
return BACKENDS[key];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Whether Chrome on `targetOs` ('win', 'mac', 'lin', or the OS name) can
|
|
41
|
+
* report this renderer.
|
|
42
|
+
*/
|
|
43
|
+
export function backendMatchesOs(renderer, targetOs) {
|
|
44
|
+
if (!renderer)
|
|
45
|
+
return true;
|
|
46
|
+
return backend(targetOs).test(renderer);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Whether an identity may claim fpgen's `gpu` value: a real device, on a
|
|
50
|
+
* backend the OS uses.
|
|
51
|
+
*/
|
|
52
|
+
export function usableGpu(gpu, targetOs) {
|
|
53
|
+
if (!isPlainObject(gpu) || !gpu.renderer || !gpu.vendor)
|
|
54
|
+
return false;
|
|
55
|
+
if (isSoftwareRenderer(gpu.renderer))
|
|
56
|
+
return false;
|
|
57
|
+
return (targetOs === null ||
|
|
58
|
+
targetOs === undefined ||
|
|
59
|
+
backendMatchesOs(gpu.renderer, targetOs));
|
|
60
|
+
}
|
|
61
|
+
// The GL spec's implementation-dependent values: fixed per device, never state
|
|
62
|
+
// a page sets. Extension limits are left out, because the browser answers a
|
|
63
|
+
// configured pname whether or not its extension is enabled.
|
|
64
|
+
const LIMIT_PREFIXES = ["MAX_", "MIN_", "ALIASED_"];
|
|
65
|
+
const LIMITS = new Set(["SUBPIXEL_BITS", "UNIFORM_BUFFER_OFFSET_ALIGNMENT"]);
|
|
66
|
+
const EXTENSION_SUFFIXES = ["_EXT", "_WEBGL", "_OES"];
|
|
67
|
+
function isNumber(value) {
|
|
68
|
+
return (typeof value === "number" ||
|
|
69
|
+
typeof value === "bigint" ||
|
|
70
|
+
value instanceof PyFloat);
|
|
71
|
+
}
|
|
72
|
+
/** The value of one recorded parameter if it is a device limit, or null. */
|
|
73
|
+
function limit(entry) {
|
|
74
|
+
if (!isPlainObject(entry))
|
|
75
|
+
return null;
|
|
76
|
+
const name = entry.name ?? "";
|
|
77
|
+
if (typeof name !== "string" ||
|
|
78
|
+
EXTENSION_SUFFIXES.some((suffix) => name.endsWith(suffix)) ||
|
|
79
|
+
!(LIMIT_PREFIXES.some((prefix) => name.startsWith(prefix)) ||
|
|
80
|
+
LIMITS.has(name))) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const value = entry.value;
|
|
84
|
+
if (entry.type === "Number" && isNumber(value)) {
|
|
85
|
+
// fpgen-js parses an integer beyond 2**53 (MAX_SERVER_WAIT_TIMEOUT) into
|
|
86
|
+
// a double; Python's fpgen keeps the recorded digits as an int.
|
|
87
|
+
return typeof value === "number" &&
|
|
88
|
+
Number.isInteger(value) &&
|
|
89
|
+
!Number.isSafeInteger(value)
|
|
90
|
+
? BigInt(String(value))
|
|
91
|
+
: value;
|
|
92
|
+
}
|
|
93
|
+
if ((entry.type === "Float32Array" || entry.type === "Int32Array") &&
|
|
94
|
+
Array.isArray(value) &&
|
|
95
|
+
value.length >= 2 &&
|
|
96
|
+
value.length <= 4 &&
|
|
97
|
+
value.every(isNumber)) {
|
|
98
|
+
return [...value];
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
/** The device limits one recorded context reports: pname -> value. */
|
|
103
|
+
export function webglParameters(context) {
|
|
104
|
+
const params = isPlainObject(context) ? context.params : null;
|
|
105
|
+
if (!isPlainObject(params))
|
|
106
|
+
return {};
|
|
107
|
+
const result = {};
|
|
108
|
+
for (const [pname, entry] of Object.entries(params)) {
|
|
109
|
+
const value = limit(entry);
|
|
110
|
+
if (value !== null && /^\d+$/.test(pname))
|
|
111
|
+
result[pname] = value;
|
|
112
|
+
}
|
|
113
|
+
return result;
|
|
114
|
+
}
|
|
115
|
+
/** A recorded getShaderPrecisionFormat table, keyed "<shaderType>,<precisionType>". */
|
|
116
|
+
export function shaderPrecisionFormats(context) {
|
|
117
|
+
const formats = isPlainObject(context)
|
|
118
|
+
? context.shaderPrecisionFormats
|
|
119
|
+
: null;
|
|
120
|
+
const table = {};
|
|
121
|
+
for (const item of Array.isArray(formats) ? formats : []) {
|
|
122
|
+
const spf = isPlainObject(item) ? item.shaderPrecisionFormat : null;
|
|
123
|
+
if (isPlainObject(spf) &&
|
|
124
|
+
["rangeMin", "rangeMax", "precision"].every((k) => Number.isInteger(spf[k]))) {
|
|
125
|
+
table[`${item.shaderType},${item.precisionType}`] = {
|
|
126
|
+
rangeMin: spf.rangeMin,
|
|
127
|
+
rangeMax: spf.rangeMax,
|
|
128
|
+
precision: spf.precision,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return table;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Whether the record's WebGL1 and WebGL2 readouts are both of `renderer`.
|
|
136
|
+
* fpgen occasionally pairs one device's GPU with another's readout, or with
|
|
137
|
+
* none; an identity drawn from such a record has no limits for its renderer.
|
|
138
|
+
*/
|
|
139
|
+
export function readoutNames(fingerprint, renderer) {
|
|
140
|
+
return (Boolean(renderer) &&
|
|
141
|
+
[fingerprint.webgl, fingerprint.webgl2].every((r) => isPlainObject(r) && r.renderer === renderer));
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* The webGl:* and webGl2:* keys of the record's WebGL1 and WebGL2 contexts,
|
|
145
|
+
* claimed only from a readout of `renderer` (readoutNames).
|
|
146
|
+
*/
|
|
147
|
+
export function webglIdentity(fingerprint, renderer) {
|
|
148
|
+
if (!readoutNames(fingerprint, renderer))
|
|
149
|
+
return {};
|
|
150
|
+
const { webgl, webgl2 } = fingerprint;
|
|
151
|
+
const claimed = {
|
|
152
|
+
"webGl:parameters": webglParameters(webgl),
|
|
153
|
+
"webGl2:parameters": webglParameters(webgl2),
|
|
154
|
+
"webGl:shaderPrecisionFormats": shaderPrecisionFormats(webgl),
|
|
155
|
+
"webGl2:shaderPrecisionFormats": shaderPrecisionFormats(webgl2),
|
|
156
|
+
"webGl:supportedExtensions": webgl.supportedExtensions,
|
|
157
|
+
"webGl2:supportedExtensions": webgl2.supportedExtensions,
|
|
158
|
+
};
|
|
159
|
+
return Object.fromEntries(Object.entries(claimed).filter(([, value]) => Array.isArray(value)
|
|
160
|
+
? value.length > 0
|
|
161
|
+
: isPlainObject(value) && Object.keys(value).length > 0));
|
|
162
|
+
}
|
|
163
|
+
const traceCache = new Map();
|
|
164
|
+
function traceGpus(targetOs) {
|
|
165
|
+
let results = traceCache.get(targetOs);
|
|
166
|
+
if (!results) {
|
|
167
|
+
if (!Object.hasOwn(FPGEN_OS, targetOs))
|
|
168
|
+
throw new KeyError(pyStrRepr(targetOs));
|
|
169
|
+
results = trace("gpu", {
|
|
170
|
+
browser: "Chrome",
|
|
171
|
+
os: FPGEN_OS[targetOs],
|
|
172
|
+
});
|
|
173
|
+
traceCache.set(targetOs, results);
|
|
174
|
+
}
|
|
175
|
+
return results;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Every [vendor, renderer] fpgen has seen Chrome report on this OS, that an
|
|
179
|
+
* identity may claim.
|
|
180
|
+
*
|
|
181
|
+
* A GPU outside this set has no recorded device behind it, so an identity
|
|
182
|
+
* naming it could only borrow another machine's limits, screen and fonts.
|
|
183
|
+
*/
|
|
184
|
+
export function chromeGpus(targetOs) {
|
|
185
|
+
const key = osKey(targetOs);
|
|
186
|
+
const seen = new Set();
|
|
187
|
+
const pairs = [];
|
|
188
|
+
for (const result of traceGpus(key)) {
|
|
189
|
+
if (!usableGpu(result.value, key))
|
|
190
|
+
continue;
|
|
191
|
+
const id = JSON.stringify([result.value.vendor, result.value.renderer]);
|
|
192
|
+
if (seen.has(id))
|
|
193
|
+
continue;
|
|
194
|
+
seen.add(id);
|
|
195
|
+
pairs.push([result.value.vendor, result.value.renderer]);
|
|
196
|
+
}
|
|
197
|
+
return pairs;
|
|
198
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_about": [
|
|
3
|
+
"How proxy telemetry recognises an anti-bot provider's answer, read by camoucore/telemetry.py and telemetry.ts.",
|
|
4
|
+
"A rule looks only at a response from the provider itself: one of its endpoints (url), or a response carrying the provider's own edge header (edge).",
|
|
5
|
+
"Every condition in a rule must hold; a provider's first matching rule decides. url is a regex searched in host + path (never the query); query tests named query parameters of that provider URL.",
|
|
6
|
+
"status is a list of codes or classes ('4xx'); headers and edge values are case-insensitive regexes; body is a case-insensitive regex, and is read only from provider endpoints and from a provider's error page (status 4xx or 5xx).",
|
|
7
|
+
"verdict: presence (the provider is on the page, no outcome yet), success, challenge, block. transient: a challenge that clears by itself (an interstitial) and counts only if nothing succeeds after it. opens false: the verdict only adds to an encounter something else showed.",
|
|
8
|
+
"unresolved: what an encounter with only presence counts as. 'unknown' for a provider whose verdict the browser never sees."
|
|
9
|
+
],
|
|
10
|
+
"version": 1,
|
|
11
|
+
"providers": {
|
|
12
|
+
"cloudflare": {
|
|
13
|
+
"edge": [{"name": "^cf-ray$"}],
|
|
14
|
+
"unresolved": "success",
|
|
15
|
+
"rules": [
|
|
16
|
+
{"document": true, "edge": true, "headers": {"cf-mitigated": "^challenge$"}, "verdict": "challenge", "transient": true},
|
|
17
|
+
{"document": true, "edge": true, "status": ["4xx"], "body": "error code: 10(06|07|08|20)|sorry, you have been blocked|cf-error-details", "verdict": "block"},
|
|
18
|
+
{"url": "^(?!challenges\\.cloudflare\\.com/)[^/]+/cdn-cgi/challenge-platform/", "verdict": "presence"},
|
|
19
|
+
{"document": true, "edge": true, "status": ["2xx"], "verdict": "success", "opens": false}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"turnstile": {
|
|
23
|
+
"unresolved": "unknown",
|
|
24
|
+
"rules": [
|
|
25
|
+
{"url": "^challenges\\.cloudflare\\.com/turnstile/", "verdict": "presence"}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"datadome": {
|
|
29
|
+
"edge": [{"name": "^x-datadome$"}, {"name": "^x-dd-b$"}],
|
|
30
|
+
"unresolved": "success",
|
|
31
|
+
"rules": [
|
|
32
|
+
{"url": "captcha-delivery\\.com/captcha/", "query": {"t": "^bv$"}, "verdict": "block"},
|
|
33
|
+
{"url": "captcha-delivery\\.com/captcha/", "verdict": "challenge"},
|
|
34
|
+
{"url": "captcha-delivery\\.com/interstitial/", "verdict": "challenge", "transient": true},
|
|
35
|
+
{"url": "^api-js\\.datadome\\.co/js/", "body": "\"status\"\\s*:\\s*200", "verdict": "success"},
|
|
36
|
+
{"url": "^(js|api-js)\\.datadome\\.co/", "verdict": "presence"},
|
|
37
|
+
{"document": true, "edge": true, "status": ["2xx"], "verdict": "success"},
|
|
38
|
+
{"document": true, "edge": true, "verdict": "presence"}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"akamai": {
|
|
42
|
+
"edge": [{"name": "^server$", "value": "^AkamaiGHost$"}, {"name": "^akamai-grn$"}],
|
|
43
|
+
"unresolved": "unknown",
|
|
44
|
+
"rules": [
|
|
45
|
+
{"document": true, "edge": true, "status": ["403"], "body": "access denied[\\s\\S]*reference\\s*#", "verdict": "block"},
|
|
46
|
+
{"url": "/_sec/cp_challenge/", "verdict": "challenge", "transient": true},
|
|
47
|
+
{"edge": true, "method": "POST", "headers": {"set-cookie": "(^|\\n|, ?)_abck=[^;]*~0~"}, "verdict": "success"},
|
|
48
|
+
{"document": true, "edge": true, "headers": {"set-cookie": "(^|\\n|, ?)_abck="}, "verdict": "presence"}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"perimeterx": {
|
|
52
|
+
"unresolved": "unknown",
|
|
53
|
+
"rules": [
|
|
54
|
+
{"url": "^captcha\\.(px-cdn|px-cloud)\\.net/|/captcha/captcha\\.js$", "verdict": "challenge"},
|
|
55
|
+
{"url": "^collector-[a-z0-9]+\\.(px-cloud|perimeterx)\\.net/|/api/v2/collector$", "body": "bake\\|_px3\\|", "verdict": "success"},
|
|
56
|
+
{"url": "(px-cloud|px-cdn|perimeterx)\\.net/|/api/v2/collector$", "verdict": "presence"}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"kasada": {
|
|
60
|
+
"edge": [{"name": "^x-kpsdk-"}],
|
|
61
|
+
"unresolved": "unknown",
|
|
62
|
+
"rules": [
|
|
63
|
+
{"document": true, "edge": true, "status": ["429"], "verdict": "challenge", "transient": true},
|
|
64
|
+
{"url": "/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/tl$", "status": ["2xx"], "verdict": "success"},
|
|
65
|
+
{"url": "/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/tl$", "status": ["4xx"], "verdict": "block"},
|
|
66
|
+
{"document": true, "edge": true, "status": ["4xx"], "verdict": "block"},
|
|
67
|
+
{"url": "/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/(ips\\.js|p\\.js|fp)$", "verdict": "presence"}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"imperva": {
|
|
71
|
+
"edge": [{"name": "^x-iinfo$"}, {"name": "^x-cdn$", "value": "imperva|incapsula"}],
|
|
72
|
+
"unresolved": "success",
|
|
73
|
+
"rules": [
|
|
74
|
+
{"document": true, "edge": true, "status": ["4xx", "5xx"], "body": "incapsula incident id|request unsuccessful", "verdict": "block"},
|
|
75
|
+
{"url": "/_Incapsula_Resource", "verdict": "challenge", "transient": true},
|
|
76
|
+
{"document": true, "edge": true, "status": ["2xx"], "verdict": "success"}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"awswaf": {
|
|
80
|
+
"edge": [{"name": "^x-amzn-waf-action$"}],
|
|
81
|
+
"unresolved": "success",
|
|
82
|
+
"rules": [
|
|
83
|
+
{"edge": true, "headers": {"x-amzn-waf-action": "^captcha$"}, "verdict": "challenge"},
|
|
84
|
+
{"edge": true, "headers": {"x-amzn-waf-action": "^challenge$"}, "verdict": "challenge", "transient": true},
|
|
85
|
+
{"url": "\\.token\\.awswaf\\.com/.*/verify$", "status": ["2xx"], "verdict": "success"},
|
|
86
|
+
{"url": "\\.awswaf\\.com/", "verdict": "presence"}
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"hcaptcha": {
|
|
90
|
+
"unresolved": "unknown",
|
|
91
|
+
"rules": [
|
|
92
|
+
{"url": "^(api|api2|hcaptcha)\\.hcaptcha\\.com/getcaptcha/", "body": "\"generated_pass_UUID\"\\s*:\\s*\"[^\"]", "verdict": "success"},
|
|
93
|
+
{"url": "^(api|api2|hcaptcha)\\.hcaptcha\\.com/getcaptcha/", "body": "\"tasklist\"", "verdict": "challenge"},
|
|
94
|
+
{"url": "^(js|api|api2|hcaptcha|newassets)\\.hcaptcha\\.com/", "verdict": "presence"}
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"recaptcha": {
|
|
98
|
+
"unresolved": "unknown",
|
|
99
|
+
"rules": [
|
|
100
|
+
{"url": "^(www\\.google\\.com|www\\.recaptcha\\.net|recaptcha\\.google\\.com)/recaptcha/(api2|enterprise)/payload$", "verdict": "challenge"},
|
|
101
|
+
{"url": "^(www\\.google\\.com|www\\.recaptcha\\.net|recaptcha\\.google\\.com)/recaptcha/(api2|enterprise)/reload$", "body": "\"nocaptcha\"", "verdict": "success"},
|
|
102
|
+
{"url": "^(www\\.google\\.com|www\\.gstatic\\.com|www\\.recaptcha\\.net|recaptcha\\.google\\.com)/recaptcha/", "verdict": "presence"}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
"arkose": {
|
|
106
|
+
"unresolved": "unknown",
|
|
107
|
+
"rules": [
|
|
108
|
+
{"url": "(arkoselabs|funcaptcha)\\.com/fc/gt2/", "body": "\\|sup=1", "verdict": "success"},
|
|
109
|
+
{"url": "(arkoselabs|funcaptcha)\\.com/fc/gt2/", "body": "\"token\"", "verdict": "challenge"},
|
|
110
|
+
{"url": "(arkoselabs|funcaptcha)\\.com/", "verdict": "presence"}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"queueit": {
|
|
114
|
+
"unresolved": "unknown",
|
|
115
|
+
"rules": [
|
|
116
|
+
{"url": "queue-it\\.net/softblock", "verdict": "challenge"},
|
|
117
|
+
{"document": true, "url": "queue-it\\.net/", "status": ["4xx"], "verdict": "block"},
|
|
118
|
+
{"document": true, "url": "queue-it\\.net/", "status": ["2xx"], "verdict": "success"},
|
|
119
|
+
{"url": "queue-it\\.net/", "verdict": "presence"}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"shape": {
|
|
123
|
+
"unresolved": "unknown",
|
|
124
|
+
"rules": [
|
|
125
|
+
{"request_header_name": "^x-[a-z0-9]{8}-[abcdfz]$", "verdict": "presence"}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
"threatmetrix": {
|
|
129
|
+
"unresolved": "unknown",
|
|
130
|
+
"rules": [
|
|
131
|
+
{"url": "(^|\\.)online-metrix\\.net/|/fp/(tags|check|clear)\\.js$", "verdict": "presence"}
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"botguard": {
|
|
135
|
+
"unresolved": "unknown",
|
|
136
|
+
"rules": [
|
|
137
|
+
{"url": "^www\\.google\\.com/js/bg/", "verdict": "presence"}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"multi_label_suffixes": [
|
|
142
|
+
"co.uk", "org.uk", "ac.uk", "gov.uk", "com.au", "net.au", "org.au", "co.nz", "co.jp", "ne.jp", "or.jp",
|
|
143
|
+
"co.kr", "co.in", "net.in", "com.br", "com.ar", "com.mx", "com.cn", "net.cn", "com.hk", "com.tw", "com.sg",
|
|
144
|
+
"com.tr", "com.ua", "co.za", "co.il", "com.pl", "com.ru", "com.vn", "com.my", "co.id", "com.ph"
|
|
145
|
+
]
|
|
146
|
+
}
|
package/dist/data.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const DATA_FILES: readonly string[];
|
|
2
|
-
/** dist/data-files/ in a built package, else python/src/camoucore/ itself. */
|
|
2
|
+
/** dist/data-files/ in a built package, else python/camoucore/src/camoucore/ itself. */
|
|
3
3
|
export declare const LOCAL_DATA: string;
|
|
4
4
|
/** A data file, parsed as YAML or JSON by its extension. */
|
|
5
5
|
export declare function loadDataFile<T = any>(file: string): T;
|
package/dist/data.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The data files camoucore ships. They live in python/src/camoucore/, the one
|
|
2
|
+
* The data files camoucore ships. They live in python/camoucore/src/camoucore/, the one
|
|
3
3
|
* copy in the repository; `pnpm build` copies them into dist/data-files/.
|
|
4
4
|
*/
|
|
5
5
|
import * as fs from "node:fs";
|
|
6
6
|
import * as path from "node:path";
|
|
7
7
|
import { parse as parseYaml } from "yaml";
|
|
8
8
|
export const DATA_FILES = [
|
|
9
|
+
"antibot-rules.json",
|
|
9
10
|
"fpgen-model.json",
|
|
10
11
|
"geoip.yml",
|
|
11
12
|
"territoryInfo.xml",
|
|
12
13
|
"warnings.yml",
|
|
13
14
|
];
|
|
14
|
-
/** dist/data-files/ in a built package, else python/src/camoucore/ itself. */
|
|
15
|
+
/** dist/data-files/ in a built package, else python/camoucore/src/camoucore/ itself. */
|
|
15
16
|
export const LOCAL_DATA = fs.existsSync(path.join(import.meta.dirname, "data-files"))
|
|
16
17
|
? path.join(import.meta.dirname, "data-files")
|
|
17
|
-
: path.resolve(import.meta.dirname, "..", "..", "python", "src", "camoucore");
|
|
18
|
+
: path.resolve(import.meta.dirname, "..", "..", "..", "python", "camoucore", "src", "camoucore");
|
|
18
19
|
/** A data file, parsed as YAML or JSON by its extension. */
|
|
19
20
|
export function loadDataFile(file) {
|
|
20
21
|
const text = fs.readFileSync(path.join(LOCAL_DATA, file), "utf-8");
|
package/dist/download.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Downloads, checksums and archives, for every launcher's browser and the
|
|
3
3
|
* GeoIP databases.
|
|
4
4
|
*
|
|
5
|
-
* TypeScript twin of python/src/camoucore/download.py.
|
|
5
|
+
* TypeScript twin of python/camoucore/src/camoucore/download.py.
|
|
6
6
|
*/
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { once } from "node:events";
|
package/dist/exceptions.d.ts
CHANGED
package/dist/exceptions.js
CHANGED
package/dist/geolocation.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Helpers to fetch geolocation, timezone, and locale data given an IP.
|
|
3
3
|
*
|
|
4
|
-
* TypeScript twin of python/src/camoucore/geolocation.py. The on-disk layout
|
|
4
|
+
* TypeScript twin of python/camoucore/src/camoucore/geolocation.py. The on-disk layout
|
|
5
5
|
* (geoip/mmdb/<name>-<ipver>.mmdb and geoip/config.yml under the camoucore
|
|
6
6
|
* cache dir) is the Python package's, so both launchers share one database.
|
|
7
7
|
*/
|
package/dist/host.d.ts
CHANGED
|
@@ -7,3 +7,5 @@ export declare const OS_NAME: "mac" | "win" | "lin";
|
|
|
7
7
|
* hosts that set XDG_CACHE_HOME, and on macOS/Windows entirely.
|
|
8
8
|
*/
|
|
9
9
|
export declare function userCacheDir(appName: string): string;
|
|
10
|
+
/** platformdirs' user_config_dir(appName), so both launchers read one defaults file. */
|
|
11
|
+
export declare function userConfigDir(appName: string): string;
|
package/dist/host.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The host this process runs on, in the names release assets use.
|
|
3
3
|
*
|
|
4
|
-
* TypeScript twin of python/src/camoucore/host.py.
|
|
4
|
+
* TypeScript twin of python/camoucore/src/camoucore/host.py.
|
|
5
5
|
*/
|
|
6
6
|
import * as os from "node:os";
|
|
7
7
|
import * as path from "node:path";
|
|
@@ -47,3 +47,19 @@ export function userCacheDir(appName) {
|
|
|
47
47
|
const base = xdg.trim() ? xdg : path.join(os.homedir(), ".cache");
|
|
48
48
|
return path.join(base, appName);
|
|
49
49
|
}
|
|
50
|
+
/** platformdirs' user_config_dir(appName), so both launchers read one defaults file. */
|
|
51
|
+
export function userConfigDir(appName) {
|
|
52
|
+
if (OS_NAME === "win") {
|
|
53
|
+
const localAppData = process.env.LOCALAPPDATA;
|
|
54
|
+
const base = localAppData && path.isAbsolute(localAppData)
|
|
55
|
+
? localAppData
|
|
56
|
+
: path.join(os.homedir(), "AppData", "Local");
|
|
57
|
+
return path.join(base, appName, appName);
|
|
58
|
+
}
|
|
59
|
+
if (OS_NAME === "mac") {
|
|
60
|
+
return path.join(os.homedir(), "Library", "Application Support", appName);
|
|
61
|
+
}
|
|
62
|
+
const xdg = process.env.XDG_CONFIG_HOME ?? "";
|
|
63
|
+
const base = xdg.trim() ? xdg : path.join(os.homedir(), ".config");
|
|
64
|
+
return path.join(base, appName);
|
|
65
|
+
}
|
package/dist/ip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Helpers to find the user's public IP address for geolocation.
|
|
3
3
|
*
|
|
4
|
-
* TypeScript twin of python/src/camoucore/ip.py. Python sends the lookup with
|
|
4
|
+
* TypeScript twin of python/camoucore/src/camoucore/ip.py. Python sends the lookup with
|
|
5
5
|
* `requests`; here it goes through node:https, tunnelled by hand through an
|
|
6
6
|
* HTTP(S) CONNECT or SOCKS5 proxy, so the package needs no HTTP client.
|
|
7
7
|
*/
|
package/dist/locales.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Locale data structures, validation and the statistical locale selector.
|
|
3
3
|
*
|
|
4
|
-
* TypeScript twin of python/src/camoucore/locales.py.
|
|
4
|
+
* TypeScript twin of python/camoucore/src/camoucore/locales.py.
|
|
5
5
|
*/
|
|
6
6
|
import * as fs from "node:fs";
|
|
7
7
|
import * as path from "node:path";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ServeOptions {
|
|
2
|
+
/**
|
|
3
|
+
* The launcher module to drive (a specifier or file URL). Without it the
|
|
4
|
+
* first positional argument names it.
|
|
5
|
+
*/
|
|
6
|
+
launcher?: string;
|
|
7
|
+
/** The command as the user typed it, for the usage line. */
|
|
8
|
+
program?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Serve a launcher's browser over MCP on stdio until the client goes away.
|
|
12
|
+
* Bad arguments print the usage and exit 2. Call it before the launcher is
|
|
13
|
+
* imported anywhere: launchers print as they load, and stdout is the protocol.
|
|
14
|
+
*/
|
|
15
|
+
export declare function serve(argv: string[], options?: ServeOptions): Promise<void>;
|