{
"event": "PreToolUse",
"tool_name": "Edit",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/ServiceProvider\/ChatServiceProvider.php",
"old_string": "use Domain\\Repository\\ChatMessageRepositoryInterface;\nuse Domain\\Repository\\ChatSessionRepositoryInterface;\nuse Domain\\Repository\\PromptsRepositoryInterface;\nuse Framework\\Container;",
"new_string": "use Domain\\Repository\\ChatMessageRepositoryInterface;\nuse Domain\\Repository\\ChatSessionRepositoryInterface;\nuse Domain\\Repository\\ContentConfigRepositoryInterface;\nuse Domain\\Repository\\PromptsRepositoryInterface;\nuse Domain\\Service\\ModelRegistryInterface;\nuse Framework\\Container;"
}
}
{
"tool_response": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/ServiceProvider\/ChatServiceProvider.php",
"oldString": "use Domain\\Repository\\ChatMessageRepositoryInterface;\nuse Domain\\Repository\\ChatSessionRepositoryInterface;\nuse Domain\\Repository\\PromptsRepositoryInterface;\nuse Framework\\Container;",
"newString": "use Domain\\Repository\\ChatMessageRepositoryInterface;\nuse Domain\\Repository\\ChatSessionRepositoryInterface;\nuse Domain\\Repository\\ContentConfigRepositoryInterface;\nuse Domain\\Repository\\PromptsRepositoryInterface;\nuse Domain\\Service\\ModelRegistryInterface;\nuse Framework\\Container;",
"originalFile": "<?php\n\ndeclare(strict_types=1);\n\n\/\/ @responsibility: Register Chat bounded context services in DI container\n\nnamespace ServiceProvider;\n\nuse Domain\\Repository\\ChatMessageRepositoryInterface;\nuse Domain\\Repository\\ChatSessionRepositoryInterface;\nuse Domain\\Repository\\PromptsRepositoryInterface;\nuse Framework\\Container;\nuse Infrastructure\\AI\\AIConfig;\nuse Infrastructure\\AI\\ChatService;\nuse Infrastructure\\AI\\ContentQualityValidator;\nuse Infrastructure\\AI\\ModelRegistry;\nuse Infrastructure\\AI\\OllamaService;\nuse Infrastructure\\AI\\QdrantClient;\nuse Infrastructure\\AI\\QdrantService;\nuse Infrastructure\\AI\\VectorSearchService;\nuse Infrastructure\\Formatting\\ChatMessageFormatter;\nuse Infrastructure\\Persistence\\ChatMessageRepository;\nuse Infrastructure\\Persistence\\ChatSessionRepository;\nuse Infrastructure\\Persistence\\ContentConfigRepository;\nuse Infrastructure\\Persistence\\CriticsRepository;\nuse Infrastructure\\Persistence\\PromptsRepository;\nuse UseCases\\Chat\\ManageChatSessionsUseCase;\n\n\/**\n * ChatServiceProvider registers all chat and AI-related services.\n *\/\nfinal class ChatServiceProvider implements ServiceProviderInterface\n{\n public function register(Container $container): void\n {\n \/\/ Repositories\n $container->set(ChatSessionRepository::class, fn (Container $c) => new ChatSessionRepository($c->get('pdo.content')));\n $container->set(ChatMessageRepository::class, fn (Container $c) => new ChatMessageRepository($c->get('pdo.content')));\n $container->set(PromptsRepository::class, fn (Container $c) => new PromptsRepository($c->get('pdo.content')));\n $container->set(CriticsRepository::class, fn (Container $c) => new CriticsRepository($c->get('pdo.content')));\n $container->set(ContentConfigRepository::class, fn (Container $c) => new ContentConfigRepository($c->get('pdo.content')));\n\n \/\/ Interface aliases\n $container->set(ChatSessionRepositoryInterface::class, fn (Container $c) => $c->get(ChatSessionRepository::class));\n $container->set(ChatMessageRepositoryInterface::class, fn (Container $c) => $c->get(ChatMessageRepository::class));\n $container->set(PromptsRepositoryInterface::class, fn (Container $c) => $c->get(PromptsRepository::class));\n\n \/\/ AI Services\n $container->set(AIConfig::class, fn () => AIConfig::fromCredentialsFile());\n $container->set(ChatService::class, fn (Container $c) => $c->get(AIConfig::class)->createChatService());\n $container->set(OllamaService::class, fn (Container $c) => $c->get(AIConfig::class)->createOllamaService());\n $container->set(QdrantService::class, fn (Container $c) => $c->get(AIConfig::class)->createQdrantService());\n $container->set(VectorSearchService::class, fn () => new VectorSearchService());\n $container->set(QdrantClient::class, fn () => new QdrantClient());\n\n $container->set(ContentQualityValidator::class, function (Container $c) {\n return new ContentQualityValidator($c->get(OllamaService::class));\n });\n\n $container->set(ModelRegistry::class, function (Container $c) {\n $registry = new ModelRegistry($c->get('pdo.dev'));\n ModelRegistry::setInstance($registry);\n\n return $registry;\n });\n\n \/\/ Formatters\n $container->set(ChatMessageFormatter::class, fn () => new ChatMessageFormatter());\n\n \/\/ Use Cases\n $container->set(ManageChatSessionsUseCase::class, function (Container $c) {\n return new ManageChatSessionsUseCase(\n $c->get(ChatSessionRepositoryInterface::class),\n $c->get(ChatMessageRepositoryInterface::class),\n $c->get(ContentConfigRepository::class),\n $c->get(\\Domain\\Repository\\CollectionRepositoryInterface::class),\n $c->get(\\Infrastructure\\Validation\\CollectionValidator::class),\n $c->get('pdo.dev'),\n $c->get(ModelRegistry::class)\n );\n });\n }\n}\n",
"structuredPatch": [
{
"oldStart": 8,
"oldLines": 7,
"newStart": 8,
"newLines": 9,
"lines": [
" ",
" use Domain\\Repository\\ChatMessageRepositoryInterface;",
" use Domain\\Repository\\ChatSessionRepositoryInterface;",
"+use Domain\\Repository\\ContentConfigRepositoryInterface;",
" use Domain\\Repository\\PromptsRepositoryInterface;",
"+use Domain\\Service\\ModelRegistryInterface;",
" use Framework\\Container;",
" use Infrastructure\\AI\\AIConfig;",
" use Infrastructure\\AI\\ChatService;"
]
}
],
"userModified": false,
"replaceAll": false
}
}