Skip to content

Commit 7bdc50e

Browse files
SwiftWing21claude
andcommitted
feat: Comms tab, MCP server upgrade, auth flow fix, build cleanup
- Add Comms dashboard tab (Fleet Comm + Chat) with 5 channels, SSE live updates - Upgrade MCP server with port discovery, comms tools, ignition control - Fix .exe launcher: frozen path resolution, _get_python() for supervisor start - Auth flow: splash → profile select → dashboard (fleet starts idle until login) - Add auto_start per-user preference (DB column + auth API + frontend wiring) - Dashboard port fallback (5555 → 5556 → 5557) with .port discovery file - Delete build.bat (replaced by cross-platform build.py) - Roadmap: PT-5 build size optimization (PyQt6-WebEngine → Edge/WebView2) - Gitignore: audit DBs, .port, baseline JSON files Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1b5d377 commit 7bdc50e

22 files changed

+2435
-122
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,15 @@ repo-descriptions.txt
174174
# ── Fleet — runtime state flags ──────────────────────────────────────────────
175175
fleet/.queue_paused
176176
fleet/.walkthrough_done
177+
fleet/.port
178+
179+
# ── Audit databases / baselines (runtime, not source) ───────────────────────
180+
*.audit.db
181+
audit.db
182+
audit_baseline.json
183+
biged_audit.db
184+
biged_baseline.json
185+
.two-brain-audit.json
177186

178187
# ── Fleet — learned packs (runtime RL output) ────────────────────────────────
179188
fleet/factorio/packs/learned/

BigEd/launcher/BigEdCC.spec

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
# -*- mode: python ; coding: utf-8 -*-
22

3-
datas = [('brick.ico', '.'), ('icon_1024.png', '.'), ('modules', 'modules'), ('tray.py', '.'), ('launcher_webview.py', '.')]
4-
binaries = []
5-
hiddenimports = ['psutil', 'pynvml', 'webview', 'qtpy', 'PyQt6', 'PyQt6.QtWebEngineWidgets']
6-
73

84
a = Analysis(
95
['launcher.py'],
106
pathex=[],
11-
binaries=binaries,
12-
datas=datas,
13-
hiddenimports=hiddenimports,
7+
binaries=[],
8+
datas=[('brick.ico', '.'), ('icon_1024.png', '.'), ('modules', 'modules'), ('launcher_webview.py', '.'), ('tray.py', '.')],
9+
hiddenimports=['psutil', 'pynvml', 'webview', 'qtpy', 'PyQt6', 'PyQt6.QtWebEngineWidgets'],
1410
hookspath=[],
1511
hooksconfig={},
1612
runtime_hooks=[],

BigEd/launcher/build.bat

Lines changed: 0 additions & 52 deletions
This file was deleted.

BigEd/launcher/launcher_webview.py

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,22 @@ def _build_splash_html() -> str:
5555
</body></html>"""
5656

5757
SPLASH_HTML = _build_splash_html()
58-
FLEET_DIR = Path(__file__).resolve().parent.parent.parent / "fleet"
59-
DATA_DIR = Path(__file__).resolve().parent / "data"
60-
ICON_PATH = Path(__file__).resolve().parent / "icon_1024.png"
58+
59+
# When frozen (PyInstaller --onefile), __file__ is inside a temp extraction dir.
60+
# Use the .exe's location as anchor instead.
61+
# Layout: BigEd/launcher/dist/BigEdCC.exe → project root is 3 levels up
62+
# Layout: BigEd/launcher/launcher_webview.py → project root is 3 levels up
63+
if getattr(sys, "frozen", False):
64+
_EXE_DIR = Path(sys.executable).resolve().parent # BigEd/launcher/dist/
65+
_LAUNCHER_DIR = _EXE_DIR.parent # BigEd/launcher/
66+
_PROJECT_ROOT = _LAUNCHER_DIR.parent.parent # project root
67+
else:
68+
_LAUNCHER_DIR = Path(__file__).resolve().parent # BigEd/launcher/
69+
_PROJECT_ROOT = _LAUNCHER_DIR.parent.parent # project root
70+
71+
FLEET_DIR = _PROJECT_ROOT / "fleet"
72+
DATA_DIR = _LAUNCHER_DIR / "data"
73+
ICON_PATH = _LAUNCHER_DIR / "icon_1024.png"
6174

6275
_lock_sock: socket.socket | None = None
6376
_supervisor_proc: subprocess.Popen | None = None
@@ -145,17 +158,26 @@ def _relaunch_windowless():
145158

146159
# -- Supervisor ----------------------------------------------------------------
147160

161+
def _get_python() -> str:
162+
"""Return a real Python interpreter — sys.executable points to the .exe when frozen."""
163+
if getattr(sys, "frozen", False):
164+
import shutil
165+
return shutil.which("python") or shutil.which("python3") or "python"
166+
return sys.executable
167+
168+
148169
def _start_supervisor():
149170
global _supervisor_proc
150171
supervisor_py = str(FLEET_DIR / "supervisor.py")
172+
python = _get_python()
151173
_supervisor_proc = subprocess.Popen(
152-
[sys.executable, supervisor_py],
174+
[python, supervisor_py],
153175
cwd=str(FLEET_DIR),
154176
stdout=subprocess.PIPE,
155177
stderr=subprocess.PIPE,
156178
creationflags=getattr(subprocess, "CREATE_NO_WINDOW", 0),
157179
)
158-
log.info("Supervisor started (PID %s)", _supervisor_proc.pid)
180+
log.info("Supervisor started (PID %s) via %s", _supervisor_proc.pid, python)
159181

160182

161183
def _stop_supervisor():
@@ -210,6 +232,17 @@ def status(self):
210232
except Exception:
211233
return {"healthy": False}
212234

235+
def open_file_dialog(self):
236+
"""Open native file dialog starting in user's home directory."""
237+
if not _window:
238+
return []
239+
result = _window.create_file_dialog(
240+
webview.OPEN_DIALOG,
241+
directory=str(Path.home()),
242+
allow_multiple=True,
243+
)
244+
return list(result) if result else []
245+
213246
def quit(self):
214247
_shutdown()
215248

@@ -477,6 +510,9 @@ def main():
477510

478511
_load_secrets_to_env()
479512

513+
# Sweep orphan fleet processes from prior sessions before anything else
514+
_sweep_zombies()
515+
480516
if not _acquire_instance_lock():
481517
log.info("Another instance is already running (port %s held)", LOCK_PORT)
482518
try:
@@ -504,25 +540,11 @@ def main():
504540

505541
_relaunch_windowless()
506542

507-
# Check auto_start setting — if false, pause queue so fleet opens idle
508-
_auto_start = True
509-
try:
510-
toml_path = FLEET_DIR / "fleet.toml"
511-
if toml_path.exists():
512-
try:
513-
import tomllib
514-
except ImportError:
515-
import tomli as tomllib
516-
cfg = tomllib.loads(toml_path.read_text(encoding="utf-8"))
517-
_auto_start = cfg.get("fleet", {}).get("auto_start", True)
518-
except Exception:
519-
pass
520-
521-
if not _auto_start:
522-
# Create pause file so workers don't process tasks on boot
523-
pause_file = FLEET_DIR / ".queue_paused"
524-
pause_file.write_text("paused_by_launcher", encoding="utf-8")
525-
log.info("auto_start=false — fleet will open idle (queue paused)")
543+
# Always start fleet idle — user profile's auto_start preference
544+
# is checked after login in the dashboard frontend
545+
pause_file = FLEET_DIR / ".queue_paused"
546+
pause_file.write_text("paused_by_launcher", encoding="utf-8")
547+
log.info("Fleet will open idle (queue paused until after login)")
526548

527549
# Show splash window immediately — no waiting
528550
_window = webview.create_window(

ROADMAP.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,28 @@ Completed 2026-03-18. Linux AppImage (`package_linux.py`), macOS .app/DMG (`pack
15551555

15561556
Completed 2026-03-18. GitHub Actions CI matrix (Win/Linux/macOS x Python 3.11/3.12), smoke test per platform, skill import verification, CLI command verification.
15571557

1558+
#### PT-5: Build Size Optimization
1559+
- **Goal:** Reduce BigEdCC.exe from 261MB (PyQt6-WebEngine bloat) to < 80MB
1560+
- **Grading Alignment:** Performance → impact: +1 pt / weight: 10%; Usability → faster downloads
1561+
- **Dependencies:** None (independent of feature work)
1562+
- **Est. Tokens:** ~8k (M)
1563+
- **Status:** [ ] Not started
1564+
1565+
**Phase 1: Drop QtWebEngine** (biggest win — ~180MB of the 261MB)
1566+
- [ ] Switch pywebview to Edge/WebView2 backend on Windows (`PYWEBVIEW_GUI=edgechromium`) — ships with Windows 10+, zero bundle cost
1567+
- [ ] Remove PyQt6-WebEngine from requirements.txt (keep PyQt6 if needed for non-web UI, or drop entirely)
1568+
- [ ] Fallback chain: edgechromium → qt → cef (build.py sets env var)
1569+
1570+
**Phase 2: PyInstaller trimming** (~additional 20-30MB reduction)
1571+
- [ ] `--exclude-module` for unused stdlib (tkinter, test, unittest, lib2to3)
1572+
- [ ] Split `requirements.txt` — anthropic/google-genai are fleet-level, not needed in launcher .exe
1573+
- [ ] UPX compression on final binary (typically 30-40% reduction)
1574+
1575+
**Phase 3: GitHub Releases distribution**
1576+
- [ ] GitHub Actions workflow: on tag push, `build.py --production`, upload artifacts to GitHub Release
1577+
- [ ] Launcher auto-update checks GitHub Releases API for latest version
1578+
- [ ] README download badges pointing to latest release
1579+
15581580
### CT — Cost Intelligence (Token Usage & Optimization)
15591581

15601582
#### CT-1: Usage Capture [DONE]

0 commit comments

Comments
 (0)