/** * @file `resolvePython()` — CPython resolution entry point. Tries each source * in order: * * 1. PATH — `python3` / `python` on the system PATH. * 2. download — python-build-standalone CPython into the DLX cache (only when * `downloadIfMissing` is passed). Returns `undefined` if all enabled * sources miss. Memoized per option-shape so repeated calls in one process * don't re-probe / re-download. NOTE: unlike the JRE / removed-uv * resolvers there is no VFS tier here — a CPython runtime is not embedded * in the smol Node binary. Add a `from-vfs` tier here if that changes. */ import type { BinaryDownloader } from '../from-download.js'; import type { HashInput } from '../../crypto/integrity.js'; import type { ResolvedPython } from './types.js'; export interface ResolvePythonOptions { /** * Prefer a downloaded python-build-standalone over a PATH interpreter. Use * when you need an exact, reproducible CPython (the host `python3` may be the * wrong version). Default false: PATH wins when present. */ preferDownload?: boolean | undefined; /** * When set, fall back to downloading python-build-standalone if no PATH * interpreter is found (or always, with `preferDownload`). */ downloadIfMissing?: { version: string; tag: string; /** * Omit to auto-detect the current host via {@link getPythonArch}. */ arch?: string | undefined; integrity?: HashInput | undefined; cacheDir?: string | undefined; downloader?: BinaryDownloader | undefined; } | undefined; } export declare function cacheKey(options: ResolvePythonOptions | undefined): string; export declare function doResolvePython(options?: ResolvePythonOptions | undefined): Promise; /** * @unused No internal or Socket consumers; exercised only by its unit tests. */ export declare function resetPythonResolution(): void; export declare function resolvePython(options?: ResolvePythonOptions | undefined): Promise;