mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 09:01:19 +00:00
feat: add Apple Calendar source package
Add @aris/source-apple-calendar for fetching iCloud calendar events via CalDAV using tsdav and ical.js. - CalendarSource implements FeedSource with fetchItems and fetchContext for downstream context - CalendarCredentialProvider interface for token injection - CalendarDAVClient interface for testability - iCal parser extracts full event data including attendees, alarms, organizer, and recurrence - Priority based on event proximity to current time Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
24
packages/aris-source-apple-calendar/src/calendar-context.ts
Normal file
24
packages/aris-source-apple-calendar/src/calendar-context.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { ContextKey } from "@aris/core"
|
||||
|
||||
import { contextKey } from "@aris/core"
|
||||
|
||||
import type { CalendarEventData } from "./types.ts"
|
||||
|
||||
/**
|
||||
* Calendar context for downstream sources.
|
||||
*
|
||||
* Provides a snapshot of the user's upcoming events so other sources
|
||||
* can adapt (e.g. a commute source checking if there's a meeting soon).
|
||||
*/
|
||||
export interface CalendarContext {
|
||||
/** Events happening right now */
|
||||
inProgress: CalendarEventData[]
|
||||
/** Next upcoming event, if any */
|
||||
nextEvent: CalendarEventData | null
|
||||
/** Whether the user has any events today */
|
||||
hasTodayEvents: boolean
|
||||
/** Total number of events today */
|
||||
todayEventCount: number
|
||||
}
|
||||
|
||||
export const CalendarKey: ContextKey<CalendarContext> = contextKey("calendar")
|
||||
Reference in New Issue
Block a user