add granola sync toggle

This commit is contained in:
Ramnique Singh 2026-01-08 11:19:43 +05:30
parent 949d36c04d
commit 1ce2b3201f
3 changed files with 102 additions and 1 deletions

View file

@ -16,6 +16,8 @@ import type { FSWatcher } from 'chokidar';
import fs from 'node:fs/promises';
import z from 'zod';
import { RunEvent } from 'packages/shared/dist/runs.js';
import container from '@x/core/dist/di/container.js';
import { IGranolaConfigRepo } from '@x/core/dist/knowledge/granola/repo.js';
type InvokeChannels = ipc.InvokeChannels;
type IPCChannels = ipc.IPCChannels;
@ -300,5 +302,15 @@ export function setupIpcHandlers() {
'oauth:get-connected-providers': async () => {
return await getConnectedProviders();
},
'granola:getConfig': async () => {
const repo = container.resolve<IGranolaConfigRepo>('granolaConfigRepo');
const config = await repo.getConfig();
return { enabled: config.enabled };
},
'granola:setConfig': async (_event, args) => {
const repo = container.resolve<IGranolaConfigRepo>('granolaConfigRepo');
await repo.setConfig({ enabled: args.enabled });
return { success: true };
},
});
}