# Implementation Plan: Saved Tool Presets

## Phase 1: Data Model & Storage
- [x] Task: Define the `ToolPreset` data model and storage logic.
    - [x] Create `src/tool_presets.py` to handle loading/saving to `tool_presets.toml`.
    - [x] Implement `ToolPresetManager` to manage CRUD operations for presets and categorization.
- [x] Task: Write unit tests for `ToolPresetManager`.
    - [x] Test loading tool presets from TOML.
    - [x] Test saving tool presets to TOML.
    - [x] Test dynamic category parsing.
    - [x] Test tool approval flag persistence.
- [x] Task: Conductor - User Manual Verification 'Phase 1: Data Model & Storage' (Protocol in workflow.md)

## Phase 2: UI Integration (AI Settings)
- [x] Task: Relocate tool settings to the AI Settings panel.
    - [x] Modify `gui_2.py` to remove the current tool listing from the main panel and move it to the AI Settings panel (global/project).
- [x] Task: Implement dynamic tool categorization UI.
    - [x] Modify `gui_2.py` to render tools in sections based on categories defined in `tool_presets.toml`.
    - [x] Implement toggleable "auto"/"ask" flags for each tool.
- [x] Task: Implement Tool Preset dropdown for MMA agent roles.
    - [x] Add the "Tool Preset" dropdown to the MMA agent role configuration modal in `gui_2.py`.
- [x] Task: Write integration tests for AI Settings UI using `live_gui`.
    - [x] Verify tools are categorized correctly in the UI.
    - [x] Verify toggling a tool's approval persists correctly.
    - [x] Verify the "Tool Preset" dropdown shows all available presets.
- [x] Task: Conductor - User Manual Verification 'Phase 2: UI Integration (AI Settings)' (Protocol in workflow.md)

## Phase 3: AI Client & Execution Integration
- [x] Task: Integrate tool presets into the AI Client.
    - [x] Modify `src/ai_client.py` to load and apply the selected tool preset for a given agent role.
    - [x] Implement logic to restrict available tools and enforce "auto"/"ask" behavior based on the preset.
- [x] Task: Update MMA delegation to pass the selected tool preset.
    - [x] Modify `scripts/mma_exec.py` and `src/multi_agent_conductor.py` to pass the `tool_preset` to sub-agents.
- [x] Task: Write integration tests for AI execution with tool presets.
    - [x] Verify agents only have access to tools in their assigned preset.
    - [x] Verify "auto" tools execute without prompting, and "ask" tools require confirmation.
- [x] Task: Conductor - User Manual Verification 'Phase 3: AI Client & Execution Integration' (Protocol in workflow.md)

## Phase 4: Final Integration & Polish
- [x] Task: Implement Preset Manager Modal.
    - [x] Create a modal for creating, editing, and deleting tool presets.
- [x] Task: Final UI polish (spacing, icons, tooltips).
- [x] Task: Run full suite of relevant tests.
- [x] Task: Conductor - User Manual Verification 'Phase 4: Final Integration & Polish' (Protocol in workflow.md)
