acppool 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,222 @@
1
+ """The supervisor over a fake ACP agent: turns, steering, cancel, permissions, crashes, restarts."""
2
+
3
+ import json
4
+ import os
5
+
6
+ from acppool import claude, supervisor
7
+ from acppool.tests.base import SupervisorCase
8
+
9
+
10
+ class Supervising(SupervisorCase):
11
+ """The agents' supervisor over a fake ACP agent: turns, steering, cancel, permissions, crashes, restarts."""
12
+
13
+ def test_how_a_turn_ended_is_kept_with_the_agent(self):
14
+ self.state("idle")
15
+ self.call("prompt", name="w", text="hi")
16
+ self.until(lambda: (self.live()["w"].get("turn") or {}).get("stop") == "end_turn")
17
+ self.call("prompt", name="w", text="slow")
18
+ self.state("busy")
19
+ self.assertIsNone(self.live()["w"]["turn"]["stop"])
20
+ self.call("cancel", name="w")
21
+ self.until(lambda: self.live()["w"]["turn"]["stop"] == "cancelled")
22
+
23
+ def test_a_prompt_runs_one_turn_and_logs_it(self):
24
+ self.state("idle")
25
+ self.call("prompt", name="w", text="hi")
26
+ self.until(lambda: any(e["kind"] == "turn" for e in self.log()))
27
+ self.state("idle")
28
+ self.assertEqual([e["kind"] for e in self.log()], ["session", "prompt", "tool", "tool_done", "message", "turn"])
29
+ self.assertEqual(self.log()[4]["text"], "echo:hi")
30
+ self.assertEqual(self.live()["w"]["usage"], {"used": 5, "size": 100, "cost": {"amount": 0.25, "currency": "USD"}})
31
+ _, offset = self.events()
32
+ self.assertEqual(self.events(offset), ([], offset))
33
+
34
+ def test_a_turn_logs_what_it_added_to_the_sessions_cost(self):
35
+ self.state("idle")
36
+ for text in ("a", "b"):
37
+ self.call("prompt", name="w", text=text)
38
+ self.until(lambda: [e["kind"] for e in self.log()].count("turn") == ("a", "b").index(text) + 1)
39
+ self.assertEqual([e["cost"] for e in self.log() if e["kind"] == "turn"], [0.25, 0.25])
40
+
41
+ def test_a_busy_agent_is_steered_or_cancelled_not_prompted(self):
42
+ self.call("prompt", name="w", text="slow")
43
+ self.state("busy")
44
+ with self.assertRaisesRegex(RuntimeError, "busy"):
45
+ self.call("prompt", name="w", text="more")
46
+ self.assertEqual(self.call("steer", name="w", text="x")["outcome"], "injected")
47
+ self.state("idle")
48
+ self.assertIn("steered:x", [e.get("text") for e in self.log()])
49
+ self.call("prompt", name="w", text="slow")
50
+ self.state("busy")
51
+ self.call("cancel", name="w")
52
+ self.state("idle")
53
+ self.assertEqual(self.log()[-1]["stop"], "cancelled")
54
+
55
+ def test_a_permission_waits_for_its_answer(self):
56
+ self.call("prompt", name="w", text="ask")
57
+ self.state("asking")
58
+ self.assertEqual([o["id"] for o in self.live()["w"]["permission"]["options"]], ["yes", "no"])
59
+ with self.assertRaisesRegex(RuntimeError, "no option"):
60
+ self.call("answer", name="w", option="maybe")
61
+ self.call("answer", name="w", option="yes")
62
+ self.state("idle")
63
+ self.assertIn("allowed:yes", [e.get("text") for e in self.log()])
64
+ self.assertIsNone(self.live()["w"]["permission"])
65
+
66
+ def test_a_crashed_agent_and_a_restarted_supervisor_resume_the_session(self):
67
+ self.state("idle")
68
+ first = self.live()["w"]["session"]
69
+ self.call("prompt", name="w", text="die")
70
+ self.until(lambda: "resumed" in [e["kind"] for e in self.log()])
71
+ self.state("idle")
72
+ self.halt()
73
+ self.serve()
74
+ self.until(lambda: [e["kind"] for e in self.log()].count("resumed") == 2)
75
+ self.state("idle")
76
+ self.assertEqual(self.live()["w"]["session"], first)
77
+ fresh = self.call("reset", name="w")["session"]
78
+ self.assertNotEqual(fresh, first)
79
+ self.assertEqual(self.live()["w"]["session"], fresh)
80
+ self.call("stop", name="w")
81
+ self.assertEqual(self.live(), {})
82
+
83
+ def test_chrome_restarts_the_adapter_on_the_same_session_and_outlives_a_restart(self):
84
+ self.state("idle")
85
+ with self.assertRaisesRegex(RuntimeError, "Claude's only"):
86
+ self.call("chrome", name="w", on=True)
87
+ self.fake.chrome = True
88
+ first = self.live()["w"]["session"]
89
+ self.call("prompt", name="w", text="slow")
90
+ self.state("busy")
91
+ with self.assertRaisesRegex(RuntimeError, "wait for its turn"):
92
+ self.call("chrome", name="w", on=True)
93
+ self.call("cancel", name="w")
94
+ self.state("idle")
95
+ self.call("chrome", name="w", on=True)
96
+ self.state("idle")
97
+ self.assertTrue(self.live()["w"]["chrome"])
98
+ self.assertEqual(self.live()["w"]["session"], first)
99
+ self.assertEqual([e["kind"] for e in self.log()][-2:], ["chrome", "resumed"])
100
+ self.assertNotIn("crashed", [e["kind"] for e in self.log()])
101
+ self.halt()
102
+ self.serve()
103
+ self.until(lambda: [e["kind"] for e in self.log()].count("resumed") == 2)
104
+ self.assertTrue(self.live()["w"]["chrome"])
105
+
106
+ def test_chrome_is_a_flag_on_claudes_session_only_when_on(self):
107
+ a = supervisor.Agent(supervisor.Supervisor(self.config), "x", "claude", self.dir.name)
108
+ self.assertNotIn("extraArgs", a.setup()["_meta"]["claudeCode"]["options"])
109
+ a.chrome = True
110
+ self.assertEqual(a.setup()["_meta"]["claudeCode"]["options"]["extraArgs"], {"chrome": ""})
111
+
112
+ def test_rate_limits_are_kept_by_window_where_the_kind_reports_them(self):
113
+ self.state("idle")
114
+ self.call("prompt", name="w", text="a")
115
+ self.until(lambda: "turn" in [e["kind"] for e in self.log()])
116
+ self.assertFalse(self.config.rates.exists()) # the fake kind reads none
117
+ self.fake.rate = claude.rate
118
+ self.call("prompt", name="w", text="b")
119
+ self.until(self.config.rates.exists)
120
+ self.assertEqual(json.loads(self.config.rates.read_text())["five_hour"]["status"], "allowed")
121
+
122
+ def test_a_crash_mid_turn_leaves_the_turn_interrupted(self):
123
+ self.state("idle")
124
+ self.call("prompt", name="w", text="slow")
125
+ self.state("busy")
126
+ os.kill(int(self.live()["w"]["session"][1:].split("-")[0]), 9)
127
+ self.until(lambda: "resumed" in [e["kind"] for e in self.log()])
128
+ self.state("idle")
129
+ self.assertEqual(self.live()["w"]["turn"]["stop"], "interrupted")
130
+
131
+ def test_a_session_that_cannot_be_resumed_starts_afresh_and_its_turn_counts_as_interrupted(self):
132
+ self.state("idle")
133
+ self.halt()
134
+ known = json.loads(self.config.agents.read_text())
135
+ known["w"]["session"] = "lost"
136
+ self.config.agents.write_text(json.dumps(known))
137
+ self.serve()
138
+ self.state("idle")
139
+ self.assertNotEqual(self.live()["w"]["session"], "lost")
140
+ self.assertEqual(self.live()["w"]["turn"]["stop"], "interrupted")
141
+ self.assertEqual(self.log()[-1]["why"], "lost")
142
+
143
+ def test_extra_folders_go_with_every_session_and_outlive_a_restart(self):
144
+ self.call("start", name="d", agent="fake", cwd=self.dir.name, dirs=["/tmp"])
145
+ self.until(lambda: self.live().get("d", {}).get("state") == "idle")
146
+ self.assertEqual(self.live()["d"]["dirs"], ["/tmp"])
147
+ a = supervisor.Agent(supervisor.Supervisor(self.config), "x", "fake", self.dir.name, dirs=["/tmp"])
148
+ self.assertEqual(a.setup()["additionalDirectories"], ["/tmp"])
149
+ self.assertNotIn("additionalDirectories", supervisor.Agent(supervisor.Supervisor(self.config), "y", "fake", self.dir.name).setup())
150
+ self.halt()
151
+ self.serve()
152
+ self.until(lambda: self.live().get("d", {}).get("state") == "idle")
153
+ self.assertEqual(self.live()["d"]["dirs"], ["/tmp"])
154
+
155
+ def test_a_kinds_session_options_are_set_on_every_session_it_opens(self):
156
+ self.config.kinds["opts"] = supervisor.Kind(command=self.fake.command, options={"mode": "auto", "model": "m"})
157
+ self.call("start", name="o", agent="opts", cwd=self.dir.name)
158
+ self.until(lambda: self.live().get("o", {}).get("state") == "idle")
159
+
160
+ def options():
161
+ n = [e["kind"] for e in self.events_of("o")].count("turn")
162
+ self.call("prompt", name="o", text="options")
163
+ self.until(lambda: [e["kind"] for e in self.events_of("o")].count("turn") == n + 1)
164
+ return json.loads([e for e in self.events_of("o") if e["kind"] == "message"][-1]["text"])
165
+
166
+ self.assertEqual(options(), {"mode": "auto", "model": "m"})
167
+ self.call("reset", name="o")
168
+ self.assertEqual(options(), {"mode": "auto", "model": "m"})
169
+ self.halt()
170
+ self.serve() # a new adapter resumes the session: it starts at its own defaults again
171
+ self.until(lambda: [e["kind"] for e in self.events_of("o")].count("resumed") == 1)
172
+ self.until(lambda: self.live().get("o", {}).get("state") == "idle")
173
+ self.assertEqual(options(), {"mode": "auto", "model": "m"})
174
+
175
+ def test_an_option_the_adapter_refuses_fails_the_start_with_its_reason(self):
176
+ self.config.kinds["bad"] = supervisor.Kind(command=self.fake.command, options={"model": "bad"})
177
+ with self.assertRaisesRegex(RuntimeError, "no such value"):
178
+ self.call("start", name="b", agent="bad", cwd=self.dir.name)
179
+ self.assertNotIn("b", self.live()) # a start that fails leaves no agent behind
180
+
181
+ def test_codex_works_in_its_folder_and_is_steered_as_claude_is(self):
182
+ from acppool import codex
183
+ k = codex.codex(lambda: ["codex-acp"])
184
+ self.assertEqual((k.options, k.steer, k.chrome), ({"mode": "agent"}, "_session/steering", False))
185
+ self.assertEqual(codex.codex(lambda: [], model="gpt-6.2-sol").options, {"mode": "agent", "model": "gpt-6.2-sol"})
186
+
187
+ def test_a_steer_the_turn_no_longer_takes_is_refused_for_the_app_to_queue(self):
188
+ self.state("idle")
189
+ self.call("prompt", name="w", text="slow")
190
+ self.state("busy")
191
+ with self.assertRaisesRegex(RuntimeError, "noRunningTurn"):
192
+ self.call("steer", name="w", text="late") # the fake's turn "ended" just before it came
193
+ self.assertNotIn("steer", [e["kind"] for e in self.log()])
194
+ self.call("steer", name="w", text="now")
195
+ self.until(lambda: any(e["kind"] == "turn" for e in self.log()))
196
+
197
+ def test_an_agent_that_only_loads_a_session_takes_it_up_without_logging_its_history_again(self):
198
+ import sys
199
+ from acppool.tests.base import FAKE
200
+ self.config.kinds["loader"] = supervisor.Kind(command=lambda: [sys.executable, str(FAKE), "--load-only"])
201
+ self.call("start", name="l", agent="loader", cwd=self.dir.name)
202
+ self.until(lambda: self.live().get("l", {}).get("state") == "idle")
203
+ first = self.live()["l"]["session"]
204
+ self.call("prompt", name="l", text="hi")
205
+ self.until(lambda: any(e["kind"] == "turn" for e in self.events_of("l")))
206
+ self.halt()
207
+ self.serve()
208
+ self.until(lambda: "resumed" in [e["kind"] for e in self.events_of("l")])
209
+ self.until(lambda: self.live().get("l", {}).get("state") == "idle")
210
+ self.assertEqual(self.live()["l"]["session"], first)
211
+ self.assertEqual([e["text"] for e in self.events_of("l") if e["kind"] == "message"], ["echo:hi"])
212
+ self.assertEqual(self.live()["l"]["usage"], {"used": 9, "size": 100}) # what it says of the session now is kept
213
+
214
+ def test_claudes_own_options_go_with_the_app_tools_allowed(self):
215
+ a = supervisor.Agent(supervisor.Supervisor(self.config), "x", "claude", self.dir.name)
216
+ servers = [{"name": "pool"}]
217
+ k = claude.claude(lambda: [], {"settingSources": ["project"], "allowedTools": ["Bash"]})
218
+ self.assertEqual(k.meta(a, servers), {"claudeCode": {"options": {"allowedTools": ["mcp__pool", "Bash"], "settingSources": ["project"]}}})
219
+ self.assertEqual(claude.claude(lambda: []).meta(a, servers), {"claudeCode": {"options": {"allowedTools": ["mcp__pool"]}}})
220
+
221
+ def test_the_socket_is_the_users_alone(self):
222
+ self.assertEqual(self.sock.stat().st_mode & 0o777, 0o600)
acppool/uploads.py ADDED
@@ -0,0 +1,64 @@
1
+ """Files the human attaches to a message: kept in a folder by their content, and named in the message's text as
2
+ `![name](upload:<id>)`, so a message keeps them whichever way it reaches the agent (steered into its turn, queued, an
3
+ answer). `prompt`, as `Config.prompt`, turns each into what the agent reads: its path, and an image block for an image."""
4
+
5
+ import base64
6
+ import hashlib
7
+ import mimetypes
8
+ import re
9
+ from pathlib import Path
10
+
11
+ ID = r"[0-9a-f]{16}\.[a-z0-9]{1,8}"
12
+ LINK = re.compile(rf"!\[([^\]]*)\]\(upload:({ID})\)")
13
+ IMAGES = {"image/png", "image/jpeg", "image/gif", "image/webp"} # what a model reads as an image
14
+
15
+
16
+ def link(name: str, id_: str) -> str:
17
+ return f"![{re.sub(r'[][]', '', name)}](upload:{id_})"
18
+
19
+
20
+ def kind_of(f: Path) -> str:
21
+ return mimetypes.guess_type(f.name)[0] or "application/octet-stream"
22
+
23
+
24
+ class Uploads:
25
+ def __init__(self, folder: Path, max_bytes: int = 20 << 20):
26
+ self.folder, self.max = Path(folder), max_bytes
27
+
28
+ def save(self, name: str, kind: str, data: str) -> dict:
29
+ """A file sent base64: kept under its hash, so the same file sent twice is kept once."""
30
+ raw = base64.b64decode(data, validate=True)
31
+ if not raw:
32
+ raise ValueError("an empty file")
33
+ if len(raw) > self.max:
34
+ raise ValueError(f"{name} is over {self.max >> 20} MB")
35
+ ext = (Path(name).suffix[1:] or (mimetypes.guess_extension(kind) or ".bin")[1:]).lower()
36
+ if not re.fullmatch(r"[a-z0-9]{1,8}", ext):
37
+ ext = "bin"
38
+ id_ = f"{hashlib.sha256(raw).hexdigest()[:16]}.{ext}"
39
+ self.folder.mkdir(parents=True, exist_ok=True)
40
+ (self.folder / id_).write_bytes(raw)
41
+ return {"id": id_, "name": name, "type": kind, "size": len(raw), "link": link(name, id_)}
42
+
43
+ def path_of(self, id_: str) -> Path | None:
44
+ if not re.fullmatch(ID, id_):
45
+ return None
46
+ f = self.folder / id_
47
+ return f if f.is_file() else None
48
+
49
+ def prompt(self, text: str, images: bool = True) -> list[dict]:
50
+ """A message as the agent's prompt: each attachment named by its path in the text, and, when the agent reads
51
+ images, each image after the text as one."""
52
+ blocks: list[dict] = []
53
+
54
+ def named(m: re.Match) -> str:
55
+ f = self.path_of(m.group(2))
56
+ if not f:
57
+ return f"[attachment {m.group(1)!r}: no longer kept]"
58
+ kind = kind_of(f)
59
+ if images and kind in IMAGES:
60
+ blocks.append({"type": "image", "mimeType": kind, "data": base64.b64encode(f.read_bytes()).decode()})
61
+ return f"[image {m.group(1)!r}, attached below; its file: {f}]"
62
+ return f"[attached file {m.group(1)!r}: {f}]"
63
+
64
+ return [{"type": "text", "text": LINK.sub(named, text)}, *blocks]
@@ -0,0 +1,157 @@
1
+ Metadata-Version: 2.5
2
+ Name: acppool
3
+ Version: 0.1.0
4
+ Summary: A worker pool for coding agents (Claude Code, Codex, any ACP agent), steered by a human.
5
+ Project-URL: Homepage, https://github.com/lunochkin/acppool
6
+ Project-URL: Issues, https://github.com/lunochkin/acppool/issues
7
+ Author-email: Maksim Lunochkin <maksim@lunochkin.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: acp,agent-client-protocol,claude-code,codex,coding-agents,human-in-the-loop
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: MacOS
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Software Development
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+
20
+ # acppool
21
+
22
+ A worker pool for coding agents, steered by a human. You bring the jobs and the board; acppool runs the agents,
23
+ queues their work, holds their questions and permission requests until a person answers, and keeps every turn going
24
+ when your app restarts.
25
+
26
+ ![A Claude worker asks a question, gets an answer, and finishes its turn while the board is closed](https://raw.githubusercontent.com/lunochkin/acppool/main/docs/demo.gif)
27
+
28
+ It speaks the [Agent Client Protocol](https://agentclientprotocol.com) (ACP) to the agents, so Claude Code, Codex,
29
+ Goose and any other ACP agent run behind the same API. The library is standard-library Python with no packages to
30
+ install; each agent brings its own runtime (Claude's and Codex's ACP adapters need Node.js, Goose needs nothing more).
31
+
32
+ ## Why
33
+
34
+ There are SDKs that talk to one agent, and finished apps that manage many of them. acppool is the layer in between:
35
+ the part every agent board builds for itself.
36
+
37
+ - **Turns outlive your app.** A supervisor process owns the agents. Restart or redeploy the board, and running turns
38
+ carry on; restart the supervisor, and each agent resumes its session.
39
+ - **A human stays in the loop.** An agent can `ask` the human (an MCP tool acppool gives it), and a permission
40
+ request waits until someone answers it. Nothing is decided for the human by a timeout or a default policy.
41
+ - **It goes into your app.** No UI and no web server of its own: you call functions, read files, and decide what a
42
+ job is. A minimal board is 100 lines ([`examples/board.py`](examples/board.py)).
43
+
44
+ ## Try it
45
+
46
+ ```sh
47
+ git clone https://github.com/lunochkin/acppool && cd acppool
48
+ python3 examples/board.py
49
+ ```
50
+
51
+ ```
52
+ > join fake /tmp ada # a miniature agent that echoes; needs nothing installed
53
+ > give ada hello
54
+ ada > tool: Read a
55
+ ada · echo:hello
56
+ ada ends its turn
57
+ ```
58
+
59
+ To run Claude instead, install its ACP adapter once (Node.js needed) and have Claude Code signed in:
60
+
61
+ ```sh
62
+ (cd examples/acp && npm install)
63
+ python3 examples/board.py
64
+ > join claude /tmp/demo ada
65
+ > give ada Write hello.py that greets me. Use the ask tool to ask me which language I want.
66
+ ```
67
+
68
+ Leave the board with Ctrl-D while ada works, start it again, and ada's turn is still running or done. The demo above
69
+ is [`docs/demo.tape`](docs/demo.tape), recorded with [VHS](https://github.com/charmbracelet/vhs).
70
+
71
+ ## How it fits together
72
+
73
+ ```
74
+ your app ──socket + files──▶ supervisor ──ACP──▶ agent adapter ──▶ the agent (claude, codex, goose …)
75
+ │ │ │
76
+ └─ pool, push, controls └─ one event log per agent └─ MCP ──▶ acppool's ask and wait
77
+ ```
78
+
79
+ - **`supervisor`** runs as its own process and owns one adapter process per agent. It starts, prompts, steers,
80
+ cancels and resumes sessions, holds permission requests, and writes every event to `sessions/<name>.jsonl`. Your
81
+ app commands it over a Unix socket (`client.call`) and reads its state from files, so a reader never waits on it.
82
+ - **`pool`** is your record of the workers: each one's job, queue, question and undelivered messages, kept in a
83
+ `Store` (SQLite, a JSON file, memory, or your own database).
84
+ - **`push`** decides what an idle worker gets next: an answer, a message, the end of a background run it waits on,
85
+ a compaction when its context is full, or its next job. Your `App` subclass says what a job is.
86
+ - **`control`** has the human's controls: give, say, answer, permit, clear, reset, hold, take back, end.
87
+ - **`needs`** lists what waits on the human (a question, a permission, a reply), each with a key to notify it once.
88
+ - **`mcp`** is the agents' MCP server with the pool's own tools: `ask` the human, and `wait` on a background run.
89
+ Add your app's tools beside them in the same server.
90
+ - **`sessions`** cuts the event logs into sessions and turns, with each turn's tokens and cost; `client.steps` reads
91
+ a log as one line per step.
92
+
93
+ ## Writing an app
94
+
95
+ Three pieces: the supervisor's configuration, an `App`, and a loop that runs the push.
96
+
97
+ ```python
98
+ from acppool import claude, client, control, pool, push, supervisor
99
+
100
+ # agentd.py, run as its own process; servers() gives each session your MCP server (acppool's ask and wait in it)
101
+ config = supervisor.Config.under(STATE, kinds={"claude": claude.installed(ADAPTER_FOLDER)}, servers=servers)
102
+ supervisor.main(config)
103
+
104
+ # your app
105
+ class Board(push.App):
106
+ home = "the board"
107
+
108
+ def brief(self, item, worker): # the prompt a job is sent with
109
+ return f"Fix {item['name']}. Report with the done tool."
110
+
111
+ def job_over(self, job, worker): # a job ends when the agent says so, not when a turn ends
112
+ return job.get("done", False)
113
+
114
+ app = Board(pool.SqliteStore(STATE / "pool.db"), my_supervisor) # my_supervisor: call() and agents(), over client
115
+ threading.Thread(target=push.run, args=(lambda: app,), daemon=True).start()
116
+ control.give(app, "ada", {"kind": "issue", "name": "#42"})
117
+ ```
118
+
119
+ Every `App` hook has a default, so the simplest app overrides nothing: a job is one turn, and its brief is its
120
+ name. The hooks you are likely to want are `brief`, `job_over`, `judge` (take, keep or drop a queued item at its
121
+ turn), `run_of` (jobs of one run share a session), `preamble` (standing instructions) and `record` (your activity
122
+ log). [`examples/`](examples) has a complete board and its supervisor.
123
+
124
+ ## Agents
125
+
126
+ | Kind | Adapter | Steering mid-turn | After a restart | Notes |
127
+ | --- | --- | --- | --- | --- |
128
+ | `claude` | [claude-agent-acp](https://github.com/agentclientprotocol/claude-agent-acp) (npm) | yes | resumed | Agent SDK options per kind, e.g. `settingSources` |
129
+ | `codex` | [codex-acp](https://github.com/agentclientprotocol/codex-acp) (npm) | yes | resumed | sessions set to the `agent` mode |
130
+ | any ACP agent | its own, e.g. `goose acp` | if it offers it | resumed, or loaded | `Kind(command=..., options=...)` |
131
+
132
+ A `Kind` is the adapter's command line plus what it offers beyond ACP: a steering method, session options (ACP
133
+ config options set on every session), Claude-style `_meta`, a rate-limit report. Claude and Codex need Node.js for
134
+ their adapters; agents that speak ACP natively, like Goose, need nothing else. An agent that cannot resume a session
135
+ but can load one is loaded, with the history it replays kept out of the log.
136
+
137
+ ## Status
138
+
139
+ 0.x: in daily use by two boards, and the API may still change between minor versions. Python 3.10 or newer, on
140
+ macOS and Linux.
141
+
142
+ Neighbouring projects solve other parts: [acpx](https://github.com/openclaw/acpx) is a scriptable ACP client for
143
+ running one agent from a script or CI, with permissions decided by policy; the ACP adapters above translate each
144
+ agent to ACP. acppool is the pool between the agents and your board.
145
+
146
+ ## Tests
147
+
148
+ ```sh
149
+ python3 -m unittest discover -s acppool/tests -t .
150
+ ```
151
+
152
+ They run the supervisor over a miniature ACP agent ([`acppool/tests/fake_agent.py`](acppool/tests/fake_agent.py))
153
+ in a temporary folder, with no network and no agent installed.
154
+
155
+ ## License
156
+
157
+ MIT
@@ -0,0 +1,22 @@
1
+ acppool/__init__.py,sha256=oKPIpdSP9oRfFR1qME7h0Qk9DiIvWZXo7QL3dQyPi14,226
2
+ acppool/adapters.py,sha256=VfLdPtaM1yRAMV79xyN6xv2m17jKEo4cpHagkQD8O7Y,1294
3
+ acppool/claude.py,sha256=k6ZGKXuGDFrmBBgrWZg4R2Ypzq2Ichc5Sze9CRN5FTQ,2025
4
+ acppool/client.py,sha256=TMBj00RUfZVK3Ljp2MGeWYavp0He5v7I6MWPM847CsM,5192
5
+ acppool/codex.py,sha256=_StOvfHQspvny9F8kRmaI3c_XFlHB9LlvxN54eEG0IU,1243
6
+ acppool/control.py,sha256=1jaxI7jq5-jZUh-aLIRsC2l4F3ojHMryqqTpBqVSCPM,10192
7
+ acppool/mcp.py,sha256=e6Zy9gH897CR3fy6OzOpIMFb0rxuPtc9cuSoHB70rW4,9679
8
+ acppool/needs.py,sha256=Wu7Ox4l0m57d68TCxGgqVfBR25R-z8t8mnsySOQESsI,3497
9
+ acppool/pool.py,sha256=aAaweYcEgG-xLoEKMLqdT7v3n3Lqcivf6v1xZRm8c94,14945
10
+ acppool/push.py,sha256=UZ5FJxlAcGGl-iNL_z20jv9dMHstA9C3pIIFq_Rje2E,14126
11
+ acppool/sessions.py,sha256=Bhn_DkCLbzcmWIKE_cksrpQjAwIV4imeHiUvElTuRsw,10935
12
+ acppool/supervisor.py,sha256=00DCLfEHoccMKuQMpKh6XBIXIrsrcvK2WwM5Z__sK5o,30815
13
+ acppool/uploads.py,sha256=sns0jcdguvGDFbvtVuMKMRIJfhbwqk07OKEae4J-75o,2805
14
+ acppool/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ acppool/tests/base.py,sha256=jhxzT63Kqk_BE53pwAD6__Jjdcn-6pDwNufeKnM8L9w,2922
16
+ acppool/tests/fake_agent.py,sha256=peSYTaCAWr_lm0Jt6_N91Louy_5OdwEWZoo7K7Idtr0,4554
17
+ acppool/tests/test_library.py,sha256=-dRuFiS4jZX9780WxG4QM3gbEamyWy1vGg-h840L0-I,19004
18
+ acppool/tests/test_supervisor.py,sha256=-dfqfzGTwYajrHWvGYNDVvP71aN0dWRFz8BfWMtfr4E,11947
19
+ acppool-0.1.0.dist-info/METADATA,sha256=ua6YRelD4R666DWg60tj3DnjdiS5G49TBrP__O6yeA8,7867
20
+ acppool-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
21
+ acppool-0.1.0.dist-info/licenses/LICENSE,sha256=3eVDy6bZFO9B-0Kpmpsw-RMt6HmrE-WVqYqUV5IMv7I,1073
22
+ acppool-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Maksim Lunochkin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.