{
"event": "PreToolUse",
"tool_name": "Edit",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/AI\/ModelConfig.php",
"old_string": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\AI;\n\n\/**\n * Central configuration for available AI models.\n * Used by Chat, Content Studio, and other AI-powered features.\n *\n * NOW READS FROM DATABASE via ModelRegistry (Single Source of Truth).\n * Legacy static interface preserved for backward compatibility.\n *\/\nfinal class ModelConfig",
"new_string": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\AI;\n\n\/\/ @responsibility: Legacy-Interface für Modell-Konfiguration (delegiert an ModelRegistry)\n\nfinal class ModelConfig"
}
}
{
"tool_response": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/AI\/ModelConfig.php",
"oldString": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\AI;\n\n\/**\n * Central configuration for available AI models.\n * Used by Chat, Content Studio, and other AI-powered features.\n *\n * NOW READS FROM DATABASE via ModelRegistry (Single Source of Truth).\n * Legacy static interface preserved for backward compatibility.\n *\/\nfinal class ModelConfig",
"newString": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\AI;\n\n\/\/ @responsibility: Legacy-Interface für Modell-Konfiguration (delegiert an ModelRegistry)\n\nfinal class ModelConfig",
"originalFile": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\AI;\n\n\/**\n * Central configuration for available AI models.\n * Used by Chat, Content Studio, and other AI-powered features.\n *\n * NOW READS FROM DATABASE via ModelRegistry (Single Source of Truth).\n * Legacy static interface preserved for backward compatibility.\n *\/\nfinal class ModelConfig\n{\n \/**\n * Get all available chat models.\n *\n * @return array<string, string> [model_key => display_name]\n *\/\n public static function getAll(): array\n {\n return ModelRegistry::getInstance()->getChatModels();\n }\n\n \/**\n * Get vision-capable models.\n *\n * @return array<string, string> [model_key => display_name]\n *\/\n public static function getVisionModels(): array\n {\n return ModelRegistry::getInstance()->getVisionModels();\n }\n\n \/**\n * Get display label for a model ID.\n *\/\n public static function getLabel(string $modelId): string\n {\n return ModelRegistry::getInstance()->getLabel($modelId);\n }\n\n \/**\n * Check if a model ID is valid.\n *\/\n public static function isValid(string $modelId): bool\n {\n $registry = ModelRegistry::getInstance();\n\n \/\/ Check in registry first\n if ($registry->isValid($modelId)) {\n return true;\n }\n\n \/\/ Fallback: accept any claude- or ollama: prefixed model\n return str_starts_with($modelId, 'claude-')\n || str_starts_with($modelId, 'ollama:');\n }\n\n \/**\n * Validate and return model, or default if invalid.\n *\/\n public static function validate(string $modelId): string\n {\n return self::isValid($modelId) ? $modelId : self::getDefaultModel();\n }\n\n \/**\n * Check if model is a local (Ollama) model.\n *\/\n public static function isLocal(string $modelId): bool\n {\n return str_starts_with($modelId, 'ollama:');\n }\n\n \/**\n * Get default chat model.\n *\/\n public static function getDefaultModel(): string\n {\n return ModelRegistry::getInstance()->getDefaultChatModel();\n }\n\n \/**\n * Get default vision model.\n *\/\n public static function getDefaultVisionModel(): string\n {\n return ModelRegistry::getInstance()->getDefaultVisionModel();\n }\n\n \/**\n * Force refresh of model cache (e.g., after Ollama sync).\n *\/\n public static function clearCache(): void\n {\n ModelRegistry::clearCache();\n }\n\n \/**\n * Sync models from Ollama.\n *\n * @return array Sync results\n *\/\n public static function syncFromOllama(): array\n {\n return ModelRegistry::getInstance()->syncFromOllama();\n }\n}\n",
"structuredPatch": [
{
"oldStart": 4,
"oldLines": 13,
"newStart": 4,
"newLines": 8,
"lines": [
" ",
" namespace Infrastructure\\AI;",
" ",
"-\/**",
"- * Central configuration for available AI models.",
"- * Used by Chat, Content Studio, and other AI-powered features.",
"- *",
"- * NOW READS FROM DATABASE via ModelRegistry (Single Source of Truth).",
"- * Legacy static interface preserved for backward compatibility.",
"- *\/",
"+\/\/ @responsibility: Legacy-Interface für Modell-Konfiguration (delegiert an ModelRegistry)",
"+",
" final class ModelConfig",
" {",
" \/**"
]
}
],
"userModified": false,
"replaceAll": false
}
}