fix(launch): reliable Windows launcher; feat(ui): compact sidebar, Vite toggle, chat Think toggle
Ported from the private repo via bin/publish.sh, plus a manual catch-up on files that had drifted out of sync before today: - launch_nexus.ps1: health-check based restart decisions instead of a bare port-listen check (a wedged leftover process squatting a port used to look "already running" and block the real service from starting), a script-path quoting fix for Start-Process, hidden console via a wscript.exe wrapper (bin/launch_nexus_hidden.vbs), and a taskbar/window icon for the native app window. - Sidebar: slim icon+text nav rows instead of bulky bordered buttons, tighter spacing throughout. - Settings: full-width layout, a Vite dev-server Start/Stop toggle (synapse/frontend_manager.py + /frontend/* endpoints), and the Linux-only Icon Branding section now gated on the new /status `platform` field instead of always rendering. - Chatbot: a Think toggle next to the model picker, so extended thinking can be flipped without leaving the chat page. - management/ncp.py: faster start/stop polling (0.25s steps instead of 1s), Vite no longer blocks `ncp start` on Linux and is skipped outright on Windows. Note: the private repo also has a Mail (IMAP/SMTP) feature; it's intentionally not included here, so the Mail-only pieces of main.py, App.jsx, and requirements-windows.txt were left out of this port.
This commit is contained in:
+28
-1
@@ -10,6 +10,7 @@ from uuid import UUID
|
||||
|
||||
import httpx
|
||||
import os as _os
|
||||
import platform as _platform
|
||||
from pathlib import Path
|
||||
from fastapi import FastAPI, HTTPException, Body
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
@@ -19,6 +20,7 @@ from .nexus_config import settings, VERSION, DEFAULT_CHAT_MODEL
|
||||
from .chat import generate_chat_response, stream_chat_response, _synapse_trace
|
||||
from . import chat as _chat
|
||||
from .ollama_manager import initialize_ollama, initialize_ollama_async, get_ollama_manager
|
||||
from . import frontend_manager as _frontend_manager
|
||||
from .playbook_manager import PlaybookManager
|
||||
from . import tools as _tools
|
||||
|
||||
@@ -226,7 +228,7 @@ async def root():
|
||||
if (ollama is not None and hasattr(ollama, "get_status")) else None)
|
||||
except Exception:
|
||||
status = None
|
||||
return {"status": "online", "version": VERSION, "ollama": status}
|
||||
return {"status": "online", "version": VERSION, "ollama": status, "platform": _platform.system().lower()}
|
||||
|
||||
|
||||
# -------------------------
|
||||
@@ -788,6 +790,31 @@ async def ollama_stop_endpoint():
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
# -------------------------
|
||||
# Vite Dev Server (Settings toggle) - dev-only convenience, not part of the
|
||||
# single-process production path. Runs via a thread so npm's own startup time
|
||||
# doesn't block the event loop, matching the Ollama start/stop pattern above.
|
||||
# -------------------------
|
||||
@app.get("/frontend/status")
|
||||
async def frontend_status_endpoint():
|
||||
return {"running": await _asyncio.to_thread(_frontend_manager.is_running)}
|
||||
|
||||
|
||||
@app.post("/frontend/start")
|
||||
async def frontend_start_endpoint():
|
||||
try:
|
||||
return await _asyncio.to_thread(_frontend_manager.start)
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
|
||||
@app.post("/frontend/stop")
|
||||
async def frontend_stop_endpoint():
|
||||
try:
|
||||
return await _asyncio.to_thread(_frontend_manager.stop)
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
# -------------------------
|
||||
# Playbooks List (existing)
|
||||
# -------------------------
|
||||
|
||||
Reference in New Issue
Block a user