Commit Graph

42 Commits

Author SHA1 Message Date
fegger b37ca2c178 Add cache interface and semantic cache tests 2026-05-08 02:20:06 +02:00
fegger 6bc1133a81 Refactor type annotations and error handling in core modules
Standardize error message extraction to handle non-Error objects.
Add explicit return types and interface definitions to VaultIndexer.
Update SemanticCacheService to use any types where necessary.
Rename SemanticCache to SemanticCacheService and adjust imports.
2026-05-08 02:19:44 +02:00
fegger fff98d1a2e Merge branch 'modularize-indexing-pipeline' 2026-05-07 23:45:31 +02:00
fegger 6423e2aa0d Clean up settings display and remove validation logic
Remove unused imports and simplify Ollama client stream handling

Add configurable ChromaDB host and UUID fallback

Refactor vault indexer to use tokenized content and improve caching
2026-05-07 23:23:32 +02:00
fegger 1985f849f4 Add semantic caching support with ChromaDB integration
Implement semantic caching for Ollama chat responses using ChromaDB to store and retrieve embeddings. The cache can be
enabled/disabled in settings and includes configurable similarity threshold, embedding model, and ChromaDB URL. Added
cache clear functionality and error handling for cache operations.
2026-05-07 23:03:58 +02:00
fegger 951c3bbc92 Fix variable naming consistency for chroma URL configuration
Update chromaUrl to chromaURL throughout the codebase to ensure consistent naming convention for the Chroma database URL
configuration parameter. This change affects the semantic cache service implementation and related tests.

The change updates the configuration property name from `chromaUrl` to `chromaURL` in:
- SemanticCacheService class
- Test files (chat-view.test.ts, ollama-client-cache.test.ts, semantic-cache.test.ts)

This maintains consistency with other URL configuration parameters in the codebase and improves code readability.
2026-05-07 22:49:07 +02:00
fegger d4a0919764 Fix merge conflicts and apply all semantic cache fixes 2026-05-07 22:49:07 +02:00
fegger e6d791a655 Update README.md 2026-05-07 22:49:01 +02:00
fegger ae16396a7a Integrate semantic cache with ChromaDB URL 2026-05-07 22:47:32 +02:00
fegger 179a58b95b Add semantic cache support using ChromaDB 2026-05-07 22:47:01 +02:00
fegger d37b9f23bd Add semantic caching and indexing pipeline
This commit adds semantic caching functionality to speed up repeated queries and implements a complete indexing pipeline
for processing vault files. The changes include:

- Added semantic cache service using ChromaDB for storing and retrieving cached responses
- Implemented indexing pipeline with extraction, normalization, and vectorization steps
- Added cache configuration settings to the plugin
- Updated Ollama client to support cache integration
- Added tests for all new indexing components
- Extended vault indexer with indexing pipeline support
2026-05-07 22:23:35 +02:00
fegger 47ecd3f803 feat: Implement modular indexing pipeline with extraction, normalization, and vectorization components 2026-05-07 22:13:43 +02:00
fegger f3a10a4b01 Merge pull request 'Refactor retry logic and extract scoring weights' (#1) from agent/review into main
Reviewed-on: http://100.103.83.12:3003/fegger/obsidian_ollama/pulls/1
2026-05-07 20:56:27 +02:00
fegger b37aaeb4d4 Add semantic cache support using ChromaDB 2026-05-07 20:53:28 +02:00
fegger 79db888f9e Refactor README with comprehensive documentation 2026-05-07 19:10:15 +02:00
fegger 3ab326ffc2 Refactor retry logic and extract scoring weights 2026-05-07 19:02:36 +02:00
fegger 667553ee9d Add check for signal abort before retrying 2026-05-07 15:32:13 +02:00
fegger 4fabf1df98 Refactor lint config and retry logic 2026-05-07 14:44:59 +02:00
fegger 140198177b Guard cleanup of currentStreamController after abort 2026-05-07 14:16:53 +02:00
fegger 9823761e03 Implement stream cancellation in OllamaClient
Add `cancelStream` method to allow aborting active requests. Store the current `AbortController` on the client instance
and reset it when the stream completes or is cancelled. Update `ChatView` to call `cancelStream` on close.

Add comprehensive tests for stream cancellation scenarios, including aborting active requests, handling cancellation
when no stream is active, clearing the controller after normal completion, and allowing new streams after cancellation.
2026-05-07 12:11:01 +02:00
fegger 45993bea67 ```
Remove stream cancellation logic and refactor controller usage

Update coverage reports and tests to reflect changes
```
2026-05-07 00:59:17 +02:00
fegger 435e1f0d93 Update coverage reports timestamp
Implement retry abort mechanism in OllamaClient
Add caching and cancellation support to VaultIndexer
2026-05-07 00:48:12 +02:00
fegger 4ddef0b98f Update coverage reports with new metrics and timestamps 2026-05-07 00:43:57 +02:00
fegger ccd2c3e0d8 Refactor message handling in chat view and improve API error handling
Simplify message construction and update logic in chat-view.js
Add abort controller support and improve error handling in ollama-client.js
Remove unused sanitizeFilePath function from utils.js
Export LogLevel enum in utils.js
Improve vault indexing to process all batches
2026-05-07 00:06:19 +02:00
fegger 75fa07f148 ```
Remove unused isValidHttpUrl function and related tests

Remove commented-out model validation regex from constants
```
2026-05-07 00:02:32 +02:00
fegger cec8302dbe Update coverage reports and fix Ollama client abort handling 2026-05-06 23:44:29 +02:00
fegger 0920e0959e Refactor message handling and remove result limit in vault indexing 2026-05-06 22:45:03 +02:00
fegger ea792b0034 Update safeParseJson to check for dangerous object keys recursively
Improve detection of prototype pollution patterns in JSON parsing
2026-05-06 22:38:31 +02:00
fegger 579e60f5d5 ```
Increase test coverage across multiple modules (91.2% statements, 82.85% branches, 82.35% functions, 93.1% lines)

Update abort controller handling in OllamaClient to properly clean up previous controllers

Remove unused imports and constants: MODEL_NAME_REGEX, MouseEvent, DEFAULT_SETTINGS, convertMarkdownToHtml

Refactor event handler naming to be more consistent
```
2026-05-06 22:30:29 +02:00
fegger 649061a747 Added new files for Ollama plugin functionality
Added new files for Ollama plugin functionality including chat view, error handling, client integration, tool execution,
vault indexing, and utility functions.
2026-05-06 22:03:52 +02:00
fegger 333328804a Remove deprecated files and update coverage reports 2026-05-06 21:52:58 +02:00
fegger ccb0603d0c Update streaming handling and improve model validation
Add MAX_STREAM_CHUNKS constant and update message handling to mark streaming as complete even without tool results.
Improve model name validation to support colons and add comprehensive test suite. Refactor VaultIndexer to simplify
constructor and remove unused methods. Fix path normalization in tool executor and remove unused safeWriteFile export.
Update error handling to remove redundant console suppressions.
2026-05-06 21:48:27 +02:00
fegger 3f23335ba1 Remove summary functionality from VaultIndexer 2026-05-06 21:24:28 +02:00
fegger caed98d0b6 ```
Update ESLint rules to disable console logging in utils and error-handler

Remove unused function and type in vault-indexer
```

```
Remove unused safeWriteFile function in utils

Remove unused isVaultLike type in vault-indexer
```
2026-05-06 21:13:59 +02:00
fegger 0a0173363b Add MAX_STREAM_CHUNKS constant for streaming control
Improve path validation to detect parent directory traversal
Refactor VaultIndexer to use VaultLike interface
Enhance heading matching to support 1-6 level headings
Improve token stemming with length-based checks
Optimize context building for user messages
2026-05-06 19:58:26 +02:00
fegger d57ade0ba8 Update coverage reports and improve error handling 2026-05-06 19:28:40 +02:00
fegger 2968932d69 Add error handler and improve coverage 2026-05-06 18:24:24 +02:00
fegger aa8e45912a Update chat view tests to use new event handlers 2026-05-06 17:21:12 +02:00
fegger fd49abcdb9 Refactor error handling, client, and tests for Ollama integration 2026-05-06 16:30:16 +02:00
fegger 59df2f6856 Refactor Ollama client and related components
Update error handling and improve streaming capabilities in the Ollama client and related components. Key changes
include:

- Simplify error types and improve error handling
- Refactor streaming logic to use async generators
- Update tool execution and vault indexing
- Improve utility functions and types
- Update test files to reflect changes
2026-05-05 17:09:16 +02:00
fegger cc580889d2 ```
Update coverage reports and add new validation utilities

Add comprehensive validation utilities for Ollama URL and model name
Add new API response types and client configuration interfaces
Add Logger utility for consistent logging
Add validation function for plugin settings
Add unit tests for validation functions
Update TypeScript configuration
Update coverage reports to reflect new code additions
```
2026-05-05 00:37:18 +02:00
fegger f638b06a86 initial commit 2026-05-04 22:05:10 +02:00