Open source CapCut alternative.
TypeScript
Fix app rpath for bundled Sparkle
David Le6599e0906746
diff --git a/docs/guides/install-donkey.md b/docs/guides/install-donkey.mdindex 6339eaba..0cb3c5b1 100644--- a/docs/guides/install-donkey.md+++ b/docs/guides/install-donkey.md@@ -8,7 +8,7 @@ From the repo root:./scripts/package-donkey-app.sh```-The script builds the release executable, creates `dist/Donkey.app`, copies bundled resources, applies an ad-hoc signature when `codesign` is available, and creates `dist/Donkey.dmg`.+The script builds the release executable, creates `dist/Donkey.app`, copies bundled resources and embedded frameworks, ensures the executable can load those frameworks from the app bundle, applies an ad-hoc signature when `codesign` is available, and creates `dist/Donkey.dmg`.The app bundle version defaults to `0.1.0` build `1`. Override it for local release testing:@@ -71,11 +71,13 @@ The package script also creates Donkey-compatible sidecar runner packages underdist/Donkey.app/Contents/Resources/LocalRuntimePackages/```-Parakeet and YOLO runner packages include manifest-tracked Python requirements. On setup, the sidecar creates a managed virtual environment under Application Support and installs those dependencies there. Build offline wheelhouse artifacts before packaging when the release must install without network access:+Parakeet and YOLO runner packages include manifest-tracked Python requirements. On setup, the sidecar creates a managed virtual environment under Application Support and installs those dependencies there. Normal packages do not bundle Python wheelhouses; setup downloads dependencies from the Python package index. Build and explicitly bundle offline wheelhouse artifacts only when the release must install without network access:```bash./scripts/build-local-runtime-wheelhouses.sh-DONKEY_RUNTIME_WHEELHOUSE_ROOT="dist/LocalRuntimeWheelhouses" ./scripts/package-donkey-app.sh+DONKEY_BUNDLE_RUNTIME_WHEELHOUSES=1 \+ DONKEY_RUNTIME_WHEELHOUSE_ROOT="dist/LocalRuntimeWheelhouses" \+ ./scripts/package-donkey-app.sh```On first launch, Donkey shows one setup button for local runtimes. Setup installs the bundled sidecar packages first, verifies their manifests/checksums/signatures, registers them in Application Support, asks them to prepare model weights, and health-checks them. The bundled packages do not include Parakeet or YOLO model weights; they contain protocol-speaking runner entrypoints for the local command parser, Parakeet voice transcription, and YOLO screenshot segmentation. UI understanding ships as a local Swift sidecar that uses Apple's on-device Vision text recognition and does not need downloaded model weights. If setup fails, clicking the same button retries failed or not-yet-attempted runtimes while keeping completed installs. The setup window can also be reopened from the app settings.diff --git a/docs/guides/minimal-run-coordinator.md b/docs/guides/minimal-run-coordinator.mdindex ab6d3135..b7e25d4c 100644--- a/docs/guides/minimal-run-coordinator.md+++ b/docs/guides/minimal-run-coordinator.md@@ -48,7 +48,7 @@ Donkey also supports a reusable local JSON sidecar runner for local model procesDonkey's live local-app observation path uses Accessibility and bounded screenshots only. `MacLocalAppTaskController` captures Accessibility controls/visible text first and, when the task definition includes screenshot local-model observation, captures a bounded target-window screenshot only if Accessibility/metadata did not provide the verification text or required controls. That screenshot is sent to `ProcessBackedLocalUIUnderstandingAdapter`. The adapter output is merged into `LocalAppTaskObservation` as visible text, controls, form fields, confidence, and metadata. Screenshot understanding is observation context only and never emits direct input actions.-Donkey also supports the first post-install local runtime setup boundary. The app package does not ship Parakeet or YOLO model weights, but `scripts/package-donkey-app.sh` creates Donkey-compatible sidecar runner packages and embeds them in `Donkey.app/Contents/Resources/LocalRuntimePackages/`. Each Python-backed package contains a small executable wrapper plus `donkey_runtime_runner.py`, and manifests checksum both files. Parakeet and YOLO packages also include a manifest-tracked `requirements.txt`; the runner creates a managed virtual environment under Application Support, installs those dependencies there, and uses a package-local wheelhouse when release artifacts are built with `scripts/build-local-runtime-wheelhouses.sh`. UI understanding ships as a Swift sidecar using Apple's on-device Vision text recognition, so it does not need downloaded model weights. `LocalModelRuntimeSetupManager` describes the required Parakeet, YOLO26, UI-understanding, and local command-parser LLM runtime packages, provides user-facing setup instructions, installs bundled package manifests before remote manifests, validates user-downloaded runtime folders, downloads manifest-backed package files when configured, enforces SHA-256 checksums and required signature metadata, verifies Curve25519 manifest signatures when trusted release keys are configured, caches verified package files under Application Support, asks each installed sidecar to prepare model weights in Application Support, and records executable paths in `~/Library/Application Support/Donkey/LocalModelRuntimes/runtime-installations.json`. The `local-llm` runner uses Ollama `qwen3:8b` when available but reports a non-blocking external-unavailable state during setup when Ollama is absent; submitted commands still have the deterministic local-app parser fallback. The Parakeet runner can prepare a Hugging Face snapshot and calls NVIDIA NeMo for transcription when available; YOLO installs its managed Ultralytics dependency and prepares the selected segmentation model. After registration, sidecar calls can resolve app-managed executables without shell environment variables. The first-run setup window exposes one setup button that installs/downloads, verifies, registers, prepares model weights, and health-checks all required runtimes, with one overall ready or retryable needs-attention state. Retry keeps completed runtime installs and resumes at failed or not-yet-attempted runtimes. Settings can reopen setup, and runtime lifecycle helpers can repair or remove managed installs and export user-data-free support status. Developer launch arguments can print setup instructions, show install status, export support status, repair, remove, or register a downloaded runtime folder.+Donkey also supports the first post-install local runtime setup boundary. The app package does not ship Parakeet or YOLO model weights, but `scripts/package-donkey-app.sh` creates Donkey-compatible sidecar runner packages and embeds them in `Donkey.app/Contents/Resources/LocalRuntimePackages/`. Each Python-backed package contains a small executable wrapper plus `donkey_runtime_runner.py`, and manifests checksum both files. Parakeet and YOLO packages also include a manifest-tracked `requirements.txt`; the runner creates a managed virtual environment under Application Support, installs those dependencies there from the Python package index by default, and uses a package-local wheelhouse only for explicitly requested offline release artifacts. UI understanding ships as a Swift sidecar using Apple's on-device Vision text recognition, so it does not need downloaded model weights. `LocalModelRuntimeSetupManager` describes the required Parakeet, YOLO26, UI-understanding, and local command-parser LLM runtime packages, provides user-facing setup instructions, installs bundled package manifests before remote manifests, validates user-downloaded runtime folders, downloads manifest-backed package files when configured, enforces SHA-256 checksums and required signature metadata, verifies Curve25519 manifest signatures when trusted release keys are configured, caches verified package files under Application Support, asks each installed sidecar to prepare model weights in Application Support, and records executable paths in `~/Library/Application Support/Donkey/LocalModelRuntimes/runtime-installations.json`. The `local-llm` runner uses Ollama `qwen3:8b` when available but reports a non-blocking external-unavailable state during setup when Ollama is absent; submitted commands still have the deterministic local-app parser fallback. The Parakeet runner can prepare a Hugging Face snapshot and calls NVIDIA NeMo for transcription when available; YOLO installs its managed Ultralytics dependency and prepares the selected segmentation model. After registration, sidecar calls can resolve app-managed executables without shell environment variables. The first-run setup window exposes one setup button that installs/downloads, verifies, registers, prepares model weights, and health-checks all required runtimes, with one overall ready or retryable needs-attention state. Retry keeps completed runtime installs and resumes at failed or not-yet-attempted runtimes. Settings can reopen setup, and runtime lifecycle helpers can repair or remove managed installs and export user-data-free support status. Developer launch arguments can print setup instructions, show install status, export support status, repair, remove, or register a downloaded runtime folder.Donkey also supports the first provider-neutral planner-hint adapter boundary using OpenAI's Responses API. `OpenAIPlannerHintAdapter` reads `OPENAI_API_KEY` from the environment, routes through the model registry, sends a structured-output Responses request with `store: false`, decodes a strict JSON response containing a planner hint plus optional memory write proposals, and records a model-call trace with role, provider, model id, prompt version, schema id, latency, timeout, validation status, and source trace/state ids. Missing credentials, cancellation, timeout, rate limit, invalid output, and provider outage return traceable failures without stopping the reflex loop. Official OpenAI docs were rechecked on May 16, 2026 for the Responses API, `text.format` JSON schema structured outputs, `store: false`, and current model registry default guidance.diff --git a/scripts/package-donkey-app.sh b/scripts/package-donkey-app.shindex 349c116e..547a80ce 100755--- a/scripts/package-donkey-app.sh+++ b/scripts/package-donkey-app.sh@@ -23,12 +23,19 @@ UI_UNDERSTANDER_EXECUTABLE="$BUILD_DIR/.build/release/DonkeyUIUnderstandingSidecCACHE_DIR="$BUILD_DIR/.build/package-cache"RUNTIME_RUNNER_SOURCE="$ROOT_DIR/scripts/local-runtime-runners/donkey_runtime_runner.py"RUNTIME_WHEELHOUSE_ROOT="${DONKEY_RUNTIME_WHEELHOUSE_ROOT:-$ROOT_DIR/dist/LocalRuntimeWheelhouses}"+BUNDLE_RUNTIME_WHEELHOUSES="${DONKEY_BUNDLE_RUNTIME_WHEELHOUSES:-0}"mkdir -p "$CACHE_DIR/clang" "$CACHE_DIR/swiftpm" "$CACHE_DIR/home"export CLANG_MODULE_CACHE_PATH="$CACHE_DIR/clang"export SWIFTPM_CACHE_PATH="$CACHE_DIR/swiftpm"export HOME="$CACHE_DIR/home"+if [ "$BUNDLE_RUNTIME_WHEELHOUSES" = "1" ]; then+ echo "Runtime wheelhouses will be bundled from $RUNTIME_WHEELHOUSE_ROOT"+else+ echo "Runtime wheelhouses will not be bundled; setup will install Python dependencies from the network."+fi+cd "$BUILD_DIR"echo "Compiling Donkey for Mac ..."swift build -c release --product Donkey@@ -37,6 +44,13 @@ swift build -c release --product DonkeyUIUnderstandingSidecarrm -rf "$APP_DIR"mkdir -p "$MACOS_DIR" "$RESOURCES_DIR" "$FRAMEWORKS_DIR"cp "$EXECUTABLE" "$MACOS_DIR/Donkey"+if ! otool -l "$MACOS_DIR/Donkey" | grep -q "@executable_path/../Frameworks"; then+ if ! command -v install_name_tool >/dev/null 2>&1; then+ echo "install_name_tool is required to package Donkey.app with embedded frameworks." >&2+ exit 1+ fi+ install_name_tool -add_rpath "@executable_path/../Frameworks" "$MACOS_DIR/Donkey"+fimake_runtime_package() {local runtime_id="$1"@@ -82,7 +96,7 @@ EOF_RUNTIMEif [ -n "$requirements" ]; thenprintf '%s\n' "$requirements" > "$requirements_path"fi- if [ -d "$wheelhouse_source" ]; then+ if [ "$BUNDLE_RUNTIME_WHEELHOUSES" = "1" ] && [ -d "$wheelhouse_source" ]; thenmkdir -p "$package_dir/wheelhouse"cp -R "$wheelhouse_source/." "$package_dir/wheelhouse/"fi