/** * Dispatcher script: email-fetch * * Polls IMAP for new emails and persists them as Email nodes in the graph. * Standalone dispatcher. Not fired automatically on a running install — the * installer-registered cron entry was removed and the replacement * surface (Claude Code's desktop scheduled tasks, per maxy-code-prd.md * §Scheduled tasks) is not yet wired. Until that lands, this binary runs only * when invoked manually or by a future scheduled-task dispatcher. When invoked, * checks pollIntervalMinutes before fetching. * * Flow: * 1. Acquire PID lock (skip if another instance is running) * 2. Load EmailAccount config + poll state * 3. Check if enough time has elapsed since lastPollAt * 4. Connect to IMAP, fetch emails since lastFetchedUid * 5. Handle UIDVALIDITY changes (reset high-water mark, rely on MERGE dedup) * 6. Classify each email via Haiku (clean/suspicious/discard) * 7. Store each email as an Email node (MERGE on emailId) with screening verdict * — discarded emails are stored without embedding (no vector pollution) * 8. Update high-water mark (lastFetchedUid, lastPollAt, uidValidity) * 9. Release lock * * Failures are logged but never crash the platform — next cycle retries * from the same high-water mark. * * PLATFORM_ROOT=... ACCOUNT_ID=... node dist/scripts/email-fetch.js */ export {}; //# sourceMappingURL=email-fetch.d.ts.map