initial agent-mgr: app builder platform MVP

Go API server + Preact UI + Claude Code adapter.
- App-centric model (ideas, not repos)
- AgentProvider interface for multi-agent support
- K8s pod lifecycle for sandboxed agent sessions
- Gitea integration (create repos, push branches)
- WebSocket streaming for live session output
- Woodpecker CI/CD pipelines (kaniko build + kubectl deploy)
This commit is contained in:
Steven Hooker
2026-02-18 15:56:32 +01:00
commit e5b07cc1d8
39 changed files with 3120 additions and 0 deletions

23
docker/Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
# Stage 1: Build UI
FROM node:22-slim AS ui-builder
WORKDIR /ui
COPY ui/package.json ui/package-lock.json* ./
RUN npm ci --ignore-scripts
COPY ui/ .
RUN npm run build
# Stage 2: Build Go binary
FROM golang:1.23-alpine AS go-builder
RUN apk add --no-cache git
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
COPY --from=ui-builder /ui/dist ./ui/dist
RUN CGO_ENABLED=0 go build -o /agent-mgr ./cmd/agent-mgr
# Stage 3: Runtime
FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=go-builder /agent-mgr /agent-mgr
EXPOSE 8080
ENTRYPOINT ["/agent-mgr"]

View File

@@ -0,0 +1,17 @@
FROM node:22-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g @anthropic-ai/claude-code
RUN useradd -m -s /bin/bash agent
USER agent
WORKDIR /workspace
COPY --chown=agent:agent entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

16
docker/entrypoint.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
set -euo pipefail
cd /workspace
# Run claude interactively, streaming JSON output
claude --output-format stream-json "$@"
EXIT_CODE=$?
# After claude exits, push whatever it did
if [ -n "$(git status --porcelain)" ]; then
git add -A
git commit -m "agent session ${SESSION_ID:-unknown}"
git push origin "agent/${SESSION_ID:-unknown}"
fi
exit $EXIT_CODE