Backup before continuing from Codex 5.2 session - User storage, compaction suggestions, streaming improvements
This commit is contained in:
@@ -1,35 +1,29 @@
|
||||
@echo off
|
||||
title NomadArch Launcher
|
||||
color 0A
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
title NomadArch Launcher
|
||||
color 0A
|
||||
|
||||
echo.
|
||||
echo ███╗ ██╗ ██████╗ ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗██╗ ██╗
|
||||
echo ████╗ ██║██╔═══██╗████╗ ████║██╔══██╗██╔══██╗██╔══██╗██╔════╝██║ ██║
|
||||
echo ██╔██╗ ██║██║ ██║██╔████╔██║███████║██║ ██║███████║██████╔╝██║ ███████║
|
||||
echo ██║╚██╗██║██║ ██║██║╚██╔╝██║██╔══██║██║ ██║██╔══██║██╔══██╗██║ ██╔══██║
|
||||
echo ██║ ╚████║╚██████╔╝██║ ╚═╝ ██║██║ ██║██████╔╝██║ ██║██║ ██║╚██████╗██║ ██║
|
||||
echo ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
|
||||
echo.
|
||||
echo LAUNCHER - Enhanced with Auto-Fix Capabilities
|
||||
echo ═════════════════════════════════════════════════════════════════════════════
|
||||
echo NomadArch Launcher (Windows)
|
||||
echo Version: 0.4.0
|
||||
echo.
|
||||
|
||||
cd /d "%~dp0"
|
||||
set SCRIPT_DIR=%~dp0
|
||||
set SCRIPT_DIR=%SCRIPT_DIR:~0,-1%
|
||||
cd /d "%SCRIPT_DIR%"
|
||||
|
||||
set ERRORS=0
|
||||
set WARNINGS=0
|
||||
set AUTO_FIXED=0
|
||||
|
||||
echo [STEP 1/5] Checking Dependencies...
|
||||
echo.
|
||||
echo [PREFLIGHT 1/7] Checking Dependencies...
|
||||
|
||||
where node >nul 2>&1
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo [ERROR] Node.js not found!
|
||||
echo.
|
||||
echo Please install Node.js first: https://nodejs.org/
|
||||
echo Then run: Install-Windows.bat
|
||||
echo.
|
||||
echo [WARN] Node.js not found. Running installer...
|
||||
call "%SCRIPT_DIR%\Install-Windows.bat"
|
||||
echo [INFO] If Node.js was installed, open a new terminal and run Launch-Windows.bat again.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
@@ -40,7 +34,6 @@ echo [OK] Node.js: %NODE_VERSION%
|
||||
where npm >nul 2>&1
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo [ERROR] npm not found!
|
||||
echo.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
@@ -49,100 +42,162 @@ for /f "tokens=*" %%i in ('npm --version') do set NPM_VERSION=%%i
|
||||
echo [OK] npm: %NPM_VERSION%
|
||||
|
||||
echo.
|
||||
echo [STEP 2/5] Checking for OpenCode CLI...
|
||||
echo.
|
||||
echo [PREFLIGHT 2/7] Checking for OpenCode CLI...
|
||||
|
||||
where opencode >nul 2>&1
|
||||
if %ERRORLEVEL% equ 0 (
|
||||
echo [OK] OpenCode is available in PATH
|
||||
echo [OK] OpenCode CLI available in PATH
|
||||
) else (
|
||||
if exist "bin\opencode.exe" (
|
||||
echo [OK] OpenCode binary found in bin/ folder
|
||||
echo [OK] OpenCode binary found in bin/
|
||||
) else (
|
||||
echo [WARN] OpenCode CLI not found
|
||||
echo [INFO] Run Install-Windows.bat to install OpenCode
|
||||
echo [INFO] Run Install-Windows.bat to set up OpenCode
|
||||
set /a WARNINGS+=1
|
||||
)
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [STEP 3/5] Checking for Existing Build...
|
||||
echo.
|
||||
echo [PREFLIGHT 3/7] Checking Dependencies...
|
||||
|
||||
if exist "packages\ui\dist" (
|
||||
echo [OK] UI build found
|
||||
if not exist "node_modules" (
|
||||
echo [INFO] Dependencies not installed. Installing now...
|
||||
call npm install
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo [ERROR] Dependency installation failed!
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
echo [OK] Dependencies installed (auto-fix)
|
||||
set /a AUTO_FIXED+=1
|
||||
) else (
|
||||
echo [WARN] No UI build found. Building now...
|
||||
echo.
|
||||
cd packages\ui
|
||||
echo [OK] Dependencies found
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [PREFLIGHT 4/7] Finding Available Port...
|
||||
|
||||
set DEFAULT_SERVER_PORT=3001
|
||||
set DEFAULT_UI_PORT=3000
|
||||
set SERVER_PORT=%DEFAULT_SERVER_PORT%
|
||||
set UI_PORT=%DEFAULT_UI_PORT%
|
||||
|
||||
for /l %%p in (%DEFAULT_SERVER_PORT%,1,3050) do (
|
||||
netstat -ano | findstr ":%%p " | findstr "LISTENING" >nul
|
||||
if !ERRORLEVEL! neq 0 (
|
||||
set SERVER_PORT=%%p
|
||||
goto :server_port_found
|
||||
)
|
||||
)
|
||||
:server_port_found
|
||||
|
||||
echo [OK] Server port: !SERVER_PORT!
|
||||
|
||||
if !SERVER_PORT! neq %DEFAULT_SERVER_PORT% (
|
||||
echo [INFO] Port %DEFAULT_SERVER_PORT% was in use, using !SERVER_PORT! instead
|
||||
set /a WARNINGS+=1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [PREFLIGHT 5/7] Final Checks...
|
||||
|
||||
if not exist "packages\ui\dist\index.html" (
|
||||
echo [WARN] UI build directory not found
|
||||
echo [INFO] Running UI build...
|
||||
pushd packages\ui
|
||||
call npm run build
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo [ERROR] UI build failed!
|
||||
popd
|
||||
set /a ERRORS+=1
|
||||
) else (
|
||||
echo [OK] UI build completed
|
||||
goto :final_launch_check
|
||||
)
|
||||
cd ..\..
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [STEP 4/5] Checking Port Availability...
|
||||
echo.
|
||||
|
||||
set SERVER_PORT=3001
|
||||
set UI_PORT=3000
|
||||
|
||||
netstat -ano | findstr ":%SERVER_PORT%" | findstr "LISTENING" >nul 2>&1
|
||||
if %ERRORLEVEL% equ 0 (
|
||||
echo [WARN] Port %SERVER_PORT% is already in use
|
||||
echo [INFO] Another NomadArch instance or app may be running
|
||||
echo [INFO] To find the process: netstat -ano | findstr ":%SERVER_PORT%"
|
||||
echo [INFO] To kill it: taskkill /F /PID <PID>
|
||||
set /a WARNINGS+=1
|
||||
popd
|
||||
echo [OK] UI build completed (auto-fix)
|
||||
set /a AUTO_FIXED+=1
|
||||
) else (
|
||||
echo [OK] Port %SERVER_PORT% is available
|
||||
echo [OK] UI build directory exists
|
||||
)
|
||||
|
||||
netstat -ano | findstr ":%UI_PORT%" | findstr "LISTENING" >nul 2>&1
|
||||
if %ERRORLEVEL% equ 0 (
|
||||
echo [WARN] Port %UI_PORT% is already in use
|
||||
echo [INFO] To find the process: netstat -ano | findstr ":%UI_PORT%"
|
||||
echo [INFO] To kill it: taskkill /F /PID <PID>
|
||||
set /a WARNINGS+=1
|
||||
) else (
|
||||
echo [OK] Port %UI_PORT% is available
|
||||
if not exist "packages\electron-app\dist\main\main.js" (
|
||||
echo [WARN] Electron build incomplete
|
||||
echo [INFO] Running full build...
|
||||
call npm run build
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo [ERROR] Full build failed!
|
||||
set /a ERRORS+=1
|
||||
goto :final_launch_check
|
||||
)
|
||||
echo [OK] Full build completed (auto-fix)
|
||||
set /a AUTO_FIXED+=1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [STEP 5/5] Starting NomadArch...
|
||||
echo [PREFLIGHT 6/7] Launch Summary
|
||||
|
||||
echo [STATUS]
|
||||
echo.
|
||||
echo Node.js: %NODE_VERSION%
|
||||
echo npm: %NPM_VERSION%
|
||||
echo Auto-fixes applied: !AUTO_FIXED!
|
||||
echo Warnings: %WARNINGS%
|
||||
echo Errors: %ERRORS%
|
||||
echo Server Port: !SERVER_PORT!
|
||||
echo.
|
||||
|
||||
if %ERRORS% gtr 0 (
|
||||
echo [ERROR] Cannot start due to errors!
|
||||
echo [RESULT] Cannot start due to errors!
|
||||
echo.
|
||||
echo Please fix the errors above and try again.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [INFO] Starting NomadArch...
|
||||
echo [INFO] Server will run on http://localhost:%SERVER_PORT%
|
||||
echo [INFO] Server will run on http://localhost:!SERVER_PORT!
|
||||
echo [INFO] UI will run on http://localhost:!UI_PORT!
|
||||
echo [INFO] Press Ctrl+C to stop
|
||||
echo.
|
||||
|
||||
set SERVER_URL=http://localhost:!SERVER_PORT!
|
||||
set VITE_PORT=!UI_PORT!
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Starting UI dev server on port !UI_PORT!...
|
||||
echo ========================================
|
||||
|
||||
pushd packages\ui
|
||||
start "NomadArch UI Server" cmd /c "set VITE_PORT=!UI_PORT! && npm run dev"
|
||||
popd
|
||||
|
||||
echo [INFO] Waiting for UI dev server to start...
|
||||
timeout /t 3 /nobreak >nul
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Starting Electron app...
|
||||
echo ========================================
|
||||
|
||||
set "VITE_DEV_SERVER_URL=http://localhost:!UI_PORT!"
|
||||
set "NOMADARCH_OPEN_DEVTOOLS=false"
|
||||
call npm run dev:electron
|
||||
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo [ERROR] NomadArch exited with an error!
|
||||
echo.
|
||||
echo Common solutions:
|
||||
echo 1. Check that all dependencies are installed: npm install
|
||||
echo 2. Check that the UI is built: cd packages\ui ^&^& npm run build
|
||||
echo 3. Check for port conflicts (see warnings above)
|
||||
echo 4. Check the error message above for details
|
||||
echo Error Code: %ERRORLEVEL%
|
||||
echo.
|
||||
echo To reinstall everything: Install-Windows.bat
|
||||
echo Troubleshooting:
|
||||
echo 1. Ensure port !SERVER_PORT! is not in use
|
||||
echo 2. Run Install-Windows.bat again
|
||||
echo 3. Check log file: packages\electron-app\.log
|
||||
echo.
|
||||
)
|
||||
|
||||
pause
|
||||
:final_launch_check
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause >nul
|
||||
exit /b %ERRORS%
|
||||
|
||||
Reference in New Issue
Block a user