/** * MRSF Types — shared type definitions for the MRSF CLI and library. */ /** A parsed MRSF sidecar document. */ export interface MrsfDocument { mrsf_version: string; document: string; comments: Comment[]; /** Catch-all for unknown / x_-prefixed extension fields at the top level. */ [key: string]: unknown; } /** A single review comment. */ export interface Comment { id: string; author: string; timestamp: string; text: string; resolved: boolean; line?: number; end_line?: number; start_column?: number; end_column?: number; selected_text?: string; selected_text_hash?: string; anchored_text?: string; commit?: string; type?: string; severity?: "low" | "medium" | "high"; reply_to?: string; /** Catch-all for unknown / x_-prefixed extension fields. */ [key: string]: unknown; } export type CommentExtensionValue = null | boolean | number | string | CommentExtensionValue[] | { [key: string]: CommentExtensionValue; }; export type CommentExtensions = Record<`x_${string}`, CommentExtensionValue>; export interface MrsfConfig { sidecar_root?: string; } export type DiagnosticSeverity = "error" | "warning"; export interface ValidationDiagnostic { severity: DiagnosticSeverity; code: string; message: string; /** Path within the document, e.g. "/comments/0/end_line". */ path?: string; /** The comment id this diagnostic relates to, if applicable. */ commentId?: string; } export interface ValidationResult { valid: boolean; errors: ValidationDiagnostic[]; warnings: ValidationDiagnostic[]; } export type ReanchorStatus = "anchored" | "shifted" | "fuzzy" | "ambiguous" | "orphaned"; export interface ReanchorResult { commentId: string; status: ReanchorStatus; /** Confidence score 0.0–1.0; 1.0 for exact/shifted. */ score: number; /** Updated line (if changed). */ newLine?: number; newEndLine?: number; newStartColumn?: number; newEndColumn?: number; /** Text currently at the resolved anchor position (for anchored_text field). */ anchoredText?: string; /** Previous selected_text before update (for audit / --update-text). */ previousSelectedText?: string; /** Human-readable explanation of the resolution. */ reason: string; } export interface AnchorPosition { status: ReanchorStatus; score: number; /** Absolute 0-based character offset in normalized document text (start). */ from?: number; /** Absolute 0-based character offset in normalized document text (end, exclusive). */ to?: number; /** 1-based start line. */ line?: number; /** 1-based end line. */ endLine?: number; /** 0-based start column. */ startColumn?: number; /** 0-based end column. */ endColumn?: number; reason: string; } export interface FuzzyCandidate { /** Matched text in the document. */ text: string; /** 1-based start line of the match. */ line: number; /** 1-based end line (inclusive). */ endLine: number; /** 0-based start column on the start line. */ startColumn: number; /** 0-based end column on the end line. */ endColumn: number; /** Similarity score 0.0–1.0. */ score: number; } export interface DiffHunk { /** Original file start line (1-based). */ oldStart: number; /** Number of lines in the original. */ oldCount: number; /** New file start line (1-based). */ newStart: number; /** Number of lines in the new file. */ newCount: number; /** Raw diff lines (prefixed with +, -, or space). */ lines: string[]; } export interface AddCommentOptions { text: string; author: string; line?: number; end_line?: number; start_column?: number; end_column?: number; type?: string; severity?: "low" | "medium" | "high"; commit?: string; reply_to?: string; /** Override auto-generated id. */ id?: string; /** Override auto-generated timestamp. */ timestamp?: string; /** Tool-specific extension fields keyed by x_*. */ extensions?: CommentExtensions; } export interface EditCommentOptions { text: string; /** Optional actor identity for author-based edit permission checks. */ actor?: string; } export interface CommentFilter { open?: boolean; resolved?: boolean; orphaned?: boolean; author?: string; type?: string; severity?: "low" | "medium" | "high"; } export type AnchorHealth = "fresh" | "stale" | "orphaned" | "unknown"; export interface StatusResult { commentId: string; health: AnchorHealth; commitAge?: string; reason: string; } export interface BaseOptions { /** Working directory (defaults to process.cwd()). */ cwd?: string; /** Path to .mrsf.yaml config. */ configPath?: string; } export interface ReanchorOptions extends BaseOptions { /** Dry run — report without modifying files. */ dryRun?: boolean; /** Fuzzy match threshold 0.0–1.0 (default 0.6). */ threshold?: number; /** Write updated anchors back to sidecar. */ autoUpdate?: boolean; /** Only process sidecars for staged Markdown files. */ staged?: boolean; /** Disable git integration. */ noGit?: boolean; /** Override from-commit for all comments. */ fromCommit?: string; /** Update selected_text to match anchored_text (opt-in per §6.2). */ updateText?: boolean; /** * Proximity window (in lines) for the §7.4 step 1a relocation guard. * A lone exact match farther than this from the original line, when the * original position's text has changed, is kept in place and flagged for * re-anchoring rather than relocated with full confidence. Default 5. */ proximityWindow?: number; /** Force-anchor: update commit to HEAD and clear audit fields for high-confidence results. */ force?: boolean; } export interface ValidateOptions extends BaseOptions { /** Treat warnings as errors. */ strict?: boolean; } //# sourceMappingURL=types.d.ts.map