/** * @file Platform detection and OS-specific constants. */ /** * CPU architecture type. */ export type Arch = NodeJS.Architecture; /** * Linux libc variant. */ export type Libc = 'glibc' | 'musl'; /** * Operating system platform type. */ export type Platform = NodeJS.Platform; /** * Get the current CPU architecture (memoized), e.g. `x64`, `arm64`. */ export declare function getArch(): Arch; /** * Get the host libc variant (memoized): `'musl'` on Alpine-and-similar, * `'glibc'` on other Linux, `undefined` off-Linux. Detected by probing for the * musl dynamic linker. The single source of truth for libc detection — * tool-specific resolvers (`getPythonArch`, `getJreArch`) call this rather than * re-probing. */ export declare function getLibc(): Libc | undefined; /** * Get the current OS (memoized), e.g. `darwin`, `linux`, `win32` — the raw * `process.platform` value. */ export declare function getOs(): Platform; /** * Get the current host **target** in the pnpm `pack-app` vocabulary (memoized): * `-[-]`, e.g. `darwin-arm64`, `linux-x64`, `win32-x64`, * `linux-x64-musl`. Raw Node `process.platform`/`process.arch` joined with `-`, * plus a `-musl` suffix on Alpine. This is the Socket-wide naming for * non-python / non-JRE tools (matches pnpm's release assets, * `pnpm--[-].{tar.gz,zip}`). Tool-specific resolvers that need * a different vocabulary own their own helper — see `getPythonArch` for * python-build-standalone and `getJreArch` for Adoptium. */ export declare function getTarget(): string; /** * Returns whether the current platform is macOS. Callable predicate backed * by the module-load memo, so tests can mock the module. * * @returns `true` on darwin, `false` otherwise */ export declare function isDarwin(): boolean; /** * Returns whether the current platform is POSIX (anything but Windows). * Callable predicate backed by the module-load memo, so tests can mock the * module. * * @returns `true` on darwin/linux, `false` on win32 */ export declare function isPosix(): boolean; /** * Returns whether the current platform is Windows. Callable predicate backed * by the module-load memo, so tests can mock the module. * * @returns `true` on win32, `false` otherwise */ export declare function isWin32(): boolean; /** * True when this process was launched as a Chrome or Chromium native * messaging host. Chrome passes the extension origin URL * (`chrome-extension:///`) as `process.argv[2]`; no other invocation shape * produces that prefix. */ export declare const NATIVE_MESSAGING_HOST: boolean; export declare const S_IXUSR = 64; export declare const S_IXGRP = 8; export declare const S_IXOTH = 1;