Metadata-Version: 2.4
Name: doeff-agents
Version: 0.1.1
Summary: Agent session management for coding agents (Claude, Codex, Gemini) in tmux
Project-URL: Homepage, https://github.com/proboscis/doeff
Project-URL: Repository, https://github.com/proboscis/doeff
Author-email: Kento Masui <nameissoap@gmail.com>
License: MIT
Keywords: agents,claude,codex,doeff,gemini,session,tmux
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.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: click>=8.0.0
Requires-Dist: doeff>=0.1.0
Requires-Dist: rich>=13.0.0
Provides-Extra: dev
Requires-Dist: doeff-preset; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Provides-Extra: examples
Requires-Dist: doeff-preset; extra == 'examples'
Description-Content-Type: text/markdown

# doeff-agents

Agent session management for coding agents (Claude, Codex, Gemini) in tmux.

## Installation

```bash
pip install doeff-agents
```

## Quick Start

### Python API

```python
from doeff_agents import (
    session_scope, monitor_session, send_message,
    LaunchConfig, AgentType, SessionStatus
)
from pathlib import Path

config = LaunchConfig(
    agent_type=AgentType.CLAUDE,
    work_dir=Path("/path/to/project"),
    prompt="Read the README and summarize the project",
)

# Context manager ensures cleanup on exit/exception
with session_scope("my-agent-session", config) as session:
    while not session.is_terminal:
        new_status = monitor_session(session)
        if new_status:
            print(f"Status changed to: {new_status}")

        if session.status == SessionStatus.BLOCKED:
            send_message(session, "Continue with the next step")

        time.sleep(1)
```

### CLI

```bash
# Launch an agent
doeff-agents run --agent claude --work-dir . --prompt "Fix the bug"

# List sessions
doeff-agents ps

# Attach to a session
doeff-agents attach my-session

# Stop a session
doeff-agents stop my-session

# Monitor a session
doeff-agents watch my-session
```

## Features

- **Tmux abstraction**: Pythonic wrapper around tmux commands
- **Adapter pattern**: Protocol-based adapters for different agents
- **Status monitoring**: Detect agent state from pane output
- **Session lifecycle**: Create, monitor, send, capture, kill
- **Async support**: Both sync and async APIs
- **Context managers**: Safe cleanup on exceptions/cancellation

## Supported Agents

- Claude Code (`claude`)
- OpenAI Codex (`codex`)
- Gemini CLI (`gemini`)

## License

MIT