@agenticprimitives/edge-cloudflare 0.0.0-alpha.2 → 0.0.0-alpha.21
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/README.md +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/request.d.ts +3 -3
- package/dist/request.d.ts.map +1 -1
- package/dist/request.js +3 -3
- package/dist/request.js.map +1 -1
- package/dist/transport-evidence.d.ts +45 -0
- package/dist/transport-evidence.d.ts.map +1 -0
- package/dist/transport-evidence.js +72 -0
- package/dist/transport-evidence.js.map +1 -0
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +25 -13
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @agenticprimitives/edge-cloudflare
|
|
2
2
|
|
|
3
|
+
> Part of **[Agentic Primitives](https://agenticprimitives.dev)** — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. [Developer kit](https://github.com/agentictrustlabs/agentic-primitives) · [All packages](https://agenticprimitives.dev/developers)
|
|
4
|
+
|
|
3
5
|
The Cloudflare adapter for [`@agenticprimitives/edge-runtime`](../edge-runtime) (spec 288 §5). It maps the
|
|
4
6
|
platform runtime onto the vendor-neutral admission core — and owns no authority
|
|
5
7
|
([ADR-0043](../../docs/architecture/decisions/0043-edge-owns-admission-never-authority.md)).
|
package/dist/index.d.ts
CHANGED
|
@@ -5,4 +5,6 @@ export type { ExtractedRequest } from './request.js';
|
|
|
5
5
|
export { createCloudflareRateLimiter } from './rate-limiter.js';
|
|
6
6
|
export { dispatchToBinding } from './dispatch.js';
|
|
7
7
|
export type { DispatchInit } from './dispatch.js';
|
|
8
|
+
export { cfTlsClientAuthOf, transportEvidenceFromCf, transportEvidenceFromRequest, } from './transport-evidence.js';
|
|
9
|
+
export type { CfTlsClientAuth, TransportEvidenceOptions } from './transport-evidence.js';
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACpE,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACpE,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,4 +4,7 @@ export { PACKAGE_NAME, PACKAGE_STATUS, SPEC_REF } from './types.js';
|
|
|
4
4
|
export { extractAdmissionRequest } from './request.js';
|
|
5
5
|
export { createCloudflareRateLimiter } from './rate-limiter.js';
|
|
6
6
|
export { dispatchToBinding } from './dispatch.js';
|
|
7
|
+
// Optional mTLS evidence (spec 339 §10). Produces evidence; decides nothing — admission decides
|
|
8
|
+
// what a certificate is worth (ADR-0043). Absent evidence is a NORMAL request.
|
|
9
|
+
export { cfTlsClientAuthOf, transportEvidenceFromCf, transportEvidenceFromRequest, } from './transport-evidence.js';
|
|
7
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,0EAA0E;AAE1E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,0EAA0E;AAE1E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,gGAAgG;AAChG,+EAA+E;AAC/E,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC"}
|
package/dist/request.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EdgeIngressRequest } from '@agenticprimitives/edge-runtime';
|
|
2
2
|
export interface ExtractedRequest {
|
|
3
|
-
admission:
|
|
3
|
+
admission: EdgeIngressRequest;
|
|
4
4
|
/** The exact body bytes for byte-identical downstream forwarding (undefined for bodyless requests). */
|
|
5
5
|
rawBody?: ArrayBuffer;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* Extract an `
|
|
8
|
+
* Extract an `EdgeIngressRequest` (+ the raw body for exact forwarding) from a Web `Request`.
|
|
9
9
|
* Reads the body once; safe for GET/HEAD (no body). The client IP is `cf-connecting-ip` — a
|
|
10
10
|
* pre-verification bucket key only, never trusted as authority.
|
|
11
11
|
*/
|
package/dist/request.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,kBAAkB,CAAC;IAC9B,uGAAuG;IACvG,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAWD;;;;GAIG;AACH,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAgBzF"}
|
package/dist/request.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// Map a Web `Request` to the runtime-neutral `
|
|
1
|
+
// Map a Web `Request` to the runtime-neutral `EdgeIngressRequest`, preserving the EXACT body bytes.
|
|
2
2
|
//
|
|
3
3
|
// The body is read ONCE here as an ArrayBuffer: `bodyBytes` is its byteLength, `bodyText` is the
|
|
4
4
|
// UTF-8 decode (for the admission JSON depth/envelope checks), and the SAME ArrayBuffer is returned
|
|
5
5
|
// as `rawBody` so the dispatcher forwards byte-identical bytes downstream — the native pipeline
|
|
6
6
|
// re-hashes them (spec 287 / hashA2aMessage), so a re-serialize would break the proof.
|
|
7
|
-
/** Lowercased header map (the runtime contract: `
|
|
7
|
+
/** Lowercased header map (the runtime contract: `EdgeIngressRequest.headers` keys are lowercased). */
|
|
8
8
|
function lowercaseHeaders(h) {
|
|
9
9
|
const out = {};
|
|
10
10
|
h.forEach((value, key) => {
|
|
@@ -13,7 +13,7 @@ function lowercaseHeaders(h) {
|
|
|
13
13
|
return out;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Extract an `
|
|
16
|
+
* Extract an `EdgeIngressRequest` (+ the raw body for exact forwarding) from a Web `Request`.
|
|
17
17
|
* Reads the body once; safe for GET/HEAD (no body). The client IP is `cf-connecting-ip` — a
|
|
18
18
|
* pre-verification bucket key only, never trusted as authority.
|
|
19
19
|
*/
|
package/dist/request.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,EAAE;AACF,iGAAiG;AACjG,oGAAoG;AACpG,gGAAgG;AAChG,uFAAuF;AAUvF,sGAAsG;AACtG,SAAS,gBAAgB,CAAC,CAAU;IAClC,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACvB,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,KAAK,CAAC;IACjC,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,OAAgB;IAC5D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,KAAK,KAAK,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,CAAC;IACtE,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,MAAM,QAAQ,GAAG,OAAO,IAAI,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEnG,MAAM,SAAS,GAAuB;QACpC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,IAAI,EAAE,GAAG,CAAC,QAAQ;QAClB,OAAO;QACP,EAAE,EAAE,OAAO,CAAC,kBAAkB,CAAC;QAC/B,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC3C,QAAQ;KACT,CAAC;IACF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { OptionalTransportEvidence } from '@agenticprimitives/admission';
|
|
2
|
+
/**
|
|
3
|
+
* The subset of Cloudflare's `tlsClientAuth` this reads.
|
|
4
|
+
*
|
|
5
|
+
* Declared locally rather than imported from `@cloudflare/workers-types` so the mapping is explicit
|
|
6
|
+
* and testable without a Workers runtime. Every field is optional because Cloudflare omits the whole
|
|
7
|
+
* object on a hostname with no client-certificate rule.
|
|
8
|
+
*/
|
|
9
|
+
export interface CfTlsClientAuth {
|
|
10
|
+
/** `'1'` when the client presented a certificate. */
|
|
11
|
+
certPresented?: string;
|
|
12
|
+
/** `'SUCCESS'` when the chain validated against the configured CA. */
|
|
13
|
+
certVerified?: string;
|
|
14
|
+
/** `'1'` when the certificate is revoked. */
|
|
15
|
+
certRevoked?: string;
|
|
16
|
+
certFingerprintSHA256?: string;
|
|
17
|
+
certNotBefore?: string;
|
|
18
|
+
certNotAfter?: string;
|
|
19
|
+
certSubjectDN?: string;
|
|
20
|
+
certIssuerDN?: string;
|
|
21
|
+
certSerial?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface TransportEvidenceOptions {
|
|
24
|
+
/**
|
|
25
|
+
* Fingerprints (SHA-256, lowercase hex) this boundary expects.
|
|
26
|
+
*
|
|
27
|
+
* Supplied ⇒ `expectedPeerMatched` reports whether the presented certificate is one of them.
|
|
28
|
+
* Omitted ⇒ the field stays ABSENT, which downstream means "not checked" — never "matched".
|
|
29
|
+
*/
|
|
30
|
+
expectedPeerFingerprints?: readonly string[];
|
|
31
|
+
/** Injected for tests. */
|
|
32
|
+
now?: () => Date;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Map a Cloudflare request's TLS client-auth result to admission evidence.
|
|
36
|
+
*
|
|
37
|
+
* Returns HTTPS-baseline evidence when no certificate was presented — which is the expected case for
|
|
38
|
+
* the ordinary endpoint, not a degraded one.
|
|
39
|
+
*/
|
|
40
|
+
export declare function transportEvidenceFromCf(tls: CfTlsClientAuth | undefined, opts?: TransportEvidenceOptions): OptionalTransportEvidence;
|
|
41
|
+
/** Read `tlsClientAuth` off a Web `Request` in a Workers runtime, tolerating its absence. */
|
|
42
|
+
export declare function cfTlsClientAuthOf(request: Request): CfTlsClientAuth | undefined;
|
|
43
|
+
/** Convenience: evidence straight off a request. Always returns something — HTTPS at minimum. */
|
|
44
|
+
export declare function transportEvidenceFromRequest(request: Request, opts?: TransportEvidenceOptions): OptionalTransportEvidence;
|
|
45
|
+
//# sourceMappingURL=transport-evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport-evidence.d.ts","sourceRoot":"","sources":["../src/transport-evidence.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,yBAAyB,EAAsB,MAAM,8BAA8B,CAAC;AAElG;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,0BAA0B;IAC1B,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAID;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,eAAe,GAAG,SAAS,EAChC,IAAI,GAAE,wBAA6B,GAClC,yBAAyB,CA2C3B;AAED,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CAG/E;AAED,iGAAiG;AACjG,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,OAAO,EAChB,IAAI,GAAE,wBAA6B,GAClC,yBAAyB,CAE3B"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Client-certificate evidence from a Cloudflare request (spec 339 §10 — Phase 5).
|
|
2
|
+
//
|
|
3
|
+
// Cloudflare surfaces mTLS results on `request.cf.tlsClientAuth` when a client-certificate rule is
|
|
4
|
+
// configured on the hostname. This maps that to the provider-neutral `OptionalTransportEvidence` the
|
|
5
|
+
// admission core consumes — and does nothing else. No policy decision is made here; the edge reports
|
|
6
|
+
// what the handshake proved and admission decides what it is worth (ADR-0043).
|
|
7
|
+
//
|
|
8
|
+
// "OPTIONAL" IS IMPLEMENTED AS: absent evidence is a NORMAL request, never an error.
|
|
9
|
+
// A baseline endpoint has no `tlsClientAuth` at all, and this returns plain HTTPS evidence for it.
|
|
10
|
+
// The failure mode being avoided is an edge that throws or 400s when a certificate is missing, which
|
|
11
|
+
// would make the optional profile mandatory by accident on the day someone enables the binding.
|
|
12
|
+
//
|
|
13
|
+
// FAIL-CLOSED ON THE FLAGS, NOT ON THE REQUEST. A certificate that is presented but unverified, or
|
|
14
|
+
// revoked, yields `certificateValid: false` — evidence that it did NOT prove what it appears to.
|
|
15
|
+
// Admission then observes `HTTPS` (see `observedTransportAssurance`), so an unverified certificate
|
|
16
|
+
// buys exactly nothing rather than being trusted because it exists.
|
|
17
|
+
//
|
|
18
|
+
// WHAT THIS DELIBERATELY DOES NOT DO:
|
|
19
|
+
// • parse the certificate (that is `profile-mtls`, if it is ever needed)
|
|
20
|
+
// • resolve a SPIFFE ID to an agent (that needs a signed WorkloadIdentityBinding, spec 339 §11)
|
|
21
|
+
// • decide anything
|
|
22
|
+
const norm = (v) => v?.trim().toLowerCase().replace(/^sha256:/, '');
|
|
23
|
+
/**
|
|
24
|
+
* Map a Cloudflare request's TLS client-auth result to admission evidence.
|
|
25
|
+
*
|
|
26
|
+
* Returns HTTPS-baseline evidence when no certificate was presented — which is the expected case for
|
|
27
|
+
* the ordinary endpoint, not a degraded one.
|
|
28
|
+
*/
|
|
29
|
+
export function transportEvidenceFromCf(tls, opts = {}) {
|
|
30
|
+
const now = (opts.now ?? (() => new Date()))();
|
|
31
|
+
// No client-certificate rule on this hostname, or no certificate offered. Baseline. Normal.
|
|
32
|
+
if (!tls || tls.certPresented !== '1') {
|
|
33
|
+
return { transportAssurance: 'HTTPS', mtls: false, validation: {} };
|
|
34
|
+
}
|
|
35
|
+
// Presented. Now: did it actually prove anything?
|
|
36
|
+
const verified = tls.certVerified === 'SUCCESS';
|
|
37
|
+
const revoked = tls.certRevoked === '1';
|
|
38
|
+
// Window check. An expired-but-"SUCCESS" certificate should not read as valid; Cloudflare's
|
|
39
|
+
// verification already covers this, but re-deriving it here means a misconfiguration upstream
|
|
40
|
+
// cannot silently promote assurance.
|
|
41
|
+
const notBefore = tls.certNotBefore ? Date.parse(tls.certNotBefore) : NaN;
|
|
42
|
+
const notAfter = tls.certNotAfter ? Date.parse(tls.certNotAfter) : NaN;
|
|
43
|
+
const inWindow = (Number.isNaN(notBefore) || notBefore <= now.getTime()) &&
|
|
44
|
+
(Number.isNaN(notAfter) || notAfter > now.getTime());
|
|
45
|
+
const fingerprint = norm(tls.certFingerprintSHA256);
|
|
46
|
+
// Only reported when an expectation was actually configured. Absent ≠ matched.
|
|
47
|
+
const expectedPeerMatched = opts.expectedPeerFingerprints === undefined
|
|
48
|
+
? undefined
|
|
49
|
+
: !!fingerprint && opts.expectedPeerFingerprints.some((f) => norm(f) === fingerprint);
|
|
50
|
+
const certificateValid = verified && !revoked && inWindow;
|
|
51
|
+
// The LABEL, which is advisory. `observedTransportAssurance` in the admission core recomputes the
|
|
52
|
+
// effective level from `validation`, so a wrong label here cannot promote a request.
|
|
53
|
+
const transportAssurance = certificateValid ? 'MTLS' : 'HTTPS';
|
|
54
|
+
return {
|
|
55
|
+
transportAssurance,
|
|
56
|
+
mtls: true,
|
|
57
|
+
clientCertificateSha256: fingerprint ? `sha256:${fingerprint}` : undefined,
|
|
58
|
+
certificateNotBefore: tls.certNotBefore,
|
|
59
|
+
certificateNotAfter: tls.certNotAfter,
|
|
60
|
+
validation: { certificateValid, expectedPeerMatched },
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** Read `tlsClientAuth` off a Web `Request` in a Workers runtime, tolerating its absence. */
|
|
64
|
+
export function cfTlsClientAuthOf(request) {
|
|
65
|
+
const cf = request.cf;
|
|
66
|
+
return cf?.tlsClientAuth;
|
|
67
|
+
}
|
|
68
|
+
/** Convenience: evidence straight off a request. Always returns something — HTTPS at minimum. */
|
|
69
|
+
export function transportEvidenceFromRequest(request, opts = {}) {
|
|
70
|
+
return transportEvidenceFromCf(cfTlsClientAuthOf(request), opts);
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=transport-evidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport-evidence.js","sourceRoot":"","sources":["../src/transport-evidence.ts"],"names":[],"mappings":"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"}
|
package/dist/types.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @agenticprimitives/edge-cloudflare — the Cloudflare adapter for edge-runtime (spec 288 §5).
|
|
2
2
|
//
|
|
3
3
|
// Implements the platform bits the vendor-neutral admission core can't: mapping a Web `Request`
|
|
4
|
-
// to the runtime's `
|
|
4
|
+
// to the runtime's `EdgeIngressRequest` (preserving the exact body bytes the native pipeline
|
|
5
5
|
// re-hashes for spec 287 / hashA2aMessage), the Workers rate-limiter binding as a `SoftRateLimiter`
|
|
6
6
|
// (Stage-1 abuse only — local, permissive, eventually-consistent), and Service-Binding dispatch to
|
|
7
7
|
// the private A2A/MCP origins. It owns NO authority (ADR-0043) — it only shuttles bytes.
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AACF,gGAAgG;AAChG,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AACF,gGAAgG;AAChG,6FAA6F;AAC7F,oGAAoG;AACpG,mGAAmG;AACnG,yFAAyF;AAEzF,MAAM,CAAC,MAAM,YAAY,GAAG,oCAA6C,CAAC;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,YAAqB,CAAC;AACpD,MAAM,CAAC,MAAM,QAAQ,GAAG,yDAAkE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/edge-cloudflare",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.21",
|
|
4
4
|
"description": "Cloudflare adapter for @agenticprimitives/edge-runtime: Request→AdmissionRequest extraction (exact-byte preserving), the Workers rate-limiter binding as a SoftRateLimiter, and Service-Binding dispatch. Imports the platform runtime; the edge core never does.",
|
|
5
|
+
"homepage": "https://agenticprimitives.dev",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
|
|
8
|
+
},
|
|
9
|
+
"author": {
|
|
10
|
+
"name": "Agentic Trust Labs",
|
|
11
|
+
"url": "https://agenticprimitives.dev"
|
|
12
|
+
},
|
|
5
13
|
"license": "MIT",
|
|
6
14
|
"repository": {
|
|
7
15
|
"type": "git",
|
|
8
16
|
"url": "git+https://github.com/agentictrustlabs/agenticprimitives.git",
|
|
9
17
|
"directory": "packages/edge-cloudflare"
|
|
10
18
|
},
|
|
11
|
-
"homepage": "https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/edge-cloudflare",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
|
|
14
|
-
},
|
|
15
19
|
"type": "module",
|
|
16
20
|
"main": "./dist/index.js",
|
|
17
21
|
"types": "./dist/index.d.ts",
|
|
@@ -31,23 +35,31 @@
|
|
|
31
35
|
"access": "public"
|
|
32
36
|
},
|
|
33
37
|
"peerDependencies": {
|
|
34
|
-
"@agenticprimitives/surface-catalog": "0.0.0-alpha.
|
|
35
|
-
"@agenticprimitives/edge-runtime": "0.0.0-alpha.
|
|
36
|
-
"@agenticprimitives/rate-control": "0.0.0-alpha.
|
|
38
|
+
"@agenticprimitives/surface-catalog": "^0.0.0-alpha.5",
|
|
39
|
+
"@agenticprimitives/edge-runtime": "^0.0.0-alpha.21",
|
|
40
|
+
"@agenticprimitives/rate-control": "^0.0.0-alpha.5"
|
|
37
41
|
},
|
|
38
42
|
"devDependencies": {
|
|
39
|
-
"vitest": "^4.1.
|
|
40
|
-
"@agenticprimitives/surface-catalog": "0.0.0-alpha.
|
|
41
|
-
"@agenticprimitives/edge-runtime": "0.0.0-alpha.
|
|
42
|
-
"@agenticprimitives/rate-control": "0.0.0-alpha.
|
|
43
|
+
"vitest": "^4.1.11",
|
|
44
|
+
"@agenticprimitives/surface-catalog": "0.0.0-alpha.5",
|
|
45
|
+
"@agenticprimitives/edge-runtime": "0.0.0-alpha.21",
|
|
46
|
+
"@agenticprimitives/rate-control": "0.0.0-alpha.5"
|
|
43
47
|
},
|
|
44
48
|
"keywords": [
|
|
45
49
|
"agentic",
|
|
46
50
|
"primitives",
|
|
47
51
|
"edge",
|
|
48
52
|
"cloudflare",
|
|
49
|
-
"adapter"
|
|
53
|
+
"adapter",
|
|
54
|
+
"agentic-primitives",
|
|
55
|
+
"agenticprimitives",
|
|
56
|
+
"ai-agents",
|
|
57
|
+
"agent-authority",
|
|
58
|
+
"agentic-trust"
|
|
50
59
|
],
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@agenticprimitives/admission": "0.0.0-alpha.20"
|
|
62
|
+
},
|
|
51
63
|
"scripts": {
|
|
52
64
|
"build": "tsc -p tsconfig.build.json",
|
|
53
65
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|