{
"event": "PreToolUse",
"tool_name": "Edit",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/AI\/AIResponse.php",
"old_string": "<?php\n\nnamespace Infrastructure\\AI;\n\nclass AIResponse",
"new_string": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\AI;\n\n\/\/ @responsibility: Datenstruktur für AI-Antworten mit Tokens und Metadaten\n\nclass AIResponse"
}
}
{
"tool_response": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/AI\/AIResponse.php",
"oldString": "<?php\n\nnamespace Infrastructure\\AI;\n\nclass AIResponse",
"newString": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\AI;\n\n\/\/ @responsibility: Datenstruktur für AI-Antworten mit Tokens und Metadaten\n\nclass AIResponse",
"originalFile": "<?php\n\nnamespace Infrastructure\\AI;\n\nclass AIResponse\n{\n private bool $success;\n private ?string $content;\n private ?string $errorMessage;\n private ?int $tokensInput;\n private ?int $tokensOutput;\n private ?int $durationMs;\n private string $model;\n private array $metadata;\n\n public function __construct(\n bool $success,\n ?string $content = null,\n ?string $errorMessage = null,\n ?int $tokensInput = null,\n ?int $tokensOutput = null,\n ?int $durationMs = null,\n string $model = '',\n array $metadata = []\n ) {\n $this->success = $success;\n $this->content = $content;\n $this->errorMessage = $errorMessage;\n $this->tokensInput = $tokensInput;\n $this->tokensOutput = $tokensOutput;\n $this->durationMs = $durationMs;\n $this->model = $model;\n $this->metadata = $metadata;\n }\n\n public static function success(\n string $content,\n ?int $tokensInput = null,\n ?int $tokensOutput = null,\n ?int $durationMs = null,\n string $model = '',\n array $metadata = []\n ): self {\n return new self(\n true,\n $content,\n null,\n $tokensInput,\n $tokensOutput,\n $durationMs,\n $model,\n $metadata\n );\n }\n\n public static function error(string $errorMessage, string $model = '', array $metadata = []): self\n {\n return new self(\n false,\n null,\n $errorMessage,\n null,\n null,\n null,\n $model,\n $metadata\n );\n }\n\n public function isSuccess(): bool\n {\n return $this->success;\n }\n\n public function getContent(): ?string\n {\n return $this->content;\n }\n\n public function getErrorMessage(): ?string\n {\n return $this->errorMessage;\n }\n\n public function getTokensInput(): ?int\n {\n return $this->tokensInput;\n }\n\n public function getTokensOutput(): ?int\n {\n return $this->tokensOutput;\n }\n\n public function getTokensTotal(): ?int\n {\n if ($this->tokensInput !== null && $this->tokensOutput !== null) {\n return $this->tokensInput + $this->tokensOutput;\n }\n\n return null;\n }\n\n public function getDurationMs(): ?int\n {\n return $this->durationMs;\n }\n\n public function getModel(): string\n {\n return $this->model;\n }\n\n public function getMetadata(): array\n {\n return $this->metadata;\n }\n\n public function toArray(): array\n {\n return [\n 'success' => $this->success,\n 'content' => $this->content,\n 'error_message' => $this->errorMessage,\n 'tokens_input' => $this->tokensInput,\n 'tokens_output' => $this->tokensOutput,\n 'tokens_total' => $this->getTokensTotal(),\n 'duration_ms' => $this->durationMs,\n 'model' => $this->model,\n 'metadata' => $this->metadata,\n ];\n }\n}\n",
"structuredPatch": [
{
"oldStart": 1,
"oldLines": 7,
"newStart": 1,
"newLines": 11,
"lines": [
" <?php",
" ",
"+declare(strict_types=1);",
"+",
" namespace Infrastructure\\AI;",
" ",
"+\/\/ @responsibility: Datenstruktur für AI-Antworten mit Tokens und Metadaten",
"+",
" class AIResponse",
" {",
" private bool $success;"
]
}
],
"userModified": false,
"replaceAll": false
}
}