Skip to content

Commit 6dcd58c

Browse files
committed
feat: add smart-whisper package with updated build configuration
1 parent a24e068 commit 6dcd58c

37 files changed

+7893
-3040
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
steps:
3434
- name: Checkout code
3535
uses: actions/checkout@v4
36+
with:
37+
submodules: recursive
3638

3739
- name: Verify architecture
3840
if: matrix.os == 'macos'

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "packages/smart-whisper/whisper.cpp"]
2+
path = packages/smart-whisper/whisper.cpp
3+
url = https://github.com/ggerganov/whisper.cpp.git

apps/desktop/assets/logo.ico

-11.5 KB
Binary file not shown.

apps/desktop/forge.config.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ let nativeModuleDependenciesToPackage: string[] = [];
2929

3030
export const EXTERNAL_DEPENDENCIES = [
3131
"electron-squirrel-startup",
32-
"smart-whisper",
3332
"@libsql/client",
3433
"@libsql/darwin-arm64",
3534
"@libsql/darwin-x64",
@@ -268,15 +267,14 @@ const config: ForgeConfig = {
268267
packagerConfig: {
269268
asar: {
270269
unpack:
271-
"{*.node,*.dylib,*.so,*.dll,*.metal,**/whisper.cpp/**,**/.vite/build/whisper-worker-fork.js,**/node_modules/smart-whisper/**,**/node_modules/jest-worker/**,**/onnxruntime-node/bin/**}",
270+
"{*.node,*.dylib,*.so,*.dll,*.metal,**/whisper.cpp/**,**/.vite/build/whisper-worker-fork.js,**/node_modules/jest-worker/**,**/onnxruntime-node/bin/**}",
272271
},
273272
name: "Amical",
274273
executableName: "Amical",
275274
icon: "./assets/logo", // Path to your icon file
276275
appBundleId: "com.amical.desktop", // Proper bundle ID
277276
extraResource: [
278-
"../../packages/native-helpers/swift-helper/bin/SwiftHelper",
279-
"../../packages/native-helpers/windows-helper/bin/WindowsHelper.exe",
277+
`${process.platform === "win32" ? "../../packages/native-helpers/windows-helper/bin" : "../../packages/native-helpers/swift-helper/bin"}`,
280278
"./src/db/migrations",
281279
// Only include the platform-specific node binary
282280
`./node-binaries/${process.platform}-${process.arch}/node${

apps/desktop/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@amical/desktop",
3-
"version": "0.0.9-windows.build.test",
3+
"version": "0.0.9-windows-ci-test",
44
"description": "Amical Desktop app",
55
"main": ".vite/build/main.js",
66
"productName": "Amical",
@@ -43,16 +43,16 @@
4343
"keywords": [],
4444
"license": "MIT",
4545
"devDependencies": {
46-
"@electron-forge/cli": "^7.8.1",
47-
"@electron-forge/maker-deb": "^7.8.1",
48-
"@electron-forge/maker-dmg": "^7.8.1",
49-
"@electron-forge/maker-rpm": "^7.8.1",
50-
"@electron-forge/maker-squirrel": "^7.8.1",
51-
"@electron-forge/maker-zip": "^7.8.1",
52-
"@electron-forge/plugin-auto-unpack-natives": "^7.8.1",
53-
"@electron-forge/plugin-fuses": "^7.8.1",
54-
"@electron-forge/plugin-vite": "^7.8.1",
55-
"@electron-forge/publisher-github": "^7.8.1",
46+
"@electron-forge/cli": "7.8.2",
47+
"@electron-forge/maker-deb": "7.8.2",
48+
"@electron-forge/maker-dmg": "7.8.2",
49+
"@electron-forge/maker-rpm": "7.8.2",
50+
"@electron-forge/maker-squirrel": "7.8.2",
51+
"@electron-forge/maker-zip": "7.8.2",
52+
"@electron-forge/plugin-auto-unpack-natives": "7.8.2",
53+
"@electron-forge/plugin-fuses": "7.8.2",
54+
"@electron-forge/plugin-vite": "7.8.2",
55+
"@electron-forge/publisher-github": "7.8.2",
5656
"@electron/fuses": "^1.8.0",
5757
"@rollup/plugin-commonjs": "^28.0.6",
5858
"@tailwindcss/vite": "^4.1.6",
@@ -147,7 +147,7 @@
147147
"react-hook-form": "^7.56.3",
148148
"react-resizable-panels": "^3.0.2",
149149
"recharts": "^2.15.3",
150-
"smart-whisper": "0.8.1",
150+
"@amical/smart-whisper": "workspace:*",
151151
"sonner": "^2.0.3",
152152
"split2": "^4.2.0",
153153
"superjson": "^2.2.2",

apps/desktop/src/main/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import { app } from "electron";
55
import * as path from "path";
66

77
// Set GGML_METAL_PATH_RESOURCES before any other imports
8-
// This ensures smart-whisper can find its resources when unpacked from asar
8+
// This ensures @amical/smart-whisper can find its resources when unpacked from asar
99
if (app.isPackaged) {
1010
// Point to the unpacked whisper.cpp directory
1111
process.env.GGML_METAL_PATH_RESOURCES = path.join(
1212
process.resourcesPath,
1313
"app.asar.unpacked",
1414
"node_modules",
15+
"@amical",
1516
"smart-whisper",
1617
"whisper.cpp",
1718
);

apps/desktop/src/pipeline/providers/transcription/whisper-worker-fork.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Worker process entry point for fork
2-
import { Whisper } from "smart-whisper";
2+
import { Whisper } from "@amical/smart-whisper";
33

44
// Simple console-based logging for worker process
55
const logger = {
@@ -29,7 +29,7 @@ const methods = {
2929
whisperInstance = null;
3030
}
3131

32-
const { Whisper } = await import("smart-whisper");
32+
const { Whisper } = await import("@amical/smart-whisper");
3333
whisperInstance = new Whisper(modelPath, { gpu: true });
3434
try {
3535
await whisperInstance.load();

apps/desktop/src/pipeline/providers/transcription/whisper-worker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file contains just the Whisper-specific operations that need to run in a separate process
2-
import { Whisper } from "smart-whisper";
2+
import { Whisper } from "@amical/smart-whisper";
33

44
// Simple console-based logging for worker process
55
const logger = {
@@ -27,7 +27,7 @@ export async function initializeModel(modelPath: string): Promise<void> {
2727
whisperInstance = null;
2828
}
2929

30-
const { Whisper } = await import("smart-whisper");
30+
const { Whisper } = await import("@amical/smart-whisper");
3131
whisperInstance = new Whisper(modelPath, { gpu: true });
3232
try {
3333
await whisperInstance.load();

apps/desktop/src/services/platform/native-bridge-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class NativeBridge extends EventEmitter {
8181
const helperDir = getNativeHelperDir();
8282

8383
return electronApp.isPackaged
84-
? path.join(process.resourcesPath, helperName)
84+
? path.join(process.resourcesPath, "bin", helperName)
8585
: path.join(
8686
electronApp.getAppPath(),
8787
"..",

apps/desktop/vite.main.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default defineConfig({
2020
entryFileNames: "[name].js",
2121
},
2222
external: [
23-
"smart-whisper",
23+
"@amical/smart-whisper",
2424
"@libsql/client",
2525
"@libsql/darwin-arm64",
2626
"@libsql/darwin-x64",

0 commit comments

Comments
 (0)