Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build/entitlements.mac.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
</dict>
</plist>
20 changes: 18 additions & 2 deletions electron/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, BrowserWindow, shell } from 'electron';
import { app, BrowserWindow, session, shell } from 'electron';
import path from 'path';
import fs from 'fs';
import { fileURLToPath } from 'url';
Expand Down Expand Up @@ -138,7 +138,23 @@ function createWindow() {
});
}

app.whenReady().then(createWindow);
app.whenReady().then(() => {
// Grant microphone and clipboard access (deny camera/video)
session.defaultSession.setPermissionRequestHandler(
(_webContents, permission, callback, details) => {
if (permission === 'clipboard-read') {
return callback(true);
}
if (permission === 'media') {
const types = (details as { mediaTypes?: string[] }).mediaTypes ?? [];
return callback(types.every((t) => t === 'audio'));
}
callback(false);
},
);

createWindow();
});

app.on('before-quit', () => {
killAllAgents();
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@
"target": "dmg",
"category": "public.app-category.developer-tools",
"hardenedRuntime": true,
"extendInfo": {
"NSMicrophoneUsageDescription": "Parallel Code needs microphone access for voice input in terminal sessions."
},
"gatekeeperAssess": false,
"notarize": true,
"x64ArchFiles": "Contents/Resources/app.asar.unpacked/node_modules/node-pty/prebuilds/**",
Expand Down
Loading