{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/chat\/index.php",
"offset": 398,
"limit": 30
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/chat\/index.php",
"content": " const response = await fetch('\/chat\/<?= $session['uuid'] ?? '' ?>\/message\/stream', {\n method: 'POST',\n body: formData\n });\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let buffer = '';\n\n while (true) {\n const {value, done} = await reader.read();\n if (done) break;\n\n buffer += decoder.decode(value, {stream: true});\n const lines = buffer.split('\\n');\n buffer = lines.pop() || '';\n\n for (const line of lines) {\n if (line.startsWith('event: ')) {\n const eventType = line.substring(7);\n continue;\n }\n if (line.startsWith('data: ')) {\n try {\n const data = JSON.parse(line.substring(6));\n\n if (data.ts && data.msg && data.step) {\n \/\/ Check if this is a start event or completion event\n const isComplete = data.step.endsWith('_done') || data.step === 'complete' || data.step === 'error';\n",
"numLines": 30,
"startLine": 398,
"totalLines": 533
}
}
}