{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/chat\/index.php",
"offset": 630,
"limit": 100
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/chat\/index.php",
"content": " }\n } catch (err) {\n progressContainer.innerHTML = '<div class=\"chat-error\">Verbindungsfehler: ' + escapeHtml(err.message) + '<\/div>';\n }\n\n messageInput.value = '';\n messageInput.focus();\n sendBtn.disabled = false;\n sendBtn.classList.remove('chat-send--loading');\n htmx.ajax('GET', '\/chat\/sessions?current=<?= $session['uuid'] ?? '' ?>', '#session-list');\n});\n\nfunction escapeHtml(text) {\n const div = document.createElement('div');\n div.textContent = text;\n return div.innerHTML;\n}\n\n\/\/ Scroll to bottom on load\nmessages.scrollTop = messages.scrollHeight;\n\n\/\/ Close sidebar on mobile when clicking main\ndocument.querySelector('.chat-main').addEventListener('click', (e) => {\n if (window.innerWidth <= 768 && !e.target.closest('.chat-toggle')) {\n sidebar.classList.remove('chat-sidebar--open');\n overlay.classList.remove('chat-overlay--visible');\n }\n});\n\n\/\/ Config Panel\nconst configPanel = document.getElementById('configPanel');\nconst configPanelToggle = document.getElementById('configPanelToggle');\nconst configPanelClose = document.getElementById('configPanelClose');\n\nconfigPanelToggle.addEventListener('click', () => {\n const isOpen = configPanel.classList.toggle('config-panel--open');\n configPanelToggle.setAttribute('aria-expanded', isOpen);\n});\n\nconfigPanelClose.addEventListener('click', () => {\n configPanel.classList.remove('config-panel--open');\n configPanelToggle.setAttribute('aria-expanded', 'false');\n});\n\n\/\/ Sync Config Panel dropdowns with hidden inputs\ndocument.getElementById('configSystemPrompt').addEventListener('change', function() {\n document.getElementById('hiddenSystemPrompt').value = this.value;\n});\ndocument.getElementById('configStructure').addEventListener('change', function() {\n document.getElementById('hiddenStructure').value = this.value;\n});\ndocument.getElementById('configAuthorProfile').addEventListener('change', function() {\n document.getElementById('hiddenAuthorProfile').value = this.value;\n});\n\n\/\/ Config Panel toggle editors\ndocument.querySelectorAll('.config-panel__toggle').forEach(btn => {\n btn.addEventListener('click', async function() {\n const configType = this.dataset.configType;\n const editorId = this.getAttribute('aria-controls');\n const editor = document.getElementById(editorId);\n const isOpen = !editor.classList.contains('config-panel__editor--hidden');\n\n if (isOpen) {\n editor.classList.add('config-panel__editor--hidden');\n editor.setAttribute('aria-hidden', 'true');\n this.setAttribute('aria-expanded', 'false');\n } else {\n \/\/ Load content from API\n const selectId = configType === 'system_prompt' ? 'configSystemPrompt' :\n configType === 'structure' ? 'configStructure' : 'configAuthorProfile';\n const selectedId = document.getElementById(selectId).value;\n\n if (selectedId && selectedId !== '0') {\n try {\n const resp = await fetch('\/api\/v1\/config\/' + selectedId);\n const data = await resp.json();\n if (data.content) {\n const textareaId = configType === 'system_prompt' ? 'systemPromptContent' :\n configType === 'structure' ? 'structureContent' : 'authorProfileContent';\n const versionId = configType === 'system_prompt' ? 'systemPromptVersion' :\n configType === 'structure' ? 'structureVersion' : 'authorProfileVersion';\n \/\/ Format JSON nicely\n let formatted = data.content;\n try {\n const parsed = JSON.parse(data.content);\n formatted = JSON.stringify(parsed, null, 2);\n } catch (e) {}\n document.getElementById(textareaId).value = formatted;\n document.getElementById(versionId).textContent = 'v' + (data.version || '1.0');\n }\n } catch (e) {\n console.error('Config load error:', e);\n }\n }\n\n editor.classList.remove('config-panel__editor--hidden');\n editor.setAttribute('aria-hidden', 'false');\n this.setAttribute('aria-expanded', 'true');\n }",
"numLines": 100,
"startLine": 630,
"totalLines": 816
}
}
}