// Types for kaito-base.js — written rather than left implicitly `any`, on the same criterion as // retry.d.ts: this is OUR module and getting it wrong is customer-facing. The return type is what // matters here. Under `any`, `base: resolveKaitoBase(...)` would compile identically whether the // function returned a string, `undefined`, or the raw env bag — and "the KAITO base is undefined" // is exactly the shape that sends a request to a URL nobody chose. /** * Where this Worker sends KAITO ingest and reindex calls. * * @param raw `env.KAITO_BASE`, if the deployment set one. Unset/blank/whitespace ⇒ `fallback` * byte-for-byte, so production (which sets nothing) does not move. * @param fallback the compiled-in production default. * @throws if `raw` is set but is not a plain absolute http(s) URL — FAIL CLOSED. It never quietly * returns `fallback` for a value somebody deliberately set; a typo that keeps pointing a * staging deploy at production's index is the accident this whole module exists for. */ export function resolveKaitoBase(raw: unknown, fallback: string): string;