Metadata-Version: 2.4
Name: agentmesh_primitives
Version: 3.4.0
Summary: Shared primitive data models for Agent OS - failure types, severity levels, and base structures
Author-email: Microsoft Corporation <agentgovtoolkit@microsoft.com>
License: MIT
Project-URL: Homepage, https://github.com/microsoft/agent-governance-toolkit
Project-URL: Repository, https://github.com/microsoft/agent-governance-toolkit.git
Project-URL: Issues, https://github.com/microsoft/agent-governance-toolkit/issues
Keywords: agent,ai,llm,primitives,models,failures,multi-agent
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
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: Operating System :: OS Independent
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: pydantic<3.0,>=2.4.0
Provides-Extra: dev
Requires-Dist: pytest<10.0,>=7.4.0; extra == "dev"
Requires-Dist: mypy<2.0,>=1.8.0; extra == "dev"
Requires-Dist: ruff<1.0,>=0.1.0; extra == "dev"

# Agent Primitives

> **Part of [Agent OS](https://github.com/microsoft/agent-governance-toolkit)** - Kernel-level governance for AI agents

**Layer 1 Primitive** - Shared data models for the Agent OS stack.

## Purpose

This package provides foundational data models used across multiple Agent OS components. By extracting these primitives into a dedicated Layer 1 package, we ensure proper dependency layering:

```
Layer 1 (Primitives): cmvk, emk, caas, agent-primitives
Layer 2 (Infrastructure): iatp, amb, atr
Layer 3 (Kernel): agent-control-plane  
Layer 4/5 (Intelligence): scak, mute-agent
```

## Installation

```bash
pip install agentmesh-primitives
```

## Models

### Failure Models

Core failure tracking primitives used by iatp, scak, and other components:

```python
from agent_primitives import (
    FailureType,
    FailureSeverity,
    AgentFailure,
    FailureTrace,
)

# Create a failure record
failure = AgentFailure(
    agent_id="agent-123",
    failure_type=FailureType.TIMEOUT,
    error_message="Request timed out after 30s",
    severity=FailureSeverity.MEDIUM,
)
```

### Available Types

- **FailureType**: Enumeration of failure categories (TIMEOUT, INVALID_ACTION, RESOURCE_EXHAUSTED, etc.)
- **FailureSeverity**: Severity levels (LOW, MEDIUM, HIGH, CRITICAL)
- **AgentFailure**: Core failure record with agent ID, type, message, and context
- **FailureTrace**: Detailed trace including reasoning chain and failed action

## Design Principles

1. **Zero Agent OS Dependencies**: This package only depends on `pydantic`
2. **Backward Compatible**: Other packages can re-export these models
3. **Type Safe**: Full typing support with `py.typed` marker

## License

MIT
