#!/bin/bash # Container entrypoint: run cursor-agent bootstrap, then start the proxy. set -euo pipefail # Enforce the sandbox cli-config (force-rewrites runtime/PVC drift back to # the deny-all policy on every boot) and verify the cursor-agent binary. /app/scripts/bootstrap-cursor.sh # Ensure the sandboxed agent HOME exists and is writable by uid 65533 # (the agent children run with a dedicated uid when supported). Best-effort: # in Kubernetes the emptyDir is fsGroup-chowned; in local docker the image's # ownership applies only if the directory was not replaced by a volume. if [[ -n "${CURSOR_AGENT_HOME:-}" ]]; then mkdir -p "${CURSOR_AGENT_HOME}" 2>/dev/null || true chmod 777 "${CURSOR_AGENT_HOME}" 2>/dev/null || true fi # Session workdirs and MCP sockets live in /tmp (readOnlyRootFilesystem # deployments mount an emptyDir there). Same best-effort widening for the # agent child processes. chmod 1777 /tmp 2>/dev/null || true # The HTTP server. A warm pool keeps bootstrapped ACP processes ready; # each request still opens session/new with request-specific MCP tools. exec node /app/src/server.mjs