feat(tauri): integrate vendored CEF-aware tauri-cli and update development scripts

- Added a new script `ensure-tauri-cli.sh` to ensure the vendored CEF-aware `tauri-cli` is installed, preventing runtime errors related to missing Chromium Embedded Framework files.
- Updated `package.json` scripts to call `yarn tauri:ensure` before other commands, ensuring the correct CLI is used for building and running the application.
- Enhanced documentation in `CLAUDE.md` and `install.md` to clarify the requirement for the vendored `tauri-cli` and the installation process.
- Improved the `dev:app` and `dev:wry` scripts to streamline the development workflow with the new CLI setup.

These changes enhance the development experience by ensuring the correct tooling is in place for building and running the application with CEF support.
This commit is contained in:
Steven Enamakel
2026-04-17 21:36:22 -07:00
parent 480ba9f746
commit ff684f22e8
5 changed files with 60 additions and 9 deletions
+1
View File
@@ -483,6 +483,7 @@ Follow this order so behavior is **specified**, **proven in Rust**, **proven ove
## Platform notes
- **Vendored CEF-aware `tauri-cli` (required)**: The default runtime is **CEF**, and only the **vendored** `tauri-cli` at `app/src-tauri/vendor/tauri-cef/crates/tauri-cli` knows how to bundle the Chromium Embedded Framework into the app's `Contents/Frameworks/`. The stock `@tauri-apps/cli` / upstream `cargo-tauri` produces a bundle **without** `Frameworks/` and the app panics at startup inside `cef::library_loader::LibraryLoader::new` with `No such file or directory`. `yarn dev:app` (and every other `cargo tauri` script in `app/package.json`) now calls **`yarn tauri:ensure`** which runs [`scripts/ensure-tauri-cli.sh`](scripts/ensure-tauri-cli.sh) to install the vendored CLI into `~/.cargo/bin/cargo-tauri` on first use. If you ever install a different `tauri-cli` over it (e.g. `npm i -g @tauri-apps/cli`) you'll need to re-run the ensure script / `cargo install --locked --path app/src-tauri/vendor/tauri-cef/crates/tauri-cli`.
- **macOS deep links**: Often require a built **`.app`** bundle; not only `tauri dev`. See [`docs/telegram-login-desktop.md`](docs/telegram-login-desktop.md) if applicable.
- **`window.__TAURI__`**: Not assumed at module load; guard Tauri usage accordingly.
- **Core sidecar**: Must be staged/built so `core_rpc` can reach the `openhuman` binary (see `scripts/stage-core-sidecar.mjs`).
+1 -1
View File
@@ -53,7 +53,7 @@ OpenHuman is an open-source agentic assistant that is designed to integrate with
- **Deep desktop integrations** — OpenHuman is a **native desktop** assistant, not a web-only chat: **memory-aware keyboard autocomplete**, **voice** (**STT** listening and **TTS** replies), **screen intelligence** that understands what is on screen and feeds your local context, plus windowing and OS-level permissions—so the agent meets you **on the machine**, not trapped in a browser tab.
Architecture: [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md). Contributor orientation: [`CONTRIBUTING.md`](./CONTRIBUTING.md).
Architecture: [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md). Contributor orientation: [`CONTRIBUTING.md`](./CONTRIBUTING.md). Running from source: [`docs/install.md`](docs/install.md#running-from-source).
## OpenHuman vs other agents
+9 -8
View File
@@ -5,21 +5,22 @@
"scripts": {
"dev": "vite",
"dev:web": "vite",
"dev:app": "yarn core:stage && bash ../scripts/setup-chromium-safe-storage.sh && source ../scripts/load-dotenv.sh && APPLE_SIGNING_IDENTITY='OpenHuman Dev Signer' cargo tauri dev",
"dev:app": "yarn tauri:ensure && yarn core:stage && bash ../scripts/setup-chromium-safe-storage.sh && source ../scripts/load-dotenv.sh && APPLE_SIGNING_IDENTITY='OpenHuman Dev Signer' cargo tauri dev",
"dev:cef": "yarn dev:app",
"dev:wry": "yarn core:stage && source ../scripts/load-dotenv.sh && cargo tauri dev --no-default-features --features wry",
"dev:wry": "yarn tauri:ensure && yarn core:stage && source ../scripts/load-dotenv.sh && cargo tauri dev --no-default-features --features wry",
"core:stage": "node ../scripts/stage-core-sidecar.mjs",
"tauri:ensure": "bash ../scripts/ensure-tauri-cli.sh",
"build": "tsc && vite build",
"build:app": "tsc && vite build",
"compile": "tsc --noEmit",
"preview": "vite preview",
"tauri": "tauri",
"tauri:build:ui": "cargo tauri build -- --bin OpenHuman",
"macos:build:intel": "source ../scripts/load-dotenv.sh && cargo tauri build --bundles app dmg --target x86_64-apple-darwin -- --bin OpenHuman",
"macos:build:intel:debug": "source ../scripts/load-dotenv.sh && cargo tauri build --debug --bundles app dmg --target x86_64-apple-darwin -- --bin OpenHuman",
"macos:build:debug": "source ../scripts/load-dotenv.sh && cargo tauri build --debug --bundles app dmg -- --bin OpenHuman",
"macos:build:release": "source ../scripts/load-dotenv.sh && cargo tauri build --bundles app dmg -- --bin OpenHuman",
"macos:build:release:signed": "source ../scripts/load-env.sh && cargo tauri build --bundles app dmg -- --bin OpenHuman",
"tauri:build:ui": "yarn tauri:ensure && cargo tauri build -- --bin OpenHuman",
"macos:build:intel": "yarn tauri:ensure && source ../scripts/load-dotenv.sh && cargo tauri build --bundles app dmg --target x86_64-apple-darwin -- --bin OpenHuman",
"macos:build:intel:debug": "yarn tauri:ensure && source ../scripts/load-dotenv.sh && cargo tauri build --debug --bundles app dmg --target x86_64-apple-darwin -- --bin OpenHuman",
"macos:build:debug": "yarn tauri:ensure && source ../scripts/load-dotenv.sh && cargo tauri build --debug --bundles app dmg -- --bin OpenHuman",
"macos:build:release": "yarn tauri:ensure && source ../scripts/load-dotenv.sh && cargo tauri build --bundles app dmg -- --bin OpenHuman",
"macos:build:release:signed": "yarn tauri:ensure && source ../scripts/load-env.sh && cargo tauri build --bundles app dmg -- --bin OpenHuman",
"macos:build:sign:release": "yarn macos:build:release:signed",
"macos:run": "open '../target/debug/bundle/macos/OpenHuman.app'",
"macos:dev": "yarn macos:build:debug && open '../target/debug/bundle/macos/OpenHuman.app'",
+12
View File
@@ -181,6 +181,18 @@ echo "$(cat openhuman-core-${VERSION}-${TARGET}.tar.gz.sha256) openhuman-core-$
---
## Running from source
The default runtime is **CEF** (bundled Chromium), which requires the **vendored CEF-aware `tauri-cli`** at `app/src-tauri/vendor/tauri-cef/crates/tauri-cli`. The stock `@tauri-apps/cli` does **not** know how to bundle the Chromium Embedded Framework into `OpenHuman.app/Contents/Frameworks/`, so a bundle produced by it panics at startup inside `cef::library_loader::LibraryLoader::new` with `No such file or directory`.
All `cargo tauri` scripts in `app/package.json` (`yarn dev:app`, `yarn macos:build:*`, etc.) run [`scripts/ensure-tauri-cli.sh`](../scripts/ensure-tauri-cli.sh) first, which installs the vendored CLI into `~/.cargo/bin/cargo-tauri` on first use. If you ever overwrite it (e.g. `npm i -g @tauri-apps/cli` or `cargo install tauri-cli`), re-run:
```bash
cargo install --locked --path app/src-tauri/vendor/tauri-cef/crates/tauri-cli
```
---
## Release artifacts reference
Each release attaches the following files:
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Ensure the vendored CEF-aware tauri-cli is installed as `cargo-tauri`.
#
# The stock `@tauri-apps/cli` / upstream `tauri-cli` does NOT know how to bundle
# the CEF (Chromium Embedded Framework) runtime into the `.app` bundle's
# `Contents/Frameworks/` — so running `cargo tauri dev` with it produces an
# `OpenHuman.app` that panics at startup inside
# `cef::library_loader::LibraryLoader::new(...)` with:
# "No such file or directory" (Os { code: 2 })
#
# The vendored fork at `app/src-tauri/vendor/tauri-cef/crates/tauri-cli` has the
# CEF bundler logic. Install it once and cargo will use it for every
# `cargo tauri ...` invocation.
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
VENDOR_CLI="$ROOT_DIR/app/src-tauri/vendor/tauri-cef/crates/tauri-cli"
VENDOR_CARGO_TOML="$VENDOR_CLI/Cargo.toml"
if [[ ! -f "$VENDOR_CARGO_TOML" ]]; then
echo "[ensure-tauri-cli] vendored tauri-cli not found at $VENDOR_CLI" >&2
echo "[ensure-tauri-cli] did you forget to init the submodule? try:" >&2
echo " git submodule update --init --recursive" >&2
exit 1
fi
# Detect whether the currently installed cargo-tauri came from our vendored path.
CRATES_TOML="${CARGO_HOME:-$HOME/.cargo}/.crates.toml"
if [[ -f "$CRATES_TOML" ]] && grep -q "tauri-cli.*$VENDOR_CLI" "$CRATES_TOML" 2>/dev/null; then
# Already installed from this exact path. Cargo won't rebuild unless sources change.
exit 0
fi
echo "[ensure-tauri-cli] installing vendored CEF-aware tauri-cli from $VENDOR_CLI"
echo "[ensure-tauri-cli] (first install only — takes a few minutes; subsequent runs are instant)"
cargo install --locked --path "$VENDOR_CLI"