/** * Client identification — every HQ client that talks to hq-cloud-api should * stamp its name and version on outbound requests so the server can attribute * traffic, gate on minimum versions, and surface deprecation warnings. * * The CLI in particular sends a third header (`x-hq-core-version`) when it's * invoked from inside an hq-core checkout, so the server sees which scaffold * generation the user is running against. */ import type { ClientInfo } from "./types.js"; export declare const HEADER_CLIENT_NAME = "x-hq-client-name"; export declare const HEADER_CLIENT_VERSION = "x-hq-client-version"; export declare const HEADER_HQ_CORE_VERSION = "x-hq-core-version"; /** * Build the set of `x-hq-*` headers (plus a derived `User-Agent`) for a * ClientInfo. Returns an empty object when info is undefined so callers can * spread the result unconditionally. */ export declare function buildClientHeaders(info: ClientInfo | undefined): Record; /** * Build a ClientInfo from a parsed package.json. Most consumers will call this * once at startup and pass the result into every VaultServiceConfig. */ export declare function clientInfoFromPackage(pkg: { name?: unknown; version?: unknown; }): ClientInfo; /** * Walk upward from `startDir` looking for `core/core.yaml`. When found, parse * out the `hqVersion` field and return it. Returns undefined if we never find * an hq-core checkout — i.e. the caller is running from a plain user dir. * * Honors `HQ_HOME` env var as an explicit override so multi-checkout setups * (e.g. CI bots, the menubar app pointing at a non-cwd HQ root) can pin the * detection without relying on cwd. * * Why a regex instead of a YAML parser: `core.yaml` lives at the very top of * the file and the field has a stable shape — adding a YAML dep just to read * one string would balloon every consumer's bundle. The current shape is * `hqVersion: "X.Y.Z"` (quoted) per the canonical seed; we tolerate unquoted * too. */ export declare function detectHqCoreVersion(startDir?: string): string | undefined; //# sourceMappingURL=client-info.d.ts.map