{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/ContentController.php",
"offset": 165,
"limit": 80
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/ContentController.php",
"content": " 'title' => 'Auftrag bearbeiten',\n 'order' => $order,\n 'profiles' => $this->repository->findAllProfiles(),\n 'contracts' => $this->repository->findAllContracts(),\n 'structures' => $this->repository->findAllStructures(),\n ]);\n }\n\n \/**\n * POST \/content\/{id}\/generate - Start async content generation (HTMX)\n *\/\n public function generate(int $id): void\n {\n $this->requireCsrf();\n\n $command = GenerateContentCommand::fromRequest($id, $_POST);\n if (($errors = $command->validate()) !== []) {\n $this->htmxError(implode(' ', $errors));\n\n return;\n }\n\n $result = $this->collectionService->validateWithCompatibility([$command->collection]);\n if (!$result['valid']) {\n $this->htmxError($result['error'] ?? 'Collection-Fehler');\n\n return;\n }\n\n \/\/ Set status to generating and start async\n $this->repository->updateGenerationStatus($id, 'generating');\n $this->generateUseCase->generateAsync($id, $command->model, $result['collections'][0], $command->contextLimit);\n\n \/\/ Return polling partial\n $this->view('content.partials.generating', ['orderId' => $id]);\n }\n\n \/**\n * GET \/content\/{id}\/generation-status - Poll generation status (HTMX)\n *\/\n public function generationStatus(int $id): void\n {\n $order = $this->repository->findOrder($id);\n if ($order === null) {\n $this->htmxError('Auftrag nicht gefunden');\n\n return;\n }\n\n $status = $order['generation_status'] ?? 'idle';\n\n if ($status === 'completed') {\n $version = $this->repository->findLatestVersion($id);\n if ($version !== null) {\n \/\/ Reset status to idle after showing result\n $this->repository->updateGenerationStatus($id, 'idle');\n $this->renderVersionPartial([\n 'content' => $version['content'],\n 'sources' => $this->repository->findSourcesByOrder($id),\n 'version_number' => $version['version_number'],\n ]);\n\n return;\n }\n }\n\n if ($status === 'failed') {\n \/\/ Reset status after showing error\n $error = $order['generation_error'] ?? 'Unbekannter Fehler';\n $this->repository->updateGenerationStatus($id, 'idle');\n $this->htmxError('Generierung fehlgeschlagen: ' . $error);\n\n return;\n }\n\n if ($status === 'generating' || $status === 'queued') {\n \/\/ Still generating - return polling partial with log\n $this->view('content.partials.generating', [\n 'orderId' => $id,\n 'log' => $order['generation_log'] ?? '',",
"numLines": 80,
"startLine": 165,
"totalLines": 417
}
}
}