forked from enderofwings/NexusOS
feat(packaging): move the CLI into nexusos_cli and make the wheel self-sufficient
The CLI shipped from `management/`, which also holds desktop-only pieces (the Tk control panel, the XFCE panel wiring, the shell wrappers). Packaging that directory meant the wheel either dragged in tkinter or shipped a broken import. Split it: `nexusos_cli/` is what the wheel ships and what `nexus`/`ncp`/ `nexusos` dispatch to, `management/` keeps the desktop half. Alongside the move: * hatch_build.py decides the interface/web/dist include at build time. dist/ is gitignored, so a static force-include aborts `pip install -e .` on a fresh clone - before the reader reaches the `npm run build` step. Editable installs now skip a missing dist; wheels and sdists hard-error naming the command to run. * synapse/proc_util.py gives frontend_manager and ncp process inspection and termination without psutil, which became an optional extra when the wheel landed. It routes around Windows having no signals, where os.kill(pid, 15) is an unblockable TerminateProcess rather than a polite request. * nexusos_cli/monitor.py adds `ncp monitor`, an ASCII dashboard with no curses or rich dependency so it works in Termux, plain SSH and Windows Terminal. Collector and renderer are separate so tests feed fixtures, no stack needed. * tests/test_packaging_deps.py fails the gate when synapse or nexusos_cli import a distribution pyproject does not declare, and when an optional dependency is imported at module scope instead of lazily. * bin/check.sh now builds the wheel, twine-checks it, and asserts the compiled UI and seed playbooks are actually inside it. A wheel that builds but ships no dist/ serves a blank page, which only shows up after release. tests/test_nexus_api.py moves to tests/ with the module it covers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
d579502a5b
commit
9104c724c4
@@ -57,7 +57,7 @@ access to the same features as the web UI (all via the REST API on `:8000`):
|
||||
./management/nexus-cli.sh stop
|
||||
./management/nexus-cli.sh start --backend|-b / --frontend|-f / --memory|-m
|
||||
|
||||
# Feature commands (dispatch to management/nexus_api.py — httpx, no TUI):
|
||||
# Feature commands (dispatch to nexusos_cli/nexus_api.py — httpx, no TUI):
|
||||
ncp chat "<message>" # stream a reply (POST /chat/stream)
|
||||
ncp memory list|add <text>|rm <id>
|
||||
ncp playbook list|show <id> # first playbook (*) is the active system prompt
|
||||
@@ -66,12 +66,15 @@ ncp history [query] # recent conversations
|
||||
The old curses TUIs (`nexus-chat.py`, `nexus-playbook.py`) were removed in favor of
|
||||
these API-backed subcommands. The CLI covers chat, memory, playbooks, and history;
|
||||
the web UI and control panel expose the remaining management features.
|
||||
The CLI itself lives in `nexusos_cli/` (that is what the wheel ships and what
|
||||
`nexus`/`ncp`/`nexusos` dispatch to); `management/` keeps the desktop-only
|
||||
pieces — the shell wrappers, the Tk control panel, and the XFCE panel wiring.
|
||||
`management/controlpanel.py` (tkinter GUI, wired into the XFCE panel via
|
||||
`bin/panel/nexus-popup.py`) stays.
|
||||
|
||||
**Checks (the release gate):**
|
||||
```bash
|
||||
./bin/check.sh # pytest (tests/ + management/) + eslint + .ps1 parse check
|
||||
./bin/check.sh # pytest + eslint + frontend tests + .ps1/.sh parse + wheel build
|
||||
```
|
||||
There is no hosted CI — the remote is self-hosted Gitea with no act_runner — so
|
||||
this script *is* the gate. Run it before tagging a release.
|
||||
|
||||
Reference in New Issue
Block a user