Metadata-Version: 2.4
Name: ainalyn-sdk
Version: 0.1.0a4
Summary: Agent Definition Compiler for Ainalyn Platform
Project-URL: Homepage, https://github.com/CoreNovus/ainalyn-sdk
Project-URL: Documentation, https://docs.ainalyn.corenovus.com
Project-URL: Repository, https://github.com/CoreNovus/ainalyn-sdk
Project-URL: Issues, https://github.com/CoreNovus/ainalyn-sdk/issues
Author-email: CoreNovus <dev@corenovus.com>
License: MIT
License-File: LICENSE
Keywords: agent,ainalyn,marketplace,sdk,task-oriented,workflow
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: pyyaml>=6.0
Provides-Extra: all
Requires-Dist: coverage[toml]>=7.3.0; extra == 'all'
Requires-Dist: ipython>=8.0.0; extra == 'all'
Requires-Dist: mkdocs-material>=9.5.0; extra == 'all'
Requires-Dist: mkdocs>=1.5.0; extra == 'all'
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'all'
Requires-Dist: mypy>=1.7.0; extra == 'all'
Requires-Dist: pre-commit>=3.6.0; extra == 'all'
Requires-Dist: pytest-cov>=4.1.0; extra == 'all'
Requires-Dist: pytest>=7.4.0; extra == 'all'
Requires-Dist: ruff>=0.1.8; extra == 'all'
Provides-Extra: dev
Requires-Dist: coverage[toml]>=7.3.0; extra == 'dev'
Requires-Dist: ipython>=8.0.0; extra == 'dev'
Requires-Dist: mypy>=1.7.0; extra == 'dev'
Requires-Dist: pre-commit>=3.6.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=7.4.0; extra == 'dev'
Requires-Dist: ruff>=0.1.8; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
Requires-Dist: mkdocs>=1.5.0; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'docs'
Provides-Extra: lint
Requires-Dist: ruff>=0.1.8; extra == 'lint'
Provides-Extra: test
Requires-Dist: coverage[toml]>=7.3.0; extra == 'test'
Requires-Dist: pytest-cov>=4.1.0; extra == 'test'
Requires-Dist: pytest>=7.4.0; extra == 'test'
Provides-Extra: type
Requires-Dist: mypy>=1.7.0; extra == 'type'
Description-Content-Type: text/markdown

# Ainalyn SDK

[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Documentation](https://img.shields.io/badge/docs-online-brightgreen)](https://corenovus.github.io/ainalyn-sdk/)

**Agent Definition Compiler for the Ainalyn Platform**

Ainalyn SDK helps you define, validate, and export task-oriented agents using a clean Python API. Think of it as a compiler: you describe what your agent does, the SDK validates it, and outputs a platform-ready YAML file.

> **Note**: This SDK is a **compiler, not a runtime**. It creates agent descriptions—the Ainalyn Platform handles execution.

## Why Ainalyn SDK?

- **Type-safe Builder API** - Define agents with IDE autocomplete and compile-time checks
- **Comprehensive Validation** - Catch errors before deployment
- **YAML Export** - One-line compilation to platform-ready format
- **Clean Architecture** - Well-tested, maintainable codebase

## Quick Start

### Installation

```bash
pip install ainalyn-sdk
```

### Your First Agent

```python
from ainalyn import AgentBuilder, WorkflowBuilder, NodeBuilder, PromptBuilder
from ainalyn.api import validate, export_yaml

# Define a prompt
greeting_prompt = (
    PromptBuilder("greeting-prompt")
    .description("Generates a personalized greeting")
    .template("Generate a personalized greeting for {{user_name}}")
    .variables("user_name")
    .build()
)

# Define a simple agent
agent = (
    AgentBuilder("greeting-agent")
    .description("Generates personalized greetings")
    .version("1.0.0")
    .add_prompt(greeting_prompt)
    .add_workflow(
        WorkflowBuilder("greet-user")
        .description("Main greeting workflow")
        .add_node(
            NodeBuilder("generate-greeting")
            .description("Generate a personalized greeting message")
            .uses_prompt("greeting-prompt")
            .outputs("greeting")
            .build()
        )
        .entry_node("generate-greeting")
        .build()
    )
    .build()
)

# Validate and export
result = validate(agent)
if result.is_valid:
    yaml_output = export_yaml(agent)
    print(yaml_output)
```

**Output:**
```yaml
# Ainalyn Agent Definition
# This file is a description submitted to Platform Core for review.
# It does NOT execute by itself. Execution is handled by Platform Core.
#
# Local compilation does NOT equal platform execution.

name: greeting-agent
version: 1.0.0
description: Generates personalized greetings
workflows:
- name: greet-user
  description: Main greeting workflow
  entry_node: generate-greeting
  nodes:
  - name: generate-greeting
    description: Generate a personalized greeting message
    type: prompt
    reference: greeting-prompt
    outputs:
    - greeting
prompts:
- name: greeting-prompt
  description: Generates a personalized greeting
  template: Generate a personalized greeting for {{user_name}}
  variables:
  - user_name
```

### Submitting Agents to Platform

After compiling your agent, submit it directly to the Ainalyn Platform for review:

```python
from ainalyn import AgentBuilder, submit_agent, track_submission

# Build your agent
agent = (
    AgentBuilder("my-agent")
    .version("1.0.0")
    .description("My awesome agent")
    # ... add workflows, prompts, tools ...
    .build()
)

# Submit for review
result = submit_agent(agent, api_key="your_api_key")
print(f"Review ID: {result.review_id}")
print(f"Track at: {result.tracking_url}")

# Check submission status
status = track_submission(result.review_id, api_key="your_api_key")
if status.is_live:
    print(f"Agent is live: {status.marketplace_url}")
```

**Important:**
- SDK can submit but **NOT approve** - Platform Core has final authority
- Submission does **NOT** create an Execution
- Submission does **NOT** incur billing (unless platform policy states)
- Get your API key at: `https://console.ainalyn.io/api-keys`

See [example/submit_agent_example.py](https://github.com/CoreNovus/ainalyn-sdk/blob/master/examples/submit_agent_example.py) for a complete walkthrough.

### CLI Usage

```bash
# Validate an agent definition
ainalyn validate my_agent.py

# Compile to YAML
ainalyn compile my_agent.py --output agent.yaml
```

## Documentation

**[Full Documentation](http://docs.ainalyn.corenovus.com/)** - Complete guides, API reference, and examples

**Quick Links:**

- [What is an Agent?](http://docs.ainalyn.corenovus.com/v1/concepts/what-is-an-agent/) - Understand the vision
- [Installation Guide](http://docs.ainalyn.corenovus.com/v1/getting-started/installation/)
- [5-Minute Quickstart](http://docs.ainalyn.corenovus.com/v1/getting-started/quickstart/)
- [Your First Agent Tutorial](http://docs.ainalyn.corenovus.com/v1/getting-started/your-first-agent/)

## Examples

Check out the `examples/` directory:

- [basic_agent.py](https://github.com/CoreNovus/ainalyn-sdk/blob/master/examples/basic_agent.py) - Simple greeting agent
- [multi_workflow_agent.py](https://github.com/CoreNovus/ainalyn-sdk/blob/master/examples/multi_workflow_agent.py) - Complex data analysis agent
- [submit_agent_example.py](https://github.com/CoreNovus/ainalyn-sdk/blob/master/examples/submit_agent_example.py) - Agent submission workflow
- [price_monitor_agent.py](https://github.com/CoreNovus/ainalyn-sdk/blob/master/examples/price_monitor_agent.py) - Complete price monitoring agent

## Contributing

We welcome contributions! See [CONTRIBUTING.md](https://github.com/CoreNovus/ainalyn-sdk/blob/master/CONTRIBUTING.md) for guidelines.

**For newcomers**, look for issues labeled [`good first issue`](https://github.com/CoreNovus/ainalyn-sdk/labels/good%20first%20issue).

## Requirements

- Python 3.11, 3.12, or 3.13
- PyYAML >= 6.0

## License

[MIT License](https://github.com/CoreNovus/ainalyn-sdk/blob/master/LICENSE) - see LICENSE file for details.

## Support

- [Documentation](http://docs.ainalyn.corenovus.com/)
- [Report Issues](https://github.com/CoreNovus/ainalyn-sdk/issues)
- [Discussions](https://github.com/CoreNovus/ainalyn-sdk/issues)

---

Built by the CoreNovus Team
