/** * Body Size Limit Middleware * * Prevents DoS via memory exhaustion by enforcing request body size limits. * - 1MB for standard API endpoints (tasks, learnings, runs) * - 5MB for spec batch ingestion endpoints (raw framework output) * - 10MB for sync endpoints (bulk data import/export) * * Uses two mechanisms: * 1. Content-Length header check for early rejection (fast path) * 2. MaxBodySize context for safety during body parsing (handles chunked encoding) */ import { HttpServerRequest, HttpServerResponse } from "@effect/platform"; import { Effect } from "effect"; /** Default body size limit: 1MB */ export declare const DEFAULT_MAX_BYTES: number; /** Sync endpoint body size limit: 10MB */ export declare const SYNC_MAX_BYTES: number; /** Spec batch endpoint body size limit: 5MB */ export declare const SPEC_BATCH_MAX_BYTES: number; /** * Get the max body size limit based on the request path. * Sync endpoints get a higher limit (10MB) since they handle bulk data. * Spec batch endpoint gets 5MB for framework-native payloads. * All other endpoints get 1MB. * @internal Exported for testing. */ export declare const getMaxBytes: (url: string) => number; /** * Body size limit middleware. * * Rejects requests with Content-Length exceeding the limit with 413 Payload Too Large. * Also sets MaxBodySize context as a safety net during body parsing * (handles chunked transfer encoding where Content-Length is absent). */ export declare const bodyLimitMiddleware: (httpApp: import("@effect/platform/HttpApp").Default) => Effect.Effect; //# sourceMappingURL=body-limit.d.ts.map