-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Turn Apple Mail into an AI Extension #17766
base: main
Are you sure you want to change the base?
Conversation
- Contributor name - Style - Changelog - Use default account for compose - Evals - Prompt engineering - Handle no messages - Improve prompts - AI extension - Initial commit
- Remove vscode ripgrep - Fix type error
Thank you for your contribution! 🎉 🔔 @yug2005 @ikupenov @pernielsentikaer @fengtianze @tleo19 @Luk4h @jfkisafk @StevenRCE0 @ridemountainpig @ViGeng you might want to have a look. You can use this guide to learn how to check out the Pull Request locally in order to test it. Due to our current reduced availability, the initial review may take up to 10-15 business days |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR adds AI capabilities to the Mail extension by introducing tools for searching emails, listing addresses, and sending emails, along with support for default mail account management.
- Critical security vulnerability: SQL injection risk in
list-addresses.ts
where query parameter is directly interpolated into SQL without sanitization - Missing error handling in
getPersistenceInfo.ts
for file access and parsing failures - Recommend wrapping file operations in
ripgrep.ts
with try-catch blocks and adding proper cleanup for failed downloads - Need input validation for email addresses and content in
send-email.ts
before processing - Consider adding rate limiting for database operations in
search-messages.ts
to prevent performance issues with large mailboxes
💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!
13 file(s) reviewed, 16 comment(s)
Edit PR Review Bot Settings | Greptile
"ai": { | ||
"instructions": "- If you can't access the Apple Mail database, tell the user he needs to give Raycast the full disk access permission in the system settings. Be detailed about the steps.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: AI instructions use gendered language ('he needs'). Consider using gender-neutral language ('they need')
type PersistenceInfo = { | ||
LastUsedVersionDirectoryName: string; | ||
VersionDirectoryIdentifiers: Record<string, string>; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider making this type readonly to prevent accidental mutations of the parsed data.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Description
Closes #17615
This PR turns the Apple Mail extension into an AI extension.
Supported tools:
Also added support for setting the default mail account, which is now used as the default in
Compose New Message
and by the AI when sending an email.How does email searching work?
I have opted for a combination of searching the local .emlx files on the filesystem using ripgrep (which this extension downloads a copy of) and using the SQLite database for filtering by date and sender. This approach is necessary because Apple does not store the complete content of all emails within the SQLite database.
Screencast
Checklist
npm run build
and tested this distribution build in Raycastassets
folder are used by the extension itselfREADME
are placed outside of themetadata
folder