Commit graph

19 commits

Author SHA1 Message Date
Andrew Beal
6835c9167d refactor: replace mammoth with native DOCX parser using fflate
Remove mammoth dependency and implement lightweight DOCX text extraction using fflate + DOMParser. Extracts text from body, headers/footers, and footnotes/endnotes by parsing w:p/w:t elements. Make readDocument() synchronous. Add PDF.js type definitions to eliminate unsafe any access.
2026-06-28 15:08:50 +01:00
Andrew Beal
9457fa5b44 Replace unpdf and officeparser with lightweight document parsers
Switch PDF extraction to Obsidian's bundled PDF.js via loadPdfJs() instead of unpdf. Replace officeparser with mammoth for DOCX and custom fflate-based ZIP parsers for PPTX/XLSX/ODF formats. Eliminates heavy dependencies, removes all dynamic eval and .wasm references, and simplifies the esbuild plugin configuration.
2026-06-28 14:06:56 +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
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
562ab8d036 fix: add scrolling to user messages and validate file uploads
- Limit user message height to 15vh with hidden scrollbar
- Show notice for unsupported file types instead of silently failing
- Extract file type check to prevent invalid MIME type lookups
2026-03-15 12:21:41 +00:00
Andrew Beal
ac835d1346 refactor: rename toolDefinitions to aiFunctionDefinitions and add AIFunctionUsageMode support
- Rename toolDefinitions to aiFunctionDefinitions across all AI classes
- Add aiFunctionUsageMode property to control function calling behavior
- Implement provider-specific tool_choice/tool_config based on usage mode
- Remove AIController and create BaseAgent base class
- Update ExecutionPrompt with scope of execution guidelines
- Simplify ChatArea layout update logic by removing debounce
- Add naming service completion wait in ChatService
- Replace console.warn with Exception.warn in InputService
- Delete unused AIController.ts file
- Update all tests to use new aiFunctionDefinitions property
2026-01-30 19:36:52 +00:00
Andrew Beal
18d0741ec9 refactor: improve function call/response parsing and filtering
- Move parseFunctionCall/parseFunctionResponse to ResponseHelper
- Enhance orphaned call/response filtering with detailed debug logs
- Add toolId to conversation content for better tracking
- Fix planning workflow execution mechanics and step numbering
- Remove unused planning agent appendix and detailedAppendixForPlanningAgent
- Add conversation save callbacks throughout AI controller loops
- Improve multi-agent function handling to avoid exceptions
- Update all tests to include toolId fields for proper filtering
2025-12-31 22:56:22 +00:00
Andrew Beal
d2e7b47c65 refactor: centralize icon handling and improve attachment UI
- Move icon name logic to Attachment and Reference classes
- Create reusable setElementIcon Svelte action in ElementHelper
- Update ChatArea and ChatAttachments to use new icon helper
- Add visual separator and background color for message attachments
- Fix duplicate URIs in drag-and-drop file handling
- Improve attachment icon centering with flexbox layout
2025-12-23 20:18:27 +00:00
Andrew Beal
ea9cd211fc refactor: extract MIME type mappings and improve attachment handling
- Move MimeTypeToFileTypes and FileTypeToMimeType mappings to dedicated FileTypeMimeTypeMapping enum file
- Add empty content validation for file attachments
- Add PDF support for Gemini
- Display attachment references in user messages with file info
- Fix OpenAI unsupported mime type message formatting
- Improve URI list handling in InputService to include text/plain
- Update chat area padding and styling for better attachment display
- Prevent drag selection on chat padding element
- Update test assertions for new unsupported mime type message format
2025-12-23 12:04:29 +00:00
Andrew Beal
13cdd0a162 feat: add support for file attachments via drag and drop and paste.
refactor: standardize file type and MIME type handling across AI providers

Introduce centralized MimeType enum and bidirectional mappings between file types and MIME types. Update Claude, Gemini, and OpenAI implementations to use consistent MIME type validation. Add file attachment support via drag-and-drop and paste in chat input. Expand supported file type detection to include programming languages, config files, and documentation formats.
2025-12-22 20:02:02 +00:00
Andrew Beal
a86d784888 refactor: remove unused backspace handling and element detection logic
Remove custom backspace key handler in ChatInput and unused getElementBeforeCursor method in InputService. Clean up unused imports and associated test cases.
2025-12-11 12:41:14 +00:00
Andrew Beal
33440d17bf refactor: standardize error handling and logging across codebase
Replace console.error/log with Exception.log helper, improve OpenAI error handling with retryable errors, add type-safe model validation, and add new AI models (Claude Opus 4.5, Gemini 3 Pro Preview, GPT-5.1)
2025-12-06 14:09:46 +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
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
cac0db5b07 Update esling config to closer match obsidian recommended.
esling autofix
2025-11-10 11:14:06 +00:00
Andrew Beal
2b5f977478 fix: improve search trigger cursor positioning and UX
- Add tooltips to search trigger elements for better visibility
- Fix cursor detection logic for contenteditable="false" elements
- Make user messages render as HTML to support rich content
- Add default cursor style to search triggers
- Remove debug console.log statement
- Clean up unused import in SearchTrigger
2025-11-01 02:01:17 +00:00
Andrew Beal
a3d0b55100 refactor: improve backspace handling for non-editable elements
Replace getNodeAtCursorPosition with getElementBeforeCursor for more robust element detection before cursor. Add cursor position validation after deletions to prevent cursor from ending up inside contenteditable="false" elements. Remove unused helper methods and reorganize code structure.
2025-10-31 18:03:00 +00:00
Andrew Beal
5d3cde18c7 feat: implement rich text input with search trigger system
Add contenteditable chat input supporting inline search triggers for tags, files, and folders. Implement custom backspace/paste/drop handlers, trigger-to-text conversion for API requests, and improved cursor position management. Fix vault exclusion logic to properly cache non-excluded files.
2025-10-31 15:03:40 +00:00
Andrew Beal
34d28587b4 Convert input helpers into service. 2025-10-29 19:46:20 +00:00