import type { Credential, DcqlQuery } from "../../types.js"; import type { CeremonyOrder } from "../types.js"; /** One policy credential's contribution to the combined query. */ export interface DelegatedDcqlEntry { /** The POLICY credential id (`age` / `payment` / a custom id) — unique per registry. */ credentialId: string; query: DcqlQuery; } /** The merged query PLUS the map from each merged credential id back to the POLICY * credential it belongs to. `/request` sends the query; `/verify` uses `idMap` to route * the verifier's disclosed claims (keyed by merged id) back to the right policy * credential's own `verify` — one definition of the id scheme, so the two cannot drift. */ export interface MergedDelegatedDcql { query: DcqlQuery; /** merged credential id → policy credential id (e.g. `age_mdl` → `age`, `payment` → `payment`). */ idMap: Map; } /** * Merge per-credential DCQL into one query, namespacing ids and preserving each * source query's alternatives as its own `credential_sets` entry. */ export declare function mergeDelegatedDcql(entries: DelegatedDcqlEntry[]): MergedDelegatedDcql; /** * The credentials this order must present in the delegated ceremony: every registered * policy credential that BLOCKS completion (`gate()` — age and custom gates — or * `authorize()` — payment) and whose `appliesTo` holds for the RE-PRICED order * (invariant 2: applicability is re-derived from catalog-priced lines, never a token). * * `discount()` credentials are excluded: a discount is opted into, not demanded, so * folding one into the required set would turn a benefit into a blocking requirement. */ export declare function delegatedPolicyEntries(registry: ReadonlyMap | undefined, order: CeremonyOrder): DelegatedDcqlEntry[];