Commit graph

322 commits

Author SHA1 Message Date
Andrew Beal
a4800bd6da refactor: convert attachments to file-based storage with lazy loading.
Migrate attachment storage from base64-in-JSON to separate binary files with SHA-256 naming, add automatic garbage collection, implement lazy loading via getBase64() and getMimeType() methods, normalize text MIME types, add image resizing, and update all AI provider integrations. Fix small issue that caused the chat area to scroll down on message streaming end even when scrolled up.
2026-02-15 22:46:25 +00:00
Andrew Beal
e2f2ebac24 Bump plugin version to 1.2.1 2026-02-05 22:09:32 +00:00
Andrew Beal
6dd8e84efd Add Claude Opus 4.6 model support and update dependencies 2026-02-05 22:09:06 +00:00
Andrew Beal
19948bcc2e docs: update Planning Mode to describe three-agent workflow
Replace two-agent description with three-agent architecture
(planning, orchestration, execution). Document the orchestration
agent's role in monitoring progress, replanning, and passing
context between steps.
2026-02-03 17:29:22 +00:00
Andrew Beal
95e08a4fad Bump plugin version to 1.2.0 2026-02-01 14:01:17 +00:00
Andrew Beal
3a42430fe7 Bump dependency versions 2026-02-01 14:00:51 +00:00
Andrew Beal
bf9aa7abf6 fix: exit orchestration when replan is triggered
Previously the orchestration would continue after requesting a replan, now it correctly exits to allow the replan to occur.
2026-02-01 13:59:13 +00:00
Andrew Beal
9d4a4452c5 Rename 'AIfunction' to 'AITool' globally. 2026-01-30 22:35:54 +00:00
Andrew Beal
a2c83f4e02 Bump plugin version to 1.1.9 2026-01-30 22:13:39 +00:00
Andrew Beal
470c132967 chore: update dependencies 2026-01-30 22:13:31 +00:00
Andrew Beal
6e24ba20cc refactor: remove unused import and redundant test cases
Remove unused AIFunctionResponse import from BaseAgent and delete
non-contentEditable element warning tests that are no longer needed
2026-01-30 22:10:11 +00:00
Andrew Beal
3d56643772 refactor: strengthen task execution boundaries and search strategy
Adds explicit "golden rule" to prevent scope creep in ExecutionPrompt,
restructures PlanningPrompt with progressive multi-tier search methodology,
and fixes ChatPlanArea height calculation timing issues.
2026-01-30 22:04:00 +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
9276d2d0cd fix: improve mobile layout spacing and modal margins
- Add horizontal margin to conversation divider in TopBar
- Adjust grid row sizing in conversation history modal
- Remove margin from modals on mobile screens (≤600px)
- Reduce bottom margin for diff mobile controls
- Remove redundant background styling from diff button container
- Fix diff view height calculation on mobile to avoid control overlap
2026-01-30 10:00:16 +00:00
Andrew Beal
79013f498f Bump plugin version to 1.1.8 2026-01-29 17:43:31 +00:00
Andrew Beal
0d99bdc6be feat: add GPT-5.2 model variants and update OpenAI namer
Add GPT-5.2 Instant, Thinking, and Pro models to supported OpenAI models.
Update default OpenAI conversation namer from GPT-5 Nano to GPT-5.2 Instant.
2026-01-29 17:43:09 +00:00
Andrew Beal
e70638079f Remove unused second parameter from streamRequest test calls 2026-01-29 17:03:50 +00:00
Andrew Beal
7878ac804d refactor: simplify chat layout update logic and extract applyLayout
- Remove isObserver parameter from updateChatAreaLayout
- Extract layout calculation logic into separate applyLayout function
- Add resetAutoScroll export to re-enable auto-scrolling
- Clear layoutUpdateTimeout when debounce is interrupted
- Simplify conditional logic for instant vs debounced updates
- Call resetAutoScroll when submitting new message
2026-01-29 17:01:50 +00:00
Andrew Beal
244ad2355d chore: update dependencies to latest versions
Update openai to 6.17.0, @types/node to 25.1.0, happy-dom to 20.4.0, and svelte to 5.49.0
2026-01-29 15:06:47 +00:00
Andrew Beal
6e4f5f33af Create new tests for Orchestration, Planning and Execution agents. 2026-01-29 15:04:43 +00:00
Andrew Beal
66c801e778 refactor tests: rename AIController to MainAgent and reorganize service structure
- Rename AIControllerService to MainAgent throughout test files
- Move AIFunctionService to AIServices directory
- Update service registration from AIControllerService to MainAgent
- Add agentType parameter to mock AI configuration
- Add resolveAIProvider method to mock service
- Update test comments to reflect orchestration agent workflow
- Remove planning/execution agent-specific tests in favor of integration tests
- Consolidate agent loop tests into main test suite
2026-01-29 14:35:38 +00:00
Andrew Beal
15fc41b35e Standardize border-radius CSS vars and improve modal spacing (post obsidian mobile UI change)
Replace legacy radius vars (--modal-radius, --button-radius, --input-radius) with standardized tokens (--radius-l, --radius-m). Add margins to modals and top bar divider for better spacing. Fix mobile diff view bottom margin to avoid Obsidian controls overlap.
2026-01-29 14:22:44 +00:00
Andrew Beal
638b229239 feat: enhance wiki-link documentation and fix ChatPlanArea height updates
- Expand SystemPrompt wiki-link guidance with examples and common mistakes
- Add ResizeObserver to ChatPlanArea for dynamic height adjustments
- Improve plan completion summary prompt with more context requirements
2026-01-29 13:32:23 +00:00
Andrew Beal
be5dbb9abc refactor: improve execution agent prompts for handling ambiguity
Update AskUserQuestionExecution function definition and ExecutionPrompt to provide clearer guidance on when to ask users vs. report outcomes. Emphasizes resolving ambiguity at discovery point rather than passing uncertain outcomes to orchestrator.
2026-01-29 12:57:21 +00:00
Andrew Beal
32c478249b housekeeping: remove unused execution agent code and clean up orchestration flow
- Remove unused agentExecutionDefinitions and gatedDefinitions methods
- Delete obsolete CreatePlan.ts (replaced by ExecuteWorkflow.ts)
- Rename PlanningAgentSystemPrompt to PlanningPrompt for consistency
- Fix orchestration agent promise returns and replan flag handling
- Make saveConversation calls async throughout AIController
- Simplify vault cache delete event handling
- Change debug logging from console.log to console.debug
- Fix function name references in execution and main agents
2026-01-29 12:26:41 +00:00
Andrew Beal
ac5755d702 refactor: standardize function description format with call/do-not-use sections
Restructure all AI function descriptions to use consistent "Call this function:" and "Do NOT use this function:" sections for improved clarity and scannability.
2026-01-29 11:02:18 +00:00
Andrew Beal
9cef35baec refactor: improve agent prompt clarity and workflow control
Clarify execution vs orchestration responsibilities, eliminate conditional step patterns in planning, add explicit plan completion signal, and strengthen guidance on atomic unconditional actions with outcome-based routing.
2026-01-28 23:48:49 +00:00
Andrew Beal
1b47c64c8b fix: prevent plan completion when replan is requested
Track replan state to ensure plan doesn't complete prematurely when a replan
is requested. Also add CompletePlan to orchestration agent definitions and
update step progress callback on successful completion.
2026-01-28 23:03:38 +00:00
Andrew Beal
1bdab361b4 Add debug logging to AI agent workflow execution
Track agent initialization, function calls, workflow transitions, and completion states across MainAgent, OrchestrationAgent, PlanningAgent, ExecutionAgent, and AIController. Remove unused window.debugServiceLog global declaration.
2026-01-28 21:59:48 +00:00
Andrew Beal
cefc408b2e Add context passing between execution steps and enhance orchestration
- Add context_for_next_step parameter to CompleteStep for passing execution history
- Add context parameter to CompleteTask for preserving task completion state
- Update OrchestrationResult to handle context propagation between steps
- Add debug color differentiation for agent types (Main, Execution, Orchestration, Planning)
- Reorganize SearchTypes from Helpers to Types directory
- Add justification requirement for execution deviations
- Support reasonable deviations in orchestration plan validation
- Refactor dependency service with TryResolve utility
- Add whitespace cleanup to Semaphore class
2026-01-28 21:23:47 +00:00
Andrew Beal
ab9ee08281 refactor: implement multi-agent orchestration architecture
Restructure the AI workflow from a single-agent model to a specialized
multi-agent system with distinct roles:

- Add AgentType enum (Main, Orchestration, Planning, Execution) to define
  agent specializations
- Replace AIControllerService and AIFunctionService with modular agent
  classes in Services/AIServices/:
  - MainAgent: Handles user interaction and delegates to orchestration
  - OrchestrationAgent: Coordinates plan execution and step-by-step workflow
  - PlanningAgent: Creates and revises execution plans
  - ExecutionAgent: Executes individual plan steps
  - AIController: Base class providing common agent loop functionality
- Create specialized prompts (OrchestrationPrompt, ExecutionPrompt) for
  agent-specific behavior
- Add OrchestrationResult type to communicate workflow control decisions
  (continue, abort, replan)
- Introduce agent-specific function scoping:
  - ExecuteWorkflow for main agent
  - CompleteTask for execution agent
  - CompleteStep/Replan/CancelPlan for orchestration agent
  - SubmitPlan/AskUserQuestionPlanning for planning agent
- Update BaseAIClass to use agentType property instead of isPlanningAgent
  boolean for model selection
- Simplify ExecutionPlan and ExecutionStep types by removing execution
  state tracking (moved to agent coordination)
- Remove PlanningEnabledAppendix and ExecutionStatus enum (superseded by
  agent architecture)
- Add comprehensive integration tests for agent workflows

This architecture provides better separation of concerns, clearer agent
responsibilities, and more robust plan execution with explicit orchestration
control flow.
2026-01-27 20:29:20 +00:00
Andrew Beal
1694c17baa Bump plugin version to 1.1.7 2026-01-07 20:40:51 +00:00
Andrew Beal
789302ade4 fix: improve height calculation reliability in ChatPlanArea
Move step height measurements into updateHeight function to ensure fresh calculations on each update, preventing stale reactive declarations from causing incorrect collapsed height values
2026-01-07 20:40:16 +00:00
Andrew Beal
67c4f3f2c6 Add comprehensive integration tests for AI agent workflows
Test agent loop function calls, planning mode, execution agent, replan workflow, error handling, save callbacks, and shouldContinue flag behavior. Update mocks to use AIFunctionResponse class and rename onPlanComplete to onPlanReset.
2026-01-07 20:15:57 +00:00
Andrew Beal
19cd82ad7d feat: split ask_user_question into separate planning and execution functions
Add distinct AskUserQuestionPlanning and AskUserQuestionExecution functions to enable user consultation during both planning and execution phases. Update system prompt to clarify when to seek user input vs. replan. Fix plan area rendering timing and improve execution flow handling.
2026-01-07 20:00:40 +00:00
Andrew Beal
7e71861a4d refactor: improve plan execution with stricter scope and error handling
- Add currentProvider getter to AI classes for provider access
- Enhance planning prompt to discourage over-engineering and scope creep
- Return Unknown enum instead of throwing for invalid AI functions
- Add completion reminders to execution steps
- Fix ChatPlanArea height calculation timing
- Update tests to handle Unknown function gracefully
2026-01-06 20:49:02 +00:00
Andrew Beal
c5a3a4a5fb Update unit tests. 2026-01-05 22:46:51 +00:00
Andrew Beal
aa1e34185a Bump plugin version to 1.1.6 2026-01-05 22:38:51 +00:00
Andrew Beal
9cc4aca679 Update dependencies: diff2html, zod, TypeScript ESLint, and rollup 2026-01-05 22:30:08 +00:00
Andrew Beal
c748d165c6 docs: add planning mode documentation to README and help text
Document the new two-agent planning workflow, including how it works, when to use it, capabilities, visualization, and planning model configuration. Add planning mode section to both README.md and help copy.
2026-01-05 22:27:58 +00:00
Andrew Beal
0fb17e7b3a feat: add planning model selection and rate limit countdown UI
Introduce separate planning model setting to allow using different models for planning vs execution. Add visual countdown display when rate limits are hit, with improved retry delay parsing across providers (Claude, OpenAI, Gemini). Refactor settings tab into Views directory and enhance mobile layout for input controls.
2026-01-05 21:49:51 +00:00
Andrew Beal
4614ec5639 feat: add markdown formatting support to AI planning questions
Enhance user question display with markdown rendering for better readability.
Display formatted questions with emphasis, lists, and code snippets. Adjust
input display max-height based on platform (mobile: 15vh, desktop: 30vh).
2026-01-04 23:59:07 +00:00
Andrew Beal
817ab3d332 fix: improve planning mode error handling and UI state management
- Add MAX_AGENT_DEPTH check to prevent infinite planning recursion
- Prompt user to submit plan if not provided instead of silent failure
- Clear planning mode when deactivating edit mode
- Remove inline overflow-y style in favor of CSS declaration
- Update error copy for clarity
- Remove unused deactivateEditMode method
2026-01-04 23:40:31 +00:00
Andrew Beal
fbb2d8275d feat: add CompletePlan function to explicitly mark plan execution as complete
Add new CompletePlan function with schema and validation to allow agents to explicitly signal when all execution steps are done. Update system prompt to include completion confirmation step. Refactor execution loop to recursively prompt for completion if incomplete, with MAX_EXECUTION_DEPTH limit replacing MAX_PLANNING_ITERATIONS. Remove automatic incomplete execution handling in favor of explicit agent-driven completion.
2026-01-04 22:47:22 +00:00
Andrew Beal
e22cd8698a refactor: implement planning mode with user questions and cross-provider function call improvements
- Add planning mode toggle and AskUserQuestion function for interactive planning
- Fix Gemini cross-provider function call detection using toolId presence
- Update OpenAI naming service to handle new response format
- Improve system prompts by removing complexity gate, streamlining to action-first principle
- Add InputDisplay component and question mode to ChatInput
- Refactor execution plan error messages to show all incomplete steps
- Update tests to reflect cross-provider function call format changes
2026-01-04 18:52:44 +00:00
Andrew Beal
275f548914 refactor: streamline planning UX and strengthen complexity gate
Restructure system prompt to enforce mandatory complexity evaluation before action. Replace verbose multi-step planning framework with concise gate-based decision model. Add UI for execution plan visibility. Improve planning/execution separation by blocking execution tools during planning phase. Remove cancellation indicator component. Fix conversation deletion bug preventing saves after delete. Strengthen type safety for AIFunction names. Simplify function summary format for planning agent. Update test mocks for new callback signatures.
2026-01-03 11:15:32 +00:00
Andrew Beal
32050767ca feat: enhance conversation naming with prompt injection protection and improved validation
- Wrap user messages in <message_to_title> tags to prevent prompt injection
- Expand NamePrompt with security guidelines and edge case handling
- Add 10-word limit truncation for generated titles
- Move conversation save before naming to ensure persistence
- Add comprehensive task complexity assessment framework to SystemPrompt
- Change stack limit error to warning log for better resilience
2026-01-01 13:06:06 +00:00
Andrew Beal
80e01e1212 refactor: extract function parsing to shared ResponseHelper
Move parseFunctionCall and parseFunctionResponse from BaseAIClass private methods to shared ResponseHelper module for better code reusability across providers and tests.
2025-12-31 23:02:01 +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
2c7e5b41b6 Add provider-specific retry delay extraction for rate limits
Implement extractRetryDelay methods in Claude, Gemini, and OpenAI classes to parse provider-specific retry delay headers/responses. Update StreamingService to use these delays when available, falling back to exponential backoff. Enhance ApiError to include response headers and body for retry delay extraction.
2025-12-31 14:19:42 +00:00