/** * Compatibility records gathered from where adapters' own CI publishes them: packages found on npm by * a keyword, each naming its record's URL in its `package.json`, and sources listed by hand. Each * record is read as `nexus adapters verify` sealed it, and must name the package that points to it. * Nothing an adapter publishes is run: a gathered record is listed as its CI recorded it. */ import { type CompatibilityRecord } from './record.js'; /** The npm keyword an adapter package carries to be found: `nexus-ai-pro-adapter`. */ export declare const ADAPTER_KEYWORD = "nexus-ai-pro-adapter"; /** Where one adapter's CI publishes its record. */ export interface RecordSource { /** The adapter's package name, which its record must name. */ package: string; /** The record's URL: HTTPS, or HTTP to this machine. */ url: string; } /** Options for `gatherRecords()`. */ export interface GatherRecordsOptions { /** * The keyword adapter packages are found by on npm, each naming its record's URL as * `nexus.compatibility` in its `package.json`. Defaults to `ADAPTER_KEYWORD`; `false` finds none. */ keyword?: string | false; /** Sources listed by hand, beside those found; a listed package's URL is used over its own. */ sources?: readonly RecordSource[]; /** The npm registry. Defaults to `https://registry.npmjs.org`. */ registry?: string; /** * The records gathered last time: a package whose record cannot be read now, because its source is * down or what it serves is refused, keeps its last one, and says why. */ previous?: readonly CompatibilityRecord[]; /** The most bytes a record may have. Defaults to 1 MiB. */ maxBytes?: number; /** How long each request may take, in milliseconds. Defaults to 15 seconds. */ timeoutMs?: number; /** The most packages found by keyword. Defaults to 1,000. */ maxPackages?: number; /** Replaces the global `fetch`. */ fetch?: typeof fetch; } /** * What became of one package's record: `gathered` now; `kept` from last time, as now it could not be; * `refused` or `unreachable` with nothing to keep; or `undeclared`, a package that names no record. */ export type GatherOutcome = 'gathered' | 'kept' | 'refused' | 'unreachable' | 'undeclared'; /** One package's source, and what became of its record. */ export interface GatheredSource { /** The package's name. */ package: string; /** Where its record is published, when it says. */ url?: string; /** What became of it. */ outcome: GatherOutcome; /** Why, for every outcome but `gathered`. */ detail?: string; /** The record listed for it: gathered now, or kept. */ record?: CompatibilityRecord; } /** What `gatherRecords()` found. */ export interface GatherReport { /** Every record to list, gathered now or kept, by package name. */ records: CompatibilityRecord[]; /** Every package, by name, and what became of its record. */ sources: GatheredSource[]; } /** * Gathers the compatibility records adapters' own CI publishes: finds adapter packages on npm by * `keyword`, reads where each publishes its record, and fetches each, with `sources` listed by hand. * A record is gathered only when it reads as sealed, with a digest that matches it, and names the * package that points to it; a package whose record cannot be read now keeps its `previous` one. * Throws when npm cannot be searched, rather than reporting every adapter gone. */ export declare function gatherRecords(options?: GatherRecordsOptions): Promise; /** The name of a package from how a record names it, such as `@acme/nexus-milvus` from `@acme/nexus-milvus@0.3.0`. */ export declare function packageName(specifier: string): string;