Metadata-Version: 2.4
Name: trinity-agent
Version: 0.2.2
Summary: Three minds, one context — Multi-agent AI orchestrator for Claude Code, Codex, and Gemini CLI.
Project-URL: Homepage, https://github.com/hongdangmoo49/Trinity
Project-URL: Repository, https://github.com/hongdangmoo49/Trinity
Project-URL: Issues, https://github.com/hongdangmoo49/Trinity/issues
Author: Trinity Contributors
License: MIT
License-File: LICENSE
Keywords: ai,claude,codex,deliberation,gemini,multi-agent,orchestrator
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.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: click>=8.1
Requires-Dist: rich>=13.0
Requires-Dist: tomli>=2.0; python_version < '3.11'
Description-Content-Type: text/markdown

# Trinity Agent

**Three minds, one context.** Multi-agent AI orchestrator that unifies Claude Code, Codex, and Gemini CLI through shared context, round-based deliberation, and task distribution.

## Quick Start

```bash
# Install
pip install trinity-agent

# Initialize in your project
trinity init

# Run a deliberation
trinity ask "인증 시스템 아키텍처를 설계해줘"

# Interactive mode (tmux)
trinity ask "질문" --interactive
```

## How It Works

```
┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│   Claude    │     │    Codex    │     │   Gemini    │
│  (Architect)│     │(Implementer)│     │  (Reviewer) │
└──────┬──────┘     └──────┬──────┘     └──────┬──────┘
       │                   │                   │
       └───────────┬───────┴───────────────────┘
                   │
           ┌───────┴───────┐
           │   Orchestrator │
           │  Shared Context│
           │   Consensus    │
           └───────────────┘
```

1. **Shared Context** — All agents read/write to a shared markdown file
2. **Round-based Deliberation** — Agents discuss in rounds until consensus
3. **Consensus Detection** — Keyword-based agreement detection
4. **Task Distribution** — Assign tasks based on agent strengths

## Commands

| Command | Description |
|---------|-------------|
| `trinity init` | Initialize `.trinity/` in current directory |
| `trinity ask "question"` | Run deliberation on a prompt |
| `trinity status` | Show agent status |
| `trinity context` | Display shared context |
| `trinity config [key]` | Show configuration |
| `trinity logs` | View orchestrator logs |
| `trinity reset --keep-context` | Reset session (preserve context) |
| `trinity attach` | Attach to tmux session |
| `trinity status-watch` | Live status dashboard |

## Configuration

Edit `.trinity/trinity.config`:

```toml
[general]
session_name = "trinity"
max_deliberation_rounds = 5
consensus_threshold = 0.6

[agents.claude]
provider = "claude-code"
cli_command = "claude"
role_prompt = "You are the Architect..."
enabled = true

[agents.codex]
provider = "codex"
cli_command = "codex"
role_prompt = "You are the Implementer..."
enabled = true

[agents.gemini]
provider = "gemini-cli"
cli_command = "gemini"
role_prompt = "You are the Reviewer..."
enabled = true
```

## Architecture

| Module | Description |
|--------|-------------|
| `trinity.orchestrator` | Top-level coordinator |
| `trinity.agents` | Provider-specific agent wrappers (Claude, Codex, Gemini) |
| `trinity.deliberation` | Protocol, consensus, task distribution |
| `trinity.completion` | Completion detection (Hook, PromptReturn, Idle) |
| `trinity.context` | Shared context engine, monitor, session rotation |
| `trinity.health` | Agent health monitoring |
| `trinity.workspace` | Workspace isolation (git worktree), managed home |
| `trinity.retry` | Retry with exponential backoff |
| `trinity.error_handler` | Crash recovery and agent respawn |

## Requirements

- Python 3.10+
- [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) (optional)
- [Codex CLI](https://github.com/openai/codex) (optional)
- [Gemini CLI](https://github.com/google-gemini/gemini-cli) (optional)
- tmux (for interactive mode)

## Development

```bash
git clone https://github.com/hongdangmoo49/Trinity.git
cd Trinity
uv sync
uv run pytest tests/ -v
```

## License

MIT
