/** * Express/Connect middleware for x402-cfo. * * Wraps any Express app so every outbound x402 payment goes through * the CFO's budget enforcement, cost policies, and audit trail. * Also exposes a GET /_cfo endpoint for live spend monitoring. * * Usage: * import express from 'express'; * import { AgentCFO } from 'x402-cfo'; * import { createExpressMiddleware } from 'x402-cfo'; * * const app = express(); * const cfo = new AgentCFO({ wallet, budget: { daily: 50 } }); * app.use(createExpressMiddleware(cfo)); */ import type { AgentCFO } from './controller.js'; export interface ExpressMiddlewareOptions { /** Mount path for the dashboard endpoint. Default: '/_cfo' */ dashboardPath?: string; /** Enable the /_cfo dashboard endpoint. Default: true */ enableDashboard?: boolean; } /** * Create Express middleware that: * 1. Attaches the AgentCFO instance to req.cfo for route handlers * 2. Exposes a GET /_cfo endpoint returning live spend data as JSON * 3. Exposes a GET /_cfo/html endpoint returning a styled dashboard page */ export declare function createExpressMiddleware(cfo: AgentCFO, options?: ExpressMiddlewareOptions): (req: any, res: any, next: any) => any; //# sourceMappingURL=middleware.d.ts.map