[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "solace-agent-mesh"
dynamic = ["version"]
description = "Solace Agent Mesh is an open-source framework for building event-driven, multi-agent AI systems where specialized agents collaborate on complex tasks."
readme = "README.md"
requires-python = ">=3.10.16"
license = { file = "LICENSE" }
authors = [
  { name="SolaceLabs", email="solacelabs@solace.com" },
]
classifiers = [
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.13",
    "License :: OSI Approved :: Apache Software License",
    "Operating System :: OS Independent",
    "Topic :: Software Development :: Libraries :: Application Frameworks",
]
dependencies = [
    "google-adk==1.18.0",
    "a2a-sdk[http-server]==0.3.7",
    "pydantic==2.11.9",
    "click==8.1.8",
    "python-dotenv==1.1.1",
    "google-genai==1.49.0",
    "httpx==0.28.1",
    "jwcrypto==1.5.6",
    "python-jwt==4.1.0",
    "asteval==1.0.6",
    "pystache==0.6.8",
    "python-liquid==2.1.0",
    "pandas==2.3.2",
    "numpy==2.2.6",
    "plotly==6.3.0",
    "kaleido==0.2.1",
    "PyYAML==6.0.2",
    "python-multipart==0.0.22",
    "wheel==0.46.2",
    "jaraco.context==6.1.0",
    "protobuf==6.33.5",
    "setuptools==80.10.2",
    "markitdown[all]==0.1.4",
    "jmespath==1.0.1",
    "mermaid_cli==0.1.2",
    "playwright==1.58.0",
    "litellm==1.76.3",
    "markdownify==1.2.0",
    "beautifulsoup4==4.13.5",
    "jsonpath-ng==1.7.0",
    "pydub==0.25.1",
    "toml==0.10.2",
    "GitPython==3.1.45",
    "Flask==3.1.3",
    "flask-cors==6.0.1",
    "werkzeug==3.1.6",
    "fastapi==0.120.1",
    "starlette==0.49.1",
    "uvicorn[standard]==0.37.0",
    "sse-starlette==3.0.2",
    "itsdangerous==2.2.0",
    "solace_ai_connector==3.3.4",
    "holidays==0.81.0",
    "rouge==1.0.1",
    "SQLAlchemy==2.0.40",
    "alembic==1.16.5",
    "openai==1.99.9",
    "rich==13.9.4",
    "boto3==1.40.37",
    "psycopg2-binary==2.9.10",
    "azure-cognitiveservices-speech==1.41.1",
    "cryptography==46.0.5",  # [CVE-2026-26007] Security fix: addresses vulnerabilities in older versions (transitive dependency from multiple packages)
    "pillow==12.1.1",  # [CVE-2026-25990] Security fix: addresses vulnerabilities in older versions (transitive dependency from python-pptx)
    "bm25s==0.2.14",
    "pypdf==6.7.5",
    "python-pptx==1.0.2",
    "python-docx==1.2.0",
    "google-cloud-storage==3.9.0",
    "azure-storage-blob==12.28.0",
    "authlib==1.6.7",
    "cachetools==7.0.1",
    "openfeature-sdk==0.8.4",
    "filelock==3.20.3",
    "uuid-utils>=0.11.1",
]

[project.optional-dependencies]
vertex = ["google-cloud-aiplatform==1.133.0"]
employee_tools = ["holidays==0.81.0"]
test = [
    "pytest-asyncio",
    "pytest>=8.0.0",
    "pytest-mock>=3.0.0",
    "pytest-cov>=4.0.0",
    "pytest-xdist>=3.5.0",
    "pytest-httpx>=0.35.0",
    "fastmcp==2.11.2",  # Pin for mcp compatibility - newer versions require Icon
    "httpx>=0.25",
    "respx",
    "ruff",
    "testcontainers",
    "aiosqlite",
    "psycopg2-binary",
    "asyncpg",
]

[tool.hatch.envs.hatch-test]
parallel = false
installer = "uv"
dependencies = [
    "solace-agent-mesh[vertex,employee_tools]",
    "pytest-asyncio",
    "pytest>=8.0.0",
    "pytest-mock>=3.0.0",
    "pytest-cov>=4.0.0",
    "pytest-xdist>=3.5.0",
    "pytest-httpx>=0.35.0",
    "fastmcp==2.11.2",  # Pin for mcp compatibility - newer versions require Icon
    "httpx>=0.25",
    "respx",
    "ruff",
    "testcontainers",
    "aiosqlite",
    "psycopg2-binary",
    "asyncpg",
    "bm25s==0.2.14",
    "pypdf==6.7.5",
    "python-pptx==1.0.2",
    "python-docx==1.2.0",
    "sam-test-infrastructure @ {root:uri}/tests/sam-test-infrastructure"
]
post-install-commands = [
  "playwright install"
]

[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.10", "3.13"]

[tool.hatch.envs.hatch-test.scripts]
run = "pytest {args}"
run-cov = "coverage run -m pytest --cov=cli --cov=src {args}"
cov-combine = "coverage combine"
cov-report = "coverage report"


[project.urls]
Homepage = "https://github.com/SolaceLabs/solace-agent-mesh"
Repository = "https://github.com/SolaceLabs/solace-agent-mesh"

[project.scripts]
solace-agent-mesh = "solace_agent_mesh.cli.main:cli"
sam = "solace_agent_mesh.cli.main:cli"

[tool.ruff]
line-length = 88
select = ["E", "W", "F", "I", "UP", "B", "C4", "SIM"]
ignore = ["E501", "B008"]

[tool.ruff.format]
quote-style = "double"

[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
addopts = "--tb=short --strict-markers --disable-warnings -p pytest_asyncio --ignore=tests/system --ignore=tests/stress"
testpaths = ["tests"]
pythonpath = [".", "src", "tests/sam-test-infrastructure/src"]
python_files = ["test_*.py", "*_test.py", "tests.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
    "all: marks all tests",
    "asyncio: marks tests as async (deselect with '-m \"not asyncio\"')",
    "default: marks tests that are basic or foundational",
    "stress: marks tests as stress tests (long-running, resource-intensive)",
    "long_soak: marks tests as very long-running soak tests for memory leak detection",

    # Core Components
    # Markers for the main components of the Solace Agent Mesh.
    "agent: marks tests related to the agent component",
    "common: marks tests related to the common component",
    "core_a2a: marks tests related to the core_a2a component",
    "gateway: marks tests related to the gateway component",

    # Common Components
    # Markers for sub-components within the 'common' directory.
    "middleware: marks tests related to the middleware component",
    "server: marks tests related to the server component",
    "services: marks tests related to the services",

    # Features
    # Markers for specific features.
    "callbacks: marks tests related to agent callbacks",
    "datapart: marks tests related to A2A DataPart objects",
    "delegation: marks tests related to agent delegation",
    "embeds: marks tests related to the embeds",
    "mcp: marks tests related to mcp",
    "notification: marks tests related to notifications",
    "task_cancellation: marks tests related to task cancellation",
    "proxy: marks tests related to the A2A proxy functionality",
    "streaming: marks tests related to streaming messages",
    "artifacts: marks tests related to artifact handling and services",
    "workflows: marks tests related to workflow execution",
    "map: marks tests for map (parallel iteration) workflows",
    "switch: marks tests for switch (multi-way) workflow branching",
    "loop: marks tests for loop workflow iteration",
    "api: marks tests related to the API",
    "tasks: marks tests related to task management",
    "builtin_artifact_embeds: marks tests related to the builtin_artifact_embeds",
    "projects: marks tests related to project management",
    "default_agent: marks tests related to default agent functionality",
    "crud: marks tests related to CRUD operations",
    "templates: marks tests related to template operations",
    "pagination: marks tests related to pagination functionality",
    "security: marks tests related to security and authorization",
    "error: marks tests related to error handling scenarios",
    "validation: marks tests related to input validation",
    "prompts: marks tests related to the prompts library feature",
    "versioning: marks tests related to version management",
    "search: marks tests related to search and filtering functionality",

    # Agent Tools
    # Markers for the built-in agent tools.
    "tools: marks tests related to the agent tools",
    "audio_tools: marks tests related to the audio_tools",
    "peer_tool: marks tests for calling peer agents",
    "parallel_tool: marks tests related to the parallel_tool",
    "builtin_artifact_tools: marks tests related to the builtin_artifact_tools",
    "builtin_data_analysis_tools: marks tests related to the builtin_data_analysis_tools",
    "general_agent_tools: marks tests related to the general_agent_tools",
    "image_tools: marks tests related to the image_tools",
    "peer_agent_tool: marks tests related to the peer_agent_tool",
    "web_tools: marks tests related to the web_tools",
    "web_search: marks tests related to web search tools (Tavily, Google, Exa, Brave)",
    "deep_research: marks tests related to deep research tool",
    "dynamic_tools: marks tests related to the dynamic_tools",
    "artifact_preloading: marks tests related to ArtifactContent type hint pre-loading",
    "auth: marks tests associated with authentication and authorization",
    "oauth: OAuth specific tests",
    "error_handling: Tests related to error handling and recovery",
    "cancellation: Tests related to task cancellation",
    "headers: marks tests related to HTTP header handling",
    "agent_card: marks tests related to agent card fetching and discovery",
    "url: marks tests related to URL handling and routing",
    "task: marks tests related to task invocation",
]

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build.targets.wheel]
packages = ["src/solace_agent_mesh"]

[tool.hatch.build.targets.wheel.force-include]
"templates" = "solace_agent_mesh/templates"
"cli" = "solace_agent_mesh/cli"
"evaluation" = "solace_agent_mesh/evaluation"
"config_portal/frontend/static" = "solace_agent_mesh/config_portal/frontend/static"
"config_portal/backend" = "solace_agent_mesh/config_portal/backend"
"config_portal/__init__.py" = "solace_agent_mesh/config_portal/__init__.py"
"client/webui/frontend/static" = "solace_agent_mesh/client/webui/frontend/static"
"docs/build" = "solace_agent_mesh/assets/docs"

[tool.hatch.build.targets.sdist.force-include]
"config_portal/frontend/static" = "/assets/config_portal"
"client/webui/frontend/static" = "/assets/client/webui"
"docs/build" = "/assets/docs"

[tool.hatch.build.targets.sdist.hooks.custom]
path = ".github/helper_scripts/build_frontend.py"

[tool.hatch.build.targets.wheel.hooks.custom]
path = ".github/helper_scripts/build_frontend.py"

[tool.hatch.version]
path = "cli/__init__.py"
