Initial commit: CI Agent competitive-intelligence monitoring app

FastAPI + Celery + Next.js + Postgres/Redis app with company monitoring,
source collection, LLM-based change analysis, enrichment, and account
security (Turnstile, escalating lockout, email verification).
This commit is contained in:
2026-08-05 10:48:20 -04:00
commit 1a4c80958f
365 changed files with 43541 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
"""Resolves a NotificationType to a concrete provider. Console is always
available and never costs anything; email/SMS are only meaningfully
configured when their settings are present (callers gate on
NOTIFICATION_SMS_ENABLED before ever routing to SMS - see alert_service.py).
SMS has two interchangeable vendor providers (`SMS_PROVIDER=twilio|telnyx`),
same pattern as LLM_PROVIDER/SEARCH_PROVIDER elsewhere in the app - swapping
the setting changes which class this returns and nothing else has to change.
"""
from __future__ import annotations
from app.core.config import Settings
from app.models.enums import NotificationType
from app.notifications.base import NotificationProvider
from app.notifications.console import ConsoleProvider
from app.notifications.smtp_email import SmtpEmailProvider
from app.notifications.telnyx_sms import TelnyxSmsProvider
from app.notifications.twilio_sms import TwilioSmsProvider
def get_notification_provider(
notification_type: NotificationType, settings: Settings
) -> NotificationProvider:
if notification_type == NotificationType.EMAIL:
return SmtpEmailProvider(settings)
if notification_type == NotificationType.SMS:
if settings.sms_provider == "telnyx":
return TelnyxSmsProvider(settings)
return TwilioSmsProvider(settings)
return ConsoleProvider()