Metadata-Version: 2.4
Name: agentsml-impl
Version: 0.2.1
Summary: AgentsML IR-first compiler — converts AgentsML YAML documents into target-specific code, manifests, and deployment bundles.
Author: Sanjay Sharma
License-Expression: MIT
Keywords: agentsml,agents,compiler,codegen
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyyaml>=6.0
Requires-Dist: jsonschema>=4.23
Requires-Dist: jinja2>=3.1
Requires-Dist: typer>=0.12
Requires-Dist: rich>=13.0
Requires-Dist: pydantic>=2.7
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Dynamic: license-file

# agentsml-impl

`agentsml-impl` is the reference compiler and implementation surface for AgentsML. 
It ingests AgentsML definitions (YAML or JSON) and compiles them into functioning code, export artifacts, and standard configurations for various target AI agent runtimes and protocols.

This repository is distinct from the core spec repository. While `agentsml/` contains the standard definitions and schemas, `agentsml-impl/` brings them to life via a Design 2 IR-first compilation approach.

## Supported Targets

See [Target Support Matrix](docs/target-support.md) for the current registry coverage, grouped by target category and maturity. The registry lists 31 targets: 22 runnable generators, 9 export generators, and 0 scaffolds. Certification: 15 external-runtime, 16 offline-behavioral, 0 structural. Registry level is retained for compatibility but does not imply runtime maturity.

## Quickstart

### Installation

```bash
# Clone the repository
git clone https://github.com/indoos/agentsml-impl.git
cd agentsml-impl

# Install locally
pip install -e .
```

### Usage

The CLI is available as both `agentsml` and `agentsml-impl`.

**1. Validate an AgentsML document:**
```bash
agentsml validate path/to/agent.yaml
```

**2. Compile to a Target Framework:**
```bash
agentsml generate path/to/agent.yaml --target pydantic-ai --out my_project
```

**3. Run Diagnostic Checks:**
```bash
agentsml doctor path/to/agent.yaml --target crewai
```

**4. Compile (alias of generate):**
```bash
agentsml compile path/to/agent.yaml -t langgraph -o my_project
```

**5. Render the execution graph:**
```bash
agentsml graph path/to/agent.yaml --format mermaid
```

**6. List registered targets with maturity and certification:**
```bash
agentsml list-targets
```

### Development & Testing

Run the complete structural, golden, conformance, and behavioral suite:
```bash
pip install -e ".[dev]"
pytest
```

Run offline behavioral and external-runtime certification:
```bash
python scripts/run_certification.py
uv run --python 3.12 --with pytest --with 'pydantic-ai==1.107.0' --with 'langchain>=1.0,<2' --with 'langgraph==1.2.20' --with 'langchain-openai==1.7.4' --with 'google-adk==2.14.0' --with 'a2a-sdk[http-server]>=1.3.0' --with 'openai-agents==0.24.0' --with 'smolagents[openai]>=1.0.0' --with 'anthropic>=0.30.0' --with 'llama-index-core>=0.11.0' --with 'llama-index-llms-openai>=0.1.0' --with 'agno>=1.0.0' --with 'ag2==1.3.1' --with 'uvicorn>=0.30' --with 'strands-agents==1.65.0' --with 'semantic-kernel==1.47.0' --with 'protobuf' python scripts/run_external_certification.py --suite a
uv run --python 3.12 --with pytest --with 'crewai==1.15.41' python scripts/run_external_certification.py --suite b
```

Structural tests prove artifact shape and syntax. Offline behavioral tests
execute generated helpers or validate generated protocol artifacts against
semantic contracts. External-runtime tests install and exercise the real target
SDK or runtime against deterministic fixtures. Fifteen targets are external-runtime certified and the remaining sixteen are offline-behavioral certified; see the support matrix for per-target evidence.

## Changelog

See [CHANGELOG.md](CHANGELOG.md).

## Adding a Target

Please refer to the [Adapter Authoring Guide](docs/adapter-authoring.md) for instructions on creating a new target generator.

## License

MIT. See [LICENSE](LICENSE).
