/** * Memory importers for Hippo. * Imports memories from ChatGPT, Claude, Cursor, generic files, and structured markdown. */ import { MemoryEntry } from './memory.js'; export interface ImportResult { total: number; imported: number; skipped: number; /** AT1: refused by the rejection-value guard — kept distinct from * `skipped` (dedup) so a tombstoned value is distinguishable from a * plain duplicate in import summaries (plan §3 containment, round-2 low). * AT1 P2 fix (codex, published-surface compat): optional, not required — * `ImportResult` is re-exported from the package root (index.ts), and a * required field breaks any existing consumer constructing the pre-AT1 * shape. Every producer in this file still always sets a real number; * `?? 0` at read sites (this file's own accumulation, cli.ts's summary * prints) tolerates a caller-supplied object that omits it. */ rejected?: number; /** K1 vault import: rows archived this run (changed + source-deleted). In a * dryRun this is the would-be count (a true deletion-sync preview). */ archived?: number; entries: MemoryEntry[]; } export interface ImportOptions { dryRun?: boolean; global?: boolean; extraTags?: string[]; hippoRoot: string; /** * L9: tenant scope for the dedup read. When provided AND `global` is * false, the dedup check only considers this tenant's existing entries. * Ignored when `global: true` (global writes are host-wide by definition). * Undefined preserves pre-1.12.1 host-wide dedup behaviour. */ tenantId?: string; /** * K1 vault import only. Logical vault name used in the `vault:` tag and * the `artifactRef='vault::'` key. REQUIRED by importVault: it * is the identity key for the destructive source-deletion sync, so it must be * set explicitly rather than inferred from the folder basename (two vaults * sharing a basename would collide and clobber each other). importVault throws * if it is missing or blank. Optional in this shared type only because the * other importers ignore it. Operator-supplied, so the loader query LIKE-escapes * it (see `escapeLike` below). */ name?: string; /** * K1 vault import only. Memory scope stamped on every imported note. Defaults * to null (unscoped) when unset. */ scope?: string; } /** * Given an array of raw text chunks, deduplicate against existing memories, * create MemoryEntry objects, write them (unless dry-run), and return a result. */ export declare function importEntries(chunks: string[], source: string, tags: string[], options: ImportOptions): ImportResult; export declare function importChatGPT(filePath: string, options: ImportOptions): ImportResult; export declare function importClaude(filePath: string, options: ImportOptions): ImportResult; export declare function importCursor(filePath: string, options: ImportOptions): ImportResult; export declare function importGenericFile(filePath: string, options: ImportOptions): ImportResult; export declare function importMarkdown(filePath: string, options: ImportOptions): ImportResult; /** * Import a markdown vault FOLDER as `kind='raw'` memories. * * NOT re-entrant: idempotency rests on the in-memory `existing` Map loaded once * at the top. Two concurrent importVault runs over the same vault could both see * a note as absent and double-insert (the connector pattern relies on a single * sequential writer; same caveat applies here). */ export declare function importVault(folderPath: string, options: ImportOptions): ImportResult; //# sourceMappingURL=importers.d.ts.map