import { Module, Global } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ClaudeAgentService } from './claude-agent.service';
import { ClaudeAgentServiceV2 } from './claude-agent-v2.service';
import { ImmigrationToolsService } from './tools/immigration-tools.service';
import { TokenUsageService } from './token-usage.service';
import { StrategyEngineService } from './strategy/strategy-engine.service';
import { TokenUsageORM } from '../database/postgres/entities/token-usage.orm';
import { KnowledgeModule } from '../knowledge/knowledge.module';
import { AgentsModule } from '../agents/agents.module';

@Global()
@Module({
  imports: [
    ConfigModule,
    KnowledgeModule,
    AgentsModule,
    TypeOrmModule.forFeature([TokenUsageORM]),
  ],
  providers: [
    ClaudeAgentService,
    /** @deprecated Use CoordinatorAgentService from AgentsModule instead */
    ClaudeAgentServiceV2,
    ImmigrationToolsService,
    TokenUsageService,
    /** @deprecated Strategy engine is now handled by Strategist Agent */
    StrategyEngineService,
  ],
  exports: [
    ClaudeAgentService,
    ClaudeAgentServiceV2,
    ImmigrationToolsService,
    TokenUsageService,
    StrategyEngineService,
  ],
})
export class ClaudeModule {}
