Commit graph

111 commits

Author SHA1 Message Date
Andrew Beal
4a42b1f84c Fix function call parsing and conversation loading issues
- Extract functionCall/functionResponse objects properly in Gemini
- Reset chat area state when loading conversations
- Add SanitiserService for path validation
- Prevent duplicate conversation names
- Improve chat scrolling and padding logic
- Clear streaming state on submission complete
2025-10-24 17:25:19 +01:00
Andrew Beal
8347ddbdf2 chore: upgrade TypeScript from 5.0.4 to 5.9.3 2025-10-22 10:11:28 +01:00
Andrew Beal
683261a565 chore: bump version to 0.0.3 2025-10-22 10:07:22 +01: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
ba77ebc81b refactor: replace API provider dropdown with model selection dropdown
Replace simple API provider selection with comprehensive model dropdown organized by provider (Claude, OpenAI, Gemini). Update settings schema from `apiProvider` to `model`, add AIProvider.fromModel() helper, simplify provider URLs, and fix indentation inconsistencies throughout codebase.
2025-10-21 22:14:35 +01:00
Andrew Beal
9f36dac64c Fix: messages with function call and content were not being displayed.
refactor: remove unused apiError429UserInfo property and simplify error handling

Remove apiError429UserInfo from IAIClass interface and all implementations (Claude, Gemini, OpenAI). Simplify StreamingService error handling by removing custom 429 error messages. Clean up ChatService formatting and ChatArea display logic.
2025-10-21 19:51:06 +01:00
Andrew Beal
afdfa3021b Refactor conversation content handling and improve error messages
- Split content and functionCall into separate fields in ConversationContent
- Extract content parsing logic into dedicated methods for Claude and Gemini
- Add API error 429 handling with provider-specific user information
- Improve error messages in naming services to include response text
- Increase max_tokens for main requests and naming services
- Optimize ChatService to reduce unnecessary saves and array recreations
- Remove message key binding in ChatArea to improve performance
- Adjust chat window max-width to fixed pixel value
2025-10-20 08:30:08 +01:00
Andrew Beal
eac7ac13fb Add Claude API provider support with streaming and tool integration
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 14:23:24 +01:00
Andrew Beal
46d97089a7 refactor: use Role enum for system role instead of string literal 2025-10-19 01:00:46 +01:00
Andrew Beal
6656f4c495 feat: implement Claude and OpenAI conversation naming service
- Add Claude and OpenAI ConversationNamingService with API integration
- Register Claude and OpenAI naming service in dependency injection
- Add model and URL constants for naming
2025-10-19 00:58:30 +01:00
Andrew Beal
bf948a79b2 Add Claude and OpenAI provider support with token services
- Add Claude and OpenAI to AIProviderModel enum
- Implement ClaudeTokenService and OpenAITokenService
- Update service registration to handle new providers
- Install @anthropic-ai/sdk and gpt-tokenizer dependencies
- Add error handling for invalid provider selection
2025-10-19 00:35:26 +01:00
Andrew Beal
023913b0b7 Bump version to 0.0.2 2025-10-18 15:05:00 +01:00
Andrew Beal
9bd38ab0ae fix: improve spacing and layout of API request aborted message
Add inline-block display and vertical margin to aborted request indicator for better visual separation and proper spacing in the UI
2025-10-18 15:03:31 +01:00
Andrew Beal
cce2cf9132 fix: update token display timing and remove unused imports
- Add 500ms timeout to chat padding recalculation to prevent race conditions
- Replace svelte tick() with setTimeout for conversation title updates
- Update token display after each conversation save and streaming response
- Remove unused svelte/transition and tick imports
2025-10-18 14:33:17 +01:00
Andrew Beal
fc892c43be refactor: replace hardcoded colors with CSS variables in syntax highlighting 2025-10-18 14:02:31 +01:00
Andrew Beal
77037472cb Bump svelte version 2025-10-18 13:07:28 +01:00
Andrew
7bbadaf972
Update version from 1.0.0 to 0.0.1
Set initial BETA version
2025-10-18 13:02:08 +01:00
Andrew Beal
cab6616142 feat: add icon to MainView and improve styling with status bar cleanup
- Add sparkles icon to MainView via getIcon() method
- Integrate StatusBarService to clean up status messages on view close
- Center view content with max-width constraint
- Apply consistent background styling to leaf content
2025-10-18 00:44:15 +01:00
Andrew Beal
a35b3dd0c9 refactor: replace let with const for immutable variables 2025-10-18 00:28:23 +01:00
Andrew Beal
c71f18d5c2 fix: use tick() for assistantMessageAction and update edit-mode accent colors
- Wrap assistantMessageAction in tick() to resolve race condition with streaming indicator removal
- Replace interactive-accent with alt-interactive-accent for edit-mode UI elements
- Add alt-interactive-accent CSS variables as color-mixed variants of interactive-accent
2025-10-18 00:11:47 +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
301a95befb feat: add animated token counter to status bar
Implement smooth ease-out animation when updating input/output token counts in the status bar, replacing instant updates with a 1-second transition for better visual feedback.
2025-10-17 22:40:12 +01:00
Andrew Beal
47af43fe1f feat: add token counting display to status bar
Implement real-time input/output token tracking in the status bar by
integrating ITokenService with ChatService. Token counts are calculated
from conversation history and updated on conversation load, reset, and
message completion.
2025-10-17 22:23:45 +01:00
Andrew Beal
db054744ba Add token counting service and refactor dependencies
- Implement ITokenService interface and GeminiTokenService for token counting
- Add StatusBarService for managing status bar messages
- Extract AIProviderModel enum to centralize model configuration
- Remove unused MessageService and AIThoughtMessage classes
- Update dependency registration to include new services
- Clean up main plugin initialization and status bar handling
2025-10-17 22:23:30 +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
08a6bde961 fix: remove unnecessary alt=sse parameter from GeminiNamer URL 2025-10-17 16:18:39 +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
279a89e483 refactor: improve system prompt search strategy and fix UI styles
- Reorder sections to prioritize vault-first decision framework
- Add blanket search tier for comprehensive vault exploration
- Emphasize persistent searching with alternative terms
- Remove duplicate StreamingIndicator component
- Fix edit mode button hover styling specificity
2025-10-15 22:57:06 +01:00
Andrew Beal
a756cee5c0 refactor: replace hardcoded blue with dynamic accent color variable
Replace direct `--color-blue` references with new `--interactive-accent-blue` variable that blends interactive accent with blue, enabling consistent theme-aware styling across edit mode UI elements.
2025-10-15 21:18:59 +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
9ab0897c57 refactor: simplify web search params and improve vault file handling
- Remove unnecessary reasoning parameter from web search function
- Update Path enum to separate root and AI agent directory
- Add filename matching to vault search results
- Use Path enum constants consistently across services
2025-10-15 20:13:14 +01:00
Andrew Beal
8ab4c93553 refactor: replace vault.modify with vault.process in VaultService
Update file modification to use vault.process() with callback function instead of vault.modify() for better async handling.
2025-10-15 19:45:23 +01:00
Andrew Beal
4c6a7e14b5 refactor: cache markdown permalinks and update SearchVaultFiles description
- Cache vault file permalinks in StreamingMarkdownService constructor to avoid repeated filesystem calls
- Update permalink cache during stream chunks to ensure freshness
- Clarify SearchVaultFiles function description to emphasize file list retrieval
- Remove obsolete code comments
2025-10-15 00:11:54 +01:00
Andrew Beal
6c55ae744f chore: update dependencies (@google/genai, core-js, katex, svelte) 2025-10-14 23:47:12 +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
1a57bb4872 style: increase streaming indicator glow shadow spread 2025-10-14 22:58:58 +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
86d59b18d2 feat: enforce wiki-link usage for all vault references in system prompt
Add comprehensive wiki-linking guidelines requiring [[note name]] syntax for every vault reference. Establish wiki-linking as mandatory practice with examples, anti-patterns, and quality checks. Update all example workflows to demonstrate proper linking density for building knowledge graphs.
2025-10-14 20:26:15 +01:00
Andrew Beal
ae5754040a feat: implement progressive search strategy with relationship inference
Adds multi-tier search approach that exhaustively tries broader terms,
partial matches, and synonyms before concluding information doesn't exist.
Enables relationship inference from found content to answer queries about
connected entities. Fixes padding calculation to account for consecutive
assistant messages by summing their heights.
2025-10-14 20:22:01 +01:00
Andrew Beal
680b2c6ec1 refactor: extract randomSample utility 2025-10-14 19:54:17 +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
92d3bc5a31 refactor: enhance system prompt with structured decision framework
Reorganize system prompt with clearer operating principles, vault-first
decision heuristics, semantic directory architecture, and comprehensive
examples. Improve multi-tool workflow guidance and error handling patterns.

Extract edit mode toggle to dedicated function for better code organization.
2025-10-13 20:06:47 +01:00
Andrew Beal
f8aa162a63 fix: improve edit mode deactivation and request cancellation handling
- Deactivate edit mode when resetting or loading conversations
- Fix cancelled request detection using Selector instead of Copy enum
- Standardize quote style in StreamingMarkdownService to double quotes
2025-10-13 19:53:00 +01:00
Andrew Beal
b82d38e799 feat: add edit mode styling to streaming indicator
Pass editModeActive prop through ChatArea to StreamingIndicator to change
streaming animation color from accent to blue when in edit mode
2025-10-13 19:25:29 +01:00
Andrew Beal
1aa0d0000d feat: add edit mode toggle to enable destructive AI actions
- Add allowDestructiveActions parameter throughout AI request chain
- Implement edit mode UI toggle with visual indicators
- Update getQueryActions to conditionally include destructive tools
- Add blue highlight styling when edit mode is active
2025-10-13 19:12:06 +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
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