# Local comms Apple Mail and Apple Calendar on this Mac. Draft only. Mark sends. This machine only. A cloud or remote hatch cannot see Mail. Say so. Do not invent inbox state. Open this file when the work is a client email or a meeting. Do not ingest it at hatch. Contacts are a file, not Apple Contacts: `/Users/mark/Desktop/beargrassai/projects/+CONTACTS.md` ## Gates 1. Email is draft only. Never send. The send path is not in this file. 2. Calendar events have no attendees. Mark adds people. An attendee send is an invite. 3. Client mail drafts from `mark@beargrassai.com`. Never another account. 4. If Full Disk Access is off, Mail is not running, or this is not the Studio, say you cannot see the mailbox. Never report "no new mail" for a store you cannot read. The boat CO drafts that client's mail. Jayson does whole-inbox triage. Do not race two Mail writes. ## Mail Pinned account UUID `A1BE9374-34A6-4640-82F2-C2D79D3544D2` (`mark@beargrassai.com`). Local cache. Freshness is last Mail sync. Envelope index: ```bash sqlite3 "/Users/mark/Library/Mail/V10/MailData/Envelope Index" " SELECT datetime(m.date_received, 'unixepoch', 'localtime'), s.contact_identifier, sub.subject, m.read, m.flagged, m.ROWID FROM messages m JOIN senders s ON m.sender = s.ROWID JOIN subjects sub ON m.subject = sub.ROWID WHERE m.mailbox = 4 AND m.deleted = 0 ORDER BY m.date_received DESC LIMIT 30;" ``` Primary account mailboxes: 4 All Mail, 5 BeargrassAI, 6 Clients, 46 Drafts. Unread: `AND m.read = 0`. Body: `find` the `{ROWID}.emlx` under that UUID. Gist only. Do not quote a body to a client until you have the real message. Draft. Bind values. Do not interpolate names or bodies into the script. ```bash osascript - "$TO" "$SUBJECT" "$BODY" <<'EOF' on run argv tell application "Mail" set newDraft to make new outgoing message with properties {visible:false, subject:item 2 of argv, content:item 3 of argv} set sender of newDraft to "mark@beargrassai.com" tell newDraft to make new to recipient at end of to recipients with properties {address:item 1 of argv} save newDraft return "Draft saved. Mark sends." end tell end run EOF ``` After any Mail script: the message is in Drafts. Sent is empty of it. Then report drafted. Keep a working copy under `Clients//comms/`. ## Calendar ```bash sqlite3 "/Users/mark/Library/Group Containers/group.com.apple.calendar/Calendar.sqlitedb" " SELECT ci.summary, datetime(ci.start_date + 978307200, 'unixepoch', 'localtime'), datetime(ci.end_date + 978307200, 'unixepoch', 'localtime'), c.title FROM CalendarItem ci JOIN Calendar c ON ci.calendar_id = c.ROWID WHERE ci.start_date > (strftime('%s','now') - 978307200) AND ci.start_date < (strftime('%s','now') - 978307200 + 604800) AND (ci.deleted_status IS NULL OR ci.deleted_status = 0) ORDER BY ci.start_date ASC;" ``` Draft event: calendar `mark@beargrassai.com`, no attendees. Open Calendar first if it is not running: `open -a Calendar && sleep 3`. ## Not this skill Send. Add attendees. Delete mail. Attachments. Apple Contacts. A headless hatch.