device-passport 1.0.0 → 1.1.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 (42) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +69 -2
  3. package/dist/adapters/index.cjs +19 -0
  4. package/dist/adapters/index.d.cts +156 -0
  5. package/dist/adapters/index.d.mts +156 -0
  6. package/dist/adapters/index.d.ts +156 -0
  7. package/dist/adapters/index.mjs +3 -0
  8. package/dist/evaluator/index.cjs +702 -0
  9. package/dist/evaluator/index.d.cts +204 -0
  10. package/dist/evaluator/index.d.mts +204 -0
  11. package/dist/evaluator/index.d.ts +204 -0
  12. package/dist/evaluator/index.mjs +680 -0
  13. package/dist/geo/index.cjs +50 -0
  14. package/dist/geo/index.d.cts +209 -0
  15. package/dist/geo/index.d.mts +209 -0
  16. package/dist/geo/index.d.ts +209 -0
  17. package/dist/geo/index.mjs +18 -0
  18. package/dist/index.cjs +113 -3543
  19. package/dist/index.d.cts +45 -903
  20. package/dist/index.d.mts +45 -903
  21. package/dist/index.d.ts +45 -903
  22. package/dist/index.mjs +11 -3438
  23. package/dist/shared/device-passport.BBf9OKap.mjs +1237 -0
  24. package/dist/shared/device-passport.BPd2-w8e.cjs +1265 -0
  25. package/dist/shared/device-passport.CLaBZWUV.cjs +1569 -0
  26. package/dist/shared/device-passport.C_F1vBE8.d.cts +79 -0
  27. package/dist/shared/device-passport.C_F1vBE8.d.mts +79 -0
  28. package/dist/shared/device-passport.C_F1vBE8.d.ts +79 -0
  29. package/dist/shared/device-passport.Cjxlv8xI.cjs +245 -0
  30. package/dist/shared/device-passport.CyQtcZeD.mjs +237 -0
  31. package/dist/shared/device-passport.NHw_f6HT.mjs +1535 -0
  32. package/dist/storage/index.cjs +10 -0
  33. package/dist/storage/index.d.cts +128 -0
  34. package/dist/storage/index.d.mts +128 -0
  35. package/dist/storage/index.d.ts +128 -0
  36. package/dist/storage/index.mjs +3 -0
  37. package/dist/types/index.cjs +2 -0
  38. package/dist/types/index.d.cts +215 -0
  39. package/dist/types/index.d.mts +215 -0
  40. package/dist/types/index.d.ts +215 -0
  41. package/dist/types/index.mjs +1 -0
  42. package/package.json +27 -2
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ const memory = require('../shared/device-passport.Cjxlv8xI.cjs');
4
+ require('node:fs');
5
+ require('node:path');
6
+
7
+
8
+
9
+ exports.JSONFileStorage = memory.JSONFileStorage;
10
+ exports.MemoryStorage = memory.MemoryStorage;
@@ -0,0 +1,128 @@
1
+ /**
2
+ * StorageAdapter interface for DevicePassport persistence.
3
+ * Implementations provide pluggable storage backends (Memory, File, Redis, DB, etc.)
4
+ */
5
+ interface StorageAdapter<T = any> {
6
+ /**
7
+ * Retrieve an item by key.
8
+ * Returns null if key does not exist.
9
+ */
10
+ get(key: string): Promise<T | null>;
11
+ /**
12
+ * Store an item with the given key.
13
+ */
14
+ set(key: string, value: T): Promise<void>;
15
+ /**
16
+ * Check if a key exists in storage.
17
+ */
18
+ has(key: string): Promise<boolean>;
19
+ /**
20
+ * Delete an item by key.
21
+ * Returns true if item existed and was deleted, false otherwise.
22
+ */
23
+ delete(key: string): Promise<boolean>;
24
+ /**
25
+ * Return all keys currently stored.
26
+ */
27
+ keys(): Promise<string[]>;
28
+ /**
29
+ * Clear all items in this storage.
30
+ */
31
+ clear(): Promise<void>;
32
+ }
33
+
34
+ interface MemoryStorageOptions {
35
+ /**
36
+ * Whether to deep-clone stored and retrieved objects to prevent external mutations.
37
+ * Defaults to true.
38
+ */
39
+ clone?: boolean;
40
+ }
41
+ /**
42
+ * In-memory storage adapter.
43
+ * Useful for ephemeral scraping runs, tests, and caching.
44
+ */
45
+ declare class MemoryStorage<T = any> implements StorageAdapter<T> {
46
+ private readonly store;
47
+ private readonly clone;
48
+ constructor(options?: MemoryStorageOptions);
49
+ private deepClone;
50
+ get(key: string): Promise<T | null>;
51
+ getSync(key: string): T | null;
52
+ set(key: string, value: T): Promise<void>;
53
+ setSync(key: string, value: T): void;
54
+ has(key: string): Promise<boolean>;
55
+ hasSync(key: string): boolean;
56
+ delete(key: string): Promise<boolean>;
57
+ deleteSync(key: string): boolean;
58
+ keys(): Promise<string[]>;
59
+ keysSync(): string[];
60
+ clear(): Promise<void>;
61
+ clearSync(): void;
62
+ get size(): number;
63
+ }
64
+
65
+ interface JSONFileStorageOptions {
66
+ /**
67
+ * Path to the JSON file on disk.
68
+ */
69
+ filePath: string;
70
+ /**
71
+ * Format JSON with indentation for readability.
72
+ * Defaults to true.
73
+ */
74
+ pretty?: boolean;
75
+ /**
76
+ * Auto-save to disk immediately when values change.
77
+ * Defaults to true.
78
+ */
79
+ autoSave?: boolean;
80
+ }
81
+ /**
82
+ * File-backed JSON storage adapter.
83
+ * Uses atomic writes via temp-file + renameSync to ensure zero corruption
84
+ * even if the process is killed mid-write. Automatically creates directories.
85
+ */
86
+ declare class JSONFileStorage<T = any> implements StorageAdapter<T> {
87
+ readonly filePath: string;
88
+ private readonly pretty;
89
+ private readonly autoSave;
90
+ private readonly cache;
91
+ private isLoaded;
92
+ private writeQueue;
93
+ constructor(filePathOrOptions: string | JSONFileStorageOptions);
94
+ /**
95
+ * Ensure data is loaded from disk into the in-memory cache.
96
+ */
97
+ private ensureLoaded;
98
+ /**
99
+ * Atomic flush to disk. Writes to a unique temp file in the same directory,
100
+ * then atomically renames it to target file.
101
+ */
102
+ private flushAtomic;
103
+ /**
104
+ * Queue a disk write to prevent race conditions during rapid concurrent mutations.
105
+ */
106
+ private queueSave;
107
+ get(key: string): Promise<T | null>;
108
+ getSync(key: string): T | null;
109
+ set(key: string, value: T): Promise<void>;
110
+ setSync(key: string, value: T): void;
111
+ has(key: string): Promise<boolean>;
112
+ hasSync(key: string): boolean;
113
+ delete(key: string): Promise<boolean>;
114
+ deleteSync(key: string): boolean;
115
+ keys(): Promise<string[]>;
116
+ keysSync(): string[];
117
+ clear(): Promise<void>;
118
+ clearSync(): void;
119
+ /**
120
+ * Explicitly force a flush to disk (useful if autoSave is set to false).
121
+ */
122
+ flush(): Promise<void>;
123
+ flushSync(): void;
124
+ get size(): number;
125
+ }
126
+
127
+ export { JSONFileStorage, MemoryStorage };
128
+ export type { JSONFileStorageOptions, MemoryStorageOptions, StorageAdapter };
@@ -0,0 +1,128 @@
1
+ /**
2
+ * StorageAdapter interface for DevicePassport persistence.
3
+ * Implementations provide pluggable storage backends (Memory, File, Redis, DB, etc.)
4
+ */
5
+ interface StorageAdapter<T = any> {
6
+ /**
7
+ * Retrieve an item by key.
8
+ * Returns null if key does not exist.
9
+ */
10
+ get(key: string): Promise<T | null>;
11
+ /**
12
+ * Store an item with the given key.
13
+ */
14
+ set(key: string, value: T): Promise<void>;
15
+ /**
16
+ * Check if a key exists in storage.
17
+ */
18
+ has(key: string): Promise<boolean>;
19
+ /**
20
+ * Delete an item by key.
21
+ * Returns true if item existed and was deleted, false otherwise.
22
+ */
23
+ delete(key: string): Promise<boolean>;
24
+ /**
25
+ * Return all keys currently stored.
26
+ */
27
+ keys(): Promise<string[]>;
28
+ /**
29
+ * Clear all items in this storage.
30
+ */
31
+ clear(): Promise<void>;
32
+ }
33
+
34
+ interface MemoryStorageOptions {
35
+ /**
36
+ * Whether to deep-clone stored and retrieved objects to prevent external mutations.
37
+ * Defaults to true.
38
+ */
39
+ clone?: boolean;
40
+ }
41
+ /**
42
+ * In-memory storage adapter.
43
+ * Useful for ephemeral scraping runs, tests, and caching.
44
+ */
45
+ declare class MemoryStorage<T = any> implements StorageAdapter<T> {
46
+ private readonly store;
47
+ private readonly clone;
48
+ constructor(options?: MemoryStorageOptions);
49
+ private deepClone;
50
+ get(key: string): Promise<T | null>;
51
+ getSync(key: string): T | null;
52
+ set(key: string, value: T): Promise<void>;
53
+ setSync(key: string, value: T): void;
54
+ has(key: string): Promise<boolean>;
55
+ hasSync(key: string): boolean;
56
+ delete(key: string): Promise<boolean>;
57
+ deleteSync(key: string): boolean;
58
+ keys(): Promise<string[]>;
59
+ keysSync(): string[];
60
+ clear(): Promise<void>;
61
+ clearSync(): void;
62
+ get size(): number;
63
+ }
64
+
65
+ interface JSONFileStorageOptions {
66
+ /**
67
+ * Path to the JSON file on disk.
68
+ */
69
+ filePath: string;
70
+ /**
71
+ * Format JSON with indentation for readability.
72
+ * Defaults to true.
73
+ */
74
+ pretty?: boolean;
75
+ /**
76
+ * Auto-save to disk immediately when values change.
77
+ * Defaults to true.
78
+ */
79
+ autoSave?: boolean;
80
+ }
81
+ /**
82
+ * File-backed JSON storage adapter.
83
+ * Uses atomic writes via temp-file + renameSync to ensure zero corruption
84
+ * even if the process is killed mid-write. Automatically creates directories.
85
+ */
86
+ declare class JSONFileStorage<T = any> implements StorageAdapter<T> {
87
+ readonly filePath: string;
88
+ private readonly pretty;
89
+ private readonly autoSave;
90
+ private readonly cache;
91
+ private isLoaded;
92
+ private writeQueue;
93
+ constructor(filePathOrOptions: string | JSONFileStorageOptions);
94
+ /**
95
+ * Ensure data is loaded from disk into the in-memory cache.
96
+ */
97
+ private ensureLoaded;
98
+ /**
99
+ * Atomic flush to disk. Writes to a unique temp file in the same directory,
100
+ * then atomically renames it to target file.
101
+ */
102
+ private flushAtomic;
103
+ /**
104
+ * Queue a disk write to prevent race conditions during rapid concurrent mutations.
105
+ */
106
+ private queueSave;
107
+ get(key: string): Promise<T | null>;
108
+ getSync(key: string): T | null;
109
+ set(key: string, value: T): Promise<void>;
110
+ setSync(key: string, value: T): void;
111
+ has(key: string): Promise<boolean>;
112
+ hasSync(key: string): boolean;
113
+ delete(key: string): Promise<boolean>;
114
+ deleteSync(key: string): boolean;
115
+ keys(): Promise<string[]>;
116
+ keysSync(): string[];
117
+ clear(): Promise<void>;
118
+ clearSync(): void;
119
+ /**
120
+ * Explicitly force a flush to disk (useful if autoSave is set to false).
121
+ */
122
+ flush(): Promise<void>;
123
+ flushSync(): void;
124
+ get size(): number;
125
+ }
126
+
127
+ export { JSONFileStorage, MemoryStorage };
128
+ export type { JSONFileStorageOptions, MemoryStorageOptions, StorageAdapter };
@@ -0,0 +1,128 @@
1
+ /**
2
+ * StorageAdapter interface for DevicePassport persistence.
3
+ * Implementations provide pluggable storage backends (Memory, File, Redis, DB, etc.)
4
+ */
5
+ interface StorageAdapter<T = any> {
6
+ /**
7
+ * Retrieve an item by key.
8
+ * Returns null if key does not exist.
9
+ */
10
+ get(key: string): Promise<T | null>;
11
+ /**
12
+ * Store an item with the given key.
13
+ */
14
+ set(key: string, value: T): Promise<void>;
15
+ /**
16
+ * Check if a key exists in storage.
17
+ */
18
+ has(key: string): Promise<boolean>;
19
+ /**
20
+ * Delete an item by key.
21
+ * Returns true if item existed and was deleted, false otherwise.
22
+ */
23
+ delete(key: string): Promise<boolean>;
24
+ /**
25
+ * Return all keys currently stored.
26
+ */
27
+ keys(): Promise<string[]>;
28
+ /**
29
+ * Clear all items in this storage.
30
+ */
31
+ clear(): Promise<void>;
32
+ }
33
+
34
+ interface MemoryStorageOptions {
35
+ /**
36
+ * Whether to deep-clone stored and retrieved objects to prevent external mutations.
37
+ * Defaults to true.
38
+ */
39
+ clone?: boolean;
40
+ }
41
+ /**
42
+ * In-memory storage adapter.
43
+ * Useful for ephemeral scraping runs, tests, and caching.
44
+ */
45
+ declare class MemoryStorage<T = any> implements StorageAdapter<T> {
46
+ private readonly store;
47
+ private readonly clone;
48
+ constructor(options?: MemoryStorageOptions);
49
+ private deepClone;
50
+ get(key: string): Promise<T | null>;
51
+ getSync(key: string): T | null;
52
+ set(key: string, value: T): Promise<void>;
53
+ setSync(key: string, value: T): void;
54
+ has(key: string): Promise<boolean>;
55
+ hasSync(key: string): boolean;
56
+ delete(key: string): Promise<boolean>;
57
+ deleteSync(key: string): boolean;
58
+ keys(): Promise<string[]>;
59
+ keysSync(): string[];
60
+ clear(): Promise<void>;
61
+ clearSync(): void;
62
+ get size(): number;
63
+ }
64
+
65
+ interface JSONFileStorageOptions {
66
+ /**
67
+ * Path to the JSON file on disk.
68
+ */
69
+ filePath: string;
70
+ /**
71
+ * Format JSON with indentation for readability.
72
+ * Defaults to true.
73
+ */
74
+ pretty?: boolean;
75
+ /**
76
+ * Auto-save to disk immediately when values change.
77
+ * Defaults to true.
78
+ */
79
+ autoSave?: boolean;
80
+ }
81
+ /**
82
+ * File-backed JSON storage adapter.
83
+ * Uses atomic writes via temp-file + renameSync to ensure zero corruption
84
+ * even if the process is killed mid-write. Automatically creates directories.
85
+ */
86
+ declare class JSONFileStorage<T = any> implements StorageAdapter<T> {
87
+ readonly filePath: string;
88
+ private readonly pretty;
89
+ private readonly autoSave;
90
+ private readonly cache;
91
+ private isLoaded;
92
+ private writeQueue;
93
+ constructor(filePathOrOptions: string | JSONFileStorageOptions);
94
+ /**
95
+ * Ensure data is loaded from disk into the in-memory cache.
96
+ */
97
+ private ensureLoaded;
98
+ /**
99
+ * Atomic flush to disk. Writes to a unique temp file in the same directory,
100
+ * then atomically renames it to target file.
101
+ */
102
+ private flushAtomic;
103
+ /**
104
+ * Queue a disk write to prevent race conditions during rapid concurrent mutations.
105
+ */
106
+ private queueSave;
107
+ get(key: string): Promise<T | null>;
108
+ getSync(key: string): T | null;
109
+ set(key: string, value: T): Promise<void>;
110
+ setSync(key: string, value: T): void;
111
+ has(key: string): Promise<boolean>;
112
+ hasSync(key: string): boolean;
113
+ delete(key: string): Promise<boolean>;
114
+ deleteSync(key: string): boolean;
115
+ keys(): Promise<string[]>;
116
+ keysSync(): string[];
117
+ clear(): Promise<void>;
118
+ clearSync(): void;
119
+ /**
120
+ * Explicitly force a flush to disk (useful if autoSave is set to false).
121
+ */
122
+ flush(): Promise<void>;
123
+ flushSync(): void;
124
+ get size(): number;
125
+ }
126
+
127
+ export { JSONFileStorage, MemoryStorage };
128
+ export type { JSONFileStorageOptions, MemoryStorageOptions, StorageAdapter };
@@ -0,0 +1,3 @@
1
+ export { J as JSONFileStorage, M as MemoryStorage } from '../shared/device-passport.CyQtcZeD.mjs';
2
+ import 'node:fs';
3
+ import 'node:path';
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -0,0 +1,215 @@
1
+ import { L as LocaleProfile } from '../shared/device-passport.C_F1vBE8.cjs';
2
+ export { C as CountryGeoDefinition, G as GeoContext, a as GeoCoordinates, b as GeoLocation, c as GeoOptions, d as LanguageWeight } from '../shared/device-passport.C_F1vBE8.cjs';
3
+
4
+ /**
5
+ * Metrics, Consistency Evaluation, and Benchmark types for Device Passport.
6
+ */
7
+ type ConsistencyCategory = 'os_ua_alignment' | 'client_hints_entropy' | 'hardware_plausibility' | 'geo_locale_coherence' | 'webgl_hardware_coupling' | 'screen_viewport_consistency';
8
+ interface ConsistencyCheck {
9
+ id: string;
10
+ name: string;
11
+ category: ConsistencyCategory;
12
+ passed: boolean;
13
+ score: number;
14
+ weight: number;
15
+ message: string;
16
+ details?: Record<string, unknown>;
17
+ }
18
+ interface EntropyAnalysis {
19
+ estimatedBits: number;
20
+ collisionRisk: 'very_low' | 'low' | 'moderate' | 'high';
21
+ fingerprintUniqueness?: number;
22
+ }
23
+ type EvaluationStatus = 'PASS' | 'WARN' | 'FAIL';
24
+ type EvaluationGrade = 'A+' | 'A' | 'B' | 'C' | 'F';
25
+ interface PassportEvaluation {
26
+ /** Overall consistency score (0 - 100) */
27
+ overallScore: number;
28
+ /** Pass / Warn / Fail status based on strict thresholds */
29
+ status: EvaluationStatus;
30
+ /** Academic grade assessment */
31
+ grade: EvaluationGrade;
32
+ /** Individual check breakdowns */
33
+ checks: ConsistencyCheck[];
34
+ /** Entropy and collision analysis */
35
+ entropyAnalysis?: EntropyAnalysis;
36
+ /** ISO timestamp when evaluated */
37
+ evaluatedAt: string;
38
+ }
39
+ interface BenchmarkMetrics {
40
+ passportId: string;
41
+ determinismScore: number;
42
+ contradictionRate: number;
43
+ overallConsistencyScore: number;
44
+ generationLatencyMs: number;
45
+ entropyBits: number;
46
+ timestamp: string;
47
+ }
48
+
49
+ /**
50
+ * Core type definitions for Device Passport.
51
+ * Compliant with RFC 8942, W3C User-Agent Client Hints, and WebGL specs.
52
+ */
53
+
54
+ type SupportedBrowserName = 'Chrome' | 'Edge' | 'Safari' | 'Firefox';
55
+ type SupportedPlatform = 'macOS' | 'Windows';
56
+ type SupportedArchitecture = 'arm' | 'x86';
57
+ interface BrowserProfile {
58
+ name: SupportedBrowserName;
59
+ version: string;
60
+ majorVersion: number;
61
+ userAgent: string;
62
+ }
63
+ interface OperatingSystemProfile {
64
+ name: SupportedPlatform;
65
+ platform: SupportedPlatform;
66
+ version: string;
67
+ release: string;
68
+ architecture: SupportedArchitecture;
69
+ }
70
+ interface ScreenProfile {
71
+ width: number;
72
+ height: number;
73
+ availWidth: number;
74
+ availHeight: number;
75
+ dpr: number;
76
+ colorDepth: number;
77
+ pixelDepth: number;
78
+ }
79
+ interface CpuProfile {
80
+ architecture: SupportedArchitecture;
81
+ concurrency: number;
82
+ }
83
+ interface MemoryProfile {
84
+ deviceMemory: number;
85
+ physicalMemoryGB?: number;
86
+ }
87
+ interface GpuProfile {
88
+ vendor: string;
89
+ renderer: string;
90
+ webglVendor?: string;
91
+ webglRenderer?: string;
92
+ }
93
+ interface HardwareProfile {
94
+ screen: ScreenProfile;
95
+ cpu: CpuProfile;
96
+ memory: MemoryProfile;
97
+ gpu: GpuProfile;
98
+ }
99
+ interface BrandVersion {
100
+ brand: string;
101
+ version: string;
102
+ }
103
+ /**
104
+ * Raw RFC 8942 / RFC 8941 structured client hints headers.
105
+ */
106
+ interface ClientHintsHeaders {
107
+ /** Low-entropy brand and major version, e.g. `"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"` */
108
+ 'sec-ch-ua': string;
109
+ /** Low-entropy mobile indicator, `"?0"` or `"?1"` */
110
+ 'sec-ch-ua-mobile': string;
111
+ /** Low-entropy platform, e.g. `"macOS"` or `"Windows"` */
112
+ 'sec-ch-ua-platform': string;
113
+ /** High-entropy OS version, e.g. `"14.6.1"` or `"15.0.0"` */
114
+ 'sec-ch-ua-platform-version': string;
115
+ /** High-entropy architecture, e.g. `"arm"` or `"x86"` */
116
+ 'sec-ch-ua-arch': string;
117
+ /** High-entropy bitness, e.g. `"64"` */
118
+ 'sec-ch-ua-bitness': string;
119
+ /** High-entropy device model, `""` for desktop */
120
+ 'sec-ch-ua-model': string;
121
+ /** High-entropy full version list, e.g. `"Chromium";v="124.0.6367.208", "Google Chrome";v="124.0.6367.208"` */
122
+ 'sec-ch-ua-full-version-list': string;
123
+ /** High-entropy 32-bit on 64-bit Windows flag, `"?0"` */
124
+ 'sec-ch-ua-wow64'?: string;
125
+ }
126
+ /**
127
+ * Structured User-Agent Client Hints object representing navigator.userAgentData.
128
+ */
129
+ interface UserAgentClientHints {
130
+ brands: BrandVersion[];
131
+ mobile: boolean;
132
+ platform: string;
133
+ platformVersion: string;
134
+ architecture: string;
135
+ bitness: string;
136
+ model: string;
137
+ fullVersionList: BrandVersion[];
138
+ wow64?: boolean;
139
+ /** Serialized RFC 8942 compliant headers */
140
+ headers: ClientHintsHeaders;
141
+ }
142
+ interface DevicePassportContext {
143
+ viewport: {
144
+ width: number;
145
+ height: number;
146
+ };
147
+ userAgent: string;
148
+ locale: string;
149
+ timezoneId: string;
150
+ geolocation?: {
151
+ latitude: number;
152
+ longitude: number;
153
+ accuracy?: number;
154
+ };
155
+ permissions?: string[];
156
+ extraHTTPHeaders: Record<string, string>;
157
+ deviceScaleFactor: number;
158
+ hasTouch: boolean;
159
+ isMobile: boolean;
160
+ colorScheme?: 'light' | 'dark' | 'no-preference';
161
+ }
162
+ interface DevicePassport {
163
+ /** Unique deterministic or UUID identifier */
164
+ id: string;
165
+ /** Seed used to generate this passport */
166
+ seed: string;
167
+ /** ISO 8601 creation timestamp */
168
+ createdAt: string;
169
+ /** Browser profile */
170
+ browser: BrowserProfile;
171
+ /** Operating system profile */
172
+ os: OperatingSystemProfile;
173
+ /** Hardware profile (screen, cpu, memory, gpu) */
174
+ hardware: HardwareProfile;
175
+ /** Locale, language, timezone */
176
+ locale: LocaleProfile;
177
+ /** All HTTP headers (User-Agent, Sec-CH-UA*, Accept*, etc.) */
178
+ headers: Record<string, string>;
179
+ /** High-entropy and low-entropy Client Hints */
180
+ clientHints: UserAgentClientHints;
181
+ /** Ready-to-use context options for Playwright / Puppeteer / Browser */
182
+ context: DevicePassportContext;
183
+ /** Consistency and anti-detection score evaluation */
184
+ evaluation?: PassportEvaluation;
185
+ /** Optional helper method to get merged headers */
186
+ getHeaders?: (overrides?: Record<string, string>) => Record<string, string>;
187
+ }
188
+ /** Alias for backward compatibility */
189
+ type DeviceProfile = DevicePassport;
190
+ interface PassportGeneratorOptions {
191
+ /** Deterministic seed (username, account ID, proxy IP, etc.) */
192
+ seed?: string | number;
193
+ /** Geographic country code ('US', 'JP', etc.) or residential proxy URL */
194
+ geo?: string;
195
+ /** Residential proxy URL to detect geographical location from */
196
+ proxy?: string;
197
+ proxyUrl?: string;
198
+ /** Preferred Operating System */
199
+ os?: SupportedPlatform;
200
+ /** Preferred Browser */
201
+ browser?: SupportedBrowserName;
202
+ /** Preferred primary locale (e.g. 'en-US', 'zh-CN') */
203
+ locale?: string;
204
+ /** Preferred country code (e.g. 'US', 'GB', 'DE', 'JP') */
205
+ country?: string;
206
+ /** Preferred timezone (e.g. 'America/New_York') */
207
+ timezone?: string;
208
+ /** Whether to integrate with header-generator when available */
209
+ useHeaderGenerator?: boolean;
210
+ /** Hardware tier preference */
211
+ hardwareTier?: 'standard' | 'high-performance';
212
+ }
213
+
214
+ export { LocaleProfile };
215
+ export type { BenchmarkMetrics, BrandVersion, BrowserProfile, ClientHintsHeaders, ConsistencyCategory, ConsistencyCheck, CpuProfile, DevicePassport, DevicePassportContext, DeviceProfile, EntropyAnalysis, EvaluationGrade, EvaluationStatus, GpuProfile, HardwareProfile, MemoryProfile, OperatingSystemProfile, PassportEvaluation, PassportGeneratorOptions, ScreenProfile, SupportedArchitecture, SupportedBrowserName, SupportedPlatform, UserAgentClientHints };