Commit graph

33 commits

Author SHA1 Message Date
Andrew Beal
989fab565d feat: implement prompt caching for Claude API requests
Add cache control to system prompt, tools, and conversation messages to optimize API performance and reduce costs by caching frequently reused content.
Update GitHub link to point directly to project page.
Improve prompt for user suggestion during actions that require confirmation.
Update unit tests.
Bump dependency versions.
2025-12-27 19:52:59 +00:00
Andrew Beal
e3e30a2b47 fix: improve chat scroll calculation and conversation deletion handling
- Use getOuterHeight helper for accurate element measurements including margins
- Simplify gap calculation for thought and streaming indicators
- Add top fade gradient to chat area for better visual polish
- Queue AI file deletions to prevent blocking conversation deletion
- Only trigger modal close callback when no conversation is active
2025-12-20 01:34:41 +00:00
Andrew Beal
d36815c214 feat: add Gemini thought signature support and OpenAI Responses API migration
Implement thought signature tracking for Gemini function calls to support Gemini 3 requirements. Migrate OpenAI integration from Chat Completions to Responses API with proper input/output item handling. Add cross-provider compatibility via legacy text format fallback for conversations without thought signatures or tool IDs. Improve chat auto-scroll behavior and conversation validation. Add and update AI class and conversation tests.
2025-12-10 21:27:58 +00:00
Andrew Beal
d93e61bc9d fix: improve chat service lifecycle and diff handling reliability
- Stop chat service before loading conversations and resetting
- Add proper diff cancellation with resolve callback
- Add runtime type guards for plugin settings API access
- Improve diff view layout with padding adjustments
- Remove overly permissive TypeScript ESLint overrides
2025-11-27 16:47:21 +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
f6f540ede9 fix: handle legacy function calls without IDs in Claude provider
Add validation to check for missing or empty function call IDs when
converting stored conversation history. Function calls and responses
without valid IDs are now converted to text format with [Legacy Tool Call]
and [Legacy Tool Result] prefixes to preserve context when switching
between providers.

Also improve ConversationHistoryModal initialization, add empty state
copy constant, enhance system prompt with regex pattern guidance, and
clean up formatting.
2025-11-11 23:46:53 +00:00
Andrew Beal
37db1a8908 refactor: improve type safety and add Zod validation for function arguments
- Change function arguments type from `Record<string, object>` to `Record<string, unknown>`
- Add Zod schemas for all AI function arguments validation
- Improve TypeScript types across modals and services
- Add ESLint disable comments for intentional exceptions
- Fix async/await handling in modal and view lifecycle methods
- Update dependencies (@typescript-eslint 8.46.4, rollup 4.53.2, zod 4.1.12)
2025-11-10 19:41:17 +00:00
Andrew Beal
643129517a refactor: convert TypeScript namespaces to standalone functions
Migrate AIProvider and SearchTrigger from namespace pattern to exported functions. Simplify OpenAITokenService async implementation, remove unused imports, fix enum aliases, and update placeholder text.
2025-11-10 12:59:48 +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
ce861d24d1 Update Help Modal to use centralized Copy enum and update manifest metadata
- Extract hardcoded strings in HelpModalSvelte to Copy enum constants
- Update manifest version to 1.0.0 and minAppVersion to 1.9.14
- Replace placeholder author/funding URLs with actual GitHub and Buy Me a Coffee links
- Improve maintainability by centralizing UI copy in Enums/Copy.ts
2025-11-09 20:54:02 +00:00
Andrew Beal
c9942e9ffa feat: add comprehensive help modal with guide and troubleshooting content
- Add detailed plugin guide covering modes, references, and instructions
- Add troubleshooting section with API key and rate limit solutions
- Add privacy documentation explaining data storage and exclusions
- Make "User Instructions" text clickable to open help modal
- Support opening help modal to specific topic via initialTopic prop
- Add internal link handling to navigate from help modal to vault files
- Update About section with GitHub link and contribution info
2025-11-09 19:59:41 +00:00
Andrew Beal
0812e91c37 fix: prevent empty messages and assistant-to-assistant structure
- Filter out messages with empty content in Claude, Gemini, and OpenAI
- Insert hidden "Continue" message when last message is from assistant
- Remove function call JSON from assistant message content
- Hide empty messages in ChatArea UI
- Add GitHub link and about content to help modal
- Add comprehensive tests for message handling edge cases
2025-11-09 13:57:47 +00:00
Andrew Beal
e3c0728c24 feat: add mobile dropdown navigation to help modal
Replace side navigation with dropdown selector on mobile devices, improving usability on smaller screens by consolidating topic selection into a compact dropdown component.
2025-11-08 17:15:55 +00:00
Andrew Beal
edaa647b9e feat: add help modal topic titles and improve layout
- Add titles for About, Plugin Guide, Troubleshooting, and Privacy sections
- Limit topic sidebar width to 150px with text truncation for long labels
- Apply ellipsis overflow handling to prevent layout breaking
2025-11-08 13:48:39 +00:00
Andrew Beal
9cb74f6f2f refactor: replace unique IDs with nth-child selectors in HelpModal
Remove unnecessary unique IDs from help modal topic elements and their corresponding CSS selectors, replacing them with more maintainable nth-child pseudo-selectors.
2025-11-08 13:41:29 +00:00
Andrew Beal
7b6682f951 feat: implement help modal with topic navigation and content display
- Add HelpModal enum entries for titles and content
- Implement HelpModalSvelte component with sidebar navigation
- Add topic selection functionality with fade transitions
- Style help modal with grid layout and custom backgrounds
- Display plugin version in modal footer
- Apply consistent spacing with conversation history modal
2025-11-08 13:31:53 +00:00
Andrew Beal
4c2630b7f5 feat: add help modal button to top bar and update license to MIT
- Add HelpModal integration to TopBar with circle-help icon
- Update LICENSE from 0BSD to MIT License
- Refactor modal constructors to use dependency injection
- Format code style (quotes, indentation) in TopBar and ConversationHistoryModal
2025-11-07 00:28:22 +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
098c598c88 feat: add updated timestamp tracking to conversations
Track when conversations are last modified by adding an `updated` field to the Conversation model. Sort conversation history by last updated time instead of creation time for better user experience.
2025-10-22 10:06:32 +01:00
Andrew Beal
eeceda00e1 refactor: migrate to Obsidian theme variables for consistent theming
Replace hardcoded color values and custom CSS variables with Obsidian's
built-in theme variables for backgrounds, borders, and interactive elements.
Removes unused isStreaming state and simplifies gradient background. Updates
view display text to "AI Agent".
2025-10-17 23:51:23 +01:00
Andrew Beal
2fc9edc194 refactor: move typing-in animation to global styles and add conversation title to top bar
- Extract typing-in animation from ChatArea to global styles.css for reuse
- Add conversation title display in TopBar with fade transition
- Update ChatService to notify title changes via onNameChanged callback
- Fix ConversationNamingService to trigger callback after saving new title
- Clean up unused isAborting flag in ChatService
- Adjust grid layout in TopBar to accommodate title display
2025-10-17 19:34:47 +01:00
Andrew Beal
6be51ebaae fix: prevent race conditions in chat lifecycle and conversation management
- Add abort flag to prevent semaphore double-release during stop
- Stop active chats before deleting conversations to avoid state corruption
- Treat empty search terms as explicit request for all files
2025-10-14 23:45:10 +01:00
Andrew Beal
4c21b39a28 refactor: centralize CSS class names in Selector enum
- Replace hardcoded class name strings with Selector enum values
- Add new selector constants for styling and UI states
- Filter cancelled request messages from saved conversations
- Improve scroll behavior when streaming ends
- Move plugin styles import to main plugin file
2025-10-13 13:14:54 +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
9cbedb6b53 refactor: extract and reuse focusInput logic across components
Move focus logic to exported method and trigger it after conversation
resets to maintain input focus consistently throughout the UI flow.
2025-10-09 21:34:40 +01:00
Andrew Beal
62104f0abd Refactor AI function handling by introducing AIFunctionCall and AIFunctionResponse classes, updating function definitions, and enhancing conversation content management. Remove unused code and improve service registration for AIFunctionService. 2025-10-06 23:01:20 +01:00
Andrew Beal
692b3b793e Add search functionality to ConversationHistoryModalSvelte, allowing users to filter conversations by title, and update styles for improved UI responsiveness. 2025-10-05 16:22:50 +01:00
Andrew Beal
0d93516d93 Enhance conversation loading functionality by adding conversation selection handling in ConversationHistoryModal and ConversationHistoryModalSvelte, updating conversationStore for improved state management, and implementing current conversation path retrieval in ConversationFileSystemService. 2025-10-05 14:15:04 +01:00
Andrew Beal
df1d9391b2 Enhance conversation management by adding file path handling in Conversation class, updating ConversationHistoryModal for improved item deletion and state management, and implementing current conversation path retrieval in ConversationFileSystemService. 2025-10-05 13:37:28 +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
0fb3e4632f Implement spike work for plugin. 2025-09-08 15:50:06 +01:00