import { Module } from '@nestjs/common';
import { OutboxModule } from '../outbox/outbox.module';
import { INFERENCE_PORT, LocalDeterministicInference } from './inference.port';
import { AiBudgetGuard } from './ai-budget.guard';
import { AiJobService } from './ai.service';
import { AiProjector } from './ai.projector';
import { AiController } from './ai.controller';

/**
 * AI Interaction SDK (P7). Proposal layer only. `INFERENCE_PORT` binds the local
 * deterministic golden provider for `nest start`; specs inject the testkit fake.
 */
@Module({
  imports: [OutboxModule],
  controllers: [AiController],
  providers: [
    { provide: INFERENCE_PORT, useClass: LocalDeterministicInference },
    AiBudgetGuard,
    AiJobService,
    AiProjector,
  ],
  exports: [AiJobService, AiBudgetGuard],
})
export class AiModule {}
