xworkmate-app/macos/Frameworks
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
..
README.md feat: integrate Codex CLI as built-in code agent 2026-03-14 00:10:27 +08:00

macOS Frameworks

This directory contains native libraries for macOS integration.

libcodex_ffi.dylib

The Rust FFI library for Codex CLI integration.

Building

Run the build script from the project root:

./scripts/build_rust_ffi.sh release

Integration

The library is linked by the Xcode project and loaded at runtime by CodexFFIBindings.

Architecture

  • libcodex_ffi.dylib - Universal binary (arm64 + x86_64)
  • libcodex_ffi.a - Static library (for debugging)

FFI Functions

Function Description
codex_init() Initialize the library
codex_runtime_create() Create a runtime instance
codex_runtime_destroy() Destroy a runtime instance
codex_start_thread() Start a new thread
codex_send_message() Send a message
codex_poll_events() Poll for events
codex_shutdown() Shutdown the runtime
codex_last_error() Get last error message

Dependencies

  • macOS 11.0 or later
  • No external dependencies beyond system libraries