feat: put ncp on PATH on both platforms; rename WSL reqs to Windows

Ports the ncp PATH work from upstream. Registering ncp as a shell-profile
function failed three ways on Windows: the default Restricted execution policy
blocks the profile itself, profiles don't exist outside PowerShell (cmd, Win+R,
Task Scheduler), and the self-elevating installer writes the admin's profile.

Windows now ships management/ncp.cmd and the installer appends management\ to
the Machine PATH via [Environment]::SetEnvironmentVariable -- never setx, which
truncates PATH at 1024 chars. A .cmd is exempt from the execution policy.

Linux symlinks /usr/local/bin/ncp -> management/nexus-cli.sh, falling back to
the old .bashrc function when sudo is unavailable.

Also renames requirements-wsl.txt to requirements-windows.txt and purges stale
WSL references, including vite.config.js's dev-server comment and
controlpanel.py's "Check WSLg." error string.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
jon
2026-07-22 14:11:18 -05:00
co-authored by Claude Opus 4.8
parent 9befa1d561
commit 6137710c25
14 changed files with 124 additions and 91 deletions
+19 -20
View File
@@ -17,8 +17,8 @@ memory service, and a React frontend. No external AI provider is called.
NexusOS ("Nexus") is a self-hosted assistant you actually own. All inference
runs through a **locally bundled Ollama** on `localhost`; conversations, facts,
and settings live in local SQLite. It ships with desktop branding (XFCE theme,
icons, boot splash) so it can be run as a full assistant environment, not just
a web app.
icons, boot splash) so it can be run as a full assistant environment on Linux,
not just a web app.
- **Chat** — streaming responses from local Ollama models (SSE).
- **Persistent memory** — a dedicated service auto-extracts durable facts from
@@ -47,26 +47,21 @@ cd nexus-core
powershell -ExecutionPolicy Bypass -File .\install-windows.ps1
```
> **Execution policy:** Windows blocks unsigned `.ps1` scripts by default, so
> run them with `-ExecutionPolicy Bypass` as shown (a one-run override — nothing
> permanent). Double-clicking `install-windows.ps1` or running `.\install-windows.ps1`
> bare will fail with *"running scripts is disabled on this system"*.
> The installer self-elevates (a UAC prompt will appear).
>
> To allow scripts persistently instead (then you can run `.\...ps1` directly):
> ```powershell
> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
> ```
Then double-click the **NexusOS** desktop icon (the shortcut already passes the
bypass), or launch from a shell with:
Then double-click the **NexusOS** desktop icon, or launch from a **new** shell
(PATH is read at process start, so already-open windows won't have `ncp` yet):
```powershell
powershell -ExecutionPolicy Bypass -File .\launch_nexus.ps1
ncp web
```
> The installer needs `-ExecutionPolicy Bypass` because Windows blocks unsigned
> `.ps1` by default; it's a one-run override, nothing permanent. It self-elevates,
> so a UAC prompt appears. `ncp` itself is `management\ncp.cmd` on the machine
> PATH — a `.cmd`, so no execution-policy change is ever needed, and it works
> from cmd and Task Scheduler as well as PowerShell.
The app opens at `:8000`; click **Start AI** to launch Ollama. The installer
uses `requirements-wsl.txt` (CPU-only, pure-Python — no ML stack, since Ollama
uses `requirements-windows.txt` (CPU-only, pure-Python — no ML stack, since Ollama
does all inference over HTTP).
### Linux
@@ -77,12 +72,13 @@ does all inference over HTTP).
./install.sh
# 2. Launch (memory :8001, backend :8000 — backend also serves the built UI)
./launch_nexus.sh
# The install symlinks ncp into /usr/local/bin (sudo); open a new shell first.
ncp web
```
Python deps are layered: `requirements-base.txt` (GPU-agnostic core) plus one
GPU overlay — `requirements-amd.txt` (ROCm) or `requirements-nvidia.txt` (CUDA).
`requirements-wsl.txt` is the standalone CPU-only runtime (no base overlay).
`requirements-windows.txt` is the standalone CPU-only runtime (no base overlay).
`bin/sync.py` picks the right one for the host.
`./install.sh` is also the update path — re-run it any time to pull the latest
@@ -115,12 +111,14 @@ ncp chat "<message>" # stream a reply
ncp memory list | add <text> | rm <id>
ncp playbook list | show <id> # first playbook (*) = active system prompt
ncp history [query] # recent conversations
ncp doctor # diagnostics: venv, Node, imports, Ollama, status
```
## Architecture
| Component | Location | Role |
|---|---|---|
| **Promethean** (venv) | `Promethean/` | The Python venv all backend code runs in — `source Promethean/bin/activate` (Linux) / `Promethean\Scripts\python.exe` (Windows). Keeps deps out of the system Python. |
| **Synapse** (backend) | `synapse/` | FastAPI app. `/chat/stream`, `/playbooks`, `/memory`, `/models`, `/conversations`, `/settings`, `/ollama`, `/icons`. Assembles the system prompt: active playbook → reference playbooks → memory facts → relevant past snippets. |
| **Memory service** | `synapse/memory/` | Separate FastAPI app (:8001). `/memories/extract` uses an Ollama prompt to decide what to persist. Shares the SQLite DB with the backend. |
| **Playbooks** | `synapse/playbooks/` + `data/playbooks/` | Ordered `{id}.yaml` records managed by `PlaybookManager`. |
@@ -142,6 +140,7 @@ management/ nexus-cli.sh, ncp API client, control panel, desktop theme
bin/ install, backup/restore, panel + provisioning scripts
assets/ branding: icons, boot splash, XFCE/GTK theme
data/playbooks/ active playbook YAML
Promethean/ Python venv (gitignored, built by the installer)
```
## Configuration
@@ -151,7 +150,7 @@ data/playbooks/ active playbook YAML
| Ollama host | `OLLAMA_HOST` env (default `http://127.0.0.1:11434`) |
| Filesystem paths | `synapse/nexus_config.py` |
| Frontend API base URL | `interface/web/src/config.js` |
| Python deps | `requirements-base.txt` + amd/nvidia GPU overlay; `requirements-wsl.txt` = standalone CPU runtime |
| Python deps | `requirements-base.txt` + amd/nvidia GPU overlay; `requirements-windows.txt` = standalone CPU runtime |
---