Repository Public
1#!/usr/bin/env bash2# Author: Simon-Pierre Boucher — contact@spboucher.ai3# File: Scripts/run-dev.sh4# Description: Launches the Debug build against the DEVELOPMENT backend with a minted development session (no Touch ID needed), optional screenshot.5#6# Usage: Scripts/run-dev.sh [--shot out.png [delay-seconds]] [app arguments…]7# DEBUG-only app arguments for visual checks: -SPChatOpen <conversation id> · -SPChatAutoSend "<text>" · -SPChatModel <model id> · -SPChatWeb8# -SPChatDraft "<text>" · -SPChatShowModelPicker · -SPChatPalette · -SPChatSection <models|compare|usage|constellation|…>9# -SPChatPanel <inspector|timeline|lens|branches> · -SPChatSettings <general|providers|assistant|…> · -SPChatAppearance <light|dark>10# -SPChatExplorerModel <model id> · -SPChatWindow <width>x<height>11set -euo pipefail12cd "$(dirname "$0")/.."13SHOT=""; DELAY=614if [[ "${1:-}" == "--shot" ]]; then SHOT="$2"; shift 2; if [[ "${1:-}" =~ ^[0-9]+$ ]]; then DELAY="$1"; shift; fi; fi15eval "$(Scripts/dev-session.sh)"16# exactly this checkout's Debug build: never the installed app, never a test host of another worktree17APP="${APP:-$PWD/build/DerivedData/Build/Products/Debug/SP Chat.app}"18pkill -f "$APP/Contents/MacOS" 2>/dev/null || true; sleep 119open -n "$APP" --env SPCHAT_SERVER="$SPCHAT_SERVER" --env SPCHAT_SESSION_COOKIE="$SPCHAT_SESSION_COOKIE" --args -SPChatInMemory "$@"20if [[ -n "$SHOT" ]]; then21 sleep "$DELAY"; PID="$(pgrep -f "$APP/Contents/MacOS/SP Chat" | head -1)"22 [[ -x build/window-shot ]] || swiftc -O Scripts/window-shot.swift -o build/window-shot 2>/dev/null23 build/window-shot "SP Chat" "$SHOT" "$PID" | tail -124fi25