Metadata-Version: 2.4
Name: sentinel-mas
Version: 0.1.0
Summary: A Multi-Agent System for intelligent task processing
Author-email: Kelvin Lee <chekeng82@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/A0291221R/sentinel_mas
Project-URL: Documentation, https://github.com/A0291221R/sentinel_mas
Project-URL: Repository, https://github.com/A0291221R/sentinel_mas
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: bandit>=1.7.7
Requires-Dist: black>=23.9.0
Requires-Dist: coverage>=7.3.0
Requires-Dist: fastapi>=0.119.0
Requires-Dist: fastmcp>=2.12.5
Requires-Dist: flake8>=6.1.0
Requires-Dist: freezegun>=1.5
Requires-Dist: gradio>=5.49.1
Requires-Dist: httpx>=0.28.1
Requires-Dist: isort>=5.13.0
Requires-Dist: jinja2>=3.1.6
Requires-Dist: langchain>=0.3.27
Requires-Dist: langchain-anthropic>=1.0.0
Requires-Dist: langchain-community>=0.3.31
Requires-Dist: langchain-core>=0.3.79
Requires-Dist: langchain-mcp-adapters>=0.1.11
Requires-Dist: langchain-openai>=0.3.35
Requires-Dist: langchain-tavily>=0.2.12
Requires-Dist: langgraph>=0.6.10
Requires-Dist: langgraph-cli[inmem]>=0.4.3
Requires-Dist: matplotlib>=3.10.7
Requires-Dist: mypy>=1.9.0
Requires-Dist: openai>=2.3.0
Requires-Dist: pandas>=2.3.3
Requires-Dist: pip>=25.2
Requires-Dist: psycopg[binary]>=3.2.10
Requires-Dist: pushover>=0.5
Requires-Dist: pydantic>=2
Requires-Dist: pytest>=7.4.0
Requires-Dist: pytest-cov>=4.1.0
Requires-Dist: pytest-mock>=3.10.0
Requires-Dist: pytest-xdist>=3.3.0
Requires-Dist: python-dateutil>=2.9.0.post0
Requires-Dist: python-jose[cryptography]>=3.5.0
Requires-Dist: pytz>=2025.2
Requires-Dist: pyyaml>=6.0
Requires-Dist: requests>=2.32.5
Requires-Dist: respx>=0.22.0
Requires-Dist: safety>=2.3.5
Requires-Dist: sentence-transformers>=5.1.1
Requires-Dist: sqlalchemy>=2.0.44
Requires-Dist: streamlit>=1.50.0
Requires-Dist: tavily-python>=0.7.12
Requires-Dist: tiktoken>=0.12.0
Requires-Dist: types-python-jose>=3.5.0.20250531
Requires-Dist: uvicorn[standard]>=0.37.0
Requires-Dist: yfinance>=0.2.66
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.3.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Requires-Dist: mypy>=1.5.0; extra == "dev"
Requires-Dist: bandit>=1.7.5; extra == "dev"
Requires-Dist: safety>=2.3.5; extra == "dev"

# Sentinel-MAS Unit Tests (pytest)

## How to run

1. Ensure your source tree looks like this (package directory name matters):

```
<repo-root>/
  sentinel_mas/
    policy_sentinel/
    tools/
    agents/
    app/
    ...
  tests/
```

2. Copy the `tests/` folder from this bundle into your repo root so that `tests/` sits next to the `sentinel_mas/` folder.

3. (Recommended) Create a virtualenv and install test deps:
```
pip install -r requirements-test.txt
```

4. Run tests with coverage:
```
pip install -e .[test]
pytest --cov=sentinel_mas --cov-report=term-missing


```

If your package directory is not named `sentinel_mas`, either rename it or update the imports inside the tests accordingly.


### Usage

## 1. Run locally
~~~bash
# Make scripts executable
chmod +x scripts/*.sh
chmod +x scripts/*.py

# Setup development environment
./scripts/setup_dev.sh

# Activate virtual environment
source .venv/bin/activate

# Run the full pipeline locally
./scripts/lint.sh
pytest tests/ --junitxml=test-results/junit.xml --cov=src
python scripts/generate_report.py
~~~


## Local Sanity Check:
~~~bash
# Run isort to automatically fix import sorting
uv run isort .
uv run black .
uv run flake8 .
uv run mypy sentinel_mas tests
uv run pytest


## Verify the fixes:
isort --check-only .
black --check .

# Check only (CI mode)
./scripts/lint.sh

# Auto-fix all issues (development mode)
./scripts/lint.sh --fix
~~~


### SonarCube Integration
~~~ bash
## Download SonarCube
cd /d/NUS/Mtech\ IS/Year\ 2\ Sem\ 2/Practice\ Module/Development/sentinel/
curl -L -o sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-windows.zip
unzip sonar-scanner.zip -d tools


## update environment variable
export PATH="$PWD/tools/sonar-scanner-5.0.1.3006-windows/bin:$PATH"

## Verify
sonar-scanner -v
~~~

## Configuration

This project uses separate environment files:

- `.env.sentinel` - Sentinel MAS package configuration
- `.env.api` - API service configuration  
- `.env.shared` - Shared configuration

### Setup

1. Copy example files:
```bash
cp .env.sentinel.example .env.sentinel
cp .env.api.example .env.api
cp .env.shared.example .env.shared
```

2. Edit `.env.sentinel`:
   - Set `OPENAI_API_KEY` with your OpenAI key

3. Edit `.env.api`:
   - Generate `SECRET_KEY`: `openssl rand -hex 32`

4. Run the application:
```bash
python scripts/start_api.py
```

### Environment Files

| File | Purpose | Required Variables |
|------|---------|-------------------|
| `.env.sentinel` | Package config | `OPENAI_API_KEY` |
| `.env.api` | API config | `SECRET_KEY` |
| `.env.shared` | Shared config | None (has defaults) |
```

---

## Migration Steps

1. **Backup your current .env:**
```bash
cp .env .env.backup
```

2. **Create the three new files:**
   - Copy `.env.sentinel` content
   - Copy `.env.api` content
   - Copy `.env.shared` content

3. **Migrate your values:**
   - From old `.env`, copy values to appropriate new files
   - Remove `SENTINEL_` and `API_` prefixes

4. **Update config files:**
   - Replace `sentinel_mas/config.py`
   - Replace `api_service/config.py`

5. **Update .gitignore:**
   - Add the new environment files

6. **Test:**
```bash
python -c "from sentinel_mas.config import Config; print(f'Model: {Config.OPENAI_MODEL}')"
python -c "from api_service.config import get_api_config; print(f'Port: {get_api_config().PORT}')"
```

7. **Start the API:**
```bash
python scripts/start_api.py

---

## Docker Update

**Update `docker/Dockerfile.api`:**

```dockerfile
# Copy environment files
COPY .env.sentinel .env.api .env.shared ./
```

**Update `docker-compose.yml`:**

```yaml
services:
  api:
    volumes:
      - ./.env.sentinel:/app/.env.sentinel
      - ./.env.api:/app/.env.api
      - ./.env.shared:/app/.env.shared
```
