Add CaldavConfigStore and preloadAppData() to load events (current month) and CalDAV config into stores before dismissing the auth loading spinner. This prevents the brief empty flash when first navigating to Calendar or Settings tabs. Also applies Prettier formatting across codebase.
32 lines
873 B
TypeScript
32 lines
873 B
TypeScript
import {
|
|
ChatMessage,
|
|
ProposedEventChange,
|
|
ExpandedEvent,
|
|
CalendarEvent,
|
|
} from "@calchat/shared";
|
|
|
|
export interface AIContext {
|
|
userId: string;
|
|
conversationHistory: ChatMessage[];
|
|
currentDate: Date;
|
|
// Callback to load events from a specific date range
|
|
// Returns ExpandedEvent[] with occurrenceStart/occurrenceEnd for recurring events
|
|
fetchEventsInRange: (
|
|
startDate: Date,
|
|
endDate: Date,
|
|
) => Promise<ExpandedEvent[]>;
|
|
// Callback to search events by title
|
|
searchEvents: (query: string) => Promise<CalendarEvent[]>;
|
|
// Callback to fetch a single event by ID
|
|
fetchEventById: (eventId: string) => Promise<CalendarEvent | null>;
|
|
}
|
|
|
|
export interface AIResponse {
|
|
content: string;
|
|
proposedChanges?: ProposedEventChange[];
|
|
}
|
|
|
|
export interface AIProvider {
|
|
processMessage(message: string, context: AIContext): Promise<AIResponse>;
|
|
}
|