import { $ as RuleBundleRejectionCode, E as FeedDemandReason, G as ReinstateRefusalReason, K as ReinstateRefusedOutcome, Q as RuleBundleRejected, T as FeedAttemptOutcome, U as ReinstateExtendedOutcome, W as ReinstateOutcome, Z as RuleBundleApplied, ct as VendorKeyFeedKeyStatus, dt as VendorKeyMissReason, et as RuleBundleReport, g as Decision, i as AdoptedVendorKeys, j as KeySetOutcome, l as BlockReason, lt as VendorKeyFeedStatus, q as ReinstateUnchangedOutcome, r as AdoptedVendorKey, ut as VendorKeyMiss } from "./types-BZXvyqcb.js"; import { a as VendorKeyFeedBindings, c as VendorKeyFeedOptions, d as getDefaultVendorKeyFeed, f as IncomingHttpLike, i as VendorKeyFeed, l as configureVendorKeyFeed, n as VENDOR_KEY_FEED_URL, o as VendorKeyFeedEvent, r as VendorKeyEdgeOptions, s as VendorKeyFeedFailureCode, t as MAX_RULE_BUNDLE_BYTES, u as createVendorKeyFeed } from "./feed-CbaIEv3h.js"; import { AssuranceTier } from "@kya-os/checkpoint-shared"; //#region src/policy-evaluator.d.ts /** * Owned, plain-data request the host hands to * {@link PolicyEvaluatorRuntime.authorize}. Mirrors the Rust * `AuthorizeInput` (`rust/crates/kya-os-engine/src/policy/authorize.rs`); * keys are camelCase across the wasm-bindgen boundary, matching every * other engine wire type. * * The evaluator is **synchronous over pre-resolved facts** (H-1 Kickoff * § 4.5): the host pre-fetches the agent's delegation chain, reputation, * etc. and ships the results here — no JS callbacks cross the boundary. * * `agentDid` and `reputation` are optional (omit or pass `undefined` for * an anonymous or reputation-less request); `grantedScopes` defaults to an * empty list when omitted. * * The attribute-based facts — `name`, `category`, `delegation`, `path` — * are optional too. They populate the principal / resource entity * attributes (`principal.name`, `principal.category`, * `principal.delegation`, `resource.path`) that attribute-based Cedar * policies reference. When omitted, the engine fills each with its default * (`""` for strings) so a policy comparing them evaluates to `false` * instead of erroring on an undefined attribute. */ interface AuthorizeInput { /** Server-owned application permission for this authenticated user/operation. * Never accept from request JSON, headers, classification, or clearance. */ applicationAuthorized?: boolean; /** Agent DID if identity has been established, otherwise omitted. */ agentDid?: string; /** Exact user DID asserted by a verified delegation issuer; not merchant IAM. */ authorizingUserDid?: string; /** The action being requested (e.g., `"book_flight"`). */ action: string; /** The resource being acted on (e.g., `"travel_api"`). */ resource: string; /** Scopes granted by the agent's delegation chain. Defaults to `[]`. */ grantedScopes?: string[]; /** Agent's reputation score in `[0.0, 1.0]`, if computed. */ reputation?: number; /** Tenant identifier. */ tenantId: string; /** Known-agent label (e.g. `"ClaudeDesktop"`) → `principal.name`. */ name?: string; /** Agent category (e.g. `"scraper"`) → `principal.category`. */ category?: string; /** Delegation posture (e.g. `"verified"`) → `principal.delegation`. */ delegation?: string; /** Resource path (e.g. `"/checkout"`) → `resource.path`. */ path?: string; /** * draft-kya-http-02 §1 assurance tier the request reached * (`anonymous` | `attested-bearer` | `key-bound` | `registered` | * `delegated`) → `context.assurance`. Defaults to `"anonymous"` (the * monotone floor) when omitted, so a policy gating on * `context.assurance == "delegated"` evaluates rather than erroring. */ assurance?: AssuranceTier; /** * Locally verified browser risk, independent of credential assurance. * `'cleared'` is the human step-up outcome: a request carrying a valid * `__Host-kya_clearance` JWT (verified by the host, bound to the * session cookie, 10-minute lifetime) → `context.integrity = "cleared"`, * which the engine-default policy permits. */ integrity?: 'agent-driven' | 'human' | 'insufficient' | 'unknown' | 'cleared'; /** * Detection confidence on the shared 0-100 scale → `principal.confidence` * (a Cedar Long). Absent stays absent — no default — so a caller that * never supplies this leaves the Cedar entity byte-identical to before * this field existed. */ confidence?: number; /** * Coarse IP-routing classification from the host's network context → * `context.ip_routing_type`. Omit when the host has no network context. */ ipRoutingType?: 'residential' | 'mobile' | 'datacenter' | 'hosting' | 'unknown'; /** * Whether the request's `trueIp` was flagged as a proxy/anonymization * exit → `context.is_proxy`. Omit when the host has no network context. */ isProxy?: boolean; /** * Coarse category of a confirmed proxy/anonymization service → * `context.proxy_type`. Omit when the host has no proxy verdict (same * posture as `isProxy` — only present once a proxy verdict was computed). */ proxyType?: 'vpn' | 'tor' | 'datacenter' | 'residential_proxy' | 'unknown'; /** * The host's IP-intelligence provider's confidence in the proxy verdict, * `0..=100` → `context.network_confidence` (a Cedar Long). Omit when the * host has no proxy verdict. */ networkConfidence?: number; /** * Gateway-computed request count for this client (session-cookie or * JA4+IP keyed) in the trailing 300-second window → * `context.request_rate_300s` (a Cedar Long). Omit when the host has no * velocity tracker for this request. */ requestRate300s?: number; } /** * Structural type of the WASM `PolicyEvaluator` class the cedar glue * exports. Pinned here so this bridge type-checks against the artifact's * `.d.ts` (`constructor(policy_text: string)`, `authorize(input): any`, * `free()`). */ interface WasmPolicyEvaluator { authorize(input: AuthorizeInput): unknown; free(): void; } /** * Host-facing wrapper around one compiled Cedar policy bundle. * * Construction compiles the bundle once; every {@link authorize} call * evaluates a single owned request against it without re-parsing policy * text (the compile-once / evaluate-many contract the engine upholds, * carried across the boundary). */ declare class PolicyEvaluatorRuntime { private readonly inner; /** * @param inner - The compiled WASM `PolicyEvaluator` handle. Built in * {@link createPolicyEvaluator}; reused by every {@link authorize} * call for the lifetime of this wrapper. */ constructor(inner: WasmPolicyEvaluator); /** * Authorize one owned request against the compiled policy bundle. * * The evaluator owns the fail-closed posture — a request it cannot * marshal into Cedar, or one matching no `permit`, comes back as a * {@link Decision} `Block` (not a thrown error). Authorization * *verdicts* never throw; they surface inside the returned value. * * @throws {Error} only for boundary faults the WASM glue rejects: a * malformed `input` that fails `AuthorizeInput` deserialisation, or a * failure serialising the resulting `Decision`. */ authorize(input: AuthorizeInput): Decision; /** * Release the compiled bundle's WASM memory. Call when the evaluator is * no longer needed; after this the wrapper must not be reused. */ free(): void; } //#endregion //#region src/engine/orchestrator/kya-signature-presentation.d.ts /** Routing only. The engine validates the full profile, including missing or * malformed counterparts. Match the same member boundaries as Rust and .NET; * never let a quoted parameter or another vendor's label select KYA. */ export declare function hasKyaSignatureMember(headers: IncomingHttpLike['headers']): boolean; //#endregion export { type AdoptedVendorKey, type AdoptedVendorKeys, type AuthorizeInput, type BlockReason, type Decision, type FeedAttemptOutcome, type FeedDemandReason, type KeySetOutcome, MAX_RULE_BUNDLE_BYTES, type PolicyEvaluatorRuntime, type ReinstateExtendedOutcome, type ReinstateOutcome, type ReinstateRefusalReason, type ReinstateRefusedOutcome, type ReinstateUnchangedOutcome, type RuleBundleApplied, type RuleBundleRejected, type RuleBundleRejectionCode, type RuleBundleReport, VENDOR_KEY_FEED_URL, type VendorKeyEdgeOptions, type VendorKeyFeed, type VendorKeyFeedBindings, type VendorKeyFeedEvent, type VendorKeyFeedFailureCode, type VendorKeyFeedKeyStatus, type VendorKeyFeedOptions, type VendorKeyFeedStatus, type VendorKeyMiss, type VendorKeyMissReason, configureVendorKeyFeed, createVendorKeyFeed, getDefaultVendorKeyFeed }; //# sourceMappingURL=index.d.ts.map