Skip to content
Open
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
5 changes: 5 additions & 0 deletions bridge/src/voice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ function findBinary(candidates: string[], fallback: string): string {

/** Check if a whisper-cli binary has Metal GPU support (native arm64 + libggml-metal). */
function detectMetal(whisperPath: string): boolean {
// Skip if whisper-cli doesn't exist (just a fallback name, not installed)
if (!existsSync(whisperPath)) {
debug('Voice', `whisper-cli not found, skipping Metal detection`);
return false;
}
try {
const otoolOut = execSync(`otool -L "${whisperPath}"`, { encoding: 'utf8' });
const hasMetal = otoolOut.includes('libggml-metal');
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"generate-icons": "node scripts/generate-icons.mjs",
"package": "bash scripts/package-plugin.sh",
"setup": "bash scripts/install.sh",
"test": "vitest run"
"test": "vitest run",
"postinstall": "bash scripts/postinstall.sh"
},
"engines": {
"node": ">=20.0.0"
Expand Down
9 changes: 9 additions & 0 deletions scripts/postinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# Fix node-pty spawn-helper permissions (pnpm doesn't preserve execute bits from prebuilds)

find node_modules -path "*node-pty*/prebuilds/darwin-*/spawn-helper" 2>/dev/null | while read -r SPAWN_HELPER; do
if [ -n "$SPAWN_HELPER" ] && [ ! -x "$SPAWN_HELPER" ]; then
chmod +x "$SPAWN_HELPER"
echo "[postinstall] Fixed spawn-helper permissions: $SPAWN_HELPER"
fi
done