Commit graph

36 commits

Author SHA1 Message Date
Andrew Beal
ae321f382a feat: add create_vault_folder tool for directory creation
Add new AI tool to create vault folders with proper permission checks and error handling. Refactor createDirectories to be public and handle both file and directory paths. Update WriteVaultFile description formatting and fix method naming consistency.
2026-04-06 18:07:59 +01:00
Andrew Beal
984ed9eb82 feat: add multi-patch support with whitespace-flexible matching
Enable PatchVaultFile to apply multiple patches in a single operation by converting oldContent and newContent from strings to arrays. Add whitespace-flexible regex matching as fallback when exact string matching fails, improving robustness for code with varying indentation. Update schemas, tool definitions, and all tests to reflect the new array-based API.
2026-02-20 00:32:44 +00:00
Andrew Beal
a4800bd6da refactor: convert attachments to file-based storage with lazy loading.
Migrate attachment storage from base64-in-JSON to separate binary files with SHA-256 naming, add automatic garbage collection, implement lazy loading via getBase64() and getMimeType() methods, normalize text MIME types, add image resizing, and update all AI provider integrations. Fix small issue that caused the chat area to scroll down on message streaming end even when scrolled up.
2026-02-15 22:46:25 +00:00
Andrew Beal
cefc408b2e Add context passing between execution steps and enhance orchestration
- Add context_for_next_step parameter to CompleteStep for passing execution history
- Add context parameter to CompleteTask for preserving task completion state
- Update OrchestrationResult to handle context propagation between steps
- Add debug color differentiation for agent types (Main, Execution, Orchestration, Planning)
- Reorganize SearchTypes from Helpers to Types directory
- Add justification requirement for execution deviations
- Support reasonable deviations in orchestration plan validation
- Refactor dependency service with TryResolve utility
- Add whitespace cleanup to Semaphore class
2026-01-28 21:23:47 +00:00
Andrew Beal
13cdd0a162 feat: add support for file attachments via drag and drop and paste.
refactor: standardize file type and MIME type handling across AI providers

Introduce centralized MimeType enum and bidirectional mappings between file types and MIME types. Update Claude, Gemini, and OpenAI implementations to use consistent MIME type validation. Add file attachment support via drag-and-drop and paste in chat input. Expand supported file type detection to include programming languages, config files, and documentation formats.
2025-12-22 20:02:02 +00:00
Andrew Beal
9b67c45a78 - Improve mobile keyboard focus ux in diff view events
- Improve readFile error message for non-existent files
2025-12-07 13:43:09 +00:00
Andrew Beal
065d475d74 Refactor file patching from unified diff to direct string replace
This change simplifies the patch mechanism by replacing the unified diff format with a straightforward find-and-replace approach. The PatchVaultFile function now accepts oldContent and newContent parameters instead of a diff patch string, making it more intuitive and reliable for AI agents to use.

Key changes:
- Update PatchVaultFile function signature and documentation
- Replace diff.applyPatch() with String.replace()
- Simplify error handling for content matching
- Update all tests to reflect new API
- Remove unused applyPatch method from DiffService
- Fix diff container height calculation in CSS
- Fix error notification logic in ChatService
- Fix conversation deletion order in TopBar component
2025-12-05 23:02:55 +00:00
Andrew Beal
f7ff10699d Add PatchVaultFile function for incremental file updates
Implements unified diff patching as an alternative to WriteVaultFile for making targeted changes without replacing entire files. Includes new PatchVaultFile AI function, DiffService.applyPatch method, and comprehensive test coverage.
2025-12-05 22:48:54 +00:00
Andrew Beal
28772e7d0e feat: implement centralized abort controller with enhanced cancellation UX
Introduce a new AbortService to centralize cancellation logic across all async operations, replacing scattered AbortSignal parameters with a unified singleton service. This improves maintainability and provides consistent cancellation behavior throughout the application.

Key changes:
- Add AbortService for centralized abort signal management with automatic cleanup
- Refactor all AI providers (Claude, Gemini, OpenAI) to use AbortService instead of passing AbortSignal parameters
- Update streaming operations to use centralized abort handling
- Add CancellationIndicator component to show visual feedback during operation cancellation
- Rename ChatAreaThought to ThoughtIndicator for better semantic clarity
- Add Environment enum for consistent environment detection
- Enhance ChatService lifecycle with proper cancellation state management
- Remove scattered abort-related UI selectors and error messages in favor of dedicated indicator
- Add safeContinue() factory method to ConversationContent for internal continuations
- Update all tests to reflect new abort handling architecture

This change simplifies the API surface by removing AbortSignal parameters from method signatures while improving the user experience with clearer cancellation feedback.
2025-12-04 23:04:20 +00:00
Andrew Beal
2d5a1b52bf feat: add interactive diff viewer with user approval workflow
Implement a comprehensive diff viewing system that allows users to review and approve/reject file changes before they're applied. The system includes event-driven architecture for managing diff lifecycle and integrates diff2html for rich visual diffs.

Key changes:
- Add DiffService for managing diff approval workflow with accept/reject/suggest actions
- Create EventService for type-safe event handling (DiffOpened/DiffClosed)
- Add DiffView component with diff2html integration for visual diff rendering
- Modify VaultService to propose changes and require confirmation before file operations
- Update FileSystemService to support optional confirmation for write operations
- Add Event enum for centralized event type definitions
- Import custom styles and diff2html styles for proper diff rendering
- Update ConversationContent validation to support optional toolId field
- Remove FileManager from dependency injection (now accessed directly from app)
- Update .gitignore to track styles.css instead of main.css
2025-11-24 21:29:54 +00:00
Andrew Beal
167a2b13a5 refactor: standardize error handling with Exception helper and improve return types
Add Exception helper class for consistent error handling and logging. Replace throw statements and console.error calls with Exception methods. Update service methods to return Error | T instead of mixed success/failure objects. Improve type safety in Claude.extractContents with explicit return type.

Add WikiLinks helper to VaultCacheService for managing wiki link references.

Update unit tests.
2025-11-17 19:02:15 +00:00
Andrew Beal
fbe5766d03 refactor: consolidate string utilities into StringTools class
Move isValidJson, dateToString, and escapeRegex from Helpers to new StringTools class. Add asRegex method for parsing regex literals with /pattern/flags format. Update all imports and usages across codebase.
2025-11-12 21:12:36 +00:00
Andrew Beal
dc192a98fe refactor: change writeFile to return Error | undefined instead of boolean
Update FileSystemService.writeFile return type from boolean | Error to Error | undefined for cleaner error handling pattern. Adjust AIFunctionService and tests accordingly.
2025-11-11 19:54:11 +00:00
Andrew Beal
4b9f703aa2 fix: improve TypeScript type safety across services and mocks
- Add explicit type assertions and casts to resolve any types
- Update return types from any to Error | boolean
- Add eslint-disable comments for unavoidable any types
- Improve mock type safety replacing any with unknown
- Add proper type parameters to callback functions
2025-11-10 20:37:13 +00:00
Andrew Beal
235609dc4c refactor: improve type safety and remove unused imports
- Add explicit type casting for API call results
- Fix regex escape sequences to use Unicode notation
- Remove unused type imports across multiple services
- Update file deletion to use FileManager.trashFile
- Add missing switch case for folder modify events
- Move CSS imports to ES6 import syntax
2025-11-10 13:44:16 +00:00
Andrew Beal
cac0db5b07 Update esling config to closer match obsidian recommended.
esling autofix
2025-11-10 11:14:06 +00:00
Andrew Beal
a217e84643 Rename plugin to Vaultkeeper AI 2025-11-10 08:03:27 +00:00
Andrew Beal
ff111c69e6 Rename from AI Agent to Vault AI 2025-11-09 23:09:08 +00:00
Andrew Beal
4d8edc8b96 Update delete functionality to support folders and use trash
- Enhance DeleteVaultFiles to handle both files and folders
- Change VaultService.delete to use vault.trash instead of permanent deletion
- Remove TFile type check to allow folder deletion
- Simplify delete method signature by removing unused force parameter
- Increase default snippet size limit from 150 to 300 characters
- Fix IPrompt to use SettingsService instead of direct plugin access
- Update all tests to reflect trash behavior and folder support
2025-11-03 21:37:47 +00:00
Andrew Beal
0a7d95e0fe Add tests for FileSystemService. 2025-11-01 15:15:16 +00:00
Andrew Beal
72ddbba72e feat: add ListVaultFiles function and improve search behavior
- Add new ListVaultFiles AI function for listing vault contents
- Remove auto-fallback to listing all files when search returns 0 results
- Improve SearchVaultFiles description to clarify it searches content
- Add listFoldersInDirectory and listDirectoryContents methods to VaultService
- Update SanitiserService to normalize empty strings to "/" (vault root)
- Add allowAccessToPluginRoot parameter to searchVaultFiles
- Update tests to reflect new search behavior and list operations
- Add DeregisterAllServices call in plugin onunload
- Update dependencies (@google/genai, svelte, vitest, eslint)
2025-11-01 11:43:32 +00:00
Andrew Beal
679a94d173 feature: implement fuzzysearch service
refactor: rename type interfaces to use I prefix convention

Standardize naming by adding I prefix to all interface types across the codebase (StreamChunk → IStreamChunk, SearchMatch → ISearchMatch, etc.). Also rename conversationStore.ts to ConversationStore.ts for consistency.
2025-10-29 19:35:19 +00:00
Andrew Beal
a35b3dd0c9 refactor: replace let with const for immutable variables 2025-10-18 00:28:23 +01:00
Andrew Beal
38c9809a27 feat: add AI-powered conversation naming with Gemini integration
Implement automatic conversation title generation using Gemini API. Add IConversationNamingService interface with GeminiConversationNamingService implementation. Integrate naming service into ChatService to generate titles on first user message. Update ConversationFileSystemService to support title updates via file renaming.
2025-10-17 16:18:23 +01:00
Andrew Beal
d0be254c5f feat: add batch file operations and move functionality
- Rename DeleteVaultFile to DeleteVaultFiles with array support
- Add MoveVaultFiles function for file relocation and renaming
- Refactor file operations to return structured success/error results
- Move directory creation logic to VaultService
- Register FileManager dependency for file operations
- Fix CSS variable for interactive accent blue hover state
2025-10-16 22:58:30 +01:00
Andrew Beal
76afac7ffc refactor: enhance file operations to support batch reads and deletion
- Rename ReadVaultFile to ReadVaultFiles with multi-file support
- Add DeleteVaultFile function with confirmation parameter
- Update function references and error handling
- Return detailed error objects from FileSystemService
2025-10-15 21:06:23 +01:00
Andrew Beal
9f8d0b5ee8 feat: rename ReadFile to ReadVaultFile and add WriteVaultFile function
- Rename ReadFile to ReadVaultFile for consistency
- Add WriteVaultFile function for destructive operations
- Fix array concatenation bug in getQueryActions
- Return all vault files when search yields no results
- Update SearchVaultFiles description to clarify fallback behavior
- Improve error handling in writeFile to return error details
- Reorder system prompt sections for better clarity
2025-10-14 22:42:52 +01:00
Andrew Beal
d58e9ef1ff refactor: enhance vault search to return content snippets with context
- Update SearchVaultFiles function to return contextual snippets instead of just file lists
- Implement snippet extraction with configurable context length (300 chars)
- Add snippet merging logic to consolidate overlapping matches
- Limit results to 20 randomly sampled matches when exceeding threshold
- Update return types across service layer to use SearchMatch/SearchSnippet
- Change regex flags to 'ig' for global case-insensitive matching
2025-10-14 19:50:45 +01:00
Andrew Beal
f2a7a41705 refactor: replace ListVaultFiles with content-based SearchVaultFiles
Replace list_vault_files function with search_vault_files that performs regex-based content search instead of listing all files. Add escapeRegex helper for search term sanitization. Remove unused edit mode CSS.
2025-10-14 18:54:16 +01:00
Andrew Beal
c188f5727e Add allowAccessToPluginRoot parameter to prevent AI editing user instructions
This change adds a new `allowAccessToPluginRoot` parameter throughout the filesystem and vault service layers to control access to plugin root directories. The AI assistant is now prevented from modifying the user instruction file while still allowing internal plugin operations to access conversation data and configuration files.
2025-10-12 23:11:36 +01:00
Andrew Beal
e543bf5351 refactor: improve dependency injection type safety and add AI exclusions setting
- Add generic types to all Resolve() calls for type safety
- Introduce VaultService abstraction layer for file operations
- Add AI File Exclusions setting with textarea and glob pattern support
- Refactor FileSystemService to use VaultService instead of direct Vault access
- Improve code organization with comments and renamed variables
- Update styles for exclusions input field
2025-10-12 21:26:01 +01:00
Andrew Beal
d910239a7f Add wiki-link support, API key validation, and refactor AI provider initialization
Implement clickable wiki-links in assistant responses with WorkSpaceService for note navigation. Add API key validation with visual feedback in ChatWindow, automatically opening settings when empty. Extract settings helper to reduce code duplication. Refactor Gemini class to resolve API key from plugin settings rather than constructor parameter. Update system prompt with wiki-link usage guidelines. Remove unused ODB cache implementation and loadExternalCSS helper. Improve UI with enhanced empty state styling and input textarea scrolling behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-08 22:06:25 +01:00
Andrew Beal
74eb20c2a1 Implement conversation history modal with Svelte component, enhance conversation file system service for loading conversations, and update styles for modal presentation. Refactor file handling methods and remove unused modal service. 2025-10-05 13:06:05 +01:00
Andrew Beal
adbe6045cf Implement conversation reset functionality and file deletion in ConversationFileSystemService 2025-10-03 22:14:30 +01:00
Andrew Beal
370c5d54bb Refactor plugin to replace DmsAssistant with AIAgent, updating imports, services, and manifest files accordingly 2025-10-02 11:10:57 +01:00
Andrew Beal
523a95f3d5 Refactor services and helpers: reorganize imports, implement ConversationFileSystemService, and enhance FileSystemService functionality 2025-09-30 21:20:24 +01:00