Metadata-Version: 2.4
Name: agentwrap
Version: 0.1.1
Summary: Wrap agents, ship APIs - Turn agent CLIs into libraries and OpenAI-compatible servers
Project-URL: Homepage, https://github.com/dashi0/agentwrap
Project-URL: Repository, https://github.com/dashi0/agentwrap
Project-URL: Issues, https://github.com/dashi0/agentwrap/issues
Author: AgentWrap Contributors
License: MIT
Keywords: agent,ai,api,capsule,codex,mcp,openai,wrapper
Classifier: Development Status :: 3 - Alpha
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: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Requires-Dist: click>=8.1.7
Requires-Dist: fastapi>=0.104.0
Requires-Dist: jsonschema>=4.25.1
Requires-Dist: pyyaml>=6.0.1
Requires-Dist: toml>=0.10.2
Requires-Dist: uvicorn>=0.24.0
Provides-Extra: dev
Requires-Dist: httpx>=0.25.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.12.0; extra == 'dev'
Requires-Dist: pytest>=7.4.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# AgentWrap

Wrap agents, ship APIs - Turn agent CLIs into libraries and OpenAI-compatible servers

## Prerequisites

CodexAgent requires the OpenAI Codex CLI to be installed:

```bash
npm install -g @openai/codex
```

**Note**: Unlike the TypeScript package which bundles Codex as a dependency, Python cannot auto-install Node.js CLI tools. You must install Codex globally.

📚 **Detailed installation guide**: See [docs/codex-installation-guide.md](https://github.com/dashi0/agentwrap/blob/master/docs/codex-installation-guide.md) for platform-specific instructions, Docker setup, and troubleshooting.

## Installation

```bash
pip install agentwrap
```

## Quick Start

```python
from agentwrap import CodexAgent, OpenAICompatibleServer

# Create and configure agent
agent = CodexAgent()
agent.configure({
    "agent_config": {"type": "codex-agent", "api_key": "OPENA_API_KEY"},
    "skills": [
      {"type": "anthropic-skill", "path": "./skills/random"}
    ]
})

# Use as library
for event in agent.run("Generate a random number for me"):
    print(event)

# Or start as OpenAI-compatible API server
server = OpenAICompatibleServer(agent)
await server.start_http_server({"port": 8000})
```
[More examples](./agentwrap/examples.py).

## Features

- 🤖 Wrap agent CLIs as Python libraries
- 🔌 OpenAI-compatible API server
- 🛠️ Function calling support
- 📦 MCP (Model Context Protocol) integration
- 🔄 Streaming responses

## Documentation

For full documentation, visit: https://github.com/dashi0/agentwrap

## License

MIT
