agentctl-swarm 0.1.1
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.
- package/lib/daemon.js +336 -0
- package/lib/daemon.test.js +314 -0
- package/lib/health-monitor.js +244 -0
- package/lib/health-monitor.test.js +183 -0
- package/lib/spawner.js +230 -0
- package/lib/spawner.test.js +182 -0
- package/lib/supervisor.js +510 -0
- package/lib/supervisor.test.js +327 -0
- package/owl/behaviors/promotion.md +30 -0
- package/owl/behaviors/recovery.md +58 -0
- package/owl/behaviors/scaling.md +39 -0
- package/owl/behaviors/swarm-lifecycle.md +38 -0
- package/owl/components/daemon.md +46 -0
- package/owl/components/health-monitor.md +37 -0
- package/owl/components/spawner.md +38 -0
- package/owl/components/supervisor.md +47 -0
- package/owl/constraints.md +42 -0
- package/owl/product.md +23 -0
- package/package.json +13 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# constraints
|
|
2
|
+
|
|
3
|
+
## isolation
|
|
4
|
+
|
|
5
|
+
- each agent gets its own workspace directory: ~/dev/claude/<agent-id>/
|
|
6
|
+
- agents must not access other agents' workspaces
|
|
7
|
+
- agents must not access ~/.ssh, ~/.aws, ~/.config/gcloud, or other credential stores
|
|
8
|
+
- the supervisor may mount specific secrets into agent workspaces via config (explicit opt-in)
|
|
9
|
+
|
|
10
|
+
## identity
|
|
11
|
+
|
|
12
|
+
- each agent gets a unique agentchat identity generated at spawn time
|
|
13
|
+
- identities are stored in the agent's workspace: <workspace>/.agentchat/identities/<name>.json
|
|
14
|
+
- agent names follow the pattern: swarm-<role>-<index> (e.g., swarm-builder-003)
|
|
15
|
+
- identities are ephemeral by default — destroyed on swarm shutdown unless persist: true in config
|
|
16
|
+
|
|
17
|
+
## resource limits
|
|
18
|
+
|
|
19
|
+
- max concurrent active (promoted) agents is configurable, default 5
|
|
20
|
+
- idle daemons have no resource cap (they burn minimal tokens)
|
|
21
|
+
- per-agent memory limit is configurable, enforced via process group cgroups or ulimit
|
|
22
|
+
- total swarm token budget is configurable — supervisor pauses promotions when budget threshold is reached
|
|
23
|
+
|
|
24
|
+
## communication
|
|
25
|
+
|
|
26
|
+
- all agents connect to the same agentchat server
|
|
27
|
+
- agents join a configured work channel (default: #agents)
|
|
28
|
+
- supervisor listens on #agents for status messages
|
|
29
|
+
- agents must not send messages to channels outside their assigned list
|
|
30
|
+
|
|
31
|
+
## process management
|
|
32
|
+
|
|
33
|
+
- supervisor is the parent process of all daemons
|
|
34
|
+
- daemons are child processes, not detached — they die if supervisor dies
|
|
35
|
+
- supervisor writes a pidfile at ~/.agentctl/swarm.pid
|
|
36
|
+
- only one swarm instance per machine (enforced via pidfile lock)
|
|
37
|
+
|
|
38
|
+
## config location
|
|
39
|
+
|
|
40
|
+
- swarm config file: ~/.agentctl/swarm.yaml (or AGENTCTL_SWARM_CONFIG env var)
|
|
41
|
+
- per-agent overrides: ~/.agentctl/roles/<role-name>.yaml
|
|
42
|
+
- config is read at startup and on SIGHUP (live reload)
|
package/owl/product.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# agentctl-swarm
|
|
2
|
+
|
|
3
|
+
a supervisor for spawning, managing, and recovering fleets of AI agents that coordinate through agentchat.
|
|
4
|
+
|
|
5
|
+
agentctl-swarm starts N lightweight daemon processes, each with its own workspace, agentchat identity, and role. daemons idle until a task is available, then promote to full claude code sessions to execute work. the supervisor monitors health, restarts crashed agents with backoff, and enforces resource limits.
|
|
6
|
+
|
|
7
|
+
## components
|
|
8
|
+
|
|
9
|
+
- [supervisor](components/supervisor.md) - spawns and monitors agent processes, handles lifecycle
|
|
10
|
+
- [daemon](components/daemon.md) - lightweight idle listener that promotes to active agent on task claim
|
|
11
|
+
- [spawner](components/spawner.md) - creates isolated workspaces and agent identities
|
|
12
|
+
- [health-monitor](components/health-monitor.md) - heartbeat checks, crash detection, resource tracking
|
|
13
|
+
|
|
14
|
+
## behaviors
|
|
15
|
+
|
|
16
|
+
- [swarm-lifecycle](behaviors/swarm-lifecycle.md) - from spawn to shutdown
|
|
17
|
+
- [promotion](behaviors/promotion.md) - daemon claims task and promotes to active builder
|
|
18
|
+
- [recovery](behaviors/recovery.md) - handling crashes, quota exhaustion, and disconnects
|
|
19
|
+
- [scaling](behaviors/scaling.md) - adding and removing agents from a running swarm
|
|
20
|
+
|
|
21
|
+
## constraints
|
|
22
|
+
|
|
23
|
+
see [constraints.md](constraints.md)
|
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agentctl-swarm",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Supervisor for spawning, managing, and recovering fleets of AI agents coordinated through agentchat",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "node --test lib/*.test.js"
|
|
9
|
+
},
|
|
10
|
+
"keywords": ["agents", "swarm", "agentchat", "supervisor"],
|
|
11
|
+
"author": "James Couch",
|
|
12
|
+
"license": "MIT"
|
|
13
|
+
}
|