/** * MRSF Comment Operations — CRUD for sidecar comments. */ import type { AddCommentOptions, Comment, CommentFilter, CommentExtensions, EditCommentOptions, MrsfDocument } from "./types.js"; export declare function normalizeCommentExtensions(extensions?: Record): CommentExtensions; /** * Add a new comment to a document. Mutates doc.comments in place. * Returns the created comment. */ export declare function addComment(doc: MrsfDocument, opts: AddCommentOptions, repoRoot?: string): Promise; /** * Populate selected_text from document lines (reads the file content region). * Should be called after addComment if the caller provides line info but not selected_text. */ export declare function populateSelectedText(comment: Comment, documentLines: string[]): void; export declare function editComment(doc: MrsfDocument, commentId: string, opts: EditCommentOptions): Comment; /** * Resolve a comment by id. Per §9, resolving a parent does NOT * automatically resolve its replies. * * Returns true if the comment was found and updated. */ export declare function resolveComment(doc: MrsfDocument, commentId: string, cascade?: boolean): boolean; /** * Unresolve a comment by id. */ export declare function unresolveComment(doc: MrsfDocument, commentId: string): boolean; export interface RemoveCommentOptions { /** * When true, also delete all direct replies instead of promoting them. * Default: false (promote replies per §9.1). */ cascade?: boolean; } /** * Remove a comment by id. Per §9.1, direct replies are promoted: * their anchor fields are inherited from the parent (when absent), * and their `reply_to` is re-pointed to the parent's parent (or cleared). * * If `cascade` is true, direct replies are removed along with the parent. * * Returns true if the comment was found and removed. */ export declare function removeComment(doc: MrsfDocument, commentId: string, opts?: RemoveCommentOptions): boolean; /** * Filter comments based on criteria. */ export declare function filterComments(comments: Comment[], filter: CommentFilter): Comment[]; /** * Get a list of threads — groups of comments by their root ID via reply_to. * Returns a map of root comment ID → [root, ...replies in order]. */ export declare function getThreads(comments: Comment[]): Map; export interface CommentSummary { total: number; open: number; resolved: number; orphaned: number; threads: number; byType: Record; bySeverity: Record; } /** * Generate summary statistics for a comment list. */ export declare function summarize(comments: Comment[]): CommentSummary; //# sourceMappingURL=comments.d.ts.map