#!/usr/bin/env bash # Installs Peppa's launchd agents (start at login, restart on crash): # quest.telecom.peppa.watchdog — session watchdog under caffeinate -i (no idle sleep) # quest.telecom.peppa.web — Next.js platform on :3100 (needs `pnpm --filter @peppa/web build`) # through its own server apps/web/server.ts (PEP-225: WebSocket # /api/ws); a checkout without it (a rollback) — plain `next start`. # PEPPA_WEB_MODE=dev runs it in dev mode (HMR) # quest.telecom.peppa.bot — Telegram bot (TELEGRAM_BOT_TOKEN in .env) # quest.telecom.peppa.observer — Observability monitors (PEP-202), own DB ~/.peppa/observe.db # quest.telecom.peppa.release — Peppa's own prod releases (PEP-18): started by launchd while # ~/.peppa/release-queue has requests (the PM's button) # Prod runs from the release directory: ~/peppa/current/scripts/install-launchd.sh, so every # path below (and PEPPA_ROOT for hooks and git config) is ~/peppa/current, not a release. # Pre-launch (PEP-165): scripts/install-launchd.sh watchdog web bot from the working copy — web in # `start` mode (build first: `next build` in apps/web), no release agent. Never `next dev` on the live # site: its rebuilds made every open tab reload in a loop (16.11). # Usage: scripts/install-launchd.sh [watchdog] [web] [bot] [observer] [release] (default: all) # Remove: launchctl bootout gui/$(id -u)/