Turn meetings into live agent loops. Record, transcribe, and analyze meetings with real-time AI intelligence — before, during, and after calls.
feat: UI updates, and context improvements
Om Gate9214a60ca3ec
diff --git a/resources/permissions.mp4 b/resources/permissions.mp4new file mode 100644index 0000000..130186bBinary files /dev/null and b/resources/permissions.mp4 differdiff --git a/src/main/db/index.ts b/src/main/db/index.tsindex a4f3c10..29775c2 100644--- a/src/main/db/index.ts+++ b/src/main/db/index.ts@@ -211,6 +211,19 @@ export function initDatabase(): ReturnType<typeof drizzle<typeof schema>> {updated_at TEXT NOT NULL DEFAULT (datetime('now')));+ -- Visual Index Tables+ CREATE TABLE IF NOT EXISTS visual_index_items (+ id TEXT PRIMARY KEY,+ recording_id INTEGER NOT NULL,+ session_id TEXT NOT NULL,+ text TEXT NOT NULL,+ start_time REAL NOT NULL,+ end_time REAL NOT NULL,+ rtstream_id TEXT,+ rtstream_name TEXT,+ created_at TEXT NOT NULL DEFAULT (datetime('now'))+ );+-- IndexesCREATE INDEX IF NOT EXISTS idx_users_access_token ON users(access_token);CREATE INDEX IF NOT EXISTS idx_recordings_session_id ON recordings(session_id);@@ -225,6 +238,8 @@ export function initDatabase(): ReturnType<typeof drizzle<typeof schema>> {CREATE INDEX IF NOT EXISTS idx_nudges_history_recording ON nudges_history(recording_id);CREATE INDEX IF NOT EXISTS idx_mcp_tool_calls_server ON mcp_tool_calls(server_id);CREATE INDEX IF NOT EXISTS idx_mcp_tool_calls_recording ON mcp_tool_calls(recording_id);+ CREATE INDEX IF NOT EXISTS idx_visual_index_items_session ON visual_index_items(session_id);+ CREATE INDEX IF NOT EXISTS idx_visual_index_items_recording ON visual_index_items(recording_id);-- Calendar Preferences tableCREATE TABLE IF NOT EXISTS calendar_preferences (@@ -491,6 +506,40 @@ export function deleteTranscriptSegmentsBySession(sessionId: string) {.run();}+// Visual Index Items++export function createVisualIndexItem(data: schema.NewVisualIndexItem) {+ const database = getDatabase();+ return database.insert(schema.visualIndexItems).values(data).returning().get();+}++export function getVisualIndexItemsByRecording(recordingId: number) {+ const database = getDatabase();+ return database+ .select()+ .from(schema.visualIndexItems)+ .where(eq(schema.visualIndexItems.recordingId, recordingId))+ .orderBy(schema.visualIndexItems.startTime)+ .all();+}++export function getVisualIndexItemsBySession(sessionId: string) {+ const database = getDatabase();+ return database+ .select()+ .from(schema.visualIndexItems)+ .where(eq(schema.visualIndexItems.sessionId, sessionId))+ .orderBy(schema.visualIndexItems.startTime)+ .all();+}++export function deleteVisualIndexItemsBySession(sessionId: string) {+ const database = getDatabase();+ return database+ .delete(schema.visualIndexItems)+ .where(eq(schema.visualIndexItems.sessionId, sessionId))+ .run();+}export function createBookmark(data: schema.NewBookmark) {const database = getDatabase();diff --git a/src/main/db/schema.ts b/src/main/db/schema.tsindex 8e4856d..e421433 100644--- a/src/main/db/schema.ts+++ b/src/main/db/schema.ts@@ -343,6 +343,30 @@ export type CalendarPreferences = typeof calendarPreferences.$inferSelect;export type NewCalendarPreferences = typeof calendarPreferences.$inferInsert;export type RecordingBehavior = 'always_ask' | 'default_record' | 'no_notification';+// Visual Index Tables++/**+ * Visual Index Items+ * Stores visual/screen analysis from VideoDB scene indexing+ */+export const visualIndexItems = sqliteTable('visual_index_items', {+ id: text('id').primaryKey(),+ recordingId: integer('recording_id').notNull(),+ sessionId: text('session_id').notNull(),+ text: text('text').notNull(), // AI-generated scene description+ startTime: real('start_time').notNull(), // seconds from call start+ endTime: real('end_time').notNull(),+ rtstreamId: text('rtstream_id'),+ rtstreamName: text('rtstream_name'),+ createdAt: text('created_at').notNull().default(sql`(datetime('now'))`),+}, (table) => ({+ sessionIdx: index('idx_visual_index_items_session').on(table.sessionId),+ recordingIdx: index('idx_visual_index_items_recording').on(table.recordingId),+}));++export type VisualIndexItem = typeof visualIndexItems.$inferSelect;+export type NewVisualIndexItem = typeof visualIndexItems.$inferInsert;+// Workflows Tables/**diff --git a/src/main/ipc/app.ts b/src/main/ipc/app.tsindex 6d0d42c..43c8965 100644--- a/src/main/ipc/app.ts+++ b/src/main/ipc/app.ts@@ -3,6 +3,8 @@ import { loadAppConfig, loadRuntimeConfig, clearAppConfig } from '../lib/config'import { VideoDBService } from '../services/videodb.service';import { getServerStatus } from '../server';import { createChildLogger } from '../lib/logger';+import os from 'os';+import path from 'path';const logger = createChildLogger('ipc-app');@@ -44,6 +46,25 @@ export function setupAppHandlers(): void {}});+ ipcMain.handle('open-call-md-folder', async (_event, folderPath: string): Promise<void> => {+ // Expand ~ to home directory+ const expandedPath = folderPath.replace(/^~/, os.homedir());+ const absolutePath = path.resolve(expandedPath);++ // Security check: only allow paths under ~/.call_md+ const callMdRoot = path.join(os.homedir(), '.call_md');+ if (!absolutePath.startsWith(callMdRoot)) {+ logger.warn({ path: absolutePath }, 'Attempted to open folder outside .call_md');+ return;+ }++ try {+ await shell.openPath(absolutePath);+ } catch (error) {+ logger.error({ error, path: absolutePath }, 'Failed to open call_md folder');+ }+ });+ipcMain.handle('show-notification',async (_event, title: string, body: string): Promise<void> => {diff --git a/src/main/ipc/index.ts b/src/main/ipc/index.tsindex 8e46b08..d8df9ff 100644--- a/src/main/ipc/index.ts+++ b/src/main/ipc/index.ts@@ -7,6 +7,7 @@ import { setupMCPHandlers, removeMCPHandlers, setMCPMainWindow } from './mcp';import { setupCalendarHandlers, removeCalendarHandlers, setCalendarMainWindow } from './calendar';import { setupLiveAssistHandlers, setLiveAssistWindow, cleanupLiveAssist } from './live-assist';import { setupWorkflowHandlers, removeWorkflowHandlers, setWorkflowsMainWindow } from './workflows';+import { setupVisualIndexIPC } from './visual-index';import { createChildLogger } from '../lib/logger';const logger = createChildLogger('ipc');@@ -22,6 +23,7 @@ export function setupIpcHandlers(): void {setupCalendarHandlers();setupLiveAssistHandlers();setupWorkflowHandlers();+ setupVisualIndexIPC();logger.info('IPC handlers registered');}diff --git a/src/main/ipc/visual-index.ts b/src/main/ipc/visual-index.tsnew file mode 100644index 0000000..6cf2d06--- /dev/null+++ b/src/main/ipc/visual-index.ts@@ -0,0 +1,38 @@+import { ipcMain } from 'electron';+import { v4 as uuid } from 'uuid';+import { createChildLogger } from '../lib/logger';+import { createVisualIndexItem } from '../db';++const logger = createChildLogger('ipc-visual-index');++export function setupVisualIndexIPC(): void {+ ipcMain.handle('visual-index:save-item', async (_event, data: {+ recordingId: number;+ sessionId: string;+ text: string;+ startTime: number;+ endTime: number;+ rtstreamId?: string;+ rtstreamName?: string;+ }) => {+ try {+ const item = createVisualIndexItem({+ id: uuid(),+ recordingId: data.recordingId,+ sessionId: data.sessionId,+ text: data.text,+ startTime: data.startTime,+ endTime: data.endTime,+ rtstreamId: data.rtstreamId,+ rtstreamName: data.rtstreamName,+ });++ logger.debug({ recordingId: data.recordingId, id: item.id }, 'Saved visual index item to DB');+ return { success: true, id: item.id };+ } catch (error) {+ const err = error as Error;+ logger.error({ error: err.message }, 'Failed to save visual index item');+ return { success: false, error: err.message };+ }+ });+}diff --git a/src/main/server/trpc/procedures/visual-index.ts b/src/main/server/trpc/procedures/visual-index.tsindex 6579227..2eb88e0 100644--- a/src/main/server/trpc/procedures/visual-index.ts+++ b/src/main/server/trpc/procedures/visual-index.ts@@ -290,4 +290,45 @@ export const visualIndexRouter = router({activeSceneIndexes.delete(input.sessionId);return { success: true };}),++ /**+ * Save a visual index item to the database.+ */+ saveItem: protectedProcedure+ .input(z.object({+ recordingId: z.number(),+ sessionId: z.string(),+ text: z.string(),+ startTime: z.number(),+ endTime: z.number(),+ rtstreamId: z.string().optional(),+ rtstreamName: z.string().optional(),+ }))+ .output(z.object({+ success: z.boolean(),+ id: z.string().optional(),+ }))+ .mutation(async ({ input }) => {+ const { createVisualIndexItem } = await import('../../../db');+ const { v4: uuid } = await import('uuid');++ try {+ const item = createVisualIndexItem({+ id: uuid(),+ recordingId: input.recordingId,+ sessionId: input.sessionId,+ text: input.text,+ startTime: input.startTime,+ endTime: input.endTime,+ rtstreamId: input.rtstreamId,+ rtstreamName: input.rtstreamName,+ });++ logger.debug({ recordingId: input.recordingId }, '[VisualIndex] Saved visual index item to DB');+ return { success: true, id: item.id };+ } catch (error) {+ logger.error({ error }, '[VisualIndex] Failed to save visual index item');+ return { success: false };+ }+ }),});diff --git a/src/main/services/copilot/sales-copilot.service.ts b/src/main/services/copilot/sales-copilot.service.tsindex 152aae7..085543e 100644--- a/src/main/services/copilot/sales-copilot.service.ts+++ b/src/main/services/copilot/sales-copilot.service.ts@@ -14,6 +14,7 @@ import {getRecordingById,createCallMetricsSnapshot,createNudge,+ getTranscriptSegmentsByRecording,} from '../../db';import {@@ -624,7 +625,7 @@ export class MeetingCopilotService extends EventEmitter {summary: PostMeetingSummary,metrics: ConversationMetrics,duration: number,- segments: TranscriptSegmentData[],+ _segments: TranscriptSegmentData[],meetingContext: { meetingName?: string; meetingDescription?: string }): Promise<void> {const recording = getRecordingById(recordingId);@@ -633,12 +634,16 @@ export class MeetingCopilotService extends EventEmitter {return;}- const transcript = segments.map((seg) => ({+ // Fetch FULL transcript from database (not limited in-memory buffer)+ const dbSegments = getTranscriptSegmentsByRecording(recordingId);+ const transcript = dbSegments.map((seg) => ({speaker: seg.channel as 'me' | 'them',text: seg.text,startTime: seg.startTime,}));+ log.info({ recordingId, segmentCount: dbSegments.length }, 'Fetched full transcript from DB for export');+const filePath = await exportMeetingToMarkdown({recordingId,meetingName: meetingContext.meetingName || 'Untitled Meeting',diff --git a/src/main/services/markdown-export.service.ts b/src/main/services/markdown-export.service.tsindex 047c794..760e36e 100644--- a/src/main/services/markdown-export.service.ts+++ b/src/main/services/markdown-export.service.ts@@ -22,8 +22,6 @@ import fs from 'fs';import path from 'path';import os from 'os';import { createChildLogger } from '../lib/logger';-import { loadRuntimeConfig } from '../lib/config';-import { connect } from 'videodb';import type { PostMeetingSummary } from './copilot/summary-generator.service';import type { ConversationMetrics } from './copilot/conversation-metrics.service';@@ -102,70 +100,29 @@ function formatTimestamp(seconds: number): string {}/**- * Fetch visual analysis from VideoDB+ * Fetch visual analysis from local database*/-async function fetchVisualAnalysis(sessionId: string, apiKey: string): Promise<SceneData[]> {+function fetchVisualAnalysisFromDB(recordingId: number): SceneData[] {try {- const runtimeConfig = loadRuntimeConfig();- const connectOptions: { apiKey: string; baseUrl?: string } = { apiKey };- if (runtimeConfig.apiUrl) {- connectOptions.baseUrl = runtimeConfig.apiUrl;- }-- const conn = connect(connectOptions);- const session = await conn.getCaptureSession(sessionId);- await session.refresh();-- // Find screen RTStream- let screens = session.getRTStream('screen');- if (screens.length === 0) {- screens = (session.rtstreams || []).filter((stream) => {- const name = (stream.name || '').toLowerCase();- const channelId = (stream.channelId || '').toLowerCase();- return (- name.includes('display') ||- name.includes('screen') ||- channelId.includes('display') ||- channelId.includes('screen')- );- });- }-- if (screens.length === 0) {- logger.debug({ sessionId }, 'No screen RTStream found for visual export');- return [];- }-- const screenStream = screens[0];- const sceneIndexes = await screenStream.listSceneIndexes();-- if (sceneIndexes.length === 0) {- logger.debug({ sessionId }, 'No scene indexes found for visual export');- return [];- }-- // Get all scenes from the first scene index- const allScenes: SceneData[] = [];- let page = 1;- let hasMore = true;-- while (hasMore) {- const result = await sceneIndexes[0].getScenes(undefined, undefined, page, 100);- if (result) {- const scenes = (result.scenes || []) as SceneData[];- allScenes.push(...scenes);- hasMore = result.nextPage || false;- } else {- hasMore = false;- }- page++;- }-- logger.info({ sessionId, sceneCount: allScenes.length }, 'Fetched visual analysis');- return allScenes;+ const { getVisualIndexItemsByRecording } = require('../db');+ const items = getVisualIndexItemsByRecording(recordingId);++ const scenes: SceneData[] = items.map((item: any) => ({+ id: item.id,+ start: item.startTime,+ end: item.endTime,+ description: item.text,+ metadata: {+ rtstreamId: item.rtstreamId,+ rtstreamName: item.rtstreamName,+ },+ }));++ logger.info({ recordingId, sceneCount: scenes.length }, 'Fetched visual analysis from DB');+ return scenes;} catch (error) {const err = error as Error;- logger.warn({ error: err.message, sessionId }, 'Failed to fetch visual analysis');+ logger.warn({ error: err.message, recordingId }, 'Failed to fetch visual analysis from DB');return [];}}@@ -452,11 +409,8 @@ export async function exportMeetingToMarkdown(data: MeetingExportData): Promise<const folderPath = getMeetingFolderPath(data.meetingName, data.startedAt);ensureDirectoryExists(folderPath);- // Fetch visual analysis if session info available- let scenes: SceneData[] = [];- if (data.sessionId && data.apiKey) {- scenes = await fetchVisualAnalysis(data.sessionId, data.apiKey);- }+ // Fetch visual analysis from local database+ const scenes: SceneData[] = fetchVisualAnalysisFromDB(data.recordingId);// Write all markdown filesfs.writeFileSync(path.join(folderPath, 'summary.md'), generateSummaryMarkdown(data), 'utf-8');diff --git a/src/preload/index.ts b/src/preload/index.tsindex 417b9a3..be22f64 100644--- a/src/preload/index.ts+++ b/src/preload/index.ts@@ -357,6 +357,7 @@ const api: IpcApi = {showNotification: (title: string, body: string) =>ipcRenderer.invoke('show-notification', title, body),openPlayerWindow: (url: string) => ipcRenderer.invoke('open-player-window', url),+ openCallMdFolder: (path: string) => ipcRenderer.invoke('open-call-md-folder', path),},on: {@@ -446,6 +447,19 @@ const api: IpcApi = {},} as CopilotEvents,+ // Visual Index API+ visualIndex: {+ saveItem: (data: {+ recordingId: number;+ sessionId: string;+ text: string;+ startTime: number;+ endTime: number;+ rtstreamId?: string;+ rtstreamName?: string;+ }) => ipcRenderer.invoke('visual-index:save-item', data),+ },+// MCP APImcp: {// Server managementdiff --git a/src/renderer/App.tsx b/src/renderer/App.tsxindex 492bc9f..36fec72 100644--- a/src/renderer/App.tsx+++ b/src/renderer/App.tsx@@ -1,5 +1,6 @@import React, { useState } from 'react';import logoIcon from '../../resources/icon-color-black-bg.png';+import permissionsVideo from '../../resources/permissions.mp4';import { NewSidebar } from './components/layout/NewSidebar';import { AuthView } from './components/auth/AuthView';import { TopStatusBar } from './components/recording/TopStatusBar';@@ -331,8 +332,17 @@ function PermissionsView({ onContinue }: { onContinue: () => void }) {</div></div>- {/* Right side - Placeholder */}- <div className="flex-1 h-full min-h-[400px] bg-[#f7f7f7] rounded-[16px]" />+ {/* Right side - Permissions Video */}+ <div className="flex-1 h-full min-h-[400px] bg-[#f7f7f7] rounded-[16px] overflow-hidden flex items-center justify-center">+ <video+ src={permissionsVideo}+ autoPlay+ loop+ muted+ playsInline+ className="w-full h-full object-cover rounded-[16px]"+ />+ </div></div></div>);diff --git a/src/renderer/components/history/RecordingCard.tsx b/src/renderer/components/history/RecordingCard.tsxindex 53b418b..647037f 100644--- a/src/renderer/components/history/RecordingCard.tsx+++ b/src/renderer/components/history/RecordingCard.tsx@@ -1,7 +1,25 @@import React from 'react';-import { Calendar, Clock, CheckCircle2, AlertTriangle, Loader2, Circle } from 'lucide-react';+import { Calendar, Clock, CheckCircle2, AlertTriangle, Loader2, Circle, Copy, ExternalLink } from 'lucide-react';import type { Recording } from '../../../shared/schemas/recording.schema';import { formatDate, formatDurationMinutes, stripMarkdown, cn } from '../../lib/utils';+import { Tooltip } from '../ui/Tooltip';++// Generate the call_md folder path for a recording+function getCallMdPath(recording: Recording): string {+ const date = new Date(recording.createdAt);+ const year = date.getFullYear();+ const month = String(date.getMonth() + 1).padStart(2, '0');+ const day = String(date.getDate()).padStart(2, '0');+ const name = (recording.meetingName || 'untitled-meeting')+ .replace(/[/\\?%*:|"<>]/g, '-')+ .replace(/\s+/g, '-')+ .replace(/-+/g, '-')+ .replace(/^-|-$/g, '')+ .toLowerCase()+ .slice(0, 100);++ return `~/.call_md/meetings/${year}/${month}/${day}/${name}`;+}interface RecordingCardProps {recording: Recording;@@ -65,6 +83,80 @@ function StatusBadge({ status }: { status: RecordingStatus }) {);}+function CopyPathButton({ recording }: { recording: Recording }) {+ const isDisabled = recording.status === 'recording' || recording.status === 'failed';+ const path = getCallMdPath(recording);++ const handleClick = (e: React.MouseEvent) => {+ e.stopPropagation();+ if (isDisabled) return;++ // Copy the path with ~ prefix (user can expand it)+ navigator.clipboard.writeText(path);+ };++ if (isDisabled) {+ return (+ <button+ disabled+ className="w-[24px] h-[24px] flex items-center justify-center rounded opacity-10 cursor-not-allowed"+ >+ <Copy className="w-[16px] h-[16px] text-[#464646]" />+ </button>+ );+ }++ return (+ <Tooltip content="Copy folder path">+ <button+ onClick={handleClick}+ className="w-[24px] h-[24px] flex items-center justify-center rounded opacity-60 hover:opacity-100 cursor-pointer transition-opacity"+ >+ <Copy className="w-[16px] h-[16px] text-[#464646]" />+ </button>+ </Tooltip>+ );+}++function OpenFolderButton({ recording }: { recording: Recording }) {+ const isDisabled = recording.status === 'recording' || recording.status === 'failed';+ const path = getCallMdPath(recording);++ const handleClick = async (e: React.MouseEvent) => {+ e.stopPropagation();+ if (isDisabled) return;++ // Use shell.openPath via IPC - the main process will resolve ~ to home dir+ try {+ await window.electronAPI?.app?.openCallMdFolder?.(path);+ } catch (err) {+ console.error('Failed to open folder:', err);+ }+ };++ if (isDisabled) {+ return (+ <button+ disabled+ className="w-[24px] h-[24px] flex items-center justify-center rounded opacity-10 cursor-not-allowed"+ >+ <ExternalLink className="w-[16px] h-[16px] text-[#464646]" />+ </button>+ );+ }++ return (+ <Tooltip content="Open folder">+ <button+ onClick={handleClick}+ className="w-[24px] h-[24px] flex items-center justify-center rounded opacity-60 hover:opacity-100 cursor-pointer transition-opacity"+ >+ <ExternalLink className="w-[16px] h-[16px] text-[#464646]" />+ </button>+ </Tooltip>+ );+}+export function RecordingCard({ recording, onClick }: RecordingCardProps) {const config = statusConfigs[recording.status] || statusConfigs.available;@@ -100,8 +192,14 @@ export function RecordingCard({ recording, onClick }: RecordingCardProps) {>{/* Header Section */}<div className="flex flex-col gap-[10px]">- {/* Status Badge */}- <StatusBadge status={recording.status} />+ {/* Status Badge and Action Buttons */}+ <div className="flex items-start justify-between">+ <StatusBadge status={recording.status} />+ <div className="flex items-center gap-[8px]">+ <CopyPathButton recording={recording} />+ <OpenFolderButton recording={recording} />+ </div>+ </div>{/* Title */}<h3 className="text-[18px] font-medium text-black tracking-[0.09px] line-clamp-1">diff --git a/src/renderer/components/ui/Tooltip.tsx b/src/renderer/components/ui/Tooltip.tsxnew file mode 100644index 0000000..48a3300--- /dev/null+++ b/src/renderer/components/ui/Tooltip.tsx@@ -0,0 +1,66 @@+import React, { useState, useRef, useEffect } from 'react';+import { cn } from '../../lib/utils';++interface TooltipProps {+ content: string;+ children: React.ReactNode;+ className?: string;+}++export function Tooltip({ content, children, className }: TooltipProps) {+ const [isVisible, setIsVisible] = useState(false);+ const [position, setPosition] = useState({ top: 0, left: 0 });+ const triggerRef = useRef<HTMLDivElement>(null);+ const tooltipRef = useRef<HTMLDivElement>(null);++ useEffect(() => {+ if (isVisible && triggerRef.current && tooltipRef.current) {+ const triggerRect = triggerRef.current.getBoundingClientRect();+ const tooltipRect = tooltipRef.current.getBoundingClientRect();++ // Position above the trigger, centered horizontally+ const top = -tooltipRect.height - 8; // 8px gap for arrow+ const left = (triggerRect.width - tooltipRect.width) / 2;++ setPosition({ top, left });+ }+ }, [isVisible]);++ return (+ <div+ ref={triggerRef}+ className={cn('relative inline-flex', className)}+ onMouseEnter={() => setIsVisible(true)}+ onMouseLeave={() => setIsVisible(false)}+ >+ {children}+ {isVisible && (+ <div+ ref={tooltipRef}+ className="absolute z-50 pointer-events-none"+ style={{ top: position.top, left: position.left }}+ >+ <div+ className={cn(+ 'h-[32px] px-[12px] flex items-center justify-center',+ 'bg-[#1e1e1e] text-white text-[10px] font-medium',+ 'rounded-[4px] whitespace-nowrap',+ 'shadow-[0px_2.979px_4.468px_0px_rgba(0,2,40,0.14)]'+ )}+ >+ {content}+ </div>+ {/* Arrow */}+ <div+ className="absolute left-1/2 -translate-x-1/2 w-0 h-0"+ style={{+ borderLeft: '6px solid transparent',+ borderRight: '6px solid transparent',+ borderTop: '6px solid #1e1e1e',+ }}+ />+ </div>+ )}+ </div>+ );+}diff --git a/src/renderer/hooks/useGlobalRecorderEvents.ts b/src/renderer/hooks/useGlobalRecorderEvents.tsindex d7672f8..0c21be6 100644--- a/src/renderer/hooks/useGlobalRecorderEvents.ts+++ b/src/renderer/hooks/useGlobalRecorderEvents.ts@@ -100,6 +100,25 @@ export function useGlobalRecorderEvents() {rtstreamId: visualData.rtstreamId,rtstreamName: visualData.rtstreamName,});++ // Save to database for durable storage+ const currentSession = useSessionStore.getState();+ const currentApi = getElectronAPI();+ if (currentSession.recordingId && currentSession.sessionId && currentApi) {+ // Convert epoch ms timestamps to seconds from call start+ const callStartSec = currentSession.startTime ? currentSession.startTime / 1000 : visualData.start;+ currentApi.visualIndex.saveItem({+ recordingId: currentSession.recordingId,+ sessionId: currentSession.sessionId,+ text: visualData.text,+ startTime: Math.max(0, visualData.start - callStartSec),+ endTime: Math.max(0, visualData.end - callStartSec),+ rtstreamId: visualData.rtstreamId,+ rtstreamName: visualData.rtstreamName,+ }).catch((err: Error) => {+ console.warn('[GlobalRecorderEvents] Error saving visual index item:', err);+ });+ }}break;diff --git a/src/shared/types/ipc.types.ts b/src/shared/types/ipc.types.tsindex 5f0f388..4b057bd 100644--- a/src/shared/types/ipc.types.ts+++ b/src/shared/types/ipc.types.ts@@ -221,6 +221,18 @@ export interface IpcApi {openExternalLink: (url: string) => Promise<void>;showNotification: (title: string, body: string) => Promise<void>;openPlayerWindow: (url: string) => Promise<void>;+ openCallMdFolder: (path: string) => Promise<void>;+ };+ visualIndex: {+ saveItem: (data: {+ recordingId: number;+ sessionId: string;+ text: string;+ startTime: number;+ endTime: number;+ rtstreamId?: string;+ rtstreamName?: string;+ }) => Promise<{ success: boolean; id?: string; error?: string }>;};on: {recorderEvent: (callback: (event: RecorderEvent) => void) => () => void;