v0.5.0: Binary-Free Mode - No OpenCode binary required
✨ Major Features: - Native session management without OpenCode binary - Provider routing: OpenCode Zen (free), Qwen OAuth, Z.AI - Streaming chat with tool execution loop - Mode detection API (/api/meta/mode) - MCP integration fix (resolved infinite loading) - NomadArch Native option in UI with comparison info 🆓 Free Models (No API Key): - GPT-5 Nano (400K context) - Grok Code Fast 1 (256K context) - GLM-4.7 (205K context) - Doubao Seed Code (256K context) - Big Pickle (200K context) 📦 New Files: - session-store.ts: Native session persistence - native-sessions.ts: REST API for sessions - lite-mode.ts: UI mode detection client - native-sessions.ts (UI): SolidJS store 🔧 Updated: - All installers: Optional binary download - All launchers: Mode detection display - Binary selector: Added NomadArch Native option - README: Binary-Free Mode documentation
This commit is contained in:
@@ -5,7 +5,7 @@ title NomadArch Installer
|
||||
|
||||
echo.
|
||||
echo NomadArch Installer (Windows)
|
||||
echo Version: 0.4.0
|
||||
echo Version: 0.5.0 - Binary-Free Mode
|
||||
echo.
|
||||
|
||||
set SCRIPT_DIR=%~dp0
|
||||
@@ -21,7 +21,7 @@ set NEEDS_FALLBACK=0
|
||||
|
||||
echo [%date% %time%] Installer started >> "%LOG_FILE%"
|
||||
|
||||
echo [STEP 1/9] OS and Architecture Detection
|
||||
echo [STEP 1/8] OS and Architecture Detection
|
||||
wmic os get osarchitecture | findstr /i "64-bit" >nul
|
||||
if %ERRORLEVEL% equ 0 (
|
||||
set ARCH=x64
|
||||
@@ -31,7 +31,7 @@ if %ERRORLEVEL% equ 0 (
|
||||
echo [OK] Architecture: %ARCH%
|
||||
|
||||
echo.
|
||||
echo [STEP 2/9] Checking write permissions
|
||||
echo [STEP 2/8] Checking write permissions
|
||||
if not exist "%BIN_DIR%" mkdir "%BIN_DIR%"
|
||||
if not exist "%TEMP_DIR%" mkdir "%TEMP_DIR%"
|
||||
|
||||
@@ -61,7 +61,7 @@ if %ERRORLEVEL% neq 0 (
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [STEP 3/9] Ensuring system dependencies
|
||||
echo [STEP 3/8] Ensuring system dependencies
|
||||
|
||||
set WINGET_AVAILABLE=0
|
||||
where winget >nul 2>&1 && set WINGET_AVAILABLE=1
|
||||
@@ -129,7 +129,7 @@ if %ERRORLEVEL% neq 0 (
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [STEP 4/9] Installing npm dependencies
|
||||
echo [STEP 4/8] Installing npm dependencies
|
||||
cd /d "%SCRIPT_DIR%"
|
||||
echo [%date% %time%] Running npm install >> "%LOG_FILE%"
|
||||
call npm install
|
||||
@@ -142,54 +142,66 @@ if %ERRORLEVEL% neq 0 (
|
||||
echo [OK] Dependencies installed
|
||||
|
||||
echo.
|
||||
echo [STEP 5/9] Fetching OpenCode binary
|
||||
echo [STEP 5/8] OpenCode Binary (OPTIONAL - Binary-Free Mode Available)
|
||||
echo [INFO] NomadArch now supports Binary-Free Mode!
|
||||
echo [INFO] You can use the application without OpenCode binary.
|
||||
echo [INFO] Free models from OpenCode Zen are available without the binary.
|
||||
if not exist "%BIN_DIR%" mkdir "%BIN_DIR%"
|
||||
|
||||
for /f "delims=" %%v in ('powershell -NoProfile -Command "(Invoke-WebRequest -UseBasicParsing https://api.github.com/repos/sst/opencode/releases/latest).Content ^| Select-String -Pattern '""tag_name""' ^| ForEach-Object { $_.Line.Split(''\"'')[3] }"') do (
|
||||
set OPENCODE_VERSION=%%v
|
||||
)
|
||||
|
||||
set OPENCODE_BASE=https://github.com/sst/opencode/releases/download/v!OPENCODE_VERSION!
|
||||
set OPENCODE_URL=!OPENCODE_BASE!/opencode-windows-%ARCH%.exe
|
||||
set CHECKSUM_URL=!OPENCODE_BASE!/checksums.txt
|
||||
|
||||
if exist "%BIN_DIR%\opencode.exe" (
|
||||
echo [OK] OpenCode binary already exists
|
||||
echo [%date% %time%] OpenCode binary exists, skipping download >> "%LOG_FILE%"
|
||||
set SKIP_OPENCODE=0
|
||||
set /p SKIP_CHOICE="Skip OpenCode binary download? (Y for Binary-Free Mode / N to download) [Y]: "
|
||||
if /i "%SKIP_CHOICE%"=="" set SKIP_CHOICE=Y
|
||||
if /i "%SKIP_CHOICE%"=="Y" (
|
||||
set SKIP_OPENCODE=1
|
||||
echo [INFO] Skipping OpenCode binary - using Binary-Free Mode
|
||||
echo [%date% %time%] Using Binary-Free Mode >> "%LOG_FILE%"
|
||||
) else (
|
||||
echo [INFO] Downloading OpenCode v!OPENCODE_VERSION!...
|
||||
if "%DOWNLOAD_CMD%"=="curl" (
|
||||
curl -L -o "%BIN_DIR%\opencode.exe.tmp" "!OPENCODE_URL!"
|
||||
curl -L -o "%BIN_DIR%\checksums.txt" "!CHECKSUM_URL!"
|
||||
for /f "delims=" %%v in ('powershell -NoProfile -Command "(Invoke-WebRequest -UseBasicParsing https://api.github.com/repos/sst/opencode/releases/latest).Content ^| Select-String -Pattern '\"\"tag_name\"\"' ^| ForEach-Object { $_.Line.Split(''\"'')[3] }"') do (
|
||||
set OPENCODE_VERSION=%%v
|
||||
)
|
||||
|
||||
set OPENCODE_BASE=https://github.com/sst/opencode/releases/download/v!OPENCODE_VERSION!
|
||||
set OPENCODE_URL=!OPENCODE_BASE!/opencode-windows-%ARCH%.exe
|
||||
set CHECKSUM_URL=!OPENCODE_BASE!/checksums.txt
|
||||
|
||||
if exist "%BIN_DIR%\opencode.exe" (
|
||||
echo [OK] OpenCode binary already exists
|
||||
echo [%date% %time%] OpenCode binary exists, skipping download >> "%LOG_FILE%"
|
||||
) else (
|
||||
powershell -NoProfile -Command "Invoke-WebRequest -Uri '%OPENCODE_URL%' -OutFile '%BIN_DIR%\\opencode.exe.tmp'"
|
||||
powershell -NoProfile -Command "Invoke-WebRequest -Uri '%CHECKSUM_URL%' -OutFile '%BIN_DIR%\\checksums.txt'"
|
||||
)
|
||||
echo [INFO] Downloading OpenCode v!OPENCODE_VERSION!...
|
||||
if "%DOWNLOAD_CMD%"=="curl" (
|
||||
curl -L -o "%BIN_DIR%\opencode.exe.tmp" "!OPENCODE_URL!"
|
||||
curl -L -o "%BIN_DIR%\checksums.txt" "!CHECKSUM_URL!"
|
||||
) else (
|
||||
powershell -NoProfile -Command "Invoke-WebRequest -Uri '%OPENCODE_URL%' -OutFile '%BIN_DIR%\\opencode.exe.tmp'"
|
||||
powershell -NoProfile -Command "Invoke-WebRequest -Uri '%CHECKSUM_URL%' -OutFile '%BIN_DIR%\\checksums.txt'"
|
||||
)
|
||||
|
||||
set EXPECTED_HASH=
|
||||
for /f "tokens=1,2" %%h in ('type "%BIN_DIR%\checksums.txt" ^| findstr /i "opencode-windows-%ARCH%"') do (
|
||||
set EXPECTED_HASH=%%h
|
||||
)
|
||||
set EXPECTED_HASH=
|
||||
for /f "tokens=1,2" %%h in ('type "%BIN_DIR%\checksums.txt" ^| findstr /i "opencode-windows-%ARCH%"') do (
|
||||
set EXPECTED_HASH=%%h
|
||||
)
|
||||
|
||||
set ACTUAL_HASH=
|
||||
for /f "skip=1 tokens=*" %%h in ('certutil -hashfile "%BIN_DIR%\opencode.exe.tmp" SHA256 ^| findstr /v "CertUtil" ^| findstr /v "hash of"') do (
|
||||
set ACTUAL_HASH=%%h
|
||||
goto :hash_found
|
||||
)
|
||||
:hash_found
|
||||
set ACTUAL_HASH=
|
||||
for /f "skip=1 tokens=*" %%h in ('certutil -hashfile "%BIN_DIR%\opencode.exe.tmp" SHA256 ^| findstr /v "CertUtil" ^| findstr /v "hash of"') do (
|
||||
set ACTUAL_HASH=%%h
|
||||
goto :hash_found
|
||||
)
|
||||
:hash_found
|
||||
|
||||
if "!ACTUAL_HASH!"=="!EXPECTED_HASH!" (
|
||||
move /Y "%BIN_DIR%\opencode.exe.tmp" "%BIN_DIR%\opencode.exe"
|
||||
echo [OK] OpenCode downloaded and verified
|
||||
) else (
|
||||
echo [ERROR] OpenCode checksum mismatch!
|
||||
del "%BIN_DIR%\opencode.exe.tmp"
|
||||
set /a ERRORS+=1
|
||||
if "!ACTUAL_HASH!"=="!EXPECTED_HASH!" (
|
||||
move /Y "%BIN_DIR%\opencode.exe.tmp" "%BIN_DIR%\opencode.exe"
|
||||
echo [OK] OpenCode downloaded and verified
|
||||
) else (
|
||||
echo [WARN] OpenCode checksum mismatch - continuing with Binary-Free Mode
|
||||
del "%BIN_DIR%\opencode.exe.tmp" 2>nul
|
||||
set SKIP_OPENCODE=1
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [STEP 6/9] Building UI assets
|
||||
echo [STEP 6/8] Building UI assets
|
||||
if exist "%SCRIPT_DIR%\packages\ui\dist\index.html" (
|
||||
echo [OK] UI build already exists
|
||||
) else (
|
||||
@@ -207,7 +219,7 @@ if exist "%SCRIPT_DIR%\packages\ui\dist\index.html" (
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [STEP 7/9] Post-install health check
|
||||
echo [STEP 7/8] Post-install health check
|
||||
set HEALTH_ERRORS=0
|
||||
|
||||
if not exist "%SCRIPT_DIR%\package.json" set /a HEALTH_ERRORS+=1
|
||||
@@ -223,19 +235,22 @@ if %HEALTH_ERRORS% equ 0 (
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [STEP 8/9] Installation Summary
|
||||
echo [STEP 8/8] Installation Summary
|
||||
echo.
|
||||
echo Install Dir: %TARGET_DIR%
|
||||
echo Architecture: %ARCH%
|
||||
echo Node.js: %NODE_VERSION%
|
||||
echo npm: %NPM_VERSION%
|
||||
if %SKIP_OPENCODE% equ 1 (
|
||||
echo Mode: Binary-Free Mode ^(OpenCode Zen free models available^)
|
||||
) else (
|
||||
echo Mode: Full Mode ^(OpenCode binary installed^)
|
||||
)
|
||||
echo Errors: %ERRORS%
|
||||
echo Warnings: %WARNINGS%
|
||||
echo Log File: %LOG_FILE%
|
||||
echo.
|
||||
|
||||
echo [STEP 9/9] Next steps
|
||||
|
||||
:SUMMARY
|
||||
if %ERRORS% gtr 0 (
|
||||
echo [RESULT] Installation completed with errors.
|
||||
@@ -245,6 +260,12 @@ if %ERRORS% gtr 0 (
|
||||
) else (
|
||||
echo [RESULT] Installation completed successfully.
|
||||
echo Run Launch-Windows.bat to start the application.
|
||||
echo.
|
||||
if %SKIP_OPENCODE% equ 1 (
|
||||
echo NOTE: Running in Binary-Free Mode.
|
||||
echo Free models ^(GPT-5 Nano, Grok Code, GLM-4.7, etc.^) are available.
|
||||
echo You can also authenticate with Qwen for additional models.
|
||||
)
|
||||
)
|
||||
|
||||
echo.
|
||||
|
||||
Reference in New Issue
Block a user