/** Used only when nothing has been published and nothing was configured. */ export declare const DEFAULT_API_URL = "http://localhost:3001"; /** * The published port, or `null` for anything that is not one. * * Decimal digits only. The writer is `formatServerPort()`, which emits * `${port}\n` and nothing else, so there is no lenient shape worth * accepting — while `Number.parseInt` would read `3002abc` as 3002 and send * the bridge to a port a corrupted file never meant. */ export declare function parsePublishedPort(raw: string | null): number | null; /** * The origin the running server published, or `null` if it published none. * * `127.0.0.1` rather than `localhost`: the server binds the IPv4 loopback * explicitly (`app.listen(port, "127.0.0.1")`), while `localhost` resolves * to `::1` first on a dual-stack host. Usually that still works — nothing * holds `::1`, the connection is refused and Node falls back to IPv4 — but * when something IS there the client reaches it and never falls back, which * is the silent misdirection this module exists to remove (#2981). */ export declare function readPublishedApiUrl(): string | null; /** * Everything except the default: an explicit argument, `MULMOCLAUDE_API_URL`, * or the port the server published — and `null` when none of those says * anything. * * The distinction matters exactly once, and it is a security boundary rather * than a nicety. A caller RECONNECTING must be able to tell "the server has not * published a port yet" from "here is a port", because the server clears * `.server-port` at startup and writes the new token before publishing the new * one (#3082). Collapsing the first into `DEFAULT_API_URL` there would take a * freshly minted bearer token to whatever holds 3001 (Codex, #3078). */ export declare function resolvePublishedApiUrl(explicit?: string): string | null; /** * Resolution order: explicit argument → `MULMOCLAUDE_API_URL` → the port the * server published → `DEFAULT_API_URL`. * * An explicit value still wins, so nothing that already sets one changes. * An EMPTY value falls through instead of being used verbatim, matching how * `readBridgeToken` treats an empty `MULMOCLAUDE_AUTH_TOKEN` — an empty * string reached `io("")` before this. * * The default at the end is a STARTUP affordance: a bridge run against a * machine where no server has published anything still tries the conventional * port. Do not reuse it for reconnection — see `resolvePublishedApiUrl`. */ export declare function resolveApiUrl(explicit?: string): string;