From 410a6f494bf5db51d83d66c293ade2825ec0e91a Mon Sep 17 00:00:00 2001 From: altair823 Date: Sat, 2 May 2026 01:37:47 +0900 Subject: [PATCH] feat(ollama): IPC inbox:ollamaRecheck + pushOllamaStatus helper (#1 v0.2.3) --- src/main/ipc/inboxApi.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/ipc/inboxApi.ts b/src/main/ipc/inboxApi.ts index 475d38e..c5ea63a 100644 --- a/src/main/ipc/inboxApi.ts +++ b/src/main/ipc/inboxApi.ts @@ -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); +}