From df8d5f79ce51c13c8e2d48492feb27bae9934aa2 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Sun, 22 Mar 2026 18:21:55 -0700 Subject: [PATCH] fix(rmeets): align MI route handlers with actual API response shapes - Search: use POST /search with JSON body (was GET with query params) - Summary: add summary_text field lookup (API's actual field name) - Speakers: add speaking_time + speaker_label fallbacks - Transcript: add speaker_label fallback for segment speaker name - Action items: add task field lookup (API returns {task, assignee}) - Recordings: detect transcript availability from segment_count - Add CSS for processing status badges (transcribing, diarizing, etc) Co-Authored-By: Claude Opus 4.6 --- modules/rmeets/mod.ts | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/modules/rmeets/mod.ts b/modules/rmeets/mod.ts index 4ec74bb..0eed1af 100644 --- a/modules/rmeets/mod.ts +++ b/modules/rmeets/mod.ts @@ -18,11 +18,17 @@ const routes = new Hono(); // ── Meeting Intelligence API helper ── -async function miApiFetch(path: string): Promise<{ ok: boolean; data?: any; error?: string }> { +async function miApiFetch(path: string, options?: { method?: string; body?: any }): Promise<{ ok: boolean; data?: any; error?: string }> { try { const controller = new AbortController(); const timeout = setTimeout(() => controller.abort(), 8000); - const res = await fetch(`${MI_API_URL}${path}`, { signal: controller.signal }); + const fetchOpts: RequestInit = { signal: controller.signal }; + if (options?.method) fetchOpts.method = options.method; + if (options?.body) { + fetchOpts.headers = { "Content-Type": "application/json" }; + fetchOpts.body = JSON.stringify(options.body); + } + const res = await fetch(`${MI_API_URL}${path}`, fetchOpts); clearTimeout(timeout); if (!res.ok) return { ok: false, error: `API returned ${res.status}` }; return { ok: true, data: await res.json() }; @@ -58,6 +64,7 @@ const MI_STYLES = `