feat: add word count support for read operations

Extended word count functionality to read operations (read_note, stat, list) to complement existing write operation support.

Changes:
- read_note: Now automatically includes wordCount when returning content (with withContent or parseFrontmatter options)
- stat: Added optional includeWordCount parameter with performance warning
- list: Added optional includeWordCount parameter with performance warning
- All operations use same word counting rules (excludes frontmatter and Obsidian comments)
- Best-effort error handling for batch operations

Technical details:
- Updated ParsedNote and FileMetadata type definitions to include optional wordCount field
- Added comprehensive test coverage (18 new tests)
- Updated tool descriptions with usage notes and performance warnings
- Updated CHANGELOG.md to document new features in version 1.1.0
This commit is contained in:
2025-10-30 10:46:16 -04:00
parent c2002b0cdb
commit f8c7b6d53f
7 changed files with 380 additions and 12 deletions

View File

@@ -73,6 +73,7 @@ export interface FileMetadata {
size: number;
modified: number;
created: number;
wordCount?: number;
}
export interface DirectoryMetadata {
@@ -181,6 +182,7 @@ export interface ParsedNote {
parsedFrontmatter?: Record<string, any>;
content: string;
contentWithoutFrontmatter?: string;
wordCount?: number;
}
/**