Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cursor/rules/program-directory-and-file-definitions.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ project-root/
├── package.json # Root scripts
├── moto-update-manifest.json # Build 0 updater/build identity manifest committed on main
├── SECURITY.md # Security policy and private vulnerability reporting
├── Click To Launch MOTO.bat # The authoritative Windows launcher entrypoint (thin wrapper that delegates to moto_launcher.py)
├── Click To Launch MOTO.bat # The authoritative Windows launcher entrypoint (bootstraps Python 3.10+ via winget when missing, then delegates to moto_launcher.py)
├── linux-ubuntu-launcher.sh # Linux/Ubuntu launcher entrypoint (thin bash wrapper that delegates to moto_launcher.py)
├── moto_launcher.py # Internal Python launcher orchestration (update check, runtime resolution, dependency install, service startup)
├── moto_updater.py # Build 1 updater helper (manifest fetch, install classification, ZIP/git apply flow, launcher state tracking)
Expand All @@ -378,7 +378,7 @@ project-root/

### Launcher and Updater

- `Click To Launch MOTO.bat`: The only Windows consumer entrypoint. It stays thin and always delegates to the Python launcher.
- `Click To Launch MOTO.bat`: The only Windows consumer entrypoint. It bootstraps a usable Python 3.10+ interpreter on fresh Windows installs when `winget` is available, then delegates to the Python launcher.
- `linux-ubuntu-launcher.sh`: The Linux/Ubuntu consumer entrypoint. Same thin-wrapper contract as the `.bat`; delegates to `moto_launcher.py`.
- `moto_launcher.py`: Orchestrates the launcher flow in order: update check, runtime resolution, dependency install, LM Studio detection, detached backend/frontend startup, and browser launch.
- `moto_updater.py`: Owns Build 1 updater behavior, including GitHub REST contents metadata + branch-HEAD resolution, install-state classification, clean-git fast-forward apply, ZIP overlay apply with post-apply manifest stamping, rollback-aware relaunch, and launcher-managed instance safety checks.
Expand Down
86 changes: 84 additions & 2 deletions Click To Launch MOTO.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,94 @@
@echo off
setlocal
setlocal EnableExtensions

set "SCRIPT_DIR=%~dp0"
python "%SCRIPT_DIR%moto_launcher.py" %*
set "LAUNCHER_SCRIPT=%SCRIPT_DIR%moto_launcher.py"
set "PYTHON_CMD="

call :find_python
if not defined PYTHON_CMD (
echo.
echo Python 3.10+ was not found. MOTO will try to install Python 3.12 with winget.
echo.
call :install_python
if errorlevel 1 goto python_missing
call :find_python
)

if not defined PYTHON_CMD goto python_missing

%PYTHON_CMD% "%LAUNCHER_SCRIPT%" %*
set "EXIT_CODE=%ERRORLEVEL%"
if %EXIT_CODE% NEQ 0 (
echo.
echo Press Enter to close...
pause >nul
)
exit /b %EXIT_CODE%

:find_python
call :check_python py -3.12
if defined PYTHON_CMD exit /b 0
call :check_python py -3.11
if defined PYTHON_CMD exit /b 0
call :check_python py -3.10
if defined PYTHON_CMD exit /b 0
call :check_python "%LocalAppData%\Programs\Python\Python312\python.exe"
if defined PYTHON_CMD exit /b 0
call :check_python "%LocalAppData%\Programs\Python\Python311\python.exe"
if defined PYTHON_CMD exit /b 0
call :check_python "%LocalAppData%\Programs\Python\Python310\python.exe"
if defined PYTHON_CMD exit /b 0
call :check_python "%ProgramFiles%\Python312\python.exe"
if defined PYTHON_CMD exit /b 0
call :check_python "%ProgramFiles%\Python311\python.exe"
if defined PYTHON_CMD exit /b 0
call :check_python "%ProgramFiles%\Python310\python.exe"
if defined PYTHON_CMD exit /b 0
call :check_python "%ProgramFiles(x86)%\Python312\python.exe"
if defined PYTHON_CMD exit /b 0
call :check_python "%ProgramFiles(x86)%\Python311\python.exe"
if defined PYTHON_CMD exit /b 0
call :check_python "%ProgramFiles(x86)%\Python310\python.exe"
if defined PYTHON_CMD exit /b 0
call :check_python python
if defined PYTHON_CMD exit /b 0
call :check_python py -3
if defined PYTHON_CMD exit /b 0
call :check_python "%LocalAppData%\Programs\Python\Python313\python.exe"
if defined PYTHON_CMD exit /b 0
call :check_python "%ProgramFiles%\Python313\python.exe"
if defined PYTHON_CMD exit /b 0
call :check_python "%ProgramFiles(x86)%\Python313\python.exe"
if defined PYTHON_CMD exit /b 0
exit /b 1

:check_python
%* -c "import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)" >nul 2>nul
if not errorlevel 1 set "PYTHON_CMD=%*"
exit /b 0

:install_python
where winget >nul 2>nul
if errorlevel 1 exit /b 1
winget install --id Python.Python.3.12 -e --source winget --scope user --accept-package-agreements --accept-source-agreements
if not errorlevel 1 exit /b 0
echo.
echo User-scope Python install did not complete. Trying the default winget install scope...
winget install --id Python.Python.3.12 -e --source winget --accept-package-agreements --accept-source-agreements
exit /b %ERRORLEVEL%

:python_missing
echo.
echo ============================================================
echo ERROR: Python 3.10+ is required to launch MOTO.
echo ============================================================
echo.
echo Automatic Python installation was unavailable or did not complete.
echo Install Python 3.12 from https://www.python.org/downloads/
echo IMPORTANT: Check "Add Python to PATH" during installation.
echo.
start "" "https://www.python.org/downloads/"
echo Press Enter to close...
pause >nul
exit /b 1
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ MOTO (Multi-Output Token Orchestrator) is a high-risk high-reward (novelty seeki
Before installation, you need:

1. **Python 3.10+** - [Download here](https://www.python.org/downloads/)
- ⚠️ **IMPORTANT**: Check "Add Python to PATH" during installation
2. **Node.js 20.19+** - [Download here](https://nodejs.org/)
- Windows one-click launches try to install Python 3.12 automatically with `winget` if Python is missing.
- ⚠️ **IMPORTANT**: If installing manually, check "Add Python to PATH" during installation.
2. **Node.js 20.19+ or 22.12+** - [Download here](https://nodejs.org/)
- Windows one-click launches try to install Node.js LTS automatically with `winget` if Node.js is missing or too old.
3. **LM Studio** (optional but HIGHLY recommended - otherwise your system will need to pay OpenRouter for RAG embedding calls, which is very slow compared to LM Studio's local embeddings) - [Download here](https://lmstudio.ai/)
- If using OpenRouter, then download and load at least one model (e.g., DeepSeek, Llama, Qwen - older models and some models below 12 billion parameters may struggle; however, it is always worth a try!)
- **Load the LM Studio RAG agent [optional but HIGHLY recommended for much faster outputs/answers]**: Load the embedding model `nomic-ai/nomic-embed-text-v1.5` in your LM Studio "Developer" tab (server tab) (search for "nomic-ai/nomic-embed-text-v1.5" to download it in the LM Studio downloads center). Please note: you may need to enable "Power User" or "Developer" to see this developer tab - this server will let you load the amount and capacity of simultaneous models that your PC will support. In this developer tab is where you load both your nomic-ai embedding agent and any optional local hosted agents you want to use in the program (e.g., GPT OSS 20b, DeepSeek 32B, etc.). **If you do not download LM Studio and enable the Nomic agent the system will run much slower and cost slightly more due to having to use the paid service OpenRouter for RAG calls.**
Expand Down Expand Up @@ -95,7 +97,8 @@ Lean 4 proof verification is optional. The launcher prepares it when available,
- Then open Settings to keep the recommended profile or switch to your saved team profile / another default profile
5. The launcher will:
- Check all prerequisites
- Install Python and Node.js dependencies automatically
- Install missing Windows Python/Node.js runtimes with `winget` when available
- Install Python and Node.js package dependencies automatically
- Create necessary directories
- Check the official GitHub `main` build manifest before startup
- Offer a prompted update flow for supported installs when `main` is ahead
Expand Down Expand Up @@ -273,11 +276,13 @@ All configurable per role:
### Installation Issues

**"Python not recognized"**
- Reinstall Python and check "Add Python to PATH"
- Double-click `Click To Launch MOTO.bat` again so it can try the `winget` Python install path
- If automatic install is unavailable, reinstall Python and check "Add Python to PATH"
- Verify: `python --version` in terminal

**"Node not recognized"**
- Install Node.js from nodejs.org
- Double-click `Click To Launch MOTO.bat` again so it can try the `winget` Node.js LTS install path
- If automatic install is unavailable, install Node.js LTS from nodejs.org
- Verify: `node --version` in terminal

**"pip install failed"**
Expand Down
39 changes: 32 additions & 7 deletions linux-ubuntu-launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,30 @@ PYTHON_BIN="$VENV_DIR/bin/python"

resolve_bootstrap_python() {
if command -v python3 >/dev/null 2>&1; then
command -v python3
return 0
local candidate
candidate="$(command -v python3)"
if "$candidate" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)' >/dev/null 2>&1; then
printf '%s\n' "$candidate"
return 0
fi
fi
if command -v python >/dev/null 2>&1; then
command -v python
return 0
local candidate
candidate="$(command -v python)"
if "$candidate" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)' >/dev/null 2>&1; then
printf '%s\n' "$candidate"
return 0
fi
fi
return 1
}

if [[ ! -x "$PYTHON_BIN" ]]; then
BOOTSTRAP_PYTHON="$(resolve_bootstrap_python || true)"
create_repo_venv() {
if [[ -z "${BOOTSTRAP_PYTHON:-}" ]]; then
BOOTSTRAP_PYTHON="$(resolve_bootstrap_python || true)"
fi
if [[ -z "${BOOTSTRAP_PYTHON:-}" ]]; then
echo "ERROR: Python 3.8+ is required to launch MOTO on Ubuntu 24.04."
echo "ERROR: Python 3.10+ is required to launch MOTO on Ubuntu 24.04."
echo "Install Python 3 and python3-venv, then run this launcher again."
echo "Example: sudo apt install python3 python3-venv"
exit 1
Expand All @@ -33,6 +43,21 @@ if [[ ! -x "$PYTHON_BIN" ]]; then
echo " sudo apt install python3-venv"
exit 1
fi
}

if [[ ! -x "$PYTHON_BIN" ]]; then
create_repo_venv
elif ! "$PYTHON_BIN" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)' >/dev/null 2>&1; then
BOOTSTRAP_PYTHON="$(resolve_bootstrap_python || true)"
if [[ -z "${BOOTSTRAP_PYTHON:-}" ]]; then
echo "ERROR: Existing repo-local .venv uses Python older than 3.10, and no replacement Python 3.10+ was found."
echo "Install Python 3 and python3-venv, then run this launcher again."
echo "Example: sudo apt install python3 python3-venv"
exit 1
fi
echo "Existing repo-local .venv uses Python older than 3.10. Recreating it ..."
rm -rf "$VENV_DIR"
create_repo_venv
fi

if [[ ! -x "$PYTHON_BIN" ]]; then
Expand Down
Loading
Loading