From 62536766e6edb04f8099db457c47aab47d836727 Mon Sep 17 00:00:00 2001 From: Juan Date: Sun, 10 May 2026 10:08:48 +0200 Subject: [PATCH] chore: scaffolding inicial del repo (pyproject, requirements, Makefile) Co-Authored-By: Claude Opus 4.7 --- .env.example | 27 ++++++++++++ Makefile | 40 ++++++++++++++++++ core/requirements.txt | 14 +++++++ core/src/agentforge_core/__init__.py | 0 core/src/agentforge_core/api/__init__.py | 0 core/src/agentforge_core/domain/__init__.py | 0 .../agentforge_core/guardrails/__init__.py | 0 core/src/agentforge_core/llm/__init__.py | 0 .../agentforge_core/observability/__init__.py | 0 core/src/agentforge_core/registry/__init__.py | 0 core/src/agentforge_core/runtime/__init__.py | 0 dashboard/requirements.txt | 4 ++ .../src/agentforge_dashboard/__init__.py | 0 .../components/__init__.py | 0 .../agentforge_dashboard/pages/__init__.py | 0 pyproject.toml | 42 +++++++++++++++++++ tests/__init__.py | 0 tests/integration/__init__.py | 0 tests/unit/__init__.py | 0 19 files changed, 127 insertions(+) create mode 100644 .env.example create mode 100644 Makefile create mode 100644 core/requirements.txt create mode 100644 core/src/agentforge_core/__init__.py create mode 100644 core/src/agentforge_core/api/__init__.py create mode 100644 core/src/agentforge_core/domain/__init__.py create mode 100644 core/src/agentforge_core/guardrails/__init__.py create mode 100644 core/src/agentforge_core/llm/__init__.py create mode 100644 core/src/agentforge_core/observability/__init__.py create mode 100644 core/src/agentforge_core/registry/__init__.py create mode 100644 core/src/agentforge_core/runtime/__init__.py create mode 100644 dashboard/requirements.txt create mode 100644 dashboard/src/agentforge_dashboard/__init__.py create mode 100644 dashboard/src/agentforge_dashboard/components/__init__.py create mode 100644 dashboard/src/agentforge_dashboard/pages/__init__.py create mode 100644 pyproject.toml create mode 100644 tests/__init__.py create mode 100644 tests/integration/__init__.py create mode 100644 tests/unit/__init__.py diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..54e906d --- /dev/null +++ b/.env.example @@ -0,0 +1,27 @@ +# Proveedor LLM activo. Valores: mock | azure | openai +LLM_PROVIDER=mock + +# Proveedor de fallback (opcional). VacĂ­o deshabilita fallback. +LLM_FALLBACK_PROVIDER= + +# Azure OpenAI (solo si LLM_PROVIDER=azure) +AZURE_OPENAI_ENDPOINT= +AZURE_OPENAI_API_KEY= +AZURE_OPENAI_DEPLOYMENT= +AZURE_OPENAI_API_VERSION=2024-08-01-preview + +# OpenAI (solo si LLM_PROVIDER=openai) +OPENAI_API_KEY= +OPENAI_MODEL=gpt-4o + +# Guardrails +GUARDRAILS_NEMO_ENABLED=false + +# Observabilidad +LOG_LEVEL=INFO + +# Persistencia +DATA_DIR=./data + +# URL del core (la usa el dashboard) +AGENTFORGE_CORE_URL=http://core:8000 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..87d082a --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +.PHONY: help install lint format test test-all smoke up down logs clean + +help: + @echo "Targets: install lint format test test-all smoke up down logs clean" + +install: + pip install -r core/requirements.txt -r dashboard/requirements.txt + pip install pytest pytest-asyncio ruff mypy freezegun + +lint: + ruff check core/src dashboard/src tests + mypy core/src + +format: + ruff format core/src dashboard/src tests + ruff check --fix core/src dashboard/src tests + +test: + pytest tests/unit -v + +test-all: + pytest -v + +smoke: + docker compose up -d + @sleep 5 + curl -fsS http://localhost:8000/health || (docker compose down && exit 1) + docker compose down + +up: + docker compose up + +down: + docker compose down + +logs: + docker compose logs -f + +clean: + rm -rf .pytest_cache .mypy_cache .ruff_cache __pycache__ data/*.sqlite data/*.jsonl diff --git a/core/requirements.txt b/core/requirements.txt new file mode 100644 index 0000000..2f5e1fd --- /dev/null +++ b/core/requirements.txt @@ -0,0 +1,14 @@ +fastapi>=0.115,<0.120 +uvicorn[standard]>=0.30,<0.32 +pydantic>=2.7,<3.0 +pydantic-settings>=2.4,<3.0 +structlog>=24.4,<25.0 +httpx>=0.27,<0.28 +langgraph>=0.2.50,<0.3 +langgraph-checkpoint-sqlite>=2.0,<3.0 +guardrails-ai>=0.5,<0.6 +presidio-analyzer>=2.2,<3.0 +presidio-anonymizer>=2.2,<3.0 +openai>=1.50,<2.0 +PyYAML>=6.0,<7.0 +nemoguardrails>=0.10,<0.12 diff --git a/core/src/agentforge_core/__init__.py b/core/src/agentforge_core/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/src/agentforge_core/api/__init__.py b/core/src/agentforge_core/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/src/agentforge_core/domain/__init__.py b/core/src/agentforge_core/domain/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/src/agentforge_core/guardrails/__init__.py b/core/src/agentforge_core/guardrails/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/src/agentforge_core/llm/__init__.py b/core/src/agentforge_core/llm/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/src/agentforge_core/observability/__init__.py b/core/src/agentforge_core/observability/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/src/agentforge_core/registry/__init__.py b/core/src/agentforge_core/registry/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/src/agentforge_core/runtime/__init__.py b/core/src/agentforge_core/runtime/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dashboard/requirements.txt b/dashboard/requirements.txt new file mode 100644 index 0000000..85290fd --- /dev/null +++ b/dashboard/requirements.txt @@ -0,0 +1,4 @@ +streamlit>=1.38,<2.0 +httpx>=0.27,<0.28 +pydantic>=2.7,<3.0 +PyYAML>=6.0,<7.0 diff --git a/dashboard/src/agentforge_dashboard/__init__.py b/dashboard/src/agentforge_dashboard/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dashboard/src/agentforge_dashboard/components/__init__.py b/dashboard/src/agentforge_dashboard/components/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dashboard/src/agentforge_dashboard/pages/__init__.py b/dashboard/src/agentforge_dashboard/pages/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2a4ffc3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,42 @@ +[build-system] +requires = ["setuptools>=68", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "agentforge" +version = "0.1.0" +description = "Plataforma profesional de gobernanza de agentes IA" +requires-python = ">=3.11" +authors = [{name = "Juan", email = "jm0x@proton.me"}] + +[tool.ruff] +line-length = 100 +target-version = "py311" + +[tool.ruff.lint] +select = ["E", "F", "W", "I", "N", "UP", "B", "C4", "SIM", "ASYNC", "RUF"] +ignore = ["E501"] + +[tool.ruff.lint.isort] +known-first-party = ["agentforge_core", "agentforge_dashboard"] + +[tool.mypy] +python_version = "3.11" +strict = true +warn_return_any = true +warn_unused_configs = true +disallow_untyped_defs = true +plugins = ["pydantic.mypy"] + +[[tool.mypy.overrides]] +module = ["guardrails.*", "presidio_analyzer.*", "nemoguardrails.*", "langgraph.*"] +ignore_missing_imports = true + +[tool.pytest.ini_options] +asyncio_mode = "auto" +testpaths = ["tests"] +addopts = "-ra -q --strict-markers" +pythonpath = ["core/src", "dashboard/src"] +markers = [ + "integration: integration tests (slower, may touch FS)", +] diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py new file mode 100644 index 0000000..e69de29