From 7d9953d34fa1d84b160efd015eed2907cd8289f9 Mon Sep 17 00:00:00 2001 From: hermias1 Date: Thu, 30 Jul 2026 17:30:25 +0300 Subject: [PATCH] fix(desktop): allow microphone from macOS setup launcher --- apps/bootstrap-installer/src-tauri/Info.plist | 10 +++++ .../src-tauri/entitlements.plist | 14 +++++++ .../src-tauri/tauri.conf.json | 3 +- tests-js/desktop-mac-entitlements.test.ts | 42 +++++++++++++++++++ 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 apps/bootstrap-installer/src-tauri/Info.plist create mode 100644 apps/bootstrap-installer/src-tauri/entitlements.plist diff --git a/apps/bootstrap-installer/src-tauri/Info.plist b/apps/bootstrap-installer/src-tauri/Info.plist new file mode 100644 index 0000000000..1df80c7b99 --- /dev/null +++ b/apps/bootstrap-installer/src-tauri/Info.plist @@ -0,0 +1,10 @@ + + + + + NSAudioCaptureUsageDescription + Hermes launches the desktop app, which uses audio capture for voice conversations. + NSMicrophoneUsageDescription + Hermes launches the desktop app, which uses the microphone for voice input and voice conversations. + + diff --git a/apps/bootstrap-installer/src-tauri/entitlements.plist b/apps/bootstrap-installer/src-tauri/entitlements.plist new file mode 100644 index 0000000000..53fdf0fc43 --- /dev/null +++ b/apps/bootstrap-installer/src-tauri/entitlements.plist @@ -0,0 +1,14 @@ + + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.disable-library-validation + + com.apple.security.device.audio-input + + + diff --git a/apps/bootstrap-installer/src-tauri/tauri.conf.json b/apps/bootstrap-installer/src-tauri/tauri.conf.json index 35ad53bc0c..a74bd105c3 100644 --- a/apps/bootstrap-installer/src-tauri/tauri.conf.json +++ b/apps/bootstrap-installer/src-tauri/tauri.conf.json @@ -57,7 +57,8 @@ }, "macOS": { "minimumSystemVersion": "11.0", - "hardenedRuntime": true + "hardenedRuntime": true, + "entitlements": "entitlements.plist" } }, "plugins": { diff --git a/tests-js/desktop-mac-entitlements.test.ts b/tests-js/desktop-mac-entitlements.test.ts index 9153e54162..fc8bf00d21 100644 --- a/tests-js/desktop-mac-entitlements.test.ts +++ b/tests-js/desktop-mac-entitlements.test.ts @@ -35,6 +35,10 @@ const REPO_ROOT = path.resolve(__dirname, '..') const ELECTRON_DIR = path.join(REPO_ROOT, 'apps', 'desktop', 'electron') const MAIN_PLIST = path.join(ELECTRON_DIR, 'entitlements.mac.plist') const INHERIT_PLIST = path.join(ELECTRON_DIR, 'entitlements.mac.inherit.plist') +const BOOTSTRAP_TAURI_DIR = path.join(REPO_ROOT, 'apps', 'bootstrap-installer', 'src-tauri') +const BOOTSTRAP_TAURI_CONFIG = path.join(BOOTSTRAP_TAURI_DIR, 'tauri.conf.json') +const BOOTSTRAP_ENTITLEMENTS = path.join(BOOTSTRAP_TAURI_DIR, 'entitlements.plist') +const BOOTSTRAP_INFO_PLIST = path.join(BOOTSTRAP_TAURI_DIR, 'Info.plist') const DEVICE_PREFIX = 'com.apple.security.device.' @@ -89,3 +93,41 @@ for (const plist of [MAIN_PLIST, INHERIT_PLIST]) { ) }) } + +test('bootstrap installer carries microphone entitlement for launcher attribution', () => { + const config = JSON.parse(fs.readFileSync(BOOTSTRAP_TAURI_CONFIG, 'utf-8')) + assert.equal( + config.bundle?.macOS?.entitlements, + 'entitlements.plist', + 'the macOS bootstrap installer must sign with its entitlements.plist. ' + + 'When /Applications/Hermes.app is the setup launcher, macOS TCC treats ' + + 'com.nousresearch.hermes.setup as the responsible process for the desktop ' + + 'app it opens; without audio-input on the setup app, microphone access is ' + + 'denied before a permission prompt can appear.' + ) + + const entitlements = loadEntitlements(BOOTSTRAP_ENTITLEMENTS) + assert.equal( + entitlements['com.apple.security.device.audio-input'], + true, + 'bootstrap installer entitlements must grant audio-input because it is the ' + + 'TCC responsible process for the desktop app launched from the setup fast path' + ) +}) + +test('bootstrap installer Info.plist explains microphone usage', () => { + const info = plist.parse(fs.readFileSync(BOOTSTRAP_INFO_PLIST, 'utf-8')) as Record< + string, + unknown + > + assert.equal( + typeof info.NSMicrophoneUsageDescription, + 'string', + 'macOS requires NSMicrophoneUsageDescription before it can prompt for microphone access' + ) + assert.match( + info.NSMicrophoneUsageDescription as string, + /microphone/i, + 'microphone usage description should be user-visible and specific' + ) +})