/** * Identification Facade (Phase 2 — identification engine) * * Async entry point that runs the identification ladder's network/deep rungs * and feeds their evidence into {@link AutoSourceAssigner.assignSources}: * * 1. Hash lookup (Modrinth sha1 batch + Hangar sha256) — byte-exact * 2. pom.properties Maven coordinates (free — extracted at scan time) * 3. Lazy embedded-ID deep scan (full JAR decompression) — ONLY for * plugins still unmatched after hash + registry + website rungs, * capped at {@link DEEP_SCAN_CONCURRENCY} concurrent JARs * * Registry name-matching and website-hint parsing stay INSIDE the assigner * (they're free/synchronous); this facade only gathers the evidence the * assigner can't compute itself. * * Resilience contract: a failed/offline rung degrades silently to the * pre-Phase-2 behavior (registry + website hints) — identification never * blocks or breaks a scan. * * @since v2.13.0 (Phase 2 — identification engine) */ import type { RegistryService } from '../registry/registry-service.js'; import type { Plugin, ScannedPlugin } from '../types/plugin.js'; import { AutoSourceAssigner } from './auto-assigner.js'; import type { AutoAssignOptions, AutoAssignResult, SourceAssignment } from './auto-source-types.js'; import { extractEmbeddedIdentity } from './embedded-identifier.js'; import { identifyByHash } from './hash-identifier.js'; import type { IdentificationEvidence } from './identification-types.js'; /** Options for {@link identifyAndAssign}. */ export interface IdentifyOptions extends AutoAssignOptions { /** The assigner to run the final assignment through (caller-constructed with its registry). */ assigner: AutoSourceAssigner; /** Max concurrent deep JAR scans (default: 2). */ deepScanConcurrency?: number; /** * Plugin names (case-insensitive) to skip entirely — bespoke/private jars * the user has explicitly excluded via `IGNORED_PLUGINS`. Ignored plugins * are dropped BEFORE any rung runs, so they never appear in assigned, * suggested, skipped, or failed — and never trigger a network call. */ ignoredPlugins?: string[]; /** Injectable rung implementations (tests). Defaults to the real rungs. */ rungs?: { identifyByHash?: typeof identifyByHash; extractEmbeddedIdentity?: typeof extractEmbeddedIdentity; }; } /** * Synthesize pom-properties evidence from the scanner's Maven coordinates. * Conservative by design: ONLY groupIds that are GitHub coordinates * (`io.github.` / `com.github.`) become evidence — anything else * (org.example, net.luckperms, shaded-dependency groupIds) is skipped, since * a wrong channel guess here would auto-assign at 0.7 confidence. */ export declare function synthesizePomEvidence(scanned: ScannedPlugin): IdentificationEvidence | null; /** * Run the identification ladder, then assign sources. * * Drop-in async replacement for `assigner.assignSources(scanned, existing, * options)` — same result shape (plus identityCorrections), same registry/ * website behavior when every async rung comes back empty (offline, stub * scans with no hashes/jarPaths, rung failures). */ export declare function identifyAndAssign(scanned: ScannedPlugin[], existingPlugins: Plugin[], options: IdentifyOptions): Promise; /** Result of {@link proposeRegistryCorrections}. */ export interface RegistryCorrectionResult { /** Corrections auto-applied in place (plugin was 'registry'-method assigned — the registry was always its authority). */ applied: SourceAssignment[]; /** Corrections for plugins assigned by other auto methods — review only, never auto-applied. */ suggested: SourceAssignment[]; } /** * Registry-correction propagation (Phase 2): when a registry entry's CURRENT * preferred source differs from what an auto-assigned plugin is configured * with (e.g. the v2.12.1 floodgate modrinth→geysermc fix), push the fix to * the user's existing assignment: * * - Assignment method 'registry' → the registry was always the authority for * this plugin: auto-apply (mutates `existingPlugins` in place) + log. * - Any other auto method (hash/embedded-id/pom/website-hint) → the plugin * has independent identity evidence: emit a suggestion only. * * Plugins without a registryId, with manual/none assignment, or whose * registry entry vanished are left untouched. */ export declare function proposeRegistryCorrections(existingPlugins: Plugin[], registryService: RegistryService): RegistryCorrectionResult; //# sourceMappingURL=identify.d.ts.map