This commit is contained in:
2026-08-14 10:26:28 +08:00
parent f051146486
commit 7d12459a32
44 changed files with 900211 additions and 15295 deletions
+17 -1
View File
@@ -4,14 +4,20 @@ set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BACKEND_DIR="$ROOT_DIR/backend"
FRONTEND_DIR="$ROOT_DIR/frontend"
AGENT_DIR="$ROOT_DIR/agent-server"
BACKEND_HOST="${BACKEND_HOST:-127.0.0.1}"
BACKEND_PORT="${BACKEND_PORT:-8000}"
AGENT_HOST="${AGENT_HOST:-127.0.0.1}"
AGENT_PORT="${AGENT_PORT:-8010}"
FRONTEND_HOST="${FRONTEND_HOST:-127.0.0.1}"
FRONTEND_PORT="${FRONTEND_PORT:-5173}"
RUN_NAME="${RUN_NAME:-frontend_split_motor_7nm}"
cleanup() {
if [[ -n "${AGENT_PID:-}" ]]; then
kill "$AGENT_PID" 2>/dev/null || true
fi
if [[ -n "${BACKEND_PID:-}" ]]; then
kill "$BACKEND_PID" 2>/dev/null || true
fi
@@ -30,6 +36,16 @@ echo "Starting backend on http://$BACKEND_HOST:$BACKEND_PORT"
) &
BACKEND_PID=$!
echo "Starting agent server on http://$AGENT_HOST:$AGENT_PORT"
(
cd "$AGENT_DIR"
if [[ ! -d node_modules ]]; then
npm install
fi
CAD_AGENT_STUDIO_CONFIG="$ROOT_DIR/llm.config.yaml" ORBIT_PROJECT_ROOT="$ROOT_DIR" TOOLCHAIN_URL="http://$BACKEND_HOST:$BACKEND_PORT" AGENT_HOST="$AGENT_HOST" AGENT_PORT="$AGENT_PORT" npm run dev
) &
AGENT_PID=$!
echo "Starting frontend on http://$FRONTEND_HOST:$FRONTEND_PORT"
cd "$FRONTEND_DIR"
npm run dev -- --host "$FRONTEND_HOST" --port "$FRONTEND_PORT"
BACKEND_HOST="$BACKEND_HOST" BACKEND_PORT="$BACKEND_PORT" AGENT_HOST="$AGENT_HOST" AGENT_PORT="$AGENT_PORT" FRONTEND_HOST="$FRONTEND_HOST" FRONTEND_PORT="$FRONTEND_PORT" npm run dev -- --host "$FRONTEND_HOST" --port "$FRONTEND_PORT" --strictPort