Metadata-Version: 2.4
Name: mdjourney-agent
Version: 0.1.1
Summary: Metadata Automation Edge Agent
Author: Saptarshi Chakrabarti
License: MIT
Project-URL: Homepage, https://github.com/sifrimlab/mdjourney
Project-URL: Documentation, https://github.com/sifrimlab/mdjourney/tree/main/edge-agent/docs
Project-URL: Repository, https://github.com/sifrimlab/mdjourney
Project-URL: Bug Tracker, https://github.com/sifrimlab/mdjourney/issues
Project-URL: Changelog, https://github.com/sifrimlab/mdjourney/blob/main/edge-agent/CHANGELOG.md
Keywords: FAIR,metadata,edge-agent,research-data,automation
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: watchdog>=3.0.0
Requires-Dist: redis>=5.0.0
Requires-Dist: websocket-client>=1.8.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: pyyaml>=6.0.0
Requires-Dist: requests>=2.31.0
Requires-Dist: questionary>=2.0.0
Provides-Extra: dev
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: taskipy>=1.12.0; extra == "dev"

# MDJourney Edge Agent

The MDJourney Edge Agent is a lightweight service for research workstations and local data servers. It watches filesystem events, validates the `p_`/`d_` hierarchy, and publishes ingestion events to an MDJourney backend gateway.

This package is developed inside the MDJourney monorepo but is designed to remain independently installable and releasable on PyPI.

## Installation

### From PyPI

```bash
pip install mdjourney-agent
```

### From source (local development)

```bash
cd edge-agent
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
```

## Quickstart

1. Configure the agent interactively:

```bash
mdjourney-agent configure
```

2. Run diagnostics:

```bash
mdjourney-agent doctor
```

3. Start monitoring:

```bash
mdjourney-agent run
```

## Configuration

Configuration is loaded from:

- YAML: `~/.config/mdjourney/config.yaml`
- legacy JSON fallback: `~/.config/mdjourney/config.json`
- environment variables (take precedence)

Key settings include:

- `AGENT_ID`
- `WATCH_PATH`
- `GATEWAY_URL`
- `GATEWAY_TOKEN`
- Redis settings (`REDIS_URL` or `REDIS_HOST`/`REDIS_PORT`/`REDIS_DB`/`REDIS_PASSWORD`)

For full details, see:

- `docs/configuration.md`
- `docs/operations.md`
- `docs/compatibility.md`

## Documentation for Maintainers

- Release runbook: `docs/release.md`
- Changelog: `CHANGELOG.md`

## Troubleshooting

- **403 Forbidden:** check that `GATEWAY_TOKEN` is valid.
- **Permission denied:** ensure user access to `WATCH_PATH`.
- **Agent offline:** verify gateway reachability and run `mdjourney-agent doctor`.
