feat(ollama): IPC inbox:ollamaRecheck + pushOllamaStatus helper (#1 v0.2.3)
This commit is contained in:
@@ -7,6 +7,7 @@ import type { CaptureService } from '../services/CaptureService.js';
|
||||
import type { HealthChecker } from '../services/HealthChecker.js';
|
||||
import type { IntentService } from '../services/IntentService.js';
|
||||
import type { Note } from '@shared/types';
|
||||
import type { HealthResult } from '../ai/InferenceProvider.js';
|
||||
|
||||
export interface InboxIpcDeps {
|
||||
repo: NoteRepository;
|
||||
@@ -127,6 +128,11 @@ export function registerInboxApi(deps: InboxIpcDeps): void {
|
||||
return { trashedCount: result.trashedCount, confirmed: true };
|
||||
}
|
||||
);
|
||||
|
||||
ipcMain.handle('inbox:ollamaRecheck', async () => {
|
||||
await deps.health.runOnce({ manual: true });
|
||||
return deps.health.lastStatus();
|
||||
});
|
||||
}
|
||||
|
||||
export function pushNoteUpdated(getWin: () => BrowserWindow | null, note: Note): void {
|
||||
@@ -134,3 +140,9 @@ export function pushNoteUpdated(getWin: () => BrowserWindow | null, note: Note):
|
||||
if (!w || w.isDestroyed()) return;
|
||||
w.webContents.send('note:updated', note);
|
||||
}
|
||||
|
||||
export function pushOllamaStatus(getWin: () => BrowserWindow | null, status: HealthResult): void {
|
||||
const w = getWin();
|
||||
if (!w || w.isDestroyed()) return;
|
||||
w.webContents.send('ollama:status', status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user