/** * @file Upstream cdxgen release asset-name mapping per `platform-arch`. cdxgen * ships per-platform SEA binaries starting in v12.0.x — bare executables, no * archive wrapper, with companion `.sha256` sidecars. Each platform has both * a "full" variant (bundles bun + deno runtimes for those project types) and * a "slim" variant (no bundled runtimes; relies on the host having them when * needed). We ship the slim variants by default: socket-lib consumers run * cdxgen for npm/pip/maven/etc. SBOM generation where the bundled runtimes * aren't on the hot path, and the slim binary is ~3× smaller. Consumers that * need full (bun/deno project scanning) can override by passing `variant: * 'full'`. Asset URLs: * https://github.com/CycloneDX/cdxgen/releases/download/v/cdxgen--[-musl][-slim][.exe] * Reference: https://github.com/CycloneDX/cdxgen/releases. Single source of * truth: the SEA binary IS the install path. The legacy `@cyclonedx/cdxgen` * npm package is not used as a fallback — every platform-arch Socket supports * has a SEA build, and routing through npm for unsupported targets would * silently use a different distribution (different bundle composition, * different startup cost, different version-pin surface). One install path; * one cached binary. */ export interface CdxgenAssetEntry { /** * Full asset filename. Version-free — the release tag is the version. */ readonly asset: string; } /** * Pull `variant: 'slim'` (default — no bundled runtimes) or `'full'` (bundles * bun + deno runtimes; ~3× larger). */ export type CdxgenVariant = 'full' | 'slim'; export interface CdxgenDownloadOptions { /** * Cdxgen release version, e.g. `'12.4.1'`. Bare semver; the helper prepends * `v` for the release tag. */ version: string; /** * Socket platform-arch token — looked up in the asset map. Returns * `undefined` when no entry exists for the target. */ platformArch: string; /** * Slim omits bundled bun/deno; full bundles both. Defaults to slim. */ variant?: CdxgenVariant | undefined; } export declare function buildCdxgenAssetName(baseTriple: string, variant: CdxgenVariant, ext: '' | '.exe'): string; export declare function getCdxgenAssetEntry(platformArch: string, variant?: CdxgenVariant): CdxgenAssetEntry | undefined; /** * Build the GitHub release-asset download URL for an upstream cdxgen binary. * Returns `undefined` when no entry exists for the requested platform-arch. */ export declare function getCdxgenDownloadUrl(options: CdxgenDownloadOptions): string | undefined; export declare function makeCdxgenEntry(baseTriple: string, variant: CdxgenVariant, ext?: '' | '.exe'): CdxgenAssetEntry; export declare function makeCdxgenPlatformMap(variant: CdxgenVariant): Readonly>; export declare const CDXGEN_SLIM_ASSET_MAP: Readonly>; export declare const CDXGEN_FULL_ASSET_MAP: Readonly>;