/** * Shared attestor-claim plumbing used by both proof callers: the agent's MCP * `run_proof` (which resolves the owner key from the credential cache and * captures trace logs) and the app's verification runner (which signs with an * ephemeral per-session key and builds a nested-proof claim). Only those * concerns differ — building the HTTP params, resolving the attestor URL, and * parsing the claim response are identical, so they live here. */ import type { ProviderParams } from '@reclaimprotocol/attestor-core'; import type { ReclaimProvider } from '../provider/schema.ts'; /** One-time crypto backend init for `@reclaimprotocol/tls` (idempotent). The * package ships with an empty `crypto = {}` and defers the backend to the * caller; without this the first proof dies inside the TLS client with * `crypto.randomBytes is not a function`. Shared by every attestor caller — * the agent MCP `run_proof` tool and the app's verification runner. */ export declare function ensureAttestorCrypto(): void; /** Resolve the attestor websocket URL: explicit override → env → public * default. Resolved per-call so an env change or per-request override takes * effect without restarting. */ export declare function resolveAttestorUrl(override?: string): string; /** Map a provider's recipe straight to the attestor's HTTP * params — never synthesized from captured traffic. */ export declare function buildHttpParams(provider: ReclaimProvider): ProviderParams<'http'>; export interface ParsedClaim { /** ProviderClaimData: provider, parameters, context, owner, identifier, … */ claimData?: Record; extractedParameters: Record; extractedValue: string; identifier?: string; owner?: string; } /** Pull claimData + decoded `context.extractedParameters` (plus identifier / * owner) out of a `createClaimOnAttestor` result. The full result still * carries signatures the caller may need for nested-proof building. */ export declare function parseClaim(claim: unknown): ParsedClaim;