Skip to content

Commit 5b5382b

Browse files
committed
feat: audio recorder with ai sdk
1 parent 33516b8 commit 5b5382b

File tree

21 files changed

+2242
-22
lines changed

21 files changed

+2242
-22
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"yaml": "^2.8.1"
6363
},
6464
"dependencies": {
65+
"@ai-sdk/openai": "^2.0.52",
6566
"@phosphor-icons/react": "^2.1.10",
6667
"@posthog/agent": "^1.9.0",
6768
"@radix-ui/react-icons": "^1.3.2",
@@ -76,6 +77,7 @@
7677
"@tiptap/react": "^3.6.6",
7778
"@tiptap/starter-kit": "^3.6.6",
7879
"@tiptap/suggestion": "^3.6.6",
80+
"ai": "^5.0.75",
7981
"axios": "^1.6.7",
8082
"clsx": "^2.1.0",
8183
"cmdk": "^1.1.1",
@@ -88,6 +90,7 @@
8890
"react-markdown": "^10.1.0",
8991
"socket.io-client": "^4.7.4",
9092
"uuid": "^9.0.1",
93+
"zod": "^4.1.12",
9194
"zustand": "^4.5.0"
9295
},
9396
"lint-staged": {

pnpm-lock.yaml

Lines changed: 111 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/index.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { registerAgentIpc, type TaskController } from "./services/agent.js";
1313
import { registerFsIpc } from "./services/fs.js";
1414
import { registerOsIpc } from "./services/os.js";
1515
import { registerPosthogIpc } from "./services/posthog.js";
16+
import { registerRecordingIpc } from "./services/recording.js";
1617

1718
const __filename = fileURLToPath(import.meta.url);
1819
const __dirname = path.dirname(__filename);
@@ -76,6 +77,27 @@ function createWindow(): void {
7677

7778
setupExternalLinkHandlers(mainWindow);
7879

80+
// Enable screen/audio capture for recordings
81+
mainWindow.webContents.session.setPermissionRequestHandler(
82+
(_webContents, permission, callback) => {
83+
if (permission === "media" || permission === "mediaKeySystem") {
84+
callback(true);
85+
} else {
86+
callback(false);
87+
}
88+
},
89+
);
90+
91+
// Handle display media requests (screen/window sharing)
92+
mainWindow.webContents.session.setPermissionCheckHandler(
93+
(_webContents, permission) => {
94+
if (permission === "media") {
95+
return true;
96+
}
97+
return false;
98+
},
99+
);
100+
79101
// Set up menu for keyboard shortcuts
80102
const template: MenuItemConstructorOptions[] = [
81103
{
@@ -144,3 +166,4 @@ registerPosthogIpc();
144166
registerOsIpc(() => mainWindow);
145167
registerAgentIpc(taskControllers, () => mainWindow);
146168
registerFsIpc();
169+
registerRecordingIpc();

0 commit comments

Comments
 (0)