{
"event": "PreToolUse",
"tool_name": "Write",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/UseCases\/Chat\/GetChatSessionUseCase.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace UseCases\\Chat;\n\n\/\/ @responsibility: Retrieves chat session data\n\nuse Domain\\Entity\\ChatMessage;\nuse Domain\\Entity\\ChatSession;\nuse Domain\\Repository\\ChatMessageRepositoryInterface;\nuse Domain\\Repository\\ChatSessionRepositoryInterface;\nuse Domain\\Repository\\CollectionRepositoryInterface;\nuse Domain\\Repository\\ContentConfigRepositoryInterface;\n\nfinal class GetChatSessionUseCase implements GetChatSessionUseCaseInterface\n{\n private ?array $collectionsCache = null;\n\n public function __construct(\n private ChatSessionRepositoryInterface $sessionRepo,\n private ChatMessageRepositoryInterface $messageRepo,\n private ContentConfigRepositoryInterface $configRepo,\n private CollectionRepositoryInterface $collectionRepo\n ) {\n }\n\n public function getSession(string $uuid): ?ChatSession\n {\n return $this->sessionRepo->findByUuid($uuid);\n }\n\n \/**\n * @return array<int, ChatSession>\n *\/\n public function getAllSessions(int $limit = 50): array\n {\n return $this->sessionRepo->findAll($limit);\n }\n\n \/**\n * @return array<int, array<string, mixed>>\n *\/\n public function getAllSessionsWithStats(int $limit = 50): array\n {\n return $this->sessionRepo->findAllWithStats($limit);\n }\n\n \/**\n * @return array<int, ChatMessage>\n *\/\n public function getMessages(int $sessionId): array\n {\n return $this->messageRepo->findBySessionId($sessionId);\n }\n\n public function getAuthorProfiles(): array\n {\n return $this->configRepo->getAuthorProfiles();\n }\n\n public function getSystemPrompts(): array\n {\n return $this->configRepo->getSystemPrompts();\n }\n\n public function getOutputStructures(): array\n {\n return $this->configRepo->getStructures();\n }\n\n public function getStructure(int $id): ?array\n {\n return $this->configRepo->getStructure($id);\n }\n\n public function getAvailableCollections(): array\n {\n if ($this->collectionsCache === null) {\n $this->collectionsCache = $this->collectionRepo->getSearchable();\n\n if ($this->collectionsCache === []) {\n $this->collectionsCache = [\n ['collection_id' => 'documents', 'display_name' => 'Dokumente', 'points_count' => 0, 'vector_size' => 1024],\n ];\n }\n }\n\n return $this->collectionsCache;\n }\n\n public function getDefaultSystemPrompt(): string\n {\n return <<<'PROMPT'\n Du bist ein hilfreicher Assistent für Fragen zu systemischem Teamcoaching und Teamentwicklung.\n\n Beantworte die Frage des Nutzers basierend auf dem bereitgestellten Kontext.\n - Antworte auf Deutsch\n - Sei präzise und hilfreich\n - Wenn der Kontext die Frage nicht beantwortet, sage das ehrlich\n - Verweise auf die Quellen wenn passend\n PROMPT;\n }\n}\n"
}
}
{
"tool_response": {
"type": "create",
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/UseCases\/Chat\/GetChatSessionUseCase.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace UseCases\\Chat;\n\n\/\/ @responsibility: Retrieves chat session data\n\nuse Domain\\Entity\\ChatMessage;\nuse Domain\\Entity\\ChatSession;\nuse Domain\\Repository\\ChatMessageRepositoryInterface;\nuse Domain\\Repository\\ChatSessionRepositoryInterface;\nuse Domain\\Repository\\CollectionRepositoryInterface;\nuse Domain\\Repository\\ContentConfigRepositoryInterface;\n\nfinal class GetChatSessionUseCase implements GetChatSessionUseCaseInterface\n{\n private ?array $collectionsCache = null;\n\n public function __construct(\n private ChatSessionRepositoryInterface $sessionRepo,\n private ChatMessageRepositoryInterface $messageRepo,\n private ContentConfigRepositoryInterface $configRepo,\n private CollectionRepositoryInterface $collectionRepo\n ) {\n }\n\n public function getSession(string $uuid): ?ChatSession\n {\n return $this->sessionRepo->findByUuid($uuid);\n }\n\n \/**\n * @return array<int, ChatSession>\n *\/\n public function getAllSessions(int $limit = 50): array\n {\n return $this->sessionRepo->findAll($limit);\n }\n\n \/**\n * @return array<int, array<string, mixed>>\n *\/\n public function getAllSessionsWithStats(int $limit = 50): array\n {\n return $this->sessionRepo->findAllWithStats($limit);\n }\n\n \/**\n * @return array<int, ChatMessage>\n *\/\n public function getMessages(int $sessionId): array\n {\n return $this->messageRepo->findBySessionId($sessionId);\n }\n\n public function getAuthorProfiles(): array\n {\n return $this->configRepo->getAuthorProfiles();\n }\n\n public function getSystemPrompts(): array\n {\n return $this->configRepo->getSystemPrompts();\n }\n\n public function getOutputStructures(): array\n {\n return $this->configRepo->getStructures();\n }\n\n public function getStructure(int $id): ?array\n {\n return $this->configRepo->getStructure($id);\n }\n\n public function getAvailableCollections(): array\n {\n if ($this->collectionsCache === null) {\n $this->collectionsCache = $this->collectionRepo->getSearchable();\n\n if ($this->collectionsCache === []) {\n $this->collectionsCache = [\n ['collection_id' => 'documents', 'display_name' => 'Dokumente', 'points_count' => 0, 'vector_size' => 1024],\n ];\n }\n }\n\n return $this->collectionsCache;\n }\n\n public function getDefaultSystemPrompt(): string\n {\n return <<<'PROMPT'\n Du bist ein hilfreicher Assistent für Fragen zu systemischem Teamcoaching und Teamentwicklung.\n\n Beantworte die Frage des Nutzers basierend auf dem bereitgestellten Kontext.\n - Antworte auf Deutsch\n - Sei präzise und hilfreich\n - Wenn der Kontext die Frage nicht beantwortet, sage das ehrlich\n - Verweise auf die Quellen wenn passend\n PROMPT;\n }\n}\n",
"structuredPatch": [],
"originalFile": null
}
}