import { Module } from "@nestjs/common";
import { APP_INTERCEPTOR } from "@nestjs/core";
import { AppController } from "./app.controller";
import { AppService } from "./app.service";
import { PrismaModule } from "./prisma/prisma.module";
import { DatabaseModule } from "./database/database.module";
import { AuthModule } from "./auth/auth.module";
import { ActivityModule } from "./activity/activity.module";
import { TasksModule } from "./tasks/tasks.module";
import { EventsModule } from "./events/events.module";
import { ProjectsModule } from "./projects/projects.module";
import { DomainsModule } from "./domains/domains.module";
import { IdeasModule } from "./ideas/ideas.module";
import { WidgetsModule } from "./widgets/widgets.module";
import { LayoutsModule } from "./layouts/layouts.module";
import { KnowledgeModule } from "./knowledge/knowledge.module";
import { UsersModule } from "./users/users.module";
import { WebSocketModule } from "./websocket/websocket.module";
import { LlmModule } from "./llm/llm.module";
import { BrainModule } from "./brain/brain.module";
import { CronModule } from "./cron/cron.module";
import { AgentTasksModule } from "./agent-tasks/agent-tasks.module";
import { ValkeyModule } from "./valkey/valkey.module";
import { TelemetryModule, TelemetryInterceptor } from "./telemetry";

@Module({
  imports: [
    TelemetryModule,
    PrismaModule,
    DatabaseModule,
    ValkeyModule,
    AuthModule,
    ActivityModule,
    TasksModule,
    EventsModule,
    ProjectsModule,
    DomainsModule,
    IdeasModule,
    WidgetsModule,
    LayoutsModule,
    KnowledgeModule,
    UsersModule,
    WebSocketModule,
    LlmModule,
    BrainModule,
    CronModule,
    AgentTasksModule,
  ],
  controllers: [AppController],
  providers: [
    AppService,
    {
      provide: APP_INTERCEPTOR,
      useClass: TelemetryInterceptor,
    },
  ],
})
export class AppModule {}
