Spaces:
Configuration error
Configuration error
File size: 3,001 Bytes
f679000 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | # Project Structure
## Overview
AMCP follows Python best practices with a clear separation of concerns:
```
AMCP/
βββ src/amcp/ # Main package source code
β βββ __init__.py # Package initialization
β βββ __main__.py # Entry point for python -m amcp
β βββ cli.py # CLI interface (Typer)
β βββ agent.py # Agent orchestration logic
β βββ agent_spec.py # Agent specification handling
β βββ tools.py # Built-in tools (read, grep, bash, etc.)
β βββ config.py # Configuration management
β βββ mcp_client.py # MCP server integration
β βββ chat.py # Chat/LLM interaction
β βββ readfile.py # File reading utilities
β
βββ tests/ # Test suite
β βββ __init__.py
β βββ conftest.py # Pytest fixtures
β βββ test_agent_spec.py
β βββ test_config.py
β βββ test_tools.py
β
βββ .github/
β βββ workflows/
β βββ ci.yml # GitHub Actions CI/CD
β
βββ docs/ # Documentation
β βββ PROJECT_STRUCTURE.md
β
βββ pyproject.toml # Project metadata & dependencies
βββ pytest.ini # Pytest configuration
βββ Makefile # Common development tasks
βββ .pre-commit-config.yaml # Pre-commit hooks
βββ .ruff.toml # Ruff linter configuration
βββ .gitignore
βββ README.md
βββ CONTRIBUTING.md
βββ CHANGELOG.md
βββ Dockerfile
```
## Key Design Decisions
### 1. Source Layout (`src/` layout)
- Prevents accidental imports of uninstalled code
- Clear separation between source and tests
- Recommended by PyPA
### 2. Testing
- Uses pytest for testing framework
- Fixtures in `conftest.py` for reusability
- Coverage reporting with pytest-cov
- Target: >80% code coverage
### 3. Code Quality
- Ruff for linting and formatting
- Type hints encouraged (mypy for type checking)
- Pre-commit hooks for automated checks
### 4. CI/CD
- GitHub Actions for automated testing
- Matrix testing across Python 3.11, 3.12, 3.13
- Automated coverage reporting
### 5. Configuration
- pyproject.toml as single source of truth
- Tool configurations centralized
- Optional dependencies for development
## Development Workflow
1. **Setup**: `make install` or `pip install -e ".[dev]"`
2. **Test**: `make test` or `pytest`
3. **Lint**: `make lint` or `ruff check src/ tests/`
4. **Format**: `make format` or `ruff format src/ tests/`
5. **Coverage**: `make test-cov`
## Module Responsibilities
- **cli.py**: Command-line interface, argument parsing
- **agent.py**: Core agent logic, tool orchestration
- **tools.py**: Built-in tool implementations
- **config.py**: Configuration loading/saving
- **mcp_client.py**: MCP protocol communication
- **chat.py**: LLM interaction, streaming responses
|