import { access, chmod, mkdir, readFile, rename, rm, stat, writeFile } from 'node:fs/promises'; /** Pinned Oxigraph release. Bump deliberately (re-pin checksums below). */ export declare const OXIGRAPH_VERSION = "0.5.8"; export declare const OXIGRAPH_VERSION_PROBE_TIMEOUT_MS = 5000; interface OxigraphAsset { /** GitHub release asset filename. */ asset: string; /** SHA-256 of the asset bytes (GitHub release API `digest`, sans prefix). */ sha256: string; } /** * Host (`${platform}-${arch}`) → release asset + integrity hash, pinned to * v0.5.8. Checksums are the GitHub release API `digest` values; re-fetch * and re-pin when bumping `OXIGRAPH_VERSION`. */ export declare const OXIGRAPH_ASSETS: Readonly>; export interface ResolvedOxigraphAsset { asset: string; sha256: string; url: string; /** Cache filename (stable across boots, version-stamped). */ fileName: string; } /** * Map a host to its release asset, or throw an actionable error for * platforms Oxigraph doesn't publish a self-contained binary for. */ export declare function resolveOxigraphAsset(platform?: NodeJS.Platform, arch?: string): ResolvedOxigraphAsset; export interface OxigraphBinaryIo { fetch: typeof globalThis.fetch; mkdir: typeof mkdir; writeFile: typeof writeFile; readFile: typeof readFile; chmod: typeof chmod; rename: typeof rename; rm: typeof rm; stat: typeof stat; access: typeof access; /** Read and parse the selected executable's own `--version` output. */ probeVersion: (path: string, timeoutMs?: number) => Promise; /** Clear the macOS quarantine xattr; best-effort, never throws. */ clearQuarantine: (path: string) => Promise; } export interface ResolvedOxigraphBinary { path: string; source: 'bundled' | 'system'; version: string; } export interface ResolveOxigraphBinaryOptions { /** Directory to cache the binary under (e.g. `/oxigraph`). */ cacheDir: string; platform?: NodeJS.Platform; arch?: string; log?: (msg: string) => void; /** Download timeout in ms. Default 120_000 (binaries are ~20 MB). */ timeoutMs?: number; /** System executable `--version` deadline. Default 5_000. */ versionProbeTimeoutMs?: number; io?: Partial; /** * Override the resolved asset (url + integrity hash + cache filename). * Production omits this and resolves from `platform`/`arch`; tests use * it to supply a checksum matching their mocked bytes. */ asset?: ResolvedOxigraphAsset; } /** * Resolve the executable plus the version metadata required for launch * capabilities. Pinned assets carry their pinned version; PATH fallbacks are * probed before they may be launched. Cached/downloaded assets are checksum * verified, marked executable, and installed atomically. */ export declare function resolveOxigraphBinary(opts: ResolveOxigraphBinaryOptions): Promise; /** * The Oxigraph binaries this node runs or ran, as the orphan reclaim may * recognise them: exact binaries, and pinned release files in the managed * cache, the same sources resolution takes a binary from. Nothing else in * those directories counts. */ export interface OxigraphBinaryLocations { /** Exact binaries: the one resolution selected, and the operator's `oxigraph` on PATH. */ readonly exact: readonly string[]; /** * The managed cache, where a file counts only as a pinned release * (`isPinnedOxigraphFile`): the versions earlier releases downloaded. */ readonly cacheDir: string | null; } /** * Whether `fileName` is a pinned Oxigraph release as the managed cache names * them (`oxigraph-v`, `.exe` on Windows). */ export declare function isPinnedOxigraphFile(fileName: string): boolean; /** * The locations for a resolved binary. An orphan from an earlier release may * run whichever binary that release resolved. The PATH lookup is skipped * when resolution already selected the PATH binary. */ export declare function oxigraphBinaryLocations(selected: ResolvedOxigraphBinary, opts: { cacheDir: string; platform?: NodeJS.Platform; io?: Partial; }): Promise; export {}; //# sourceMappingURL=oxigraph-binary.d.ts.map