/** * `openlore import ` — bootstrap the local graph index from a portable artifact, * validate-or-rebuild (change: add-shareable-graph-artifact). * * The consumer validates integrity and currency before promotion, while producer authenticity * is a separate optional signature verdict. Unsigned integrity is never described as authenticity. * 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: * clean build + commit == HEAD → import as-is (current versus that commit) * dirty / legacy-unknown build → import as-is with approximate/unknown currency * no git / commit unknown → import as-is, currency disclosed as UNVERIFIED * clean ancestor → apply the exact bounded delta through the watcher convergence path * diverged / dirty ancestor / oversized delta → full local rebuild * 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, type BundleSignatureVerdict } from '../../core/analyzer/index-bundle.js'; import { type SourceTreeState } from '../../core/analyzer/source-state.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-current' | 'import-delta' | 'import-approximate' | 'import-currency-unknown' | 'rebuild'; /** Decide currency once the artifact has materialized and validated. Pure — unit-tested. */ export declare function currencyDecision(facts: { isGitRepo: boolean; sourceCommit: string | null; sourceTreeState: SourceTreeState; consumerTreeState?: SourceTreeState; commitMatchesHead: boolean; commitIsAncestor: boolean; }): { action: ImportAction; reason: string; detail: string; }; export interface GitDeltaPaths { changed: string[]; deleted: string[]; } /** Parse `git diff --name-status -z -M` without treating repository paths as shell input. */ export declare function parseGitNameStatus(raw: Buffer): GitDeltaPaths; export declare function provenanceDetail(verdict: BundleSignatureVerdict): 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