Commit Graph

15 Commits

Author SHA1 Message Date
cbd2559169 🐛 fix: normalize AI-generated dates to valid ISO offset datetimes
- add normalizeAiDateString() to coerce bare ISO datetimes, date-only
  strings, and fractional-second variants into offset-aware format
- apply via z.preprocess in AiEventResponseItemSchema so Zod validation
  no longer rejects AI responses missing a timezone offset
- fix system prompt to use toISOString() (unambiguous UTC) and clarify
  expected datetime format for the AI model
- install bun-types and add to tsconfig so bun:test resolves cleanly
- add 8 behaviour-driven tests covering all normalizer edge cases
2026-04-07 23:01:42 -04:00
79f98ebfd3 refactor(api): simplify AI event route with extracted utilities and env-based model
Replace inline JSON extraction with the shared json-utils module,
extract chat response content parsing into a dedicated helper, make
the AI model configurable via AI_MODEL env var, and improve error
messages for production safety.
2026-04-07 13:11:15 -04:00
a0a7e021a8 style: standardize import ordering, type imports, and formatting in source files
Sort imports alphabetically, convert value imports to type-only where
appropriate, normalize indentation to tabs, and sort exports
alphabetically across UI components, pages, and lib modules.
2026-04-07 13:10:49 -04:00
8d1b04f646 feat(api): refactor AI event route with Zod validation, multimodal image support, and JSON extraction 2026-04-07 11:57:22 -04:00
48ef4f60df style(api): standardize API route file formatting 2026-04-07 08:09:49 -04:00
e1fd7dc5a3 feat(api): add input validation to AI endpoints
Add prompt validation to ai-event (non-empty string, max 2000 chars)
and events array length validation to ai-summary (max 100 items)
to prevent abuse and injection attacks.
2026-04-06 23:24:15 -04:00
c3026c8262 feat(api): add auth check to ai-summary endpoint
Require authentication for ai-summary endpoint to prevent
unauthorized API key usage and cost leakage.
2026-04-06 23:18:46 -04:00
15be2399c6 refactor: migrate session usage to better-auth API 2026-04-06 22:41:57 -04:00
08a894577b refactor: replace next-auth with better-auth core and client 2026-04-06 22:41:11 -04:00
824768ce93 Add RRuleDisplay component and clean up unused imports
- Create new RRuleDisplay component for better recurrence rule formatting
- Replace Badge with RRuleDisplay in EventCard for improved UX
- Remove unused imports across multiple files (CalendarEvent, Badge, Card components)
- Remove unused catch parameter in ai-event route
2025-08-22 13:35:13 -04:00
12e9ec5d85 proper user/session creation and auth integration into UI 2025-08-19 03:40:06 -04:00
2c6737ceb4 implement authentik auth 2025-08-16 19:09:57 -04:00
836feb2e11 add recurrence editor component 2025-08-16 01:54:30 -04:00
a41d003401 bulk ai event creation 2025-08-16 01:54:30 -04:00
3ee7be9110 ai integration 2025-08-16 01:54:30 -04:00