/* tslint:disable */ /* eslint-disable */ /** * Verify a signed rule bundle against the keys compiled into this build * and, only if every check passes, swap in the vendor IP ranges and * extend the pinned vendor-key expiries it carries. * * The host owns the fetch and the clock (`nowUnix`, whole seconds); the * engine decides what may be adopted. Never throws: anything that fails * verification comes back as `{ ok: false, code }` and leaves the * compiled-in data, or the last good bundle, in effect. See * [`crate::rule_bundle`]. * * # JS signature * * ```ts * type RuleBundleReport = * | { ok: true; version: number; unchanged: boolean; expiresAt: number; * ipVendorsUpdated: string[]; vendorsIgnored: string[]; * keyOutcomes: ReinstateOutcome[] } * | { ok: false; code: string; message: string }; * * function applyRuleBundle(bundleJson: string, nowUnix: number): RuleBundleReport; * ``` */ export function applyRuleBundle(bundle_json: string, now_unix: number): any; /** * Cross-boundary `engineInfo` wrapper: this build's [`EngineManifest`] * (attribution stamp plus the capabilities it enforces). * * [`EngineManifest`]: crate::capabilities::EngineManifest * * # JS signature * * ```ts * function engineInfo(): EngineManifest; * ``` */ export function engineInfo(): any; export function feedAttemptFinished(outcome: string): boolean; export function feedDemand(now_unix: number): string | undefined; export function feedNoteMiss(keyid: string, reason: string): boolean; export function feedStatus(now_unix: number): any; /** * Cross-boundary `render` wrapper: turn a `VerifyResult` into the * kya-os/http answer (status, ordered headers, body). See * [`crate::render::render`]. * * The input crosses as JSON text (`JSON.stringify`), so a key whose value is * `undefined` is absent exactly as it is for the WASI and uniffi bindings, * which share [`crate::render::render_json`]. Never throws: a failure comes * back as `{ success: false, error: { code, message } }`. * * # JS signature * * ```ts * function render(input: { result: VerifyResult; options?: RenderOptions }): RenderEnvelope; * ``` */ export function render(input_js: any): any; /** * Cross-boundary `rootNeeds` wrapper: the DID-document needs of every * trusted root, which a host that warms a cache registers at startup. See * [`crate::resolution::root_needs_json`]. Never throws. * * # JS signature * * ```ts * function rootNeeds(contextJson: string): { needs: Need[] } | { error: string }; * ``` */ export function rootNeeds(context_json: string): any; export function vendorKeys(): any; /** * Cross-boundary `verify` wrapper. The JS host calls `engine.verify(input, * ctxSpec)`; on success it gets a [`VerifyResult`] JSON object; on * infrastructure failure (or malformed input) it gets a thrown JS error * whose message names the failure mode. * * **Error semantics**: * * - Verification *verdicts* (Block/Challenge/etc.) surface inside the * returned `VerifyResult` — they are not thrown. * - Engine [`VerifyError`][crate::error::VerifyError] (resolver / cache / * reputation / policy infra failures) surface as thrown JS errors. * - Serde deserialisation failures (malformed JS input) surface as thrown * JS errors too, mirroring the typed-vs-thrown split. * * With `ctx.resolution: "engine-directed"` the result is either a * `VerifyResult` or `{ needs: Need[] }` (see [`crate::resolution`]); a host * tells them apart by the `needs` key. * * # JS signature * * ```ts * function verify(input: AgentRequest, ctx: ContextSpec): VerifyResult | { needs: Need[] }; * ``` */ export function verify(input_js: any, ctx_js: any): any; /** * Cross-boundary `verifyDelegation` wrapper — the standalone Layer-2-only * (`Authorization: Bearer `) path, `draft-kya-http-02` * §4.3 (issue #3344). The JS host calls * `engine.verifyDelegation(input, ctxSpec)` where `input` is a * [`DelegationVerifyInput`] (`{ credential, requiredScopes }`) and the * credential was extracted from wherever it arrived (the engine reads no * transport header). The resource server's own org DID rides on the same * [`ContextSpec`] as `resourceOrgDid`. * * Same error semantics as [`verify_wasm`]: verdicts (Permit/Block) ride * inside the returned `VerifyResult`; infra failures + malformed input throw. * Engine-directed mode answers as [`verify_wasm`] does. * * # JS signature * * ```ts * function verifyDelegation( * input: DelegationVerifyInput, * ctx: ContextSpec, * ): VerifyResult | { needs: Need[] }; * ``` */ export function verifyDelegation(input_js: any, ctx_js: any): any; /** * Cross-boundary `verifyStatusList` wrapper: verify a fetched status list * against its issuer's DID document and return its set indices. See * [`crate::status_list::verify_status_list_json`] for the request and the * result; the WASI and uniffi bindings share it. * * The request crosses as JSON text so the envelope and DID document reach * the engine as the exact response bodies the host fetched. Never throws: * every failure comes back as `{ ok: false, code, message }`. * * # JS signature * * ```ts * type StatusListResult = * | { ok: true; envelope: 'StatusList2021' | 'BitstringStatusList'; url: string; * issuer: string; issuedAt: number; expiresAt: number; setIndices: number[] } * | { ok: false; code: string; message: string }; * * function verifyStatusList(requestJson: string): StatusListResult; * ``` */ export function verifyStatusList(request_json: string): any;