import type { CortexStore, ParsedMemoryItem } from '../db/store.js'; import type { MemoryReferenceDetail } from './inspect.js'; export interface EditMemoryResult { item: ParsedMemoryItem; prior_text: string; references: MemoryReferenceDetail[]; correction_id: string; } /** * Replace an item's text, re-extract its references and re-project it. * * The store performs the update, the reference re-extraction and the audit * write in one transaction; this layer only resolves the id and reports the * result. Returns null when the id resolves to nothing. */ export declare function editMemory(store: CortexStore, id: string, text: string): EditMemoryResult | null; export interface DeletionCounterpart { id: string; subject: string | null; } export interface MemoryDeletionPreview { item: ParsedMemoryItem; source_table: string | null; source_id: string | null; /** False when no deletion rule exists for `source_table`; the delete refuses. */ deletable: boolean; /** The table the source row would be rebuilt from, if any. */ upstream_table: string | null; reference_count: number; /** True when the item is one side of an open contest. */ contested: boolean; /** The other side(s), whose contest this deletion will clear. */ counterparts: DeletionCounterpart[]; /** Set when the source row holds more than this item's text. */ aggregate_warning: string | null; } /** * What a deletion would remove, without removing it. * * Destructive commands in this repo preview by default — `cortex gc` is * dry-run unless `--apply`, and `project-context.md` makes that the standing * convention. This is the read half of that pairing, and it is also the * confirmation AC #2 requires: the user sees the item before affirming. */ export declare function previewMemoryDeletion(store: CortexStore, id: string): MemoryDeletionPreview | null; export interface MemoryDeletionResult { deleted: boolean; item: ParsedMemoryItem; source_table: string | null; source_id: string | null; /** Notes whose contest was closed because this side went away. */ cleared_contest_for: string | null; } /** * Delete an item, its source row and everything derived from it, in one * transaction. Returns null when the id resolves to nothing. */ export declare function deleteMemory(store: CortexStore, id: string): MemoryDeletionResult | null; //# sourceMappingURL=correct.d.ts.map