Commit graph

204 commits

Author SHA1 Message Date
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
b3871fad10 fix: reset selected result when search results are cleared
Moves search state reset to only occur when an option is selected and clears the selected result when the results list becomes empty, preventing stale selection state.
2025-11-15 11:35:23 +00:00
Andrew Beal
7853384d6f Bump plugin version to 1.0.6 and update vitest to 4.0.9 2025-11-14 10:28:05 +00:00
Andrew Beal
d7eefae936 refactor: migrate OpenAI integration to Responses API. Add web search capabilities.
Remove 'gpt-4.1-nano' which does not support web search.

Replace Chat Completions API with OpenAI Responses API throughout codebase. Update event parsing from delta-based streaming to event-based model, restructure request format to use instructions/input instead of messages array, and revise conversation naming service to handle new response structure.
2025-11-14 10:24:46 +00:00
Andrew Beal
a6adec6018 feat: add web search tool to Claude AI and update dependencies
- Enable web_search_20250305 tool for Claude with max 5 uses
- Remove unused VaultkeeperAIPlugin dependency from Gemini
- Update @google/genai to 1.29.1 and openai to 6.9.0
2025-11-13 22:17:25 +00:00
Andrew Beal
cdfbf228e4 Update help documentation with enhanced error handling info
- Clarify issue reporting call-to-action in welcome message
- Add comprehensive 503 Service Unavailable error documentation
- Document common Gemini service interruptions and resolution steps
2025-11-13 21:25:55 +00:00
Andrew Beal
d743d07d8f fix: improve focus handling in search results and user instruction selection
- Add optional MouseEvent parameter to acceptance handlers
- Prevent default behavior and restore input focus after selection
- Pass focusInput callback to UserInstruction component
- Update default search icon to file-question-mark
- Remove unused plugin import from UserInstruction
2025-11-13 21:15:38 +00:00
Andrew Beal
ba599ffd58 Update read me installation section to be clear that the plugin is not yet available as a community plugin.
Add regex-parser to project dependencies list
2025-11-12 22:13:22 +00:00
Andrew Beal
fc221912d4 Bump version to 1.0.5 and update dependencies 2025-11-12 22:06:52 +00:00
Andrew Beal
10472bf30a fix: improve search trigger detection on mobile keyboards
Switch from keydown to beforeinput event for detecting search trigger characters, which works reliably across desktop and mobile virtual keyboards. Allow Shift+Enter to create newlines on mobile devices.
2025-11-12 22:05:12 +00:00
Andrew Beal
911165b15d Optimize vault search with parallel processing and early termination
- Add shuffleArray helper function for randomized file processing
- Process files in parallel batches to improve search performance
- Implement early termination when sufficient matches are found
- Optimize snippet extraction to reduce redundant text operations
- Simplify search result structure to reduce memory overhead
- Update setting description to mention increased search time
- Fix test mocks for empty search term handling
2025-11-12 21:49:16 +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
ada7f358ef fix: blur input on mobile after submit, focus on desktop 2025-11-12 00:06:54 +00:00
Andrew Beal
0556ae984a Bump plugin version to 1.0.4 and update dependencies. 2025-11-11 23:50:20 +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
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
8722235552 Remove obsolete eslint-disable comments after rule configuration changes 2025-11-10 22:32:25 +00:00
Andrew Beal
cc0f469aea refactor: improve markdown processor type safety and plugin order
chore: bump plugin version to 1.0.3

- Replace `any` types with explicit unified processor types (MdastRoot, HastRoot)
- Move wikiLinkPlugin before remarkRehype to fix processing order
- Remove unnecessary null assertion operator
2025-11-10 22:21:17 +00:00
Andrew Beal
4d21dd4407 bump plugin version to 1.0.2 2025-11-10 21:47:54 +00:00
Andrew Beal
3a97b5b076 refactor: improve eslint disable comments with justifications
Add eslint-plugin-eslint-comments to require descriptions on all
disable directives. Replace generic eslint-disable comments with
specific explanations of why rules are disabled. Change `any` type
to `unknown` in DependencyService and add justification for remaining
`any` usage in StreamingMarkdownService.
2025-11-10 21:47:18 +00:00
Andrew Beal
6b5eafa4a5 Update Acknowledgments in read me 2025-11-10 20:43:01 +00:00
Andrew Beal
bb60bce10d bump version to 1.0.1 2025-11-10 20:37:46 +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
a30693bfe5 refactor: convert AIFunctionCall.name from string to AIFunction enum
- Add AIFunction enum type to AIFunctionCall name property
- Implement fromString helper to convert string to AIFunction
- Update Claude, Gemini, and OpenAI classes to use aiFunctionFromString
- Add type safety to AIFunctionService switch statement
- Update all test files to use AIFunction enum values
2025-11-10 20:08:32 +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
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
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
96a90452f8 refactor: replace custom type definitions with official SDK types
Remove custom interface definitions for Claude, OpenAI, and Gemini APIs in favor of importing types directly from official SDKs (@anthropic-ai/sdk, openai, @google/genai). Add openai package dependency and update StoredFunctionResponse interface to include name field.
2025-11-10 12:39:05 +00:00
Andrew Beal
15f1a01e4a Strengthen type safety across AI provider implementations
Replace `any` types with proper TypeScript interfaces and type assertions throughout Claude, Gemini, and OpenAI implementations. Add explicit typing for streaming events, function parameters, and conversation content to improve type checking and reduce runtime errors.
2025-11-10 11:55:19 +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
d8c7672211 Add eslint to project to help address Obsidian eslint issues. 2025-11-10 10:25:49 +00:00
Andrew
b7404ff154
Update image source in README.md 2025-11-10 08:26:18 +00:00
Andrew Beal
7f7e5f30b4 Remove obsidian from the description. 2025-11-10 08:19:37 +00:00
Andrew Beal
e011edb3a0 chore: revert version from 1.0.1 to 1.0.0 2025-11-10 08:13:12 +00:00
Andrew Beal
a217e84643 Rename plugin to Vaultkeeper AI 2025-11-10 08:03:27 +00:00
Andrew Beal
619d3c423c Bump plugin version and update description. 2025-11-09 23:25:50 +00:00
Andrew Beal
6214f4622d Cleanup dependencies. 2025-11-09 23:20:53 +00:00
Andrew Beal
ff111c69e6 Rename from AI Agent to Vault AI 2025-11-09 23:09:08 +00:00
Andrew
61c2e85aa2
Update README with image
Added an image in README.
2025-11-09 21:29:25 +00:00
Andrew Beal
3c5425716b update GitHub repository URLs 2025-11-09 21:16:55 +00:00
Andrew Beal
f0564434fe chore: update package versions to latest 2025-11-09 21:01:45 +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
0a318a1caf refactor: streamline system prompt by removing redundant examples and verbose explanations
Consolidate guidelines to reduce prompt length while maintaining core functionality. Remove emoji examples, merge duplicate sections on search strategy and wiki-linking, simplify anti-patterns list, and clarify multi-tool workflow architecture.
2025-11-09 16:01:31 +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
b8dba18989 refactor: centralize UI copy strings to Copy enum
Replace hardcoded strings in AIAgentSettingTab with Copy enum constants for better maintainability and consistency. Add new Copy entries for settings labels, descriptions, placeholders, and tooltips. Update README with comprehensive documentation and fix textarea resize behavior.
2025-11-08 15:37:01 +00:00
Andrew Beal
c36e30999c chore: update dependencies to latest versions 2025-11-08 14:16:33 +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