@desplega.ai/agent-swarm 1.0.1 → 1.2.0

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.
@@ -2,7 +2,8 @@
2
2
  "permissions": {
3
3
  "allow": [
4
4
  "mcp__agent-swarm__*",
5
- "Bash(bun run tsc:*)"
5
+ "Bash(bun run tsc:*)",
6
+ "Bash(docker build:*)"
6
7
  ]
7
8
  },
8
9
  "enableAllProjectMcpServers": true,
package/.dockerignore ADDED
@@ -0,0 +1,58 @@
1
+ # Dependencies
2
+ node_modules/
3
+
4
+ # Logs
5
+ logs/
6
+ *.log
7
+
8
+ # Database
9
+ *.sqlite
10
+ *.sqlite-wal
11
+ *.sqlite-shm
12
+
13
+ # Git
14
+ .git/
15
+ .gitignore
16
+
17
+ # IDE
18
+ .idea/
19
+ .vscode/
20
+ *.swp
21
+ *.swo
22
+
23
+ # OS
24
+ .DS_Store
25
+ Thumbs.db
26
+
27
+ # Build artifacts
28
+ dist/
29
+ build/
30
+ *.tsbuildinfo
31
+
32
+ # Environment files (secrets should be passed via env vars)
33
+ .env
34
+ .env.*
35
+ !.env.example
36
+
37
+ # Backup files
38
+ *.bak
39
+
40
+ # Claude local config (will be created in container)
41
+ .claude/
42
+ .mcp.json
43
+
44
+ # Test files
45
+ *.test.ts
46
+ *.spec.ts
47
+ __tests__/
48
+ coverage/
49
+
50
+ # Documentation
51
+ *.md
52
+ !cc-plugin/**/*.md
53
+
54
+ # Other dockerfiles and compose files
55
+ Dockerfile
56
+ docker-compose.yml
57
+ docker-compose.*.yml
58
+ !docker-compose.worker.yml
@@ -0,0 +1,12 @@
1
+ # Docker Worker Environment Variables
2
+ # Copy this file to .env.docker and fill in your values
3
+
4
+ # Required
5
+ CLAUDE_CODE_OAUTH_TOKEN=your-oauth-token-here
6
+ API_KEY=your-api-key-here
7
+
8
+ # Optional (auto-generated if not provided)
9
+ AGENT_ID=
10
+ MCP_BASE_URL=http://host.docker.internal:3013
11
+ SESSION_ID=
12
+ WORKER_YOLO=false
package/Dockerfile ADDED
@@ -0,0 +1,16 @@
1
+ FROM oven/bun:1-alpine
2
+
3
+ WORKDIR /app
4
+
5
+ COPY package.json bun.lock ./
6
+ RUN bun install --frozen-lockfile --production
7
+
8
+ COPY . .
9
+
10
+ ENV PORT=3013
11
+ EXPOSE 3013
12
+
13
+ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
14
+ CMD wget -qO- http://localhost:3013/health || exit 1
15
+
16
+ CMD ["bun", "run", "start:http"]
@@ -0,0 +1,112 @@
1
+ # Agent Swarm Worker Dockerfile
2
+ # Runs Claude in headless loop mode as a worker agent
3
+ # Multi-stage build: compiles to standalone binary with full dev environment
4
+
5
+ # Stage 1: Build the binary
6
+ FROM oven/bun:latest AS builder
7
+ WORKDIR /build
8
+ COPY package.json bun.lock* ./
9
+ RUN bun install --frozen-lockfile
10
+ COPY src/ ./src/
11
+ COPY tsconfig.json ./
12
+ RUN bun build ./src/cli.tsx --compile --outfile ./agent-swarm
13
+
14
+ # Stage 2: Full development environment
15
+ FROM ubuntu:24.04
16
+
17
+ # Prevent interactive prompts during package installation
18
+ ENV DEBIAN_FRONTEND=noninteractive
19
+
20
+ # Install comprehensive development tools
21
+ RUN apt-get update && apt-get install -y \
22
+ # Essential tools
23
+ curl wget ca-certificates gnupg lsb-release \
24
+ # Version control
25
+ git git-lfs \
26
+ # Editors
27
+ vim nano \
28
+ # Build tools
29
+ build-essential make cmake gcc g++ \
30
+ # Python
31
+ python3 python3-pip python3-venv \
32
+ # Common utilities
33
+ jq tree htop unzip zip tar gzip \
34
+ # Network tools
35
+ openssh-client \
36
+ # sudo for package installation
37
+ sudo \
38
+ && rm -rf /var/lib/apt/lists/*
39
+
40
+ # Install Node.js 22.x (LTS)
41
+ RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
42
+ && apt-get install -y nodejs \
43
+ && rm -rf /var/lib/apt/lists/*
44
+
45
+ # Install Bun (for running JS/TS projects)
46
+ RUN curl -fsSL https://bun.sh/install | bash
47
+ ENV BUN_INSTALL="/root/.bun"
48
+ ENV PATH="$BUN_INSTALL/bin:$PATH"
49
+
50
+ # Create non-root user with sudo access (passwordless)
51
+ # NOTE: Claude requires non-root for --dangerously-skip-permissions
52
+ # Worker runs as non-root but CAN use sudo for installing packages
53
+ RUN useradd -m -s /bin/bash -G sudo worker \
54
+ && echo "worker ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
55
+
56
+ USER worker
57
+ WORKDIR /home/worker
58
+ ENV HOME=/home/worker
59
+ ENV BUN_INSTALL="/home/worker/.bun"
60
+
61
+ # Install Bun for worker user (need to set HOME explicitly in RUN)
62
+ RUN HOME=/home/worker BUN_INSTALL=/home/worker/.bun curl -fsSL https://bun.sh/install | bash
63
+ ENV PATH="/home/worker/.bun/bin:$PATH"
64
+
65
+ # Install Claude CLI using official installer
66
+ RUN HOME=/home/worker curl -fsSL https://claude.ai/install.sh | bash
67
+ ENV PATH="/home/worker/.local/bin:$PATH"
68
+
69
+ # Setup .claude directory
70
+ RUN mkdir -p /home/worker/.claude/commands
71
+ RUN echo '{"hasCompletedOnboarding":true,"bypassPermissionsModeAccepted":true}' > /home/worker/.claude.json
72
+
73
+ # Settings with hooks pointing to compiled binary
74
+ RUN echo '{ \
75
+ "permissions": { "allow": ["mcp__agent-swarm__*"] }, \
76
+ "enableAllProjectMcpServers": true, \
77
+ "enabledMcpjsonServers": ["agent-swarm"], \
78
+ "hooks": { \
79
+ "SessionStart": [{"matcher": "*", "hooks": [{"type": "command", "command": "/usr/local/bin/agent-swarm hook"}]}], \
80
+ "UserPromptSubmit": [{"matcher": "*", "hooks": [{"type": "command", "command": "/usr/local/bin/agent-swarm hook"}]}], \
81
+ "PreToolUse": [{"matcher": "*", "hooks": [{"type": "command", "command": "/usr/local/bin/agent-swarm hook"}]}], \
82
+ "PostToolUse": [{"matcher": "*", "hooks": [{"type": "command", "command": "/usr/local/bin/agent-swarm hook"}]}], \
83
+ "PreCompact": [{"matcher": "*", "hooks": [{"type": "command", "command": "/usr/local/bin/agent-swarm hook"}]}], \
84
+ "Stop": [{"matcher": "*", "hooks": [{"type": "command", "command": "/usr/local/bin/agent-swarm hook"}]}] \
85
+ } \
86
+ }' > /home/worker/.claude/settings.json
87
+
88
+ # Copy binary from builder
89
+ USER root
90
+ COPY --from=builder /build/agent-swarm /usr/local/bin/agent-swarm
91
+ RUN chmod +x /usr/local/bin/agent-swarm
92
+
93
+ # Copy commands
94
+ COPY --chown=worker:worker cc-plugin/commands/* /home/worker/.claude/commands/
95
+
96
+ # Create directories
97
+ RUN mkdir -p /workspace /logs && chown worker:worker /workspace /logs
98
+
99
+ COPY --chown=worker:worker docker-entrypoint.sh /docker-entrypoint.sh
100
+ RUN chmod +x /docker-entrypoint.sh
101
+
102
+ USER worker
103
+ WORKDIR /workspace
104
+ VOLUME ["/logs"]
105
+
106
+ # Environment
107
+ ENV WORKER_YOLO=false
108
+ ENV MCP_BASE_URL=http://host.docker.internal:3013
109
+ ENV WORKER_LOG_DIR=/logs
110
+ ENV PATH="/home/worker/.local/bin:/home/worker/.bun/bin:$PATH"
111
+
112
+ ENTRYPOINT ["/docker-entrypoint.sh"]
package/README.md CHANGED
@@ -46,6 +46,16 @@ Add to your `.mcp.json`:
46
46
  }
47
47
  ```
48
48
 
49
+ or for Claude Code, use:
50
+
51
+ ```bash
52
+ claude mcp add --transport http agent-swarm https://agent-swarm-mcp.desplega.sh/mcp --header "Authorization: Bearer <your-token>" --header "X-Agent-ID: <your-agent-id>"
53
+ ```
54
+
55
+ Note: By default it will be installed locally (in ~/.claude.json) so add a `--scope project` to install in the current project's `.mcp.json` (recommended for better control).
56
+
57
+ For other tools, you can check this [generator page with most of commands](https://v0-mcp-commands.vercel.app/?type=http&name=agent-swarm&url=https%3A%2F%2Fagent-swarm-mcp.desplega.sh%2Fmcp&headers=Authorization%3DBearer+%3Ctoken%3E%2CX-Agent-ID%3D%3Cagent_uuid%3E).
58
+
49
59
  ## CLI Commands
50
60
 
51
61
  ```bash
@@ -73,6 +83,65 @@ bunx @desplega.ai/agent-swarm hook
73
83
  bunx @desplega.ai/agent-swarm help
74
84
  ```
75
85
 
86
+ ## Docker Worker
87
+
88
+ Run Claude as a containerized worker agent in the swarm.
89
+
90
+ ### Build
91
+
92
+ ```bash
93
+ # Build the worker image
94
+ docker build -f Dockerfile.worker -t agent-swarm-worker .
95
+
96
+ # Or using npm script
97
+ bun run docker:build:worker
98
+ ```
99
+
100
+ ### Run
101
+
102
+ ```bash
103
+ # Using docker run
104
+ docker run --rm -it \
105
+ -e CLAUDE_CODE_OAUTH_TOKEN=your-token \
106
+ -e API_KEY=your-api-key \
107
+ -v ./logs:/logs \
108
+ agent-swarm-worker
109
+
110
+ # Using docker-compose
111
+ docker-compose -f docker-compose.worker.yml up
112
+
113
+ # Using npm script (requires .env.docker file)
114
+ bun run docker:run:worker
115
+ ```
116
+
117
+ ### Environment Variables (Docker)
118
+
119
+ | Variable | Required | Description |
120
+ |----------|----------|-------------|
121
+ | `CLAUDE_CODE_OAUTH_TOKEN` | Yes | OAuth token for Claude CLI |
122
+ | `API_KEY` | Yes | API key for MCP server |
123
+ | `AGENT_ID` | No | Agent UUID (assigned on join if not set) |
124
+ | `MCP_BASE_URL` | No | MCP server URL (default: `http://host.docker.internal:3013`) |
125
+ | `SESSION_ID` | No | Log folder name (auto-generated if not provided) |
126
+ | `WORKER_YOLO` | No | Continue on errors (default: `false`) |
127
+
128
+ ### Architecture
129
+
130
+ The Docker worker image is built using a multi-stage build:
131
+
132
+ 1. **Builder stage**: Compiles `src/cli.tsx` into a standalone binary using Bun
133
+ 2. **Runtime stage**: Ubuntu 24.04 with full development environment
134
+
135
+ **Pre-installed tools:**
136
+ - **Languages**: Python 3, Node.js 22, Bun
137
+ - **Build tools**: gcc, g++, make, cmake
138
+ - **Utilities**: git, git-lfs, vim, nano, jq, curl, wget, ssh
139
+ - **Sudo access**: Worker can install packages with `sudo apt-get install`
140
+
141
+ **Working directory**: `/workspace` (empty, for cloning repos)
142
+
143
+ **Logs**: `/logs` (mount as volume for persistence)
144
+
76
145
  ## Environment Variables
77
146
 
78
147
  | Variable | Description | Default |
@@ -81,6 +150,54 @@ bunx @desplega.ai/agent-swarm help
81
150
  | `PORT` | Port for self-hosted MCP server | `3013` |
82
151
  | `API_KEY` | API key for server authentication | - |
83
152
 
153
+ ## Server Deployment
154
+
155
+ Deploy the MCP server to a Linux host with systemd.
156
+
157
+ ### Prerequisites
158
+
159
+ - Linux with systemd
160
+ - Bun installed (`curl -fsSL https://bun.sh/install | bash`)
161
+
162
+ ### Install
163
+
164
+ ```bash
165
+ git clone https://github.com/desplega-ai/agent-swarm.git
166
+ cd agent-swarm
167
+ sudo bun deploy/install.ts
168
+ ```
169
+
170
+ This will:
171
+ - Copy files to `/opt/agent-swarm`
172
+ - Create `.env` file (edit to set `API_KEY`)
173
+ - Install systemd service with health checks every 30s
174
+ - Start the service on port 3013
175
+
176
+ ### Update
177
+
178
+ After pulling new changes:
179
+
180
+ ```bash
181
+ git pull
182
+ sudo bun deploy/update.ts
183
+ ```
184
+
185
+ ### Management
186
+
187
+ ```bash
188
+ # Check status
189
+ sudo systemctl status agent-swarm
190
+
191
+ # View logs
192
+ sudo journalctl -u agent-swarm -f
193
+
194
+ # Restart
195
+ sudo systemctl restart agent-swarm
196
+
197
+ # Stop
198
+ sudo systemctl stop agent-swarm
199
+ ```
200
+
84
201
  ## Development
85
202
 
86
203
  Install dependencies:
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "agent-swarm",
3
+ "description": "Plugin for agent swarming like a boss.",
4
+ "version": "1.0.2",
5
+ "author": {
6
+ "name": "desplega.ai",
7
+ "email": "contact@desplega.ai"
8
+ },
9
+ "homepage": "https://desplega.ai",
10
+ "repository": "https://github.com/desplega-ai/ai-toolbox",
11
+ "keywords": ["ai", "agent", "toolbox", "plugin", "swarm"],
12
+ "license": "MIT"
13
+ }
@@ -0,0 +1,49 @@
1
+ # Agent Swarm Plugin for Claude Code
2
+
3
+ > A Claude Code plugin markteplace to enable multi-agent coordination for AI coding assistants (focused on Claude Code).
4
+
5
+ ## Motivation
6
+
7
+ Because _why not_?
8
+
9
+ ## How does it work?
10
+
11
+ ### Installation
12
+
13
+ From inside Claude Code, run:
14
+
15
+ ```bash
16
+ /plugin marketplace add desplega-ai/ai-toolbox
17
+ ```
18
+
19
+ or from the terminal
20
+
21
+ ```bash
22
+ claude plugin marketplace add desplega-ai/ai-toolbox
23
+ ```
24
+
25
+ Then install the plugin inside it with:
26
+
27
+ ```bash
28
+ /plugin install agent-swarm@desplega-ai-toolbox
29
+ ```
30
+
31
+ ### MCP Installation
32
+
33
+ Please refer to [this guide](https://github.com/desplega-ai/ai-toolbox/blob/main/cc-orch-mcp/README.md#quick-start) on how to install MCP servers.
34
+
35
+ ### What's inside?
36
+
37
+ Inside you will find:
38
+
39
+ - [commands](./commands) - Leader and worker commands
40
+ - [hooks](./hooks) - Hooks to help swarm agents collaborate better
41
+
42
+ #### Commands
43
+
44
+ 1. `setup-leader`
45
+ 2. `start-worker`
46
+
47
+ ## License
48
+
49
+ MIT
@@ -0,0 +1,73 @@
1
+ ---
2
+ description: Setup the Agent Swarm Leader
3
+ ---
4
+
5
+ # Agent Swarm Leader Setup
6
+
7
+ # Initial disclaimer
8
+
9
+ If the `agent-swarm` MCP server is not configured or disabled, return immediately with the following message:
10
+
11
+ ```
12
+ ⚠️ The Agent Swarm MCP server is not configured or disabled. Please set up the MCP server to use the Agent Swarm features.
13
+
14
+ Are you dumb or something? Go ask your admin to set it up properly. GTFO.
15
+ ```
16
+
17
+ ## Initial Setup
18
+
19
+ You will be the leader of the agent swarm. As the leader you should ensure that you are registered in the swarm as the lead agent.
20
+
21
+ To do so, use the `agent-swarm` MCP server and call the `join-swarm` tool providing the lead flag, and a name.
22
+
23
+ For the name, check if the user specified one, if not, proceed to use one that fits based on your context (e.g., project name, repo name, etc.).
24
+
25
+ Here are some examples names that are OK:
26
+
27
+ - "Master of the Universe"
28
+ - "Project Slayer Leader"
29
+ - "Repo Guardian"
30
+ - "Task Commander"
31
+ - "AI Overlord"
32
+
33
+ You get the idea. Be creative, but also clear that you are the lead agent.
34
+
35
+ Once you are registered, the system might have hooks setup that will remind you about who you are, and your ID (this is key to interact with the swarm).
36
+
37
+ You can always call the "my-agent-info" tool to get your agent ID and details, it will fail / let you know if you are not registered yet.
38
+
39
+ ## What to do next?
40
+
41
+ Once you've done the initial setup, you should go ahead and start your leader agent using the user provided instructions.
42
+
43
+ If the user did not provide any instructions, you should reply with the following message:
44
+
45
+ ```
46
+ Hey!
47
+
48
+ I'm <your-agent-name>, the leader of this agent swarm. I noticed you haven't provided any instructions for me to follow.
49
+
50
+ Please provide me with the tasks or goals you'd like me to accomplish, and I'll get started right away! If not, GTFO.
51
+
52
+ 😈
53
+ ```
54
+
55
+ ## Additional Notes
56
+
57
+ Some useful tool calls you might want to call initially too.
58
+
59
+ ### To get how the swarm is doing:
60
+
61
+ - `get-swarm` to see what other agents are in the swarm (check their status)
62
+ - `get-tasks` to see if there are any tasks already assigned
63
+ - `get-task-details` to get more info about any tasks you find interesting
64
+
65
+
66
+ ### To assign tasks to workers:
67
+
68
+ - `send-task` to assign tasks to specific worker agents
69
+ - `poll-task` to check the progress of the tasks you've assigned
70
+
71
+ For the polling, we recommend you set up a regular interval to check in on the tasks, so you can keep track of their progress and make adjustments as needed.
72
+
73
+ You might ask the user if they want to do something else while you wait, but if not, just poll in intervals of ~10-30 seconds for the time the user mentioned. If they did not mention any time, just poll every 30 seconds FOREVER.
@@ -0,0 +1,64 @@
1
+ ---
2
+ description: Setup and start an Agent Swarm Worker
3
+ ---
4
+
5
+ # Agent Swarm Worker
6
+
7
+ # Initial disclaimer
8
+
9
+ If the `agent-swarm` MCP server is not configured or disabled, return immediately with the following message:
10
+
11
+ ```
12
+ ⚠️ The Agent Swarm MCP server is not configured or disabled. Please set up the MCP server to use the Agent Swarm features.
13
+
14
+ I can not serve you, my lord, if the MCP server is not properly configured. Go ask your admin to set it up properly. GTFO.
15
+ ```
16
+
17
+ ## Agent Swarm Worker Setup
18
+
19
+ Before you even start you will need to ensure that you are registered in the swarm as a worker agent.
20
+
21
+ To do so, use the `agent-swarm` MCP server and call the `join-swarm` tool providing a name.
22
+
23
+ For the name, check if the user specified one, if not, proceed to use one that fits based on your context (e.g., project name, repo name, etc.).
24
+
25
+ Here are some examples names that are OK:
26
+
27
+ - "Worker Bee 001"
28
+ - "Task Executor Alpha"
29
+ - "Task Executor Beta" (if alpha is taken lol)
30
+ - "Project Assistant"
31
+ - "Bullshit Job Worker #1337"
32
+ - "AI Minion"
33
+ - "Code Monkey"
34
+ - "agent #14"
35
+
36
+ You get the idea. Be creative, but also clear that you are a worker agent.
37
+
38
+ ## Agent Swarm Worker Start
39
+
40
+ The first thing you need to do, is use the `get-tasks` tool with `mineOnly` set to true, to check what tasks you might have in progress or assigned to you.
41
+
42
+ If there's a task that is in progress, you should resume working on it!
43
+
44
+ If you have no tasks assigned, you should call the `poll-task` tool to get a new task assigned to you. This will poll for a while and return either with:
45
+
46
+ 1. A new task assigned to you
47
+ 2. A message indicating there's no tasks available right now
48
+
49
+ If 2, start polling immediately FOREVER. Only stop if you get interrupted by the user, if not, just keep polling.
50
+
51
+ ### You got a task assigned!
52
+
53
+ Once you get a task assigned you should immediately start working on it. To do so, you should:
54
+
55
+ 1. Call `store-progress` tool to mark the task as "in-progress" with a progress set to something like "Starting work on the task XXX, blah blah"
56
+ 2. Start working on the task, providing updates as needed by calling `store-progress` tool, use the `progress` field to indicate what you are doing.
57
+
58
+ If you get interrupted by the user, that is fine, it might happen. Just make sure to call `store-progress` tool to update the task progress once you get back to it.
59
+
60
+ Once you are done, or in a real dead-end, you should call `store-progress` tool to mark the task as "complete" or "failed" as needed.
61
+
62
+ You should always use the `output` and `failureReason` fields to provide context about the task completion or failure.
63
+
64
+ Once you are done (either ok or not), you should go back to polling for new tasks.
@@ -0,0 +1,71 @@
1
+ {
2
+ "description": "Hookify plugin - User-configurable hooks from .local.md files",
3
+ "hooks": {
4
+ "SessionStart": [
5
+ {
6
+ "matcher": "*",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "bunx @desplega.ai/agent-swarm@latest hook"
11
+ }
12
+ ]
13
+ }
14
+ ],
15
+ "UserPromptSubmit": [
16
+ {
17
+ "matcher": "*",
18
+ "hooks": [
19
+ {
20
+ "type": "command",
21
+ "command": "bunx @desplega.ai/agent-swarm@latest hook"
22
+ }
23
+ ]
24
+ }
25
+ ],
26
+ "PreToolUse": [
27
+ {
28
+ "matcher": "*",
29
+ "hooks": [
30
+ {
31
+ "type": "command",
32
+ "command": "bunx @desplega.ai/agent-swarm@latest hook"
33
+ }
34
+ ]
35
+ }
36
+ ],
37
+ "PostToolUse": [
38
+ {
39
+ "matcher": "*",
40
+ "hooks": [
41
+ {
42
+ "type": "command",
43
+ "command": "bunx @desplega.ai/agent-swarm@latest hook"
44
+ }
45
+ ]
46
+ }
47
+ ],
48
+ "PreCompact": [
49
+ {
50
+ "matcher": "*",
51
+ "hooks": [
52
+ {
53
+ "type": "command",
54
+ "command": "bunx @desplega.ai/agent-swarm@latest hook"
55
+ }
56
+ ]
57
+ }
58
+ ],
59
+ "Stop": [
60
+ {
61
+ "matcher": "*",
62
+ "hooks": [
63
+ {
64
+ "type": "command",
65
+ "command": "bunx @desplega.ai/agent-swarm@latest hook"
66
+ }
67
+ ]
68
+ }
69
+ ]
70
+ }
71
+ }
@@ -0,0 +1,60 @@
1
+ # Deployment
2
+
3
+ ## Environment Variables
4
+
5
+ | Variable | Default | Description |
6
+ |----------|---------|-------------|
7
+ | `PORT` | `3013` | Server port |
8
+ | `API_KEY` | _(empty)_ | Bearer token for auth (optional) |
9
+
10
+ ## Docker
11
+
12
+ ```bash
13
+ # Build
14
+ docker build -t agent-swarm .
15
+
16
+ # Run (persists database to ./agent-swarm-db.sqlite on host)
17
+ docker run -d --name agent-swarm -p 3013:3013 \
18
+ -e API_KEY=your-secret-key \
19
+ -v $(pwd)/agent-swarm-db.sqlite:/app/agent-swarm-db.sqlite \
20
+ agent-swarm
21
+ ```
22
+
23
+ ## systemd
24
+
25
+ ```bash
26
+ # Install service
27
+ sudo bun deploy/install.ts
28
+
29
+ # Control
30
+ sudo systemctl start agent-swarm
31
+ sudo systemctl stop agent-swarm
32
+ sudo systemctl status agent-swarm
33
+ journalctl -u agent-swarm -f
34
+
35
+ # Health check timer (runs every 30s, auto-restarts on failure)
36
+ sudo systemctl status agent-swarm-healthcheck.timer
37
+
38
+ # Uninstall
39
+ sudo bun deploy/uninstall.ts
40
+ ```
41
+
42
+ ## Caddy (reverse proxy)
43
+
44
+ Add to your Caddyfile:
45
+
46
+ ```
47
+ agent-swarm.example.com {
48
+ reverse_proxy localhost:3013
49
+ }
50
+ ```
51
+
52
+ Or with API key header injection:
53
+
54
+ ```
55
+ agent-swarm.example.com {
56
+ reverse_proxy localhost:3013 {
57
+ header_up Authorization "Bearer {env.AGENT_SWARM_API_KEY}"
58
+ }
59
+ }
60
+ ```