import { Request, Response } from 'express'; import { TicketIssuer, ValidationResult } from '@agntor/sdk'; /** * Configuration for the trust proxy middleware */ export interface TrustProxyConfig { /** Ticket issuer instance for validation */ issuer: TicketIssuer; /** Custom header name for the audit proof (default: 'x-agntor-proof') */ headerName?: string; /** Whether to require audit proof for all requests (default: true) */ requireProof?: boolean; /** Custom error handler */ onError?: (error: TrustProxyError, req: Request, res: Response) => void; /** Custom success handler (for logging/metrics) */ onSuccess?: (result: ValidationResult, req: Request) => void; /** Whether to extract transaction value from request (default: true) */ validateTransactionValue?: boolean; /** Path to transaction value in request body (default: 'amount') */ transactionValuePath?: string; /** Path to MCP server name in request body (default: 'mcp_server') */ mcpServerPath?: string; /** Path to payment protocol in request body (default: 'payment_protocol') */ paymentProtocolPath?: string; /** Path to x402 payment proof in request body (default: 'x402_proof') */ x402PaymentProofPath?: string; /** Whether to guard incoming prompt/input for injection (default: false) */ guardInputs?: boolean; /** Path to the input field to guard (default: 'prompt' or 'input') */ inputPath?: string; /** Whether to redact PII/Secrets from outgoing responses (default: false) */ redactOutputs?: boolean; } /** * Extended Express Request with Agntor audit data */ export interface AgntorRequest extends Request { agntor?: { /** Validated audit ticket payload */ ticket: ValidationResult['payload']; /** Agent ID from the ticket */ agentId: string; /** Audit level of the certified agent */ auditLevel: string; }; } /** * Trust Proxy error types */ export declare class TrustProxyError extends Error { statusCode: number; errorCode: string; details?: unknown | undefined; constructor(message: string, statusCode: number, errorCode: string, details?: unknown | undefined); } /** * Response format for 402 Payment Required with Agntor context */ export interface Payment402Response { error: string; code: 402; message: string; payment_context: { required_proof: 'X-AGNTOR-Proof'; issuer_endpoint?: string; documentation?: string; }; } /** * Response format for 403 Forbidden (failed validation) */ export interface Forbidden403Response { error: string; code: 403; message: string; reason: string; error_code: string; } //# sourceMappingURL=types.d.ts.map