/** * Shared HTTP helper for calling the FreightUtils API. * * Auth model: when FREIGHTUTILS_API_KEY is set in the environment, every * outbound call carries it as `Authorization: Bearer `. Unset env var * preserves the existing anonymous behaviour (25 requests/day per IP), so * users running freely continue to work without code changes. * * Why centralised in buildHeaders(): callers should never have to remember * to forward the key. apiGet / apiPost are the only two outbound surfaces * in this package, and both now route through this helper — the stdio * key-passthrough bug (Pro customers silently rate-limited because the * stdio surface wasn't forwarding the env-var key) is closed end-to-end. */ export declare function buildHeaders(extra?: Record): Record; /** Options for the two outbound helpers. `envelope: true` requests the * FreightUtils response envelope, v1.1 since 2.15.0 (`?envelope=1.1`) — used for the * structuredContent channel. `legacySource: true` adds the bridge opt-in * (`&legacy_source=1`): the API appends the flat channel's exact `_source` * block to the envelope so the flat legacy text channel can be reconstructed * from the SAME response — one request per successful call instead of two. */ export interface ApiOpts { envelope?: boolean; legacySource?: boolean; } export declare function apiGet(endpoint: string, params: Record, opts?: ApiOpts): Promise; export declare function apiPost(endpoint: string, body: unknown, opts?: ApiOpts): Promise;