Collector Implementation¶
Haven.app uses Swift collector modules to access macOS system resources. These collectors are integrated directly into Haven.app and run via Swift APIs (no HTTP server required).
Overview¶
The collector modules provide native macOS capabilities that containers cannot access:
- Messages Database: Read-only access to iMessage history
- Vision APIs: Native macOS Vision framework for OCR and entity detection
- Filesystem Monitoring: FSEvents-based file watching
- Contacts: Access to macOS Contacts database
- Email: IMAP and local Mail.app email collection
Architecture¶
Haven.app integrates collectors directly:
Haven.app (SwiftUI) → Direct Swift APIs → Collector Modules → Gateway API
Benefits: - No HTTP overhead - Simpler deployment (single app) - Better error handling and state management - Integrated UI and runtime
Core Capabilities¶
The collector modules provide:
- iMessage Collection: Safe, read-only access to Messages.app database with smart snapshots
- Email Collection: IMAP and local Mail.app
.emlxcollection - File System Monitoring: FSEvents-based file watching with presigned URL uploads
- Contacts Collection: macOS Contacts.app integration
- OCR Service: Vision framework OCR + entity extraction
Configuration¶
Configuration is managed through:
- Settings UI: Built-in settings window in Haven.app (
⌘,) - Config File:
~/.haven/hostagent.yaml(YAML format)
The unified app provides a comprehensive settings interface for all collector configuration, or you can edit the YAML file directly.
Usage¶
See the Haven.app Guide for installation and usage instructions.
Collector Documentation¶
- iMessage Collector - iMessage collection
- Local Files Collector - Filesystem watching
- Contacts Collector - Contacts sync
- Email Collectors - IMAP and Mail.app
Implementation Details¶
The collector modules are implemented as Swift packages within Haven.app:
- HavenCore: Core collector infrastructure
- Collectors: Individual collector implementations
- Utilities: OCR, file watching, link resolution
For implementation details, see the source code in hostagent/Sources/ and Haven/Haven/.
Related Documentation¶
- Haven.app Guide - App usage and configuration
- Architecture Overview - System architecture
- Local Development - Development setup
- Functional Guide - Ingestion workflows