set('pdo.dev', fn () => DatabaseFactory::dev()); // ki_content database connection $container->set('pdo.content', fn () => DatabaseFactory::content()); // ========================================================================= // REPOSITORIES - ki_dev database // ========================================================================= $container->set(SystemExplorerRepository::class, fn () => new SystemExplorerRepository()); $container->set(DokumentationRepository::class, fn () => new DokumentationRepository()); $container->set(FileBackupRepository::class, fn () => new FileBackupRepository()); $container->set(ContractRepository::class, fn () => new ContractRepository()); $container->set(TaskRepository::class, fn () => new TaskRepository()); $container->set(TaskAssignmentRepository::class, fn () => new TaskAssignmentRepository()); $container->set(TaskResultRepository::class, fn () => new TaskResultRepository()); $container->set(TaskCommentRepository::class, fn () => new TaskCommentRepository()); $container->set(KiProtokollRepository::class, fn () => new KiProtokollRepository()); $container->set(CollectionRepository::class, fn () => new CollectionRepository()); $container->set(PipelineRepository::class, fn () => new PipelineRepository()); // ========================================================================= // REPOSITORIES - ki_content database // ========================================================================= $container->set(ContentRepository::class, fn () => new ContentRepository()); $container->set(SemanticExplorerRepository::class, fn () => new SemanticExplorerRepository()); $container->set(ChatSessionRepository::class, fn () => new ChatSessionRepository()); $container->set(ChatMessageRepository::class, fn () => new ChatMessageRepository()); $container->set(PromptsRepository::class, fn () => new PromptsRepository()); $container->set(CriticsRepository::class, fn () => new CriticsRepository()); $container->set(ContentConfigRepository::class, fn () => new ContentConfigRepository()); // ========================================================================= // INTERFACE ALIASES (Domain → Infrastructure) // ========================================================================= $container->set(TaskRepositoryInterface::class, fn (Container $c) => $c->get(TaskRepository::class)); $container->set(ChatSessionRepositoryInterface::class, fn (Container $c) => $c->get(ChatSessionRepository::class)); $container->set(ChatMessageRepositoryInterface::class, fn (Container $c) => $c->get(ChatMessageRepository::class)); $container->set(CollectionRepositoryInterface::class, fn (Container $c) => $c->get(CollectionRepository::class)); $container->set(PipelineRepositoryInterface::class, fn (Container $c) => $c->get(PipelineRepository::class)); $container->set(ContentRepositoryInterface::class, fn (Container $c) => $c->get(ContentRepository::class)); $container->set(DokumentationRepositoryInterface::class, fn (Container $c) => $c->get(DokumentationRepository::class)); // ========================================================================= // AI SERVICES // ========================================================================= $container->set(AIConfig::class, fn () => AIConfig::fromCredentialsFile()); $container->set(ChatService::class, function (Container $c) { return $c->get(AIConfig::class)->createChatService(); }); $container->set(OllamaService::class, function (Container $c) { return $c->get(AIConfig::class)->createOllamaService(); }); $container->set(QdrantService::class, function (Container $c) { return $c->get(AIConfig::class)->createQdrantService(); }); $container->set(VectorSearchService::class, fn () => new VectorSearchService()); $container->set(ContentQualityValidator::class, function (Container $c) { return new ContentQualityValidator($c->get(OllamaService::class)); }); $container->set(ModelRegistry::class, function (Container $c) { return new ModelRegistry($c->get('pdo.dev')); }); // ========================================================================= // APPLICATION SERVICES // ========================================================================= $container->set(AuditLogger::class, fn () => new AuditLogger()); $container->set(ChunkSyncService::class, function (Container $c) { return new ChunkSyncService( $c->get('pdo.dev'), $c->get(OllamaService::class) ); }); $container->set(HybridSearchService::class, function (Container $c) { return new HybridSearchService( $c->get('pdo.dev'), $c->get(OllamaService::class) ); }); $container->set(ChunkAnalysisService::class, function (Container $c) { return new ChunkAnalysisService( $c->get('pdo.dev'), $c->get(OllamaService::class) ); }); $container->set(ChunkingService::class, function (Container $c) { return new ChunkingService( $c->get('pdo.dev'), $c->get(DokumentationRepository::class) ); }); $container->set(CollectionValidator::class, function (Container $c) { return new CollectionValidator($c->get(CollectionRepository::class)); }); $container->set(ContentCollectionService::class, function (Container $c) { return new ContentCollectionService( $c->get(CollectionRepository::class), $c->get(CollectionValidator::class) ); }); $container->set(PipelineStepService::class, function (Container $c) { return new PipelineStepService($c->get(PipelineRepository::class)); }); // ========================================================================= // FORMATTERS // ========================================================================= $container->set(ApiResponseFormatter::class, fn () => new ApiResponseFormatter()); $container->set(ChatMessageFormatter::class, fn () => new ChatMessageFormatter()); // ========================================================================= // USE CASES - Resolved via Autowiring // ========================================================================= // All UseCases are automatically resolved by Container::autowire(). // Dependencies are injected based on constructor type-hints. // No explicit registration needed - just ensure: // 1. All interface dependencies have aliases registered above // 2. All concrete dependencies are registered or autowirable };