/** Represents a configured Apple Mail account. */ export interface MailAccount { /** Exact account name as shown in Mail.app (e.g., "Google (Jiran)"). */ name: string; /** Category: personal, business, or university. */ category: "personal" | "business" | "university"; /** Business/org name if applicable (e.g., "Cyberionsoft"). */ business: string; /** Email addresses associated with this account. */ emails: string[]; /** Provider-specific mailbox names. */ mailboxes: { inbox: string; sent: string; trash: string; junk: string; archive: string; drafts: string; }; } /** A mail message summary (returned by list operations). */ export interface MailMessageSummary { id: string; account: string; mailbox: string; from: string; to?: string[]; cc?: string[]; subject: string; date: string; read: boolean; flagged: boolean; } /** A full mail message (returned by read operations). */ export interface MailMessage extends MailMessageSummary { body: string; truncated: boolean; to: string[]; cc: string[]; hasAttachments: boolean; attachments: Array<{ name: string; mimeType: string; }>; } /** Account statistics. */ export interface AccountStats { account: string; email: string; category: string; mailboxCounts: Record; unread: number; flagged: number; topSenders: Array<{ sender: string; count: number; }>; } /** Triage priority levels. */ export type TriagePriority = "urgent" | "actionable" | "informational" | "low-priority" | "uncategorized"; /** A triaged message with priority and category label. */ export interface TriagedMessage extends MailMessageSummary { priority: TriagePriority; label: string; } /** Triage result across accounts. */ export interface TriageResult { totalUnread: number; accountsChecked: number; messages: TriagedMessage[]; } /** Daily summary data. */ export interface DailySummary { date: string; totalNewToday: number; totalUnread: number; activeAccounts: number; accounts: Array<{ name: string; email: string; inboxTotal: number; unread: number; flagged: number; today: number; }>; } /** Bulk action result. */ export interface BulkActionResult { action: string; account: string; affected: number; dryRun: boolean; preview?: Array<{ from: string; subject: string; }>; } /** Categorization rule for triage. */ export interface CategoryRule { priority: 1 | 2 | 3 | 4; type: "from_contains" | "from_ends_with" | "subject_contains"; pattern: string; label: string; } /** Parsed calendar event from an .ics attachment or Calendar.app. */ export interface CalendarEvent { /** Event unique identifier (UID from .ics). */ uid: string; /** Event summary/title. */ summary: string; /** Start date-time as ISO 8601 string. */ dtstart: string; /** End date-time as ISO 8601 string. */ dtend: string; /** Event location, if specified. */ location: string; /** Event description/body text. */ description: string; /** Organizer email address. */ organizer: string; /** Attendee email addresses. */ attendees: string[]; /** iCalendar method: REQUEST, REPLY, CANCEL, PUBLISH. */ method: string; /** Event status: TENTATIVE, CONFIRMED, CANCELLED. */ status: string; } /** Calendar info from Calendar.app. */ export interface CalendarInfo { /** Calendar name. */ name: string; /** Calendar unique identifier. */ uid: string; } /** Extended mail message with calendar invite data. */ export interface MailMessageWithCalendar extends MailMessage { /** True if message contains at least one calendar invite (.ics). */ hasCalendarInvite: boolean; /** Parsed calendar events from .ics attachments. */ calendarEvents: CalendarEvent[]; } /** Engine configuration. */ export interface EngineConfig { /** Allow sending emails. Default: false (draft only). */ allowSend: boolean; /** Timeout in seconds for AppleScript/JXA operations. */ timeout: number; /** Default message limit for list operations. */ defaultLimit: number; /** Maximum message limit. */ maxLimit: number; /** Custom categorization rules (merged with defaults). */ categoryRules: CategoryRule[]; /** Batch chunk size for bulk operations. Default: 50. */ batchChunkSize: number; /** Cache TTL in milliseconds. Default: 30000. */ cacheTtlMs: number; /** Max categorize sample count per category. Default: 5. */ categorizeSampleSize: number; } export declare const DEFAULT_CONFIG: EngineConfig; /** Paginated result wrapper for list/search operations. */ export interface PaginatedResult { messages: T[]; /** Total matching messages. -1 if unknown (e.g., cross-account search). */ total: number; /** Current offset (0-based). */ offset: number; /** Requested limit. */ limit: number; /** True if more results exist beyond this page. */ hasMore: boolean; } /** Bulk count result for all mailboxes in an account. */ export interface BulkCountResult { account: string; mailboxes: Record; } /** Stats for all accounts. */ export interface StatsAllResult { accounts: Array<{ account: string; email: string; category: string; inbox: { total: number; unread: number; flagged: number; }; }>; totalUnread: number; totalFlagged: number; } //# sourceMappingURL=types.d.ts.map