/**
 * index.ts — Cloudflare Worker entry point for QuantRisk MCP.
 *
 * Routes:
 *   POST /mcp                → MCP Streamable HTTP transport
 *   POST /stripe-webhook     → Stripe webhook handler (tier upgrades/downgrades)
 *   GET  /upgrade            → HTML page with "Subscribe to Pro" CTA
 *   GET  /checkout           → 303 redirect to Stripe-hosted Checkout
 *   GET  /checkout/success   → claims the API key, displays it to the user
 *   GET  /checkout/cancel    → cancel landing page
 *   GET  /health             → health check
 *   GET  /                   → service summary (JSON)
 *
 * Key flow (subscription → API key → tier upgrade):
 *
 *   1. /checkout generates a fresh `qr_<uuidhex>` API key and embeds it in the
 *      Checkout Session's `subscription_data.metadata.api_key`. Stripe copies
 *      that metadata onto the Subscription, so every subsequent webhook event
 *      for that subscription carries the same key.
 *
 *   2. After payment, Stripe redirects the user to /checkout/success with
 *      `?session_id=cs_…`. The handler reads the api_key + customer +
 *      subscription off the session and calls the UserState DO's POST /set-key
 *      to mark the DO as claimed (tier=paid, key valid).
 *
 *   3. In parallel, Stripe sends `customer.subscription.created` to
 *      /stripe-webhook. The handler reads `metadata.api_key` from the
 *      subscription and routes the tier change to the same DO. The two paths
 *      are idempotent — whoever wins, the end state is the same.
 *
 * Durable Object export:
 *   UserState                — re-exported so Cloudflare can locate the class
 *                              when resolving the USER_STATE binding.
 */
import { type Env } from "./server.js";
export { UserState } from "./auth/user-state.js";
declare const _default: {
    fetch(request: Request, env: Env, _ctx: ExecutionContext): Promise<Response>;
};
export default _default;
//# sourceMappingURL=index.d.ts.map