refactor: добавить агентную архитектуру, UI и CLI

- src/agent/solve_tools.py: новые LLM-субагенты validate_teacher_comment и
  generate_code_solution — агент сам решает когда их вызывать
- src/agent/solve_prompts.py: централизованные промпты для субагентов решения
- src/agent/gitea_tools.py: добавлен gitea_list_files для чтения файлов репо
- src/agent/agent.py: SOLVE_TOOLS подключены к homework_direct_agent и rework_agent
- src/agent/prompts.py: промпты переработаны в capability-based формат (без жёстких шагов)
- cli.py: единая точка входа (solve / run / status)
- ui.py: Streamlit UI с реал-тайм отображением вызовов инструментов
- requirements.txt: добавлен streamlit>=1.35.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 16:43:00 +03:00
parent bb1aedfe2a
commit 3ae3488691
8 changed files with 1260 additions and 566 deletions
+27
View File
@@ -172,9 +172,36 @@ def gitea_get_file(repo: str, path: str, owner: str = GITEA_OWNER) -> str:
return f"Ошибка: {e}"
@tool()
def gitea_list_files(repo: str, owner: str = GITEA_OWNER) -> str:
"""Список файлов в корне репозитория на git.brojs.ru.
Args:
repo: имя репозитория (например task-abc123)
owner: владелец репозитория (по умолчанию glevelll)
"""
try:
result = _get(f"/api/v1/repos/{owner}/{repo}/contents")
files = [item["name"] for item in result if item.get("type") == "file"]
dirs = [item["name"] for item in result if item.get("type") == "dir"]
parts = []
if files:
parts.append(f"Файлы: {', '.join(files)}")
if dirs:
parts.append(f"Папки: {', '.join(dirs)}")
return "\n".join(parts) if parts else f"Репозиторий {owner}/{repo} пуст"
except httpx.HTTPStatusError as e:
if e.response.status_code == 404:
return f"Репозиторий {owner}/{repo} не найден (первая сдача)"
return f"Ошибка: {e.response.text}"
except Exception as e:
return f"Ошибка: {e}"
# Список всех gitea-инструментов для удобного импорта
GITEA_TOOLS = [
gitea_list_repos,
gitea_list_files,
gitea_create_repo,
gitea_write_file,
gitea_get_file,