import { Journal } from "./journal.cjs"; import { Logger } from "./logger.cjs"; import { MetricsRegistry } from "./metrics.cjs"; import { ChaosAction, ChaosConfig, ChatCompletionRequest, Fixture } from "./types.cjs"; import * as http$1 from "node:http"; //#region src/chaos.d.ts /** * Evaluate chaos config and return the triggered action, or null if none. * Checks in order: drop, malformed, disconnect — first hit wins. */ declare function evaluateChaos(fixture: Fixture | null, serverDefaults?: ChaosConfig, rawHeaders?: http$1.IncomingHttpHeaders, logger?: Logger): ChaosAction | null; interface ChaosJournalContext { method: string; path: string; headers: Record; body: ChatCompletionRequest | null; } /** * Apply chaos to a request. Returns true if chaos was applied (caller should * return early), false if the request should proceed normally. * * `source` is required so the invariant "this handler only applies chaos in * the phase" is enforced at the type level. A future handler that grows * a proxy path MUST pass `"proxy"` explicitly; the default can't drift silently. */ declare function applyChaos(res: http$1.ServerResponse, fixture: Fixture | null, serverDefaults: ChaosConfig | undefined, rawHeaders: http$1.IncomingHttpHeaders, journal: Journal, context: ChaosJournalContext, source: "fixture" | "proxy" | "internal", registry?: MetricsRegistry, logger?: Logger): boolean; /** * Apply a specific (already-rolled) chaos action. Exposed so callers that roll * the dice themselves can dispatch without re-rolling — important when the * caller wants to branch on the action before committing (e.g. pre-flight vs. * post-response phases). * * `source` is required (not optional) so callers can't silently omit it on * one branch and journal an ambiguous entry. Pass `"fixture"` when a fixture * matched (or would have) and `"proxy"` when the request was headed for the * proxy path. */ //#endregion export { applyChaos, evaluateChaos }; //# sourceMappingURL=chaos.d.cts.map