import type { IncomingMessage } from 'node:http'; /** Body cap in bytes for a tool. `WIGOLO_SERVE_MAX_BODY_BYTES` overrides the * base cap; diff/extract get the larger cap when no override is set. */ export declare function bodyCapFor(tool: string): number; /** Per-route response deadline in ms, scaled by `WIGOLO_SERVE_TIMEOUT_SCALE`. */ export declare function deadlineFor(tool: string): number; /** In-flight cap on /v1 + shim; `WIGOLO_SERVE_MAX_CONCURRENCY` overrides. */ export declare function maxConcurrency(): number; export interface ClampSpec { tool: string; field: string; /** For scalar fields: the maximum value. For array fields: max item count. */ max: number; kind: 'scalar' | 'array'; } /** * Single source of truth for server-side param clamps, imported by both the * router (enforcement) and openapi.ts (bound injection) so the served bounds * can never drift from the enforced ones. */ export declare const CLAMP_TABLE: readonly ClampSpec[]; export interface ClampViolation { field: string; max: number; kind: 'scalar' | 'array'; } /** * Generic clamp check: compares body fields against the clamp table. Returns * the first violation or null. Array clamps only fire when the field is an * array (a string `query` is unbounded by this table). */ export declare function findClampViolation(tool: string, body: Record): ClampViolation | null; export declare class BodyTooLargeError extends Error { constructor(); } /** * Read and JSON-parse a request body, destroying the stream if it exceeds * `capBytes` (→ BodyTooLargeError). An empty body parses to `{}`. A parse * failure rejects with a SyntaxError (router maps to 400 invalid_json). */ export declare function readJsonBodyCapped(req: IncomingMessage, capBytes: number): Promise; /** Simple counting semaphore for the in-flight cap. Acquired pre-dispatch, * released ONLY when the handler promise settles (never at 504). */ export declare class ConcurrencySlots { private readonly cap; private inFlight; constructor(cap: number); tryAcquire(): boolean; release(): void; get active(): number; } //# sourceMappingURL=limits.d.ts.map