/** * @fileoverview Tiered source-recovery orchestrator. * @module @skillsmith/core/provenance/SourceRecoveryService * @see SMI-5407 * * Resolves the canonical GitHub source of each locally-installed skill by * trying tiers in confidence order and short-circuiting on the first hit: * git remote (exact) -> plugin manifest (high) -> registry name * (medium/low, review-only) -> embedding (opt-in) -> hints (opt-in) -> unknown. * * The git and plugin tiers are local file reads: they resolve the SOURCE * before any injected dependency is invoked. They then make a best-effort, * OFFLINE call to the optional `findRegistryIdByRepoUrl` (local catalog lookup) * to enrich the manifest id with a registry UUID (SMI-5411) -- never network, * never throws. An offline run never touches the network. */ import type { RecoveryDeps, RecoveryReport, SkillRecoveryResult } from './types.js'; /** Options for a full recovery run. */ export interface RecoverSourcesOptions { /** Root to scan. Defaults to `~/.claude/skills`. */ skillsRoot?: string; /** Restrict to these skill directory names. */ only?: string[]; /** Enable the embedding tiebreak tier (off by default). */ enableEmbedding?: boolean; /** Enable the catalog / author hint tier (off by default). */ enableCatalogHint?: boolean; } /** Per-skill resolution options (opt-in tiers). */ export interface RecoverOneOptions { enableEmbedding?: boolean; enableCatalogHint?: boolean; } /** Default install root for locally-installed skills. */ export declare function defaultSkillsRoot(): string; export declare class SourceRecoveryService { private readonly deps; constructor(deps: RecoveryDeps); /** * Best-effort OFFLINE registry-UUID enrichment for a git/plugin source URL. * Returns the catalog UUID for `url`'s repo when the optional dep is wired and * a match exists; null otherwise. NEVER throws -- a missing dep, a no-match, or * a dep failure all degrade to null so the already-resolved (exact/high) source * is never lost. SMI-5411. */ private enrichRegistryId; /** Scan `skillsRoot` and resolve every (non-filtered) skill's source. */ recoverSources(opts?: RecoverSourcesOptions): Promise; /** * Resolve a single skill directory. Tiers short-circuit on the first hit; the * git and plugin tiers resolve the source before any dependency call, then * best-effort enrich the manifest id with a registry UUID via the optional, * OFFLINE `findRegistryIdByRepoUrl`. */ recoverOne(dir: string, skillName: string, skillMd: string | null, opts?: RecoverOneOptions): Promise; /** Tier 4: embedding tiebreak over an ambiguous candidate set (opt-in). */ private resolveAmbiguous; /** Tier 5 helper: catalog repo_url then a speculative frontmatter author. */ private resolveHint; } //# sourceMappingURL=SourceRecoveryService.d.ts.map