/** * `openlore import ` — bootstrap the local graph index from a portable artifact, * validate-or-rebuild (change: add-shareable-graph-artifact). * * Safe by construction: the consumer validates the artifact before trusting it and NEVER * serves a stale, schema-mismatched, or tampered bundle as current. The validation ladder: * 1. bundle format version compatible (else rebuild) * 2. payload byte-integrity (tamper/corrupt) (else rebuild) * 3. index schema version matches (else rebuild) * 4. graph-content digest == bundled attestation, and the store reconciles healthy (else rebuild) * 5. currency vs the working tree: * commit == HEAD → import as-is (verified current) * no git / commit unknown → import as-is, currency disclosed as UNVERIFIED * stale (ancestor) / diverged → full local rebuild (incremental-delta is a deferred optimization) * Any validation failure degrades transparently to a local rebuild — import never leaves the * consumer worse off than having no artifact. The mechanism is offline and deterministic. */ import { Command } from 'commander'; import type { FileSignatureMap } from '../../core/analyzer/signature-extractor.js'; import { type Bundle } from '../../core/analyzer/index-bundle.js'; export interface ImportOptions { projectRoot?: string; } /** A rebuild reason, or null when the pre-materialize checks pass. Pure — unit-tested. */ export declare function preMaterializeRebuildReason(bundle: Bundle, currentBundleVersion?: number, currentSchemaVersion?: number): { reason: string; detail: string; } | null; export type ImportAction = 'import-fresh' | 'import-unverified' | 'rebuild'; /** Decide currency once the artifact has materialized and validated. Pure — unit-tested. */ export declare function currencyDecision(facts: { isGitRepo: boolean; sourceCommit: string | null; commitMatchesHead: boolean; commitIsAncestor: boolean; }): { action: ImportAction; reason: string; detail: string; }; /** Read the per-file signature maps the bundle persisted in llm-context.json (best-effort). */ export declare function readBundledSignatures(analysisDir: string): Promise; export declare function runImport(artifact: string, opts: ImportOptions): Promise; export declare const importCommand: Command; //# sourceMappingURL=import.d.ts.map