/** * @file Install the Socket native messaging host manifest so Chrome can find * and launch the host when the extension calls connectNative(). Native host * manifest paths (Chrome): macOS ~/Library/Application * Support/Google/Chrome/NativeMessagingHosts/.json * ~/Library/Application Support/Chromium/NativeMessagingHosts/.json * Linux ~/.config/google-chrome/NativeMessagingHosts/.json * ~/.config/chromium/NativeMessagingHosts/.json Windows * HKCU\Software\Google\Chrome\NativeMessagingHosts → path to .json The * manifest points to a small wrapper shell script (POSIX) or .cmd (Windows) * that invokes `node /path/to/socket-lib/src/native-messaging/run.ts` with * the `--native-messaging` flag so the host can detect its context even when * the extension origin arg is absent (e.g. during local testing). Strip-types * flag policy: Node 24+ no flag needed (default-on). Node 22.6–23 pass * `--strip-types` (stable since 22.6). Node < 22.6 refuse to install; * assertNodeStripTypesSupported throws. The flag decision is baked into the * wrapper at install time. If the user later switches Node versions (e.g. via * nvm) the host enforces the same floor at runtime via * assertNodeStripTypesSupported. */ export declare const HOST_NAME = "dev.socket.trusted_publisher_host"; export declare const MIN_NODE_VERSION_FOR_STRIP_TYPES = "22.6.0"; export interface InstallOptions { /** * List of Chrome extension origin URLs that are allowed to connect to this * host. Each entry is `chrome-extension:///`. Pass `['*']` * during development to allow any extension. Never do that in production. */ allowedOrigins: string[]; /** * When `true`, reject wildcard origins (`['*']`) — production installs must * pin to specific extension IDs. */ production?: boolean | undefined; /** * Directory to write the wrapper script. Defaults to the same directory as * this file (`src/native-messaging/`). */ wrapperDir?: string | undefined; } export interface InstallResult { manifestPaths: string[]; wrapperPath: string; } /** * Throw a clear, actionable error if the current Node runtime is too old to * strip TypeScript types (i.e. < 22.6). Use at install time + host startup. * * The error message names the active Node version manager (nvm / fnm / volta / * asdf / n / corepack / system) and gives the exact one-liner to upgrade — so * the user can copy-paste the fix rather than searching docs. */ export declare function assertNodeStripTypesSupported(): void; export declare function buildManifest(wrapperPath: string, allowedOrigins: string[]): object; export declare function chromeManifestDirs(): string[]; export declare function installNativeHost(options: InstallOptions): InstallResult; export declare function registerWindows(manifestPath: string): void; export declare function stripTypesFlag(): string; export declare function writeWrapperPosix(wrapperPath: string): void; export declare function writeWrapperWindows(wrapperPath: string): void;