Files
Zero/apps/mail/types
Adam 3bb42e5357 better ai (#1724)
## Description

Refactored the AI chat component and email assistant to improve performance, reliability, and user experience. This PR introduces a new `inboxRag` tool for natural language email search, replaces the previous `listThreads` implementation, and enhances the prompt design for more efficient inbox management.

---

## Type of Change

-  New feature (non-breaking change which adds functionality)
-  Performance improvement

## Areas Affected

- [x] Email Integration (Gmail, IMAP, etc.)
- [x] User Interface/Experience
- [x] API Endpoints

## Testing Done

- [x] Manual testing performed

## Checklist

- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings

## Additional Notes

Key improvements:
- Added `ThreadPreview` component to replace the previous thread rendering approach
- Refactored `ToolResponse` to use specialized subcomponents for different tool types
- Updated AI prompts with better instructions for multi-step and parallel operations
- Switched backend models to Claude 3.5 for improved reasoning capabilities
- Fixed key prop issues in attachment rendering to prevent React warnings
- Increased agent max steps from 5 to 10 for more complex operations
- Added better markdown styling support for lists and other elements

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **New Features**
  * Introduced advanced AI-powered inbox search and organization with new tools and richer assistant guidance.
  * Added support for Anthropic AI models for chat and search tasks.
  * Enabled new streaming tool for natural language inbox search.

* **Improvements**
  * Enhanced AI assistant prompt with detailed instructions, expanded use cases, and improved communication style.
  * Modularized and streamlined AI chat component for clearer tool response rendering and better markdown styling.
  * Increased chat step limit in the AI sidebar for longer conversations.
  * Improved uniqueness of attachment keys to prevent display issues.

* **Bug Fixes**
  * Corrected parameter naming for thread and draft listing to ensure accurate pagination.

* **Chores**
  * Updated dependencies and environment variables for improved configuration and model support.
  * Cleaned up unused code and imports for better maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-13 16:34:03 -07:00
..
2025-06-25 13:56:20 -07:00
2025-03-01 16:36:17 -05:00
2025-07-13 16:34:03 -07:00