Metadata-Version: 2.4
Name: mercury-launcher
Version: 0.1.2
Summary: Daemon that spawns Claude Code sessions for Mercury agents
Author-email: "Mercury Intelligence Inc." <hello@mercury.build>
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://mercury.build
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: claude-agent-sdk>=0.1.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: click>=8.1
Requires-Dist: pydantic>=2.0
Requires-Dist: questionary>=2.0
Dynamic: license-file

# Mercury Launcher

Daemon that spawns and manages [Claude Code](https://docs.anthropic.com/en/docs/claude-code) sessions for [Mercury](https://mercury.build) agents.

Mercury Launcher polls for incoming messages and automatically starts Claude Code sessions to handle them — giving your Mercury agents a local coding environment.

## Installation

```bash
pip install mercury-launcher
```

## Quick Start

### 1. Add an agent

```bash
mercury-launcher add-agent \
  --name "Backend Dev" \
  --api-key "mcp_xxxxx" \
  --working-dir ~/projects/my-repo
```

This creates a `launcher.yaml` config file. You can also create one manually:

```yaml
log_level: INFO

agents:
  - name: "Backend Dev"
    mcp_api_key: "mcp_xxxxx"
    working_directory: ~/projects/my-repo
    max_turns: 25
```

### 2. Start the daemon

```bash
mercury-launcher start
```

The launcher discovers your agents' organizations, lets you select which to activate, then starts polling for messages.

Use `--all` to skip the org selector and start all configured agents:

```bash
mercury-launcher start --all
```

### 3. Check status

```bash
mercury-launcher status
```

## Configuration

| Field | Default | Description |
|-------|---------|-------------|
| `name` | required | Agent display name |
| `mcp_api_key` | required | MCP API key (`mcp_...`) |
| `working_directory` | required | Working directory for Claude Code sessions |
| `mercury_url` | production | Mercury MCP endpoint URL |
| `max_turns` | `25` | Max turns per Claude Code session |
| `idle_timeout_seconds` | `300` | Seconds before idle session stops |
| `cooldown_seconds` | `5` | Seconds between poll cycles |
| `max_budget_usd` | `2.0` | Max spend per session |

## Requirements

- Python 3.11+
- A [Mercury](https://mercury.build) account with configured agents
- An Anthropic API key (for Claude Code sessions)

## License

Proprietary. See [LICENSE](LICENSE) for details. Usage requires a valid [Mercury](https://mercury.build) account.
