import type { GatewayDiscovery, HealthResponse } from "../types.js"; export type ResolvedGateway = GatewayDiscovery & { /** In-memory only. Never log, print, or serialize this. */ token?: string; }; export declare function connectHostFor(bindHost: string): string; /** * Normalize a full origin override: drop path/userinfo/trailing slash, and * rewrite bind wildcards (0.0.0.0 / ::) to 127.0.0.1. Tailscale / LAN names * pass through connectHostFor unchanged. */ export declare function normalizeGatewayBaseUrl(raw: string): string; export type DiscoverOptions = { sandRoot?: string; env?: NodeJS.ProcessEnv; discoveryPath?: string; /** * Full gateway origin override (scheme + host + port). * Same as GROKBOT_GATEWAY_URL / SAND_GATEWAY_URL. Wins over gateway.json * host/port/scheme and over SAND_GATEWAY_BIND_HOST / SAND_HOST_PORT. */ gatewayUrl?: string; }; /** * Load gateway.json + env overrides. * Token comes from SAND_GATEWAY_TOKEN or the discovery file, and stays in memory. * A full URL (options.gatewayUrl, GROKBOT_GATEWAY_URL, or SAND_GATEWAY_URL) * wins over gateway.json host/port/scheme. */ export declare function discoverGateway(options?: DiscoverOptions): ResolvedGateway; /** CLI `grokbot health` — baseUrl + host health fields. Never includes a token. */ export declare function formatHealthOutput(baseUrl: string, health: Pick): string; /** * CLI `grokbot discovery` — public fields only. * Never includes a token; `hasToken` is a boolean. */ export declare function formatDiscoveryOutput(discovery: GatewayDiscovery): string; /** Replace every occurrence of `secret` so logs / errors cannot echo it. */ export declare function redactSecret(text: string, secret: string | undefined): string; /** Strip the token for anything that might be printed or logged. */ export declare function publicDiscovery(resolved: ResolvedGateway): GatewayDiscovery; //# sourceMappingURL=discovery.d.ts.map