/** * Verified device catalog ingestion pipeline. * * Resolves an LCSC part number into a `DeviceEntry` by combining two * independent, best-effort sources: * * 1. The keyless LCSC tier (`src/vendors/lcsc/client.ts`) for commodity * metadata — manufacturer/MPN string, package, stock, price, * basic/preferred/extended classification. * 2. The EasyEDA bridge's `library.getDeviceByLcscId` method * (`LIB_Device.getByLcscIds`) for a *reference* to a matching symbol and * footprint already known to the connected EasyEDA Pro instance's * library. * * Neither source can supply real pin/pad geometry for an arbitrary part — * jlcsearch is commodity metadata only, and EasyEDA's API returns opaque * library UUID references, not drawable content, with no read-back method * for the underlying symbol/footprint drawing. When the EasyEDA lookup * finds no match (part not already in the connected instance's library, * bridge disconnected, or the method is unsupported/restricted), the * resulting device's `symbolRef`/`footprintRef` are marked with * `UNRESOLVED_REF_PREFIX` rather than fabricated, and * `validateDeviceEntry`/`validateCatalog` will flag that as an error for * any category that requires a real symbol/footprint. This is a deliberate * design choice, not a bug — see docs/catalog-ingestion.md. * * @module */ import { type ToolContext } from '../tools/types.js'; import { type DeviceEntry } from './schema.js'; import { type CatalogValidationResult } from './validation.js'; export type IngestStatus = 'resolved' | 'partial' | 'unresolved'; export interface IngestResult { entry: DeviceEntry; validation: CatalogValidationResult; /** * 'resolved': a real EasyEDA symbol/footprint match was found and the * entry passes validation. * 'partial': a real EasyEDA match was found but validation still failed * (e.g. missing pin map for a category that requires one). * 'unresolved': no EasyEDA library match was found; symbolRef/footprintRef * are placeholders and validation will fail for categories requiring them. */ status: IngestStatus; provenance: { symbolFootprintSource: 'easyeda-library' | 'unresolved'; metadataSource: 'keyless-lcsc' | 'unavailable'; }; } /** * Resolve a single LCSC part number into a catalog `DeviceEntry`, running it * through business-rule validation. Never throws for "no match" — only * throws `CatalogError` (code `DEVICE_RESOLUTION_FAILED`) when *neither* * source returns anything at all for the given id. */ export declare function ingestDeviceFromLcsc(ctx: Pick, rawLcscId: string): Promise;