Metadata-Version: 2.5
Name: acppool
Version: 0.3.0
Summary: A worker pool for coding agents (Claude Code, Codex, any ACP agent), steered by a human.
Project-URL: Homepage, https://github.com/lunochkin/acppool
Project-URL: Issues, https://github.com/lunochkin/acppool/issues
Author-email: Maksim Lunochkin <maksim@lunochkin.com>
License-Expression: MIT
License-File: LICENSE
Keywords: acp,agent-client-protocol,claude-code,codex,coding-agents,human-in-the-loop
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# acppool

acppool lets a Python application give work to coding agents through the Agent Client Protocol (ACP). Your app owns the tasks. A separate supervisor runs the agents, keeps active turns going when your app restarts, and forwards questions and permission requests to your users. Optional React components put a **Give to worker** button and the worker’s conversation on your existing board.

![A worker receives a task, writes hello.py, and waits for permission to run it](https://raw.githubusercontent.com/lunochkin/acppool/main/docs/board.gif)

## Quickstart

Try the terminal board with Python 3.10+ on macOS or Linux. The included fake agent runs locally with just the Python standard library.

In your shell, clone the repository and start the board.

```sh
git clone https://github.com/lunochkin/acppool.git
cd acppool
python3 examples/board.py
```

At the board’s `>` prompt, start a worker named Ada and give it a job.

```text
join fake /tmp ada
give ada hello
```

Look for this line in the output from the worker.

```text
ada · echo:hello
```

Press Ctrl-D to leave. Run `python3 examples/board.py` again and enter `who` to see Ada. The board stores its state in `examples/.board`. Its supervisor keeps running when you close the board. If the **supervisor itself** restarts, it tries to recover each session and marks an active turn as interrupted. The default app leaves that job open for a person to continue.

### Try the browser board

From the repository root, use Node.js and npm to build the example page and start its Python server.

```sh
(cd examples/web && npm ci && npm run build)
python3 examples/web/server.py
```

Open [the local board](http://localhost:8791), add a task, and give it to Ada. The browser and terminal examples share workers. On a fresh board, choose **Add a worker**, select **Fake agent (echoes)**, and click **Start it**.

## Install and version compatibility

To use the Python library in your application, install it in your Python environment.

```sh
python3 -m pip install acppool
```

When upgrading from **0.2.0 to 0.3.0**, update the board and supervisor together. Pass the displayed question ID as the fourth argument to `control.answer` and `pool.answer` so the board can reject stale answers. [v0.2.0 README](https://github.com/lunochkin/acppool/blob/v0.2.0/README.md)

The Python library has no third-party runtime dependencies. Each real agent needs its own runtime and credentials. The optional React components are TypeScript source that you link into your frontend build. [UI setup](ui/README.md)

## Supported agents

| Agent | How to connect it | During a turn | Session recovery |
| --- | --- | --- | --- |
| Claude Code | [Claude ACP adapter](https://github.com/agentclientprotocol/claude-agent-acp) | Send a message | Resume |
| Codex | [Codex ACP adapter](https://github.com/agentclientprotocol/codex-acp) | Send a message | Resume |
| Other ACP agents, including Goose | Register the agent command with `supervisor.Kind` | Steering if the adapter offers it | Resume or load if supported |

### Try Claude Code

With Claude Code signed in and Node.js installed, run these shell commands from the repository root. The example creates a dedicated working folder for Claude.

```sh
(cd examples/acp && npm install)
mkdir -p /tmp/acppool-claude-demo
python3 examples/board.py
```

At the board prompt, use a different worker name from the fake-agent demo.

```text
join claude /tmp/acppool-claude-demo cleo
give cleo Use the ask tool to ask me which language to use, then write hello.py in that language.
```

The board prints the numbered `answer` command when Cleo asks. acppool forwards the permission requests the adapter issues. The example Claude configuration pre-allows Bash, Write, and Edit, so those tools can run without a prompt. [Example tool policy](examples/agentd.py)

## Integrate with your app

```text
React page → your routes → Python app → Unix socket → supervisor → ACP adapter → agent
                              │                          │
                         jobs and queues            session event logs
```

**Supervisor process.** Run the supervisor separately from your app. From the repository root, the following starts the example configuration with its fake and Claude adapters and its MCP tools. If you ran the quickstart, its supervisor is already running and you can go straight to the application block.

```sh
python3 examples/agentd.py
```

**Application process.** In another shell at the repository root, use the example’s socket client to start a worker and give it one job. The default `push.App` uses the job’s name as its prompt and finishes the job after a successful turn. The final line keeps the delivery loop running. In your application, run that loop in a background thread.

```sh
PYTHONPATH=examples python3 - <<'PY'
from acppool import control, pool, push
from agentd import DB
from board import Supervisor

rpc = Supervisor()
store = pool.SqliteStore(DB)
app = push.App(store, rpc)
worker = pool.join(store, set(rpc.agents()), "/tmp", "fake")
rpc.call("start", name=worker, agent="fake", cwd="/tmp")
control.give(app, worker, {"kind": "task", "name": "hello"})
print(f"Gave hello to {worker}", flush=True)
push.run(lambda: app)
PY
```

Use Ctrl-C to stop this application loop. For a complete integration, see how the web board translates a task ID into a brief and connects React actions to the Python controls. [Example backend](examples/web/server.py) · [React bindings](examples/web/src/board.tsx) · [Board integration guide](docs/boards.md)

## Help and contributing

Maksim Lunochkin maintains acppool. For a bug report, include your Python version, operating system, agent and adapter, and the smallest steps that reproduce the problem. [Open an issue](https://github.com/lunochkin/acppool/issues)

To check a change, run the Python suite from the repository root. It uses a miniature ACP agent and temporary directories. CI also checks lint, Python types, and the example frontend on pull requests. [CI workflow](.github/workflows/ci.yml)

```sh
python3 -m unittest discover -s acppool/tests -t .
```

## License

[MIT](LICENSE)
