mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 00:51:20 +00:00
* feat: add generic CalDAV calendar data source Add @aris/source-caldav package that fetches calendar events from any CalDAV server via tsdav + ical.js. - Supports Basic auth and OAuth via explicit authMethod discriminant - serverUrl provided at construction time, not hardcoded - Optional timeZone for correct local day boundaries - Credentials cleared from memory after client login - Failed calendar fetches logged, not silently dropped - Login promise cached with retry on failure Co-authored-by: Ona <no-reply@ona.com> * fix: deduplicate concurrent fetchEvents calls Co-authored-by: Ona <no-reply@ona.com> * fix: timezone-aware signals, low-priority cancelled events - computeSignals uses startOfDay(timeZone) for 'later today' boundary - Cancelled events get urgency 0.1, excluded from context inProgress/nextEvent Co-authored-by: Ona <no-reply@ona.com> --------- Co-authored-by: Ona <no-reply@ona.com>
25 lines
742 B
TypeScript
25 lines
742 B
TypeScript
import type { ContextKey } from "@aris/core"
|
|
|
|
import { contextKey } from "@aris/core"
|
|
|
|
import type { CalDavEventData } from "./types.ts"
|
|
|
|
/**
|
|
* Calendar context for downstream sources.
|
|
*
|
|
* Provides a snapshot of the user's upcoming CalDAV 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: CalDavEventData[]
|
|
/** Next upcoming event, if any */
|
|
nextEvent: CalDavEventData | null
|
|
/** Whether the user has any events today */
|
|
hasTodayEvents: boolean
|
|
/** Total number of events today */
|
|
todayEventCount: number
|
|
}
|
|
|
|
export const CalDavCalendarKey: ContextKey<CalendarContext> = contextKey("caldavCalendar")
|