From aaa7e2435791430485db063bdf75b4561f3e174b Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 17 May 2026 02:06:12 -0700 Subject: [PATCH] =?UTF-8?q?feat(@projects/@magic-civilization):=20?= =?UTF-8?q?=E2=9C=A8=20add=20os-specific=20godot=20runner=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- scripts/claude-player-server.sh | 52 ++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/scripts/claude-player-server.sh b/scripts/claude-player-server.sh index 8c35bac5..52e23ae4 100755 --- a/scripts/claude-player-server.sh +++ b/scripts/claude-player-server.sh @@ -28,17 +28,41 @@ PROJECT_DIR="$(dirname "$SCRIPT_DIR")" : "${CP_LOG_FILE:=}" # Pure-headless mode — no Wayland needed. JSON-Lines speaks to stdout. -flatpak run --user \ - --env=CP_SEED="$CP_SEED" \ - --env=CP_PLAYERS="$CP_PLAYERS" \ - --env=CP_CLAUDE_SLOT="$CP_CLAUDE_SLOT" \ - --env=CP_MAP_SIZE="$CP_MAP_SIZE" \ - --env=CP_MAP_TYPE="$CP_MAP_TYPE" \ - --env=CP_OMNISCIENT="$CP_OMNISCIENT" \ - --env=CP_TIMEOUT_SEC="$CP_TIMEOUT_SEC" \ - --env=CP_LOG_FILE="$CP_LOG_FILE" \ - org.godotengine.Godot \ - --path "$PROJECT_DIR/src/game" \ - --headless \ - --rendering-method gl_compatibility \ - res://engine/scenes/headless/claude_player_main.tscn +# +# Linux uses flatpak Godot (matches the rest of the apricot pipeline). +# macOS uses the locally-installed `godot` binary (Homebrew); a parallel +# flatpak runtime just for this harness is silly when native Godot 4 +# works directly. Env-var passthrough is automatic for the native path. +export CP_SEED CP_PLAYERS CP_CLAUDE_SLOT CP_MAP_SIZE CP_MAP_TYPE \ + CP_OMNISCIENT CP_TIMEOUT_SEC CP_LOG_FILE + +case "$(uname -s)" in + Darwin) + GODOT_BIN="${GODOT_BIN:-godot}" + if ! command -v "$GODOT_BIN" >/dev/null 2>&1; then + echo "ERROR: no godot binary on PATH (set GODOT_BIN or 'brew install godot')." >&2 + exit 1 + fi + exec "$GODOT_BIN" \ + --path "$PROJECT_DIR/src/game" \ + --headless \ + --rendering-method gl_compatibility \ + res://engine/scenes/headless/claude_player_main.tscn + ;; + *) + exec flatpak run --user \ + --env=CP_SEED="$CP_SEED" \ + --env=CP_PLAYERS="$CP_PLAYERS" \ + --env=CP_CLAUDE_SLOT="$CP_CLAUDE_SLOT" \ + --env=CP_MAP_SIZE="$CP_MAP_SIZE" \ + --env=CP_MAP_TYPE="$CP_MAP_TYPE" \ + --env=CP_OMNISCIENT="$CP_OMNISCIENT" \ + --env=CP_TIMEOUT_SEC="$CP_TIMEOUT_SEC" \ + --env=CP_LOG_FILE="$CP_LOG_FILE" \ + org.godotengine.Godot \ + --path "$PROJECT_DIR/src/game" \ + --headless \ + --rendering-method gl_compatibility \ + res://engine/scenes/headless/claude_player_main.tscn + ;; +esac