/** * @file DLX binary execution utilities for Socket ecosystem. High-level entry * points for downloading standalone URL-hosted binaries (not npm packages — * see `./package` for those) and executing them with cross-platform shell * handling. * * - `dlxBinary` — download when needed + execute * - `executeBinary` — execute an already-cached binary Supporting surface lives * in sibling leaves and is re-exported here so existing `dlx/binary` * importers keep working unchanged: * - lazy `node:fs` / `node:path` / `node:crypto` + LRU cache — `./shared` * - types — `./binary-types` * - on-disk cache metadata — `./binary-cache` * - download + integrity verification — `./binary-download` */ import { spawn } from '../process/spawn/child.js'; import type { DlxBinaryOptions, DlxBinaryResult } from './binary-types.js'; import type { SpawnExtra, SpawnOptions } from '../process/spawn/types.js'; /** * Download and execute a binary from a URL with caching. * * @example * ;```typescript * const result = await dlxBinary(['--version'], { * url: 'https://example.com/tool-linux-x64', * name: 'tool', * }) * await result.spawnPromise * ``` */ export declare function dlxBinary(args: readonly string[] | string[], options?: DlxBinaryOptions | undefined, spawnExtra?: SpawnExtra | undefined): Promise; /** * Execute a cached binary without re-downloading. Similar to executePackage * from dlx/package. Binary must have been previously downloaded via * downloadBinary or dlxBinary. * * @example * ;```typescript * const { binaryPath } = await downloadBinary({ * url: 'https://example.com/tool-linux-x64', * name: 'tool', * }) * const result = executeBinary(binaryPath, ['--help']) * ``` * * @param binaryPath Path to the cached binary (from downloadBinary result) * @param args Arguments to pass to the binary. * @param spawnOptions Spawn options for execution. * @param spawnExtra Extra spawn configuration. * * @returns The spawn promise for the running process */ export declare function executeBinary(binaryPath: string, args: readonly string[] | string[], spawnOptions?: SpawnOptions | undefined, spawnExtra?: SpawnExtra | undefined): ReturnType; export { cleanDlxCache, getBinaryCacheMetadataPath, getDlxCachePath, isBinaryCacheValid, listDlxCache, writeBinaryCacheMetadata, } from './binary-cache.js'; export { downloadBinary, downloadBinaryFile } from './binary-download.js'; export type { DlxBinaryOptions, DlxBinaryResult, DlxMetadata, } from './binary-types.js';