From 194c63e4d11e6de9792a736a7b99788f1db78741 Mon Sep 17 00:00:00 2001 From: historia Date: Mon, 24 Aug 2026 00:41:52 -0400 Subject: feat: running process detection, menu gating --- backends/audiocpp.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'backends/audiocpp.py') diff --git a/backends/audiocpp.py b/backends/audiocpp.py index b401366..57636a7 100755 --- a/backends/audiocpp.py +++ b/backends/audiocpp.py @@ -41,8 +41,8 @@ from typing import Callable, Dict, List, Optional, Set, Tuple # Allow running directly (python backends/audiocpp.py) from any cwd. sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) -import tui -from backends import BackendStatus, ModifyAction +from ui import tui +from backends import BackendStatus, ConfigureAction from backends import common from backends.common import ( CONFIG_PATH, @@ -1645,11 +1645,14 @@ def build_parser() -> argparse.ArgumentParser: def detect() -> BackendStatus: """Detect how far audio.cpp is set up, plus the command to start it.""" checkout = find_local_checkout() + # Probe the server first: it may be running externally even with no + # local checkout, and the status table should show that. + running = common.server_running(config.AUDIOCPP_API_URL) details: List[str] = [] launch = "" if checkout is None: return BackendStatus("audiocpp", "audio.cpp", installed=False, - configured=False, + configured=False, running=running, details=["not cloned — run setup to clone " "./audio.cpp"]) details.append(f"checkout: {checkout}") @@ -1670,13 +1673,13 @@ def detect() -> BackendStatus: else: details.append("no server.json — run setup to configure models") return BackendStatus("audiocpp", "audio.cpp", installed=built, - configured=configured, details=details, - launch_hint=launch) + configured=configured, running=running, + details=details, launch_hint=launch) -modify_actions: List[ModifyAction] = [ - ModifyAction("Reconfigure audio.cpp (models, voices, server.json)", - run_tui), +configure_actions: List[ConfigureAction] = [ + ConfigureAction("Reconfigure audio.cpp (models, voices, server.json)", + run_tui), ] -- cgit v1.2.3