feat: add browser_console MCP tool for frontend error capture

This commit is contained in:
2026-05-07 12:45:30 -07:00
parent 87577e69a4
commit dc60e1fdf5
9 changed files with 22038 additions and 52 deletions

View File

@@ -1,13 +1,7 @@
# vibn-dev — per-project AI development container.
#
# Goal: a small, fast-pulling base image (~500 MB target) that gives the AI
# (and the user, eventually) a real shell with git, ripgrep, and the
# scaffolding to lazy-install language toolchains via mise on first use.
#
# Heavy toolchains (Node / Python / Go / Rust) are NOT baked in — they
# install on demand via `mise install` the first time the AI runs
# `npm`, `python`, `go`, etc. This keeps the base image lean and lets us
# bump toolchain versions without rebuilding the image.
# Ships with Node.js (LTS), Python 3.12, and Go 1.23 pre-installed so the AI
# can start running code immediately without a mise install step.
#
# Spec is in AI_PATH_B_EXECUTION_PLAN.md §3.
@@ -18,55 +12,50 @@ ENV DEBIAN_FRONTEND=noninteractive \
LC_ALL=C.UTF-8 \
TZ=UTC
# Core OS packages: shell, git, network, build essentials, ripgrep
# (powers fs.grep), tini (PID 1 reaper), supervisord (process supervisor
# for sshd + dev servers), curl/ca-certs (downloads), unzip (mise
# tarballs), sudo (toolchain installers expect it).
# Core OS packages + shell/git/ripgrep/tini/supervisor.
# Language toolchains installed below.
RUN apt-get update && apt-get install -y --no-install-recommends \
bash coreutils ca-certificates curl wget git openssh-client \
ripgrep jq nano vim less procps lsof net-tools dnsutils \
build-essential pkg-config \
sudo tini supervisor unzip xz-utils \
python3-minimal \
python3 python3-pip python3-venv \
&& rm -rf /var/lib/apt/lists/*
# Playwright System Dependencies (for headless Chromium)
RUN apt-get update && apt-get install -y --no-install-recommends \
libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
libgbm1 libasound2t64 libpangocairo-1.0-0 libpango-1.0-0 libcairo2 \
&& rm -rf /var/lib/apt/lists/*
# Node.js LTS (via NodeSource)
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Go 1.23 — scrape latest patch version from go.dev/dl
RUN GO_TAR=$(curl -fsSL https://go.dev/dl/ | grep -oE 'go1\.23\.[0-9]+\.linux-amd64\.tar\.gz' | head -1) \
&& curl -fsSL "https://go.dev/dl/${GO_TAR}" | tar -C /usr/local -xz \
&& echo 'export PATH=/usr/local/go/bin:$PATH' >> /etc/profile.d/go.sh
# vibn user — the AI runs as this, NOT root.
# Ubuntu 24.04 base image preallocates a default `ubuntu` user at uid 1000;
# delete it first so we can claim 1000 for vibn (matches the docker exec
# `--user vibn` calls in lib/coolify-exec.ts and the workspace volume's
# default ownership in the compose template).
RUN userdel -r ubuntu 2>/dev/null || true \
&& useradd --create-home --shell /bin/bash --uid 1000 vibn \
&& mkdir -p /workspace /home/vibn/.cache /home/vibn/.local /var/log/vibn-dev \
&& chown -R vibn:vibn /workspace /home/vibn /var/log/vibn-dev \
&& echo 'vibn ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vibn
# mise — polyglot version manager. Installs Node/Python/Go/Rust on demand.
# Pinned to a specific version for reproducibility; bump in this Dockerfile.
ENV MISE_VERSION=v2024.12.14
RUN curl -fsSL "https://mise.run" | MISE_VERSION=${MISE_VERSION} sh \
&& mv /root/.local/bin/mise /usr/local/bin/mise \
&& chmod +x /usr/local/bin/mise
# Hook mise into vibn's shell so `node`, `python` etc. resolve once
# installed via `mise install`.
RUN echo 'eval "$(/usr/local/bin/mise activate bash)"' >> /home/vibn/.bashrc \
# Toolchain env for vibn user
RUN echo 'export PATH=/usr/local/go/bin:$PATH' >> /home/vibn/.bashrc \
&& echo 'export PATH="$HOME/.local/bin:$PATH"' >> /home/vibn/.bashrc
# Default mise toolchain config — lazily materialised. The AI can
# override per-project by writing /workspace/.mise.toml.
COPY --chown=vibn:vibn mise.default.toml /home/vibn/.config/mise/config.toml
# supervisord runs sshd-less; we don't need ssh in the container because
# all exec happens via `docker exec` from the Coolify host. Supervisord
# is reserved for dev_server.* (Vite/Next/etc) once that ships.
COPY supervisord.conf /etc/supervisor/conf.d/vibn-dev.conf
WORKDIR /workspace
USER vibn
# Keep-alive process. The container's job is to exist; commands run via
# `docker exec`. tail -f /dev/null is the canonical "stay running, do
# nothing" pattern — cheaper than supervisord for the no-dev-server case.
# Keep-alive. Commands run via docker exec.
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["tail", "-f", "/dev/null"]