{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/chat\/partials\/message.php"
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/chat\/partials\/message.php",
"content": "<?php\n\/**\n * Chat Message Partial\n *\n * @var array $message Message data from database\n * @var bool $formatContent Whether to apply markdown formatting (default: true for assistant)\n *\/\n\n$role = $message['role'] ?? 'user';\n$content = $message['content'] ?? '';\n$sources = [];\nif (!empty($message['sources'])) {\n $decoded = json_decode($message['sources'], true);\n $sources = is_array($decoded) ? $decoded : [];\n}\n\n$inputTokens = (int) ($message['tokens_input'] ?? 0);\n$outputTokens = (int) ($message['tokens_output'] ?? 0);\n$model = $message['model'] ?? 'claude-opus-4-5-20251101';\n$isOllama = str_starts_with($model, 'ollama:');\n$modelLabel = $isOllama ? substr($model, 7) : $model;\n$cost = ($inputTokens * 0.000015) + ($outputTokens * 0.000075);\n?>\n<div class=\"chat-message chat-message--<?= htmlspecialchars($role) ?>\">\n <div class=\"message-content\">\n <?php if ($role === 'user'): ?>\n <?= htmlspecialchars($content) ?>\n <?php else: ?>\n <?= nl2br(htmlspecialchars($content)) ?>\n <?php if (!empty($sources)): ?>\n <?php $uniqueId = 'sources-' . ($message['id'] ?? uniqid()); ?>\n <div class=\"chat-sources chat-sources--collapsed\" id=\"<?= $uniqueId ?>\">\n <button type=\"button\" class=\"chat-sources__toggle\" onclick=\"toggleSources('<?= $uniqueId ?>')\">\n <span class=\"chat-sources__count\"><?= count($sources) ?> Quelle<?= count($sources) > 1 ? 'n' : '' ?><\/span>\n <span class=\"chat-sources__arrow\">▼<\/span>\n <\/button>\n <div class=\"chat-sources__list\">\n <?php foreach ($sources as $source): ?>\n <div class=\"source-item\">\n <div class=\"source-item__header\">\n <span class=\"source-item__title\"><?= htmlspecialchars($source['title'] ?? 'Unbekannt') ?><\/span>\n <span class=\"source-item__score\"><?= round(($source['score'] ?? 0) * 100) ?>%<\/span>\n <\/div>\n <?php if (!empty($source['content'])): ?>\n <div class=\"source-item__content\">\"<?= htmlspecialchars(mb_substr($source['content'], 0, 200)) ?><?= mb_strlen($source['content']) > 200 ? '...' : '' ?>\"<\/div>\n <?php endif; ?>\n <\/div>\n <?php endforeach; ?>\n <\/div>\n <\/div>\n <?php endif; ?>\n <div class=\"message-meta\">\n <span class=\"model-info\">Modell: <?= htmlspecialchars($modelLabel) ?><\/span>\n <?php if (!$isOllama && ($inputTokens > 0 || $outputTokens > 0)): ?>\n <span class=\"tokens-info\">\n <span class=\"tokens-input\" title=\"Input-Tokens\">↓<?= number_format($inputTokens) ?><\/span>\n <span class=\"tokens-output\" title=\"Output-Tokens\">↑<?= number_format($outputTokens) ?><\/span>\n <\/span>\n <span class=\"cost-info\" title=\"Geschätzte Kosten\">~$<?= number_format($cost, 4) ?><\/span>\n <?php elseif ($isOllama): ?>\n <span class=\"tokens-info local\">lokal<\/span>\n <?php endif; ?>\n <\/div>\n <?php endif; ?>\n <\/div>\n<\/div>\n",
"numLines": 67,
"startLine": 1,
"totalLines": 67
}
}
}