-
Notifications
You must be signed in to change notification settings - Fork 2
IMAP email tool agent #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Implement read-only IMAP email query tool for AI agents with: - IMAP client using rustls for cross-platform TLS - Operations: list mailboxes, search, fetch headers, fetch emails - Email parsing with mail-parser for text/HTML bodies and attachments - Type-safe request/response structures with JsonSchema - Integration with ToolExecutor and ToolRequest/ToolResponse enums Dependencies added: imap (rustls-tls), imap-proto, mail-parser All unit tests passing (84 tests). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…lysis - Create ImapEmailAgent module with complete Agent trait implementation - Add IMAP credential management via agent settings (host, port, username, password) - Implement two-phase workflow: analyze headers first, then selective email download - Add ImapReader to AgentTool enum with tool parsing - Add IMAP tool schema with support for list_mailboxes, mailbox_status, search, fetch_headers, fetch_email operations - Add 6 unit tests for settings schema, tools, objective, and credential loading - Update README with IMAP Email Agent documentation - Fix sqlite_reader test naming (SqliteAnalysisAgent → SqliteReaderAgent) - Add task documentation for future reference
…est binary This commit fixes three critical issues preventing the IMAP Email Agent from working: ## Fix 1: TLS Encryption for IMAPS (nocodo-tools) - IMAP client was connecting to port 993 without TLS, causing auth failures - Refactored client.rs to explicitly use rustls for TLS encryption - Changed from ClientBuilder to manual: TCP → TLS handshake → IMAP client - Now properly supports IMAPS with cross-platform rustls (no OpenSSL) ## Fix 2: Credential Injection (nocodo-agents) - Agent was logging injection intent but not actually passing credentials - Implemented temp config file creation with NamedTempFile (auto-cleanup) - Inject config file path into ImapReaderRequest.config_path - Added tempfile to runtime dependencies - Removed #[allow(dead_code)] warnings (all fields now used) ## Fix 3: Test Binary with Pre-Connection Validation - Created imap-email-runner binary for manual testing - Secure password input with rpassword (not echoed) - Pre-connection test runs BEFORE calling LLM (saves API costs) - Interactive and single-query modes supported - Clear error messages for common auth issues Files changed: - nocodo-tools/src/imap/client.rs - TLS implementation - nocodo-agents/src/imap_email/mod.rs - Credential injection - nocodo-agents/bin/imap_email_runner.rs - Test binary (252 lines) - nocodo-agents/bin/README-imap-email-runner.md - Usage guide - nocodo-agents/Cargo.toml - Added dependencies (tempfile, rpassword, imap, rustls-connector) - nocodo-agents/tasks/add-imap-email-agent.md - Updated with fixes and completion notes All tests passing. Binary tested and working with real IMAP server. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add IMAP agent execution handler with endpoint /agents/imap/execute - Register IMAP agent in supported agents list - Add create_imap_agent helper function for agent instantiation - Add ImapAgentConfig to shared types and generate TypeScript types - Add IMAP agent form inputs in GUI (host, port, username, password) - Add validation for IMAP configuration fields - Update agent selection logic to handle IMAP agent
📊 Code Complexity Analysis
💡 Suggestion: This is a large PR with 4572 added lines. Consider:
Automated analysis by GitHub Actions |
🤖 Automated Code Review SummaryThis automated review was generated to help ensure code quality and security standards. Rust Code Analysis
TypeScript/JavaScript Code AnalysisSecurity Analysis
Recommendations
This review was automatically generated. Please address any issues before merging. |
No description provided.