/** * Parsing and validating the `routing` block of a config document (HOTSPOT-03). * * `parseRouting` plus the thirty-six declarations only it reaches: the nine sub-block parsers * (`parseQuotaEnforcement`, `parseLatencyDemotion`, `parseHedge`, `parseProbation`, `parseCrawl`, * `parseMcpSettings`, `parseLaneProbe`, `parseDispatchWalk`, `parseSticky`) assembled by `parseOptionalBlocks`, * `parseOffload`, the top-level field parsers `assertNoReservedProviderNames`, `parseDefault`, * `parseTiers` and `parseSubagents`, the pool trio `parsePoolPolicy`/`parsePoolEntry`/`parsePools`, * the ladder family (`parseLadder`, `parseLadders`, `parseCliLane`, `parseSpawnEnv` and its three * placeholder tokens), the disabled-provider degradation family (`dropDisabledSpecs`, * `dropDisabledRungs`, `pruneDisabledSpecEntries`, `degradeDisabledRouting`), the resolvability * trio `assertSpecResolvable`/`assertRungsResolvable`/`assertRoutingResolvable`, * `hasAsciiControl`, `DEFAULT_LANE_PROBE`, `DEFAULT_DISPATCH_WALK` and `EFFORT_LEVEL_SET`. * Roughly 700 lines out of a 2,000-line `config.ts`. * * ⚠ **It imports `config-types.js` and `spec.js`, and NOTHING else.** That is the property the item * asks for, and it is why `spec.ts` had to exist first: this parser needs `POOL_PREFIX`, * `AUTO_MODEL` and `splitSpec`, and reaching into `config.js` for them would be a cycle straight * back into the file it was extracted from. The dependency runs one way — `config.ts` imports this * module and re-exports its three publicly-consumed names, so no other importer changed. * * ⚠ Everything here is PURE over its inputs: no IO, no clock, no randomness, no `await`. A config * document goes in and either a validated `Routing` comes out or a `ConfigError` is thrown. Keep it * that way — the request path must never be reachable from a parser, and a parser that read the * filesystem could not be tested by handing it a literal. * * ⚠ A parse failure here is LOUD by design. An unknown key in a `compat`, `limits`, `hedge`, * `latency` or `laneProbe` block is a hard load error naming the key, because an ignored typo reads * as a declaration that took effect while the wire was unchanged. The one deliberate exception is * an unset `${ENV}`, which DISABLES one provider rather than aborting startup: this proxy fronts * every client session, so refusing to start would turn one unused optional provider into a total * outage. See the degradation rules in `CLAUDE.md`. */ import { type DispatchWalkOutlierSettings, type DispatchWalkSettings, type LaneProbeSettings, type OffloadConfig, type ProviderConfig, type Routing } from "../config-types.js"; export declare function parseRouting(raw: unknown, providers: Record, overrideDefault: string | undefined, warnings?: string[], disabledProviders?: Set): Routing; export declare const DEFAULT_LANE_PROBE: LaneProbeSettings; /** * Defaults for the automatic lane walk. **ON**. The three attempt-budget values remain in this * object only for backward-compatible config parsing since v0.84; `idleMs` is the sole walk * stopping policy. `attemptMinSamples` remains live for history fallback and outlier demotion. */ export declare const DEFAULT_DISPATCH_WALK_OUTLIER: DispatchWalkOutlierSettings; export declare const DEFAULT_DISPATCH_WALK: DispatchWalkSettings; /** Parse the legacy global switch or the independently keyed client-rule form. */ export declare function parseOffload(raw: unknown): OffloadConfig;