import type { IndexMemory } from "../indexer/index-memory.js"; import type { Memory } from "../types/index.js"; export interface ExportOptions { format: "markdown" | "notion" | "json"; /** Output path. For markdown: directory. For json/notion: file. */ to: string; /** Limit by kind (episodic/semantic/procedural). Optional. */ kind?: "episodic" | "semantic" | "procedural"; /** Include invalidated rows (the bi-temporal timeline). Default false. */ includeInvalidated?: boolean; /** Notion-only: target database id. Required for format=notion. */ notionDatabase?: string; } export interface ExportReport { format: ExportOptions["format"]; written: string[]; rowsExported: number; byCategory: Record; } export declare function runMemoryExport(indexer: IndexMemory, opts: ExportOptions): ExportReport; /** * Render every memory row as one combined markdown document, grouped by * category. Used by `sverklo memory show` (prints to stdout) and * `sverklo memory edit` (round-trips through $EDITOR). The format is the * same per-memory shape as `writeMarkdown` so users can pipe `show` * output into the existing export markdown without surprises. * * Memory headings carry the row id (`## #42 · ...`) so the round-trip * parser in `parseMarkdownEdits` can match edited content back to the * source row by id. */ export declare function renderMarkdownCombined(rows: Memory[]): string; /** * Parse `renderMarkdownCombined` output back into a list of {id, content} * pairs. Used by `sverklo memory edit` to round-trip user edits. * * Safety policy: this parser only emits {id, content} pairs for headings * the user kept. It NEVER deletes by omission — if a heading was removed * from the file, the corresponding row is left alone, not deleted. Users * who actually want to delete a memory should use `sverklo memory demote` * or `sverklo_demote` from MCP. * * Returns `null` if the parser can't match a clean structure (so the * caller can abort instead of writing partial garbage). */ export declare function parseMarkdownEdits(text: string): Array<{ id: number; content: string; }> | null;