{
"event": "PreToolUse",
"tool_name": "Write",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/UseCases\/Chat\/ChatSessionDTO.php",
"content": "<?php\n\nnamespace UseCases\\Chat;\n\n\/**\n * ChatSessionDTO - Data Transfer Object for chat sessions\n *\n * Contains session data with messages for view rendering.\n *\/\nfinal class ChatSessionDTO\n{\n \/**\n * @param array<string,mixed> $session Session data from database\n * @param array<int,array<string,mixed>> $messages Messages for this session\n *\/\n public function __construct(\n private array $session,\n private array $messages = [],\n ) {\n }\n\n public function getId(): int\n {\n return (int) ($this->session['id'] ?? 0);\n }\n\n public function getUuid(): string\n {\n return $this->session['uuid'] ?? '';\n }\n\n public function getTitle(): ?string\n {\n return $this->session['title'] ?? null;\n }\n\n public function getModel(): string\n {\n return $this->session['model'] ?? 'claude-opus-4-5-20251101';\n }\n\n \/**\n * @return array<string>\n *\/\n public function getCollections(): array\n {\n $collections = $this->session['collections'] ?? '[\"documents\"]';\n $decoded = json_decode($collections, true);\n\n return is_array($decoded) ? $decoded : ['documents'];\n }\n\n public function getContextLimit(): int\n {\n return (int) ($this->session['context_limit'] ?? 5);\n }\n\n public function getAuthorProfileId(): int\n {\n return (int) ($this->session['author_profile_id'] ?? 0);\n }\n\n public function getSystemPromptId(): int\n {\n return (int) ($this->session['system_prompt_id'] ?? 1);\n }\n\n public function getTemperature(): float\n {\n return (float) ($this->session['temperature'] ?? 0.7);\n }\n\n public function getMaxTokens(): int\n {\n return (int) ($this->session['max_tokens'] ?? 4096);\n }\n\n public function getSystemPrompt(): ?string\n {\n return $this->session['system_prompt'] ?? null;\n }\n\n \/**\n * @return array<int,array<string,mixed>>\n *\/\n public function getMessages(): array\n {\n return $this->messages;\n }\n\n public function getMessageCount(): int\n {\n return count($this->messages);\n }\n\n \/**\n * Get raw session array for backwards compatibility\n *\n * @return array<string,mixed>\n *\/\n public function toArray(): array\n {\n return $this->session;\n }\n\n \/**\n * Check if session exists\n *\/\n public function exists(): bool\n {\n return $this->getId() > 0;\n }\n}\n"
}
}
{
"tool_response": {
"type": "create",
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/UseCases\/Chat\/ChatSessionDTO.php",
"content": "<?php\n\nnamespace UseCases\\Chat;\n\n\/**\n * ChatSessionDTO - Data Transfer Object for chat sessions\n *\n * Contains session data with messages for view rendering.\n *\/\nfinal class ChatSessionDTO\n{\n \/**\n * @param array<string,mixed> $session Session data from database\n * @param array<int,array<string,mixed>> $messages Messages for this session\n *\/\n public function __construct(\n private array $session,\n private array $messages = [],\n ) {\n }\n\n public function getId(): int\n {\n return (int) ($this->session['id'] ?? 0);\n }\n\n public function getUuid(): string\n {\n return $this->session['uuid'] ?? '';\n }\n\n public function getTitle(): ?string\n {\n return $this->session['title'] ?? null;\n }\n\n public function getModel(): string\n {\n return $this->session['model'] ?? 'claude-opus-4-5-20251101';\n }\n\n \/**\n * @return array<string>\n *\/\n public function getCollections(): array\n {\n $collections = $this->session['collections'] ?? '[\"documents\"]';\n $decoded = json_decode($collections, true);\n\n return is_array($decoded) ? $decoded : ['documents'];\n }\n\n public function getContextLimit(): int\n {\n return (int) ($this->session['context_limit'] ?? 5);\n }\n\n public function getAuthorProfileId(): int\n {\n return (int) ($this->session['author_profile_id'] ?? 0);\n }\n\n public function getSystemPromptId(): int\n {\n return (int) ($this->session['system_prompt_id'] ?? 1);\n }\n\n public function getTemperature(): float\n {\n return (float) ($this->session['temperature'] ?? 0.7);\n }\n\n public function getMaxTokens(): int\n {\n return (int) ($this->session['max_tokens'] ?? 4096);\n }\n\n public function getSystemPrompt(): ?string\n {\n return $this->session['system_prompt'] ?? null;\n }\n\n \/**\n * @return array<int,array<string,mixed>>\n *\/\n public function getMessages(): array\n {\n return $this->messages;\n }\n\n public function getMessageCount(): int\n {\n return count($this->messages);\n }\n\n \/**\n * Get raw session array for backwards compatibility\n *\n * @return array<string,mixed>\n *\/\n public function toArray(): array\n {\n return $this->session;\n }\n\n \/**\n * Check if session exists\n *\/\n public function exists(): bool\n {\n return $this->getId() > 0;\n }\n}\n",
"structuredPatch": [],
"originalFile": null
}
}