export type CompressedScanPaths = { paths: string[]; cleanup: () => Promise; }; /** * For each `.socket.facts.json` in `scanPaths`, stream-brotli-compress a * sibling `.socket.facts.json.br` next to the original file and swap its * path in. Other paths pass through unchanged. Missing files also pass * through unchanged (the upload will fail downstream with the same error * it would have). * * Streaming + worker-thread compression keeps the event loop responsive: * default brotli quality (11) on a 60+MB facts file takes multiple seconds * of CPU, which would otherwise freeze the spinner / signal handlers / * any concurrent work. * * The `.br` lives next to the source rather than under the OS temp dir * because depscan's multipart ingest (`addStreamEntry`) rejects entries * whose names contain `..` traversal segments. The SDK computes the * multipart entry name via `path.relative(cwd, brPath)`, so an OS-tmpdir * temp path turns into `../../../var/folders/...` and gets dropped as * `unmatchedFiles`. Sibling-write keeps the relative path inside cwd, and * keeps the directory shape symmetric with the plain `.socket.facts.json` * upload (depscan strips only the `.br` suffix at ingest, so * `/.socket.facts.json.br` and `/.socket.facts.json` resolve to * the same storage path). * * Concurrent scans against the same source directory are already racy on * `.socket.facts.json` itself (coana writes to a single path), so the * sibling `.br` doesn't introduce a new race. * * Caller MUST `await cleanup()` (typically in a `finally` block) once the * upload completes — successful or not — to remove the sibling files. */ export declare function compressSocketFactsForUpload(scanPaths: string[]): Promise; export type ReachabilityError = { componentName: string; componentVersion: string; ghsaId: string; subprojectPath: string; }; export declare function extractReachabilityErrors(socketFactsFile: string): ReachabilityError[]; export declare function extractTier1ReachabilityScanId(socketFactsFile: string): string | undefined; //# sourceMappingURL=coana.d.mts.map