feat: Add intelligent auto-router and enhanced integrations
- Add intelligent-router.sh hook for automatic agent routing - Add AUTO-TRIGGER-SUMMARY.md documentation - Add FINAL-INTEGRATION-SUMMARY.md documentation - Complete Prometheus integration (6 commands + 4 tools) - Complete Dexto integration (12 commands + 5 tools) - Enhanced Ralph with access to all agents - Fix /clawd command (removed disable-model-invocation) - Update hooks.json to v5 with intelligent routing - 291 total skills now available - All 21 commands with automatic routing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
0
prometheus/tests/test_utils/__init__.py
Normal file
0
prometheus/tests/test_utils/__init__.py
Normal file
90
prometheus/tests/test_utils/fixtures.py
Normal file
90
prometheus/tests/test_utils/fixtures.py
Normal file
@@ -0,0 +1,90 @@
|
||||
import shutil
|
||||
import tempfile
|
||||
import uuid
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from git import Repo
|
||||
from testcontainers.neo4j import Neo4jContainer
|
||||
from testcontainers.postgres import PostgresContainer
|
||||
|
||||
from prometheus.app.services.neo4j_service import Neo4jService
|
||||
from prometheus.graph.knowledge_graph import KnowledgeGraph
|
||||
from prometheus.neo4j.knowledge_graph_handler import KnowledgeGraphHandler
|
||||
from tests.test_utils import test_project_paths
|
||||
|
||||
NEO4J_IMAGE = "neo4j:5.20.0"
|
||||
NEO4J_USERNAME = "neo4j"
|
||||
NEO4J_PASSWORD = "password"
|
||||
|
||||
POSTGRES_IMAGE = "postgres"
|
||||
POSTGRES_USERNAME = "postgres"
|
||||
POSTGRES_PASSWORD = "password"
|
||||
POSTGRES_DB = "postgres"
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
async def neo4j_container_with_kg_fixture():
|
||||
kg = KnowledgeGraph(1, 1000, 100, 0)
|
||||
await kg.build_graph(test_project_paths.TEST_PROJECT_PATH)
|
||||
container = (
|
||||
Neo4jContainer(image=NEO4J_IMAGE, username=NEO4J_USERNAME, password=NEO4J_PASSWORD)
|
||||
.with_env("NEO4J_PLUGINS", '["apoc"]')
|
||||
.with_name(f"neo4j_container_with_kg_{uuid.uuid4().hex[:12]}")
|
||||
)
|
||||
with container as neo4j_container:
|
||||
neo4j_service = Neo4jService(container.get_connection_url(), NEO4J_USERNAME, NEO4J_PASSWORD)
|
||||
handler = KnowledgeGraphHandler(neo4j_service.neo4j_driver, 100)
|
||||
await handler.write_knowledge_graph(kg)
|
||||
yield neo4j_container, kg
|
||||
await neo4j_service.close()
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def empty_neo4j_container_fixture():
|
||||
container = (
|
||||
Neo4jContainer(image=NEO4J_IMAGE, username=NEO4J_USERNAME, password=NEO4J_PASSWORD)
|
||||
.with_env("NEO4J_PLUGINS", '["apoc"]')
|
||||
.with_name(f"empty_neo4j_container_{uuid.uuid4().hex[:12]}")
|
||||
)
|
||||
with container as neo4j_container:
|
||||
yield neo4j_container
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def postgres_container_fixture():
|
||||
container = PostgresContainer(
|
||||
image=POSTGRES_IMAGE,
|
||||
username=POSTGRES_USERNAME,
|
||||
password=POSTGRES_PASSWORD,
|
||||
dbname=POSTGRES_DB,
|
||||
port=5432,
|
||||
driver="asyncpg",
|
||||
).with_name(f"postgres_container_{uuid.uuid4().hex[:12]}")
|
||||
with container as postgres_container:
|
||||
yield postgres_container
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def git_repo_fixture():
|
||||
temp_dir = Path(tempfile.mkdtemp())
|
||||
temp_project_dir = temp_dir / "test_project"
|
||||
original_project_path = test_project_paths.TEST_PROJECT_PATH
|
||||
|
||||
try:
|
||||
shutil.copytree(original_project_path, temp_project_dir)
|
||||
shutil.move(temp_project_dir / test_project_paths.GIT_DIR.name, temp_project_dir / ".git")
|
||||
|
||||
repo = Repo(temp_project_dir)
|
||||
yield repo
|
||||
finally:
|
||||
shutil.rmtree(temp_project_dir)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def temp_test_dir(tmp_path):
|
||||
"""Create a temporary test directory."""
|
||||
test_dir = tmp_path / "test_files"
|
||||
test_dir.mkdir()
|
||||
yield test_dir
|
||||
# Cleanup happens automatically after tests due to tmp_path fixture
|
||||
11
prometheus/tests/test_utils/test_project_paths.py
Normal file
11
prometheus/tests/test_utils/test_project_paths.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from pathlib import Path
|
||||
|
||||
TEST_PROJECT_PATH = Path(__file__).parent.parent / "test_project"
|
||||
GIT_DIR = TEST_PROJECT_PATH / ".dummy_git"
|
||||
C_FILE = TEST_PROJECT_PATH / "test.c"
|
||||
BAR_DIR = TEST_PROJECT_PATH / "bar"
|
||||
JAVA_FILE = BAR_DIR / "test.java"
|
||||
PYTHON_FILE = BAR_DIR / "test.py"
|
||||
FOO_DIR = TEST_PROJECT_PATH / "foo"
|
||||
MD_FILE = FOO_DIR / "test.md"
|
||||
DUMMY_FILE = FOO_DIR / "test.dummy"
|
||||
13
prometheus/tests/test_utils/util.py
Normal file
13
prometheus/tests/test_utils/util.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from langchain_core.language_models.fake_chat_models import FakeListChatModel
|
||||
from testcontainers.neo4j import Neo4jContainer
|
||||
|
||||
|
||||
class FakeListChatWithToolsModel(FakeListChatModel):
|
||||
def bind_tools(self, tools=None, tool_choice=None, **kwargs):
|
||||
return self
|
||||
|
||||
|
||||
def clean_neo4j_container(neo4j_container: Neo4jContainer):
|
||||
with neo4j_container.get_driver() as driver:
|
||||
with driver.session() as session:
|
||||
session.run("MATCH (n) DETACH DELETE n")
|
||||
Reference in New Issue
Block a user