Phase 2: API Unification & Typed Results + Phase 2.1 Fixes

Phase 2 - Breaking Changes (v2.0.0):
- Added typed result interfaces (FileMetadata, DirectoryMetadata, VaultInfo, SearchResult, SearchMatch)
- Unified parameter naming: list_notes now uses 'path' parameter (removed 'folder')
- Enhanced tool responses with structured JSON for all tools
- list_notes: Returns array of FileMetadata/DirectoryMetadata with full metadata
- search_notes: Returns SearchResult with line numbers, snippets, and match ranges
- get_vault_info: Returns VaultInfo with comprehensive statistics
- Updated all tool descriptions to document structured responses
- Version bumped to 2.0.0 (breaking changes)

Phase 2.1 - Post-Testing Fixes:
- Fixed root listing to exclude vault root folder itself (handles path '', '/', and isRoot())
- Fixed alphabetical sorting to be case-insensitive for stable ordering
- Improved directory metadata with better timestamp detection and error handling
- Fixed parent folder validation order (check if file before checking existence)
- Updated documentation with root path examples and leading slash warnings
- Added comprehensive test suite for sorting and root listing behavior
- Fixed test mocks to use proper TFile/TFolder instances

Tests: All 64 tests passing
Build: Successful, no errors
This commit is contained in:
2025-10-16 22:49:28 -04:00
parent d074470d11
commit 9d07ec64e2
13 changed files with 1043 additions and 70 deletions

View File

@@ -46,8 +46,8 @@ The plugin is currently minimally functioning with basic CRUD operations and sim
| **P0** | Error Message Improvements | 1 day | ✅ Complete |
| **P0** | Enhanced Parent Folder Detection | 0.5 days | ✅ Complete |
| **P0** | Enhanced Authentication | 2-3 days | ✅ Complete |
| **P1** | API Unification | 2-3 days | ⏳ Pending |
| **P1** | Typed Results | 1-2 days | ⏳ Pending |
| **P1** | API Unification | 2-3 days | ✅ Complete |
| **P1** | Typed Results | 1-2 days | ✅ Complete |
| **P1** | Discovery Endpoints | 2-3 days | ⏳ Pending |
| **P1** | Write Operations & Concurrency | 5-6 days | ⏳ Pending |
| **P2** | List Ergonomics | 3-4 days | ⏳ Pending |
@@ -57,8 +57,8 @@ The plugin is currently minimally functioning with basic CRUD operations and sim
| **P3** | Waypoint Support | 3-4 days | ⏳ Pending |
**Total Estimated Effort:** 29.5-42.5 days
**Completed:** 2.5-3.5 days (Phase 1.1-1.5)
**Remaining:** 27-39 days
**Completed:** 5.5-8.5 days (Phase 1.1-1.5, Phase 2)
**Remaining:** 24-34 days
---
@@ -312,7 +312,8 @@ Improve bearer token authentication with automatic secure key generation and enh
**Priority:** P1
**Dependencies:** Phase 1
**Estimated Effort:** 3-5 days
**Estimated Effort:** 3-5 days
**Status:** ✅ Complete
### Goals
@@ -322,14 +323,14 @@ Standardize parameter naming and return structured, typed results.
#### 2.1 Parameter Unification
- [ ] Standardize on `path` parameter for all file/folder operations
- [ ] Keep `folder` as deprecated alias for backward compatibility
- [ ] Update tool schemas in `handleListTools()`
- [ ] Add deprecation warnings to documentation
- [x] Standardize on `path` parameter for all file/folder operations
- [x] Remove `folder` parameter (breaking change)
- [x] Update tool schemas in `handleListTools()`
- [x] Update documentation
**Changes:**
- `list_notes({ folder })``list_notes({ path })`
- Document `folder` as deprecated but still functional
- `folder` parameter completely removed
#### 2.2 Typed Result Interfaces
@@ -385,16 +386,17 @@ export interface SearchResult {
#### 2.3 Update Tool Return Values
- [ ] Modify `listNotes` to return structured `FileMetadata[]` or `DirectoryMetadata[]`
- [ ] Modify `getVaultInfo` to return `VaultInfo`
- [ ] Modify `searchNotes` to return `SearchResult`
- [ ] Return JSON-serialized structured data instead of plain text
- [x] Modify `listNotes` to return structured `FileMetadata[]` or `DirectoryMetadata[]`
- [x] Modify `getVaultInfo` to return `VaultInfo`
- [x] Modify `searchNotes` to return `SearchResult`
- [x] Return JSON-serialized structured data instead of plain text
#### 2.4 Documentation Updates
- [ ] Update README with new response formats
- [ ] Add examples of structured responses
- [ ] Document backward compatibility notes
- [x] Update CHANGELOG with new response formats
- [x] Add examples of structured responses
- [x] Document migration guide from v1.x to v2.x
- [x] Mark Phase 2 as complete in ROADMAP
---