feat(openfang): add bundled OpenFang runtime support
- Add prepare-openfang-runtime.mjs script for cross-platform binary download - Update lib.rs to support binary runtime (fallback to Node.js for legacy) - Add openfang.cmd/sh launcher scripts - Update runtime-manifest.json for binary-based runtime - Add README documentation for bundled runtime architecture OpenFang binary is downloaded during build, supporting: - Windows x64/ARM64 (.zip) - macOS Intel/Apple Silicon (.tar.gz) - Linux x64/ARM64 (.tar.gz) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
76
desktop/src-tauri/resources/openfang-runtime/README.md
Normal file
76
desktop/src-tauri/resources/openfang-runtime/README.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# OpenFang Bundled Runtime
|
||||
|
||||
This directory contains the bundled OpenFang runtime for ZClaw Desktop.
|
||||
|
||||
## Architecture
|
||||
|
||||
OpenFang is a **single Rust binary** (~32MB) that runs as the Agent OS backend.
|
||||
|
||||
```
|
||||
openfang-runtime/
|
||||
├── openfang.exe # Windows binary
|
||||
├── openfang-x86_64-unknown-linux-gnu # Linux x64 binary
|
||||
├── openfang-aarch64-unknown-linux-gnu # Linux ARM64 binary
|
||||
├── openfang-x86_64-apple-darwin # macOS Intel binary
|
||||
├── openfang-aarch64-apple-darwin # macOS Apple Silicon binary
|
||||
├── runtime-manifest.json # Runtime metadata
|
||||
├── openfang.cmd # Windows launcher
|
||||
├── openfang.sh # Unix launcher
|
||||
├── download-openfang.ps1 # Windows download script
|
||||
└── download-openfang.sh # Unix download script
|
||||
```
|
||||
|
||||
## Setup
|
||||
|
||||
### Option 1: Download Binary
|
||||
|
||||
**Windows (PowerShell):**
|
||||
```powershell
|
||||
cd desktop/src-tauri/resources/openfang-runtime
|
||||
.\download-openfang.ps1
|
||||
```
|
||||
|
||||
**Linux/macOS:**
|
||||
```bash
|
||||
cd desktop/src-tauri/resources/openfang-runtime
|
||||
chmod +x download-openfang.sh
|
||||
./download-openfang.sh
|
||||
```
|
||||
|
||||
### Option 2: Manual Download
|
||||
|
||||
1. Go to https://github.com/RightNow-AI/openfang/releases
|
||||
2. Download the appropriate binary for your platform
|
||||
3. Place it in this directory
|
||||
|
||||
## Build Integration
|
||||
|
||||
The Tauri build process will include this directory in the application bundle:
|
||||
|
||||
```json
|
||||
// tauri.conf.json
|
||||
{
|
||||
"bundle": {
|
||||
"resources": ["resources/openfang-runtime/"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Runtime Resolution
|
||||
|
||||
ZClaw Desktop resolves the OpenFang runtime in this order:
|
||||
|
||||
1. `ZCLAW_OPENFANG_BIN` environment variable (for development)
|
||||
2. Bundled `openfang-runtime/` directory
|
||||
3. System PATH (`openfang`)
|
||||
|
||||
## Endpoints
|
||||
|
||||
- **WebSocket**: `ws://127.0.0.1:4200/ws`
|
||||
- **REST API**: `http://127.0.0.1:4200/api`
|
||||
|
||||
## Version Info
|
||||
|
||||
- OpenFang Version: 2026.3.13
|
||||
- Port: 4200 (was 18789 for OpenClaw)
|
||||
- Config: `~/.openfang/openfang.toml` (was `~/.openclaw/openclaw.json`)
|
||||
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
REM OpenFang Agent OS - Bundled Binary Launcher
|
||||
"%~dp0openfang.exe" %*
|
||||
BIN
desktop/src-tauri/resources/openfang-runtime/openfang.exe
Normal file
BIN
desktop/src-tauri/resources/openfang-runtime/openfang.exe
Normal file
Binary file not shown.
4
desktop/src-tauri/resources/openfang-runtime/openfang.sh
Normal file
4
desktop/src-tauri/resources/openfang-runtime/openfang.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
# OpenFang Agent OS - Bundled Binary Launcher
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
exec "$SCRIPT_DIR/openfang.exe" "$@"
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"source": {
|
||||
"binPath": "openfang.exe",
|
||||
"binPathLinux": "openfang-x86_64-unknown-linux-gnu",
|
||||
"binPathMac": "openfang-x86_64-apple-darwin",
|
||||
"binPathMacArm": "openfang-aarch64-apple-darwin"
|
||||
},
|
||||
"stagedAt": "2026-03-13T09:08:38.514Z",
|
||||
"version": "2026.03.13",
|
||||
"runtimeType": "openfang",
|
||||
"description": "OpenFang Agent OS - Single binary runtime (~32MB)",
|
||||
"endpoints": {
|
||||
"websocket": "ws://127.0.0.1:4200/ws",
|
||||
"rest": "http://127.0.0.1:4200/api"
|
||||
},
|
||||
"platform": {
|
||||
"os": "win32",
|
||||
"arch": "x64"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user