Commit graph

334 commits

Author SHA1 Message Date
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
9901dfb06b fix: add top margin to conversation history list on mobile devices 2026-02-16 22:16:58 +00:00
Andrew Beal
50f14aa594 Bump plugin version to 1.2.2 2026-02-16 22:04:43 +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
13e9030b4b fix: correct scroll positioning and spinner layout in chat plan area
- Calculate step position relative to scroll container for accurate centering
- Add flex-shrink: 0 to spinner to prevent unwanted shrinking
- Pass alternateBackground prop to active step spinner
2026-02-16 21:56:31 +00:00
Andrew Beal
9b40f397c4 refactor: improve planning/execution context flow and reduce redundant discovery
Enhance AI agent prompts to pass exploration findings as step context rather than creating redundant discovery steps. Add recovery guidelines for execution agent to handle minor gaps without replanning. Clarify replan context requirements for orchestration layer.
2026-02-16 21:29:09 +00:00
Andrew Beal
c044ebdf42 feat: add select-all checkbox and grid layout to conversation history modal
- Add toggleAll function to select/deselect all conversations
- Restructure layout using CSS grid for better alignment
- Add header row with column labels (Date, Title) and select-all checkbox
- Improve text overflow handling with min-width
- Update TypeScript ESLint packages to 8.56.0
2026-02-16 20:39:15 +00:00
Andrew Beal
2bc12691d3 feat: add early tool call feedback for improved UI responsiveness
Emit tool call start events immediately when tools begin execution,
allowing UI to display contextual "thinking" messages (e.g., "Generating
note contents..." for WriteVaultFile) before tool completion. Add
Spinner to ThoughtIndicator component for visual feedback during tool
operations.
2026-02-16 17:40:14 +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
Andrew Beal
8a8f3bce2e chore: update dependencies to latest versions
Update AI SDK packages (@anthropic-ai/sdk, @google/genai, openai), TypeScript tooling (@typescript-eslint packages), build tools (esbuild), testing dependencies (happy-dom), and Svelte packages to their latest compatible versions
2026-02-15 23:02:13 +00:00
Andrew Beal
d26140491c test: add getMimeType mock to Attachment test fixtures
Add getMimeType method mock to all Attachment test objects across AI service tests (Claude, Gemini, OpenAI) and mock StringTools.resizeB64Image in BaseAIFileService tests to prevent browser environment issues.
2026-02-15 22:55:39 +00:00
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