@kya-os/checkpoint-shared 1.3.1 → 1.5.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/CHANGELOG.md +127 -2
- package/dist/beacon-types/index.d.mts +441 -432
- package/dist/beacon-types/index.d.mts.map +1 -0
- package/dist/beacon-types/index.d.ts +441 -432
- package/dist/beacon-types/index.d.ts.map +1 -0
- package/dist/beacon-types/index.js +198 -182
- package/dist/beacon-types/index.mjs +197 -179
- package/dist/beacon-types/index.mjs.map +1 -0
- package/dist/browser-posture-cookie-Dmq9Brf_.d.mts +5 -0
- package/dist/browser-posture-cookie-Dmq9Brf_.d.mts.map +1 -0
- package/dist/browser-posture-cookie-Dmq9Brf_.d.ts +5 -0
- package/dist/browser-posture-cookie-Dmq9Brf_.d.ts.map +1 -0
- package/dist/browser-posture-cookie.d.mts +2 -0
- package/dist/browser-posture-cookie.d.ts +2 -0
- package/dist/browser-posture-cookie.js +1 -0
- package/dist/browser-posture-cookie.mjs +2 -0
- package/dist/browser-posture-cookie.mjs.map +1 -0
- package/dist/browser-posture-report.d.mts +50 -82
- package/dist/browser-posture-report.d.mts.map +1 -0
- package/dist/browser-posture-report.d.ts +50 -82
- package/dist/browser-posture-report.d.ts.map +1 -0
- package/dist/browser-posture-report.js +1 -1
- package/dist/browser-posture-report.mjs +2 -1
- package/dist/browser-posture-report.mjs.map +1 -0
- package/dist/browser-posture.d.mts +80 -111
- package/dist/browser-posture.d.mts.map +1 -0
- package/dist/browser-posture.d.ts +80 -111
- package/dist/browser-posture.d.ts.map +1 -0
- package/dist/browser-posture.js +143 -4164
- package/dist/browser-posture.mjs +142 -4161
- package/dist/browser-posture.mjs.map +1 -0
- package/dist/browser.d.mts +323 -316
- package/dist/browser.d.mts.map +1 -0
- package/dist/browser.d.ts +323 -316
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +1 -1
- package/dist/browser.mjs +2 -1
- package/dist/browser.mjs.map +1 -0
- package/dist/canonical-signer/index.d.mts +38 -33
- package/dist/canonical-signer/index.d.mts.map +1 -0
- package/dist/canonical-signer/index.d.ts +38 -33
- package/dist/canonical-signer/index.d.ts.map +1 -0
- package/dist/canonical-signer/index.js +411 -181
- package/dist/canonical-signer/index.mjs +383 -175
- package/dist/canonical-signer/index.mjs.map +1 -0
- package/dist/clearance.d.mts +30 -0
- package/dist/clearance.d.mts.map +1 -0
- package/dist/clearance.d.ts +30 -0
- package/dist/clearance.d.ts.map +1 -0
- package/dist/clearance.js +120 -0
- package/dist/clearance.mjs +112 -0
- package/dist/clearance.mjs.map +1 -0
- package/dist/client-ip-1y2iXAYW.js +237 -0
- package/dist/client-ip-HOfe6ucV.mjs +215 -0
- package/dist/client-ip-HOfe6ucV.mjs.map +1 -0
- package/dist/deploy/index.d.mts +375 -810
- package/dist/deploy/index.d.mts.map +1 -0
- package/dist/deploy/index.d.ts +375 -810
- package/dist/deploy/index.d.ts.map +1 -0
- package/dist/deploy/index.js +505 -413
- package/dist/deploy/index.mjs +504 -410
- package/dist/deploy/index.mjs.map +1 -0
- package/dist/errors/index.d.mts +101 -101
- package/dist/errors/index.d.mts.map +1 -0
- package/dist/errors/index.d.ts +101 -101
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +341 -314
- package/dist/errors/index.mjs +340 -311
- package/dist/errors/index.mjs.map +1 -0
- package/dist/external-jr_S4iSS.d.mts +4187 -0
- package/dist/external-jr_S4iSS.d.mts.map +1 -0
- package/dist/external-jr_S4iSS.d.ts +4187 -0
- package/dist/external-jr_S4iSS.d.ts.map +1 -0
- package/dist/gateway/index.d.mts +154 -550
- package/dist/gateway/index.d.mts.map +1 -0
- package/dist/gateway/index.d.ts +154 -550
- package/dist/gateway/index.d.ts.map +1 -0
- package/dist/gateway/index.js +117 -81
- package/dist/gateway/index.mjs +116 -78
- package/dist/gateway/index.mjs.map +1 -0
- package/dist/gateway-client-ip.d.mts +59 -0
- package/dist/gateway-client-ip.d.mts.map +1 -0
- package/dist/gateway-client-ip.d.ts +59 -0
- package/dist/gateway-client-ip.d.ts.map +1 -0
- package/dist/gateway-client-ip.js +149 -0
- package/dist/gateway-client-ip.mjs +139 -0
- package/dist/gateway-client-ip.mjs.map +1 -0
- package/dist/index.d.mts +15523 -38968
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +15523 -38968
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14950 -16029
- package/dist/index.mjs +14846 -15955
- package/dist/index.mjs.map +1 -0
- package/dist/mcpi/agentshield-api/index.d.mts +45 -44
- package/dist/mcpi/agentshield-api/index.d.mts.map +1 -0
- package/dist/mcpi/agentshield-api/index.d.ts +45 -44
- package/dist/mcpi/agentshield-api/index.d.ts.map +1 -0
- package/dist/mcpi/agentshield-api/index.js +0 -2
- package/dist/mcpi/agentshield-api/index.mjs +1 -1
- package/dist/mcpi/approval-grant/index.d.mts +63 -61
- package/dist/mcpi/approval-grant/index.d.mts.map +1 -0
- package/dist/mcpi/approval-grant/index.d.ts +63 -61
- package/dist/mcpi/approval-grant/index.d.ts.map +1 -0
- package/dist/mcpi/approval-grant/index.js +220 -140
- package/dist/mcpi/approval-grant/index.mjs +219 -137
- package/dist/mcpi/approval-grant/index.mjs.map +1 -0
- package/dist/mcpi/dashboard-config/index.d.mts +2395 -13915
- package/dist/mcpi/dashboard-config/index.d.mts.map +1 -0
- package/dist/mcpi/dashboard-config/index.d.ts +2395 -13915
- package/dist/mcpi/dashboard-config/index.d.ts.map +1 -0
- package/dist/mcpi/dashboard-config/index.js +605 -458
- package/dist/mcpi/dashboard-config/index.mjs +604 -455
- package/dist/mcpi/dashboard-config/index.mjs.map +1 -0
- package/dist/mcpi/multibase-ed25519.d.mts +10 -8
- package/dist/mcpi/multibase-ed25519.d.mts.map +1 -0
- package/dist/mcpi/multibase-ed25519.d.ts +10 -8
- package/dist/mcpi/multibase-ed25519.d.ts.map +1 -0
- package/dist/mcpi/multibase-ed25519.js +182 -106
- package/dist/mcpi/multibase-ed25519.mjs +181 -103
- package/dist/mcpi/multibase-ed25519.mjs.map +1 -0
- package/dist/patterns-CkRVOdtV.js +243 -0
- package/dist/patterns-DzkGy_qk.mjs +173 -0
- package/dist/patterns-DzkGy_qk.mjs.map +1 -0
- package/dist/project-verification-key-C3L5rd8a.js +41 -0
- package/dist/project-verification-key-CgSVX9_m.mjs +37 -0
- package/dist/project-verification-key-CgSVX9_m.mjs.map +1 -0
- package/dist/rolldown-runtime-iY2fYEqi.mjs +19 -0
- package/dist/schemas-BmjNLAE7.js +5677 -0
- package/dist/schemas-DxY-dk9y.mjs +5511 -0
- package/dist/schemas-DxY-dk9y.mjs.map +1 -0
- package/dist/signals/index.d.mts +125 -115
- package/dist/signals/index.d.mts.map +1 -0
- package/dist/signals/index.d.ts +125 -115
- package/dist/signals/index.d.ts.map +1 -0
- package/dist/signals/index.js +1693 -1536
- package/dist/signals/index.mjs +1692 -1533
- package/dist/signals/index.mjs.map +1 -0
- package/dist/test-fixtures/index.d.mts +124 -119
- package/dist/test-fixtures/index.d.mts.map +1 -0
- package/dist/test-fixtures/index.d.ts +124 -119
- package/dist/test-fixtures/index.d.ts.map +1 -0
- package/dist/test-fixtures/index.js +460 -228
- package/dist/test-fixtures/index.mjs +459 -225
- package/dist/test-fixtures/index.mjs.map +1 -0
- package/dist/tool-protection/index.d.mts +368 -1067
- package/dist/tool-protection/index.d.mts.map +1 -0
- package/dist/tool-protection/index.d.ts +368 -1067
- package/dist/tool-protection/index.d.ts.map +1 -0
- package/dist/tool-protection/index.js +366 -285
- package/dist/tool-protection/index.mjs +365 -282
- package/dist/tool-protection/index.mjs.map +1 -0
- package/fixtures/bot-signal-resolution.json +142 -0
- package/fixtures/browser-posture-claims.json +421 -0
- package/fixtures/browser-posture-headers.json +46 -0
- package/fixtures/detection/reason-codes.json +10 -1
- package/fixtures/kya-http/challenge.delegation.fetcher-200.json +9 -3
- package/fixtures/kya-http/challenge.delegation.full.json +9 -3
- package/fixtures/kya-http/challenge.delegation.minimal.json +9 -3
- package/fixtures/kya-http/error-codes.json +7 -2
- package/package.json +21 -7
|
@@ -1,222 +1,240 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/beacon-types/index.ts
|
|
2
2
|
function isRecord(input) {
|
|
3
|
-
|
|
3
|
+
return typeof input === "object" && input !== null && !Array.isArray(input);
|
|
4
4
|
}
|
|
5
5
|
function toRecord(input) {
|
|
6
|
-
|
|
6
|
+
return isRecord(input) ? input : {};
|
|
7
7
|
}
|
|
8
8
|
function numberOr(value, fallback) {
|
|
9
|
-
|
|
9
|
+
return typeof value === "number" && Number.isFinite(value) && value !== 0 ? value : fallback;
|
|
10
10
|
}
|
|
11
11
|
function stringOr(value, fallback) {
|
|
12
|
-
|
|
12
|
+
return typeof value === "string" ? value : fallback;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
function isStringArray(value) {
|
|
15
|
+
return Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Non-empty on purpose: an empty schedule would mean "zero posture-recovery
|
|
19
|
+
* attempts", silently disabling recovery rather than configuring it. A
|
|
20
|
+
* deployment that actually wants no retries sets `flushInterval` instead.
|
|
21
|
+
*/
|
|
22
|
+
function isPositiveNumberArray(value) {
|
|
23
|
+
return Array.isArray(value) && value.length > 0 && value.every((entry) => typeof entry === "number" && Number.isFinite(entry) && entry > 0);
|
|
18
24
|
}
|
|
25
|
+
function isBeaconTags(value) {
|
|
26
|
+
return isRecord(value) && Object.values(value).every((entry) => typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean");
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Exported because `parseBeaconConfig` is an allowlist: a key it does not
|
|
30
|
+
* name is dropped, silently. The beacon's other public entry point
|
|
31
|
+
* (`checkpoint-shared/browser`) carries its own copy of that allowlist, so
|
|
32
|
+
* the CHECK at least lives in one place even while the two parsers do not —
|
|
33
|
+
* see the note on `BeaconConfig.identity`.
|
|
34
|
+
*
|
|
35
|
+
* Rejects an identity with no usable `userId` rather than passing through a
|
|
36
|
+
* half-formed object: downstream this becomes `detections.user_id`, and an
|
|
37
|
+
* empty string there is worse than an absent one — it reads as "identified"
|
|
38
|
+
* while naming nobody.
|
|
39
|
+
*/
|
|
19
40
|
function isBeaconIdentity(value) {
|
|
20
|
-
|
|
41
|
+
return isRecord(value) && typeof value.userId === "string" && value.userId.length > 0;
|
|
21
42
|
}
|
|
22
43
|
function isLogLevel(value) {
|
|
23
|
-
|
|
44
|
+
return value === "error" || value === "warn" || value === "info" || value === "debug";
|
|
24
45
|
}
|
|
25
46
|
function isBeaconWorkerMessageType(value) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
47
|
+
return value === "init" || value === "collect" || value === "flush" || value === "config" || value === "status" || value === "error" || value === "response" || value === "posture";
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Resolves whether a beacon should use its Web Worker transport.
|
|
51
|
+
*
|
|
52
|
+
* `enableWebWorker` is accepted as an alias for `useWorker`: the package's
|
|
53
|
+
* own test suite (`checkpoint-beacon/src/index.test.ts`) has always
|
|
54
|
+
* constructed with `enableWebWorker: false`, but `parseBeaconConfig`'s
|
|
55
|
+
* allowlist only ever named `useWorker`, so that key was silently dropped —
|
|
56
|
+
* the beacon kept auto-detecting worker support regardless of what the
|
|
57
|
+
* caller passed. `useWorker` wins when both are set, since it's the
|
|
58
|
+
* canonical name every other config field (`workerUrl`, `workerConfig`)
|
|
59
|
+
* pairs with.
|
|
60
|
+
*/
|
|
32
61
|
function resolveUseWorker(config) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (typeof config.enableWebWorker === "boolean") {
|
|
37
|
-
return config.enableWebWorker;
|
|
38
|
-
}
|
|
39
|
-
return true;
|
|
62
|
+
if (typeof config.useWorker === "boolean") return config.useWorker;
|
|
63
|
+
if (typeof config.enableWebWorker === "boolean") return config.enableWebWorker;
|
|
64
|
+
return true;
|
|
40
65
|
}
|
|
41
66
|
function parseRetryStrategy(input) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
67
|
+
const strategy = toRecord(input);
|
|
68
|
+
return {
|
|
69
|
+
maxAttempts: numberOr(strategy.maxAttempts, 3),
|
|
70
|
+
baseDelay: numberOr(strategy.baseDelay, 1e3),
|
|
71
|
+
maxDelay: numberOr(strategy.maxDelay, 3e4),
|
|
72
|
+
factor: numberOr(strategy.factor, 2),
|
|
73
|
+
jitter: strategy.jitter !== false
|
|
74
|
+
};
|
|
50
75
|
}
|
|
51
76
|
function parseCircuitBreakerConfig(input) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
77
|
+
const config = toRecord(input);
|
|
78
|
+
return {
|
|
79
|
+
threshold: numberOr(config.threshold, 5),
|
|
80
|
+
timeout: numberOr(config.timeout, 6e4),
|
|
81
|
+
resetTimeout: numberOr(config.resetTimeout, 3e4)
|
|
82
|
+
};
|
|
58
83
|
}
|
|
59
84
|
function parseOfflineQueueEntry(input) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
retryCount: numberOr(entry.retryCount, 0),
|
|
71
|
-
size: numberOr(entry.size, 0)
|
|
72
|
-
};
|
|
85
|
+
if (!isRecord(input)) throw new Error("Invalid offline queue entry");
|
|
86
|
+
const entry = input;
|
|
87
|
+
return {
|
|
88
|
+
id: stringOr(entry.id, `${Date.now()}_${Math.random().toString(36).substr(2, 9)}`),
|
|
89
|
+
events: Array.isArray(entry.events) ? entry.events : [],
|
|
90
|
+
timestamp: numberOr(entry.timestamp, Date.now()),
|
|
91
|
+
expiresAt: numberOr(entry.expiresAt, Date.now() + 864e5),
|
|
92
|
+
retryCount: numberOr(entry.retryCount, 0),
|
|
93
|
+
size: numberOr(entry.size, 0)
|
|
94
|
+
};
|
|
73
95
|
}
|
|
74
96
|
function parseBeaconWorkerMessage(input) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
id: stringOr(msg.id, messageId)
|
|
87
|
-
};
|
|
97
|
+
if (!isRecord(input)) throw new Error("Invalid beacon worker message");
|
|
98
|
+
const msg = input;
|
|
99
|
+
const messageId = stringOr(msg.messageId) ?? stringOr(msg.id) ?? crypto.randomUUID();
|
|
100
|
+
return {
|
|
101
|
+
type: isBeaconWorkerMessageType(msg.type) ? msg.type : "init",
|
|
102
|
+
data: msg.data,
|
|
103
|
+
payload: msg.payload,
|
|
104
|
+
messageId,
|
|
105
|
+
timestamp: numberOr(msg.timestamp, Date.now()),
|
|
106
|
+
id: stringOr(msg.id, messageId)
|
|
107
|
+
};
|
|
88
108
|
}
|
|
89
109
|
function isMessagePriority(value) {
|
|
90
|
-
|
|
110
|
+
return value === "low" || value === "normal" || value === "high" || value === "critical";
|
|
91
111
|
}
|
|
92
112
|
function isWorkerMessageType(value) {
|
|
93
|
-
|
|
113
|
+
return value === "request" || value === "response" || value === "error" || value === "heartbeat" || value === "status";
|
|
94
114
|
}
|
|
95
115
|
function isWorkerErrorType(value) {
|
|
96
|
-
|
|
116
|
+
return value === "initialization" || value === "runtime" || value === "communication" || value === "timeout" || value === "memory" || value === "network" || value === "permission" || value === "validation" || value === "processing" || value === "unknown";
|
|
97
117
|
}
|
|
98
118
|
function parseWorkerMessage(input) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
correlationId: msg.correlationId
|
|
112
|
-
};
|
|
119
|
+
const msg = input && typeof input === "object" ? input : null;
|
|
120
|
+
if (!msg) throw new Error("Invalid worker message");
|
|
121
|
+
return {
|
|
122
|
+
id: msg.id || crypto.randomUUID(),
|
|
123
|
+
type: isWorkerMessageType(msg.type) ? msg.type : "request",
|
|
124
|
+
action: msg.action,
|
|
125
|
+
payload: msg.payload,
|
|
126
|
+
timestamp: msg.timestamp || Date.now(),
|
|
127
|
+
compressed: msg.compressed,
|
|
128
|
+
priority: isMessagePriority(msg.priority) ? msg.priority : "normal",
|
|
129
|
+
correlationId: msg.correlationId
|
|
130
|
+
};
|
|
113
131
|
}
|
|
114
132
|
function parseWorkerError(input) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
133
|
+
const error = input && typeof input === "object" ? input : {};
|
|
134
|
+
return {
|
|
135
|
+
type: isWorkerErrorType(error.type) ? error.type : "unknown",
|
|
136
|
+
code: typeof error.code === "string" ? error.code : void 0,
|
|
137
|
+
message: typeof error.message === "string" ? error.message : "Worker error",
|
|
138
|
+
stack: typeof error.stack === "string" ? error.stack : void 0,
|
|
139
|
+
timestamp: typeof error.timestamp === "number" ? error.timestamp : Date.now(),
|
|
140
|
+
recoverable: error.recoverable !== false,
|
|
141
|
+
retryAfter: typeof error.retryAfter === "number" ? error.retryAfter : void 0,
|
|
142
|
+
context: error.context
|
|
143
|
+
};
|
|
126
144
|
}
|
|
127
145
|
function parseWorkerPoolConfig(input) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
const config = input && typeof input === "object" ? input : {};
|
|
147
|
+
return {
|
|
148
|
+
maxWorkers: config.maxWorkers ?? 4,
|
|
149
|
+
minWorkers: config.minWorkers ?? 1,
|
|
150
|
+
workerIdleTimeout: config.workerIdleTimeout ?? 3e4,
|
|
151
|
+
taskQueueSize: config.taskQueueSize ?? 100,
|
|
152
|
+
resourceLimits: config.resourceLimits ?? {},
|
|
153
|
+
autoScale: config.autoScale ?? true,
|
|
154
|
+
scaleUpThreshold: config.scaleUpThreshold ?? 75,
|
|
155
|
+
scaleDownThreshold: config.scaleDownThreshold ?? 25
|
|
156
|
+
};
|
|
139
157
|
}
|
|
140
158
|
function parseResourceUsage(input) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
159
|
+
const usage = input && typeof input === "object" ? input : {};
|
|
160
|
+
return {
|
|
161
|
+
memory: usage.memory ?? {
|
|
162
|
+
used: 0,
|
|
163
|
+
limit: 0,
|
|
164
|
+
percentage: 0
|
|
165
|
+
},
|
|
166
|
+
cpu: usage.cpu ?? {
|
|
167
|
+
usage: 0,
|
|
168
|
+
limit: 100
|
|
169
|
+
},
|
|
170
|
+
tasks: usage.tasks ?? {
|
|
171
|
+
pending: 0,
|
|
172
|
+
active: 0,
|
|
173
|
+
completed: 0,
|
|
174
|
+
failed: 0
|
|
175
|
+
},
|
|
176
|
+
activeWorkers: usage.activeWorkers ?? 0
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
const ResourceUsageSchema = { parse: parseResourceUsage };
|
|
180
|
+
const WorkerPoolConfigSchema = { parse: parseWorkerPoolConfig };
|
|
155
181
|
function parseWorkerCapabilities(input) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
182
|
+
const cap = toRecord(input);
|
|
183
|
+
const csp = toRecord(cap.csp);
|
|
184
|
+
const performance = toRecord(cap.performance);
|
|
185
|
+
return {
|
|
186
|
+
workerAPI: cap.workerAPI !== false,
|
|
187
|
+
sharedArrayBuffer: cap.sharedArrayBuffer === true,
|
|
188
|
+
transferableObjects: cap.transferableObjects === true,
|
|
189
|
+
offscreenCanvas: cap.offscreenCanvas === true,
|
|
190
|
+
webAssembly: cap.webAssembly === true,
|
|
191
|
+
atomics: cap.atomics === true,
|
|
192
|
+
bigInt: cap.bigInt === true,
|
|
193
|
+
csp: {
|
|
194
|
+
workerSrc: csp.workerSrc === true,
|
|
195
|
+
scriptSrc: csp.scriptSrc === true,
|
|
196
|
+
blobUrls: csp.blobUrls === true,
|
|
197
|
+
inlineWorkers: csp.inlineWorkers === true
|
|
198
|
+
},
|
|
199
|
+
performance: {
|
|
200
|
+
memory: performance.memory === true,
|
|
201
|
+
measureUserAgentSpecificMemory: performance.measureUserAgentSpecificMemory === true
|
|
202
|
+
}
|
|
203
|
+
};
|
|
178
204
|
}
|
|
179
205
|
function parseBeaconConfig(input) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
// checkpoint-beacon (wrong direction of the package dependency graph).
|
|
211
|
-
collectorDeadlineMs: numberOr(config.collectorDeadlineMs, 1600),
|
|
212
|
-
maxQueueSize: numberOr(config.maxQueueSize, 100),
|
|
213
|
-
retryAttempts: numberOr(config.retryAttempts, 3),
|
|
214
|
-
retryDelay: numberOr(config.retryDelay, 2e3),
|
|
215
|
-
useWorker: resolveUseWorker(config),
|
|
216
|
-
workerUrl: stringOr(config.workerUrl),
|
|
217
|
-
workerConfig: isRecord(config.workerConfig) ? config.workerConfig : void 0,
|
|
218
|
-
lazySignalsUrl: stringOr(config.lazySignalsUrl)
|
|
219
|
-
};
|
|
206
|
+
const config = toRecord(input);
|
|
207
|
+
if (typeof config.projectId !== "string" || config.projectId.length === 0) throw new Error("Project ID is required");
|
|
208
|
+
return {
|
|
209
|
+
projectId: config.projectId,
|
|
210
|
+
environment: stringOr(config.environment),
|
|
211
|
+
tags: isBeaconTags(config.tags) ? config.tags : void 0,
|
|
212
|
+
identity: isBeaconIdentity(config.identity) ? config.identity : void 0,
|
|
213
|
+
endpoint: stringOr(config.endpoint),
|
|
214
|
+
enabled: config.enabled !== false,
|
|
215
|
+
debug: config.debug === true,
|
|
216
|
+
logLevel: isLogLevel(config.logLevel) ? config.logLevel : "error",
|
|
217
|
+
respectDoNotTrack: config.respectDoNotTrack !== false,
|
|
218
|
+
anonymizeIp: config.anonymizeIp === true,
|
|
219
|
+
stripUrlFragment: config.stripUrlFragment !== false,
|
|
220
|
+
scrubQueryParams: isStringArray(config.scrubQueryParams) ? config.scrubQueryParams : void 0,
|
|
221
|
+
dropQueryParams: config.dropQueryParams === true,
|
|
222
|
+
sessionTimeout: numberOr(config.sessionTimeout, 18e5),
|
|
223
|
+
sessionCookieName: stringOr(config.sessionCookieName, "_as_beacon_session"),
|
|
224
|
+
batchSize: numberOr(config.batchSize, 10),
|
|
225
|
+
flushInterval: numberOr(config.flushInterval, 5e3),
|
|
226
|
+
collectorDeadlineMs: numberOr(config.collectorDeadlineMs, 1600),
|
|
227
|
+
maxQueueSize: numberOr(config.maxQueueSize, 100),
|
|
228
|
+
retryAttempts: numberOr(config.retryAttempts, 3),
|
|
229
|
+
retryDelay: numberOr(config.retryDelay, 2e3),
|
|
230
|
+
postureRetryScheduleMs: isPositiveNumberArray(config.postureRetryScheduleMs) ? config.postureRetryScheduleMs : void 0,
|
|
231
|
+
useWorker: resolveUseWorker(config),
|
|
232
|
+
workerUrl: stringOr(config.workerUrl),
|
|
233
|
+
workerConfig: isRecord(config.workerConfig) ? config.workerConfig : void 0,
|
|
234
|
+
lazySignalsUrl: stringOr(config.lazySignalsUrl)
|
|
235
|
+
};
|
|
220
236
|
}
|
|
221
237
|
|
|
238
|
+
//#endregion
|
|
222
239
|
export { ResourceUsageSchema, WorkerPoolConfigSchema, isBeaconIdentity, parseBeaconConfig, parseBeaconWorkerMessage, parseCircuitBreakerConfig, parseOfflineQueueEntry, parseResourceUsage, parseRetryStrategy, parseWorkerCapabilities, parseWorkerError, parseWorkerMessage, parseWorkerPoolConfig };
|
|
240
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/beacon-types/index.ts"],"sourcesContent":["/**\n * Public TypeScript types for Checkpoint Beacon\n *\n * This package contains only the public API types needed by beacon consumers.\n * No implementation details or detection rules are included.\n */\n\nexport type JsonPrimitive = string | number | boolean | null;\nexport type JsonValue = JsonPrimitive | JsonValue[] | { [key: string]: JsonValue | undefined };\nexport type BeaconPrimitive = JsonPrimitive;\nexport type BeaconJsonValue = JsonValue;\nexport type BeaconCustomData = Record<string, JsonValue | undefined>;\nexport type BeaconPayload = BeaconCollectorData | BeaconCustomData | null;\nexport type WorkerPayload = unknown;\ntype UnknownRecord = Record<string, unknown>;\n\nfunction isRecord(input: unknown): input is UnknownRecord {\n return typeof input === 'object' && input !== null && !Array.isArray(input);\n}\n\nfunction toRecord(input: unknown): UnknownRecord {\n return isRecord(input) ? input : {};\n}\n\nfunction numberOr(value: unknown, fallback: number): number {\n return typeof value === 'number' && Number.isFinite(value) && value !== 0 ? value : fallback;\n}\n\nfunction stringOr(value: unknown, fallback?: string): string | undefined {\n return typeof value === 'string' ? value : fallback;\n}\n\nfunction isStringArray(value: unknown): value is string[] {\n return Array.isArray(value) && value.every((entry) => typeof entry === 'string');\n}\n\n/**\n * Non-empty on purpose: an empty schedule would mean \"zero posture-recovery\n * attempts\", silently disabling recovery rather than configuring it. A\n * deployment that actually wants no retries sets `flushInterval` instead.\n */\nfunction isPositiveNumberArray(value: unknown): value is number[] {\n return (\n Array.isArray(value) &&\n value.length > 0 &&\n value.every((entry) => typeof entry === 'number' && Number.isFinite(entry) && entry > 0)\n );\n}\n\nfunction isBeaconTags(value: unknown): value is Record<string, string | number | boolean> {\n return (\n isRecord(value) &&\n Object.values(value).every(\n (entry) =>\n typeof entry === 'string' || typeof entry === 'number' || typeof entry === 'boolean'\n )\n );\n}\n\n/**\n * Exported because `parseBeaconConfig` is an allowlist: a key it does not\n * name is dropped, silently. The beacon's other public entry point\n * (`checkpoint-shared/browser`) carries its own copy of that allowlist, so\n * the CHECK at least lives in one place even while the two parsers do not —\n * see the note on `BeaconConfig.identity`.\n *\n * Rejects an identity with no usable `userId` rather than passing through a\n * half-formed object: downstream this becomes `detections.user_id`, and an\n * empty string there is worse than an absent one — it reads as \"identified\"\n * while naming nobody.\n */\nexport function isBeaconIdentity(value: unknown): value is BeaconIdentity {\n return isRecord(value) && typeof value.userId === 'string' && value.userId.length > 0;\n}\n\nfunction isLogLevel(value: unknown): value is BeaconConfig['logLevel'] {\n return value === 'error' || value === 'warn' || value === 'info' || value === 'debug';\n}\n\nfunction isBeaconWorkerMessageType(value: unknown): value is BeaconWorkerMessageType {\n return (\n value === 'init' ||\n value === 'collect' ||\n value === 'flush' ||\n value === 'config' ||\n value === 'status' ||\n value === 'error' ||\n // `beacon.worker.ts`'s `respond()` has always sent this on every\n // successful request (init/collect/flush/config/status) — the allowlist\n // just never named it, so `parseBeaconWorkerMessage` silently coerced\n // every success response to `'init'` (see that function's fallback).\n value === 'response' ||\n value === 'posture'\n );\n}\n\n/**\n * Resolves whether a beacon should use its Web Worker transport.\n *\n * `enableWebWorker` is accepted as an alias for `useWorker`: the package's\n * own test suite (`checkpoint-beacon/src/index.test.ts`) has always\n * constructed with `enableWebWorker: false`, but `parseBeaconConfig`'s\n * allowlist only ever named `useWorker`, so that key was silently dropped —\n * the beacon kept auto-detecting worker support regardless of what the\n * caller passed. `useWorker` wins when both are set, since it's the\n * canonical name every other config field (`workerUrl`, `workerConfig`)\n * pairs with.\n */\nfunction resolveUseWorker(config: UnknownRecord): boolean {\n if (typeof config.useWorker === 'boolean') {\n return config.useWorker;\n }\n if (typeof config.enableWebWorker === 'boolean') {\n return config.enableWebWorker;\n }\n return true;\n}\n\nexport interface NetworkInformationLike extends EventTarget {\n type?: string;\n effectiveType?: string;\n downlink?: number;\n rtt?: number;\n saveData?: boolean;\n}\n\nexport interface NavigatorWithNetworkInformation extends Navigator {\n connection?: NetworkInformationLike;\n mozConnection?: NetworkInformationLike;\n webkitConnection?: NetworkInformationLike;\n deviceMemory?: number;\n vendorSub: string;\n doNotTrack: string | null;\n msDoNotTrack?: string | null;\n}\n\nexport interface WindowWithBeaconMetadata extends Window {\n doNotTrack?: string | null;\n __NEXT_DATA__?: {\n buildId?: string;\n };\n}\n\nexport interface TrustedTypePolicyLike {\n createScriptURL(url: string): string;\n createScript(script: string): string;\n}\n\nexport interface WindowWithTrustedTypes extends Window {\n trustedTypes?: {\n createPolicy(\n name: string,\n rules: {\n createScriptURL?: (url: string) => string;\n createScript?: (script: string) => string;\n }\n ): TrustedTypePolicyLike;\n };\n}\n\nexport interface PerformanceMemoryInfo {\n usedJSHeapSize: number;\n totalJSHeapSize: number;\n jsHeapSizeLimit: number;\n}\n\nexport interface PerformanceWithMemory extends Performance {\n memory?: PerformanceMemoryInfo;\n measureUserAgentSpecificMemory?: () => Promise<unknown>;\n}\n\nexport interface LargestContentfulPaintEntry extends PerformanceEntry {\n renderTime?: number;\n loadTime?: number;\n}\n\n// ============================================================================\n// BEACON CONFIGURATION\n// ============================================================================\n\n/**\n * Who the current visitor is, when the host site knows.\n *\n * Deliberately just the id. The pixel's `identify` call also carries\n * `previousId` and `userTraits`, but those drive the server's profile and\n * alias-graph pipeline (tenant salt, profile-copy, write advisory locks),\n * which the beacon ingest route does not run — accepting them here would mean\n * collecting personal data the beacon path then silently discards. Both are\n * additive later: this is an optional field on an optional object.\n */\nexport interface BeaconIdentity {\n /**\n * The host site's own id for the signed-in user. Capped at 255 characters\n * to match `detections.user_id`; a longer value is rejected at ingest.\n */\n userId: string;\n}\n\nexport interface BeaconConfig {\n /** Project ID for tracking (same as pixel data-project-id) */\n projectId: string;\n\n /**\n * Who the visitor is, when the page already knows at construction time.\n * When identity only becomes known later (a login part-way through the\n * session), call `identify()` instead.\n */\n identity?: BeaconIdentity;\n\n /**\n * Where batches are POSTed. Defaults to the hosted ingest endpoint declared\n * in `NETWORK_CONTRACT.md`.\n *\n * Set it to send somewhere else — a self-hosted deployment, a regional\n * install, or a test origin. An override means the destination is the\n * integrator's, not ours, so `NETWORK_CONTRACT.md` describes the DEFAULT and\n * says so explicitly.\n *\n * @default 'https://kya.vouched.id/api/v1/beacon'\n */\n endpoint?: string;\n\n /** Optional environment tag for data segmentation */\n environment?: 'development' | 'staging' | 'production' | string;\n\n /** Optional tags for custom data segmentation */\n tags?: Record<string, string | number | boolean>;\n\n /**\n * Not read by the SDK. Construct the beacon only when it should run, and\n * call `destroy()` to stop it.\n *\n * @deprecated\n */\n enabled?: boolean;\n\n /**\n * Verbose console logging.\n *\n * @default false\n */\n debug?: boolean;\n\n /**\n * Log verbosity.\n *\n * @default 'error'\n */\n logLevel?: 'error' | 'warn' | 'info' | 'debug';\n\n /**\n * When the browser sends Do Not Track, the beacon collects and sends nothing.\n *\n * @default true\n */\n respectDoNotTrack?: boolean;\n\n /**\n * Truncate the stored IP to /24 (IPv4) or /48 (IPv6) before persistence.\n * Read once at construction, so `updateConfig` will not change it; build a\n * new beacon instead.\n *\n * @default false\n */\n anonymizeIp?: boolean;\n\n /**\n * Strip the `#fragment` from the `url`/`referrer` collector fields before\n * they leave the page. Defaults to `true`: a fragment is never sent to\n * the server by the browser in the first place for any OTHER surface\n * (it is script-visible only), so a beacon that forwards it is the one\n * place it can leak — and it is also the highest-risk part of the URL,\n * since SPA routers, magic-link auth, and OAuth implicit-flow responses\n * all put tokens there. Set to `false` only if a project genuinely\n * consumes `url`'s fragment server-side.\n *\n * @default true\n */\n stripUrlFragment?: boolean;\n\n /**\n * Query parameter names (matched case-insensitively) to redact from the\n * `url`/`referrer` collector fields before they leave the page. Each\n * matching value is replaced with the literal string `\"[redacted]\"`; the\n * parameter itself stays present so the URL's shape is unchanged. Empty\n * by default — nothing is scrubbed unless a project opts in with the\n * param names it puts tokens/PII behind (e.g. `[\"token\", \"email\"]`).\n * Ignored for a parameter when `dropQueryParams` is also `true`, since\n * there is no query string left to scrub.\n *\n * @default []\n */\n scrubQueryParams?: string[];\n\n /**\n * Drop the entire query string from the `url`/`referrer` collector\n * fields before they leave the page. Off by default. Takes priority over\n * `scrubQueryParams` when both are set — there is nothing left to scrub\n * once the whole query string is gone.\n *\n * @default false\n */\n dropQueryParams?: boolean;\n\n /**\n * Inactivity timeout in milliseconds (30 minutes). Every send extends it,\n * so the session cookie rotates only after that much idle time.\n *\n * @default 1800000\n */\n sessionTimeout?: number;\n\n /**\n * Name of the visitor session cookie shared by pixel, beacon, gateway, and\n * SDK rows. Query it with `?sessionId=` on the\n * [detections endpoint](/docs/api-reference#get-project-detections).\n *\n * @default '_as_beacon_session'\n */\n sessionCookieName?: string;\n\n /**\n * Events per batch.\n *\n * @default 10\n */\n batchSize?: number;\n\n /**\n * Interval in milliseconds for automatic collection and flush.\n *\n * @default 5000\n */\n flushInterval?: number;\n\n /**\n * Per-collector deadline in milliseconds. A collector still running past\n * this deadline is dropped from the current collection round rather than\n * awaited further — see `collectWithDeadline` in checkpoint-beacon.\n * Default and rationale documented in checkpoint-beacon's\n * `src/budget/thresholds.ts`.\n *\n * @default 1600\n */\n collectorDeadlineMs?: number;\n\n /**\n * Maximum number of queued events.\n *\n * @default 100\n */\n maxQueueSize?: number;\n\n /**\n * Retry count for failed sends.\n *\n * @default 3\n */\n retryAttempts?: number;\n\n /**\n * Base retry delay in milliseconds.\n *\n * @default 2000\n */\n retryDelay?: number;\n\n /**\n * Delays in milliseconds between posture-recovery attempts after a\n * durably-queued ingest response that carried no posture verdict. The\n * array's length is the attempt ceiling. Defaults to the shipped ladder;\n * override only in tests and in a self-hosted deployment with a\n * different outage profile.\n */\n postureRetryScheduleMs?: number[];\n\n /**\n * Prefer a Web Worker for event processing, batching, and transport.\n * Page-dependent collection remains on the main thread. Unsupported\n * browsers fall back to the main thread; SSR never starts a worker.\n * Set false to disable the processing worker.\n *\n * @default true\n */\n useWorker?: boolean;\n\n /**\n * Alias for `useWorker`, accepted for callers using the older option\n * name. When both are set, `useWorker` wins — see `resolveUseWorker`.\n */\n enableWebWorker?: boolean;\n\n /**\n * URL of the worker script (`beacon.worker.js`, exported as\n * `@kya-os/checkpoint-beacon/worker`). Classic workers must be same-origin.\n * When unset, the beacon derives `beacon.worker.js` next to the `<script>`\n * tag that loaded `beacon.min.js`, else `/beacon.worker.js` at the site root.\n */\n workerUrl?: string;\n\n /**\n * Worker lifecycle tuning: `initTimeoutMs` (3000), `messageTimeout` (30000),\n * `heartbeatInterval` (5000), `maxRetries` (3), `retryDelay` (1000),\n * `compressionThreshold` (5120), `allowFallback` (true).\n */\n workerConfig?: WorkerConfig;\n\n /**\n * Explicit URL override for the lazy-loaded signals chunk\n * (`beacon-lazy-signals.min.js` — userAgentData, fontPreferences, Client\n * Hints, webrtcCodecs, speechVoices, plus canvas/WebGL/audio/permissions\n * render entropy). Same shape and purpose as `workerUrl`: when unset,\n * checkpoint-beacon derives the chunk's URL from wherever `beacon.min.js`\n * itself was loaded from — see `checkpoint-beacon`'s\n * `src/core/load-lazy-chunk.ts` for the full resolution order.\n */\n lazySignalsUrl?: string;\n}\n\n// ============================================================================\n// BEACON EVENTS\n// ============================================================================\n\nexport interface BeaconEvent {\n /** Event type identifier */\n type: BeaconEventType;\n\n /** Event data payload */\n data: BeaconCollectorData;\n\n /** Event metadata */\n metadata: BeaconMetadata;\n}\n\nexport interface BeaconMetadata {\n /** Session ID */\n sessionId: string;\n\n /** Event timestamp */\n timestamp: number;\n\n /** Optional event name */\n eventName?: string;\n\n /** Present only once the host site has told us who the visitor is. */\n identity?: BeaconIdentity;\n\n /** Allow additional metadata */\n [key: string]: unknown;\n}\n\n// ============================================================================\n// BEACON API\n// ============================================================================\n\nexport interface IAgentShieldBeacon {\n /**\n * Collect a generic event\n */\n collect(eventType: string, data?: BeaconPayload): Promise<void>;\n\n /**\n * Track a custom event\n */\n trackEvent(eventName: string, eventData?: BeaconPayload): Promise<void>;\n\n /**\n * Track a pageview\n */\n trackPageview(pageData?: BeaconPayload): Promise<void>;\n\n /**\n * Track page unload\n */\n trackPageUnload(): Promise<void>;\n\n /**\n * Update configuration\n */\n updateConfig(updates: Partial<BeaconConfig>): void;\n\n /**\n * Destroy the beacon and clean up\n */\n destroy(): Promise<void>;\n}\n\n// ============================================================================\n// RESPONSE TYPES\n// ============================================================================\n\nexport interface BeaconResponse {\n /** Response status */\n status: 'success' | 'error';\n\n /** Optional message */\n message?: string;\n\n /** Optional error details */\n error?: {\n code: string;\n message: string;\n };\n}\n\n// ============================================================================\n// BROWSER CONTEXT\n// ============================================================================\n\nexport interface BrowserContext {\n /** Browser name and version */\n browser: {\n name: string;\n version: string;\n engine: string;\n };\n\n /** Operating system */\n os: {\n name: string;\n version: string;\n };\n\n /** Device information */\n device: {\n type: 'desktop' | 'mobile' | 'tablet' | 'tv' | 'unknown';\n vendor?: string;\n model?: string;\n };\n\n /** Screen information */\n screen: {\n width: number;\n height: number;\n pixelRatio: number;\n colorDepth: number;\n };\n\n /** Connection information */\n connection?: {\n type: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | 'unknown';\n effectiveType?: '2g' | '3g' | '4g' | '5g';\n downlink?: number;\n rtt?: number;\n saveData?: boolean;\n };\n}\n\n// ============================================================================\n// PERFORMANCE METRICS\n// ============================================================================\n\nexport interface PerformanceMetrics {\n /** Page load time in milliseconds */\n pageLoadTime?: number;\n\n /** DOM content loaded time */\n domContentLoadedTime?: number;\n\n /** Time to interactive */\n timeToInteractive?: number;\n\n /** First paint time */\n firstPaintTime?: number;\n\n /** First contentful paint time */\n firstContentfulPaintTime?: number;\n\n /** Largest contentful paint time */\n largestContentfulPaintTime?: number;\n\n /** DNS lookup time */\n dnsLookupTime?: number;\n\n /** TCP connection time */\n tcpConnectionTime?: number;\n\n /** Server response time */\n serverResponseTime?: number;\n\n /** Resource timing */\n resources?: {\n scripts: number;\n stylesheets: number;\n images: number;\n fonts: number;\n total: number;\n };\n}\n\n// ============================================================================\n// SESSION TYPES\n// ============================================================================\n\nexport interface SessionData {\n /** Unique session ID */\n id: string;\n\n /** Session start timestamp */\n startTime: number;\n\n /** Last activity timestamp */\n lastActivity: number;\n\n /** Page view count in session */\n pageViews: number;\n\n /** Event count in session */\n eventCount: number;\n\n /** Session duration in milliseconds */\n duration: number;\n\n /** Is this a new session */\n isNew: boolean;\n}\n\n// ============================================================================\n// TRANSPORT TYPES\n// ============================================================================\n\nexport interface TransportConfig {\n batchSize: number;\n flushInterval: number;\n maxRetries: number;\n retryDelayBase: number;\n offlineQueueSize: number;\n useCompression: boolean;\n compressionThreshold: number;\n networkAdaptation: boolean;\n dedupWindow: number;\n /** Build item 6: carried onto every outgoing `BeaconBatch` — see `BeaconConfig.anonymizeIp`. */\n anonymizeIp?: boolean;\n}\n\nexport interface TransportOptions {\n immediate?: boolean;\n priority?: 'low' | 'normal' | 'high' | 'critical';\n retry?: boolean;\n timeout?: number;\n}\n\nexport interface TransportResponse {\n success: boolean;\n timestamp: number;\n batchId?: string;\n error?: string;\n}\n\nexport type TransportState = 'idle' | 'sending' | 'offline' | 'paused' | 'error';\n\nexport interface TransportMetrics {\n eventsSent: number;\n eventsFailed: number;\n eventsQueued: number;\n batchesSent: number;\n batchesFailed: number;\n bytesTransferred: number;\n compressionRatio?: number;\n averageLatency?: number;\n lastSuccessTimestamp?: number;\n lastErrorTimestamp?: number;\n}\n\nexport interface BatchEvent {\n id: string;\n event: BeaconEvent;\n timestamp: number;\n retryCount: number;\n hash: string;\n priority: 'low' | 'normal' | 'high' | 'critical';\n}\n\nexport type ConnectionType =\n | 'bluetooth'\n | 'cellular'\n | 'ethernet'\n | 'none'\n | 'wifi'\n | 'wimax'\n | 'other'\n | 'unknown';\n\nexport interface NetworkInfo {\n type?: string;\n effectiveType?: string;\n downlink?: number;\n rtt?: number;\n saveData?: boolean;\n}\n\n// ============================================================================\n// WORKER TYPES\n// ============================================================================\n\nexport type MessagePriority = 'low' | 'normal' | 'high' | 'critical';\nexport type WorkerErrorType =\n | 'initialization'\n | 'runtime'\n | 'communication'\n | 'timeout'\n | 'memory'\n | 'network'\n | 'permission'\n | 'validation'\n | 'processing'\n | 'unknown';\nexport type WorkerAction =\n | 'process'\n | 'init'\n | 'terminate'\n | 'pause'\n | 'resume'\n | 'status'\n | 'health';\nexport type WorkerMessageType = 'request' | 'response' | 'error' | 'heartbeat' | 'status';\n\nexport interface WorkerMessage {\n id: string;\n type: 'request' | 'response' | 'error' | 'heartbeat' | 'status';\n action?: string;\n payload?: WorkerPayload;\n timestamp: number;\n compressed?: boolean;\n priority?: MessagePriority;\n correlationId?: string;\n}\n\nexport type WorkerState =\n | 'idle'\n | 'initializing'\n | 'ready'\n | 'processing'\n | 'busy'\n | 'error'\n | 'terminating'\n | 'terminated';\n\nexport type WorkerHealthStatus = 'healthy' | 'degraded' | 'unhealthy' | 'unknown';\n\nexport interface WorkerMetrics {\n tasksProcessed: number;\n tasksFailed: number;\n averageProcessingTime?: number;\n memoryUsage?: number;\n cpuUsage?: number;\n healthStatus: WorkerHealthStatus;\n lastHealthCheck: number;\n restartCount: number;\n errorRate?: number;\n errorCount: number;\n messageQueueSize: number;\n startTime: number;\n uptime: number;\n averageTaskTime?: number;\n lastTaskTime?: number;\n}\n\nexport interface WorkerError {\n type: WorkerErrorType;\n code?: string;\n message: string;\n stack?: string;\n timestamp: number;\n recoverable: boolean;\n retryAfter?: number;\n context?: Record<string, unknown>;\n}\n\nexport interface WorkerCapabilities {\n workerAPI: boolean;\n sharedArrayBuffer: boolean;\n transferableObjects: boolean;\n offscreenCanvas: boolean;\n webAssembly: boolean;\n atomics: boolean;\n bigInt: boolean;\n csp: {\n workerSrc: boolean;\n scriptSrc: boolean;\n blobUrls: boolean;\n inlineWorkers: boolean;\n };\n performance: {\n memory: boolean;\n measureUserAgentSpecificMemory: boolean;\n };\n}\n\nexport interface WorkerTask {\n id: string;\n type: string;\n data: WorkerPayload;\n priority: 'low' | 'normal' | 'high' | 'critical';\n createdAt: number;\n startedAt?: number;\n completedAt?: number;\n error?: WorkerError;\n maxRetries?: number;\n retries?: number;\n timeout?: number;\n}\n\nexport interface FallbackOptions {\n useRequestIdleCallback: boolean;\n idleTimeout: number;\n chunkSize: number;\n throttleMs: number;\n maxExecutionTime: number;\n}\n\nexport interface ResourceUsage {\n memory: {\n used: number;\n limit: number;\n percentage: number;\n };\n cpu: {\n usage: number;\n limit: number;\n };\n tasks: {\n pending: number;\n active: number;\n completed: number;\n failed: number;\n };\n activeWorkers: number;\n}\n\nexport interface WorkerPoolConfig {\n maxWorkers: number;\n minWorkers: number;\n workerIdleTimeout: number;\n taskQueueSize: number;\n resourceLimits: Record<string, number>;\n autoScale?: boolean;\n scaleUpThreshold?: number;\n scaleDownThreshold?: number;\n}\n\nexport type BeaconWorkerMessageType =\n | 'init'\n | 'collect'\n | 'flush'\n | 'config'\n | 'status'\n | 'error'\n | 'response'\n // Unsolicited worker -> main relay of a 202 ingest body (posture cookie\n // delivery needs `document`, which the worker lacks).\n | 'posture';\nexport type ProtocolVersion = '1.0' | '1.1' | '2.0';\n\nexport interface BeaconWorkerMessage {\n type: BeaconWorkerMessageType;\n data?: WorkerPayload;\n payload?: WorkerPayload;\n messageId: string;\n timestamp: number;\n id: string;\n}\n\nexport interface WorkerConfig {\n enabled?: boolean;\n url?: string;\n heartbeatInterval?: number;\n maxUnhealthyCount?: number;\n maxRetries?: number;\n retryDelay?: number;\n restartDelay?: number;\n messageTimeout?: number;\n compressionThreshold?: number;\n allowFallback?: boolean;\n crossOriginIsolated?: boolean;\n maxRestartAttempts?: number;\n terminationTimeout?: number;\n taskTimeout?: number;\n fallbackDelay?: number;\n enableFallback?: boolean;\n /**\n * Hard ceiling on how long worker startup (script load + init handshake)\n * gets before the caller gives up and falls back to the main-thread\n * transport. Deliberately separate from `taskTimeout`/`messageTimeout`\n * (which govern steady-state message round trips once the worker is\n * already up): a slow or hung worker script would otherwise hold up\n * every event for the full 30s message timeout before anything left the\n * page. A few seconds is enough for a healthy worker to load and answer\n * its init message; anything slower isn't worth waiting on.\n */\n initTimeoutMs?: number;\n}\n\n// ============================================================================\n// CIRCUIT BREAKER & RETRY\n// ============================================================================\n\nexport interface CircuitBreakerConfig {\n threshold: number;\n timeout: number;\n resetTimeout: number;\n}\n\nexport type CircuitBreakerState = 'closed' | 'open' | 'half-open';\n\nexport interface RetryStrategy {\n maxAttempts: number;\n baseDelay: number;\n maxDelay: number;\n factor: number;\n jitter: boolean;\n}\n\n// ============================================================================\n// OFFLINE QUEUE\n// ============================================================================\n\nexport interface OfflineQueueEntry {\n id: string;\n events: BeaconEvent[];\n timestamp: number;\n expiresAt: number;\n retryCount: number;\n size: number;\n}\n\n// ============================================================================\n// BEACON BATCH\n// ============================================================================\n\nexport interface BeaconBatch {\n projectId: string;\n events: BeaconEvent[];\n sessionId: string;\n batchId: string;\n timestamp: number;\n /** Build item 6: mirrors `BeaconConfig.anonymizeIp` (default `false`) — see the beacon route's own doc comment. */\n anonymizeIp?: boolean;\n /** Nonce-bound ingest (build item 5): the value from the prior 202 response's `nonce`. */\n nonce?: string;\n /** Nonce-bound ingest (build item 5): declares this client echoes nonces — see checkpoint-beacon's `BeaconBatch`. */\n nonceEcho?: boolean;\n}\n\nexport interface BeaconCollectorData {\n // Browser collector data\n userAgent?: string;\n language?: string;\n platform?: string;\n screenResolution?: string;\n viewport?: string;\n cookiesEnabled?: boolean;\n doNotTrack?: boolean;\n timezone?: string;\n referrer?: string;\n url?: string;\n title?: string;\n vendor?: string;\n\n // Performance collector data\n pageLoadTime?: number;\n domContentLoadedTime?: number;\n firstPaintTime?: number;\n firstContentfulPaintTime?: number;\n connectionType?: string;\n\n // Session data\n sessionId?: string;\n timestamp?: number;\n\n // Allow additional properties\n [key: string]: unknown;\n}\n\nexport type BeaconEventType =\n | 'pageview'\n | 'pageunload'\n | 'heartbeat'\n | 'custom'\n | 'error'\n | 'performance';\n\n// ============================================================================\n// PARSER FUNCTIONS\n// ============================================================================\n\nexport function parseRetryStrategy(input: unknown): RetryStrategy {\n const strategy = toRecord(input);\n return {\n maxAttempts: numberOr(strategy.maxAttempts, 3),\n baseDelay: numberOr(strategy.baseDelay, 1000),\n maxDelay: numberOr(strategy.maxDelay, 30000),\n factor: numberOr(strategy.factor, 2),\n jitter: strategy.jitter !== false,\n };\n}\n\nexport function parseCircuitBreakerConfig(input: unknown): CircuitBreakerConfig {\n const config = toRecord(input);\n return {\n threshold: numberOr(config.threshold, 5),\n timeout: numberOr(config.timeout, 60000),\n resetTimeout: numberOr(config.resetTimeout, 30000),\n };\n}\n\nexport function parseOfflineQueueEntry(input: unknown): OfflineQueueEntry {\n if (!isRecord(input)) {\n throw new Error('Invalid offline queue entry');\n }\n\n const entry = input;\n return {\n id: stringOr(entry.id, `${Date.now()}_${Math.random().toString(36).substr(2, 9)}`)!,\n events: Array.isArray(entry.events) ? (entry.events as BeaconEvent[]) : [],\n timestamp: numberOr(entry.timestamp, Date.now()),\n expiresAt: numberOr(entry.expiresAt, Date.now() + 86400000), // 24 hours\n retryCount: numberOr(entry.retryCount, 0),\n size: numberOr(entry.size, 0),\n };\n}\n\nexport function parseBeaconWorkerMessage(input: unknown): BeaconWorkerMessage {\n if (!isRecord(input)) {\n throw new Error('Invalid beacon worker message');\n }\n\n const msg = input;\n const messageId = stringOr(msg.messageId) ?? stringOr(msg.id) ?? crypto.randomUUID();\n return {\n type: isBeaconWorkerMessageType(msg.type) ? msg.type : 'init',\n data: msg.data,\n payload: msg.payload,\n messageId,\n timestamp: numberOr(msg.timestamp, Date.now()),\n id: stringOr(msg.id, messageId)!,\n };\n}\n\nfunction isMessagePriority(value: unknown): value is MessagePriority {\n return value === 'low' || value === 'normal' || value === 'high' || value === 'critical';\n}\n\nfunction isWorkerMessageType(value: unknown): value is WorkerMessageType {\n return (\n value === 'request' ||\n value === 'response' ||\n value === 'error' ||\n value === 'heartbeat' ||\n value === 'status'\n );\n}\n\nfunction isWorkerErrorType(value: unknown): value is WorkerErrorType {\n return (\n value === 'initialization' ||\n value === 'runtime' ||\n value === 'communication' ||\n value === 'timeout' ||\n value === 'memory' ||\n value === 'network' ||\n value === 'permission' ||\n value === 'validation' ||\n value === 'processing' ||\n value === 'unknown'\n );\n}\n\nexport function parseWorkerMessage(input: unknown): WorkerMessage {\n const msg = (input && typeof input === 'object' ? input : null) as Partial<WorkerMessage> | null;\n if (!msg) {\n throw new Error('Invalid worker message');\n }\n\n return {\n id: msg.id || crypto.randomUUID(),\n type: isWorkerMessageType(msg.type) ? msg.type : 'request',\n action: msg.action,\n payload: msg.payload,\n timestamp: msg.timestamp || Date.now(),\n compressed: msg.compressed,\n priority: isMessagePriority(msg.priority) ? msg.priority : 'normal',\n correlationId: msg.correlationId,\n };\n}\n\nexport function parseWorkerError(input: unknown): WorkerError {\n const error = (input && typeof input === 'object' ? input : {}) as Partial<WorkerError>;\n return {\n type: isWorkerErrorType(error.type) ? error.type : 'unknown',\n code: typeof error.code === 'string' ? error.code : undefined,\n message: typeof error.message === 'string' ? error.message : 'Worker error',\n stack: typeof error.stack === 'string' ? error.stack : undefined,\n timestamp: typeof error.timestamp === 'number' ? error.timestamp : Date.now(),\n recoverable: error.recoverable !== false,\n retryAfter: typeof error.retryAfter === 'number' ? error.retryAfter : undefined,\n context: error.context,\n };\n}\n\nexport function parseWorkerPoolConfig(input: unknown): WorkerPoolConfig {\n const config = (input && typeof input === 'object' ? input : {}) as Partial<WorkerPoolConfig>;\n return {\n maxWorkers: config.maxWorkers ?? 4,\n minWorkers: config.minWorkers ?? 1,\n workerIdleTimeout: config.workerIdleTimeout ?? 30000,\n taskQueueSize: config.taskQueueSize ?? 100,\n resourceLimits: config.resourceLimits ?? {},\n autoScale: config.autoScale ?? true,\n scaleUpThreshold: config.scaleUpThreshold ?? 75,\n scaleDownThreshold: config.scaleDownThreshold ?? 25,\n };\n}\n\nexport function parseResourceUsage(input: unknown): ResourceUsage {\n const usage = (input && typeof input === 'object' ? input : {}) as Partial<ResourceUsage>;\n return {\n memory: usage.memory ?? { used: 0, limit: 0, percentage: 0 },\n cpu: usage.cpu ?? { usage: 0, limit: 100 },\n tasks: usage.tasks ?? { pending: 0, active: 0, completed: 0, failed: 0 },\n activeWorkers: usage.activeWorkers ?? 0,\n };\n}\n\nexport const ResourceUsageSchema = {\n parse: parseResourceUsage,\n};\n\nexport const WorkerPoolConfigSchema = {\n parse: parseWorkerPoolConfig,\n};\n\nexport function parseWorkerCapabilities(input: unknown): WorkerCapabilities {\n const cap = toRecord(input);\n const csp = toRecord(cap.csp);\n const performance = toRecord(cap.performance);\n\n return {\n workerAPI: cap.workerAPI !== false,\n sharedArrayBuffer: cap.sharedArrayBuffer === true,\n transferableObjects: cap.transferableObjects === true,\n offscreenCanvas: cap.offscreenCanvas === true,\n webAssembly: cap.webAssembly === true,\n atomics: cap.atomics === true,\n bigInt: cap.bigInt === true,\n csp: {\n workerSrc: csp.workerSrc === true,\n scriptSrc: csp.scriptSrc === true,\n blobUrls: csp.blobUrls === true,\n inlineWorkers: csp.inlineWorkers === true,\n },\n performance: {\n memory: performance.memory === true,\n measureUserAgentSpecificMemory: performance.measureUserAgentSpecificMemory === true,\n },\n };\n}\n\nexport function parseBeaconConfig(input: unknown): BeaconConfig {\n const config = toRecord(input);\n\n if (typeof config.projectId !== 'string' || config.projectId.length === 0) {\n throw new Error('Project ID is required');\n }\n\n return {\n projectId: config.projectId,\n environment: stringOr(config.environment),\n tags: isBeaconTags(config.tags) ? config.tags : undefined,\n identity: isBeaconIdentity(config.identity) ? config.identity : undefined,\n // `parseBeaconConfig` is an allowlist: a key it does not name is dropped\n // silently, which is how `identity` first shipped inert.\n endpoint: stringOr(config.endpoint),\n enabled: config.enabled !== false,\n debug: config.debug === true,\n logLevel: isLogLevel(config.logLevel) ? config.logLevel : 'error',\n respectDoNotTrack: config.respectDoNotTrack !== false,\n anonymizeIp: config.anonymizeIp === true,\n stripUrlFragment: config.stripUrlFragment !== false,\n scrubQueryParams: isStringArray(config.scrubQueryParams) ? config.scrubQueryParams : undefined,\n dropQueryParams: config.dropQueryParams === true,\n sessionTimeout: numberOr(config.sessionTimeout, 1800000), // 30 minutes\n sessionCookieName: stringOr(config.sessionCookieName, '_as_beacon_session'),\n batchSize: numberOr(config.batchSize, 10),\n flushInterval: numberOr(config.flushInterval, 5000),\n // 1600ms — see packages/checkpoint-beacon/src/budget/thresholds.ts\n // (MAX_PER_SOURCE_DEADLINE_MS) for the full measurement-backed rationale;\n // sized to sit just above the vendored FingerprintJS pipeline's own\n // already-ratified 1500ms TOTAL_COLLECTION_BUDGET_MS\n // (collectors/entropy/vendored-fingerprint.ts), so a future collector\n // wrapping that pipeline gets to use its own internal timeout instead\n // of being truncated one layer up before it fires. Keep these two\n // literals in sync; checkpoint-shared can't import from\n // checkpoint-beacon (wrong direction of the package dependency graph).\n collectorDeadlineMs: numberOr(config.collectorDeadlineMs, 1600),\n maxQueueSize: numberOr(config.maxQueueSize, 100),\n retryAttempts: numberOr(config.retryAttempts, 3),\n retryDelay: numberOr(config.retryDelay, 2000),\n postureRetryScheduleMs: isPositiveNumberArray(config.postureRetryScheduleMs)\n ? config.postureRetryScheduleMs\n : undefined,\n useWorker: resolveUseWorker(config),\n workerUrl: stringOr(config.workerUrl),\n workerConfig: isRecord(config.workerConfig) ? (config.workerConfig as WorkerConfig) : undefined,\n lazySignalsUrl: stringOr(config.lazySignalsUrl),\n };\n}\n\n// ============================================================================\n// EXPORT MAIN CLASS TYPE\n// ============================================================================\n\nexport declare class AgentShieldBeacon implements IAgentShieldBeacon {\n constructor(config: BeaconConfig);\n collect(eventType: string, data?: BeaconPayload): Promise<void>;\n trackEvent(eventName: string, eventData?: BeaconPayload): Promise<void>;\n trackPageview(pageData?: BeaconPayload): Promise<void>;\n trackPageUnload(): Promise<void>;\n updateConfig(updates: Partial<BeaconConfig>): void;\n destroy(): Promise<void>;\n}\n"],"mappings":";AAgBA,SAAS,SAAS,OAAwC;CACxD,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,SAAS,OAA+B;CAC/C,OAAO,SAAS,KAAK,IAAI,QAAQ,CAAC;AACpC;AAEA,SAAS,SAAS,OAAgB,UAA0B;CAC1D,OAAO,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,UAAU,IAAI,QAAQ;AACtF;AAEA,SAAS,SAAS,OAAgB,UAAuC;CACvE,OAAO,OAAO,UAAU,WAAW,QAAQ;AAC7C;AAEA,SAAS,cAAc,OAAmC;CACxD,OAAO,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAO,UAAU,OAAO,UAAU,QAAQ;AACjF;;;;;;AAOA,SAAS,sBAAsB,OAAmC;CAChE,OACE,MAAM,QAAQ,KAAK,KACnB,MAAM,SAAS,KACf,MAAM,OAAO,UAAU,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,QAAQ,CAAC;AAE3F;AAEA,SAAS,aAAa,OAAoE;CACxF,OACE,SAAS,KAAK,KACd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AkB,OAAO,qBAAqB;EAC9C,kBAAkB,cAAc,OAAO,gBAAgB,IAAI,OAAO,mBAAmB;EACrF,iBAAiB,OAAO,oBAAoB;EAC5C,gBAAgB,SAAS,OAAO,gBAAgB,IAAO;EACvD,mBAAmB,SAAS,OAAO,mBAAmB,oBAAoB;EAC1E,WAAW,SAAS,OAAO,WAAW,EAAE;EACxC,eAAe,SAAS,OAAO,eAAe,GAAI;EAUlD,qBAAqB,SAAS,OAAO,qBAAqB,IAAI;EAC9D,cAAc,SAAS,OAAO,cAAc,GAAG;EAC/C,eAAe,SAAS,OAAO,eAAe,CAAC;EAC/C,YAAY,SAAS,OAAO,YAAY,GAAI;EAC5C,wBAAwB,sBAAsB,OAAO,sBAAsB,IACvE,OAAO,yBACP;EACJ,WAAW,iBAAiB,MAAM;EAClC,WAAW,SAAS,OAAO,SAAS;EACpC,cAAc,SAAS,OAAO,YAAY,IAAK,OAAO,eAAgC;EACtF,gBAAgB,SAAS,OAAO,cAAc;CAChD;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-posture-cookie-Dmq9Brf_.d.mts","names":[],"sources":["../src/browser-posture-cookie.ts"],"mappings":";iBAgBgB,kBAAkB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-posture-cookie-Dmq9Brf_.d.ts","names":[],"sources":["../src/browser-posture-cookie.ts"],"mappings":";iBAgBgB,kBAAkB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function t(t){if(!e.test(t)||t!==t.toLowerCase())throw Error(`Invalid posture project id`);return`__Host-checkpoint_posture_${t}`}exports.postureCookieName=t;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function t(t){if(!e.test(t)||t!==t.toLowerCase())throw Error(`Invalid posture project id`);return`__Host-checkpoint_posture_${t}`}export{t as postureCookieName};
|
|
2
|
+
//# sourceMappingURL=browser-posture-cookie.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-posture-cookie.mjs","names":[],"sources":["../src/constants/patterns.ts","../src/browser-posture-cookie.ts"],"sourcesContent":["/**\n * Regular Expression Patterns\n *\n * Common regex patterns used for validation and detection\n */\n\n/**\n * Validation Patterns\n */\n// Hoisted out of the object literal below so bundle-size-critical leaves can\n// import JUST this one pattern. `VALIDATION_PATTERNS` re-exports it, so there\n// is still exactly one definition and no drift.\n//\n// Why it matters: rolldown (via tsdown) does not do property-level DCE on a\n// const object literal the way esbuild did. `browser-posture-cookie.ts` uses\n// only `.UUID`, but importing the whole object dragged every pattern —\n// ULID, SLUG, IPV4, IPV6 — into that leaf, taking it from 272 to 2,870 bytes.\n// The beacon inlines that leaf (`noExternal`), which pushed its gzipped\n// bundle from 29,337 to 30,123 against a 29,696-byte CI budget.\n//\n// UUID pattern: accepts versions 0-5 (0 is nil UUID, 1-5 are standard versions)\n// Variants: 0 (nil), 8-9-a-b (standard variants)\nexport const UUID_PATTERN =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n\nexport const VALIDATION_PATTERNS = {\n // Identifiers\n UUID: UUID_PATTERN,\n ULID: /^[0-9A-HJKMNP-TV-Z]{26}$/,\n SLUG: /^[a-z0-9]+(?:-[a-z0-9]+)*$/,\n\n // Network\n IPV4: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,\n IPV6: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0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/,\n // eslint-disable-next-line no-useless-escape\n // CIDR pattern: uses IPV4 pattern and restricts mask to 0-32\n CIDR: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\/(?:[0-9]|[12][0-9]|3[0-2])$/,\n // eslint-disable-next-line no-useless-escape\n DOMAIN: /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i,\n HOSTNAME:\n /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/,\n // eslint-disable-next-line no-useless-escape\n URL: /^https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)$/,\n\n // Contact\n // Email pattern: stricter validation (rejects consecutive dots, requires TLD)\n // Local part: alphanumeric start/end, dots allowed but not consecutive\n EMAIL:\n /^[a-zA-Z0-9](?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]|\\.(?!\\.))*[a-zA-Z0-9]?@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/,\n PHONE: /^[+]?[(]?[0-9]{3}[)]?[-\\s.]?[0-9]{3}[-\\s.]?[0-9]{4,6}$/,\n\n // Security\n // JWT pattern: requires 3 parts (header.payload.signature) - signature cannot be empty\n JWT: /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+$/,\n // eslint-disable-next-line no-useless-escape\n BASE64: /^[A-Za-z0-9+\\/]*={0,2}$/,\n HEX: /^[0-9a-fA-F]+$/,\n MD5: /^[a-f0-9]{32}$/i,\n SHA1: /^[a-f0-9]{40}$/i,\n SHA256: /^[a-f0-9]{64}$/i,\n\n // Versions\n SEMVER:\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/,\n\n // Files\n FILENAME: /^[a-zA-Z0-9](?:[a-zA-Z0-9 ._-]*[a-zA-Z0-9])?\\.[a-zA-Z0-9_-]+$/,\n PATH: /^(\\/[^/ ]*)+\\/?$/,\n\n // Keys\n API_KEY: /^[A-Za-z0-9_-]{32,}$/,\n SECRET_KEY: /^[A-Za-z0-9_-]{64,}$/,\n PIXEL_ID: /^px_[A-Za-z0-9]{16}$/,\n} as const;\n\n/**\n * User Agent Patterns for Agent Detection\n */\nexport const USER_AGENT_PATTERNS = {\n // AI Agents\n OPENAI: /(?:GPTBot|ChatGPT-User|OpenAI)/i,\n ANTHROPIC: /(?:Claude-Web|Claude-User|anthropic-ai|claude-web|claude-user|ClaudeBot)/i,\n PERPLEXITY: /(?:PerplexityBot|Perplexica)/i,\n GOOGLE_AI: /(?:Google-Extended|Bard|Google-InspectionTool)/i,\n MICROSOFT_AI: /(?:BingPreview\\/.*ChatGPT|Copilot)/i,\n\n // Search Bots\n GOOGLEBOT: /Googlebot/i,\n BINGBOT: /(?:bingbot|BingPreview|msnbot)/i,\n DUCKDUCKBOT: /DuckDuckBot/i,\n BAIDUBOT: /Baiduspider/i,\n YANDEXBOT: /YandexBot/i,\n\n // Social Media Bots\n FACEBOOK: /(?:facebookexternalhit|facebookcatalog)/i,\n TWITTER: /(?:Twitterbot|TwitterImageProxy)/i,\n LINKEDIN: /LinkedInBot/i,\n WHATSAPP: /WhatsApp/i,\n TELEGRAM: /TelegramBot/i,\n DISCORD: /Discordbot/i,\n SLACK: /Slackbot/i,\n\n // Crawlers and Scrapers\n GENERIC_BOT: /(?:bot|crawler|spider|scraper|agent)/i,\n SCRAPY: /Scrapy/i,\n PUPPETEER: /(?:HeadlessChrome|Puppeteer)/i,\n PLAYWRIGHT: /Playwright/i,\n SELENIUM: /(?:selenium|webdriver)/i,\n\n // Development Tools\n POSTMAN: /PostmanRuntime/i,\n INSOMNIA: /insomnia/i,\n CURL: /curl/i,\n WGET: /Wget/i,\n HTTPIE: /HTTPie/i,\n\n // Monitoring Services\n UPTIMEROBOT: /UptimeRobot/i,\n PINGDOM: /Pingdom/i,\n NEWRELIC: /NewRelicPinger/i,\n DATADOG: /Datadog/i,\n} as const;\n\n/**\n * Header Patterns for Agent Detection\n */\nexport const HEADER_PATTERNS = {\n // AI-specific headers\n AI_HEADERS: /^(?:X-(?:OpenAI|Anthropic|AI|Bot|Agent|LLM))/i,\n\n // Automation headers\n AUTOMATION_HEADERS: /^(?:X-(?:Automated|Robot|Crawler|Scraper))/i,\n\n // Missing standard headers\n MISSING_ACCEPT: /^$/,\n MISSING_ACCEPT_LANGUAGE: /^$/,\n MISSING_ACCEPT_ENCODING: /^$/,\n\n // Suspicious patterns\n GENERIC_ACCEPT: /^\\*\\/\\*$/,\n NO_COOKIES: /^$/,\n\n // Known proxy headers\n PROXY_HEADERS: /^(?:X-Forwarded-|X-Real-IP|X-Originating-IP|Via|Forwarded)/i,\n\n // Cloud provider headers\n CLOUD_HEADERS: /^(?:X-(?:AWS|Azure|GCP|Cloudflare))/i,\n} as const;\n\n/**\n * Browser Patterns\n */\nexport const BROWSER_PATTERNS = {\n CHROME: /Chrome\\/([0-9.]+)/,\n FIREFOX: /Firefox\\/([0-9.]+)/,\n SAFARI: /Version\\/([0-9.]+).*Safari/,\n EDGE: /Edg\\/([0-9.]+)/,\n OPERA: /OPR\\/([0-9.]+)/,\n IE: /MSIE ([0-9.]+)/,\n} as const;\n\n/**\n * Operating System Patterns\n */\nexport const OS_PATTERNS = {\n WINDOWS: /Windows NT ([0-9.]+)/,\n MACOS: /Mac OS X ([0-9_]+)/,\n LINUX: /Linux/,\n ANDROID: /Android ([0-9.]+)/,\n IOS: /OS ([0-9_]+) like Mac OS X/,\n} as const;\n\n/**\n * Mobile Device Patterns\n */\nexport const MOBILE_PATTERNS = {\n MOBILE: /(?:Mobile|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini)/i,\n TABLET: /(?:iPad|Android.*Tablet|Tablet.*Android|Kindle|Silk)/i,\n DESKTOP: /(?:Windows NT|Mac OS X|Linux|CrOS)/i,\n} as const;\n\n/**\n * Suspicious Behavior Patterns\n */\nexport const SUSPICIOUS_PATTERNS = {\n // Rapid requests\n RAPID_REQUESTS: /^[0-9]{1,3}$/,\n\n // Sequential access\n SEQUENTIAL_URLS: /\\?(?:page|offset|id)=[0-9]+/,\n\n // Data extraction\n API_ENDPOINTS: /\\/api\\/|\\.json$|\\.xml$/i,\n\n // Form submission without interaction\n DIRECT_POST: /^POST$/,\n\n // Known attack patterns\n SQL_INJECTION:\n /(?:union|select|insert|update|delete|drop|create|alter|exec|script|javascript|onerror|onload|eval|src=)/i,\n XSS_ATTEMPT: /(?:<script|javascript:|onerror=|onclick=|<iframe|<embed|<object)/i,\n PATH_TRAVERSAL: /(?:\\.\\.\\/|\\.\\.\\\\|%2e%2e%2f|%252e%252e%252f)/i,\n\n // Encoding attempts\n URL_ENCODED: /%[0-9a-f]{2}/i,\n BASE64_DATA: /data:[^;]+;base64,/i,\n} as const;\n\n/**\n * Maximum input length for pattern matching. UAs, header values, and\n * detection payloads are bounded in practice (<4KB even for the most\n * verbose Chrome/Firefox UAs). Caps worst-case complexity for any\n * polynomial-shaped pattern an external caller might supply to\n * `testPattern` / `extractMatch`; CodeQL flagged the unbounded path\n * (js/polynomial-redos) on PR #2576.\n */\nconst MAX_PATTERN_INPUT_LENGTH = 4096;\n\n/**\n * Helper function to test a pattern. Returns `false` on inputs longer\n * than {@link MAX_PATTERN_INPUT_LENGTH} — an abuse signal we'd rather\n * reject than process.\n */\nexport function testPattern(pattern: RegExp, value: string): boolean {\n if (value.length > MAX_PATTERN_INPUT_LENGTH) return false;\n return pattern.test(value);\n}\n\n/**\n * Helper function to extract match from pattern. Returns `null` on\n * over-long inputs (same ReDoS defense as `testPattern`).\n */\nexport function extractMatch(pattern: RegExp, value: string): string | null {\n if (value.length > MAX_PATTERN_INPUT_LENGTH) return null;\n const match = value.match(pattern);\n return match ? match[1] || match[0] : null;\n}\n\n/**\n * Helper function to test multiple patterns\n */\nexport function testPatterns(patterns: RegExp[], value: string): boolean {\n return patterns.some((pattern) => testPattern(pattern, value));\n}\n\n/**\n * Helper function to find matching pattern\n */\nexport function findMatchingPattern(\n patterns: Record<string, RegExp>,\n value: string\n): string | null {\n for (const [name, pattern] of Object.entries(patterns)) {\n if (testPattern(pattern, value)) {\n return name;\n }\n }\n return null;\n}\n","// Imports the single hoisted pattern, not the whole `VALIDATION_PATTERNS`\n// object — same definition, but it keeps this leaf actually dependency-free\n// under rolldown, which does not property-shake object literals.\nimport { UUID_PATTERN } from './constants/patterns';\n\n/**\n * The browser-posture cookie name. Kept in its own dependency-free leaf so the\n * beacon (bundle-size budgeted, no `jose`) derives the name from the SAME\n * function every SDK reader uses via `./browser-posture`; two independent\n * derivations of this name is exactly the drift that dropped the cookie.\n *\n * The lowercase UUID only: the issuer signs `project_id` as the database's\n * lowercase project UUID and cookie names compare case-sensitively, so a\n * friendly id, or the same UUID in upper case, can never name a cookie a\n * reader will look for.\n */\nexport function postureCookieName(projectId: string): string {\n if (!UUID_PATTERN.test(projectId) || projectId !== projectId.toLowerCase())\n throw new Error('Invalid posture project id');\n return `__Host-checkpoint_posture_${projectId}`;\n}\n"],"mappings":"AAsBA,MAAa,EACX,8ECPF,SAAgB,EAAkB,EAA2B,CAC3D,GAAI,CAAC,EAAa,KAAK,CAAS,GAAK,IAAc,EAAU,YAAY,EACvE,MAAU,MAAM,4BAA4B,EAC9C,MAAO,6BAA6B,GACtC"}
|