feat(packaging): add portable CLI and self-contained wheel #7

Closed
Athena wants to merge 0 commits from Athena/NexusOS:codex/cli-packaging-pr into main
Contributor

Summary

  • Adds the portable nexus/ncp/nexusos CLI and package metadata.
  • Makes the wheel self-contained with backend, web UI, seed playbooks, and the upstream modules package.
  • Adds lifecycle/doctor/config/provider commands, status monitoring, Termux bootstrap documentation, and packaging checks.

Scope and dependency

This is the packaging foundation for the TUI, macOS, and Curry follow-ups. It deliberately excludes those feature implementations.

Stacked on #5. Merge #5 first; the shared runtime commits then disappear from this PR's diff automatically.

Verification

  • 33 focused CLI, process, API-client, dependency, and packaging tests passed.
  • Frontend production build passed.
  • nexusos_ai-1.2.0-py3-none-any.whl built successfully; archive inspection confirmed modules, CLI, and compiled web assets are present.
  • The four existing Windows-only full-suite failures reproduce on main (UTF-8 fixture decoding, POSIX mode assertions, and slash path normalization); no new full-suite failure was introduced.
## Summary - Adds the portable nexus/ncp/nexusos CLI and package metadata. - Makes the wheel self-contained with backend, web UI, seed playbooks, and the upstream modules package. - Adds lifecycle/doctor/config/provider commands, status monitoring, Termux bootstrap documentation, and packaging checks. ## Scope and dependency This is the packaging foundation for the TUI, macOS, and Curry follow-ups. It deliberately excludes those feature implementations. Stacked on #5. Merge #5 first; the shared runtime commits then disappear from this PR's diff automatically. ## Verification - 33 focused CLI, process, API-client, dependency, and packaging tests passed. - Frontend production build passed. - nexusos_ai-1.2.0-py3-none-any.whl built successfully; archive inspection confirmed modules, CLI, and compiled web assets are present. - The four existing Windows-only full-suite failures reproduce on main (UTF-8 fixture decoding, POSIX mode assertions, and slash path normalization); no new full-suite failure was introduced.
Athena added 6 commits 2026-08-26 13:30:30 +00:00
Use contextlib.closing for dump, comparison, and restore connections so Windows can unlink the live database immediately after the comparison step.
Repair vector rows left behind by older databases at store startup. Keep the existing single-statement delete path from main and avoid reintroducing the redundant batched helper.
Separate bind and client addresses, include Ollama's response body in HTTP failures, and strip inline <think> blocks from complete and streamed replies.
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>
Owner

Closing as superseded by #12: this branch carried forward as-is, minus the memory-service integration - synapse/memory/service.py was deleted 2026-08-25 when curation moved in-process (curator.py), so nexus serve spawning it always failed (ModuleNotFoundError), and nexus start memory/stop memory had no handler at all. Removed rather than repaired; nexus_api.py's memory data commands (list/add/rm against the backend's own /memory endpoint) are untouched. Merged onto main.

Everything else here - the CLI itself, wheel packaging, doctor/config/provider commands, Termux docs - held up under review with no other changes needed.

Closing as superseded by #12: this branch carried forward as-is, minus the memory-service integration - synapse/memory/service.py was deleted 2026-08-25 when curation moved in-process (curator.py), so `nexus serve` spawning it always failed (ModuleNotFoundError), and `nexus start memory`/`stop memory` had no handler at all. Removed rather than repaired; nexus_api.py's memory data commands (list/add/rm against the backend's own /memory endpoint) are untouched. Merged onto main. Everything else here - the CLI itself, wheel packaging, doctor/config/provider commands, Termux docs - held up under review with no other changes needed.
enderofwings closed this pull request 2026-08-26 18:49:52 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: enderofwings/NexusOS#7