{
"event": "PreToolUse",
"tool_name": "Edit",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Domain\/Repository\/KiProtokollRepositoryInterface.php",
"old_string": " public function findPreviousId(int $id): ?int;\n\n public function findNextId(int $id): ?int;\n}",
"new_string": " public function findPreviousId(int $id): ?int;\n\n public function findNextId(int $id): ?int;\n\n \/**\n * Insert new protokoll entry with status 'pending'.\n * Sets request_timestamp = NOW(6).\n *\n * @return int The inserted ID\n *\/\n public function insert(\n string $clientName,\n string $request,\n string $model,\n string $requestIp\n ): int;\n\n \/**\n * Complete a pending protokoll entry with response data.\n * Sets response_timestamp = NOW(6), calculates tokens_total.\n *\/\n public function complete(\n int $id,\n string $response,\n int $durationMs,\n ?int $tokensInput,\n ?int $tokensOutput\n ): void;\n\n \/**\n * Mark a protokoll entry as failed with error message.\n *\/\n public function fail(int $id, string $errorMessage): void;\n\n \/**\n * Mark stale 'pending' entries as 'error'.\n *\n * @param int $minutesOld Age threshold in minutes (default: 10)\n * @return int Number of affected rows\n *\/\n public function cleanupStale(int $minutesOld = 10): int;\n}"
}
}
{
"tool_response": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Domain\/Repository\/KiProtokollRepositoryInterface.php",
"oldString": " public function findPreviousId(int $id): ?int;\n\n public function findNextId(int $id): ?int;\n}",
"newString": " public function findPreviousId(int $id): ?int;\n\n public function findNextId(int $id): ?int;\n\n \/**\n * Insert new protokoll entry with status 'pending'.\n * Sets request_timestamp = NOW(6).\n *\n * @return int The inserted ID\n *\/\n public function insert(\n string $clientName,\n string $request,\n string $model,\n string $requestIp\n ): int;\n\n \/**\n * Complete a pending protokoll entry with response data.\n * Sets response_timestamp = NOW(6), calculates tokens_total.\n *\/\n public function complete(\n int $id,\n string $response,\n int $durationMs,\n ?int $tokensInput,\n ?int $tokensOutput\n ): void;\n\n \/**\n * Mark a protokoll entry as failed with error message.\n *\/\n public function fail(int $id, string $errorMessage): void;\n\n \/**\n * Mark stale 'pending' entries as 'error'.\n *\n * @param int $minutesOld Age threshold in minutes (default: 10)\n * @return int Number of affected rows\n *\/\n public function cleanupStale(int $minutesOld = 10): int;\n}",
"originalFile": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Domain\\Repository;\n\n\/\/ @responsibility: Contract für KI-Protokoll-Persistenz\n\ninterface KiProtokollRepositoryInterface\n{\n \/**\n * @return array<string, mixed>|null\n *\/\n public function findById(int $id): ?array;\n\n \/**\n * @return array<array<string, mixed>>\n *\/\n public function findLatest(int $limit = 20): array;\n\n \/**\n * @return array<array<string, mixed>>\n *\/\n public function findPaginated(\n ?string $search = null,\n ?string $status = null,\n ?string $model = null,\n int $limit = 50,\n int $offset = 0\n ): array;\n\n public function countFiltered(?string $search = null, ?string $status = null, ?string $model = null): int;\n\n \/**\n * @return array<string, mixed>\n *\/\n public function getStatistics(): array;\n\n \/**\n * @return array<string>\n *\/\n public function getDistinctModels(): array;\n\n public function findPreviousId(int $id): ?int;\n\n public function findNextId(int $id): ?int;\n}\n",
"structuredPatch": [
{
"oldStart": 44,
"oldLines": 4,
"newStart": 44,
"newLines": 42,
"lines": [
" public function findPreviousId(int $id): ?int;",
" ",
" public function findNextId(int $id): ?int;",
"+",
"+ \/**",
"+ * Insert new protokoll entry with status 'pending'.",
"+ * Sets request_timestamp = NOW(6).",
"+ *",
"+ * @return int The inserted ID",
"+ *\/",
"+ public function insert(",
"+ string $clientName,",
"+ string $request,",
"+ string $model,",
"+ string $requestIp",
"+ ): int;",
"+",
"+ \/**",
"+ * Complete a pending protokoll entry with response data.",
"+ * Sets response_timestamp = NOW(6), calculates tokens_total.",
"+ *\/",
"+ public function complete(",
"+ int $id,",
"+ string $response,",
"+ int $durationMs,",
"+ ?int $tokensInput,",
"+ ?int $tokensOutput",
"+ ): void;",
"+",
"+ \/**",
"+ * Mark a protokoll entry as failed with error message.",
"+ *\/",
"+ public function fail(int $id, string $errorMessage): void;",
"+",
"+ \/**",
"+ * Mark stale 'pending' entries as 'error'.",
"+ *",
"+ * @param int $minutesOld Age threshold in minutes (default: 10)",
"+ * @return int Number of affected rows",
"+ *\/",
"+ public function cleanupStale(int $minutesOld = 10): int;",
" }"
]
}
],
"userModified": false,
"replaceAll": false
}
}