import { spawn, spawnSync } from "node:child_process"; import type { RegistryManifest } from "./types.ts"; import type { DownloadProgress } from "./download-progress.ts"; /** * Parse a GitHub URL (https or git@) into owner and repo. */ export declare function parseGitHubUrl(url: string): { owner: string; repo: string; }; /** * Resolve the version for a role from the registry manifest. */ export declare function resolveVersion(manifest: RegistryManifest, roleId: string): string; /** * Fetch a registry manifest from a GitHub raw content URL with caching. */ export declare function fetchRegistryManifest(registry: { name: string; url: string; }, ref?: string, options?: { noCache?: boolean; }): Promise; /** * Optional dependency injection for downloadRole's process invocation. * * Tests inject recording/spying spawn functions here; production callers * omit it and get the real spawn/spawnSync from node:child_process. This * seam exists because mocking the node:child_process builtin (or a re-export) * via mock.module hangs in Bun when a real child is spawned. */ export interface DownloadRoleProcess { spawn: typeof spawn; spawnSync: typeof spawnSync; } /** * Optional progress reporter for {@link downloadRole}. * * Added as an optional trailing parameter (via {@link DownloadRoleOptions}) so * the exported signature stays backward-compatible: existing callers that omit * it get silent, buffer-based streaming and no phase/byte reporting. */ export interface DownloadRoleOptions { /** Progress reporter; when supplied, the response body is streamed and * byte counts are reported via `update`, with phase lifecycle reporting for * downloading / verifying / extracting. */ progress?: DownloadProgress; /** Per-attempt download timeout in ms. Defaults to {@link DEFAULT_DOWNLOAD_TIMEOUT_MS}. */ timeoutMs?: number; /** Number of retries on transient network error (total attempts = retries + 1). * Defaults to {@link DEFAULT_DOWNLOAD_MAX_RETRIES}. */ maxRetries?: number; } /** * Download a role from a GitHub registry tarball and extract it. */ export declare function downloadRole(registry: { name: string; url: string; }, roleId: string, _version: string, ref?: string, deps?: DownloadRoleProcess, options?: DownloadRoleOptions): Promise; /** * Compute SHA256 hash of all files in a directory for lock file integrity. */ export declare function computeIntegrity(dirPath: string): Promise; //# sourceMappingURL=registry-client.d.ts.map