squads-cli 0.1.2 → 0.3.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.
- package/README.md +164 -21
- package/dist/chunk-266URT5W.js +915 -0
- package/dist/chunk-266URT5W.js.map +1 -0
- package/dist/chunk-7OCVIDC7.js +12 -0
- package/dist/chunk-7OCVIDC7.js.map +1 -0
- package/dist/chunk-FUHBEL3L.js +203 -0
- package/dist/chunk-FUHBEL3L.js.map +1 -0
- package/dist/cli.js +2118 -1017
- package/dist/cli.js.map +1 -1
- package/dist/memory-4PVUKIDK.js +19 -0
- package/dist/memory-4PVUKIDK.js.map +1 -0
- package/dist/sessions-UR3YGSLR.js +15 -0
- package/dist/sessions-UR3YGSLR.js.map +1 -0
- package/docker/.env.example +17 -0
- package/docker/README.md +92 -0
- package/docker/docker-compose.engram.yml +289 -0
- package/docker/docker-compose.yml +194 -0
- package/docker/init-db.sql +399 -0
- package/docker/init-engram-db.sql +148 -0
- package/docker/init-langfuse-db.sh +10 -0
- package/docker/otel-collector.yaml +34 -0
- package/docker/squads-bridge/Dockerfile +14 -0
- package/docker/squads-bridge/Dockerfile.proxy +14 -0
- package/docker/squads-bridge/anthropic_proxy.py +313 -0
- package/docker/squads-bridge/requirements.txt +7 -0
- package/docker/squads-bridge/squads_bridge.py +1457 -0
- package/docker/telemetry-ping/Dockerfile +10 -0
- package/docker/telemetry-ping/deploy.sh +69 -0
- package/docker/telemetry-ping/main.py +136 -0
- package/docker/telemetry-ping/requirements.txt +3 -0
- package/package.json +12 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
appendToMemory,
|
|
4
|
+
findMemoryDir,
|
|
5
|
+
getSquadState,
|
|
6
|
+
listMemoryEntries,
|
|
7
|
+
searchMemory,
|
|
8
|
+
updateMemory
|
|
9
|
+
} from "./chunk-FUHBEL3L.js";
|
|
10
|
+
import "./chunk-7OCVIDC7.js";
|
|
11
|
+
export {
|
|
12
|
+
appendToMemory,
|
|
13
|
+
findMemoryDir,
|
|
14
|
+
getSquadState,
|
|
15
|
+
listMemoryEntries,
|
|
16
|
+
searchMemory,
|
|
17
|
+
updateMemory
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=memory-4PVUKIDK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
buildCurrentSessionSummary,
|
|
4
|
+
sessionsCommand,
|
|
5
|
+
sessionsHistoryCommand,
|
|
6
|
+
sessionsSummaryCommand
|
|
7
|
+
} from "./chunk-266URT5W.js";
|
|
8
|
+
import "./chunk-7OCVIDC7.js";
|
|
9
|
+
export {
|
|
10
|
+
buildCurrentSessionSummary,
|
|
11
|
+
sessionsCommand,
|
|
12
|
+
sessionsHistoryCommand,
|
|
13
|
+
sessionsSummaryCommand
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=sessions-UR3YGSLR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Squads Local Stack Configuration
|
|
2
|
+
# Copy to .env and customize as needed
|
|
3
|
+
|
|
4
|
+
# PostgreSQL
|
|
5
|
+
POSTGRES_USER=squads
|
|
6
|
+
POSTGRES_PASSWORD=squads_local_dev
|
|
7
|
+
POSTGRES_DB=squads
|
|
8
|
+
|
|
9
|
+
# Langfuse
|
|
10
|
+
NEXTAUTH_SECRET=squads-local-dev-secret-change-in-prod
|
|
11
|
+
NEXTAUTH_URL=http://localhost:3000
|
|
12
|
+
|
|
13
|
+
# Redis (for future use)
|
|
14
|
+
REDIS_URL=redis://localhost:6379
|
|
15
|
+
|
|
16
|
+
# Neo4j (uncomment when enabled)
|
|
17
|
+
# NEO4J_AUTH=neo4j/squads_local_dev
|
package/docker/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Squads Local Stack
|
|
2
|
+
|
|
3
|
+
Local development infrastructure for squads CLI telemetry and analytics.
|
|
4
|
+
|
|
5
|
+
## Services
|
|
6
|
+
|
|
7
|
+
| Service | Port | Purpose |
|
|
8
|
+
|---------|------|---------|
|
|
9
|
+
| PostgreSQL | 5433 | Data storage (Langfuse + squads metrics) |
|
|
10
|
+
| Langfuse | 3100 | Telemetry UI, LLM tracing |
|
|
11
|
+
| Redis | 6379 | Caching, job queues |
|
|
12
|
+
|
|
13
|
+
> Note: Ports 5433/3100 avoid conflicts with local Postgres/dev servers.
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Start all services
|
|
19
|
+
docker-compose up -d
|
|
20
|
+
|
|
21
|
+
# Check status
|
|
22
|
+
docker-compose ps
|
|
23
|
+
|
|
24
|
+
# View logs
|
|
25
|
+
docker-compose logs -f langfuse
|
|
26
|
+
|
|
27
|
+
# Stop services
|
|
28
|
+
docker-compose down
|
|
29
|
+
|
|
30
|
+
# Stop and remove data
|
|
31
|
+
docker-compose down -v
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Access
|
|
35
|
+
|
|
36
|
+
- **Langfuse UI**: http://localhost:3100
|
|
37
|
+
- First run: Create an account (local only, no verification)
|
|
38
|
+
- Create a project and get API keys
|
|
39
|
+
|
|
40
|
+
## Configure squads CLI
|
|
41
|
+
|
|
42
|
+
After starting the stack, configure your environment:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# In your project's .env or ~/.zshrc
|
|
46
|
+
export LANGFUSE_HOST=http://localhost:3100
|
|
47
|
+
export LANGFUSE_PUBLIC_KEY=pk-lf-... # From Langfuse UI
|
|
48
|
+
export LANGFUSE_SECRET_KEY=sk-lf-... # From Langfuse UI
|
|
49
|
+
export SQUADS_DATABASE_URL=postgresql://squads:squads_local_dev@localhost:5433/squads
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Database Schema
|
|
53
|
+
|
|
54
|
+
The `init-db.sql` creates a `squads` schema with:
|
|
55
|
+
|
|
56
|
+
- `github_metrics` - Daily GitHub activity (commits, PRs, issues)
|
|
57
|
+
- `agent_executions` - Agent run history with cost tracking
|
|
58
|
+
- `baselines` - Before/after comparison snapshots
|
|
59
|
+
|
|
60
|
+
## Upgrade Path
|
|
61
|
+
|
|
62
|
+
When you outgrow local:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Export your data
|
|
66
|
+
pg_dump -h localhost -U squads squads > backup.sql
|
|
67
|
+
|
|
68
|
+
# Migrate to Squads Cloud
|
|
69
|
+
squads cloud migrate --from-backup backup.sql
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Troubleshooting
|
|
73
|
+
|
|
74
|
+
**Langfuse won't start:**
|
|
75
|
+
```bash
|
|
76
|
+
# Check if postgres is ready
|
|
77
|
+
docker-compose logs postgres
|
|
78
|
+
# Restart langfuse
|
|
79
|
+
docker-compose restart langfuse
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Port conflicts:**
|
|
83
|
+
```bash
|
|
84
|
+
# Change ports in docker-compose.yml or use:
|
|
85
|
+
LANGFUSE_PORT=3001 docker-compose up -d
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Reset everything:**
|
|
89
|
+
```bash
|
|
90
|
+
docker-compose down -v
|
|
91
|
+
docker-compose up -d
|
|
92
|
+
```
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
# Squads Local Stack - With Engram Integration
|
|
2
|
+
# Full telemetry pipeline + Memory system
|
|
3
|
+
#
|
|
4
|
+
# Usage:
|
|
5
|
+
# cd docker && docker-compose -f docker-compose.engram.yml up -d
|
|
6
|
+
#
|
|
7
|
+
# Access:
|
|
8
|
+
# Langfuse UI: http://localhost:3100
|
|
9
|
+
# Neo4j Browser: http://localhost:7474
|
|
10
|
+
# Engram MCP: http://localhost:8080
|
|
11
|
+
# Mem0 API: http://localhost:8000
|
|
12
|
+
# Postgres: localhost:5433
|
|
13
|
+
|
|
14
|
+
name: agents-squads
|
|
15
|
+
|
|
16
|
+
services:
|
|
17
|
+
# =============================================================================
|
|
18
|
+
# PostgreSQL with pgvector - Primary data store + Vector search
|
|
19
|
+
# =============================================================================
|
|
20
|
+
postgres:
|
|
21
|
+
image: pgvector/pgvector:pg16
|
|
22
|
+
container_name: squads-postgres
|
|
23
|
+
restart: unless-stopped
|
|
24
|
+
environment:
|
|
25
|
+
POSTGRES_USER: squads
|
|
26
|
+
POSTGRES_PASSWORD: squads
|
|
27
|
+
POSTGRES_DB: squads
|
|
28
|
+
ports:
|
|
29
|
+
- "${POSTGRES_PORT:-5433}:5432"
|
|
30
|
+
volumes:
|
|
31
|
+
- squads_postgres_data:/var/lib/postgresql/data
|
|
32
|
+
- ./init-db.sql:/docker-entrypoint-initdb.d/01-init-squads.sql:ro
|
|
33
|
+
- ./init-langfuse-db.sh:/docker-entrypoint-initdb.d/00-init-langfuse.sh:ro
|
|
34
|
+
- ./init-engram-db.sql:/docker-entrypoint-initdb.d/02-init-engram.sql:ro
|
|
35
|
+
healthcheck:
|
|
36
|
+
test: ["CMD-SHELL", "pg_isready -U squads -d squads"]
|
|
37
|
+
interval: 5s
|
|
38
|
+
timeout: 5s
|
|
39
|
+
retries: 5
|
|
40
|
+
networks:
|
|
41
|
+
- squads
|
|
42
|
+
|
|
43
|
+
# =============================================================================
|
|
44
|
+
# Redis - Caching and job queues
|
|
45
|
+
# =============================================================================
|
|
46
|
+
redis:
|
|
47
|
+
image: redis:7-alpine
|
|
48
|
+
container_name: squads-redis
|
|
49
|
+
restart: unless-stopped
|
|
50
|
+
ports:
|
|
51
|
+
- "${REDIS_PORT:-6379}:6379"
|
|
52
|
+
volumes:
|
|
53
|
+
- squads_redis_data:/data
|
|
54
|
+
command: redis-server --appendonly yes
|
|
55
|
+
healthcheck:
|
|
56
|
+
test: ["CMD", "redis-cli", "ping"]
|
|
57
|
+
interval: 5s
|
|
58
|
+
timeout: 5s
|
|
59
|
+
retries: 5
|
|
60
|
+
networks:
|
|
61
|
+
- squads
|
|
62
|
+
|
|
63
|
+
# =============================================================================
|
|
64
|
+
# Neo4j - Knowledge graph for agent memory
|
|
65
|
+
# =============================================================================
|
|
66
|
+
neo4j:
|
|
67
|
+
image: neo4j:5-community
|
|
68
|
+
container_name: squads-neo4j
|
|
69
|
+
restart: unless-stopped
|
|
70
|
+
environment:
|
|
71
|
+
NEO4J_AUTH: neo4j/${NEO4J_PASSWORD:-squads_local_dev}
|
|
72
|
+
NEO4J_PLUGINS: '["apoc"]'
|
|
73
|
+
ports:
|
|
74
|
+
- "${NEO4J_HTTP_PORT:-7474}:7474"
|
|
75
|
+
- "${NEO4J_BOLT_PORT:-7687}:7687"
|
|
76
|
+
volumes:
|
|
77
|
+
- squads_neo4j_data:/data
|
|
78
|
+
healthcheck:
|
|
79
|
+
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:7474"]
|
|
80
|
+
interval: 10s
|
|
81
|
+
timeout: 5s
|
|
82
|
+
retries: 5
|
|
83
|
+
start_period: 30s
|
|
84
|
+
networks:
|
|
85
|
+
- squads
|
|
86
|
+
|
|
87
|
+
# =============================================================================
|
|
88
|
+
# Langfuse - LLM Observability (local instance)
|
|
89
|
+
# =============================================================================
|
|
90
|
+
langfuse:
|
|
91
|
+
image: langfuse/langfuse:2
|
|
92
|
+
container_name: squads-langfuse
|
|
93
|
+
restart: unless-stopped
|
|
94
|
+
depends_on:
|
|
95
|
+
postgres:
|
|
96
|
+
condition: service_healthy
|
|
97
|
+
environment:
|
|
98
|
+
DATABASE_URL: postgresql://squads:squads@postgres:5432/langfuse
|
|
99
|
+
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-squads-local-dev-secret}
|
|
100
|
+
NEXTAUTH_URL: http://localhost:${LANGFUSE_PORT:-3100}
|
|
101
|
+
SALT: ${LANGFUSE_SALT:-squads-local-salt}
|
|
102
|
+
TELEMETRY_ENABLED: "false"
|
|
103
|
+
LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES: "true"
|
|
104
|
+
ports:
|
|
105
|
+
- "${LANGFUSE_PORT:-3100}:3000"
|
|
106
|
+
healthcheck:
|
|
107
|
+
test: ["CMD-SHELL", "wget -q -O /dev/null http://$(hostname -i):3000/api/public/health || exit 1"]
|
|
108
|
+
interval: 15s
|
|
109
|
+
timeout: 10s
|
|
110
|
+
retries: 5
|
|
111
|
+
start_period: 60s
|
|
112
|
+
networks:
|
|
113
|
+
- squads
|
|
114
|
+
|
|
115
|
+
# =============================================================================
|
|
116
|
+
# OpenTelemetry Collector - Receives telemetry from Claude Code
|
|
117
|
+
# =============================================================================
|
|
118
|
+
otel-collector:
|
|
119
|
+
image: otel/opentelemetry-collector-contrib:latest
|
|
120
|
+
container_name: squads-otel-collector
|
|
121
|
+
restart: unless-stopped
|
|
122
|
+
command: ["--config=/etc/otel-collector.yaml"]
|
|
123
|
+
volumes:
|
|
124
|
+
- ./otel-collector.yaml:/etc/otel-collector.yaml:ro
|
|
125
|
+
ports:
|
|
126
|
+
- "${OTEL_PORT:-4318}:4318"
|
|
127
|
+
depends_on:
|
|
128
|
+
- squads-bridge
|
|
129
|
+
networks:
|
|
130
|
+
- squads
|
|
131
|
+
|
|
132
|
+
# =============================================================================
|
|
133
|
+
# Squads Bridge - Telemetry storage (postgres first, Langfuse optional)
|
|
134
|
+
# =============================================================================
|
|
135
|
+
squads-bridge:
|
|
136
|
+
build:
|
|
137
|
+
context: ./squads-bridge
|
|
138
|
+
dockerfile: Dockerfile
|
|
139
|
+
container_name: squads-bridge
|
|
140
|
+
restart: unless-stopped
|
|
141
|
+
environment:
|
|
142
|
+
PORT: 8080
|
|
143
|
+
DEBUG: "1"
|
|
144
|
+
DATABASE_URL: postgresql://squads:squads@postgres:5432/squads
|
|
145
|
+
REDIS_URL: redis://redis:6379/0
|
|
146
|
+
SQUADS_DAILY_BUDGET: ${SQUADS_DAILY_BUDGET:-50.0}
|
|
147
|
+
LANGFUSE_ENABLED: ${LANGFUSE_ENABLED:-false}
|
|
148
|
+
LANGFUSE_HOST: ${LANGFUSE_HOST:-http://langfuse:3000}
|
|
149
|
+
LANGFUSE_PUBLIC_KEY: ${LANGFUSE_PUBLIC_KEY:-}
|
|
150
|
+
LANGFUSE_SECRET_KEY: ${LANGFUSE_SECRET_KEY:-}
|
|
151
|
+
ports:
|
|
152
|
+
- "${BRIDGE_PORT:-8088}:8080"
|
|
153
|
+
depends_on:
|
|
154
|
+
postgres:
|
|
155
|
+
condition: service_healthy
|
|
156
|
+
redis:
|
|
157
|
+
condition: service_healthy
|
|
158
|
+
networks:
|
|
159
|
+
- squads
|
|
160
|
+
|
|
161
|
+
# =============================================================================
|
|
162
|
+
# Anthropic Proxy - Captures rate limit headers
|
|
163
|
+
# =============================================================================
|
|
164
|
+
anthropic-proxy:
|
|
165
|
+
build:
|
|
166
|
+
context: ./squads-bridge
|
|
167
|
+
dockerfile: Dockerfile.proxy
|
|
168
|
+
container_name: squads-anthropic-proxy
|
|
169
|
+
restart: unless-stopped
|
|
170
|
+
profiles: ["proxy"]
|
|
171
|
+
environment:
|
|
172
|
+
PORT: 8089
|
|
173
|
+
DEBUG: "${DEBUG:-0}"
|
|
174
|
+
ANTHROPIC_API_URL: https://api.anthropic.com
|
|
175
|
+
REDIS_URL: redis://redis:6379/0
|
|
176
|
+
SQUADS_BRIDGE_URL: http://squads-bridge:8080
|
|
177
|
+
ports:
|
|
178
|
+
- "${ANTHROPIC_PROXY_PORT:-8089}:8089"
|
|
179
|
+
depends_on:
|
|
180
|
+
redis:
|
|
181
|
+
condition: service_healthy
|
|
182
|
+
networks:
|
|
183
|
+
- squads
|
|
184
|
+
|
|
185
|
+
# =============================================================================
|
|
186
|
+
# Mem0 - Memory extraction API (Engram backend)
|
|
187
|
+
# =============================================================================
|
|
188
|
+
mem0:
|
|
189
|
+
build:
|
|
190
|
+
context: ../../engram/mem0-server
|
|
191
|
+
dockerfile: Dockerfile
|
|
192
|
+
container_name: squads-mem0
|
|
193
|
+
restart: unless-stopped
|
|
194
|
+
environment:
|
|
195
|
+
# Database
|
|
196
|
+
POSTGRES_HOST: postgres
|
|
197
|
+
POSTGRES_PORT: 5432
|
|
198
|
+
POSTGRES_USER: squads
|
|
199
|
+
POSTGRES_PASSWORD: squads
|
|
200
|
+
POSTGRES_DB: engram
|
|
201
|
+
POSTGRES_COLLECTION_NAME: memories
|
|
202
|
+
# Neo4j
|
|
203
|
+
NEO4J_URI: bolt://neo4j:7687
|
|
204
|
+
NEO4J_USERNAME: neo4j
|
|
205
|
+
NEO4J_PASSWORD: ${NEO4J_PASSWORD:-squads_local_dev}
|
|
206
|
+
# LLM Provider: openai (fast) or ollama (local)
|
|
207
|
+
# Set LLM_PROVIDER=openai and OPENAI_API_KEY for fast embeddings
|
|
208
|
+
LLM_PROVIDER: ${LLM_PROVIDER:-openai}
|
|
209
|
+
# OpenAI config (recommended for speed)
|
|
210
|
+
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
|
|
211
|
+
OPENAI_LLM_MODEL: ${OPENAI_LLM_MODEL:-gpt-4o-mini}
|
|
212
|
+
OPENAI_EMBEDDING_MODEL: ${OPENAI_EMBEDDING_MODEL:-text-embedding-3-small}
|
|
213
|
+
OPENAI_EMBEDDING_DIMS: ${OPENAI_EMBEDDING_DIMS:-1536}
|
|
214
|
+
# Ollama config (fallback for local/offline)
|
|
215
|
+
OLLAMA_BASE_URL: ${OLLAMA_BASE_URL:-http://host.docker.internal:11434}
|
|
216
|
+
OLLAMA_LLM_MODEL: ${OLLAMA_LLM_MODEL:-qwen3:latest}
|
|
217
|
+
OLLAMA_EMBEDDING_MODEL: ${OLLAMA_EMBEDDING_MODEL:-nomic-embed-text:latest}
|
|
218
|
+
OLLAMA_EMBEDDING_DIMS: ${OLLAMA_EMBEDDING_DIMS:-768}
|
|
219
|
+
# Logging
|
|
220
|
+
LOG_LEVEL: ${LOG_LEVEL:-INFO}
|
|
221
|
+
ports:
|
|
222
|
+
- "${MEM0_PORT:-8000}:8000"
|
|
223
|
+
depends_on:
|
|
224
|
+
postgres:
|
|
225
|
+
condition: service_healthy
|
|
226
|
+
neo4j:
|
|
227
|
+
condition: service_healthy
|
|
228
|
+
healthcheck:
|
|
229
|
+
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')\" || exit 1"]
|
|
230
|
+
interval: 10s
|
|
231
|
+
timeout: 5s
|
|
232
|
+
retries: 5
|
|
233
|
+
start_period: 30s
|
|
234
|
+
networks:
|
|
235
|
+
- squads
|
|
236
|
+
|
|
237
|
+
# =============================================================================
|
|
238
|
+
# Engram MCP - MCP server for Claude Code memory integration
|
|
239
|
+
# =============================================================================
|
|
240
|
+
engram-mcp:
|
|
241
|
+
build:
|
|
242
|
+
context: ../../engram/mcp-server
|
|
243
|
+
dockerfile: Dockerfile
|
|
244
|
+
container_name: squads-engram-mcp
|
|
245
|
+
restart: unless-stopped
|
|
246
|
+
environment:
|
|
247
|
+
# Mem0 API
|
|
248
|
+
MEM0_API_URL: http://mem0:8000
|
|
249
|
+
# Database (for auth)
|
|
250
|
+
POSTGRES_HOST: postgres
|
|
251
|
+
POSTGRES_PORT: 5432
|
|
252
|
+
POSTGRES_USER: squads
|
|
253
|
+
POSTGRES_PASSWORD: squads
|
|
254
|
+
POSTGRES_DB: engram
|
|
255
|
+
# MCP Server
|
|
256
|
+
MCP_HOST: 0.0.0.0
|
|
257
|
+
MCP_PORT: 8080
|
|
258
|
+
# Project ID Mode
|
|
259
|
+
PROJECT_ID_MODE: ${PROJECT_ID_MODE:-auto}
|
|
260
|
+
DEFAULT_USER_ID: ${DEFAULT_USER_ID:-claude_code_mcp}
|
|
261
|
+
# Chunking
|
|
262
|
+
CHUNK_MAX_SIZE: ${CHUNK_MAX_SIZE:-1000}
|
|
263
|
+
CHUNK_OVERLAP_SIZE: ${CHUNK_OVERLAP_SIZE:-150}
|
|
264
|
+
# Logging
|
|
265
|
+
LOG_LEVEL: ${LOG_LEVEL:-INFO}
|
|
266
|
+
ports:
|
|
267
|
+
- "${ENGRAM_MCP_PORT:-8080}:8080"
|
|
268
|
+
depends_on:
|
|
269
|
+
mem0:
|
|
270
|
+
condition: service_healthy
|
|
271
|
+
postgres:
|
|
272
|
+
condition: service_healthy
|
|
273
|
+
healthcheck:
|
|
274
|
+
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://localhost:8080/')\" || exit 1"]
|
|
275
|
+
interval: 10s
|
|
276
|
+
timeout: 5s
|
|
277
|
+
retries: 5
|
|
278
|
+
start_period: 15s
|
|
279
|
+
networks:
|
|
280
|
+
- squads
|
|
281
|
+
|
|
282
|
+
networks:
|
|
283
|
+
squads:
|
|
284
|
+
driver: bridge
|
|
285
|
+
|
|
286
|
+
volumes:
|
|
287
|
+
squads_postgres_data:
|
|
288
|
+
squads_redis_data:
|
|
289
|
+
squads_neo4j_data:
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Squads Local Stack - Consolidated
|
|
2
|
+
# Full telemetry pipeline: OTel → Bridge → Langfuse (local or cloud)
|
|
3
|
+
#
|
|
4
|
+
# Usage:
|
|
5
|
+
# cd docker && docker-compose up -d
|
|
6
|
+
#
|
|
7
|
+
# Access:
|
|
8
|
+
# Langfuse UI: http://localhost:3100
|
|
9
|
+
# Postgres: localhost:5433
|
|
10
|
+
|
|
11
|
+
name: agents-squads
|
|
12
|
+
|
|
13
|
+
services:
|
|
14
|
+
# =============================================================================
|
|
15
|
+
# PostgreSQL - Primary data store
|
|
16
|
+
# =============================================================================
|
|
17
|
+
postgres:
|
|
18
|
+
image: postgres:16-alpine
|
|
19
|
+
container_name: squads-postgres
|
|
20
|
+
restart: unless-stopped
|
|
21
|
+
environment:
|
|
22
|
+
POSTGRES_USER: squads
|
|
23
|
+
POSTGRES_PASSWORD: squads
|
|
24
|
+
POSTGRES_DB: squads
|
|
25
|
+
# Create both databases on init
|
|
26
|
+
POSTGRES_MULTIPLE_DATABASES: langfuse
|
|
27
|
+
ports:
|
|
28
|
+
- "${POSTGRES_PORT:-5433}:5432"
|
|
29
|
+
volumes:
|
|
30
|
+
- squads_postgres_data:/var/lib/postgresql/data
|
|
31
|
+
- ./init-db.sql:/docker-entrypoint-initdb.d/01-init-squads.sql:ro
|
|
32
|
+
- ./init-langfuse-db.sh:/docker-entrypoint-initdb.d/00-init-langfuse.sh:ro
|
|
33
|
+
healthcheck:
|
|
34
|
+
test: ["CMD-SHELL", "pg_isready -U squads -d squads"]
|
|
35
|
+
interval: 5s
|
|
36
|
+
timeout: 5s
|
|
37
|
+
retries: 5
|
|
38
|
+
networks:
|
|
39
|
+
- squads
|
|
40
|
+
|
|
41
|
+
# =============================================================================
|
|
42
|
+
# Redis - Caching and job queues
|
|
43
|
+
# =============================================================================
|
|
44
|
+
redis:
|
|
45
|
+
image: redis:7-alpine
|
|
46
|
+
container_name: squads-redis
|
|
47
|
+
restart: unless-stopped
|
|
48
|
+
ports:
|
|
49
|
+
- "${REDIS_PORT:-6379}:6379"
|
|
50
|
+
volumes:
|
|
51
|
+
- squads_redis_data:/data
|
|
52
|
+
command: redis-server --appendonly yes
|
|
53
|
+
healthcheck:
|
|
54
|
+
test: ["CMD", "redis-cli", "ping"]
|
|
55
|
+
interval: 5s
|
|
56
|
+
timeout: 5s
|
|
57
|
+
retries: 5
|
|
58
|
+
networks:
|
|
59
|
+
- squads
|
|
60
|
+
|
|
61
|
+
# =============================================================================
|
|
62
|
+
# Langfuse - LLM Observability (local instance)
|
|
63
|
+
# =============================================================================
|
|
64
|
+
langfuse:
|
|
65
|
+
image: langfuse/langfuse:2
|
|
66
|
+
container_name: squads-langfuse
|
|
67
|
+
restart: unless-stopped
|
|
68
|
+
depends_on:
|
|
69
|
+
postgres:
|
|
70
|
+
condition: service_healthy
|
|
71
|
+
environment:
|
|
72
|
+
DATABASE_URL: postgresql://squads:squads@postgres:5432/langfuse
|
|
73
|
+
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-squads-local-dev-secret}
|
|
74
|
+
NEXTAUTH_URL: http://localhost:${LANGFUSE_PORT:-3100}
|
|
75
|
+
SALT: ${LANGFUSE_SALT:-squads-local-salt}
|
|
76
|
+
TELEMETRY_ENABLED: "false"
|
|
77
|
+
LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES: "true"
|
|
78
|
+
ports:
|
|
79
|
+
- "${LANGFUSE_PORT:-3100}:3000"
|
|
80
|
+
healthcheck:
|
|
81
|
+
test: ["CMD-SHELL", "wget -q --spider http://localhost:3000/api/public/health || exit 1"]
|
|
82
|
+
interval: 30s
|
|
83
|
+
timeout: 15s
|
|
84
|
+
retries: 10
|
|
85
|
+
start_period: 60s
|
|
86
|
+
networks:
|
|
87
|
+
- squads
|
|
88
|
+
|
|
89
|
+
# =============================================================================
|
|
90
|
+
# OpenTelemetry Collector - Receives telemetry from Claude Code
|
|
91
|
+
# =============================================================================
|
|
92
|
+
otel-collector:
|
|
93
|
+
image: otel/opentelemetry-collector-contrib:latest
|
|
94
|
+
container_name: squads-otel-collector
|
|
95
|
+
restart: unless-stopped
|
|
96
|
+
command: ["--config=/etc/otel-collector.yaml"]
|
|
97
|
+
volumes:
|
|
98
|
+
- ./otel-collector.yaml:/etc/otel-collector.yaml:ro
|
|
99
|
+
ports:
|
|
100
|
+
- "${OTEL_PORT:-4318}:4318"
|
|
101
|
+
depends_on:
|
|
102
|
+
- squads-bridge
|
|
103
|
+
networks:
|
|
104
|
+
- squads
|
|
105
|
+
|
|
106
|
+
# =============================================================================
|
|
107
|
+
# Squads Bridge - Telemetry storage (postgres first, Langfuse optional)
|
|
108
|
+
# =============================================================================
|
|
109
|
+
squads-bridge:
|
|
110
|
+
build:
|
|
111
|
+
context: ./squads-bridge
|
|
112
|
+
dockerfile: Dockerfile
|
|
113
|
+
container_name: squads-bridge
|
|
114
|
+
restart: unless-stopped
|
|
115
|
+
environment:
|
|
116
|
+
PORT: 8080
|
|
117
|
+
DEBUG: "1"
|
|
118
|
+
# Primary storage: PostgreSQL (durable)
|
|
119
|
+
DATABASE_URL: postgresql://squads:squads@postgres:5432/squads
|
|
120
|
+
# Cache: Redis (real-time stats, session cache)
|
|
121
|
+
REDIS_URL: redis://redis:6379/0
|
|
122
|
+
# Budget tracking
|
|
123
|
+
SQUADS_DAILY_BUDGET: ${SQUADS_DAILY_BUDGET:-50.0}
|
|
124
|
+
# Optional: Forward to Langfuse (set LANGFUSE_ENABLED=true to enable)
|
|
125
|
+
LANGFUSE_ENABLED: ${LANGFUSE_ENABLED:-false}
|
|
126
|
+
LANGFUSE_HOST: ${LANGFUSE_HOST:-http://langfuse:3000}
|
|
127
|
+
LANGFUSE_PUBLIC_KEY: ${LANGFUSE_PUBLIC_KEY:-}
|
|
128
|
+
LANGFUSE_SECRET_KEY: ${LANGFUSE_SECRET_KEY:-}
|
|
129
|
+
ports:
|
|
130
|
+
- "${BRIDGE_PORT:-8088}:8080"
|
|
131
|
+
depends_on:
|
|
132
|
+
postgres:
|
|
133
|
+
condition: service_healthy
|
|
134
|
+
redis:
|
|
135
|
+
condition: service_healthy
|
|
136
|
+
networks:
|
|
137
|
+
- squads
|
|
138
|
+
|
|
139
|
+
# =============================================================================
|
|
140
|
+
# Anthropic Proxy - Captures rate limit headers
|
|
141
|
+
# =============================================================================
|
|
142
|
+
anthropic-proxy:
|
|
143
|
+
build:
|
|
144
|
+
context: ./squads-bridge
|
|
145
|
+
dockerfile: Dockerfile.proxy
|
|
146
|
+
container_name: squads-anthropic-proxy
|
|
147
|
+
restart: unless-stopped
|
|
148
|
+
profiles: ["proxy"] # Only start with: docker-compose --profile proxy up
|
|
149
|
+
environment:
|
|
150
|
+
PORT: 8089
|
|
151
|
+
DEBUG: "${DEBUG:-0}"
|
|
152
|
+
ANTHROPIC_API_URL: https://api.anthropic.com
|
|
153
|
+
REDIS_URL: redis://redis:6379/0
|
|
154
|
+
SQUADS_BRIDGE_URL: http://squads-bridge:8080
|
|
155
|
+
ports:
|
|
156
|
+
- "${ANTHROPIC_PROXY_PORT:-8089}:8089"
|
|
157
|
+
depends_on:
|
|
158
|
+
redis:
|
|
159
|
+
condition: service_healthy
|
|
160
|
+
networks:
|
|
161
|
+
- squads
|
|
162
|
+
|
|
163
|
+
# =============================================================================
|
|
164
|
+
# Neo4j - Graph database for agent memory (future)
|
|
165
|
+
# =============================================================================
|
|
166
|
+
neo4j:
|
|
167
|
+
image: neo4j:5-community
|
|
168
|
+
container_name: squads-neo4j
|
|
169
|
+
restart: unless-stopped
|
|
170
|
+
profiles: ["full"] # Only start with: docker-compose --profile full up
|
|
171
|
+
environment:
|
|
172
|
+
NEO4J_AUTH: neo4j/${NEO4J_PASSWORD:-squads_local_dev}
|
|
173
|
+
NEO4J_PLUGINS: '["apoc"]'
|
|
174
|
+
ports:
|
|
175
|
+
- "${NEO4J_HTTP_PORT:-7474}:7474"
|
|
176
|
+
- "${NEO4J_BOLT_PORT:-7687}:7687"
|
|
177
|
+
volumes:
|
|
178
|
+
- squads_neo4j_data:/data
|
|
179
|
+
healthcheck:
|
|
180
|
+
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:7474"]
|
|
181
|
+
interval: 10s
|
|
182
|
+
timeout: 5s
|
|
183
|
+
retries: 5
|
|
184
|
+
networks:
|
|
185
|
+
- squads
|
|
186
|
+
|
|
187
|
+
networks:
|
|
188
|
+
squads:
|
|
189
|
+
driver: bridge
|
|
190
|
+
|
|
191
|
+
volumes:
|
|
192
|
+
squads_postgres_data:
|
|
193
|
+
squads_redis_data:
|
|
194
|
+
squads_neo4j_data:
|