/** * Registry utility functions extracted from sources/providers/registry.ts. * * Shared helpers for registry operations: version selection, integrity * computation, zip extraction, type pluralization, and path building. * * @experimental This API is unstable and may change without notice. * @packageDocumentation */ import * as FileSystem from "effect/FileSystem"; import * as Path from "effect/Path"; import * as Duration from "effect/Duration"; import * as Effect from "effect/Effect"; import * as Option from "effect/Option"; import type { Handle } from "../extensions/handle.js"; import { type ExtensionType } from "../extensions/index.js"; import type { ExtensionIndex, VersionEntry } from "./schema.js"; import { type ReleaseAgeEvaluation, type ReleaseAgeEvidence, type ReleaseAgeExemption } from "./release-age-policy.js"; /** * Select the best matching version from a list of versions. * * Returns the maximum non-yanked version, independent of input order. */ export declare const selectVersion: (versions: ReadonlyArray) => Option.Option; export declare const resolveVersionEntry: (versions: ReadonlyArray, versionRange: Option.Option) => Option.Option; export declare const extensionLifecycleWarnings: (index: ExtensionIndex, version: VersionEntry) => ReadonlyArray; export declare const resolveVersionEntryWithReleaseAge: (versions: ReadonlyArray, versionRange: Option.Option, minimumReleaseAge: Option.Option) => Effect.Effect>; export type ReleaseAgeVersionResolution = { readonly kind: "selected"; readonly version: VersionEntry; readonly newerHeld?: ReleaseAgeEvidence; } | { readonly kind: "exempted"; readonly version: VersionEntry; readonly bypassed: ReleaseAgeEvidence; readonly exemption: ReleaseAgeExemption; } | { readonly kind: "version_unsatisfied"; } | { readonly kind: "policy_held"; readonly candidate: ReleaseAgeEvidence; }; /** * Resolve one visible Registry index under one caller-supplied release-age * evaluation. The supplied timestamp makes a complete operation deterministic. * An accepted version that satisfies the requested range is a lower bound for * unattended selection, even while that version is itself under age. */ export declare const resolveVersionEntryForReleaseAge: (versions: ReadonlyArray, versionRange: Option.Option, evaluation: ReleaseAgeEvaluation, exemption?: ReleaseAgeExemption, acceptedVersion?: string) => ReleaseAgeVersionResolution; /** Pluralize extension type for directory segments. */ export declare const pluralizeType: (type: ExtensionType) => string; /** Build the path to an extension's directory within a registry. */ export declare const extensionDir: (registryRoot: string, owner: Handle, type: ExtensionType, name: string, join: (...parts: readonly string[]) => string) => string; /** * Extract a zip archive to a target directory. * Uses fflate for in-memory decompression (portable across platforms). */ export declare const extractZip: (archive: Uint8Array, targetDir: string) => Effect.Effect; //# sourceMappingURL=utils.d.ts.map