Files
loki/scripts
Mao NakamotoandClaude Opus 4.7 a3f470ded7 refactor: retire bash-daemon TS consumers (Session 4a)
Session 4 of killing-the-bash-daemon plan, commit A — removes every
TS reference that pointed at the bash daemon, the bash bridge, or the
standalone home/server.ts. Bash file deletion (commit B) follows.

DELETED:
  home/server.ts (790 LoC)
    The standalone Brain HTTP server at 127.0.0.1:3001. Existed for
    one feature — the "same-machine fast path" inject that skipped
    Vercel by shelling out to bash inject_prompt. Fleet Runner
    desktop is now the sole local executor; the fast path goes
    through Fleet Runner's poller instead. The Brain's library
    pieces (home/watcher.ts, home/decide.ts, home/render.ts, home/
    state.ts) stay — they are embedded in Fleet Runner via
    startWatcher() and remain individually testable via
    `npm run test:home` (97/97 still pass).
  scripts/home-start.sh (74 LoC)
    Launcher for the deleted Brain server. Nothing to launch.
  src/app/api/system/daemon/route.ts (103 LoC)
    POST/GET that controlled the fleetcrown-daemon.service systemd
    unit. The unit was disabled in Session 1; the route's
    raison-d'être is gone.
  src/components/control/DaemonControls.tsx (102 LoC)
    UI for the deleted /api/system/daemon route. Showed start/
    restart/stop buttons that called into the bash daemon. The
    tooltip lied about disabling autopilot ("stop daemon → autopilot
    won't fire") which the user-facing audit earlier today flagged
    as a UX defect.

REWRITTEN:
  src/app/api/agent/daemon/route.ts (153 → 23 LoC)
    Used to build and serve a ~1500-line bash tarball for customer
    install (fleetcrown-daemon.sh + agent-hook-bridge.sh +
    agent-hook-lib.sh + Python beacon stack). Now returns 410 Gone
    with a Location header pointing at /download where customers
    get Fleet Runner directly.
  src/app/api/system/doctor/route.ts
    Removed the beacon-window and bash-daemon systemd unit probes.
    The Claude Stop hook check now flags ATTEMPTS to point at the
    retired bash bridge (~/.local/share/fleetcrown-beacon/
    agent-hook-bridge.sh) as failures — a hook that exec's a
    deleted path is broken, not a feature.
  src/components/control/DaemonStatusBanner.tsx
    Removed the embedded DaemonControls. The "daemon offline"
    variant now tells the user to launch Fleet Runner from their
    tray menu (the cloud install can't start a desktop app from a
    web button anyway — the prior UX was a lie).
  src/hooks/use-control-data.ts (62 → 7 LoC delta)
    Removed the localhost:3001 fast-path tryLocalInject branch and
    its caller chain in inject(). Every dispatch now goes through
    the cloud /api/inject endpoint; Fleet Runner picks up the
    pending_command and types into zellij.

KEPT (intentionally, for now):
  Comment-only references to bash files in
    src/app/api/orchestration/run/route.ts
    src/db/schema/pending-commands.ts
    src/config/prompt-library.ts
    home/{watcher,worker,projects}.ts
    desktop/src/main/{dispatch,poller}.ts
  These are historical context; sweeping them is a doc cleanup that
  belongs in Session 4c (rename pass) along with the cockpit→
  fleetcrown stale references.

Verification: tsc clean. test:home 97/97. test:autopilot-defaults
11/11. test:dispatch-gates 11/11. lint clean (11 pre-existing
warnings, no errors).

Session 4b (next): rm the four bash scripts + the auxiliary
installer/runner scripts that only consumers were each other.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-11 07:50:40 +02:00
..