import { type FetchWithGuardsOptions } from "./lib/http.js"; /** Adapter interface for registry-specific search behavior. */ interface RegistrySearchAdapter { buildUrl(query: string, limit: number): URL; extractResults(data: unknown): RegistrySearchResult[]; allowedOrigins: readonly string[]; getHeaders(): Record; } /** * Shared registry search logic extracted from 5 nearly identical functions. * Handles query normalization, URL building, fetch with guards, data validation, * result extraction, and error handling. */ declare function searchRegistry(query: string, limit: number, adapter: RegistrySearchAdapter, options?: Pick): Promise; /** * Describes npm package search result data exchanged by the lifecycle pipeline. */ export interface NpmPackageSearchResult { name: string; description?: string; keywords: string[]; lastUpdated?: string; } /** * Describes npm package metadata exchanged by the lifecycle pipeline. */ export interface NpmPackageMetadata { name: string; description?: string; homepage?: string; repository?: { type?: string; url?: string; } | string; distTags?: Record; keywords?: string[]; versions?: Record; lastUpdated?: string; } /** * Describes pypi package metadata exchanged by the lifecycle pipeline. */ export interface PypiPackageMetadata { info: { name: string; summary?: string; home_page?: string; project_urls?: Record; version?: string; keywords?: string; package_url?: string; }; lastUpdated?: string; } /** * Searches npm package metadata with the configured runtime safeguards. */ export declare function fetchNpmPackageSearch(query: string, options?: Pick): Promise; /** * Fetches npm package metadata with the configured runtime safeguards. */ export declare function fetchNpmPackageMetadata(packageName: string, options?: Pick): Promise; /** * Fetches pypi package metadata with the configured runtime safeguards. */ export declare function fetchPypiPackageMetadata(packageName: string, options?: Pick): Promise; /** * Normalizes npm search API responses into package search result records. */ export declare function normalizeNpmPackageSearchResults(data: unknown): NpmPackageSearchResult[]; /** * Normalizes npm package metadata responses for discovery scoring. */ export declare function normalizeNpmPackageMetadata(data: Record, packageName: string): NpmPackageMetadata; /** * Normalizes PyPI package metadata responses for discovery scoring. */ export declare function normalizePypiPackageMetadata(data: unknown, packageName: string): PypiPackageMetadata | null; declare function normalizeStringArray(value: unknown): string[]; declare function normalizeStringRecord(value: unknown): Record | undefined; /** * Provides extract repository url from npm metadata for the lifecycle pipeline. */ export declare function extractRepositoryUrlFromNpmMetadata(metadata: NpmPackageMetadata): string | undefined; /** * Provides extract repository url from pypi metadata for the lifecycle pipeline. */ export declare function extractRepositoryUrlFromPypiMetadata(metadata: PypiPackageMetadata): string | undefined; declare function isGitHubRepositoryUrl(value: string): boolean; /** * Sanitizes package registry repository URL values into HTTPS GitHub URLs when possible. */ export declare function sanitizeRepositoryUrl(value: string): string; declare function buildGitHubRepositoryUrl(owner: string, repo: string): string; declare function stripUrlSuffix(value: string): string; /** Result returned by any registry search (common shape across registries). */ export interface RegistrySearchResult { name: string; description?: string; downloads?: number; } /** * Searches crates.io by keyword, sorted by download count. * Includes the required `User-Agent: agent-harness/` header per API TOS. */ export declare function fetchCratesIoSearch(query: string, limit?: number, options?: Pick): Promise; /** * Searches the NuGet v3 query endpoint, sorted by total downloads. */ export declare function fetchNugetSearch(query: string, limit?: number, options?: Pick): Promise; /** * Searches Maven Central via the Solr-backed search endpoint. */ export declare function fetchMavenSearch(query: string, limit?: number, options?: Pick): Promise; /** * Searches Packagist (PHP Composer registry) by keyword. */ export declare function fetchPackagistSearch(query: string, limit?: number, options?: Pick): Promise; /** * Searches RubyGems by keyword, sorted by download count. */ export declare function fetchRubyGemsSearch(query: string, limit?: number, options?: Pick): Promise; /** * Searches Hex.pm (Elixir/Erlang package registry) by keyword, sorted by * download count. Hex API requires a contactable User-Agent header per TOS. */ export declare function fetchHexSearch(query: string, limit?: number, options?: Pick): Promise; /** * Exposes narrow package-registry internals for focused behavioral coverage. */ export declare const packageRegistryInternals: { normalizeStringArray: typeof normalizeStringArray; normalizeStringRecord: typeof normalizeStringRecord; isGitHubRepositoryUrl: typeof isGitHubRepositoryUrl; buildGitHubRepositoryUrl: typeof buildGitHubRepositoryUrl; stripUrlSuffix: typeof stripUrlSuffix; searchRegistry: typeof searchRegistry; }; export {};