xworkmate-app/scripts/copy_ffi_framework.sh
Haitao Pan a6699beff3 feat: integrate Codex CLI as built-in code agent
- Add CodexRuntime for process management and JSON-RPC communication
- Add CodexConfigBridge for AI Gateway configuration
- Add ModeSwitcher for OpenClaw Gateway mode switching (local/remote/offline)
- Add AgentRegistry for agent registration and discovery
- Add RuntimeCoordinator for unified coordination
- Add Rust FFI bindings for native integration
- Add comprehensive test coverage

Phase 1-4 features:
- Configuration bridging to AI Gateway
- Mode switching between local/remote/offline
- Agent registration protocol
- Cloud memory sync capability
- Offline fallback support

CI/CD:
- GitHub Actions workflow for Rust FFI build
- Build scripts for macOS universal binary
- Integration with Flutter build process

Co-authored-by: Codex CLI Integration <codex@openai.com>
2026-03-14 00:10:27 +08:00

40 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# Copy FFI library to macOS Frameworks
# Add this to Xcode Build Phases > Run Script
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
FRAMEWORKS_DIR="$PROJECT_ROOT/macos/Frameworks"
RUST_DIR="$PROJECT_ROOT/rust"
# Source FFI library location
UNIVERSAL_LIB="$RUST_DIR/target/universal/libcodex_ffi.dylib"
ARM_LIB="$RUST_DIR/target/aarch64-apple-darwin/release/libcodex_ffi.dylib"
DEBUG_LIB="$RUST_DIR/target/debug/libcodex_ffi.dylib"
# Ensure Frameworks directory exists
mkdir -p "$FRAMEWORKS_DIR"
# Copy universal binary if available, otherwise fall back to single architecture
if [[ -f "$UNIVERSAL_LIB" ]]; then
echo "Copying universal FFI library..."
cp "$UNIVERSAL_LIB" "$FRAMEWORKS_DIR/"
elif [[ -f "$ARM_LIB" ]]; then
echo "Copying arm64 FFI library..."
cp "$ARM_LIB" "$FRAMEWORKS_DIR/"
elif [[ -f "$DEBUG_LIB" ]]; then
echo "Copying debug FFI library..."
cp "$DEBUG_LIB" "$FRAMEWORKS_DIR/"
else
echo "Warning: FFI library not found. Run scripts/build_rust_ffi.sh first."
echo "Expected one of:"
echo " - $UNIVERSAL_LIB"
echo " - $ARM_LIB"
echo " - $DEBUG_LIB"
exit 0 # Don't fail the build if library doesn't exist yet
fi
echo "FFI library copied to $FRAMEWORKS_DIR/"