refactor: migrate VaultTools to use adapter interfaces

Update VaultTools constructor to accept IVaultAdapter and
IMetadataCacheAdapter. Add factory function for production usage.
Update stat, exists, and createFileMetadataWithFrontmatter methods.
This commit is contained in:
2025-10-19 23:25:22 -04:00
parent 248b3924fe
commit 25755661f7
3 changed files with 162 additions and 132 deletions

View File

@@ -2,6 +2,7 @@ import { App } from 'obsidian';
import { Tool, CallToolResult } from '../types/mcp-types';
import { NoteTools } from './note-tools';
import { VaultTools } from './vault-tools';
import { createVaultTools } from './vault-tools-factory';
import { NotificationManager } from '../ui/notifications';
export class ToolRegistry {
@@ -11,7 +12,7 @@ export class ToolRegistry {
constructor(app: App) {
this.noteTools = new NoteTools(app);
this.vaultTools = new VaultTools(app);
this.vaultTools = createVaultTools(app);
}
/**