/** * BOM quality — supplier adapter layer. * * Provides a common {@link SupplierAdapter} interface over each vendor * client so quality checks can query any configured supplier uniformly. * * Each adapter: * - normalises part data into {@link SupplierQueryResult} * - records a query timestamp for provenance * - wraps transient errors with an exponential-backoff retry * * @module */ import { type LcscClient } from '../vendors/lcsc/client.js'; import { type MouserClient } from '../vendors/mouser/client.js'; import { type DigiKeyClient } from '../vendors/digikey/client.js'; import type { SupplierKind, SupplierQueryResult, SupplierQueryStatus } from './types.js'; export declare function classifySupplierFailure(error: unknown): { status: SupplierQueryStatus; reason: string; statusCode?: number; }; export interface SupplierAdapter { /** Short supplier key (e.g. 'lcsc', 'mouser'). */ readonly kind: SupplierKind; /** Human-readable supplier name. */ readonly displayName: string; /** Whether this supplier is configured and available. */ isAvailable(): boolean; /** * Query a part by LCSC code or manufacturer part number. * Returns `null` when the part is not found (not an error). */ queryPart(identifier: { lcsc?: string; mpn?: string; }): Promise; } export declare class LcscAdapter implements SupplierAdapter { readonly kind: SupplierKind; readonly displayName = "LCSC"; private client; private logger; constructor(client: LcscClient | null); isAvailable(): boolean; private buildFoundResult; queryPart(identifier: { lcsc?: string; mpn?: string; }): Promise; } export declare class MouserAdapter implements SupplierAdapter { readonly kind: SupplierKind; readonly displayName = "Mouser"; private client; private logger; constructor(client: MouserClient | null); isAvailable(): boolean; private buildFoundResult; queryPart(identifier: { lcsc?: string; mpn?: string; }): Promise; } export declare class DigiKeyAdapter implements SupplierAdapter { readonly kind: SupplierKind; readonly displayName = "DigiKey"; private client; private logger; constructor(client: DigiKeyClient | null); isAvailable(): boolean; private buildFoundResult; queryPart(identifier: { lcsc?: string; mpn?: string; }): Promise; } export interface AdapterMap { lcsc: LcscAdapter; mouser: MouserAdapter; digikey: DigiKeyAdapter; } /** * Build the adapter map from a ToolContext vendors object. * Each adapter wraps the corresponding vendor client (or null if disabled). */ export declare function createAdapters(vendors: { lcsc: LcscClient | null; mouser: MouserClient | null; digikey: DigiKeyClient | null; }): AdapterMap; /** * Return the subset of adapters that are currently configured / available. */ export declare function availableAdapters(adapters: AdapterMap): SupplierAdapter[];