Add macOS app bundle packaging, native launcher, and MACOS_APP_PACKAGING guide

This commit is contained in:
Adolfo Reyna
2026-08-08 17:37:52 -04:00
parent 757261ebfd
commit 6e8a578e86
8 changed files with 431 additions and 3 deletions
+20 -1
View File
@@ -33,6 +33,7 @@ import asyncio
import json
import os
import subprocess
import sys
import tempfile
from collections.abc import AsyncGenerator
from pathlib import Path
@@ -45,7 +46,25 @@ from pipecat.services.stt_service import SegmentedSTTService
from pipecat.transcriptions.language import Language
from pipecat.utils.time import time_now_iso8601
HELPER = Path(__file__).parent / "swift" / "speech-helper"
def get_helper_path(binary_name: str) -> Path:
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
p1 = Path(sys._MEIPASS) / binary_name
if p1.exists():
return p1
p2 = Path(sys._MEIPASS) / "swift" / binary_name
if p2.exists():
return p2
if getattr(sys, "frozen", False):
res_dir = Path(sys.executable).parent.parent / "Resources"
p1 = res_dir / binary_name
if p1.exists():
return p1
p2 = res_dir / "swift" / binary_name
if p2.exists():
return p2
return Path(__file__).parent / "swift" / binary_name
HELPER = get_helper_path("speech-helper")
# Generous: the helper may be downloading the on-device model on first use.
_FIRST_RUN_TIMEOUT = 300.0