1"""Type definitions for session management MCP server.

2

3 This module provides type-safe dataclass definitions to replace problematic

4 tuple/union return types that cause issues with type checkers like zuban.

5"""

6

7 from dataclasses import dataclass

8 from datetime import datetime

9

10

11@dataclass

12 class TimeRange:

13 """Represents a time range with optional start and end times.

14

15 Used for temporal search and time-based filtering operations.

16 """

17

18 start: datetime | None = None

19 end: datetime | None = None

20

21

22@dataclass

23 class SQLCondition:

24 """Represents a SQL condition with WHERE clause and parameters.

25

26 Used for building parameterized SQL queries with type-safe parameter binding.

27 """

28

29 condition: str

30 params: list[str | datetime]

31

32

33@dataclass

34 class RecurrenceInterval:

35 """Represents a parsed recurrence interval from a recurrence rule.

36

37 Used for calculating next occurrences of recurring reminders.

38 """

39

40 frequency: str | None = None

41 interval: int = 1