Commit graph

135 commits

Author SHA1 Message Date
Andrew Beal
bbf59ff911 test: add migration tests for stale/renamed model strings
Add comprehensive test coverage for ensureValidModels method to verify
proper handling of outdated model identifiers and provider mismatches.
Tests cover fallback to provider defaults when models are renamed,
removed, or no longer match the active provider.
2026-07-12 16:07:05 +01:00
Andrew Beal
0b54cdcc10 refactor(ChatArea): extract message rendering into separate components
Extract user and assistant message rendering logic from ChatArea into dedicated UserMessage and AssistantMessage components, removing unused dependencies and styles.
2026-07-11 14:04:19 +01:00
Andrew Beal
f4c3b5b826 feat: add file change summary cards to assistant messages
Display artifact changes in chat with visual indicators for create/modify/delete actions, including file counts, color-coded status badges, and scrollable file list
2026-07-11 13:49:44 +01:00
Andrew Beal
cc45949eba Update OpenAI model identifiers from GPT-5.5/5.4 to GPT-5.6 series
Replace GPT-5.5-pro, GPT-5.5, GPT-5.4-mini, and GPT-5.4-nano with the new GPT-5.6 Sol, Terra, and Luna model variants across enum definitions, display copy, settings UI, tests, and default model configurations.
2026-07-10 23:06:16 +01:00
Andrew Beal
7757800127 refactor: simplify chat layout with turn-based grouping
Replace complex dynamic padding system with turn-based message grouping that scrolls to the latest user/assistant exchange. Remove manual height calculations and message element tracking in favor of CSS-based layout using .message-group containers. Neutralize leading frontmatter markers in streaming markdown to prevent Obsidian from hiding content.
2026-07-10 22:57:25 +01:00
Andrew Beal
6b31e3d4e9 test: add artifact tracking tests for file operations
Add comprehensive test coverage for artifact generation in AIToolService
and ConversationFileSystemService, including write/patch/delete operations,
binary file handling, serialization/deserialization, and garbage collection.
2026-07-10 21:44:40 +01:00
Andrew Beal
10ddb1da28 feat: add artifact tracking system for agent file operations
Implement comprehensive artifact tracking to record all file modifications made by the AI agent during conversations. Add artifact persistence, garbage collection, and UI updates with new "Discuss" button styling.
2026-07-10 21:23:44 +01:00
Andrew Beal
1c5834e858 Update AI model references to latest versions
Replace Claude Sonnet 4.6 with Sonnet 5 as default model, add Claude Fable 5, update OpenAI models to include versioned releases (GPT-5.5 Pro, dated variants), and update all references across enums, settings, tests, and documentation.
2026-07-06 19:37:41 +01:00
Andrew Beal
afaa530f8b feat: add mobile suggestion button and force-focus parameter
- Add "Suggest" button to mobile diff controls with three-column layout
- Replace focusInput's onMobile param with force param for explicit control
- Scope diff mobile button styles to prevent conflicts
- Enable focus on chat input when suggestion button clicked
2026-07-05 19:59:07 +01:00
Andrew Beal
f74286f3c8 Fix toolCallStarted to emit when function name first becomes available
Ensures toolCallStarted fires once when the accumulated function name first becomes non-empty, handling providers that stream function names across multiple deltas. Also adds Obsidian DOM helper mocks for tests.
2026-07-04 15:39:12 +01:00
Andrew Beal
0d21c1e3e0 Implement local model support. 2026-07-04 12:16:08 +01:00
Andrew Beal
938837c9c1 feat: add cached model settings per provider with automatic restoration
Preserve user's model preferences for each AI provider separately and restore them when switching between providers, preventing unwanted model resets during provider changes
2026-06-29 19:31:32 +01:00
Andrew Beal
1390fafe86 refactor: extract shared Chat Completions logic and consolidate retry/tool-choice handling
Move common OpenAI-compatible API code to ChatCompletionsAIClass base, unify retry delay extraction and tool-choice mapping across providers (Claude, Gemini, Mistral, OpenAI), fix Gemini model labels, and correct scroll state when content is not scrollable

Fix Gemini model naming in settings. Fix CHat area scroll to bottom state when clearing a conversation.
2026-06-27 14:44:55 +01:00
Andrew Beal
72bf43a8ea refactor: clarify binary file attachment handling for AI agents
Add explicit instructions across all agent prompts explaining that binary
files (PDFs, images, documents) return content as attachments in the
message following the tool result, not as text in the result itself.

Update tool response messages to clearly state the attachment delivery
mechanism and prevent agents from re-reading the same file expecting
different output.

Improve build safety by neutralizing dynamic eval constructs and
hardening the officeparser plugin against bundle shape changes.
2026-05-31 17:58:23 +01:00
Andrew Beal
e8e3dcd363 Update AI provider model enums and default configurations
Remove deprecated model versions (Claude 4/4.5/4.6, Gemini 2.5, GPT 5.4 Pro, Mistral latest aliases) and replace with current model identifiers. Add DEFAULT_QUICK_MODEL_BY_PROVIDER configuration, update default models to use Sonnet 4.6 standard and Opus 4.8 for planning, and adjust Mistral agent to use Small model.
2026-05-30 16:32:56 +01:00
Andrew Beal
060ce4964f feat: add frontmatter generation and tag suggestion quick actions
- Implement "Suggest tags" action that generates and merges tags using AI
- Implement "Generate frontmatter" action that creates metadata fields
- Add updateFrontmatter method to VaultService and FileSystemService
- Create FrontmatterHelpers for YAML parsing and field merging
- Update prompts to reuse existing vault tags for consistency
- Remove deprecated mergeTagsIntoFrontmatter function
- Add yaml package dependency for frontmatter parsing
2026-05-30 12:33:38 +01:00
Andrew Beal
9cf8f1dbd7 refactor: move replaceCopy helper to Helpers module and add tag merge utilities
Move replaceCopy function from Copy enum to Helpers module to improve
separation of concerns. Add splitFrontmatter and mergeTagsIntoFrontmatter
utilities for YAML frontmatter manipulation. Remove unused Beautify prompt
and QuickActionsService. Add timeout support to Semaphore.wait(). Remove
unused Event.QuickActionsSettingsChanged. Update all imports across AI
classes, prompts, services, and tests.
2026-05-29 22:01:02 +01:00
Andrew Beal
aed4caf347 refactor: replace custom markdown pipeline with Obsidian's native MarkdownRenderer.
Fix reactive issue for web and chat mode display.

Rewrites StreamingMarkdownService to use Obsidian's built-in MarkdownRenderer
instead of the unified/remark/rehype/KaTeX stack, eliminating ~700 lines of
custom markdown processing, CSS, and streaming state management. Internal link
handling now relies on Obsidian's native .internal-link class and data-href
attributes. The streaming split-point algorithm (freeze completed blocks, re-render
the live tail) is preserved.
2026-05-25 16:25:22 +01:00
Andrew Beal
89dceda21c Update dependencies and replace deprecated API calls
Replace activeDocument/activeWindow globals with Obsidian API equivalents (createFragment, createDiv, createSpan, window), update officeparser to use async API, switch diff2html import path and disable highlight option, prefix unused parameters with underscore, and update dependencies including @anthropic-ai/sdk, @google/genai, officeparser, and various dev dependencies
2026-05-17 12:42:09 +01:00
Andrew Beal
8823e3cf23 refactor: convert ChatMode enum to string literals and improve state management
- Change ChatMode enum values from numeric (0,1,2) to string literals ("read_only", "edit", "planning")
- Move chat mode state management from ChatWindow to SettingsService with persistence
- Add chat mode awareness to system prompts and tool validation
- Replace Map with WeakMap for settings subscribers to prevent memory leaks
- Add type-safe event handlers to EventService
- Update esbuild and TypeScript targets from ES2018/ES2020 to ES2022
- Add requiresEditModeEnabled() validation to prevent tool hallucination in read-only mode
- Update all test fixtures to include chatMode in mock settings
2026-05-05 20:54:34 +01:00
Andrew Beal
31f0484114 test: add subscribeToSettingsChanged mock and update settings tests
Mock the new subscribeToSettingsChanged method in all AI provider test files to prevent test failures. Update SettingsService tests to use updateSettings method instead of direct settings modification and saveSettings calls, aligning with the new reactive settings API that notifies subscribers of changes.
2026-05-04 16:31:49 +01:00
Andrew Beal
145c4c817f Update unit test after GPT 5.5 update 2026-04-26 16:40:55 +01:00
Andrew Beal
0107878a10 Update GPT-5.4 model references to GPT-5.5 and add hideDrawerElements to test mocks 2026-04-26 00:05:41 +01:00
Andrew Beal
841b3af5a4 feat: add toggleable quick actions with context menu and toolbar options
Add settings to enable/disable quick actions in both the editor context menu and toolbar. Implement dynamic registration system that updates when settings change. Include event-driven architecture for settings changes and improve toolbar injection logic. Update dependencies to latest versions.
2026-04-24 15:52:06 +01:00
Andrew Beal
21e237c80a test: rename FileSystemService methods in mocks to match interface
Update test mocks to use renamed methods: readFile → readFilePath, writeFile → writeToFilePath, patchFile → patchFileAtPath. Add activeWindow and activeDocument globals to test setup for Obsidian compatibility.
2026-04-23 16:10:03 +01:00
Andrew Beal
28c8ccb44b feat: add quick actions system with provider-aware model settings
Introduce QuickActionsService and QuickAgent for lightweight, single-shot AI
operations. Add a dedicated quickActionModel setting alongside a new top-level
provider setting, with validation ensuring all models match the selected provider
and provider-specific defaults. Refactor FileSystemService to offer both TFile
and path-based overloads (readFile/readFilePath, writeToFile/writeToFilePath,
patchFile/patchFileAtPath). Replace window/document globals with activeWindow/
activeDocument throughout InputService and VaultkeeperAISettingTab for Obsidian
mobile compatibility.
Update linting packages to latest.
2026-04-20 20:20:22 +01:00
Andrew Beal
df5d62d981 refactor: improve message height calculation and update dependencies
- Calculate height for consecutive assistant messages instead of just last message
- Track message role in ChatArea for proper height calculation
- Update MultiAgentIntegration test to use ChatMode enum
- Update officeparser browser bundle path and shim for v6
2026-04-19 23:53:14 +01:00
Andrew Beal
f51f171da2 refactor(test): replace boolean params with ChatMode enum in AIControllerService tests 2026-04-19 20:41:28 +01:00
Andrew Beal
c414915688 Update OpenAI models from GPT-5.2 to GPT-5.4, add Gemini 3.1 Flash Lite, reorder Gemini models, and bump dependencies 2026-04-12 12:58:16 +01:00
Andrew Beal
f3485e040f test: add enableWebSearch and enableWebViewer to mock settings 2026-04-10 22:24:05 +01:00
Andrew Beal
d52b1c3c74 feat: add conditional web viewer access setting and directive system
Introduce a new setting to control AI access to the web viewer tool and refactor prompt building to inject capability directives (memories, web search, web viewer) into all agent contexts. Update tool definitions to conditionally include web viewer and memory tools based on settings. Consolidate memories injection and active directives into a unified prompt builder pattern.
2026-04-10 22:19:34 +01:00
Andrew Beal
ac1dcf7f83 feat: add toggleable web search with UI control and provider-specific implementations
Implement web search toggle functionality across all AI providers (Claude, Gemini, Mistral, OpenAI) with conditional tool inclusion based on settings. Add globe button to chat input for toggling web search on/off. Change formatBinaryFiles visibility from public to protected in BaseAIClass and IAIClass interface. Extract tool configuration into private getTools() methods for each provider. Update tests to verify web search toggle behavior and formatBinaryFiles access level changes.
2026-04-10 10:47:23 +01:00
Andrew Beal
57fb5d3be3 feat: add move_vault_folder tool and standardize schema naming
- Add MoveVaultFolder tool with supporting schema and enum
- Rename schemas from *Schema to *ArgsSchema for consistency
- Fix VaultService.move() to handle folder destinations properly
- Update AIToolResponse to use AIToolResponsePayload wrapper
- Update error message for non-existent move sources
- Add MoveVaultFolder import and tool registration
2026-04-09 22:20:37 +01:00
Andrew Beal
540b76e0ea test: update tests to use AIToolResponsePayload wrapper class
Refactor all test files to wrap tool response data in AIToolResponsePayload instances instead of passing raw objects directly to AIToolResponse constructor. Update assertions to access response data via payload.response property.
2026-04-08 21:16:59 +01:00
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
0ffaa95a57 test: add memory settings to mock configurations
Updated all test mock settings objects to include enableMemories and allowUpdatingMemories fields with default values
2026-04-04 20:36:21 +01:00
Andrew Beal
5a3900049b fix: improve memories error message with dynamic length limits
- Update error message to show actual max lines and words per line
- Return error message from updateMemories instead of success boolean
- Add SettingsService mocks to all agent tests to prevent initialization errors
- Update test expectations for new default search limits (30 results, 100 snippet size)
2026-04-04 20:34:32 +01:00
Andrew Beal
b752d8e75b chore: remove Conversation.path field and update dependencies
- Remove unused `path` property from Conversation class and its test
- Initialize `items` and `conversations` arrays in ConversationHistoryModal
- Use `Exception.messageFrom()` for safer error serialization in StreamingMarkdownService
- Fix redundant type cast in obsidian mock's Events.on()
- Bump @anthropic-ai/sdk, @google/genai, openai, esbuild, svelte, typescript, vitest, and other minor deps
2026-04-03 11:03:41 +01:00
Andrew Beal
0d0f23ae7d Update file attachment messages to use centralized copy management
Replace hardcoded "provided below" strings with "included below" and migrate to centralized Copy enum system for consistent messaging across Claude, Gemini, Mistral, and OpenAI implementations.
2026-03-22 23:11:31 +00:00
Andrew Beal
a4c65f16c2 Update file attachment messaging and add document file support
Add support for DOCX, PPTX, XLSX, ODT, ODP, and ODS document formats by converting them to plain text. Standardize attachment introduction messages across all AI providers from "Binary data for X follows" to "The contents of the file 'X' are provided below."
2026-03-15 19:48:28 +00:00
Andrew Beal
8f90177e97 test: use AITool enum for tool name in Mistral test 2026-02-28 14:35:22 +00:00
Andrew Beal
8e9718ba01 Add comprehensive Mistral AI provider integration with cross-provider tests
Implement complete Mistral AI support including message formatting, tool calls with ID validation (9-char alphanumeric), streaming, file attachments, and conversation naming service. Add extensive cross-provider integration tests covering Mistral interactions with Claude, OpenAI, and Gemini, including round-trip conversions, ID validation, and mixed conversation handling. Update all test fixtures to include Mistral API keys.
2026-02-28 14:29:26 +00:00
Andrew Beal
0fd231b3b6 test: update mock model to GPT_5_Nano in naming service test 2026-02-20 16:21:40 +00:00
Andrew Beal
256ea568a8 Add invalid model recovery on settings load (can happen if a model has been retired but was in use).
Reinforce faithful plan request in ExecuteWorkflow tool.
2026-02-20 01:27:16 +00:00
Andrew Beal
d3b461efc7 Add new models for Gemini and Claude. Remove older models for OpenAI and Sonnet 3.7. 2026-02-20 00:56:18 +00: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
d18f5ef655 refactor: replace Replan with granular orchestration tools
Replace the single Replan tool with three targeted alternatives:
ReviseStep, RevisePlan, and SkipStep. This gives the orchestration
agent more precise control over plan recovery — revising only the
current step, replacing all remaining steps, or skipping a step
entirely — rather than triggering a full replan each time.

Also give the orchestration agent read access to vault files so it
can resolve execution failures without routing back to the planning
agent, and update the execution agent prompt to stop it from
attempting self-recovery (gap resolution is now the orchestrator's
responsibility).
2026-02-19 20:48:59 +00:00
Andrew Beal
5e3858416e test: refactor callback mocks to reduce duplication in tests
Move repeated callback mock definitions to shared test setup level,
adding missing onToolCallStarted callback to agent test suites.
2026-02-16 22:01:59 +00:00
Andrew Beal
89fa8b809c Rename remaining references to functioncall to toolcall 2026-02-15 23:27:14 +00:00
Andrew Beal
df424eee68 Rename functions folder to tools. 2026-02-15 23:07:39 +00:00