opencode-swarm-plugin 0.2.0 → 0.4.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/.beads/issues.jsonl +115 -5
- package/README.md +38 -1
- package/bun.lock +23 -0
- package/dist/index.js +9697 -2
- package/dist/plugin.js +9695 -2
- package/package.json +2 -3
- package/src/agent-mail.ts +134 -0
- package/src/index.ts +2 -0
- package/src/rate-limiter.integration.test.ts +466 -0
- package/src/rate-limiter.ts +656 -0
- package/src/swarm.integration.test.ts +126 -0
- package/src/swarm.ts +278 -0
- package/src/tool-availability.ts +3 -2
- package/Dockerfile +0 -30
- package/docker/agent-mail/Dockerfile +0 -23
- package/docker/agent-mail/__pycache__/server.cpython-314.pyc +0 -0
- package/docker/agent-mail/requirements.txt +0 -3
- package/docker/agent-mail/server.py +0 -879
- package/docker-compose.yml +0 -45
- package/scripts/docker-entrypoint.sh +0 -54
package/docker-compose.yml
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# Docker Compose for opencode-swarm-plugin integration tests
|
|
2
|
-
# Services: agent-mail (FastAPI) + test-runner (Bun)
|
|
3
|
-
|
|
4
|
-
services:
|
|
5
|
-
agent-mail:
|
|
6
|
-
build:
|
|
7
|
-
context: ./docker/agent-mail
|
|
8
|
-
dockerfile: Dockerfile
|
|
9
|
-
ports:
|
|
10
|
-
- "8765:8765"
|
|
11
|
-
environment:
|
|
12
|
-
- AGENT_MAIL_HOST=0.0.0.0
|
|
13
|
-
- AGENT_MAIL_PORT=8765
|
|
14
|
-
healthcheck:
|
|
15
|
-
test: ["CMD", "curl", "-f", "http://localhost:8765/health/liveness"]
|
|
16
|
-
interval: 5s
|
|
17
|
-
timeout: 3s
|
|
18
|
-
retries: 10
|
|
19
|
-
start_period: 5s
|
|
20
|
-
networks:
|
|
21
|
-
- test-network
|
|
22
|
-
|
|
23
|
-
test-runner:
|
|
24
|
-
build:
|
|
25
|
-
context: .
|
|
26
|
-
dockerfile: Dockerfile
|
|
27
|
-
depends_on:
|
|
28
|
-
agent-mail:
|
|
29
|
-
condition: service_healthy
|
|
30
|
-
environment:
|
|
31
|
-
- AGENT_MAIL_URL=http://agent-mail:8765
|
|
32
|
-
- GIT_AUTHOR_NAME=Test Runner
|
|
33
|
-
- GIT_AUTHOR_EMAIL=test@example.com
|
|
34
|
-
- GIT_COMMITTER_NAME=Test Runner
|
|
35
|
-
- GIT_COMMITTER_EMAIL=test@example.com
|
|
36
|
-
volumes:
|
|
37
|
-
# Mount source for faster iteration (optional - comment out for clean builds)
|
|
38
|
-
- ./src:/app/src:ro
|
|
39
|
-
- ./tests:/app/tests:ro
|
|
40
|
-
networks:
|
|
41
|
-
- test-network
|
|
42
|
-
|
|
43
|
-
networks:
|
|
44
|
-
test-network:
|
|
45
|
-
driver: bridge
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set -e
|
|
3
|
-
|
|
4
|
-
# Colors for output
|
|
5
|
-
RED='\033[0;31m'
|
|
6
|
-
GREEN='\033[0;32m'
|
|
7
|
-
YELLOW='\033[1;33m'
|
|
8
|
-
NC='\033[0m' # No Color
|
|
9
|
-
|
|
10
|
-
log() { echo -e "${GREEN}[entrypoint]${NC} $1"; }
|
|
11
|
-
warn() { echo -e "${YELLOW}[entrypoint]${NC} $1"; }
|
|
12
|
-
error() { echo -e "${RED}[entrypoint]${NC} $1"; }
|
|
13
|
-
|
|
14
|
-
# Initialize git repo if not present (beads requires git)
|
|
15
|
-
if [ ! -d ".git" ]; then
|
|
16
|
-
log "Initializing git repository..."
|
|
17
|
-
git init
|
|
18
|
-
git config user.email "test@example.com"
|
|
19
|
-
git config user.name "Test Runner"
|
|
20
|
-
git add -A
|
|
21
|
-
git commit -m "Initial commit for test environment" --allow-empty
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
# Initialize beads if not present
|
|
25
|
-
if [ ! -d ".beads" ]; then
|
|
26
|
-
log "Initializing beads..."
|
|
27
|
-
bd init --name "test-project" || warn "beads init failed (may already exist)"
|
|
28
|
-
fi
|
|
29
|
-
|
|
30
|
-
# Wait for agent-mail to be healthy
|
|
31
|
-
AGENT_MAIL_URL="${AGENT_MAIL_URL:-http://agent-mail:8765}"
|
|
32
|
-
MAX_RETRIES=30
|
|
33
|
-
RETRY_COUNT=0
|
|
34
|
-
|
|
35
|
-
log "Waiting for agent-mail at ${AGENT_MAIL_URL}..."
|
|
36
|
-
|
|
37
|
-
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
|
|
38
|
-
if curl -sf "${AGENT_MAIL_URL}/health/liveness" > /dev/null 2>&1; then
|
|
39
|
-
log "agent-mail is healthy!"
|
|
40
|
-
break
|
|
41
|
-
fi
|
|
42
|
-
RETRY_COUNT=$((RETRY_COUNT + 1))
|
|
43
|
-
if [ $RETRY_COUNT -eq $MAX_RETRIES ]; then
|
|
44
|
-
error "agent-mail failed to become healthy after ${MAX_RETRIES} attempts"
|
|
45
|
-
exit 1
|
|
46
|
-
fi
|
|
47
|
-
warn "Waiting for agent-mail... (attempt ${RETRY_COUNT}/${MAX_RETRIES})"
|
|
48
|
-
sleep 1
|
|
49
|
-
done
|
|
50
|
-
|
|
51
|
-
log "Starting integration tests..."
|
|
52
|
-
|
|
53
|
-
# Execute the command passed to the container
|
|
54
|
-
exec "$@"
|