/** * Schema-driven data exchange with external service endpoints. * * Three pillars: endpoint + schema + identity. * Transport (fetch, Playwright, gRPC) is an implementation detail. * The value is schema enforcement and credential resolution — * validating both sides of the exchange and resolving auth from * the connection store at the last mile. */ /** * Validate data against a JSON Schema. * * Returns a list of human-readable error strings (empty when valid). */ export declare function validateSchema(data: unknown, schema: Record): { valid: boolean; errors: string[]; }; /** * Exchange data with an external service endpoint under schema enforcement. * * 1. If request_schema provided, validate body before sending. * On failure: return immediately (never send the request). * 2. Make the HTTP call (transport layer — currently Node.js fetch). * 3. Parse response body (JSON auto-detect). * 4. If response_schema provided, validate response after receiving. * 5. Return result with validated flag and any validation_errors. */ export declare function exchange(args: { endpoint?: string; url?: string; method: string; headers?: Record; query?: Record; body?: unknown; request_schema?: Record; response_schema?: Record; timeout_ms?: number; credential_provider?: string; credential_label?: string; auth_scheme?: string; auth_header?: string; }): Promise<{ status: number; data: unknown; headers: Record; elapsed_ms: number; validated: boolean; validation_errors: string[]; }>;