@kya-os/checkpoint-shared 1.8.0 → 1.9.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 +37 -0
- package/dist/agent-catalog.d.mts +12 -0
- package/dist/agent-catalog.d.mts.map +1 -0
- package/dist/agent-catalog.d.ts +12 -0
- package/dist/agent-catalog.d.ts.map +1 -0
- package/dist/agent-catalog.js +105 -0
- package/dist/agent-catalog.mjs +105 -0
- package/dist/agent-catalog.mjs.map +1 -0
- package/dist/beacon-types/index.d.mts +18 -0
- package/dist/beacon-types/index.d.mts.map +1 -1
- package/dist/beacon-types/index.d.ts +18 -0
- package/dist/beacon-types/index.d.ts.map +1 -1
- package/dist/beacon-types/index.js +116 -12
- package/dist/beacon-types/index.mjs +105 -13
- package/dist/beacon-types/index.mjs.map +1 -1
- package/dist/browser-posture-5fPrsxx7.d.mts.map +1 -1
- package/dist/browser-posture-CCR1kh5e.d.ts.map +1 -1
- package/dist/browser-posture-cookie.js +1 -1
- package/dist/browser-posture-cookie.mjs +1 -1
- package/dist/browser-posture-cookie.mjs.map +1 -1
- package/dist/browser-posture-proof-verifier-DvsOmFrM.js +202 -0
- package/dist/browser-posture-proof-verifier-I0HP2Ics.mjs +180 -0
- package/dist/browser-posture-proof-verifier-I0HP2Ics.mjs.map +1 -0
- package/dist/browser-posture-proof-verifier.d.mts +25 -0
- package/dist/browser-posture-proof-verifier.d.mts.map +1 -0
- package/dist/browser-posture-proof-verifier.d.ts +25 -0
- package/dist/browser-posture-proof-verifier.d.ts.map +1 -0
- package/dist/browser-posture-proof-verifier.js +7 -0
- package/dist/browser-posture-proof-verifier.mjs +3 -0
- package/dist/browser-posture-proof.d.mts +3 -18
- package/dist/browser-posture-proof.d.mts.map +1 -1
- package/dist/browser-posture-proof.d.ts +3 -18
- package/dist/browser-posture-proof.d.ts.map +1 -1
- package/dist/browser-posture-proof.js +6 -131
- package/dist/browser-posture-proof.mjs +1 -126
- package/dist/browser-posture-proof.mjs.map +1 -1
- package/dist/browser-posture.js +1 -1
- package/dist/browser-posture.mjs +1 -1
- package/dist/browser-posture.mjs.map +1 -1
- package/dist/browser.d.mts +0 -282
- package/dist/browser.d.mts.map +1 -1
- package/dist/browser.d.ts +0 -282
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +1 -1
- package/dist/browser.mjs +1 -1
- package/dist/browser.mjs.map +1 -1
- package/dist/canonical-signer/index.mjs.map +1 -1
- package/dist/consent-handoff.d.mts +0 -3
- package/dist/consent-handoff.d.mts.map +1 -1
- package/dist/consent-handoff.d.ts +0 -3
- package/dist/consent-handoff.d.ts.map +1 -1
- package/dist/consent-handoff.mjs.map +1 -1
- package/dist/default-sign-in-host.d.mts +10 -0
- package/dist/default-sign-in-host.d.mts.map +1 -0
- package/dist/default-sign-in-host.d.ts +10 -0
- package/dist/default-sign-in-host.d.ts.map +1 -0
- package/dist/default-sign-in-host.js +72 -0
- package/dist/default-sign-in-host.mjs +66 -0
- package/dist/default-sign-in-host.mjs.map +1 -0
- package/dist/errors/index.d.mts +1 -0
- package/dist/errors/index.d.mts.map +1 -1
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +5 -2
- package/dist/errors/index.mjs +5 -2
- package/dist/errors/index.mjs.map +1 -1
- package/dist/{fetcher-CivUCbhL.d.ts → fetcher-C8qvwdnA.d.ts} +2 -2
- package/dist/{fetcher-CivUCbhL.d.ts.map → fetcher-C8qvwdnA.d.ts.map} +1 -1
- package/dist/{fetcher-cXQsbm6s.d.mts → fetcher-D2vjr7jB.d.mts} +2 -2
- package/dist/{fetcher-cXQsbm6s.d.mts.map → fetcher-D2vjr7jB.d.mts.map} +1 -1
- package/dist/gateway-client-ip.d.mts +0 -2
- package/dist/gateway-client-ip.d.mts.map +1 -1
- package/dist/gateway-client-ip.d.ts +0 -2
- package/dist/gateway-client-ip.d.ts.map +1 -1
- package/dist/gateway-client-ip.mjs.map +1 -1
- package/dist/host-adapter/index.d.mts +1 -1
- package/dist/host-adapter/index.d.ts +1 -1
- package/dist/host-adapter/index.js +1 -1
- package/dist/host-adapter/index.mjs +1 -1
- package/dist/{host-adapter-DHyISsIf.mjs → host-adapter-BKdQHwbi.mjs} +2 -2
- package/dist/{host-adapter-DHyISsIf.mjs.map → host-adapter-BKdQHwbi.mjs.map} +1 -1
- package/dist/{host-adapter-0F8EpbD6.js → host-adapter-bWftXA9T.js} +1 -1
- package/dist/{index-CXbOY7gB.d.ts → index-DnFsmr_o.d.ts} +3 -3
- package/dist/{index-CXbOY7gB.d.ts.map → index-DnFsmr_o.d.ts.map} +1 -1
- package/dist/{index-B3cHxr3O.d.mts → index-rvw5Bz-r.d.mts} +3 -3
- package/dist/{index-B3cHxr3O.d.mts.map → index-rvw5Bz-r.d.mts.map} +1 -1
- package/dist/index.d.mts +94 -449
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +94 -449
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -455
- package/dist/index.mjs +17 -422
- package/dist/index.mjs.map +1 -1
- package/dist/{kya-http-error-codes-UYb1zpGM.js → kya-http-error-codes-B4rUmUEI.js} +2 -0
- package/dist/{kya-http-error-codes-7ewV5RuK.d.ts → kya-http-error-codes-C14E4gi3.d.mts} +2 -1
- package/dist/kya-http-error-codes-C14E4gi3.d.mts.map +1 -0
- package/dist/{kya-http-error-codes-7ewV5RuK.d.mts → kya-http-error-codes-C14E4gi3.d.ts} +2 -1
- package/dist/kya-http-error-codes-C14E4gi3.d.ts.map +1 -0
- package/dist/{kya-http-error-codes-C2JiWPsi.mjs → kya-http-error-codes-DSBrxNry.mjs} +3 -1
- package/dist/kya-http-error-codes-DSBrxNry.mjs.map +1 -0
- package/dist/kya-http.d.mts +1 -1
- package/dist/kya-http.d.ts +1 -1
- package/dist/kya-http.js +1 -1
- package/dist/kya-http.mjs +1 -1
- package/dist/mcpi/dashboard-config/index.d.mts.map +1 -1
- package/dist/mcpi/dashboard-config/index.d.ts.map +1 -1
- package/dist/mcpi/dashboard-config/index.mjs.map +1 -1
- package/dist/{patterns-B2r7M9wR.js → patterns-CiMpbdAF.js} +1 -1
- package/dist/{patterns-B7dQoeE3.mjs → patterns-D4OAsNQY.mjs} +2 -2
- package/dist/{patterns-B7dQoeE3.mjs.map → patterns-D4OAsNQY.mjs.map} +1 -1
- package/dist/patterns.js +1 -1
- package/dist/patterns.mjs +1 -1
- package/dist/policy/fetcher.d.mts +1 -1
- package/dist/policy/fetcher.d.ts +1 -1
- package/dist/policy/schemas.d.mts +1 -1
- package/dist/policy/schemas.d.ts +1 -1
- package/dist/{schemas-C_3C72SR.d.ts → schemas-CGKHzcMV.d.ts} +21 -21
- package/dist/{schemas-C_3C72SR.d.ts.map → schemas-CGKHzcMV.d.ts.map} +1 -1
- package/dist/{schemas-02CI7jgm.d.mts → schemas-m-GqyfyO.d.mts} +21 -21
- package/dist/{schemas-02CI7jgm.d.mts.map → schemas-m-GqyfyO.d.mts.map} +1 -1
- package/dist/tool-protection/index.d.mts +12 -0
- package/dist/tool-protection/index.d.mts.map +1 -1
- package/dist/tool-protection/index.d.ts +12 -0
- package/dist/tool-protection/index.d.ts.map +1 -1
- package/dist/tool-protection/index.js +46 -0
- package/dist/tool-protection/index.mjs +44 -1
- package/dist/tool-protection/index.mjs.map +1 -1
- package/fixtures/kya-http/error-codes.json +2 -1
- package/package.json +19 -3
- package/dist/kya-http-error-codes-7ewV5RuK.d.mts.map +0 -1
- package/dist/kya-http-error-codes-7ewV5RuK.d.ts.map +0 -1
- package/dist/kya-http-error-codes-C2JiWPsi.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
# @kya-os/checkpoint-shared
|
|
4
4
|
|
|
5
|
+
## 1.9.0 - 2026-10-22
|
|
6
|
+
|
|
7
|
+
### Breaking changes
|
|
8
|
+
|
|
9
|
+
- Removed: Unused dashboard and bouncer schemas: the analytics query and response schemas and types (`AnalyticsQuery`, `AnalyticsSessionsQuery`, `AnalyticsAgentSourcesQuery`, `AnalyticsAgentTypesQuery`, `AnalyticsExportQuery`, `AnalyticsRealtimeQuery`, `AnalyticsTimeSeries`, `AnalyticsChartData`, `AnalyticsSessionsResponse`, `AgentSourceDistribution`, their schemas, and the `AnalyticsSessionsSummary*`, `SharedAgentTypeDistribution*` and `SharedConfidenceDistribution*` aliases), the sign-in, sign-up, forgot-password, change-password and verify-email schemas and types, the inferred admin request types, the delegation, delegation status, delegation polling status, bouncer proof and tool consent override schemas and types, the unused bouncer OAuth, provider and consent types (`OAuthConnectionStatus`, `OAuthMode`, `OAuthTokensResponse`, `CRISPBudget`, `AuthProviderType`, `AuthProviderTypeInput`, `LegacyAuthProviderType`, `BaseAuthProvider`, `OAuthProvidersMap`, `AddUpdateProviderRequest`, `ProviderDefinition`, `ConsentCapability`, `ConsentAgentMetadata`, `ConsentSignInCopy`), the provider registry conversion helpers (`toProviderRegistryFormat`, `fromProviderRegistryFormat`, `fromProviderRegistryFormatSafe`, `isSupportedAuthType`, `SupportedProviderAuthType`), `parseRules`, and the schemas `AuthProviderTypeSchema`, `ProviderDefinitionSchema`, `BouncerOutcomeSchema`, `RuleLoadOptionsSchema`, `RuleUpdateEventSchema` and `RuleMatchResultSchema`. (#6563)
|
|
10
|
+
- Removed: Unused types from the `./consent-handoff` entry (`ConsentHandoffReportOutcome`, `ConsentHandoffModuleReason`, `ConsentHandoffProbeCode`) and the `./gateway-client-ip` entry (`GatewayClientIpPublicJwk`, `GatewayClientIpPrivateJwk`). (#6563)
|
|
11
|
+
- Changed: The root `AnalyticsQuerySchema` is now the internal API's analytics query schema, the one `AnalyticsQueryRequest` is inferred from; it was an unused dashboard schema of the same name. (#6563)
|
|
12
|
+
- Removed: Unused exports of the `./browser` entry: the old beacon worker, transport, circuit-breaker, retry, offline-queue and config types (`BeaconBatch`, `BatchEvent`, `BeaconIdentity`, `BeaconConfig`, `TransportConfig`, `TransportOptions`, `TransportResponse`, `TransportState`, `TransportMetrics`, `ConnectionType`, `NetworkInfo`, `MessagePriority`, `WorkerConfig`, `WorkerErrorType`, `WorkerAction`, `WorkerMessageType`, `WorkerMessage`, `WorkerState`, `WorkerHealthStatus`, `WorkerMetrics`, `WorkerError`, `WorkerCapabilities`, `WorkerTask`, `FallbackOptions`, `ResourceUsage`, `WorkerPoolConfig`, `BeaconWorkerMessageType`, `ProtocolVersion`, `BeaconWorkerMessage`, `CircuitBreakerConfig`, `CircuitBreakerState`, `RetryStrategy`, `OfflineQueueEntry`), their parsers and validators (`validateBeaconConfig`, `validateBeaconBatch`, `parseBeaconConfig`, the twelve `parse*` worker functions), `Guards`, `DEFAULT_CONFIG`, `ERROR_TYPES`, and `BrowserDetectionResult` with its alias `DetectionResult`, `AgentCategory`, `ConfidenceLevel` and `AgentInfo`.
|
|
13
|
+
`./browser` keeps the client-IP helpers and `validateBeaconEvent` with its event types; the beacon's own types stay in `./beacon-types`. (#6567)
|
|
14
|
+
- Added: `ERROR_CODES.FLY_CLEANUP_FAILED` (HTTP 502): a delete was refused because a managed agent's Fly machine could
|
|
15
|
+
not be stopped, so the row that tracks the machine was kept. `DELETE /api/v1/projects/{id}` can now answer it. (#6241)
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- `kyaos/unsupported-carriage` (403) in the kya-http error registry (`KYA_HTTP_ERROR.UNSUPPORTED_CARRIAGE`, `KYA_HTTP_ERROR_STATUS` and `fixtures/kya-http/error-codes.json`): a delegation presented in a form the verifier does not accept. (#6544)
|
|
20
|
+
- `defaultRequiredScopes(toolName, entry)` and `executeScopeFor(toolName)` in `@kya-os/checkpoint-shared/tool-protection`: the scopes a tool entry is stored with when it has none of its own. The result is never empty, and the default is `<name>:execute` cut down to the scope-token alphabet, 200 characters at most. (#6552)
|
|
21
|
+
- `AGENT_CATALOG` (also `@kya-os/checkpoint-shared/agent-catalog`): the agents a policy can name, each with its id, label, vendor, tier and the names the detection engine reports for it, and the generated `src/data/generated/agent-catalog.json`. (#6583)
|
|
22
|
+
- `@kya-os/checkpoint-shared/browser-posture-proof-verifier`, the posture proof verifier on WebCrypto with no jose or zod dependency. `verifyBrowserPostureProofKey`, `browserPostureKeyThumbprint` and the constants are the same bindings from `./browser-posture-proof`. (#6542)
|
|
23
|
+
- `keyless` on `BeaconBatch` and `TransportOptions`, the `BeaconKeyless` type, and `beaconBodyIdentityWithKeyless`. (#6595)
|
|
24
|
+
- `BEACON_EDGE_CAPABILITIES`, `BEACON_EDGE_CAPABILITIES_HEADER`, `BEACON_EDGE_CAPABILITIES_VALUE`, `BeaconEdgeCapability` and `parseBeaconEdgeCapabilities`, the capability the Worker advertises to the origin. (#6595)
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- `TRANSACTION_FAILED`'s default message now ends "The project was not deleted." instead of "Nothing was
|
|
29
|
+
deleted.": a project's agents are removed before the project, so they can already be gone when the project delete
|
|
30
|
+
fails. (#6241)
|
|
31
|
+
- a posture proof with `=` padding in any segment, or `+`, `/` or whitespace in its payload or signature segment, is rejected as `bad-signature`; the previous jose build tolerated exact padding and those characters. Node callers: `./browser-posture-proof` now verifies through WebCrypto instead of jose's Node build, so a JWK the Node build accepted is now rejected as `malformed` or `bad-signature` when it has a `d` of `""`, `0`, `false` or `null`, a `key_ops` of `["sign"]`, `["sign","verify"]`, `"verify"`, `null`, `{}`, `[]` or `["encrypt"]`, or some `ext` or `use` values. A public key with `key_ops: ["verify"]` and `ext: true`, as the beacon exports it, still verifies. (#6542)
|
|
32
|
+
- `beaconBodyIdentity` ignores `keyless`. (#6595)
|
|
33
|
+
|
|
34
|
+
### Other merged changes
|
|
35
|
+
|
|
36
|
+
- feat(authz): send a merchant login as a urlencoded form when the provider asks (#6492)
|
|
37
|
+
- feat(admin): list accounts that finished setup with no detection (KYA-1193, part A) (#6522)
|
|
38
|
+
- fix(beacon): bind posture cnf to the key each batch carries (#6528)
|
|
39
|
+
- feat(beacon): self-certifying session ids (#6554)
|
|
40
|
+
- feat(shared): name default sign-in hosts, with nothing on main calling the names yet (F5-0) (#6655)
|
|
41
|
+
|
|
5
42
|
## 1.8.0 - 2026-10-21
|
|
6
43
|
|
|
7
44
|
### Breaking changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/agent-catalog.d.ts
|
|
2
|
+
export type AgentCatalogTier = 'assistant' | 'search' | 'crawler';
|
|
3
|
+
export interface AgentCatalogEntry {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly vendor: string;
|
|
7
|
+
readonly tier: AgentCatalogTier;
|
|
8
|
+
readonly engineNames: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
export declare const AGENT_CATALOG: readonly AgentCatalogEntry[];
|
|
11
|
+
//#endregion
|
|
12
|
+
//# sourceMappingURL=agent-catalog.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-catalog.d.mts","names":[],"sources":["../src/agent-catalog.ts"],"mappings":";YAgBY;iBAGK;WAEN;WAEA;WAEA;WACA,MAAM;WAON;;qBAGE,wBAAwB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/agent-catalog.d.ts
|
|
2
|
+
export type AgentCatalogTier = 'assistant' | 'search' | 'crawler';
|
|
3
|
+
export interface AgentCatalogEntry {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly vendor: string;
|
|
7
|
+
readonly tier: AgentCatalogTier;
|
|
8
|
+
readonly engineNames: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
export declare const AGENT_CATALOG: readonly AgentCatalogEntry[];
|
|
11
|
+
//#endregion
|
|
12
|
+
//# sourceMappingURL=agent-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-catalog.d.ts","names":[],"sources":["../src/agent-catalog.ts"],"mappings":";YAgBY;iBAGK;WAEN;WAEA;WAEA;WACA,MAAM;WAON;;qBAGE,wBAAwB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
//#region src/agent-catalog.ts
|
|
3
|
+
const AGENT_CATALOG = [
|
|
4
|
+
{
|
|
5
|
+
id: "claude",
|
|
6
|
+
label: "Claude",
|
|
7
|
+
vendor: "Anthropic",
|
|
8
|
+
tier: "assistant",
|
|
9
|
+
engineNames: ["Claude"]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "claudebot",
|
|
13
|
+
label: "ClaudeBot",
|
|
14
|
+
vendor: "Anthropic",
|
|
15
|
+
tier: "crawler",
|
|
16
|
+
engineNames: ["ClaudeBot"]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "anthropic-ai",
|
|
20
|
+
label: "Anthropic AI",
|
|
21
|
+
vendor: "Anthropic",
|
|
22
|
+
tier: "crawler",
|
|
23
|
+
engineNames: ["Anthropic-AI Crawler"]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "chatgpt",
|
|
27
|
+
label: "ChatGPT",
|
|
28
|
+
vendor: "OpenAI",
|
|
29
|
+
tier: "assistant",
|
|
30
|
+
engineNames: ["ChatGPT"]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "gptbot",
|
|
34
|
+
label: "GPTBot",
|
|
35
|
+
vendor: "OpenAI",
|
|
36
|
+
tier: "crawler",
|
|
37
|
+
engineNames: ["GPTBot"]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "googlebot",
|
|
41
|
+
label: "Googlebot",
|
|
42
|
+
vendor: "Google",
|
|
43
|
+
tier: "search",
|
|
44
|
+
engineNames: ["Googlebot"]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: "gemini",
|
|
48
|
+
label: "Gemini",
|
|
49
|
+
vendor: "Google",
|
|
50
|
+
tier: "assistant",
|
|
51
|
+
engineNames: ["Google Gemini"]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "perplexitybot",
|
|
55
|
+
label: "PerplexityBot",
|
|
56
|
+
vendor: "Perplexity",
|
|
57
|
+
tier: "search",
|
|
58
|
+
engineNames: ["PerplexityBot"]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "meta-externalagent",
|
|
62
|
+
label: "Meta AI",
|
|
63
|
+
vendor: "Meta",
|
|
64
|
+
tier: "crawler",
|
|
65
|
+
engineNames: ["Meta-ExternalAgent"]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "meta-muse",
|
|
69
|
+
label: "Meta Muse",
|
|
70
|
+
vendor: "Meta",
|
|
71
|
+
tier: "assistant",
|
|
72
|
+
engineNames: ["Meta Muse"]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: "bytespider",
|
|
76
|
+
label: "ByteSpider",
|
|
77
|
+
vendor: "ByteDance",
|
|
78
|
+
tier: "crawler",
|
|
79
|
+
engineNames: ["Bytedance Crawler"]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "ccbot",
|
|
83
|
+
label: "CCBot",
|
|
84
|
+
vendor: "Common Crawl",
|
|
85
|
+
tier: "crawler",
|
|
86
|
+
engineNames: ["Common Crawl"]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: "amazonbot",
|
|
90
|
+
label: "Amazonbot",
|
|
91
|
+
vendor: "Amazon",
|
|
92
|
+
tier: "crawler",
|
|
93
|
+
engineNames: ["Amazonbot"]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: "cohere-ai",
|
|
97
|
+
label: "Cohere AI",
|
|
98
|
+
vendor: "Cohere",
|
|
99
|
+
tier: "crawler",
|
|
100
|
+
engineNames: ["CohereBot"]
|
|
101
|
+
}
|
|
102
|
+
];
|
|
103
|
+
|
|
104
|
+
//#endregion
|
|
105
|
+
exports.AGENT_CATALOG = AGENT_CATALOG;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
//#region src/agent-catalog.ts
|
|
2
|
+
const AGENT_CATALOG = [
|
|
3
|
+
{
|
|
4
|
+
id: "claude",
|
|
5
|
+
label: "Claude",
|
|
6
|
+
vendor: "Anthropic",
|
|
7
|
+
tier: "assistant",
|
|
8
|
+
engineNames: ["Claude"]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: "claudebot",
|
|
12
|
+
label: "ClaudeBot",
|
|
13
|
+
vendor: "Anthropic",
|
|
14
|
+
tier: "crawler",
|
|
15
|
+
engineNames: ["ClaudeBot"]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "anthropic-ai",
|
|
19
|
+
label: "Anthropic AI",
|
|
20
|
+
vendor: "Anthropic",
|
|
21
|
+
tier: "crawler",
|
|
22
|
+
engineNames: ["Anthropic-AI Crawler"]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "chatgpt",
|
|
26
|
+
label: "ChatGPT",
|
|
27
|
+
vendor: "OpenAI",
|
|
28
|
+
tier: "assistant",
|
|
29
|
+
engineNames: ["ChatGPT"]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "gptbot",
|
|
33
|
+
label: "GPTBot",
|
|
34
|
+
vendor: "OpenAI",
|
|
35
|
+
tier: "crawler",
|
|
36
|
+
engineNames: ["GPTBot"]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "googlebot",
|
|
40
|
+
label: "Googlebot",
|
|
41
|
+
vendor: "Google",
|
|
42
|
+
tier: "search",
|
|
43
|
+
engineNames: ["Googlebot"]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "gemini",
|
|
47
|
+
label: "Gemini",
|
|
48
|
+
vendor: "Google",
|
|
49
|
+
tier: "assistant",
|
|
50
|
+
engineNames: ["Google Gemini"]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: "perplexitybot",
|
|
54
|
+
label: "PerplexityBot",
|
|
55
|
+
vendor: "Perplexity",
|
|
56
|
+
tier: "search",
|
|
57
|
+
engineNames: ["PerplexityBot"]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "meta-externalagent",
|
|
61
|
+
label: "Meta AI",
|
|
62
|
+
vendor: "Meta",
|
|
63
|
+
tier: "crawler",
|
|
64
|
+
engineNames: ["Meta-ExternalAgent"]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: "meta-muse",
|
|
68
|
+
label: "Meta Muse",
|
|
69
|
+
vendor: "Meta",
|
|
70
|
+
tier: "assistant",
|
|
71
|
+
engineNames: ["Meta Muse"]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "bytespider",
|
|
75
|
+
label: "ByteSpider",
|
|
76
|
+
vendor: "ByteDance",
|
|
77
|
+
tier: "crawler",
|
|
78
|
+
engineNames: ["Bytedance Crawler"]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "ccbot",
|
|
82
|
+
label: "CCBot",
|
|
83
|
+
vendor: "Common Crawl",
|
|
84
|
+
tier: "crawler",
|
|
85
|
+
engineNames: ["Common Crawl"]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "amazonbot",
|
|
89
|
+
label: "Amazonbot",
|
|
90
|
+
vendor: "Amazon",
|
|
91
|
+
tier: "crawler",
|
|
92
|
+
engineNames: ["Amazonbot"]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "cohere-ai",
|
|
96
|
+
label: "Cohere AI",
|
|
97
|
+
vendor: "Cohere",
|
|
98
|
+
tier: "crawler",
|
|
99
|
+
engineNames: ["CohereBot"]
|
|
100
|
+
}
|
|
101
|
+
];
|
|
102
|
+
|
|
103
|
+
//#endregion
|
|
104
|
+
export { AGENT_CATALOG };
|
|
105
|
+
//# sourceMappingURL=agent-catalog.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-catalog.mjs","names":[],"sources":["../src/agent-catalog.ts"],"sourcesContent":["/**\n * The agent catalog: every agent a policy can name, with the names the\n * detection engine reports for it.\n *\n * A policy names an agent by its `id`. The engine reports a detected agent\n * by name, and that name is one of the entry's `engineNames`: a Tier 3\n * pattern name, from `data/generated/known-agent-patterns.json` or the\n * engine's non-AI pattern table. The catalog is the one place that ties the\n * two together, for the dashboard and, through\n * `data/generated/agent-catalog.json`, for the engine build. Regenerate that\n * file with `pnpm --filter @kya-os/checkpoint-shared build:agent-catalog`;\n * `src/__tests__/agent-catalog.test.ts` fails when it is stale, and when an\n * engine name is not one the engine reports.\n */\n\n/** How the dashboard groups an agent. */\nexport type AgentCatalogTier = 'assistant' | 'search' | 'crawler';\n\n/** One agent a policy can name. */\nexport interface AgentCatalogEntry {\n /** Stable id a policy names the agent by. Never renamed: stored policies hold it. */\n readonly id: string;\n /** Display label. */\n readonly label: string;\n /** The company behind the agent. */\n readonly vendor: string;\n readonly tier: AgentCatalogTier;\n /**\n * The names the engine reports for this agent. Exactly one for now: the\n * dashboard and compiled policies match on the first name only, so a\n * second would be ignored (`src/__tests__/agent-catalog.test.ts` holds the\n * line until they match any of them).\n */\n readonly engineNames: readonly string[];\n}\n\nexport const AGENT_CATALOG: readonly AgentCatalogEntry[] = [\n // The engine reports every Claude surface (desktop, code, API, web) as\n // \"Claude\"; only the crawler has a name of its own.\n {\n id: 'claude',\n label: 'Claude',\n vendor: 'Anthropic',\n tier: 'assistant',\n engineNames: ['Claude'],\n },\n {\n id: 'claudebot',\n label: 'ClaudeBot',\n vendor: 'Anthropic',\n tier: 'crawler',\n engineNames: ['ClaudeBot'],\n },\n {\n id: 'anthropic-ai',\n label: 'Anthropic AI',\n vendor: 'Anthropic',\n tier: 'crawler',\n engineNames: ['Anthropic-AI Crawler'],\n },\n // The engine reports the browsing assistant, ChatGPT-User and\n // OAI-SearchBot as \"ChatGPT\", verified or not.\n {\n id: 'chatgpt',\n label: 'ChatGPT',\n vendor: 'OpenAI',\n tier: 'assistant',\n engineNames: ['ChatGPT'],\n },\n { id: 'gptbot', label: 'GPTBot', vendor: 'OpenAI', tier: 'crawler', engineNames: ['GPTBot'] },\n {\n id: 'googlebot',\n label: 'Googlebot',\n vendor: 'Google',\n tier: 'search',\n engineNames: ['Googlebot'],\n },\n {\n id: 'gemini',\n label: 'Gemini',\n vendor: 'Google',\n tier: 'assistant',\n engineNames: ['Google Gemini'],\n },\n {\n id: 'perplexitybot',\n label: 'PerplexityBot',\n vendor: 'Perplexity',\n tier: 'search',\n engineNames: ['PerplexityBot'],\n },\n {\n id: 'meta-externalagent',\n label: 'Meta AI',\n vendor: 'Meta',\n tier: 'crawler',\n engineNames: ['Meta-ExternalAgent'],\n },\n {\n id: 'meta-muse',\n label: 'Meta Muse',\n vendor: 'Meta',\n tier: 'assistant',\n engineNames: ['Meta Muse'],\n },\n {\n id: 'bytespider',\n label: 'ByteSpider',\n vendor: 'ByteDance',\n tier: 'crawler',\n engineNames: ['Bytedance Crawler'],\n },\n {\n id: 'ccbot',\n label: 'CCBot',\n vendor: 'Common Crawl',\n tier: 'crawler',\n engineNames: ['Common Crawl'],\n },\n {\n id: 'amazonbot',\n label: 'Amazonbot',\n vendor: 'Amazon',\n tier: 'crawler',\n engineNames: ['Amazonbot'],\n },\n {\n id: 'cohere-ai',\n label: 'Cohere AI',\n vendor: 'Cohere',\n tier: 'crawler',\n engineNames: ['CohereBot'],\n },\n];\n"],"mappings":";AAoCA,MAAa,gBAA8C;CAGzD;EACE,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa,CAAC,QAAQ;CACxB;CACA;EACE,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa,CAAC,WAAW;CAC3B;CACA;EACE,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa,CAAC,sBAAsB;CACtC;CAGA;EACE,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa,CAAC,SAAS;CACzB;CACA;EAAE,IAAI;EAAU,OAAO;EAAU,QAAQ;EAAU,MAAM;EAAW,aAAa,CAAC,QAAQ;CAAE;CAC5F;EACE,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa,CAAC,WAAW;CAC3B;CACA;EACE,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa,CAAC,eAAe;CAC/B;CACA;EACE,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa,CAAC,eAAe;CAC/B;CACA;EACE,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa,CAAC,oBAAoB;CACpC;CACA;EACE,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa,CAAC,WAAW;CAC3B;CACA;EACE,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa,CAAC,mBAAmB;CACnC;CACA;EACE,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa,CAAC,cAAc;CAC9B;CACA;EACE,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa,CAAC,WAAW;CAC3B;CACA;EACE,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa,CAAC,WAAW;CAC3B;AACF"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
//#region src/beacon-types/session-commitment.d.ts
|
|
2
|
+
export declare function thumbprintCommitment(thumbprint: Uint8Array): string;
|
|
3
|
+
export declare function sessionIdFromCommitment(commitment: string, uuidV4: string): string;
|
|
4
|
+
export declare function committedSessionId(thumbprint: Uint8Array, uuidV4: string): string;
|
|
5
|
+
export declare function sessionKeyCommitment(sessionId: string): string | undefined;
|
|
6
|
+
export declare function sessionCommitsToThumbprint(sessionId: string, thumbprint: Uint8Array): boolean;
|
|
7
|
+
export declare function sessionCommitsToJkt(sessionId: string, jkt: string): boolean;
|
|
8
|
+
export declare function keyMayActForSession(sessionId: string, jkt: string | undefined): boolean;
|
|
9
|
+
//#endregion
|
|
1
10
|
//#region src/beacon-types/index.d.ts
|
|
2
11
|
export type JsonPrimitive = string | number | boolean | null;
|
|
3
12
|
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
@@ -207,6 +216,7 @@ export interface TransportOptions {
|
|
|
207
216
|
retry?: boolean;
|
|
208
217
|
timeout?: number;
|
|
209
218
|
publicJwk?: EcPublicJwk;
|
|
219
|
+
keyless?: BeaconKeyless;
|
|
210
220
|
deviceId?: string;
|
|
211
221
|
handoffToken?: string;
|
|
212
222
|
batch?: QueuedBatchIdentity;
|
|
@@ -437,10 +447,12 @@ export interface BeaconBatch {
|
|
|
437
447
|
nonce?: string;
|
|
438
448
|
nonceEcho?: boolean;
|
|
439
449
|
publicJwk?: EcPublicJwk;
|
|
450
|
+
keyless?: BeaconKeyless;
|
|
440
451
|
queueEvictions?: number;
|
|
441
452
|
queueExpirations?: number;
|
|
442
453
|
queueCorruptions?: number;
|
|
443
454
|
}
|
|
455
|
+
export type BeaconKeyless = 1 | 2;
|
|
444
456
|
export interface BeaconCollectorData {
|
|
445
457
|
userAgent?: string;
|
|
446
458
|
language?: string;
|
|
@@ -494,11 +506,17 @@ export declare const SESSION_IDLE_GAP_MAX_MS = 21600000;
|
|
|
494
506
|
export declare const BEACON_MAX_BATCH_ID_LENGTH = 255;
|
|
495
507
|
export declare const BEACON_ORIGIN_CONTRACT_VERSION = 1;
|
|
496
508
|
export declare const BEACON_ORIGIN_CAPABILITIES: readonly ["batch-replay-v1", "receipt-status-v1", "receipt-posture-v1", "batch-identity-digest-v1"];
|
|
509
|
+
export declare const BEACON_EDGE_CAPABILITIES_HEADER = "x-checkpoint-beacon-capabilities";
|
|
510
|
+
export declare const BEACON_EDGE_CAPABILITIES: readonly ["key-pending-v1"];
|
|
511
|
+
export type BeaconEdgeCapability = (typeof BEACON_EDGE_CAPABILITIES)[number];
|
|
512
|
+
export declare function beaconEdgeCapabilitiesHeaderValue(): string;
|
|
513
|
+
export declare function parseBeaconEdgeCapabilities(value: string | null | undefined): BeaconEdgeCapability[];
|
|
497
514
|
export declare function withAdoptedSession<B extends {
|
|
498
515
|
sessionId: string;
|
|
499
516
|
events: ReadonlyArray<Record<string, unknown>>;
|
|
500
517
|
}>(batch: B, sessionId: string): B;
|
|
501
518
|
export declare function beaconBodyIdentity(body: object): string;
|
|
519
|
+
export declare function beaconBodyIdentityWithKeyless(body: object): string;
|
|
502
520
|
export declare const POSTURE_TTL_SECONDS = 120;
|
|
503
521
|
export interface CachedPosture {
|
|
504
522
|
token: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/beacon-types/index.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/beacon-types/session-commitment.ts","../../src/beacon-types/index.ts"],"mappings":";wBAWgB,qBAAqB,YAAY;wBAIjC,wBAAwB,oBAAoB;wBAI5C,mBAAmB,YAAY,YAAY;wBAI3C,qBAAqB;wBAKrB,2BAA2B,mBAAmB,YAAY;wBAK1D,oBAAoB,mBAAmB;wBAYvC,oBAAoB,mBAAmB;;;YCpC3C;YACA,YAAY,gBAAgB;GAAiB,cAAc;;YAC3D,kBAAkB;YAClB,kBAAkB;YAClB,mBAAmB,eAAe;YAClC,gBAAgB,sBAAsB;YACtC;wBA4KI,iBAAiB,iBAAiB,SAAS;iBA+C1C,+BAA+B;EAC9C;EACA;EACA;EACA;EACA;;iBAGe,wCAAwC;EACvD,aAAa;EACb,gBAAgB;EAChB,mBAAmB;EACnB;EACA;EACA;EACA;;iBAGe,iCAAiC;EAChD;EACA;IACE;;;iBAIa;EACf,gBAAgB;EAChB,aAAa;;iBAGE,+BAA+B;EAC9C;IACE,aACE,cACA;MACE,mBAAmB;MACnB,gBAAgB;QAEjB;;;iBAIU;EACf;EACA;EACA;;iBAGe,8BAA8B;EAC7C,SAAS;EACT,uCAAuC;;iBAGxB,oCAAoC;EACnD;EACA;;iBAiBe;EAKf;;iBAIe;EAEf;EAEA;EAEA;EAEA;EAEA;EAEA;EASA;;iBAGe;EAEf;EAOA,WAAW;EAaX;EAGA;EAGA,OAAO;EAQP;EAOA;EAOA;EAOA;EASA;EAOA;EAcA;EAcA;EAUA;EAMA;EASA;EAWA;EASA,aAAa,SAAS;EAOtB;EASA;EAUA;EAUA;EAOA,WAAW;EAkBX;EAUA;EAWA;EAUA;EASA;EAMA;EAWA;EAOA;EAOA;EAOA;EASA;EAUA;EAMA;EAQA;EAOA,eAAe;EAEf;;iBAOe;EAEf,MAAM;EAGN,MAAM;EAGN,UAAU;;iBAGK;EAEf;EAGA;EAGA;EAGA,WAAW;GAGV;;iBAOc;EAIf,QAAQ,mBAAmB,OAAO,gBAAgB;EAKlD,WAAW,mBAAmB,YAAY,gBAAgB;EAK1D,cAAc,WAAW,gBAAgB;EAKzC,mBAAmB;EAKnB,aAAa,SAAS,QAAQ;EAK9B,WAAW;;iBAOI;EAEf;EAGA;EAGA;IACE;IACA;;;iBAQa;EAEf;IACE;IACA;IACA;;EAIF;IACE;IACA;;EAIF;IACE;IACA;IACA;;EAIF;IACE;IACA;IACA;IACA;;EAIF;IACE;IACA;IACA;IACA;IACA;;;iBAQa;EAEf;EAGA;EAGA;EAGA;EAGA;EAGA;EAGA;EAGA;EAGA;EAGA;IACE;IACA;IACA;IACA;IACA;;;iBAQa;EAEf;EAGA;EAGA;EAGA;EAGA;EAGA;EAGA;;iBAOe;EACf;EACA;EACA;EACA;EACA;EAEA;;iBAGe;EACf;EACA;EACA;EACA;EACA,YAAY;EACZ,UAAU;EACV;EACA;EACA,QAAQ;;iBAGO;EACf;EACA;EACA;EACA;EACA;;YAGU;iBAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU;iBAUK;EACf;EACA;EACA;EACA;EACA;;YAOU;YACA;YAWA;YAQA;iBAEK;EACf;EACA;EACA;EACA,UAAU;EACV;EACA;EACA,WAAW;EACX;;YAGU;YAUA;iBAEK;EACf;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA,UAAU;;iBAGK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;IACE;IACA;IACA;IACA;;EAEF;IACE;IACA;;;iBAIa;EACf;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;;iBAGe;EACf;IACE;IACA;IACA;;EAEF;IACE;IACA;;EAEF;IACE;IACA;IACA;IACA;;EAEF;;iBAGe;EACf;EACA;EACA;EACA;EACA,gBAAgB;EAChB;EACA;EACA;;YAGU;YAWA;iBAEK;EACf,MAAM;EACN,OAAO;EACP,UAAU;EACV;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAWA;;iBAOe;EACf;EACA;EACA;;YAGU;iBAEK;EACf;EACA;EACA;EACA;EACA;;iBAOe;EACf;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA,QAAQ;EACR;EACA;EACA;EACA;EACA,QAAQ;;iBAUO;EACf;EACA;EACA;EACA;;iBAIe;EAOf;EAKA;EAEA;IAAY;IAAe;;EAE3B;;iBAGe;EACf;EACA,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;EACZ,UAAU;EACV;EACA;EACA;;YAGU;iBAEK;EAEf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EAGA;EACA;GAGC;;YAGS;wBAaI,mBAAmB,iBAAiB;wBAWpC,0BAA0B,iBAAiB;wBAgC3C,uBAAuB,iBAAiB;wBA6BxC,yBAAyB,iBAAiB;wBA8C1C,mBAAmB,iBAAiB;wBAkBpC,iBAAiB,iBAAiB;wBAclC,sBAAsB,iBAAiB;wBAcvC,mBAAmB,iBAAiB;qBAUvC;gBAAA;;qBAIA;gBAAA;;wBAIG,wBAAwB,iBAAiB;wBAiCzC,kBACd,gBACA,UAAU,2BACT;qBA6HkB,6BAA6B;EACpC,YAAA,QAAQ;EACpB,QAAQ,mBAAmB,OAAO,gBAAgB;EAClD,WAAW,mBAAmB,YAAY,gBAAgB;EAC1D,cAAc,WAAW,gBAAgB;EACzC,mBAAmB;EACnB,aAAa,SAAS,QAAQ;EAC9B,WAAW;;qBAQA;qBAEA;qBACA;qBAEA;qBAEA;qBAOA;qBAEA;YAED,+BAA+B;wBAE3B;wBAIA,4BACd,mCACC;wBAKa,mBACd;EAAY;EAAmB,QAAQ,cAAc;GACrD,OAAO,GAAG,oBAAoB;wBA6BhB,mBAAmB;wBAInB,8BAA8B;qBASjC;iBAEI;EACf;EACA;;iBAGe;EACf,UAAU;EACV;EACA;EACA;EACA;;wBAGc,mBAAmB,iBAAiB"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
//#region src/beacon-types/session-commitment.d.ts
|
|
2
|
+
export declare function thumbprintCommitment(thumbprint: Uint8Array): string;
|
|
3
|
+
export declare function sessionIdFromCommitment(commitment: string, uuidV4: string): string;
|
|
4
|
+
export declare function committedSessionId(thumbprint: Uint8Array, uuidV4: string): string;
|
|
5
|
+
export declare function sessionKeyCommitment(sessionId: string): string | undefined;
|
|
6
|
+
export declare function sessionCommitsToThumbprint(sessionId: string, thumbprint: Uint8Array): boolean;
|
|
7
|
+
export declare function sessionCommitsToJkt(sessionId: string, jkt: string): boolean;
|
|
8
|
+
export declare function keyMayActForSession(sessionId: string, jkt: string | undefined): boolean;
|
|
9
|
+
//#endregion
|
|
1
10
|
//#region src/beacon-types/index.d.ts
|
|
2
11
|
export type JsonPrimitive = string | number | boolean | null;
|
|
3
12
|
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
@@ -207,6 +216,7 @@ export interface TransportOptions {
|
|
|
207
216
|
retry?: boolean;
|
|
208
217
|
timeout?: number;
|
|
209
218
|
publicJwk?: EcPublicJwk;
|
|
219
|
+
keyless?: BeaconKeyless;
|
|
210
220
|
deviceId?: string;
|
|
211
221
|
handoffToken?: string;
|
|
212
222
|
batch?: QueuedBatchIdentity;
|
|
@@ -437,10 +447,12 @@ export interface BeaconBatch {
|
|
|
437
447
|
nonce?: string;
|
|
438
448
|
nonceEcho?: boolean;
|
|
439
449
|
publicJwk?: EcPublicJwk;
|
|
450
|
+
keyless?: BeaconKeyless;
|
|
440
451
|
queueEvictions?: number;
|
|
441
452
|
queueExpirations?: number;
|
|
442
453
|
queueCorruptions?: number;
|
|
443
454
|
}
|
|
455
|
+
export type BeaconKeyless = 1 | 2;
|
|
444
456
|
export interface BeaconCollectorData {
|
|
445
457
|
userAgent?: string;
|
|
446
458
|
language?: string;
|
|
@@ -494,11 +506,17 @@ export declare const SESSION_IDLE_GAP_MAX_MS = 21600000;
|
|
|
494
506
|
export declare const BEACON_MAX_BATCH_ID_LENGTH = 255;
|
|
495
507
|
export declare const BEACON_ORIGIN_CONTRACT_VERSION = 1;
|
|
496
508
|
export declare const BEACON_ORIGIN_CAPABILITIES: readonly ["batch-replay-v1", "receipt-status-v1", "receipt-posture-v1", "batch-identity-digest-v1"];
|
|
509
|
+
export declare const BEACON_EDGE_CAPABILITIES_HEADER = "x-checkpoint-beacon-capabilities";
|
|
510
|
+
export declare const BEACON_EDGE_CAPABILITIES: readonly ["key-pending-v1"];
|
|
511
|
+
export type BeaconEdgeCapability = (typeof BEACON_EDGE_CAPABILITIES)[number];
|
|
512
|
+
export declare function beaconEdgeCapabilitiesHeaderValue(): string;
|
|
513
|
+
export declare function parseBeaconEdgeCapabilities(value: string | null | undefined): BeaconEdgeCapability[];
|
|
497
514
|
export declare function withAdoptedSession<B extends {
|
|
498
515
|
sessionId: string;
|
|
499
516
|
events: ReadonlyArray<Record<string, unknown>>;
|
|
500
517
|
}>(batch: B, sessionId: string): B;
|
|
501
518
|
export declare function beaconBodyIdentity(body: object): string;
|
|
519
|
+
export declare function beaconBodyIdentityWithKeyless(body: object): string;
|
|
502
520
|
export declare const POSTURE_TTL_SECONDS = 120;
|
|
503
521
|
export interface CachedPosture {
|
|
504
522
|
token: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/beacon-types/index.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/beacon-types/session-commitment.ts","../../src/beacon-types/index.ts"],"mappings":";wBAWgB,qBAAqB,YAAY;wBAIjC,wBAAwB,oBAAoB;wBAI5C,mBAAmB,YAAY,YAAY;wBAI3C,qBAAqB;wBAKrB,2BAA2B,mBAAmB,YAAY;wBAK1D,oBAAoB,mBAAmB;wBAYvC,oBAAoB,mBAAmB;;;YCpC3C;YACA,YAAY,gBAAgB;GAAiB,cAAc;;YAC3D,kBAAkB;YAClB,kBAAkB;YAClB,mBAAmB,eAAe;YAClC,gBAAgB,sBAAsB;YACtC;wBA4KI,iBAAiB,iBAAiB,SAAS;iBA+C1C,+BAA+B;EAC9C;EACA;EACA;EACA;EACA;;iBAGe,wCAAwC;EACvD,aAAa;EACb,gBAAgB;EAChB,mBAAmB;EACnB;EACA;EACA;EACA;;iBAGe,iCAAiC;EAChD;EACA;IACE;;;iBAIa;EACf,gBAAgB;EAChB,aAAa;;iBAGE,+BAA+B;EAC9C;IACE,aACE,cACA;MACE,mBAAmB;MACnB,gBAAgB;QAEjB;;;iBAIU;EACf;EACA;EACA;;iBAGe,8BAA8B;EAC7C,SAAS;EACT,uCAAuC;;iBAGxB,oCAAoC;EACnD;EACA;;iBAiBe;EAKf;;iBAIe;EAEf;EAEA;EAEA;EAEA;EAEA;EAEA;EASA;;iBAGe;EAEf;EAOA,WAAW;EAaX;EAGA;EAGA,OAAO;EAQP;EAOA;EAOA;EAOA;EASA;EAOA;EAcA;EAcA;EAUA;EAMA;EASA;EAWA;EASA,aAAa,SAAS;EAOtB;EASA;EAUA;EAUA;EAOA,WAAW;EAkBX;EAUA;EAWA;EAUA;EASA;EAMA;EAWA;EAOA;EAOA;EAOA;EASA;EAUA;EAMA;EAQA;EAOA,eAAe;EAEf;;iBAOe;EAEf,MAAM;EAGN,MAAM;EAGN,UAAU;;iBAGK;EAEf;EAGA;EAGA;EAGA,WAAW;GAGV;;iBAOc;EAIf,QAAQ,mBAAmB,OAAO,gBAAgB;EAKlD,WAAW,mBAAmB,YAAY,gBAAgB;EAK1D,cAAc,WAAW,gBAAgB;EAKzC,mBAAmB;EAKnB,aAAa,SAAS,QAAQ;EAK9B,WAAW;;iBAOI;EAEf;EAGA;EAGA;IACE;IACA;;;iBAQa;EAEf;IACE;IACA;IACA;;EAIF;IACE;IACA;;EAIF;IACE;IACA;IACA;;EAIF;IACE;IACA;IACA;IACA;;EAIF;IACE;IACA;IACA;IACA;IACA;;;iBAQa;EAEf;EAGA;EAGA;EAGA;EAGA;EAGA;EAGA;EAGA;EAGA;EAGA;IACE;IACA;IACA;IACA;IACA;;;iBAQa;EAEf;EAGA;EAGA;EAGA;EAGA;EAGA;EAGA;;iBAOe;EACf;EACA;EACA;EACA;EACA;EAEA;;iBAGe;EACf;EACA;EACA;EACA;EACA,YAAY;EACZ,UAAU;EACV;EACA;EACA,QAAQ;;iBAGO;EACf;EACA;EACA;EACA;EACA;;YAGU;iBAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU;iBAUK;EACf;EACA;EACA;EACA;EACA;;YAOU;YACA;YAWA;YAQA;iBAEK;EACf;EACA;EACA;EACA,UAAU;EACV;EACA;EACA,WAAW;EACX;;YAGU;YAUA;iBAEK;EACf;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA,UAAU;;iBAGK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;IACE;IACA;IACA;IACA;;EAEF;IACE;IACA;;;iBAIa;EACf;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;;iBAGe;EACf;IACE;IACA;IACA;;EAEF;IACE;IACA;;EAEF;IACE;IACA;IACA;IACA;;EAEF;;iBAGe;EACf;EACA;EACA;EACA;EACA,gBAAgB;EAChB;EACA;EACA;;YAGU;YAWA;iBAEK;EACf,MAAM;EACN,OAAO;EACP,UAAU;EACV;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAWA;;iBAOe;EACf;EACA;EACA;;YAGU;iBAEK;EACf;EACA;EACA;EACA;EACA;;iBAOe;EACf;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA,QAAQ;EACR;EACA;EACA;EACA;EACA,QAAQ;;iBAUO;EACf;EACA;EACA;EACA;;iBAIe;EAOf;EAKA;EAEA;IAAY;IAAe;;EAE3B;;iBAGe;EACf;EACA,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;EACZ,UAAU;EACV;EACA;EACA;;YAGU;iBAEK;EAEf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EAGA;EACA;GAGC;;YAGS;wBAaI,mBAAmB,iBAAiB;wBAWpC,0BAA0B,iBAAiB;wBAgC3C,uBAAuB,iBAAiB;wBA6BxC,yBAAyB,iBAAiB;wBA8C1C,mBAAmB,iBAAiB;wBAkBpC,iBAAiB,iBAAiB;wBAclC,sBAAsB,iBAAiB;wBAcvC,mBAAmB,iBAAiB;qBAUvC;gBAAA;;qBAIA;gBAAA;;wBAIG,wBAAwB,iBAAiB;wBAiCzC,kBACd,gBACA,UAAU,2BACT;qBA6HkB,6BAA6B;EACpC,YAAA,QAAQ;EACpB,QAAQ,mBAAmB,OAAO,gBAAgB;EAClD,WAAW,mBAAmB,YAAY,gBAAgB;EAC1D,cAAc,WAAW,gBAAgB;EACzC,mBAAmB;EACnB,aAAa,SAAS,QAAQ;EAC9B,WAAW;;qBAQA;qBAEA;qBACA;qBAEA;qBAEA;qBAOA;qBAEA;YAED,+BAA+B;wBAE3B;wBAIA,4BACd,mCACC;wBAKa,mBACd;EAAY;EAAmB,QAAQ,cAAc;GACrD,OAAO,GAAG,oBAAoB;wBA6BhB,mBAAmB;wBAInB,8BAA8B;qBASjC;iBAEI;EACf;EACA;;iBAGe;EACf,UAAU;EACV;EACA;EACA;EACA;;wBAGc,mBAAmB,iBAAiB"}
|
|
@@ -1,4 +1,79 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
//#region src/utils/base64url.ts
|
|
3
|
+
/**
|
|
4
|
+
* Base64url (RFC 4648 § 5) built on `atob` and `btoa` rather than Node's
|
|
5
|
+
* buffer API, so it runs on every runtime the SDKs support, Cloudflare Workers
|
|
6
|
+
* without `nodejs_compat` included.
|
|
7
|
+
*/
|
|
8
|
+
const BASE64URL_UNPADDED = /^[A-Za-z0-9_-]*$/;
|
|
9
|
+
const PADDING = 61;
|
|
10
|
+
/**
|
|
11
|
+
* `text` without its trailing `=` padding. A backward scan, not
|
|
12
|
+
* `replace(/=+$/, '')`: that regex retries from every `=` in a long run that
|
|
13
|
+
* does not reach the end, which is quadratic on hostile input.
|
|
14
|
+
*/
|
|
15
|
+
function withoutPadding(text) {
|
|
16
|
+
let end = text.length;
|
|
17
|
+
while (end > 0 && text.charCodeAt(end - 1) === PADDING) end -= 1;
|
|
18
|
+
return text.slice(0, end);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Decode base64url, with or without `=` padding.
|
|
22
|
+
*
|
|
23
|
+
* Strict where Node's buffer decoder is lenient: a character outside the
|
|
24
|
+
* alphabet, or a length no encoder produces (one character past a multiple of
|
|
25
|
+
* four), throws a `TypeError` instead of being skipped or truncated. This
|
|
26
|
+
* matches the engine's decoder.
|
|
27
|
+
*/
|
|
28
|
+
function base64UrlToBytes(text) {
|
|
29
|
+
const unpadded = withoutPadding(text);
|
|
30
|
+
if (!BASE64URL_UNPADDED.test(unpadded) || unpadded.length % 4 === 1) throw new TypeError("not valid base64url (RFC 4648 § 5)");
|
|
31
|
+
const base64 = unpadded.replace(/-/g, "+").replace(/_/g, "/");
|
|
32
|
+
const binary = atob(base64 + "=".repeat((4 - base64.length % 4) % 4));
|
|
33
|
+
const bytes = new Uint8Array(binary.length);
|
|
34
|
+
for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
|
|
35
|
+
return bytes;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/beacon-types/session-commitment.ts
|
|
40
|
+
const COMMITMENT_BYTES = 9;
|
|
41
|
+
const THUMBPRINT_BYTES = 32;
|
|
42
|
+
const COMMITTED_SESSION_ID = /^([0-9a-f]{8})-([0-9a-f]{4})-8([0-9a-f]{3})-[89ab]([0-9a-f]{3})-[0-9a-f]{12}$/;
|
|
43
|
+
function toHex(bytes) {
|
|
44
|
+
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
45
|
+
}
|
|
46
|
+
function thumbprintCommitment(thumbprint) {
|
|
47
|
+
return toHex(thumbprint.subarray(0, COMMITMENT_BYTES));
|
|
48
|
+
}
|
|
49
|
+
function sessionIdFromCommitment(commitment, uuidV4) {
|
|
50
|
+
return `${commitment.slice(0, 8)}-${commitment.slice(8, 12)}-8${commitment.slice(12, 15)}-${uuidV4[19]}${commitment.slice(15)}-${uuidV4.slice(24)}`;
|
|
51
|
+
}
|
|
52
|
+
function committedSessionId(thumbprint, uuidV4) {
|
|
53
|
+
return sessionIdFromCommitment(thumbprintCommitment(thumbprint), uuidV4);
|
|
54
|
+
}
|
|
55
|
+
function sessionKeyCommitment(sessionId) {
|
|
56
|
+
const match = COMMITTED_SESSION_ID.exec(sessionId.toLowerCase());
|
|
57
|
+
return match ? match.slice(1).join("") : void 0;
|
|
58
|
+
}
|
|
59
|
+
function sessionCommitsToThumbprint(sessionId, thumbprint) {
|
|
60
|
+
const commitment = sessionKeyCommitment(sessionId);
|
|
61
|
+
return commitment !== void 0 && thumbprintCommitment(thumbprint) === commitment;
|
|
62
|
+
}
|
|
63
|
+
function sessionCommitsToJkt(sessionId, jkt) {
|
|
64
|
+
let thumbprint;
|
|
65
|
+
try {
|
|
66
|
+
thumbprint = base64UrlToBytes(jkt);
|
|
67
|
+
} catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
return thumbprint.length === THUMBPRINT_BYTES && sessionCommitsToThumbprint(sessionId, thumbprint);
|
|
71
|
+
}
|
|
72
|
+
function keyMayActForSession(sessionId, jkt) {
|
|
73
|
+
return sessionKeyCommitment(sessionId) === void 0 || jkt !== void 0 && sessionCommitsToJkt(sessionId, jkt);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
2
77
|
//#region src/beacon-types/index.ts
|
|
3
78
|
function isRecord(input) {
|
|
4
79
|
return typeof input === "object" && input !== null && !Array.isArray(input);
|
|
@@ -361,6 +436,15 @@ const BEACON_ORIGIN_CAPABILITIES = [
|
|
|
361
436
|
"receipt-posture-v1",
|
|
362
437
|
"batch-identity-digest-v1"
|
|
363
438
|
];
|
|
439
|
+
const BEACON_EDGE_CAPABILITIES_HEADER = "x-checkpoint-beacon-capabilities";
|
|
440
|
+
const BEACON_EDGE_CAPABILITIES = ["key-pending-v1"];
|
|
441
|
+
function beaconEdgeCapabilitiesHeaderValue() {
|
|
442
|
+
return BEACON_EDGE_CAPABILITIES.join(",");
|
|
443
|
+
}
|
|
444
|
+
function parseBeaconEdgeCapabilities(value) {
|
|
445
|
+
const offered = (value ?? "").split(",").map((token) => token.trim());
|
|
446
|
+
return BEACON_EDGE_CAPABILITIES.filter((capability) => offered.includes(capability));
|
|
447
|
+
}
|
|
364
448
|
function withAdoptedSession(batch, sessionId) {
|
|
365
449
|
return {
|
|
366
450
|
...batch,
|
|
@@ -374,19 +458,27 @@ function withAdoptedSession(batch, sessionId) {
|
|
|
374
458
|
}))
|
|
375
459
|
};
|
|
376
460
|
}
|
|
461
|
+
const BODY_IDENTITY_BLANKED_FIELDS = [
|
|
462
|
+
"nonce",
|
|
463
|
+
"nonceEcho",
|
|
464
|
+
"deviceId",
|
|
465
|
+
"anonymizeIp",
|
|
466
|
+
"publicJwk",
|
|
467
|
+
"handoffToken",
|
|
468
|
+
"queueEvictions",
|
|
469
|
+
"queueExpirations",
|
|
470
|
+
"queueCorruptions"
|
|
471
|
+
];
|
|
472
|
+
function bodyIdentity(body, blanked) {
|
|
473
|
+
const identity = { ...body };
|
|
474
|
+
for (const field of blanked) identity[field] = void 0;
|
|
475
|
+
return JSON.stringify(identity);
|
|
476
|
+
}
|
|
377
477
|
function beaconBodyIdentity(body) {
|
|
378
|
-
return
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
deviceId: void 0,
|
|
383
|
-
anonymizeIp: void 0,
|
|
384
|
-
publicJwk: void 0,
|
|
385
|
-
handoffToken: void 0,
|
|
386
|
-
queueEvictions: void 0,
|
|
387
|
-
queueExpirations: void 0,
|
|
388
|
-
queueCorruptions: void 0
|
|
389
|
-
});
|
|
478
|
+
return bodyIdentity(body, [...BODY_IDENTITY_BLANKED_FIELDS, "keyless"]);
|
|
479
|
+
}
|
|
480
|
+
function beaconBodyIdentityWithKeyless(body) {
|
|
481
|
+
return bodyIdentity(body, BODY_IDENTITY_BLANKED_FIELDS);
|
|
390
482
|
}
|
|
391
483
|
/**
|
|
392
484
|
* Lifetime of the signed browser posture token, in seconds. Defined here and
|
|
@@ -409,6 +501,8 @@ function parsePostureAnswer(value) {
|
|
|
409
501
|
}
|
|
410
502
|
|
|
411
503
|
//#endregion
|
|
504
|
+
exports.BEACON_EDGE_CAPABILITIES = BEACON_EDGE_CAPABILITIES;
|
|
505
|
+
exports.BEACON_EDGE_CAPABILITIES_HEADER = BEACON_EDGE_CAPABILITIES_HEADER;
|
|
412
506
|
exports.BEACON_MAX_BATCH_ID_LENGTH = BEACON_MAX_BATCH_ID_LENGTH;
|
|
413
507
|
exports.BEACON_MAX_EVENTS_PER_BATCH = BEACON_MAX_EVENTS_PER_BATCH;
|
|
414
508
|
exports.BEACON_ORIGIN_CAPABILITIES = BEACON_ORIGIN_CAPABILITIES;
|
|
@@ -418,8 +512,13 @@ exports.ResourceUsageSchema = ResourceUsageSchema;
|
|
|
418
512
|
exports.SESSION_IDLE_GAP_MAX_MS = SESSION_IDLE_GAP_MAX_MS;
|
|
419
513
|
exports.WorkerPoolConfigSchema = WorkerPoolConfigSchema;
|
|
420
514
|
exports.beaconBodyIdentity = beaconBodyIdentity;
|
|
515
|
+
exports.beaconBodyIdentityWithKeyless = beaconBodyIdentityWithKeyless;
|
|
516
|
+
exports.beaconEdgeCapabilitiesHeaderValue = beaconEdgeCapabilitiesHeaderValue;
|
|
517
|
+
exports.committedSessionId = committedSessionId;
|
|
421
518
|
exports.isBeaconIdentity = isBeaconIdentity;
|
|
519
|
+
exports.keyMayActForSession = keyMayActForSession;
|
|
422
520
|
exports.parseBeaconConfig = parseBeaconConfig;
|
|
521
|
+
exports.parseBeaconEdgeCapabilities = parseBeaconEdgeCapabilities;
|
|
423
522
|
exports.parseBeaconWorkerMessage = parseBeaconWorkerMessage;
|
|
424
523
|
exports.parseCircuitBreakerConfig = parseCircuitBreakerConfig;
|
|
425
524
|
exports.parseOfflineQueueEntry = parseOfflineQueueEntry;
|
|
@@ -430,4 +529,9 @@ exports.parseWorkerCapabilities = parseWorkerCapabilities;
|
|
|
430
529
|
exports.parseWorkerError = parseWorkerError;
|
|
431
530
|
exports.parseWorkerMessage = parseWorkerMessage;
|
|
432
531
|
exports.parseWorkerPoolConfig = parseWorkerPoolConfig;
|
|
532
|
+
exports.sessionCommitsToJkt = sessionCommitsToJkt;
|
|
533
|
+
exports.sessionCommitsToThumbprint = sessionCommitsToThumbprint;
|
|
534
|
+
exports.sessionIdFromCommitment = sessionIdFromCommitment;
|
|
535
|
+
exports.sessionKeyCommitment = sessionKeyCommitment;
|
|
536
|
+
exports.thumbprintCommitment = thumbprintCommitment;
|
|
433
537
|
exports.withAdoptedSession = withAdoptedSession;
|