/** * Move / rename / delete `.md` files inside the vault. * * Ported from the move/delete paths in aaronsb/obsidian-mcp-plugin's * `ObsidianAPI` (`renameFile`, `deleteFile`). The aaronsb version relies on * `app.vault.rename` / `app.fileManager.trashFile`, which handle link- * rewriting and trash semantics for free. This standalone implementation * uses plain `fs` calls; inbound wiki-link rewriting on move is driven * eagerly by the `move_note` tool layer (`src/tools/move-note.ts`) using * the edge store + `rewriteWikiLinks` — this function itself only touches * the file being moved. */ import type { DatabaseHandle } from '../store/db.js'; export interface MoveResult { /** Vault-relative source path. */ oldPath: string; /** Vault-relative destination path. */ newPath: string; } export interface DeleteResult { /** Vault-relative path that was requested for deletion. */ path: string; deletedFromIndex: { node: boolean; edges: number; embedding: boolean; stubsPruned: number; }; } /** * Rename or move a note. * * `destinationRel` is interpreted flexibly: * - If it points to an existing directory, the source filename is kept. * - If it ends with `/`, it's treated as a directory. * - Otherwise it's treated as a full relative file path; `.md` is * appended if the extension is missing. * * Intermediate directories are created. This function does NOT touch the * index — callers should trigger a re-scan afterwards. */ export declare function moveNote(vaultPath: string, sourceRel: string, destinationRel: string): Promise; /** * Delete a note and its index entries. * * Order: purge edges -> embedding -> node -> sync-path, then unlink the * file. If the file is already gone the index is still reconciled. * * Edge count is captured before deletion because `deleteEdgesBySource` * returns `void`. */ export declare function deleteNote(vaultPath: string, fileRelPath: string, db: DatabaseHandle): Promise;