Skip to content

Turn meetings into live agent loops. Record, transcribe, and analyze meetings with real-time AI intelligence — before, during, and after calls.

feat: new meeting UI , live insights, workflows

Om Gateace73b9c1d8e
diff --git a/resources/icon.png b/resources/icon.png
new file mode 100644
index 0000000..0bc4792
Binary files /dev/null and b/resources/icon.png differ
diff --git a/src/main/db/index.ts b/src/main/db/index.ts
index aec3270..705ea49 100644
--- a/src/main/db/index.ts
+++ b/src/main/db/index.ts
@@ -234,6 +234,16 @@ export function initDatabase(): ReturnType<typeof drizzle<typeof schema>> {
created_at TEXT NOT NULL DEFAULT (datetime('now')),
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
);
+
+ -- Workflows table
+ CREATE TABLE IF NOT EXISTS workflows (
+ id TEXT PRIMARY KEY,
+ name TEXT NOT NULL,
+ webhook_url TEXT NOT NULL,
+ enabled INTEGER NOT NULL DEFAULT 1,
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
+ updated_at TEXT NOT NULL DEFAULT (datetime('now'))
+ );
`);
ensureRecordingColumns();
@@ -274,6 +284,7 @@ function ensureRecordingColumns(): void {
addColumnIfMissing('probing_questions', "ALTER TABLE recordings ADD COLUMN probing_questions TEXT");
addColumnIfMissing('meeting_checklist', "ALTER TABLE recordings ADD COLUMN meeting_checklist TEXT");
addColumnIfMissing('collection_id', "ALTER TABLE recordings ADD COLUMN collection_id TEXT");
+ addColumnIfMissing('post_meeting_checklist', "ALTER TABLE recordings ADD COLUMN post_meeting_checklist TEXT");
}
function ensureNudgesHistorySchema(): void {
@@ -475,7 +486,8 @@ export function deleteTranscriptSegmentsBySession(sessionId: string) {
const database = getDatabase();
return database
.delete(schema.transcriptSegments)
- .where(eq(schema.transcriptSegments.sessionId, sessionId));
+ .where(eq(schema.transcriptSegments.sessionId, sessionId))
+ .run();
}
@@ -496,7 +508,7 @@ export function getBookmarksByRecording(recordingId: number) {
export function deleteBookmark(id: string) {
const database = getDatabase();
- return database.delete(schema.bookmarks).where(eq(schema.bookmarks.id, id));
+ return database.delete(schema.bookmarks).where(eq(schema.bookmarks.id, id)).run();
}
@@ -705,13 +717,13 @@ export function upsertSetting(data: schema.NewCopilotSetting) {
export function deleteSetting(key: string) {
const database = getDatabase();
- return database.delete(schema.copilotSettings).where(eq(schema.copilotSettings.key, key));
+ return database.delete(schema.copilotSettings).where(eq(schema.copilotSettings.key, key)).run();
}
export function deleteCueCard(id: string) {
const database = getDatabase();
- return database.delete(schema.cueCards).where(eq(schema.cueCards.id, id));
+ return database.delete(schema.cueCards).where(eq(schema.cueCards.id, id)).run();
}
export function updatePlaybook(id: string, data: Partial<schema.Playbook>) {
@@ -726,7 +738,7 @@ export function updatePlaybook(id: string, data: Partial<schema.Playbook>) {
export function deletePlaybook(id: string) {
const database = getDatabase();
- return database.delete(schema.playbooks).where(eq(schema.playbooks.id, id));
+ return database.delete(schema.playbooks).where(eq(schema.playbooks.id, id)).run();
}
export function setDefaultPlaybook(id: string) {
@@ -1504,7 +1516,7 @@ export function updateMCPServerStatus(
export function deleteMCPServer(id: string) {
const database = getDatabase();
- return database.delete(schema.mcpServers).where(eq(schema.mcpServers.id, id));
+ return database.delete(schema.mcpServers).where(eq(schema.mcpServers.id, id)).run();
}
// MCP Tool Call CRUD Operations
@@ -1587,7 +1599,8 @@ export function deleteMCPOauthToken(serverId: string) {
const database = getDatabase();
return database
.delete(schema.mcpOauthTokens)
- .where(eq(schema.mcpOauthTokens.serverId, serverId));
+ .where(eq(schema.mcpOauthTokens.serverId, serverId))
+ .run();
}
// Calendar Preferences CRUD Operations
@@ -1641,4 +1654,53 @@ export function upsertCalendarPreferences(data: {
.get();
}
+// Workflow CRUD Operations
+
+export function getAllWorkflows() {
+ const database = getDatabase();
+ return database
+ .select()
+ .from(schema.workflows)
+ .orderBy(desc(schema.workflows.createdAt))
+ .all();
+}
+
+export function getWorkflowById(id: string) {
+ const database = getDatabase();
+ return database
+ .select()
+ .from(schema.workflows)
+ .where(eq(schema.workflows.id, id))
+ .get();
+}
+
+export function getEnabledWorkflows() {
+ const database = getDatabase();
+ return database
+ .select()
+ .from(schema.workflows)
+ .where(eq(schema.workflows.enabled, true))
+ .all();
+}
+
+export function createWorkflow(data: schema.NewWorkflow) {
+ const database = getDatabase();
+ return database.insert(schema.workflows).values(data).returning().get();
+}
+
+export function updateWorkflow(id: string, data: Partial<schema.Workflow>) {
+ const database = getDatabase();
+ return database
+ .update(schema.workflows)
+ .set({ ...data, updatedAt: new Date().toISOString() })
+ .where(eq(schema.workflows.id, id))
+ .returning()
+ .get();
+}
+
+export function deleteWorkflow(id: string) {
+ const database = getDatabase();
+ return database.delete(schema.workflows).where(eq(schema.workflows.id, id)).run();
+}
+
export { schema };
diff --git a/src/main/db/schema.ts b/src/main/db/schema.ts
index d367ffe..64313a1 100644
--- a/src/main/db/schema.ts
+++ b/src/main/db/schema.ts
@@ -35,7 +35,9 @@ export const recordings = sqliteTable('recordings', {
meetingName: text('meeting_name'),
meetingDescription: text('meeting_description'),
probingQuestions: text('probing_questions'), // JSON: ProbingQuestion[]
- meetingChecklist: text('meeting_checklist'), // JSON: string[]
+ meetingChecklist: text('meeting_checklist'), // JSON: string[] (in-meeting agenda)
+ // Post-meeting analysis
+ postMeetingChecklist: text('post_meeting_checklist'), // JSON: string[] (action items after meeting)
});
// Meeting Co-Pilot Tables
@@ -339,3 +341,21 @@ export const calendarPreferences = sqliteTable('calendar_preferences', {
export type CalendarPreferences = typeof calendarPreferences.$inferSelect;
export type NewCalendarPreferences = typeof calendarPreferences.$inferInsert;
export type RecordingBehavior = 'always_ask' | 'default_record' | 'no_notification';
+
+// Workflows Tables
+
+/**
+ * Workflows
+ * Webhook integrations for post-meeting automation (n8n, Zapier, etc.)
+ */
+export const workflows = sqliteTable('workflows', {
+ id: text('id').primaryKey(),
+ name: text('name').notNull(),
+ webhookUrl: text('webhook_url').notNull(),
+ enabled: integer('enabled', { mode: 'boolean' }).notNull().default(true),
+ createdAt: text('created_at').notNull().default(sql`(datetime('now'))`),
+ updatedAt: text('updated_at').notNull().default(sql`(datetime('now'))`),
+});
+
+export type Workflow = typeof workflows.$inferSelect;
+export type NewWorkflow = typeof workflows.$inferInsert;
diff --git a/src/main/index.ts b/src/main/index.ts
index 3231ca8..c15b63f 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -10,6 +10,7 @@ import {
setCopilotMainWindow,
setMCPMainWindow,
setCalendarMainWindow,
+ setLiveAssistWindow,
sendToRenderer,
shutdownCaptureClient,
} from './ipc';
@@ -142,6 +143,7 @@ async function createWindow(): Promise<void> {
setCopilotMainWindow(mainWindow);
setMCPMainWindow(mainWindow);
setCalendarMainWindow(mainWindow);
+ setLiveAssistWindow(mainWindow);
if (isDev) {
const VITE_DEV_PORT = 51730;
diff --git a/src/main/ipc/index.ts b/src/main/ipc/index.ts
index 048915a..8e46b08 100644
--- a/src/main/ipc/index.ts
+++ b/src/main/ipc/index.ts
@@ -5,6 +5,8 @@ import { setupAppHandlers } from './app';
import { setupCopilotHandlers, removeCopilotHandlers, setCopilotMainWindow } from './copilot';
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 { createChildLogger } from '../lib/logger';
const logger = createChildLogger('ipc');
@@ -18,6 +20,8 @@ export function setupIpcHandlers(): void {
setupCopilotHandlers();
setupMCPHandlers();
setupCalendarHandlers();
+ setupLiveAssistHandlers();
+ setupWorkflowHandlers();
logger.info('IPC handlers registered');
}
@@ -56,6 +60,16 @@ export function removeIpcHandlers(): void {
// Calendar handlers
removeCalendarHandlers();
+ // Live Assist handlers
+ ipcMain.removeHandler('live-assist:start');
+ ipcMain.removeHandler('live-assist:stop');
+ ipcMain.removeHandler('live-assist:add-transcript');
+ ipcMain.removeHandler('live-assist:clear');
+ cleanupLiveAssist();
+
+ // Workflow handlers
+ removeWorkflowHandlers();
+
logger.info('IPC handlers removed');
}
@@ -63,3 +77,5 @@ export { sendToRenderer, getMainWindow, setMainWindow, shutdownCaptureClient, is
export { setCopilotMainWindow } from './copilot';
export { setMCPMainWindow } from './mcp';
export { setCalendarMainWindow } from './calendar';
+export { setLiveAssistWindow } from './live-assist';
+export { setWorkflowsMainWindow } from './workflows';
diff --git a/src/main/ipc/live-assist.ts b/src/main/ipc/live-assist.ts
new file mode 100644
index 0000000..497607a
--- /dev/null
+++ b/src/main/ipc/live-assist.ts
@@ -0,0 +1,95 @@
+/**
+ * Live Assist IPC Handlers
+ *
+ * Handles IPC communication for the live assist feature and MCP inference.
+ * Forwards events from both services to the renderer.
+ */
+
+import { ipcMain, BrowserWindow } from 'electron';
+import { getLiveAssistService, resetLiveAssistService } from '../services/live-assist.service';
+import { getMCPInferenceService, resetMCPInferenceService } from '../services/mcp-inference.service';
+import { createChildLogger } from '../lib/logger';
+import type { LiveAssistEvent } from '../../shared/types/live-assist.types';
+import type { MCPDisplayResult } from '../../shared/types/mcp.types';
+
+const logger = createChildLogger('ipc-live-assist');
+
+let mainWindow: BrowserWindow | null = null;
+
+function sendToRenderer(channel: string, data: unknown): void {
+ if (mainWindow && !mainWindow.isDestroyed()) {
+ mainWindow.webContents.send(channel, data);
+ }
+}
+
+export function setLiveAssistWindow(window: BrowserWindow): void {
+ mainWindow = window;
+}
+
+export function setupLiveAssistHandlers(): void {
+ // Start live assist (also starts MCP inference)
+ ipcMain.handle('live-assist:start', async () => {
+ logger.info('Starting live assist and MCP inference');
+
+ // Start Live Assist service
+ const liveAssistService = getLiveAssistService();
+ liveAssistService.removeAllListeners('assists');
+ liveAssistService.on('assists', (event: LiveAssistEvent) => {
+ logger.info({ assistCount: event.assists.length }, 'Sending assists to renderer');
+ sendToRenderer('live-assist:update', event);
+ });
+ liveAssistService.start();
+
+ // Start MCP Inference service
+ const mcpInferenceService = getMCPInferenceService();
+ mcpInferenceService.removeAllListeners('result');
+ mcpInferenceService.on('result', (result: MCPDisplayResult) => {
+ logger.info({ resultId: result.id }, 'Sending MCP inference result to renderer');
+ sendToRenderer('mcp:result', { result });
+ });
+ mcpInferenceService.start();
+
+ return { success: true };
+ });
+
+ // Stop live assist (also stops MCP inference)
+ ipcMain.handle('live-assist:stop', async () => {
+ logger.info('Stopping live assist and MCP inference');
+
+ const liveAssistService = getLiveAssistService();
+ liveAssistService.stop();
+
+ const mcpInferenceService = getMCPInferenceService();
+ mcpInferenceService.stop();
+
+ return { success: true };
+ });
+
+ // Add transcript (called from global recorder events)
+ ipcMain.handle('live-assist:add-transcript', async (_event, text: string, source: 'mic' | 'system_audio') => {
+ // Forward to both services
+ const liveAssistService = getLiveAssistService();
+ liveAssistService.addTranscript(text, source);
+
+ const mcpInferenceService = getMCPInferenceService();
+ mcpInferenceService.addTranscript(text, source);
+
+ return { success: true };
+ });
+
+ // Clear live assist state
+ ipcMain.handle('live-assist:clear', async () => {
+ const liveAssistService = getLiveAssistService();
+ liveAssistService.clear();
+
+ const mcpInferenceService = getMCPInferenceService();
+ mcpInferenceService.clear();
+
+ return { success: true };
+ });
+}
+
+export function cleanupLiveAssist(): void {
+ resetLiveAssistService();
+ resetMCPInferenceService();
+}
diff --git a/src/main/ipc/workflows.ts b/src/main/ipc/workflows.ts
new file mode 100644
index 0000000..b214ec5
--- /dev/null
+++ b/src/main/ipc/workflows.ts
@@ -0,0 +1,217 @@
+/**
+ * Workflows IPC Handlers
+ *
+ * Handles IPC communication for workflow webhook management.
+ */
+
+import { ipcMain, BrowserWindow } from 'electron';
+import { v4 as uuid } from 'uuid';
+import { createChildLogger } from '../lib/logger';
+import {
+ getAllWorkflows,
+ getWorkflowById,
+ createWorkflow,
+ updateWorkflow,
+ deleteWorkflow,
+} from '../db';
+import type {
+ Workflow,
+ CreateWorkflowRequest,
+ UpdateWorkflowRequest,
+} from '../../shared/types/workflow.types';
+
+const logger = createChildLogger('ipc-workflows');
+
+let mainWindow: BrowserWindow | null = null;
+
+export function setWorkflowsMainWindow(window: BrowserWindow): void {
+ mainWindow = window;
+}
+
+export function setupWorkflowHandlers(): void {
+ logger.info('Setting up workflow IPC handlers');
+
+ // Get all workflows
+ ipcMain.handle('workflows:get-all', async (): Promise<{
+ success: boolean;
+ workflows?: Workflow[];
+ error?: string;
+ }> => {
+ try {
+ const workflows = getAllWorkflows();
+ return {
+ success: true,
+ workflows: workflows.map((w) => ({
+ id: w.id,
+ name: w.name,
+ webhookUrl: w.webhookUrl,
+ enabled: w.enabled,
+ createdAt: w.createdAt,
+ updatedAt: w.updatedAt,
+ })),
+ };
+ } catch (error) {
+ const err = error as Error;
+ logger.error({ error: err.message }, 'Failed to get workflows');
+ return { success: false, error: err.message };
+ }
+ });
+
+ // Get a single workflow
+ ipcMain.handle('workflows:get', async (_event, id: string): Promise<{
+ success: boolean;
+ workflow?: Workflow;
+ error?: string;
+ }> => {
+ try {
+ const workflow = getWorkflowById(id);
+ if (!workflow) {
+ return { success: false, error: 'Workflow not found' };
+ }
+ return {
+ success: true,
+ workflow: {
+ id: workflow.id,
+ name: workflow.name,
+ webhookUrl: workflow.webhookUrl,
+ enabled: workflow.enabled,
+ createdAt: workflow.createdAt,
+ updatedAt: workflow.updatedAt,
+ },
+ };
+ } catch (error) {
+ const err = error as Error;
+ logger.error({ error: err.message }, 'Failed to get workflow');
+ return { success: false, error: err.message };
+ }
+ });
+
+ // Create a workflow
+ ipcMain.handle('workflows:create', async (_event, request: CreateWorkflowRequest): Promise<{
+ success: boolean;
+ workflow?: Workflow;
+ error?: string;
+ }> => {
+ try {
+ const workflow = createWorkflow({
+ id: uuid(),
+ name: request.name,
+ webhookUrl: request.webhookUrl,
+ enabled: request.enabled ?? true,
+ });
+
+ logger.info({ workflowId: workflow.id, name: workflow.name }, 'Workflow created');
+
+ return {
+ success: true,
+ workflow: {
+ id: workflow.id,
+ name: workflow.name,
+ webhookUrl: workflow.webhookUrl,
+ enabled: workflow.enabled,
+ createdAt: workflow.createdAt,
+ updatedAt: workflow.updatedAt,
+ },
+ };
+ } catch (error) {
+ const err = error as Error;
+ logger.error({ error: err.message }, 'Failed to create workflow');
+ return { success: false, error: err.message };
+ }
+ });
+
+ // Update a workflow
+ ipcMain.handle('workflows:update', async (_event, id: string, request: UpdateWorkflowRequest): Promise<{
+ success: boolean;
+ workflow?: Workflow;
+ error?: string;
+ }> => {
+ try {
+ const existing = getWorkflowById(id);
+ if (!existing) {
+ return { success: false, error: 'Workflow not found' };
+ }
+
+ const workflow = updateWorkflow(id, {
+ name: request.name,
+ webhookUrl: request.webhookUrl,
+ enabled: request.enabled,
+ });
+
+ if (!workflow) {
+ return { success: false, error: 'Failed to update workflow' };
+ }
+
+ logger.info({ workflowId: id }, 'Workflow updated');
+
+ return {
+ success: true,
+ workflow: {
+ id: workflow.id,
+ name: workflow.name,
+ webhookUrl: workflow.webhookUrl,
+ enabled: workflow.enabled,
+ createdAt: workflow.createdAt,
+ updatedAt: workflow.updatedAt,
+ },
+ };
+ } catch (error) {
+ const err = error as Error;
+ logger.error({ error: err.message }, 'Failed to update workflow');
+ return { success: false, error: err.message };
+ }
+ });
+
+ // Delete a workflow
+ ipcMain.handle('workflows:delete', async (_event, id: string): Promise<{
+ success: boolean;
+ error?: string;
+ }> => {
+ try {
+ const existing = getWorkflowById(id);
+ if (!existing) {
+ return { success: false, error: 'Workflow not found' };
+ }
+
+ deleteWorkflow(id);
+ logger.info({ workflowId: id }, 'Workflow deleted');
+
+ return { success: true };
+ } catch (error) {
+ const err = error as Error;
+ logger.error({ error: err.message }, 'Failed to delete workflow');
+ return { success: false, error: err.message };
+ }
+ });
+
+ // Test a webhook URL
+ ipcMain.handle('workflows:test', async (_event, webhookUrl: string): Promise<{
+ success: boolean;
+ statusCode?: number;
+ error?: string;
+ responseTime?: number;
+ }> => {
+ try {
+ const { testWorkflowWebhook } = await import('../services/workflow-webhook.service');
+ const result = await testWorkflowWebhook(webhookUrl);
+ return result;
+ } catch (error) {
+ const err = error as Error;
+ logger.error({ error: err.message }, 'Failed to test webhook');
+ return { success: false, error: err.message };
+ }
+ });
+
+ logger.info('Workflow IPC handlers registered');
+}
+
+export function removeWorkflowHandlers(): void {
+ ipcMain.removeHandler('workflows:get-all');
+ ipcMain.removeHandler('workflows:get');
+ ipcMain.removeHandler('workflows:create');
+ ipcMain.removeHandler('workflows:update');
+ ipcMain.removeHandler('workflows:delete');
+ ipcMain.removeHandler('workflows:test');
+
+ logger.info('Workflow IPC handlers removed');
+}
diff --git a/src/main/server/trpc/procedures/meeting-setup.ts b/src/main/server/trpc/procedures/meeting-setup.ts
index 5f28170..b1f5035 100644
--- a/src/main/server/trpc/procedures/meeting-setup.ts
+++ b/src/main/server/trpc/procedures/meeting-setup.ts
@@ -9,7 +9,6 @@ import { getMeetingSetupService } from '../../../services/meeting-setup.service'
const probingQuestionSchema = z.object({
question: z.string(),
- type: z.enum(['single-choice', 'multi-choice']),
options: z.array(z.string()),
answer: z.string(),
customAnswer: z.string().optional(),
diff --git a/src/main/server/trpc/procedures/recordings.ts b/src/main/server/trpc/procedures/recordings.ts
index cb33c09..b4382b9 100644
--- a/src/main/server/trpc/procedures/recordings.ts
+++ b/src/main/server/trpc/procedures/recordings.ts
@@ -55,6 +55,10 @@ function toApiRecording(dbRecording: ReturnType<typeof getRecordingById>) {
(dbRecording as any).meetingChecklist,
z.array(z.string())
);
+ const postMeetingChecklist = safeJsonParse(
+ (dbRecording as any).postMeetingChecklist,
+ z.array(z.string())
+ );
return {
id: dbRecording.id,
@@ -78,6 +82,8 @@ function toApiRecording(dbRecording: ReturnType<typeof getRecordingById>) {
meetingDescription: (dbRecording as any).meetingDescription || null,
probingQuestions: probingQuestions || null,
meetingChecklist: meetingChecklist || null,
+ // Post-meeting analysis
+ postMeetingChecklist: postMeetingChecklist || null,
};
}
diff --git a/src/main/services/calendar-poller.service.ts b/src/main/services/calendar-poller.service.ts
index 8d9b64e..e4b0b06 100644
--- a/src/main/services/calendar-poller.service.ts
+++ b/src/main/services/calendar-poller.service.ts
@@ -20,7 +20,7 @@ const log = logger.child({ module: 'calendar-poller' });
// Polling configuration
const POLL_INTERVAL_MS = 20_000; // 20 seconds
const DEFAULT_NOTIFY_MINUTES_BEFORE = 2; // Default: notify 2 minutes before meeting
-const UPCOMING_HOURS = 2; // Fetch events within next 2 hours
+const UPCOMING_HOURS = 24; // Fetch events within next 24 hours
class CalendarPollerService extends EventEmitter {
private pollInterval: NodeJS.Timeout | null = null;
diff --git a/src/main/services/copilot/sales-copilot.service.ts b/src/main/services/copilot/sales-copilot.service.ts
index 7afde6a..148d484 100644
--- a/src/main/services/copilot/sales-copilot.service.ts
+++ b/src/main/services/copilot/sales-copilot.service.ts
@@ -570,6 +570,7 @@ export class MeetingCopilotService extends EventEmitter {
summary = {
shortOverview: `Summary generation failed: ${errMsg}`,
keyPoints: [],
+ postMeetingChecklist: [],
generatedAt: Date.now(),
};
}
@@ -580,6 +581,7 @@ export class MeetingCopilotService extends EventEmitter {
updateRecording(recordingId, {
shortOverview: summary.shortOverview,
keyPoints: JSON.stringify(summary.keyPoints),
+ postMeetingChecklist: JSON.stringify(summary.postMeetingChecklist),
metricsSnapshot: JSON.stringify(metrics),
duration: Math.round(duration),
});
@@ -597,6 +599,11 @@ export class MeetingCopilotService extends EventEmitter {
duration,
});
+ // Trigger workflow webhooks (fire and forget)
+ this.triggerWorkflowWebhooks(recordingId, summary, duration, segments).catch((err) => {
+ log.error({ err }, 'Failed to trigger workflow webhooks');
+ });
+
// Cleanup
this.transcriptBuffer.clear(sessionId);
this.contextManager.clear(sessionId);
@@ -605,6 +612,53 @@ export class MeetingCopilotService extends EventEmitter {
return summary;
}
+ /**
+ * Trigger workflow webhooks with meeting data
+ */
+ private async triggerWorkflowWebhooks(
+ recordingId: number,
+ summary: PostMeetingSummary,
+ duration: number,
+ segments: TranscriptSegmentData[]
+ ): Promise<void> {
+ const { triggerWorkflowWebhooks } = await import('../workflow-webhook.service');
+
+ // Fetch recording data for video details
+ const recording = getRecordingById(recordingId);
+ if (!recording) {
+ log.warn({ recordingId }, 'Recording not found for workflow webhooks');
+ return;
+ }
+
+ // Prepare transcript data
+ const transcript = segments.map((seg) => ({
+ speaker: seg.channel as 'me' | 'them',
+ text: seg.text,
+ timestamp: seg.startTime,
+ }));
+
+ // Trigger webhooks
+ await triggerWorkflowWebhooks({
+ recordingId,
+ title: (recording as any).meetingName || 'Meeting Recording',
+ description: (recording as any).meetingDescription,
+ startedAt: recording.createdAt,
+ endedAt: new Date().toISOString(),
+ durationSeconds: Math.round(duration),
+ exportedVideoId: recording.videoId || '',
+ playerUrl: recording.playerUrl || '',
+ streamId: (recording as any).streamUrl,
+ summary: summary.shortOverview,
+ topics: summary.keyPoints.map((kp) => kp.topic),
+ actionItems: summary.keyPoints.flatMap((kp) => kp.points),
+ checklist: summary.postMeetingChecklist.map((item) => ({
+ text: item,
+ completed: false,
+ })),
+ transcript,
+ });
+ }
+
/**
* Update configuration
*/
diff --git a/src/main/services/copilot/summary-generator.service.ts b/src/main/services/copilot/summary-generator.service.ts
index 5fbac71..09bedae 100644
--- a/src/main/services/copilot/summary-generator.service.ts
+++ b/src/main/services/copilot/summary-generator.service.ts
@@ -1,15 +1,15 @@
/**
* Summary Generator Service
*
- * Generates post-meeting summaries using two specialized prompts:
+ * Generates post-meeting summaries using three specialized prompts:
* 1. Short Overview - A narrative paragraph summary (3-5 sentences)
* 2. Key Points - Structured JSON with topics and attributed points
+ * 3. Post-Meeting Checklist - Action items and follow-ups from the conversation
*/
import { logger } from '../../lib/logger';
import { getLLMService } from '../llm.service';
import { getTranscriptSegmentsByRecording } from '../../db';
-import type { TranscriptSegmentData } from './transcript-buffer.service';
const log = logger.child({ module: 'summary-generator' });
@@ -23,6 +23,7 @@ export interface KeyPoint {
export interface PostMeetingSummary {
shortOverview: string;
keyPoints: KeyPoint[];
+ postMeetingChecklist: string[];
generatedAt: number;
}
@@ -96,13 +97,44 @@ Output format:
]
}`;
+const POST_MEETING_CHECKLIST_SYSTEM_PROMPT = `You are an expert meeting analyst. Given a meeting transcript, extract
+all action items, follow-ups, open questions, and tasks that need to be
+handled AFTER the meeting ends.
+
+Rules:
+- Extract concrete, actionable items that emerged from the conversation.
+- Include: tasks assigned to people, decisions that need follow-up,
+ questions that were left unanswered, commitments made, deadlines
+ mentioned, and next steps discussed.
+- Each item should be a clear, actionable statement. Include the
+ responsible person if mentioned.
+- Good: "John to send the proposal by Friday"
+- Good: "Schedule follow-up meeting with design team"
+- Good: "Clarify budget allocation with finance"
+- Bad: "Discussed the project" (not actionable)
+- Order by priority/urgency if discernible, otherwise by order mentioned.
+- Generate between 3-10 items. Only include genuine action items from
+ the conversation - do not pad or invent items.
+- If no clear action items were discussed, return an empty array.
+
+Respond ONLY with the JSON object below - no explanation, no markdown
+fences, no preamble.
+
+Output format:
+{
+ "checklist": [
+ "Action item 1",
+ "Action item 2"
+ ]
+}`;
+
// Summary Generator Service
export class SummaryGeneratorService {
constructor() {}
/**
- * Generate both short overview and key points from full transcript
+ * Generate short overview, key points, and post-meeting checklist from full transcript
*/
async generate(
recordingId: number,
@@ -121,15 +153,17 @@ export class SummaryGeneratorService {
const transcript = this.formatTranscript(dbSegments);
const userPrompt = this.buildUserPrompt(transcript, context);
- // Generate both summaries in parallel
- const [shortOverview, keyPoints] = await Promise.all([
+ // Generate all summaries in parallel
+ const [shortOverview, keyPoints, postMeetingChecklist] = await Promise.all([
this.generateShortOverview(userPrompt),
this.generateKeyPoints(userPrompt),
+ this.generatePostMeetingChecklist(userPrompt),
]);
return {
shortOverview,
keyPoints,
+ postMeetingChecklist,
generatedAt: Date.now(),
};
}
@@ -178,6 +212,29 @@ export class SummaryGeneratorService {
return [];
}
+ /**
+ * Generate post-meeting checklist (action items)
+ */
+ private async generatePostMeetingChecklist(userPrompt: string): Promise<string[]> {
+ const llm = getLLMService();
+
+ try {
+ const response = await llm.complete(userPrompt, POST_MEETING_CHECKLIST_SYSTEM_PROMPT);
+
+ if (response.success && response.content) {
+ const parsed = this.parseChecklistResponse(response.content);
+ if (parsed) {
+ log.info({ itemCount: parsed.length }, 'Post-meeting checklist generated successfully');
+ return parsed;
+ }
+ }
+ } catch (error) {
+ log.error({ error }, 'Post-meeting checklist generation failed');
+ }
+
+ return [];
+ }
+
/**
* Parse key points JSON response
*/
@@ -206,6 +263,31 @@ export class SummaryGeneratorService {
return null;
}
+ /**
+ * Parse checklist JSON response
+ */
+ private parseChecklistResponse(content: string): string[] | null {
+ try {
+ // Remove markdown fences if present
+ let cleaned = content.trim();
+ if (cleaned.startsWith('```')) {
+ cleaned = cleaned.replace(/^```(?:json)?\s*\n?/, '').replace(/\n?```\s*$/, '');
+ }
+
+ const parsed = JSON.parse(cleaned);
+
+ // Handle both { checklist: [...] } and direct array
+ const checklist = parsed.checklist || parsed;
+
+ if (Array.isArray(checklist)) {
+ return checklist.filter((item: unknown) => typeof item === 'string' && item.trim().length > 0);
+ }
+ } catch (error) {
+ log.warn({ error, content: content.slice(0, 200) }, 'Failed to parse checklist JSON');
+ }
+ return null;
+ }
+
/**
* Build the user prompt with meeting context
*/
@@ -269,6 +351,7 @@ ${transcript}`;
return {
shortOverview: 'No transcript available to summarize.',
keyPoints: [],
+ postMeetingChecklist: [],
generatedAt: Date.now(),
};
}
diff --git a/src/main/services/live-assist.service.ts b/src/main/services/live-assist.service.ts
new file mode 100644
index 0000000..d18c389
--- /dev/null
+++ b/src/main/services/live-assist.service.ts
@@ -0,0 +1,246 @@
+/**
+ * Live Assist Service
+ *
+ * Runs every 20 seconds during recording, analyzes recent transcript,
+ * and generates contextual assists (questions, suggestions, actions)
+ * using an LLM.
+ */
+
+import { EventEmitter } from 'events';
+import { v4 as uuid } from 'uuid';
+import { logger } from '../lib/logger';
+import { getLLMService } from './llm.service';
+import type { LiveAssistItem, LiveAssistResponse } from '../../shared/types/live-assist.types';
+
+const log = logger.child({ module: 'live-assist' });
+
+const LIVE_ASSIST_INTERVAL_MS = 20000; // 20 seconds
+
+const SYSTEM_PROMPT = `You are a live meeting coach. You receive a rolling 20-second transcript from an ongoing meeting. Your job is to ALWAYS surface helpful nudges — questions to ask, things to say, actions to take.
+
+IMPORTANT: You MUST always return at least 1-2 assists for every transcript chunk. Never return an empty array. Find something helpful to suggest.
+
+---
+
+## WHAT TO SURFACE
+
+- A clarifying question worth asking
+- A way to respond to something said
+- A vague claim worth pinning down
+- A topic worth parking for later
+- A decision that should be captured
+- An opportunity to summarize or steer
+- A commitment someone made
+- Anything where a nudge would help
+
+Even simple observations are valuable. Always find something.
+
+---
+
+## OUTPUT FORMAT
+
+Return a JSON object with an "assists" array. Each item has:
+- "type": one of "ask", "speak", "act"
+- "urgency": one of "now", "soon", "later"
+- "text": the suggestion — short, ready to use
+- "reason": one short sentence explaining what you detected
+
+Example:
+{
+ "assists": [
+ {
+ "type": "ask",
+ "urgency": "now",
+ "text": "What specific metrics are behind that 15% number?",
+ "reason": "Speaker claimed 15% improvement without citing data."
+ }
+ ]
+}
+
+---
+
+## RULES
+
+- ALWAYS return 1-3 assists. Never return an empty array.
+- Every assist must connect to something in the transcript.
+- Write questions as ready-to-use first-person lines.
+- Only output the JSON, nothing else.`;
+
+interface TranscriptChunk {
+ text: string;
+ source: 'mic' | 'system_audio';
+ timestamp: number;
+}
+
+class LiveAssistService extends EventEmitter {
+ private intervalTimer: NodeJS.Timeout | null = null;
+ private isRunning = false;
+ private transcriptBuffer: TranscriptChunk[] = [];
+ private previousAssistTexts: Set<string> = new Set();
+ private lastProcessedTimestamp = 0;
+
+ /**
+ * Start the live assist loop
+ */
+ start(): void {
+ if (this.isRunning) {
+ log.warn('Live assist already running');
+ return;
+ }
+
+ log.info('Starting live assist service');
+ this.isRunning = true;
+ this.transcriptBuffer = [];
+ this.previousAssistTexts.clear();
+ this.lastProcessedTimestamp = Date.now();
+
+ // Run immediately, then every 20 seconds
+ this.processTranscript();
+ this.intervalTimer = setInterval(() => {
+ this.processTranscript();
+ }, LIVE_ASSIST_INTERVAL_MS);
+ }
+
+ /**
+ * Stop the live assist loop
+ */
+ stop(): void {
+ if (!this.isRunning) return;
+
+ log.info('Stopping live assist service');
+ this.isRunning = false;
+
+ if (this.intervalTimer) {
+ clearInterval(this.intervalTimer);
+ this.intervalTimer = null;
+ }
+
+ this.transcriptBuffer = [];
+ this.previousAssistTexts.clear();
+ }
+
+ /**
+ * Add a transcript segment to the buffer
+ */
+ addTranscript(text: string, source: 'mic' | 'system_audio'): void {
+ if (!this.isRunning) return;
+
+ this.transcriptBuffer.push({
+ text,
+ source,
+ timestamp: Date.now(),
+ });
+
+ // Keep only last 60 seconds of transcript for context
+ const cutoff = Date.now() - 60000;
+ this.transcriptBuffer = this.transcriptBuffer.filter(t => t.timestamp > cutoff);
+ }
+
+ /**
+ * Process transcript and generate assists
+ */
+ private async processTranscript(): Promise<void> {
+ if (!this.isRunning) return;
+
+ // Get transcript from last 20 seconds
+ const cutoff = Date.now() - LIVE_ASSIST_INTERVAL_MS;
+ const recentChunks = this.transcriptBuffer.filter(t => t.timestamp > cutoff);
+
+ if (recentChunks.length === 0) {
+ log.debug('No recent transcript to process');
+ return;
+ }
+
+ // Build transcript text with speaker labels
+ const transcriptText = recentChunks
+ .map(chunk => {
+ const speaker = chunk.source === 'mic' ? 'You' : 'Them';
+ return `[${speaker}]: ${chunk.text}`;
+ })
+ .join('\n');
+
+ log.info({ chunkCount: recentChunks.length, textLength: transcriptText.length }, 'Processing transcript for live assist');
+
+ try {
+ const llm = getLLMService();
+ const response = await llm.chatCompletionJSON<LiveAssistResponse>([
+ { role: 'system', content: SYSTEM_PROMPT },
+ { role: 'user', content: `Analyze this transcript chunk:\n\n${transcriptText}` },
+ ]);
+
+ if (!response.success || !response.data) {
+ log.warn({ error: response.error }, 'Failed to get live assist response');
+ return;
+ }
+
+ const { assists } = response.data;
+ log.debug({ response }, 'Response from live assist');
+ log.debug({ assists }, 'Assists generated for this chunk');
+
+ if (!assists || assists.length === 0) {
+ log.debug('No assists generated for this chunk');
+ return;
+ }
+
+ // Filter out duplicates from previous rounds
+ const newAssists: LiveAssistItem[] = assists
+ .filter(assist => !this.previousAssistTexts.has(assist.text.toLowerCase()))
+ .slice(0, 3) // Max 3 per round
+ .map(assist => ({
+ id: uuid(),
+ type: assist.type,
+ urgency: assist.urgency,
+ text: assist.text,
+ reason: assist.reason,
+ timestamp: Date.now(),
+ }));
+
+ // Track these assists to avoid repetition
+ newAssists.forEach(assist => {
+ this.previousAssistTexts.add(assist.text.toLowerCase());
+ });
+
+ // Keep previous assists set manageable (last 20)
+ if (this.previousAssistTexts.size > 20) {
+ const arr = Array.from(this.previousAssistTexts);
+ this.previousAssistTexts = new Set(arr.slice(-20));
+ }
+
+ if (newAssists.length > 0) {
+ log.info({ count: newAssists.length }, 'Generated new live assists');
+ this.emit('assists', { assists: newAssists, processedAt: Date.now() });
+ }
+ } catch (error) {
+ log.error({ error }, 'Error processing transcript for live assist');
+ }
+ }
+
+ /**
+ * Clear all state
+ */
+ clear(): void {
+ this.transcriptBuffer = [];
+ this.previousAssistTexts.clear();
+ }
+}
+
+// Singleton instance
+let instance: LiveAssistService | null = null;
+
+export function getLiveAssistService(): LiveAssistService {
+ if (!instance) {
+ instance = new LiveAssistService();
+ }
+ return instance;
+}
+
+export function resetLiveAssistService(): void {
+ if (instance) {
+ instance.stop();
+ instance.removeAllListeners();
+ instance = null;
+ }
+}
+
+export { LiveAssistService };
+export type { TranscriptChunk };
diff --git a/src/main/services/llm.service.ts b/src/main/services/llm.service.ts
index d91a3e4..8a86382 100644
--- a/src/main/services/llm.service.ts
+++ b/src/main/services/llm.service.ts
@@ -322,29 +322,6 @@ export class LLMService {
}
const startTime = Date.now();
- log.info({
- apiBase: this.config.apiBase,
- model: this.config.model,
- toolCount: tools.length,
- toolNames: tools.map(t => t.function.name),
- messageCount: messages.length,
- messageRoles: messages.map(m => m.role),
- }, 'LLM tool call request starting');
-
- // Debug: Log the full request payload
- log.debug({
- messages: messages.map(m => ({
- role: m.role,
- contentPreview: typeof m.content === 'string' ? m.content.slice(0, 200) : m.content,
- hasToolCalls: !!m.tool_calls,
- toolCallId: m.tool_call_id,
- })),
- tools: tools.map(t => ({
- name: t.function.name,
- description: t.function.description?.slice(0, 100),
- paramKeys: Object.keys(t.function.parameters.properties || {}),
- })),
- }, 'LLM tool call request payload');
try {
const formattedMessages = this.formatMessages(messages);
diff --git a/src/main/services/mcp-inference.service.ts b/src/main/services/mcp-inference.service.ts
new file mode 100644
index 0000000..d217f07
--- /dev/null
+++ b/src/main/services/mcp-inference.service.ts
@@ -0,0 +1,405 @@
+/**
+ * MCP Inference Service
+ *
+ * Runs every 20 seconds during recording, analyzes transcript,
+ * and calls MCP tools when the conversation warrants it.
+ * Outputs markdown findings to the MCP Findings panel.
+ */
+
+import { EventEmitter } from 'events';
+import { v4 as uuid } from 'uuid';
+import { logger } from '../lib/logger';
+import { getLLMService, type ChatMessage, type Tool, type ToolCall } from './llm.service';
+import { getToolAggregator } from './mcp/tool-aggregator.service';
+import { getConnectionOrchestrator } from './mcp/connection-orchestrator.service';
+import type { MCPTool, MCPDisplayResult } from '../../shared/types/mcp.types';
+
+const log = logger.child({ module: 'mcp-inference' });
+
+const MCP_INFERENCE_INTERVAL_MS = 20000; // 20 seconds
+const MAX_TOOL_CALLS_PER_RUN = 3;
+
+const SYSTEM_PROMPT = `You are a silent meeting assistant running in an agent loop. You receive a rolling 20-second transcript from an ongoing meeting. You have access to connected tools.
+
+Your only job: when the conversation creates an information need that your tools can answer — fetch it and present it. Otherwise, return nothing.
+
+---
+
+## WHAT TO LISTEN FOR
+
+**Active requests** — someone explicitly asks for information:
+"Can we pull up the deal status for Acme?"
+"What's on this week's plan?"
+"When did we last contact them?"
+→ Act immediately.
+
+**Passive requests** — the conversation implies a need:
+"I think the renewal is coming up soon" → your CRM can confirm the date.
+"Wasn't there a task for this?" → your project tool can search.
+→ Act if you have a matching tool and enough specifics to query.
+
+---
+
+## OUTPUT
+
+Clean markdown the user can glance at mid-meeting. Lead with the data. Add a suggested talking point only if natural. Keep it short.
+
+---
+
+## RULES
+
+- Never fabricate data. If a tool returns nothing, say so in one line.
+- Every tool call must tie to something said in the transcript.
+- Don't repeat a fetch already made this session unless explicitly asked again.
+- Don't summarize the meeting or narrate your reasoning.
+- If fetched data contains sensitive internals, flag it as not safe to share aloud.
+- Silence is your default. An empty response is correct.`;
+
+interface TranscriptChunk {
+ text: string;
+ source: 'mic' | 'system_audio';
+ timestamp: number;
+}
+
+export interface MCPInferenceEvents {
+ result: MCPDisplayResult;
+}
+
+class MCPInferenceService extends EventEmitter {
+ private intervalTimer: NodeJS.Timeout | null = null;
+ private isRunning = false;
+ private transcriptBuffer: TranscriptChunk[] = [];
+ private previousQueries: Set<string> = new Set(); // Track queries to avoid repetition
+ private conversationHistory: ChatMessage[] = [];
+
+ // Map short tool names to full serverId + toolName
+ private toolNameMap: Map<string, { serverId: string; toolName: string }> = new Map();
+
+ /**
+ * Start the MCP inference loop
+ */
+ start(): void {
+ if (this.isRunning) {
+ log.warn('MCP inference already running');
+ return;
+ }
+
+ log.info('Starting MCP inference service');
+ this.isRunning = true;
+ this.transcriptBuffer = [];
+ this.previousQueries.clear();
+ this.conversationHistory = [];
+
+ // Run every 20 seconds (don't run immediately - wait for transcript to accumulate)
+ this.intervalTimer = setInterval(() => {
+ this.processTranscript();
+ }, MCP_INFERENCE_INTERVAL_MS);
+ }
+
+ /**
+ * Stop the MCP inference loop
+ */
+ stop(): void {
+ if (!this.isRunning) return;
+
+ log.info('Stopping MCP inference service');
+ this.isRunning = false;
+
+ if (this.intervalTimer) {
+ clearInterval(this.intervalTimer);
+ this.intervalTimer = null;
+ }
+
+ this.transcriptBuffer = [];
+ this.previousQueries.clear();
+ this.conversationHistory = [];
+ }
+
+ /**
+ * Add a transcript segment to the buffer
+ */
+ addTranscript(text: string, source: 'mic' | 'system_audio'): void {
+ if (!this.isRunning) return;
+
+ this.transcriptBuffer.push({
+ text,
+ source,
+ timestamp: Date.now(),
+ });
+
+ // Keep only last 60 seconds of transcript for context
+ const cutoff = Date.now() - 60000;
+ this.transcriptBuffer = this.transcriptBuffer.filter(t => t.timestamp > cutoff);
+ }
+
+ /**
+ * Generate a short, unique tool name for OpenAI compatibility
+ */
+ private generateShortToolName(serverId: string, toolName: string, index: number): string {
+ const serverPrefix = serverId.replace(/^mcp-/, '').slice(0, 6);
+ const truncatedToolName = toolName.slice(0, 20);
+ const shortName = `s${serverPrefix}_${index}_${truncatedToolName}`;
+ return shortName.slice(0, 32);
+ }
+
+ /**
+ * Convert MCP tools to OpenAI function calling format
+ */
+ private mcpToolsToOpenAIFormat(mcpTools: MCPTool[]): Tool[] {
+ this.toolNameMap.clear();
+
+ return mcpTools.map((tool, index) => {
+ const shortName = this.generateShortToolName(tool.serverId, tool.name, index);
+
+ this.toolNameMap.set(shortName, {
+ serverId: tool.serverId,
+ toolName: tool.name,
+ });
+
+ return {
+ type: 'function' as const,
+ function: {
+ name: shortName,
+ description: tool.description || `Tool from ${tool.serverName}: ${tool.name}`,
+ parameters: this.convertInputSchema(tool.inputSchema),
+ },
+ };
+ });
+ }
+
+ /**
+ * Convert MCP input schema to OpenAI format
+ */
+ private convertInputSchema(inputSchema: MCPTool['inputSchema']): Tool['function']['parameters'] {
+ if (!inputSchema || typeof inputSchema !== 'object') {
+ return { type: 'object', properties: {} };
+ }
+
+ const schema = inputSchema as Record<string, unknown>;
+ return {
+ type: 'object',
+ properties: (schema.properties as Record<string, { type: string; description?: string; enum?: string[] }>) || {},
+ required: (schema.required as string[]) || undefined,
+ };
+ }
+
+ /**
+ * Execute a tool call
+ */
+ private async executeToolCall(toolCall: ToolCall): Promise<{
+ success: boolean;
+ output: unknown;
+ error?: string;
+ }> {
+ const mapping = this.toolNameMap.get(toolCall.function.name);
+ if (!mapping) {
+ return { success: false, output: null, error: 'Unknown tool' };
+ }
+
+ const { serverId, toolName } = mapping;
+ let input: Record<string, unknown> = {};
+
+ try {
+ input = JSON.parse(toolCall.function.arguments || '{}');
+ } catch {
+ log.warn({ arguments: toolCall.function.arguments }, 'Failed to parse tool arguments');
+ }
+
+ try {
+ const orchestrator = getConnectionOrchestrator();
+ const result = await orchestrator.executeTool(serverId, toolName, input);
+
+ // Track this query to avoid repetition
+ const queryKey = `${toolName}:${JSON.stringify(input)}`;
+ this.previousQueries.add(queryKey);
+
+ return {
+ success: result.status === 'success',
+ output: result.result,
+ error: result.error,
+ };
+ } catch (error) {
+ return {
+ success: false,
+ output: null,
+ error: error instanceof Error ? error.message : 'Unknown error',
+ };
+ }
+ }
+
+ /**
+ * Format transcript for the prompt
+ */
+ private formatTranscript(chunks: TranscriptChunk[]): string {
+ return chunks
+ .map(chunk => {
+ const speaker = chunk.source === 'mic' ? 'You' : 'Them';
+ return `[${speaker}]: ${chunk.text}`;
+ })
+ .join('\n');
+ }
+
+ /**
+ * Process transcript and run MCP agent
+ */
+ private async processTranscript(): Promise<void> {
+ if (!this.isRunning) return;
+
+ // Get transcript from last 20 seconds
+ const cutoff = Date.now() - MCP_INFERENCE_INTERVAL_MS;
+ const recentChunks = this.transcriptBuffer.filter(t => t.timestamp > cutoff);
+
+ if (recentChunks.length === 0) {
+ log.debug('No recent transcript to process for MCP inference');
+ return;
+ }
+
+ // Get available MCP tools
+ const toolAggregator = getToolAggregator();
+ const mcpTools = toolAggregator.getAllTools();
+
+ if (mcpTools.length === 0) {
+ log.debug('No MCP tools available');
+ return;
+ }
+
+ const llm = getLLMService();
+ if (!llm) {
+ log.warn('LLM service not available');
+ return;
+ }
+
+ const transcriptText = this.formatTranscript(recentChunks);
+ log.info({ chunkCount: recentChunks.length, toolCount: mcpTools.length }, 'Processing transcript for MCP inference');
+
+ // Convert tools to OpenAI format
+ const tools = this.mcpToolsToOpenAIFormat(mcpTools);
+
+ // Build the user message with transcript
+ const userMessage = `## TRANSCRIPT (Last 20 seconds)
+
+${transcriptText}
+
+---
+
+Analyze the transcript above. If there's an information need that your tools can answer, call the appropriate tool and provide the result. If nothing needs fetching, respond with an empty message.`;
+
+ // Build messages
+ const messages: ChatMessage[] = [
+ { role: 'system', content: SYSTEM_PROMPT },
+ ...this.conversationHistory,
+ { role: 'user', content: userMessage },
+ ];
+
+ try {
+ let toolsCalled = 0;
+ let finalResponse: string | null = null;
+
+ // Agentic loop
+ while (toolsCalled < MAX_TOOL_CALLS_PER_RUN) {
+ const response = await llm.chatCompletionWithTools(messages, tools);
+
+ if (!response.success) {
+ log.warn({ error: response.error }, 'LLM call failed');
+ break;
+ }
+
+ // Check for tool calls
+ if (response.tool_calls && response.tool_calls.length > 0) {
+ // Add assistant message with tool calls
+ messages.push({
+ role: 'assistant',
+ content: response.content,
+ tool_calls: response.tool_calls,
+ });
+
+ // Execute tool calls
+ for (const toolCall of response.tool_calls) {
+ toolsCalled++;
+
+ const result = await this.executeToolCall(toolCall);
+
+ // Add tool result
+ messages.push({
+ role: 'tool',
+ tool_call_id: toolCall.id,
+ content: result.success
+ ? JSON.stringify(result.output, null, 2)
+ : `Error: ${result.error}`,
+ });
+ }
+
+ // Continue loop to get final response
+ continue;
+ }
+
+ // No tool calls - got final response
+ finalResponse = response.content || null;
+ break;
+ }
+
+ // If we got a non-empty response, emit it
+ if (finalResponse && finalResponse.trim().length > 0) {
+ // Add to conversation history for context
+ this.conversationHistory.push({ role: 'user', content: userMessage });
+ this.conversationHistory.push({ role: 'assistant', content: finalResponse });
+
+ // Keep history manageable
+ if (this.conversationHistory.length > 10) {
+ this.conversationHistory = this.conversationHistory.slice(-10);
+ }
+
+ // Emit as MCPDisplayResult
+ const displayResult: MCPDisplayResult = {
+ id: uuid(),
+ toolCallId: uuid(),
+ serverId: 'mcp-inference',
+ serverName: 'MCP Agent',
+ toolName: 'inference',
+ displayType: 'panel',
+ title: 'MCP Findings',
+ content: {
+ markdown: finalResponse,
+ },
+ timestamp: new Date().toISOString(),
+ };
+
+ log.info({ responseLength: finalResponse.length }, 'Generated MCP inference result');
+ this.emit('result', displayResult);
+ } else {
+ log.debug('MCP agent returned empty response (no action needed)');
+ }
+ } catch (error) {
+ log.error({ error }, 'Error in MCP inference');
+ }
+ }
+
+ /**
+ * Clear all state
+ */
+ clear(): void {
+ this.transcriptBuffer = [];
+ this.previousQueries.clear();
+ this.conversationHistory = [];
+ }
+}
+
+// Singleton instance
+let instance: MCPInferenceService | null = null;
+
+export function getMCPInferenceService(): MCPInferenceService {
+ if (!instance) {
+ instance = new MCPInferenceService();
+ }
+ return instance;
+}
+
+export function resetMCPInferenceService(): void {
+ if (instance) {
+ instance.stop();
+ instance.removeAllListeners();
+ instance = null;
+ }
+}
+
+export { MCPInferenceService };
diff --git a/src/main/services/meeting-setup.prompts.ts b/src/main/services/meeting-setup.prompts.ts
index 824be43..985e2d3 100644
--- a/src/main/services/meeting-setup.prompts.ts
+++ b/src/main/services/meeting-setup.prompts.ts
@@ -10,12 +10,7 @@ goals, concerns, and success criteria for an upcoming meeting.
Rules:
- Generate exactly 3 questions. No more, no less.
- Each question must have exactly 4 options.
-- Each question must have exactly 4 options as plain strings.
-- Each question must specify a "type": either "multi-choice" (user picks
- one or more) or "single-choice" (user picks exactly one). Use your
- judgment - if only one answer makes sense, use single-choice.
-- Include an empty "answer" field in every question (the app fills it in
- later - for multi-choice, answers will be comma-separated).
+- All questions are multi-choice - users can select one or more options.
- Questions should dig into: (a) what a successful outcome looks like,
(b) what risks or blockers exist, and (c) what specific deliverables
or decisions are expected.
@@ -25,8 +20,10 @@ Rules:
platitudes. Derive them from the name and description provided.
- Keep question text under 15 words. Keep each option under 12 words.
-You will receive the meeting name and description. Respond ONLY with the
-JSON object below - no explanation, no markdown fences, no preamble.`;
+You will receive the meeting name and description. Respond ONLY with
+valid JSON in this exact format - no explanation, no markdown fences:
+
+{"questions":[{"question":"...","options":["...","...","...","..."]}]}`;
export function buildProbingQuestionsUserPrompt(name: string, description: string): string {
return `Meeting Name: ${name}
@@ -58,14 +55,14 @@ no explanation, no markdown fences, no preamble.`;
export function buildChecklistUserPrompt(
name: string,
description: string,
- questions: Array<{ question: string; type: string; answer: string; customAnswer?: string }>
+ questions: Array<{ question: string; answer: string; customAnswer?: string }>
): string {
const questionsText = questions
.map((q) => {
const answerPart = q.customAnswer
? `${q.answer}${q.answer ? ', ' : ''}Other: ${q.customAnswer}`
: q.answer;
- return `Q: ${q.question} (${q.type})\nAnswer: ${answerPart}`;
+ return `Q: ${q.question}\nSelected: ${answerPart}`;
})
.join('\n\n');
diff --git a/src/main/services/meeting-setup.service.ts b/src/main/services/meeting-setup.service.ts
index 4dcfe50..80c5ffe 100644
--- a/src/main/services/meeting-setup.service.ts
+++ b/src/main/services/meeting-setup.service.ts
@@ -46,10 +46,9 @@ export class MeetingSetupService {
};
}
- // Ensure questions have the correct structure
+ // Map response to ProbingQuestion format
const questions: ProbingQuestion[] = response.data.questions.map((q) => ({
question: q.question,
- type: q.type,
options: q.options,
answer: '',
customAnswer: undefined,
diff --git a/src/main/services/tray.service.ts b/src/main/services/tray.service.ts
index 8dbc590..2481ff3 100644
--- a/src/main/services/tray.service.ts
+++ b/src/main/services/tray.service.ts
@@ -31,11 +31,9 @@ class TrayService {
try {
icon = nativeImage.createFromPath(iconPath);
- // Resize for tray (16x16 on most platforms, template on macOS)
+ // Resize for tray (16x16 on most platforms)
+ // Don't set as template - using colored VideoDB logo
icon = icon.resize({ width: 16, height: 16 });
- if (process.platform === 'darwin') {
- icon.setTemplateImage(true);
- }
} catch (error) {
log.warn({ error }, 'Failed to load tray icon, using empty');
icon = nativeImage.createEmpty();
@@ -77,10 +75,10 @@ class TrayService {
private getIconPath(): string {
// In packaged app, icons are in resources/
if (app.isPackaged) {
- return path.join(process.resourcesPath, 'resources', 'logo.jpeg');
+ return path.join(process.resourcesPath, 'resources', 'icon.png');
}
// In development, look in resources/
- return path.join(app.getAppPath(), 'resources', 'logo.jpeg');
+ return path.join(app.getAppPath(), 'resources', 'icon.png');
}
/**
diff --git a/src/main/services/workflow-webhook.service.ts b/src/main/services/workflow-webhook.service.ts
new file mode 100644
index 0000000..8414345
--- /dev/null
+++ b/src/main/services/workflow-webhook.service.ts
@@ -0,0 +1,222 @@
+/**
+ * Workflow Webhook Service
+ *
+ * Calls configured workflow webhooks after meeting completion.
+ * Sends meeting data (video ID, summary, checklist, player URL, etc.) to
+ * automation platforms like n8n and Zapier.
+ */
+
+import { v4 as uuid } from 'uuid';
+import { createChildLogger } from '../lib/logger';
+import { getEnabledWorkflows } from '../db';
+import type {
+ WorkflowWebhookPayload,
+ WorkflowWebhookResult,
+} from '../../shared/types/workflow.types';
+
+const logger = createChildLogger('workflow-webhook');
+
+const WEBHOOK_TIMEOUT_MS = 30000; // 30 seconds
+
+export interface MeetingCompletionData {
+ recordingId: number;
+ title: string;
+ description?: string;
+ startedAt: string;
+ endedAt: string;
+ durationSeconds: number;
+ exportedVideoId: string;
+ playerUrl: string;
+ streamId?: string;
+ summary?: string;
+ topics?: string[];
+ actionItems?: string[];
+ checklist?: Array<{ text: string; completed: boolean }>;
+ transcript?: Array<{ speaker: 'me' | 'them'; text: string; timestamp: number }>;
+}
+
+/**
+ * Trigger all enabled workflow webhooks with meeting data
+ */
+export async function triggerWorkflowWebhooks(
+ meetingData: MeetingCompletionData
+): Promise<WorkflowWebhookResult[]> {
+ const workflows = getEnabledWorkflows();
+
+ if (workflows.length === 0) {
+ logger.debug('No enabled workflows to trigger');
+ return [];
+ }
+
+ logger.info(
+ { workflowCount: workflows.length, recordingId: meetingData.recordingId },
+ 'Triggering workflow webhooks'
+ );
+
+ const payload: WorkflowWebhookPayload = {
+ callId: uuid(),
+ triggeredAt: new Date().toISOString(),
+ meeting: {
+ recordingId: meetingData.recordingId,
+ title: meetingData.title,
+ description: meetingData.description,
+ startedAt: meetingData.startedAt,
+ endedAt: meetingData.endedAt,
+ durationSeconds: meetingData.durationSeconds,
+ },
+ videodb: {
+ exportedVideoId: meetingData.exportedVideoId,
+ playerUrl: meetingData.playerUrl,
+ streamId: meetingData.streamId,
+ },
+ content: {
+ summary: meetingData.summary,
+ topics: meetingData.topics,
+ actionItems: meetingData.actionItems,
+ checklist: meetingData.checklist,
+ },
+ transcript: meetingData.transcript,
+ };
+
+ const results = await Promise.all(
+ workflows.map((workflow) => callWebhook(workflow.id, workflow.name, workflow.webhookUrl, payload))
+ );
+
+ const successCount = results.filter((r) => r.success).length;
+ const failCount = results.filter((r) => !r.success).length;
+
+ logger.info(
+ { successCount, failCount, total: workflows.length },
+ 'Workflow webhooks completed'
+ );
+
+ return results;
+}
+
+/**
+ * Call a single webhook endpoint
+ */
+async function callWebhook(
+ workflowId: string,
+ workflowName: string,
+ webhookUrl: string,
+ payload: WorkflowWebhookPayload
+): Promise<WorkflowWebhookResult> {
+ const startTime = Date.now();
+
+ try {
+ logger.debug({ workflowId, workflowName, url: webhookUrl }, 'Calling webhook');
+
+ const controller = new AbortController();
+ const timeoutId = setTimeout(() => controller.abort(), WEBHOOK_TIMEOUT_MS);
+
+ const response = await fetch(webhookUrl, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'User-Agent': 'MeetingCopilot/1.0',
+ 'X-Workflow-Call-Id': payload.callId,
+ },
+ body: JSON.stringify(payload),
+ signal: controller.signal,
+ });
+
+ clearTimeout(timeoutId);
+
+ const responseTime = Date.now() - startTime;
+
+ if (!response.ok) {
+ logger.warn(
+ { workflowId, workflowName, status: response.status, responseTime },
+ 'Webhook returned non-OK status'
+ );
+ return {
+ workflowId,
+ workflowName,
+ success: false,
+ statusCode: response.status,
+ error: `HTTP ${response.status}: ${response.statusText}`,
+ responseTime,
+ };
+ }
+
+ logger.info(
+ { workflowId, workflowName, status: response.status, responseTime },
+ 'Webhook call successful'
+ );
+
+ return {
+ workflowId,
+ workflowName,
+ success: true,
+ statusCode: response.status,
+ responseTime,
+ };
+ } catch (error) {
+ const responseTime = Date.now() - startTime;
+ const err = error as Error;
+
+ if (err.name === 'AbortError') {
+ logger.error({ workflowId, workflowName, responseTime }, 'Webhook call timed out');
+ return {
+ workflowId,
+ workflowName,
+ success: false,
+ error: 'Request timed out',
+ responseTime,
+ };
+ }
+
+ logger.error(
+ { workflowId, workflowName, error: err.message, responseTime },
+ 'Webhook call failed'
+ );
+
+ return {
+ workflowId,
+ workflowName,
+ success: false,
+ error: err.message,
+ responseTime,
+ };
+ }
+}
+
+/**
+ * Test a webhook URL by sending a test payload
+ */
+export async function testWorkflowWebhook(
+ webhookUrl: string
+): Promise<{ success: boolean; statusCode?: number; error?: string; responseTime?: number }> {
+ const testPayload: WorkflowWebhookPayload = {
+ callId: uuid(),
+ triggeredAt: new Date().toISOString(),
+ meeting: {
+ recordingId: 0,
+ title: 'Test Meeting',
+ description: 'This is a test webhook call from Meeting Copilot',
+ startedAt: new Date().toISOString(),
+ endedAt: new Date().toISOString(),
+ durationSeconds: 0,
+ },
+ videodb: {
+ exportedVideoId: 'test-video-id',
+ playerUrl: 'https://example.com/player/test',
+ },
+ content: {
+ summary: 'This is a test webhook call to verify your workflow integration.',
+ topics: ['Test Topic'],
+ actionItems: ['Verify webhook integration'],
+ checklist: [{ text: 'Test checklist item', completed: false }],
+ },
+ };
+
+ const result = await callWebhook('test', 'Test', webhookUrl, testPayload);
+
+ return {
+ success: result.success,
+ statusCode: result.statusCode,
+ error: result.error,
+ responseTime: result.responseTime,
+ };
+}
diff --git a/src/preload/index.ts b/src/preload/index.ts
index ee6fe7f..d5771b6 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -219,6 +219,25 @@ export interface MCPOAuthConfig {
redirectUri?: string;
}
+// Workflow Types
+export interface Workflow {
+ id: string;
+ name: string;
+ webhookUrl: string;
+ enabled: boolean;
+ createdAt: string;
+ updatedAt: string;
+}
+
+export interface WorkflowApi {
+ getAll: () => Promise<{ success: boolean; workflows?: Workflow[]; error?: string }>;
+ get: (id: string) => Promise<{ success: boolean; workflow?: Workflow; error?: string }>;
+ create: (request: { name: string; webhookUrl: string; enabled?: boolean }) => Promise<{ success: boolean; workflow?: Workflow; error?: string }>;
+ update: (id: string, request: { name?: string; webhookUrl?: string; enabled?: boolean }) => Promise<{ success: boolean; workflow?: Workflow; error?: string }>;
+ delete: (id: string) => Promise<{ success: boolean; error?: string }>;
+ test: (webhookUrl: string) => Promise<{ success: boolean; statusCode?: number; error?: string; responseTime?: number }>;
+}
+
export interface MCPApi {
// Server management
getServers: () => Promise<{ success: boolean; servers?: MCPServerConfig[]; connectionStates?: Record<string, { status: string; error?: string }>; error?: string }>;
@@ -302,6 +321,22 @@ const api: IpcApi = {
ipcRenderer.invoke('recorder-list-channels', sessionToken, apiUrl),
},
+ liveAssist: {
+ start: () => ipcRenderer.invoke('live-assist:start'),
+ stop: () => ipcRenderer.invoke('live-assist:stop'),
+ addTranscript: (text: string, source: 'mic' | 'system_audio') =>
+ ipcRenderer.invoke('live-assist:add-transcript', text, source),
+ clear: () => ipcRenderer.invoke('live-assist:clear'),
+ },
+
+ liveAssistOn: {
+ onUpdate: (callback: (data: { assists: any[]; processedAt: number }) => void) => {
+ const listener = (_event: Electron.IpcRendererEvent, data: any) => callback(data);
+ ipcRenderer.on('live-assist:update', listener);
+ return () => ipcRenderer.removeListener('live-assist:update', listener);
+ },
+ },
+
permissions: {
checkMicPermission: () => ipcRenderer.invoke('check-mic-permission'),
checkScreenPermission: () => ipcRenderer.invoke('check-screen-permission'),
@@ -520,6 +555,18 @@ const api: IpcApi = {
return () => ipcRenderer.removeListener('calendar:events-updated', listener);
},
} as CalendarEvents,
+
+ // Workflows API
+ workflows: {
+ getAll: () => ipcRenderer.invoke('workflows:get-all'),
+ get: (id: string) => ipcRenderer.invoke('workflows:get', id),
+ create: (request: { name: string; webhookUrl: string; enabled?: boolean }) =>
+ ipcRenderer.invoke('workflows:create', request),
+ update: (id: string, request: { name?: string; webhookUrl?: string; enabled?: boolean }) =>
+ ipcRenderer.invoke('workflows:update', id, request),
+ delete: (id: string) => ipcRenderer.invoke('workflows:delete', id),
+ test: (webhookUrl: string) => ipcRenderer.invoke('workflows:test', webhookUrl),
+ } as WorkflowApi,
};
contextBridge.exposeInMainWorld('electronAPI', api);
@@ -534,6 +581,7 @@ declare global {
mcpOn: MCPEvents;
calendar: CalendarApi;
calendarOn: CalendarEvents;
+ workflows: WorkflowApi;
};
}
}
diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx
index 640fe48..8b083ca 100644
--- a/src/renderer/App.tsx
+++ b/src/renderer/App.tsx
@@ -11,8 +11,6 @@ import { useSessionStore } from './stores/session.store';
import { usePermissions } from './hooks/usePermissions';
import { useGlobalRecorderEvents } from './hooks/useGlobalRecorderEvents';
import { useCopilot } from './hooks/useCopilot';
-import { Card, CardContent, CardHeader, CardTitle } from './components/ui/card';
-import { Button } from './components/ui/button';
import { ErrorToast } from './components/ui/error-toast';
import { AlertCircle, Loader2 } from 'lucide-react';
import {
@@ -23,6 +21,7 @@ import { useCopilotStore } from './stores/copilot.store';
import { useMeetingSetupStore } from './stores/meeting-setup.store';
import { MCPServersPanel } from './components/settings/MCPServersPanel';
import { CalendarPanel } from './components/settings/CalendarPanel';
+import { WorkflowsPanel } from './components/settings/WorkflowsPanel';
import { CalendarAuthBanner } from './components/calendar';
import { MeetingSetupFlow } from './components/meeting-setup';
import { StepIndicators } from './components/auth/AuthView';
@@ -226,14 +225,20 @@ function RecordingView({ onBack }: RecordingViewProps) {
<div className="flex-1 overflow-hidden p-6">
<div className="max-w-4xl mx-auto h-full flex flex-col">
<div className="flex items-center justify-between mb-4 shrink-0">
- <h2 className="text-lg font-semibold">Call Complete</h2>
- <div className="flex gap-2">
- <Button variant="outline" size="sm" onClick={handleGoBack}>
+ <h2 className="text-[18px] font-semibold text-[#141420]">Call Complete</h2>
+ <div className="flex gap-[8px]">
+ <button
+ onClick={handleGoBack}
+ className="px-[14px] py-[8px] border border-[#ededf3] rounded-[10px] text-[13px] font-medium text-[#464646] hover:bg-[#f7f7f7] transition-colors"
+ >
Back to Home
- </Button>
- <Button variant="outline" size="sm" onClick={handleStartNewCall}>
+ </button>
+ <button
+ onClick={handleStartNewCall}
+ className="px-[14px] py-[8px] bg-[#ec5b16] hover:bg-[#d9520f] rounded-[10px] text-[13px] font-medium text-white transition-colors"
+ >
Start New Call
- </Button>
+ </button>
</div>
</div>
<div className="flex-1 min-h-0 overflow-auto">
@@ -296,7 +301,7 @@ function RecordingView({ onBack }: RecordingViewProps) {
{hasChecklist && <MeetingAgendaPanel checklist={checklist} />}
{/* Live Assist Panel */}
- <LiveAssistPanel insights={insights} mcpFindings={mcpFindings} />
+ <LiveAssistPanel />
</div>
</div>
</div>
@@ -306,7 +311,7 @@ function RecordingView({ onBack }: RecordingViewProps) {
function SettingsView() {
const [activeSettingsTab, setActiveSettingsTab] = useState<
- 'account' | 'calendar' | 'mcpServers'
+ 'account' | 'calendar' | 'mcpServers' | 'workflows'
>('account');
const configStore = useConfigStore();
@@ -314,66 +319,78 @@ function SettingsView() {
{ id: 'account' as const, label: 'Account' },
{ id: 'calendar' as const, label: 'Calendar' },
{ id: 'mcpServers' as const, label: 'MCP Servers' },
+ { id: 'workflows' as const, label: 'Workflows' },
];
return (
- <div className="space-y-4 h-full overflow-auto">
- {/* Settings Tabs */}
- <div className="flex gap-1 p-1 bg-muted rounded-lg w-fit">
- {settingsTabs.map((tab) => (
- <Button
- key={tab.id}
- variant={activeSettingsTab === tab.id ? 'default' : 'ghost'}
- size="sm"
- onClick={() => setActiveSettingsTab(tab.id)}
- >
- {tab.label}
- </Button>
- ))}
- </div>
+ <div className="h-full overflow-auto bg-[#f7f7f7] p-[24px]">
+ <div className="max-w-[720px] mx-auto">
+ {/* Settings Tabs */}
+ <div className="flex gap-[4px] p-[4px] bg-white border border-[#ededf3] rounded-[12px] w-fit mb-[24px]">
+ {settingsTabs.map((tab) => (
+ <button
+ key={tab.id}
+ onClick={() => setActiveSettingsTab(tab.id)}
+ className={`px-[16px] py-[8px] text-[14px] font-medium rounded-[8px] transition-colors ${
+ activeSettingsTab === tab.id
+ ? 'bg-[#ec5b16] text-white'
+ : 'text-[#464646] hover:bg-[#f7f7f7]'
+ }`}
+ >
+ {tab.label}
+ </button>
+ ))}
+ </div>
- {/* Tab Content */}
- <div className="max-w-4xl">
- {activeSettingsTab === 'account' && (
- <div className="max-w-md space-y-4">
- <Card>
- <CardHeader>
- <CardTitle>Account</CardTitle>
- </CardHeader>
- <CardContent className="space-y-2">
- <div>
- <p className="text-sm text-muted-foreground">Name</p>
- <p className="font-medium">{configStore.userName || 'Not set'}</p>
+ {/* Tab Content */}
+ <div className="space-y-[16px]">
+ {activeSettingsTab === 'account' && (
+ <div className="space-y-[16px]">
+ {/* Account Card */}
+ <div className="bg-white border border-[#ededf3] rounded-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)]">
+ <div className="px-[20px] py-[16px] border-b border-[#ededf3]">
+ <h3 className="text-[16px] font-semibold text-[#141420]">Account</h3>
</div>
- <div>
- <p className="text-sm text-muted-foreground">API Key</p>
- <p className="font-mono text-xs">
- {configStore.apiKey ? `${configStore.apiKey.slice(0, 8)}...` : 'Not set'}
+ <div className="px-[20px] py-[16px] space-y-[16px]">
+ <div>
+ <p className="text-[13px] text-[#969696] mb-[4px]">Name</p>
+ <p className="text-[14px] font-medium text-[#141420]">
+ {configStore.userName || 'Not set'}
+ </p>
+ </div>
+ <div>
+ <p className="text-[13px] text-[#969696] mb-[4px]">API Key</p>
+ <p className="text-[13px] font-mono text-[#464646]">
+ {configStore.apiKey ? `${configStore.apiKey.slice(0, 8)}...` : 'Not set'}
+ </p>
+ </div>
+ </div>
+ </div>
+
+ {/* About Card */}
+ <div className="bg-white border border-[#ededf3] rounded-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)]">
+ <div className="px-[20px] py-[16px] border-b border-[#ededf3]">
+ <h3 className="text-[16px] font-semibold text-[#141420]">About</h3>
+ </div>
+ <div className="px-[20px] py-[16px] space-y-[8px]">
+ <p className="text-[14px] text-[#464646] leading-[20px]">
+ Meeting Copilot is a desktop app for recording meetings with real-time
+ transcription and AI-powered insights.
+ </p>
+ <p className="text-[13px] text-[#969696]">
+ Built with Electron, React, and VideoDB.
</p>
</div>
- </CardContent>
- </Card>
-
- <Card>
- <CardHeader>
- <CardTitle>About</CardTitle>
- </CardHeader>
- <CardContent className="space-y-2">
- <p className="text-sm text-muted-foreground">
- Meeting Copilot is a desktop app for recording meetings with real-time
- transcription and AI-powered insights.
- </p>
- <p className="text-xs text-muted-foreground">
- Built with Electron, React, and VideoDB.
- </p>
- </CardContent>
- </Card>
- </div>
- )}
+ </div>
+ </div>
+ )}
+
+ {activeSettingsTab === 'calendar' && <CalendarPanel />}
- {activeSettingsTab === 'calendar' && <CalendarPanel />}
+ {activeSettingsTab === 'mcpServers' && <MCPServersPanel />}
- {activeSettingsTab === 'mcpServers' && <MCPServersPanel />}
+ {activeSettingsTab === 'workflows' && <WorkflowsPanel />}
+ </div>
</div>
</div>
);
diff --git a/src/renderer/components/history/RecordingDetailPage.tsx b/src/renderer/components/history/RecordingDetailPage.tsx
index ad9fcc0..176c715 100644
--- a/src/renderer/components/history/RecordingDetailPage.tsx
+++ b/src/renderer/components/history/RecordingDetailPage.tsx
@@ -137,8 +137,8 @@ export function RecordingDetailPage({ recordingId, onBack }: RecordingDetailPage
onToggle={() => setShowAllKeyPoints(!showAllKeyPoints)}
/>
- {/* Checklist Card */}
- <ChecklistCard checklist={recording.meetingChecklist} />
+ {/* Action Items Card (Post-Meeting Checklist) */}
+ <ActionItemsCard checklist={recording.postMeetingChecklist} />
</div>
</div>
@@ -440,20 +440,20 @@ function KeyPointsCard({ keyPoints, expanded, onToggle }: KeyPointsCardProps) {
);
}
-interface ChecklistCardProps {
+interface ActionItemsCardProps {
checklist: string[] | null | undefined;
}
-function ChecklistCard({ checklist }: ChecklistCardProps) {
+function ActionItemsCard({ checklist }: ActionItemsCardProps) {
if (!checklist || checklist.length === 0) return null;
return (
<div className="bg-[#f7f7f7] border border-[#efefef] rounded-[16px] p-[20px] flex flex-col gap-[16px]">
{/* Header */}
<div className="flex items-center gap-[8px]">
- <CheckSquare className="h-5 w-5 text-[#464646]" />
+ <CheckSquare className="h-5 w-5 text-[#ec5b16]" />
<h3 className="text-[16px] font-medium text-black tracking-[0.08px]">
- Follow Up
+ Action Items
</h3>
</div>
@@ -462,13 +462,13 @@ function ChecklistCard({ checklist }: ChecklistCardProps) {
{checklist.map((item, idx) => (
<div
key={idx}
- className="bg-white border border-[#efefef] rounded-[8px] px-[16px] py-[8px] flex items-center gap-[16px]"
+ className="bg-white border border-[#efefef] rounded-[8px] px-[16px] py-[12px] flex items-start gap-[12px]"
>
{/* Checkbox */}
- <div className="w-4 h-4 shrink-0 rounded border border-[#969696] flex items-center justify-center">
+ <div className="w-4 h-4 shrink-0 rounded border border-[#ec5b16] flex items-center justify-center mt-[2px]">
{/* Unchecked by default */}
</div>
- <span className="text-[14px] text-black leading-[24px] tracking-[0.07px]">
+ <span className="text-[14px] text-black leading-[20px] tracking-[0.07px]">
{item}
</span>
</div>
diff --git a/src/renderer/components/history/RecordingDetailsModal.tsx b/src/renderer/components/history/RecordingDetailsModal.tsx
index df0cba2..176d266 100644
--- a/src/renderer/components/history/RecordingDetailsModal.tsx
+++ b/src/renderer/components/history/RecordingDetailsModal.tsx
@@ -215,17 +215,17 @@ export function RecordingDetailsModal({
</CollapsibleSection>
)}
- {/* Meeting Checklist */}
- {recording.meetingChecklist && recording.meetingChecklist.length > 0 && (
+ {/* Action Items (Post-Meeting Checklist) */}
+ {recording.postMeetingChecklist && recording.postMeetingChecklist.length > 0 && (
<CollapsibleSection
- title="Meeting Checklist"
+ title="Action Items"
icon={<ClipboardList className="h-4 w-4" />}
- badge={`${recording.meetingChecklist.length} items`}
+ badge={`${recording.postMeetingChecklist.length} items`}
>
<ul className="space-y-2 pt-2">
- {recording.meetingChecklist.map((item, idx) => (
+ {recording.postMeetingChecklist.map((item, idx) => (
<li key={idx} className="flex items-start gap-2 text-sm">
- <div className="w-4 h-4 rounded border border-muted-foreground/40 flex-shrink-0 mt-0.5" />
+ <div className="w-4 h-4 rounded border border-primary/60 flex-shrink-0 mt-0.5" />
<span>{item}</span>
</li>
))}
diff --git a/src/renderer/components/home/HomeView.tsx b/src/renderer/components/home/HomeView.tsx
index 0d47191..b1c75dd 100644
--- a/src/renderer/components/home/HomeView.tsx
+++ b/src/renderer/components/home/HomeView.tsx
@@ -164,6 +164,26 @@ function EmptyMCPIcon() {
);
}
+function WorkflowIcon() {
+ return (
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M3 7h4v6H3V7zM13 7h4v6h-4V7z" stroke="black" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" />
+ <path d="M7 10h2M11 10h2" stroke="black" strokeWidth="1.25" strokeLinecap="round" />
+ <circle cx="10" cy="10" r="1.5" stroke="black" strokeWidth="1.25" />
+ </svg>
+ );
+}
+
+function EmptyWorkflowIcon() {
+ return (
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M5 11h6v10H5V11zM21 11h6v10h-6V11z" stroke="#969696" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
+ <path d="M11 16h3M18 16h3" stroke="#969696" strokeWidth="1.5" strokeLinecap="round" />
+ <circle cx="16" cy="16" r="2.5" stroke="#969696" strokeWidth="1.5" />
+ </svg>
+ );
+}
+
function GoogleIcon() {
return (
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -309,17 +329,58 @@ function MCPServerItem({
);
}
+// Workflow Item Component
+function WorkflowItem({
+ workflow,
+ onEdit,
+}: {
+ workflow: { id: string; name: string; enabled: boolean };
+ onEdit: () => void;
+}) {
+ return (
+ <div className="bg-white border border-[#ededf3] rounded-[10px] px-[15px] py-[13px]">
+ <div className="flex items-center gap-[12px]">
+ <div className="w-[20px] h-[20px] flex items-center justify-center">
+ <WorkflowIcon />
+ </div>
+ <div className="flex-1 flex flex-col gap-[2px]">
+ <p className="text-[14px] font-medium text-black tracking-[0.07px]">{workflow.name}</p>
+ <p className="text-[12px] text-[#969696]">
+ {workflow.enabled ? 'Active' : 'Disabled'}
+ </p>
+ </div>
+ <button
+ onClick={onEdit}
+ className="w-[24px] h-[24px] flex items-center justify-center hover:bg-[#f7f7f7] rounded-[6px] transition-colors"
+ >
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M10.5 1.75L12.25 3.5M1.75 12.25L2.333 9.833L10.083 2.083L11.917 3.917L4.167 11.667L1.75 12.25Z" stroke="#969696" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" />
+ </svg>
+ </button>
+ </div>
+ </div>
+ );
+}
+
interface HomeViewProps {
onStartRecording: () => void;
onNavigateToHistory: () => void;
onNavigateToSettings: () => void;
}
+interface WorkflowData {
+ id: string;
+ name: string;
+ webhookUrl: string;
+ enabled: boolean;
+}
+
export function HomeView({ onStartRecording, onNavigateToHistory, onNavigateToSettings }: HomeViewProps) {
const [selectedRecordingId, setSelectedRecordingId] = useState<number | null>(null);
const [calendarStatus, setCalendarStatus] = useState<'disconnected' | 'connected' | 'loading'>('loading');
const [upcomingEvents, setUpcomingEvents] = useState<UpcomingMeeting[]>([]);
const [eventNotifications, setEventNotifications] = useState<Record<string, boolean>>({});
+ const [workflows, setWorkflows] = useState<WorkflowData[]>([]);
// Session state for stream toggles
const sessionStore = useSessionStore();
@@ -397,6 +458,21 @@ export function HomeView({ onStartRecording, onNavigateToHistory, onNavigateToSe
return () => unsubscribe();
}, []);
+ // Load workflows
+ useEffect(() => {
+ const loadWorkflows = async () => {
+ try {
+ const result = await window.electronAPI.workflows.getAll();
+ if (result.success && result.workflows) {
+ setWorkflows(result.workflows);
+ }
+ } catch {
+ // Ignore errors
+ }
+ };
+ loadWorkflows();
+ }, []);
+
const handleConnectCalendar = async () => {
try {
const result = await window.electronAPI.calendar.signIn();
@@ -652,6 +728,54 @@ export function HomeView({ onStartRecording, onNavigateToHistory, onNavigateToSe
</div>
)}
</div>
+
+ {/* Workflows Section */}
+ <div className="bg-white border border-[#efefef] rounded-[16px] p-[16px] flex flex-col gap-[20px]">
+ {/* Header */}
+ <div className="flex items-center gap-[4px]">
+ <WorkflowIcon />
+ <span className="flex-1 text-[18px] font-medium text-black">Workflows</span>
+ <button
+ onClick={onNavigateToSettings}
+ className="flex items-center gap-[4px] text-[14px] font-medium text-[#ec5b16] hover:opacity-80"
+ >
+ <span className="text-[14px]">+</span>
+ Add
+ </button>
+ </div>
+
+ {/* Content */}
+ {workflows.length === 0 ? (
+ <div className="flex flex-col items-center gap-[16px] px-[8px] py-[16px]">
+ <EmptyWorkflowIcon />
+ <div className="flex flex-col items-center gap-[8px]">
+ <p className="text-[16px] font-medium text-black text-center leading-[20px]">
+ No workflows yet
+ </p>
+ <p className="text-[13px] text-[#969696] text-center leading-[19px]">
+ Send meeting data to n8n, Zapier, and other automation tools.
+ </p>
+ </div>
+ <button
+ onClick={onNavigateToSettings}
+ className="flex items-center gap-[4px] bg-white border border-[#e4e4ec] px-[16px] py-[12px] rounded-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)] hover:bg-gray-50 transition-colors"
+ >
+ <span className="text-[14px]">+</span>
+ <span className="text-[14px] font-medium text-black">Add workflow</span>
+ </button>
+ </div>
+ ) : (
+ <div className="flex flex-col gap-[12px]">
+ {workflows.map((workflow) => (
+ <WorkflowItem
+ key={workflow.id}
+ workflow={workflow}
+ onEdit={onNavigateToSettings}
+ />
+ ))}
+ </div>
+ )}
+ </div>
</div>
</div>
);
diff --git a/src/renderer/components/meeting-setup/ChecklistStep.tsx b/src/renderer/components/meeting-setup/ChecklistStep.tsx
index 6fa7ede..8574e33 100644
--- a/src/renderer/components/meeting-setup/ChecklistStep.tsx
+++ b/src/renderer/components/meeting-setup/ChecklistStep.tsx
@@ -1,15 +1,72 @@
import React from 'react';
-import { ArrowLeft, Play, CheckCircle2 } from 'lucide-react';
-import { Button } from '../ui/button';
-import { Card, CardContent } from '../ui/card';
+import { Loader2 } from 'lucide-react';
+
+// Icons
+function ChecklistIcon() {
+ return (
+ <svg width="50" height="50" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <rect width="50" height="50" rx="12" fill="#EC5B16" />
+ <path
+ d="M17 25l4 4 12-12"
+ stroke="white"
+ strokeWidth="2.5"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path
+ d="M17 35h16"
+ stroke="white"
+ strokeWidth="2"
+ strokeLinecap="round"
+ />
+ </svg>
+ );
+}
+
+function ArrowLeftIcon() {
+ return (
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M10 12L6 8l4-4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
+ </svg>
+ );
+}
+
+function RecordingIcon() {
+ return (
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="10" cy="10" r="4" fill="white" />
+ <circle cx="10" cy="10" r="7" stroke="white" strokeWidth="1.5" />
+ </svg>
+ );
+}
+
+function SkipRecordingIcon() {
+ return (
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="8" cy="8" r="3" fill="currentColor" />
+ <circle cx="8" cy="8" r="5.5" stroke="currentColor" strokeWidth="1.25" />
+ </svg>
+ );
+}
+
+function CheckCircleIcon() {
+ return (
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="8" cy="8" r="6" stroke="#ec5b16" strokeWidth="1.25" />
+ <path d="M5.5 8l2 2 3-4" stroke="#ec5b16" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" />
+ </svg>
+ );
+}
interface ChecklistStepProps {
name: string;
description: string;
checklist: string[];
isStarting: boolean;
+ isSkipping?: boolean;
onBack: () => void;
onStart: () => void;
+ onSkip: () => void;
}
export function ChecklistStep({
@@ -17,61 +74,108 @@ export function ChecklistStep({
description,
checklist,
isStarting,
+ isSkipping,
onBack,
onStart,
+ onSkip,
}: ChecklistStepProps) {
+ const isDisabled = isStarting || isSkipping;
+
return (
- <div className="flex flex-col items-center justify-center min-h-[400px] space-y-8 animate-in fade-in duration-300">
- <div className="text-center space-y-2">
- <h2 className="text-2xl font-semibold tracking-tight">Ready to Start</h2>
- <p className="text-muted-foreground">
- Your meeting checklist is ready
- </p>
+ <div className="flex flex-col items-center">
+ {/* Icon and heading */}
+ <div className="flex flex-col items-center gap-[16px] mb-[32px]">
+ <ChecklistIcon />
+ <div className="flex flex-col items-center gap-[8px]">
+ <h1 className="text-[22px] font-semibold text-black text-center tracking-[-0.44px] leading-[33px]">
+ Ready to Start
+ </h1>
+ <p className="text-[14px] font-normal text-[#464646] text-center leading-[21px]">
+ Your meeting checklist is ready
+ </p>
+ </div>
</div>
- <Card className="w-full max-w-lg">
- <CardContent className="pt-6 space-y-4">
- <div>
- <h3 className="font-semibold text-lg">{name}</h3>
- <p className="text-sm text-muted-foreground line-clamp-2">{description}</p>
- </div>
+ {/* Meeting card */}
+ <div className="w-full bg-white border border-[#efefef] rounded-[16px] p-[20px] mb-[24px]">
+ {/* Meeting info */}
+ <div className="mb-[16px]">
+ <h3 className="text-[16px] font-semibold text-black mb-[4px]">{name}</h3>
+ <p className="text-[13px] text-[#464646] leading-[19px] line-clamp-2">{description}</p>
+ </div>
+
+ {/* Divider */}
+ <div className="h-[1px] bg-[#efefef] mb-[16px]" />
- <div className="border-t pt-4">
- <p className="text-xs text-muted-foreground uppercase tracking-wider mb-3">
- Meeting Checklist ({checklist.length} items)
- </p>
- <ul className="space-y-2">
- {checklist.map((item, idx) => (
- <li key={idx} className="flex items-start gap-2 text-sm">
- <CheckCircle2 className="h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5" />
- <span>{item}</span>
- </li>
- ))}
- </ul>
- </div>
- </CardContent>
- </Card>
+ {/* Checklist */}
+ <div>
+ <p className="text-[12px] font-medium text-[#969696] uppercase tracking-[0.5px] mb-[12px]">
+ Meeting Checklist ({checklist.length} items)
+ </p>
+ <ul className="flex flex-col gap-[10px]">
+ {checklist.map((item, idx) => (
+ <li key={idx} className="flex items-start gap-[10px]">
+ <div className="flex-shrink-0 mt-[2px]">
+ <CheckCircleIcon />
+ </div>
+ <span className="text-[14px] text-[#141420] leading-[20px]">{item}</span>
+ </li>
+ ))}
+ </ul>
+ </div>
+ </div>
+
+ {/* Buttons */}
+ <div className="w-full flex flex-col gap-[12px]">
+ {/* Primary row: Back and Start Recording */}
+ <div className="flex gap-[12px]">
+ <button
+ type="button"
+ onClick={onBack}
+ disabled={isDisabled}
+ className="flex-1 flex items-center justify-center gap-[6px] px-[20px] py-[14px] bg-white border border-[#e0e0e8] rounded-[12px] text-[14px] font-semibold text-[#464646] hover:bg-[#f7f7f7] disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
+ >
+ <ArrowLeftIcon />
+ Back
+ </button>
+ <button
+ onClick={onStart}
+ disabled={isDisabled}
+ className="flex-1 flex items-center justify-center gap-[6px] px-[20px] py-[16px] bg-[#ff4000] hover:bg-[#e63900] rounded-[12px] text-[14px] font-semibold text-white disabled:opacity-50 disabled:cursor-not-allowed transition-colors shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)]"
+ >
+ {isStarting && !isSkipping ? (
+ <>
+ <Loader2 className="w-4 h-4 animate-spin" />
+ Starting...
+ </>
+ ) : (
+ <>
+ <RecordingIcon />
+ Start Recording
+ </>
+ )}
+ </button>
+ </div>
- <div className="flex gap-3 w-full max-w-lg pt-2">
- <Button
+ {/* Skip and Record button */}
+ <button
type="button"
- variant="outline"
- onClick={onBack}
- disabled={isStarting}
- className="flex-1"
- >
- <ArrowLeft className="mr-2 h-4 w-4" />
- Back
- </Button>
- <Button
- onClick={onStart}
- disabled={isStarting}
- className="flex-1 bg-red-600 hover:bg-red-700"
- size="lg"
+ onClick={onSkip}
+ disabled={isDisabled}
+ className="w-full flex items-center justify-center gap-[6px] px-[20px] py-[12px] bg-transparent border border-dashed border-[#c0c0c8] rounded-[12px] text-[14px] font-medium text-[#464646] hover:border-[#ec5b16] hover:text-[#ec5b16] disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
>
- <Play className="mr-2 h-4 w-4 fill-current" />
- {isStarting ? 'Starting...' : 'Start Recording'}
- </Button>
+ {isSkipping ? (
+ <>
+ <Loader2 className="w-4 h-4 animate-spin" />
+ Starting...
+ </>
+ ) : (
+ <>
+ <SkipRecordingIcon />
+ Skip and Record
+ </>
+ )}
+ </button>
</div>
</div>
);
diff --git a/src/renderer/components/meeting-setup/InfoStep.tsx b/src/renderer/components/meeting-setup/InfoStep.tsx
index 4087616..780e919 100644
--- a/src/renderer/components/meeting-setup/InfoStep.tsx
+++ b/src/renderer/components/meeting-setup/InfoStep.tsx
@@ -1,105 +1,193 @@
import React, { useState } from 'react';
-import { ArrowRight, ArrowLeft, Loader2 } from 'lucide-react';
-import { Button } from '../ui/button';
-import { Input } from '../ui/input';
-import { Textarea } from '../ui/textarea';
-import { Label } from '../ui/label';
+import { Loader2 } from 'lucide-react';
+
+// Icons
+function MeetingIcon() {
+ return (
+ <svg width="50" height="50" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <rect width="50" height="50" rx="12" fill="#EC5B16" />
+ <path
+ d="M17 18h16v14H17V18z"
+ stroke="white"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ fill="none"
+ />
+ <path
+ d="M21 14v4M29 14v4M17 24h16"
+ stroke="white"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+}
+
+function ArrowLeftIcon() {
+ return (
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M10 12L6 8l4-4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
+ </svg>
+ );
+}
+
+function ArrowRightIcon() {
+ return (
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M6 12l4-4-4-4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
+ </svg>
+ );
+}
+
+function RecordingIcon() {
+ return (
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="8" cy="8" r="3" fill="currentColor" />
+ <circle cx="8" cy="8" r="5.5" stroke="currentColor" strokeWidth="1.25" />
+ </svg>
+ );
+}
interface InfoStepProps {
initialName: string;
initialDescription: string;
isGenerating: boolean;
+ isSkipping?: boolean;
onBack: () => void;
onNext: (name: string, description: string) => void;
+ onSkip: () => void;
}
export function InfoStep({
initialName,
initialDescription,
isGenerating,
+ isSkipping,
onBack,
onNext,
+ onSkip,
}: InfoStepProps) {
const [name, setName] = useState(initialName);
const [description, setDescription] = useState(initialDescription);
const canContinue = name.trim().length > 0 && description.trim().length >= 10;
+ const isDisabled = isGenerating || isSkipping;
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
- if (canContinue && !isGenerating) {
+ if (canContinue && !isDisabled) {
onNext(name.trim(), description.trim());
}
};
return (
- <div className="flex flex-col items-center justify-center min-h-[400px] space-y-8 animate-in fade-in duration-300">
- <div className="text-center space-y-2">
- <h2 className="text-2xl font-semibold tracking-tight">Meeting Details</h2>
- <p className="text-muted-foreground">
- Tell us about your meeting so we can prepare better
- </p>
+ <div className="flex flex-col items-center">
+ {/* Icon and heading */}
+ <div className="flex flex-col items-center gap-[16px] mb-[32px]">
+ <MeetingIcon />
+ <div className="flex flex-col items-center gap-[8px]">
+ <h1 className="text-[22px] font-semibold text-black text-center tracking-[-0.44px] leading-[33px]">
+ Meeting Details
+ </h1>
+ <p className="text-[14px] font-normal text-[#464646] text-center leading-[21px]">
+ Tell us about your meeting so we can prepare better
+ </p>
+ </div>
</div>
- <form onSubmit={handleSubmit} className="w-full max-w-md space-y-6">
- <div className="space-y-2">
- <Label htmlFor="meeting-name">Meeting Name</Label>
- <Input
+ {/* Form */}
+ <form onSubmit={handleSubmit} className="w-full flex flex-col gap-[20px]">
+ {/* Meeting Name */}
+ <div className="flex flex-col gap-[8px]">
+ <label htmlFor="meeting-name" className="text-[14px] font-medium text-[#141420]">
+ Meeting Name
+ </label>
+ <input
id="meeting-name"
+ type="text"
placeholder="e.g., Q4 Planning Session"
value={name}
onChange={(e) => setName(e.target.value)}
- disabled={isGenerating}
+ disabled={isDisabled}
autoFocus
+ className="w-full px-[16px] py-[14px] bg-white border border-[#e0e0e8] rounded-[12px] text-[14px] text-black placeholder:text-[#969696] focus:outline-none focus:border-[#ec5b16] focus:ring-1 focus:ring-[#ec5b16] disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
/>
</div>
- <div className="space-y-2">
- <Label htmlFor="meeting-description">Description</Label>
- <Textarea
+ {/* Description */}
+ <div className="flex flex-col gap-[8px]">
+ <label htmlFor="meeting-description" className="text-[14px] font-medium text-[#141420]">
+ Description
+ </label>
+ <textarea
id="meeting-description"
placeholder="What will be discussed in this meeting? What are the goals?"
value={description}
onChange={(e) => setDescription(e.target.value)}
- disabled={isGenerating}
+ disabled={isDisabled}
rows={4}
- className="resize-none"
+ className="w-full px-[16px] py-[14px] bg-white border border-[#e0e0e8] rounded-[12px] text-[14px] text-black placeholder:text-[#969696] focus:outline-none focus:border-[#ec5b16] focus:ring-1 focus:ring-[#ec5b16] disabled:opacity-50 disabled:cursor-not-allowed transition-colors resize-none"
/>
- <p className="text-xs text-muted-foreground">
+ <p className="text-[12px] text-[#969696]">
{description.length < 10
? `At least ${10 - description.length} more characters needed`
: 'Good description!'}
</p>
</div>
- <div className="flex gap-3 pt-2">
- <Button
+ {/* Buttons */}
+ <div className="flex flex-col gap-[12px] pt-[8px]">
+ {/* Primary row: Back and Continue */}
+ <div className="flex gap-[12px]">
+ <button
+ type="button"
+ onClick={onBack}
+ disabled={isDisabled}
+ className="flex-1 flex items-center justify-center gap-[6px] px-[20px] py-[14px] bg-white border border-[#e0e0e8] rounded-[12px] text-[14px] font-semibold text-[#464646] hover:bg-[#f7f7f7] disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
+ >
+ <ArrowLeftIcon />
+ Back
+ </button>
+ <button
+ type="submit"
+ disabled={!canContinue || isDisabled}
+ className="flex-1 flex items-center justify-center gap-[6px] px-[20px] py-[14px] bg-[#ff4000] hover:bg-[#e63900] rounded-[12px] text-[14px] font-semibold text-white disabled:opacity-50 disabled:cursor-not-allowed transition-colors shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)]"
+ >
+ {isGenerating ? (
+ <>
+ <Loader2 className="w-4 h-4 animate-spin" />
+ Preparing...
+ </>
+ ) : (
+ <>
+ Continue
+ <ArrowRightIcon />
+ </>
+ )}
+ </button>
+ </div>
+
+ {/* Skip and Record button */}
+ <button
type="button"
- variant="outline"
- onClick={onBack}
- disabled={isGenerating}
- className="flex-1"
- >
- <ArrowLeft className="mr-2 h-4 w-4" />
- Back
- </Button>
- <Button
- type="submit"
- disabled={!canContinue || isGenerating}
- className="flex-1"
+ onClick={onSkip}
+ disabled={isDisabled}
+ className="w-full flex items-center justify-center gap-[6px] px-[20px] py-[12px] bg-transparent border border-dashed border-[#c0c0c8] rounded-[12px] text-[14px] font-medium text-[#464646] hover:border-[#ec5b16] hover:text-[#ec5b16] disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
>
- {isGenerating ? (
+ {isSkipping ? (
<>
- <Loader2 className="mr-2 h-4 w-4 animate-spin" />
- Preparing...
+ <Loader2 className="w-4 h-4 animate-spin" />
+ Starting...
</>
) : (
<>
- Continue
- <ArrowRight className="ml-2 h-4 w-4" />
+ <RecordingIcon />
+ Skip and Record
</>
)}
- </Button>
+ </button>
</div>
</form>
</div>
diff --git a/src/renderer/components/meeting-setup/MeetingSetupFlow.tsx b/src/renderer/components/meeting-setup/MeetingSetupFlow.tsx
index 0fe8f68..d077ee6 100644
--- a/src/renderer/components/meeting-setup/MeetingSetupFlow.tsx
+++ b/src/renderer/components/meeting-setup/MeetingSetupFlow.tsx
@@ -10,6 +10,20 @@ interface MeetingSetupFlowProps {
onCancel: () => void;
}
+/**
+ * Generate a default meeting name based on current time
+ * Format: "Meeting at 10:30 AM"
+ */
+function generateDefaultMeetingName(): string {
+ const now = new Date();
+ const timeStr = now.toLocaleTimeString('en-US', {
+ hour: 'numeric',
+ minute: '2-digit',
+ hour12: true,
+ });
+ return `Meeting at ${timeStr}`;
+}
+
export function MeetingSetupFlow({ onCancel }: MeetingSetupFlowProps) {
const {
step,
@@ -27,6 +41,7 @@ export function MeetingSetupFlow({ onCancel }: MeetingSetupFlowProps) {
setIsGenerating,
setError,
getMeetingSetupData,
+ reset,
} = useMeetingSetupStore();
const { startRecording, isStarting } = useSession();
@@ -39,6 +54,23 @@ export function MeetingSetupFlow({ onCancel }: MeetingSetupFlowProps) {
setStep('info');
}, [setStep]);
+ // Skip setup and start recording immediately with a generic name
+ const handleSkipAndRecord = async () => {
+ const defaultName = generateDefaultMeetingName();
+
+ // Reset any partial setup data and set only the name
+ reset();
+ setInfo(defaultName, '');
+
+ // Start recording with minimal data (just the name)
+ await startRecording({
+ name: defaultName,
+ description: '',
+ questions: [],
+ checklist: [],
+ });
+ };
+
const handleInfoNext = async (newName: string, newDescription: string) => {
setInfo(newName, newDescription);
setIsGenerating(true);
@@ -103,44 +135,59 @@ export function MeetingSetupFlow({ onCancel }: MeetingSetupFlowProps) {
await startRecording(setupData);
};
+ const isSkipping = isStarting && !isGenerating;
+
return (
- <div className="w-full max-w-2xl mx-auto px-4">
- {error && (
- <div className="mb-6 p-4 rounded-lg bg-destructive/10 border border-destructive/20 text-destructive text-sm animate-in fade-in duration-200">
- {error}
- </div>
- )}
-
- {step === 'info' && (
- <InfoStep
- initialName={name}
- initialDescription={description}
- isGenerating={isGenerating}
- onBack={onCancel}
- onNext={handleInfoNext}
- />
- )}
-
- {step === 'questions' && (
- <QuestionsStep
- questions={questions}
- isGenerating={isGenerating}
- onBack={handleQuestionsBack}
- onNext={handleQuestionsNext}
- onAnswerChange={setQuestionAnswer}
- />
- )}
-
- {step === 'checklist' && (
- <ChecklistStep
- name={name}
- description={description}
- checklist={checklist}
- isStarting={isStarting}
- onBack={handleChecklistBack}
- onStart={handleStartRecording}
- />
- )}
+ <div className="h-full w-full flex flex-col items-center justify-center relative overflow-hidden">
+ {/* Main content */}
+ <div className="w-full max-w-[480px] px-6 relative z-10">
+ {error && (
+ <div className="mb-6 p-[16px] bg-[#fff5f5] border border-[#ffdfdf] rounded-[12px] flex items-start gap-[12px]">
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" className="flex-shrink-0 mt-0.5">
+ <circle cx="10" cy="10" r="8" stroke="#dc2626" strokeWidth="1.5" />
+ <path d="M10 6v5M10 13.5v.5" stroke="#dc2626" strokeWidth="1.5" strokeLinecap="round" />
+ </svg>
+ <p className="text-[13px] text-[#dc2626] leading-[20px]">{error}</p>
+ </div>
+ )}
+
+ {step === 'info' && (
+ <InfoStep
+ initialName={name}
+ initialDescription={description}
+ isGenerating={isGenerating}
+ isSkipping={isSkipping}
+ onBack={onCancel}
+ onNext={handleInfoNext}
+ onSkip={handleSkipAndRecord}
+ />
+ )}
+
+ {step === 'questions' && (
+ <QuestionsStep
+ questions={questions}
+ isGenerating={isGenerating}
+ isSkipping={isSkipping}
+ onBack={handleQuestionsBack}
+ onNext={handleQuestionsNext}
+ onAnswerChange={setQuestionAnswer}
+ onSkip={handleSkipAndRecord}
+ />
+ )}
+
+ {step === 'checklist' && (
+ <ChecklistStep
+ name={name}
+ description={description}
+ checklist={checklist}
+ isStarting={isStarting}
+ isSkipping={isSkipping}
+ onBack={handleChecklistBack}
+ onStart={handleStartRecording}
+ onSkip={handleSkipAndRecord}
+ />
+ )}
+ </div>
</div>
);
}
diff --git a/src/renderer/components/meeting-setup/QuestionsStep.tsx b/src/renderer/components/meeting-setup/QuestionsStep.tsx
index 6f51785..599934d 100644
--- a/src/renderer/components/meeting-setup/QuestionsStep.tsx
+++ b/src/renderer/components/meeting-setup/QuestionsStep.tsx
@@ -1,24 +1,67 @@
import React, { useState } from 'react';
-import { ArrowRight, ArrowLeft, Loader2, Check, MessageSquare } from 'lucide-react';
-import { Button } from '../ui/button';
-import { Input } from '../ui/input';
-import { cn } from '../../lib/utils';
+import { Loader2 } from 'lucide-react';
import type { ProbingQuestion } from '../../../shared/types/meeting-setup.types';
+// Icons
+function ArrowLeftIcon() {
+ return (
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M10 12L6 8l4-4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
+ </svg>
+ );
+}
+
+function ArrowRightIcon() {
+ return (
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M6 12l4-4-4-4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
+ </svg>
+ );
+}
+
+function CheckIcon() {
+ return (
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M10 3L4.5 8.5 2 6" stroke="white" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
+ </svg>
+ );
+}
+
+function MessageIcon() {
+ return (
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M14 10.667a1.333 1.333 0 01-1.333 1.333H4L2 14V3.333A1.333 1.333 0 013.333 2h9.334A1.333 1.333 0 0114 3.333v7.334z" stroke="#969696" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" />
+ </svg>
+ );
+}
+
+function RecordingIcon() {
+ return (
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="8" cy="8" r="3" fill="currentColor" />
+ <circle cx="8" cy="8" r="5.5" stroke="currentColor" strokeWidth="1.25" />
+ </svg>
+ );
+}
+
interface QuestionsStepProps {
questions: ProbingQuestion[];
isGenerating: boolean;
+ isSkipping?: boolean;
onBack: () => void;
onNext: (questions: ProbingQuestion[]) => void;
onAnswerChange: (index: number, answer: string, customAnswer?: string) => void;
+ onSkip: () => void;
}
export function QuestionsStep({
questions,
isGenerating,
+ isSkipping,
onBack,
onNext,
onAnswerChange,
+ onSkip,
}: QuestionsStepProps) {
const [currentQuestion, setCurrentQuestion] = useState(0);
const [showCustomInput, setShowCustomInput] = useState<Record<number, boolean>>({});
@@ -26,34 +69,27 @@ export function QuestionsStep({
const current = questions[currentQuestion];
const isLastQuestion = currentQuestion === questions.length - 1;
-
- const allQuestionsAnswered = questions.every(
- (q) => q.answer.trim().length > 0 || (showCustomInput[questions.indexOf(q)] && customInputs[questions.indexOf(q)]?.trim())
- );
+ const isDisabled = isGenerating || isSkipping;
const currentHasAnswer = current?.answer.trim().length > 0 ||
(showCustomInput[currentQuestion] && customInputs[currentQuestion]?.trim());
const handleOptionClick = (option: string) => {
- if (!current) return;
+ if (!current || isDisabled) return;
- if (current.type === 'single-choice') {
- onAnswerChange(currentQuestion, option, customInputs[currentQuestion]);
- setShowCustomInput((prev) => ({ ...prev, [currentQuestion]: false }));
- } else {
- // Multi-choice: toggle the option
- const currentAnswers = current.answer ? current.answer.split(',').map((s) => s.trim()) : [];
- const isSelected = currentAnswers.includes(option);
+ // Multi-choice: toggle the option
+ const currentAnswers = current.answer ? current.answer.split(',').map((s) => s.trim()) : [];
+ const isSelected = currentAnswers.includes(option);
- const newAnswers = isSelected
- ? currentAnswers.filter((a) => a !== option)
- : [...currentAnswers, option];
+ const newAnswers = isSelected
+ ? currentAnswers.filter((a) => a !== option)
+ : [...currentAnswers, option];
- onAnswerChange(currentQuestion, newAnswers.join(','), customInputs[currentQuestion]);
- }
+ onAnswerChange(currentQuestion, newAnswers.join(','), customInputs[currentQuestion]);
};
const handleOtherClick = () => {
+ if (isDisabled) return;
setShowCustomInput((prev) => ({ ...prev, [currentQuestion]: !prev[currentQuestion] }));
};
@@ -80,144 +116,165 @@ export function QuestionsStep({
const isOptionSelected = (option: string) => {
if (!current) return false;
- if (current.type === 'single-choice') {
- return current.answer === option;
- }
return current.answer.split(',').map((s) => s.trim()).includes(option);
};
if (!current) {
return (
<div className="flex items-center justify-center min-h-[400px]">
- <Loader2 className="h-8 w-8 animate-spin text-muted-foreground" />
+ <Loader2 className="h-8 w-8 animate-spin text-[#969696]" />
</div>
);
}
return (
- <div className="flex flex-col items-center justify-center min-h-[400px] space-y-8 animate-in fade-in duration-300">
+ <div className="flex flex-col items-center">
{/* Progress indicator */}
- <div className="flex gap-2">
+ <div className="flex gap-[6px] mb-[32px]">
{questions.map((_, idx) => (
<div
key={idx}
- className={cn(
- 'w-2.5 h-2.5 rounded-full transition-all duration-200',
+ className={`h-[6px] rounded-full transition-all duration-200 ${
idx === currentQuestion
- ? 'bg-primary w-6'
+ ? 'w-[24px] bg-[#ec5b16]'
: idx < currentQuestion
- ? 'bg-primary/60'
- : 'bg-muted'
- )}
+ ? 'w-[6px] bg-[#ec5b16]/60'
+ : 'w-[6px] bg-[#e0e0e8]'
+ }`}
/>
))}
</div>
- <div className="text-center space-y-2 max-w-lg">
- <p className="text-xs text-muted-foreground uppercase tracking-wider">
- Question {currentQuestion + 1} of {questions.length}
- {current.type === 'multi-choice' && ' (select multiple)'}
+ {/* Question header */}
+ <div className="flex flex-col items-center gap-[8px] mb-[24px] text-center">
+ <p className="text-[12px] font-medium text-[#969696] uppercase tracking-[0.5px]">
+ Question {currentQuestion + 1} of {questions.length} (select all that apply)
</p>
- <h2 className="text-xl font-semibold tracking-tight">{current.question}</h2>
+ <h2 className="text-[18px] font-semibold text-black tracking-[-0.17px] leading-[27px]">
+ {current.question}
+ </h2>
</div>
- <div className="w-full max-w-md space-y-3">
- {current.options.map((option, idx) => (
- <button
- key={idx}
- type="button"
- onClick={() => handleOptionClick(option)}
- className={cn(
- 'w-full flex items-center gap-3 p-4 rounded-lg border-2 text-left transition-all duration-200',
- 'hover:border-primary/50 hover:bg-muted/30',
- 'focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-2',
- isOptionSelected(option)
- ? 'border-primary bg-primary/10'
- : 'border-border bg-background'
- )}
- >
- <div
- className={cn(
- 'w-5 h-5 rounded-full border-2 flex items-center justify-center flex-shrink-0 transition-all',
- current.type === 'multi-choice' && 'rounded-md',
- isOptionSelected(option)
- ? 'border-primary bg-primary'
- : 'border-muted-foreground/40'
- )}
+ {/* Options */}
+ <div className="w-full flex flex-col gap-[10px] mb-[24px]">
+ {current.options.map((option, idx) => {
+ const selected = isOptionSelected(option);
+ return (
+ <button
+ key={idx}
+ type="button"
+ onClick={() => handleOptionClick(option)}
+ disabled={isDisabled}
+ className={`w-full flex items-center gap-[12px] p-[16px] rounded-[12px] border-2 text-left transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed ${
+ selected
+ ? 'border-[#ec5b16] bg-[#fff5ec]'
+ : 'border-[#e0e0e8] bg-white hover:border-[#ec5b16]/50 hover:bg-[#fff5ec]/30'
+ }`}
>
- {isOptionSelected(option) && (
- <Check className="h-3 w-3 text-primary-foreground" />
- )}
- </div>
- <span className="text-sm">{option}</span>
- </button>
- ))}
+ <div
+ className={`w-[20px] h-[20px] rounded-[4px] flex items-center justify-center flex-shrink-0 transition-all ${
+ selected
+ ? 'bg-[#ec5b16] border-2 border-[#ec5b16]'
+ : 'border-2 border-[#c0c0c8]'
+ }`}
+ >
+ {selected && <CheckIcon />}
+ </div>
+ <span className="text-[14px] text-[#141420]">{option}</span>
+ </button>
+ );
+ })}
{/* Other option */}
<button
type="button"
onClick={handleOtherClick}
- className={cn(
- 'w-full flex items-center gap-3 p-4 rounded-lg border-2 text-left transition-all duration-200',
- 'hover:border-primary/50 hover:bg-muted/30',
- 'focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-2',
+ disabled={isDisabled}
+ className={`w-full flex items-center gap-[12px] p-[16px] rounded-[12px] border-2 border-dashed text-left transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed ${
showCustomInput[currentQuestion]
- ? 'border-primary bg-primary/10'
- : 'border-dashed border-border bg-background'
- )}
+ ? 'border-[#ec5b16] bg-[#fff5ec]'
+ : 'border-[#e0e0e8] bg-white hover:border-[#ec5b16]/50 hover:bg-[#fff5ec]/30'
+ }`}
>
- <MessageSquare className="h-5 w-5 text-muted-foreground flex-shrink-0" />
- <span className="text-sm text-muted-foreground">Other (type your answer)</span>
+ <MessageIcon />
+ <span className="text-[14px] text-[#969696]">Other (type your answer)</span>
</button>
+ {/* Custom input */}
{showCustomInput[currentQuestion] && (
<div className="animate-in slide-in-from-top-2 duration-200">
- <Input
+ <input
+ type="text"
placeholder="Type your answer..."
value={customInputs[currentQuestion] || ''}
onChange={(e) => handleCustomInputChange(e.target.value)}
+ disabled={isDisabled}
autoFocus
+ className="w-full px-[16px] py-[14px] bg-white border border-[#e0e0e8] rounded-[12px] text-[14px] text-black placeholder:text-[#969696] focus:outline-none focus:border-[#ec5b16] focus:ring-1 focus:ring-[#ec5b16] disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
/>
</div>
)}
</div>
- <div className="flex gap-3 w-full max-w-md pt-2">
- <Button
- type="button"
- variant="outline"
- onClick={handlePrev}
- disabled={isGenerating}
- className="flex-1"
- >
- <ArrowLeft className="mr-2 h-4 w-4" />
- {currentQuestion === 0 ? 'Back' : 'Previous'}
- </Button>
- <Button
- type="button"
- onClick={handleNext}
- disabled={!currentHasAnswer || (isLastQuestion && isGenerating)}
- className="flex-1"
- >
- {isLastQuestion ? (
- isGenerating ? (
- <>
- <Loader2 className="mr-2 h-4 w-4 animate-spin" />
- Generating...
- </>
+ {/* Buttons */}
+ <div className="w-full flex flex-col gap-[12px]">
+ {/* Primary row: Previous/Back and Next/Generate */}
+ <div className="flex gap-[12px]">
+ <button
+ type="button"
+ onClick={handlePrev}
+ disabled={isDisabled}
+ className="flex-1 flex items-center justify-center gap-[6px] px-[20px] py-[14px] bg-white border border-[#e0e0e8] rounded-[12px] text-[14px] font-semibold text-[#464646] hover:bg-[#f7f7f7] disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
+ >
+ <ArrowLeftIcon />
+ {currentQuestion === 0 ? 'Back' : 'Previous'}
+ </button>
+ <button
+ type="button"
+ onClick={handleNext}
+ disabled={!currentHasAnswer || isDisabled}
+ className="flex-1 flex items-center justify-center gap-[6px] px-[20px] py-[14px] bg-[#ff4000] hover:bg-[#e63900] rounded-[12px] text-[14px] font-semibold text-white disabled:opacity-50 disabled:cursor-not-allowed transition-colors shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)]"
+ >
+ {isLastQuestion ? (
+ isGenerating ? (
+ <>
+ <Loader2 className="w-4 h-4 animate-spin" />
+ Generating...
+ </>
+ ) : (
+ <>
+ Generate Checklist
+ <ArrowRightIcon />
+ </>
+ )
) : (
<>
- Generate Checklist
- <ArrowRight className="ml-2 h-4 w-4" />
+ Next
+ <ArrowRightIcon />
</>
- )
+ )}
+ </button>
+ </div>
+
+ {/* Skip and Record button */}
+ <button
+ type="button"
+ onClick={onSkip}
+ disabled={isDisabled}
+ className="w-full flex items-center justify-center gap-[6px] px-[20px] py-[12px] bg-transparent border border-dashed border-[#c0c0c8] rounded-[12px] text-[14px] font-medium text-[#464646] hover:border-[#ec5b16] hover:text-[#ec5b16] disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
+ >
+ {isSkipping ? (
+ <>
+ <Loader2 className="w-4 h-4 animate-spin" />
+ Starting...
+ </>
) : (
<>
- Next
- <ArrowRight className="ml-2 h-4 w-4" />
+ <RecordingIcon />
+ Skip and Record
</>
)}
- </Button>
+ </button>
</div>
</div>
);
diff --git a/src/renderer/components/recording/LiveAssistPanel.tsx b/src/renderer/components/recording/LiveAssistPanel.tsx
index 23f5d01..df8d3a3 100644
--- a/src/renderer/components/recording/LiveAssistPanel.tsx
+++ b/src/renderer/components/recording/LiveAssistPanel.tsx
@@ -1,16 +1,21 @@
/**
* Live Assist Panel Component
*
- * Shows live AI insights and MCP findings during recording:
- * - Bullet list of insights/suggestions
- * - MCP Findings section with markdown content
+ * Shows real-time AI-generated assists during recording:
+ * - Questions to ask (ask)
+ * - Things to say (speak)
+ * - Actions to take (act)
+ *
+ * Also shows MCP Findings section.
*/
import React from 'react';
-import { Zap } from 'lucide-react';
import ReactMarkdown from 'react-markdown';
+import { useLiveAssist } from '../../hooks/useLiveAssist';
+import { useMCP } from '../../hooks/useMCP';
+import type { LiveAssistItem } from '../../../shared/types/live-assist.types';
-// Lightning bolt icon for Live Assist
+// Lightbulb icon for Live Assist
function LightbulbIcon() {
return (
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -41,35 +46,56 @@ function EmptyInsightsIcon() {
);
}
-interface LiveAssistPanelProps {
- insights: string[];
- mcpFindings: string;
+interface AssistItemProps {
+ item: LiveAssistItem;
+}
+
+function AssistItem({ item }: AssistItemProps) {
+ return (
+ <div className="flex flex-col justify-center w-full">
+ <ul>
+ <li className="list-disc ms-[21px]">
+ <span className="text-[14px] text-black leading-[22px]">{item.text}</span>
+ </li>
+ </ul>
+ </div>
+ );
}
-export function LiveAssistPanel({ insights, mcpFindings }: LiveAssistPanelProps) {
- const hasContent = insights.length > 0 || mcpFindings.length > 0;
+export function LiveAssistPanel() {
+ const { assists } = useLiveAssist();
+ const { activeResults } = useMCP();
+
+ // Get the latest MCP result for display
+ const latestMCPResult = activeResults.length > 0 ? activeResults[activeResults.length - 1] : null;
+ const mcpFindings = latestMCPResult?.content?.text || latestMCPResult?.content?.markdown || '';
+
+ const hasAssists = assists.length > 0;
return (
- <div className="bg-white border border-[#e4e4ec] rounded-[12px] shadow-[0px_1px_3px_0px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.02)] p-[17px] flex flex-col gap-[20px] max-h-[520px]">
+ <div className="bg-white border border-[#e4e4ec] rounded-[12px] shadow-[0px_1px_3px_0px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.02)] p-[17px] flex flex-col gap-[20px]">
{/* Header */}
<div className="flex items-center gap-[6px]">
<LightbulbIcon />
<span className="font-medium text-[16px] text-black">Live Assist</span>
</div>
- {/* Insights List */}
- {insights.length > 0 && (
- <div className="flex flex-col gap-[6px]">
- {insights.map((insight, idx) => (
- <div key={idx} className="flex items-start">
- <span className="text-[14px] text-black leading-[22px]">
- <span className="mr-2">•</span>
- {insight}
- </span>
- </div>
- ))}
- </div>
- )}
+ {/* Assists List */}
+ <div className="bg-white rounded-[16px] max-h-[206px] min-h-[80px] overflow-y-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]">
+ {hasAssists ? (
+ <div className="flex flex-col gap-[6px] text-[14px] text-black">
+ {assists.map((assist) => (
+ <AssistItem key={assist.id} item={assist} />
+ ))}
+ </div>
+ ) : (
+ <div className="flex flex-col items-center justify-center h-[80px] text-center">
+ <p className="text-[13px] text-[#969696]">
+ AI suggestions will appear here as the conversation progresses
+ </p>
+ </div>
+ )}
+ </div>
{/* MCP Findings Section */}
<div className="border border-[#efefef] rounded-[12px] overflow-hidden">
diff --git a/src/renderer/components/recording/RecordingHeader.tsx b/src/renderer/components/recording/RecordingHeader.tsx
index caeb127..94f2598 100644
--- a/src/renderer/components/recording/RecordingHeader.tsx
+++ b/src/renderer/components/recording/RecordingHeader.tsx
@@ -7,7 +7,7 @@
* - Pause/Stop buttons
*/
-import React from 'react';
+import React, { useState, useEffect } from 'react';
import { Pause, Square, Loader2 } from 'lucide-react';
import { useSession } from '../../hooks/useSession';
import { useMeetingSetupStore } from '../../stores/meeting-setup.store';
@@ -62,18 +62,17 @@ function formatTime(seconds: number): string {
return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
}
-function formatTimeRange(): string {
- const now = new Date();
- const endTime = new Date(now.getTime() + 45 * 60 * 1000); // 45 min meeting
- const formatTime = (date: Date) =>
- date.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', hour12: true });
- return `${formatTime(now)} - ${formatTime(endTime)}`;
+function formatStartTime(date: Date): string {
+ return date.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', hour12: true });
}
export function RecordingHeader() {
const { status, elapsedTime, isRecording, isStopping, isPaused, stopRecording, pauseRecording, resumeRecording } = useSession();
const { name } = useMeetingSetupStore();
+ // Capture start time once when component mounts
+ const [startTime] = useState(() => new Date());
+
const meetingName = name || 'Meeting';
return (
@@ -83,7 +82,7 @@ export function RecordingHeader() {
<h1 className="font-semibold text-[24px] text-black tracking-[0.12px]">{meetingName}</h1>
<div className="flex items-center gap-[4px]">
<ClockIcon />
- <span className="text-[14px] text-[#464646] tracking-[0.07px]">{formatTimeRange()}</span>
+ <span className="text-[14px] text-[#464646] tracking-[0.07px]">Started at: {formatStartTime(startTime)}</span>
</div>
</div>
diff --git a/src/renderer/components/recording/SessionControls.tsx b/src/renderer/components/recording/SessionControls.tsx
index 9aa1ab8..3bf4d82 100644
--- a/src/renderer/components/recording/SessionControls.tsx
+++ b/src/renderer/components/recording/SessionControls.tsx
@@ -54,7 +54,7 @@ export function SessionControls() {
<Button
size="lg"
className="w-32 h-12"
- onClick={startRecording}
+ onClick={() => startRecording()}
disabled={isStarting || isStopping}
>
<Circle className="mr-2 h-4 w-4 fill-current" />
diff --git a/src/renderer/components/settings/CalendarPanel.tsx b/src/renderer/components/settings/CalendarPanel.tsx
index 6a41b6e..94ed53c 100644
--- a/src/renderer/components/settings/CalendarPanel.tsx
+++ b/src/renderer/components/settings/CalendarPanel.tsx
@@ -5,9 +5,6 @@
*/
import React, { useState, useEffect } from 'react';
-import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '../ui/card';
-import { Button } from '../ui/button';
-import { Badge } from '../ui/badge';
import {
Calendar,
Check,
@@ -20,6 +17,39 @@ import type { UpcomingMeeting } from '../../../shared/types/calendar.types';
type CalendarStatus = 'disconnected' | 'connecting' | 'connected' | 'error';
+// Status Badge Component
+function StatusBadge({ status }: { status: CalendarStatus }) {
+ switch (status) {
+ case 'connected':
+ return (
+ <div className="flex items-center gap-[6px] px-[10px] py-[4px] bg-[#ecfdf5] border border-[#a7f3d0] rounded-[8px]">
+ <Check className="h-[14px] w-[14px] text-[#059669]" />
+ <span className="text-[13px] font-medium text-[#059669]">Connected</span>
+ </div>
+ );
+ case 'connecting':
+ return (
+ <div className="flex items-center gap-[6px] px-[10px] py-[4px] bg-[#fff5ec] border border-[#fed7aa] rounded-[8px] animate-pulse">
+ <Loader2 className="h-[14px] w-[14px] text-[#ec5b16] animate-spin" />
+ <span className="text-[13px] font-medium text-[#ec5b16]">Connecting...</span>
+ </div>
+ );
+ case 'error':
+ return (
+ <div className="flex items-center gap-[6px] px-[10px] py-[4px] bg-[#fef2f2] border border-[#fecaca] rounded-[8px]">
+ <AlertCircle className="h-[14px] w-[14px] text-[#dc2626]" />
+ <span className="text-[13px] font-medium text-[#dc2626]">Error</span>
+ </div>
+ );
+ default:
+ return (
+ <div className="flex items-center gap-[6px] px-[10px] py-[4px] bg-[#f7f7f7] border border-[#ededf3] rounded-[8px]">
+ <span className="text-[13px] font-medium text-[#969696]">Not Connected</span>
+ </div>
+ );
+ }
+}
+
export function CalendarPanel() {
const [status, setStatus] = useState<CalendarStatus>('disconnected');
const [isLoading, setIsLoading] = useState(true);
@@ -106,163 +136,138 @@ export function CalendarPanel() {
}
};
- const getStatusBadge = () => {
- switch (status) {
- case 'connected':
- return (
- <Badge className="bg-green-500 text-white">
- <Check className="h-3 w-3 mr-1" />
- Connected
- </Badge>
- );
- case 'connecting':
- return (
- <Badge variant="secondary" className="animate-pulse">
- <Loader2 className="h-3 w-3 mr-1 animate-spin" />
- Connecting...
- </Badge>
- );
- case 'error':
- return (
- <Badge variant="destructive">
- <AlertCircle className="h-3 w-3 mr-1" />
- Error
- </Badge>
- );
- default:
- return (
- <Badge variant="outline">
- Not Connected
- </Badge>
- );
- }
- };
-
const formatEventTime = (event: UpcomingMeeting) => {
if (event.isAllDay) return 'All day';
return event.startTime.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
};
return (
- <div className="space-y-6">
+ <div className="space-y-[16px]">
{/* Header */}
<div className="flex items-center justify-between">
<div>
- <h2 className="text-lg font-semibold flex items-center gap-2">
- <Calendar className="h-5 w-5" />
+ <h2 className="text-[16px] font-semibold text-[#141420] flex items-center gap-[8px]">
+ <Calendar className="h-[18px] w-[18px]" />
Google Calendar
</h2>
- <p className="text-sm text-slate-500 dark:text-slate-400">
+ <p className="text-[13px] text-[#969696] mt-[2px]">
Get notified before your meetings start
</p>
</div>
- <div className="flex items-center gap-2">
- {getStatusBadge()}
+ <div className="flex items-center gap-[8px]">
+ <StatusBadge status={status} />
{status === 'connected' && (
- <Button variant="outline" size="icon" onClick={checkAuthStatus} disabled={isLoading}>
- <RefreshCw className={`h-4 w-4 ${isLoading ? 'animate-spin' : ''}`} />
- </Button>
+ <button
+ onClick={checkAuthStatus}
+ disabled={isLoading}
+ className="w-[32px] h-[32px] flex items-center justify-center border border-[#ededf3] rounded-[8px] bg-white hover:bg-[#f7f7f7] transition-colors disabled:opacity-50"
+ >
+ <RefreshCw className={`h-[14px] w-[14px] text-[#464646] ${isLoading ? 'animate-spin' : ''}`} />
+ </button>
)}
</div>
</div>
{/* Connection Card */}
- <Card>
- <CardHeader>
- <CardTitle className="text-base">Calendar Connection</CardTitle>
- <CardDescription>
+ <div className="bg-white border border-[#ededf3] rounded-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)]">
+ <div className="px-[20px] py-[16px] border-b border-[#ededf3]">
+ <h3 className="text-[15px] font-semibold text-[#141420]">Calendar Connection</h3>
+ <p className="text-[13px] text-[#969696] mt-[4px]">
Connect your Google Calendar to receive notifications 2 minutes before meetings start.
- The app will run in your system tray to monitor upcoming events.
- </CardDescription>
- </CardHeader>
- <CardContent className="space-y-4">
+ </p>
+ </div>
+ <div className="px-[20px] py-[20px]">
{error && (
- <div className="p-3 bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-800 rounded-lg">
- <p className="text-sm text-red-600 dark:text-red-400 flex items-center gap-2">
- <AlertCircle className="h-4 w-4" />
+ <div className="p-[12px] bg-[#fef2f2] border border-[#fecaca] rounded-[10px] mb-[16px]">
+ <p className="text-[13px] text-[#dc2626] flex items-center gap-[8px]">
+ <AlertCircle className="h-[14px] w-[14px]" />
{error}
</p>
</div>
)}
{status === 'disconnected' && (
- <div className="flex flex-col items-center py-6">
- <Calendar className="h-12 w-12 text-slate-300 dark:text-slate-600 mb-4" />
- <p className="text-sm text-slate-500 dark:text-slate-400 text-center mb-4">
+ <div className="flex flex-col items-center py-[32px]">
+ <div className="w-[48px] h-[48px] flex items-center justify-center bg-[#f7f7f7] rounded-[12px] mb-[16px]">
+ <Calendar className="h-[24px] w-[24px] text-[#969696]" />
+ </div>
+ <p className="text-[14px] text-[#464646] text-center mb-[16px]">
Connect your Google Calendar to get started
</p>
- <Button onClick={handleConnect}>
- <Calendar className="h-4 w-4 mr-2" />
+ <button
+ onClick={handleConnect}
+ className="flex items-center gap-[8px] px-[16px] py-[10px] bg-[#ec5b16] hover:bg-[#d9520f] text-white text-[14px] font-medium rounded-[10px] transition-colors"
+ >
+ <Calendar className="h-[16px] w-[16px]" />
Connect Google Calendar
- </Button>
+ </button>
</div>
)}
{status === 'connecting' && (
- <div className="flex flex-col items-center py-6">
- <Loader2 className="h-12 w-12 text-blue-500 mb-4 animate-spin" />
- <p className="text-sm text-slate-500 dark:text-slate-400 text-center">
+ <div className="flex flex-col items-center py-[32px]">
+ <Loader2 className="h-[48px] w-[48px] text-[#ec5b16] mb-[16px] animate-spin" />
+ <p className="text-[14px] text-[#464646] text-center">
Connecting to Google Calendar...
</p>
- <p className="text-xs text-slate-400 dark:text-slate-500 text-center mt-2">
+ <p className="text-[12px] text-[#969696] text-center mt-[8px]">
A browser window will open for authorization
</p>
</div>
)}
{status === 'connected' && (
- <div className="space-y-4">
- <div className="flex items-center justify-between p-3 bg-green-50 dark:bg-green-950/30 rounded-lg">
- <div className="flex items-center gap-2">
- <Check className="h-5 w-5 text-green-500" />
- <span className="text-sm font-medium text-green-700 dark:text-green-300">
+ <div className="space-y-[16px]">
+ <div className="flex items-center justify-between p-[12px] bg-[#ecfdf5] rounded-[10px]">
+ <div className="flex items-center gap-[8px]">
+ <Check className="h-[18px] w-[18px] text-[#059669]" />
+ <span className="text-[14px] font-medium text-[#059669]">
Calendar connected
</span>
</div>
- <Button
- variant="outline"
- size="sm"
+ <button
onClick={handleDisconnect}
disabled={isLoading}
+ className="flex items-center gap-[6px] px-[12px] py-[6px] border border-[#ededf3] rounded-[8px] bg-white hover:bg-[#f7f7f7] text-[13px] font-medium text-[#464646] transition-colors disabled:opacity-50"
>
- <LogOut className="h-4 w-4 mr-2" />
+ <LogOut className="h-[14px] w-[14px]" />
Disconnect
- </Button>
+ </button>
</div>
{/* Upcoming Events Preview */}
{upcomingEvents.length > 0 && (
- <div className="space-y-2">
- <h4 className="text-sm font-medium text-slate-700 dark:text-slate-300">
+ <div className="space-y-[8px]">
+ <h4 className="text-[14px] font-medium text-[#141420]">
Upcoming Meetings (next 24h)
</h4>
- <div className="space-y-2 max-h-48 overflow-y-auto">
+ <div className="space-y-[8px] max-h-[192px] overflow-y-auto">
{upcomingEvents.slice(0, 5).map((event) => (
<div
key={event.id}
- className="flex items-center justify-between p-2 bg-slate-50 dark:bg-slate-800/50 rounded"
+ className="flex items-center justify-between p-[10px] bg-[#f7f7f7] rounded-[8px]"
>
<div className="flex-1 min-w-0">
- <p className="text-sm font-medium truncate">{event.summary}</p>
- <p className="text-xs text-slate-500 dark:text-slate-400">
+ <p className="text-[14px] font-medium text-[#141420] truncate">{event.summary}</p>
+ <p className="text-[12px] text-[#969696]">
{formatEventTime(event)}
{event.minutesUntil > 0 && event.minutesUntil <= 60 && (
- <span className="ml-2 text-amber-600 dark:text-amber-400">
+ <span className="ml-[8px] text-[#ec5b16]">
in {event.minutesUntil}m
</span>
)}
</p>
</div>
{event.meetLink && (
- <Badge variant="outline" className="text-xs ml-2">
- Meet
- </Badge>
+ <div className="px-[8px] py-[2px] bg-white border border-[#ededf3] rounded-[6px] ml-[8px]">
+ <span className="text-[11px] font-medium text-[#464646]">Meet</span>
+ </div>
)}
</div>
))}
</div>
{upcomingEvents.length > 5 && (
- <p className="text-xs text-slate-500 dark:text-slate-400 text-center">
+ <p className="text-[12px] text-[#969696] text-center">
+{upcomingEvents.length - 5} more events
</p>
)}
@@ -270,7 +275,7 @@ export function CalendarPanel() {
)}
{upcomingEvents.length === 0 && (
- <p className="text-sm text-slate-500 dark:text-slate-400 text-center py-4">
+ <p className="text-[14px] text-[#969696] text-center py-[16px]">
No upcoming meetings in the next 24 hours
</p>
)}
@@ -278,54 +283,56 @@ export function CalendarPanel() {
)}
{status === 'error' && (
- <div className="flex flex-col items-center py-6">
- <AlertCircle className="h-12 w-12 text-red-400 mb-4" />
- <p className="text-sm text-slate-500 dark:text-slate-400 text-center mb-4">
+ <div className="flex flex-col items-center py-[32px]">
+ <div className="w-[48px] h-[48px] flex items-center justify-center bg-[#fef2f2] rounded-[12px] mb-[16px]">
+ <AlertCircle className="h-[24px] w-[24px] text-[#dc2626]" />
+ </div>
+ <p className="text-[14px] text-[#464646] text-center mb-[16px]">
{error || 'Something went wrong'}
</p>
- <Button onClick={handleConnect}>
- <RefreshCw className="h-4 w-4 mr-2" />
+ <button
+ onClick={handleConnect}
+ className="flex items-center gap-[8px] px-[16px] py-[10px] bg-[#ec5b16] hover:bg-[#d9520f] text-white text-[14px] font-medium rounded-[10px] transition-colors"
+ >
+ <RefreshCw className="h-[16px] w-[16px]" />
Try Again
- </Button>
+ </button>
</div>
)}
- </CardContent>
- </Card>
+ </div>
+ </div>
{/* Info Card */}
- <Card>
- <CardContent className="pt-6">
- <div className="space-y-3 text-sm text-slate-600 dark:text-slate-400">
- <div className="flex items-start gap-3">
- <div className="w-6 h-6 rounded-full bg-blue-100 dark:bg-blue-900/30 flex items-center justify-center shrink-0">
- <span className="text-xs font-medium text-blue-600 dark:text-blue-400">1</span>
+ <div className="bg-white border border-[#ededf3] rounded-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)]">
+ <div className="px-[20px] py-[16px]">
+ <div className="space-y-[12px]">
+ <div className="flex items-start gap-[12px]">
+ <div className="w-[24px] h-[24px] rounded-full bg-[#fff5ec] flex items-center justify-center shrink-0">
+ <span className="text-[12px] font-semibold text-[#ec5b16]">1</span>
</div>
- <p>
- <strong>System Tray:</strong> When you close the app, it continues running in your
- system tray to monitor your calendar.
+ <p className="text-[13px] text-[#464646] leading-[18px]">
+ <span className="font-medium text-[#141420]">System Tray:</span> When you close the app, it continues running in your system tray to monitor your calendar.
</p>
</div>
- <div className="flex items-start gap-3">
- <div className="w-6 h-6 rounded-full bg-blue-100 dark:bg-blue-900/30 flex items-center justify-center shrink-0">
- <span className="text-xs font-medium text-blue-600 dark:text-blue-400">2</span>
+ <div className="flex items-start gap-[12px]">
+ <div className="w-[24px] h-[24px] rounded-full bg-[#fff5ec] flex items-center justify-center shrink-0">
+ <span className="text-[12px] font-semibold text-[#ec5b16]">2</span>
</div>
- <p>
- <strong>Notifications:</strong> You'll receive a notification 2 minutes before each
- meeting starts.
+ <p className="text-[13px] text-[#464646] leading-[18px]">
+ <span className="font-medium text-[#141420]">Notifications:</span> You'll receive a notification 2 minutes before each meeting starts.
</p>
</div>
- <div className="flex items-start gap-3">
- <div className="w-6 h-6 rounded-full bg-blue-100 dark:bg-blue-900/30 flex items-center justify-center shrink-0">
- <span className="text-xs font-medium text-blue-600 dark:text-blue-400">3</span>
+ <div className="flex items-start gap-[12px]">
+ <div className="w-[24px] h-[24px] rounded-full bg-[#fff5ec] flex items-center justify-center shrink-0">
+ <span className="text-[12px] font-semibold text-[#ec5b16]">3</span>
</div>
- <p>
- <strong>Privacy:</strong> Your calendar data stays on your device. We only read
- event titles and times to send notifications.
+ <p className="text-[13px] text-[#464646] leading-[18px]">
+ <span className="font-medium text-[#141420]">Privacy:</span> Your calendar data stays on your device. We only read event titles and times to send notifications.
</p>
</div>
</div>
- </CardContent>
- </Card>
+ </div>
+ </div>
</div>
);
}
diff --git a/src/renderer/components/settings/MCPServersPanel.tsx b/src/renderer/components/settings/MCPServersPanel.tsx
index 4202ca4..9a79640 100644
--- a/src/renderer/components/settings/MCPServersPanel.tsx
+++ b/src/renderer/components/settings/MCPServersPanel.tsx
@@ -6,12 +6,6 @@
*/
import React, { useState, useEffect } from 'react';
-import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '../ui/card';
-import { Button } from '../ui/button';
-import { Input } from '../ui/input';
-import { Label } from '../ui/label';
-import { Badge } from '../ui/badge';
-import { Switch } from '../ui/switch';
import { ScrollArea } from '../ui/scroll-area';
import {
Dialog,
@@ -21,13 +15,6 @@ import {
DialogHeader,
DialogTitle,
} from '../ui/dialog';
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from '../ui/select';
import {
AlertDialog,
AlertDialogAction,
@@ -51,13 +38,91 @@ import {
Check,
RefreshCw,
ExternalLink,
- Zap,
- X,
+ ChevronDown,
} from 'lucide-react';
import { useMCP } from '../../hooks/useMCP';
-import { cn } from '../../lib/utils';
import type { MCPServerConfig, MCPServerTemplate } from '../../../preload/index';
+// Toggle Component
+function Toggle({
+ enabled,
+ onChange,
+}: {
+ enabled: boolean;
+ onChange: (enabled: boolean) => void;
+}) {
+ return (
+ <button
+ onClick={() => onChange(!enabled)}
+ className={`w-[38px] h-[22px] rounded-full relative transition-colors ${
+ enabled ? 'bg-[#ec5b16]' : 'bg-[#e4e4ec]'
+ }`}
+ >
+ <div
+ className={`absolute size-[18px] bg-white rounded-full top-[2px] shadow-[0px_1px_3px_0px_rgba(0,0,0,0.15)] transition-all ${
+ enabled ? 'left-[18px]' : 'left-[2px]'
+ }`}
+ />
+ </button>
+ );
+}
+
+// Custom Select Component
+function CustomSelect({
+ value,
+ onChange,
+ options,
+ placeholder,
+}: {
+ value: string;
+ onChange: (value: string) => void;
+ options: { value: string; label: string; description?: string }[];
+ placeholder?: string;
+}) {
+ const [isOpen, setIsOpen] = useState(false);
+ const selectedOption = options.find((o) => o.value === value);
+
+ return (
+ <div className="relative">
+ <button
+ type="button"
+ onClick={() => setIsOpen(!isOpen)}
+ className="w-full flex items-center justify-between px-[12px] py-[10px] text-[14px] bg-white border border-[#ededf3] rounded-[10px] outline-none focus:border-[#ec5b16] focus:ring-1 focus:ring-[#ec5b16]/20 transition-colors text-left"
+ >
+ <span className={selectedOption ? 'text-[#141420]' : 'text-[#969696]'}>
+ {selectedOption?.label || placeholder}
+ </span>
+ <ChevronDown className={`h-[14px] w-[14px] text-[#969696] transition-transform ${isOpen ? 'rotate-180' : ''}`} />
+ </button>
+ {isOpen && (
+ <div className="absolute z-50 w-full mt-[4px] bg-white border border-[#ededf3] rounded-[10px] shadow-[0px_4px_16px_0px_rgba(0,0,0,0.1)] overflow-hidden">
+ {options.map((option) => (
+ <button
+ key={option.value}
+ type="button"
+ onClick={() => {
+ onChange(option.value);
+ setIsOpen(false);
+ }}
+ className={`w-full px-[12px] py-[10px] text-left hover:bg-[#f7f7f7] transition-colors ${
+ option.value === value ? 'bg-[#fff5ec]' : ''
+ }`}
+ >
+ <div className="flex items-center gap-[8px]">
+ <Server className="h-[14px] w-[14px] text-[#464646]" />
+ <span className="text-[14px] text-[#141420]">{option.label}</span>
+ </div>
+ {option.description && (
+ <p className="text-[12px] text-[#969696] mt-[2px] ml-[22px]">{option.description}</p>
+ )}
+ </button>
+ ))}
+ </div>
+ )}
+ </div>
+ );
+}
+
// Server Card Component
interface ServerCardProps {
@@ -87,112 +152,109 @@ function ServerCard({
switch (status) {
case 'connected':
return (
- <Badge className="bg-green-500 text-white">
- <Wifi className="h-3 w-3 mr-1" />
- Connected
- </Badge>
+ <div className="flex items-center gap-[4px] px-[8px] py-[3px] bg-[#ecfdf5] border border-[#a7f3d0] rounded-[6px]">
+ <Wifi className="h-[12px] w-[12px] text-[#059669]" />
+ <span className="text-[11px] font-medium text-[#059669]">Connected</span>
+ </div>
);
case 'connecting':
return (
- <Badge variant="secondary" className="animate-pulse">
- <Loader2 className="h-3 w-3 mr-1 animate-spin" />
- Connecting
- </Badge>
+ <div className="flex items-center gap-[4px] px-[8px] py-[3px] bg-[#fff5ec] border border-[#fed7aa] rounded-[6px] animate-pulse">
+ <Loader2 className="h-[12px] w-[12px] text-[#ec5b16] animate-spin" />
+ <span className="text-[11px] font-medium text-[#ec5b16]">Connecting</span>
+ </div>
);
case 'error':
return (
- <Badge variant="destructive">
- <AlertCircle className="h-3 w-3 mr-1" />
- Error
- </Badge>
+ <div className="flex items-center gap-[4px] px-[8px] py-[3px] bg-[#fef2f2] border border-[#fecaca] rounded-[6px]">
+ <AlertCircle className="h-[12px] w-[12px] text-[#dc2626]" />
+ <span className="text-[11px] font-medium text-[#dc2626]">Error</span>
+ </div>
);
default:
return (
- <Badge variant="outline">
- <WifiOff className="h-3 w-3 mr-1" />
- Disconnected
- </Badge>
+ <div className="flex items-center gap-[4px] px-[8px] py-[3px] bg-[#f7f7f7] border border-[#ededf3] rounded-[6px]">
+ <WifiOff className="h-[12px] w-[12px] text-[#969696]" />
+ <span className="text-[11px] font-medium text-[#969696]">Disconnected</span>
+ </div>
);
}
};
return (
- <Card className={cn('transition-all', !server.isEnabled && 'opacity-60')}>
- <CardHeader className="pb-2">
- <div className="flex items-start justify-between">
- <div className="flex-1">
- <div className="flex items-center gap-2 mb-1">
- <Server className="h-4 w-4 text-slate-500" />
- <CardTitle className="text-base">{server.name}</CardTitle>
+ <div className={`bg-white border border-[#ededf3] rounded-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)] transition-all ${!server.isEnabled ? 'opacity-60' : ''}`}>
+ <div className="px-[16px] py-[14px]">
+ <div className="flex items-start justify-between gap-[12px] mb-[12px]">
+ <div className="flex-1 min-w-0 overflow-hidden">
+ <div className="flex items-center gap-[8px] mb-[4px]">
+ <Server className="h-[16px] w-[16px] text-[#464646] flex-shrink-0" />
+ <h4 className="text-[14px] font-semibold text-[#141420] truncate">{server.name}</h4>
</div>
- <CardDescription className="text-xs">
+ <p className="text-[12px] text-[#969696] truncate">
{server.transport === 'stdio' ? server.command : server.url}
- </CardDescription>
+ </p>
</div>
- {getStatusBadge()}
+ <div className="flex-shrink-0">{getStatusBadge()}</div>
</div>
- </CardHeader>
- <CardContent className="pt-2">
+
{connectionState?.error && (
- <p className="text-xs text-red-500 mb-3 p-2 bg-red-50 dark:bg-red-950/30 rounded">
- {connectionState.error}
- </p>
+ <div className="p-[8px] bg-[#fef2f2] rounded-[8px] mb-[12px]">
+ <p className="text-[12px] text-[#dc2626]">{connectionState.error}</p>
+ </div>
)}
<div className="flex items-center justify-between">
- <div className="flex items-center gap-4">
- <div className="flex items-center gap-2">
- <Switch
- checked={server.isEnabled}
- onCheckedChange={(checked) => onToggleEnabled(server.id, checked)}
- id={`enabled-${server.id}`}
+ <div className="flex items-center gap-[12px]">
+ <div className="flex items-center gap-[6px]">
+ <Toggle
+ enabled={server.isEnabled}
+ onChange={(checked) => onToggleEnabled(server.id, checked)}
/>
- <Label htmlFor={`enabled-${server.id}`} className="text-xs">
- Enabled
- </Label>
+ <span className="text-[12px] text-[#464646]">Enabled</span>
+ </div>
+ <div className="px-[8px] py-[2px] bg-[#f7f7f7] border border-[#ededf3] rounded-[6px]">
+ <span className="text-[11px] font-medium text-[#464646]">{server.transport}</span>
</div>
- <Badge variant="outline" className="text-xs">
- {server.transport}
- </Badge>
{server.autoConnect && (
- <Badge variant="secondary" className="text-xs">
- Auto-connect
- </Badge>
+ <div className="px-[8px] py-[2px] bg-[#fff5ec] border border-[#fed7aa] rounded-[6px]">
+ <span className="text-[11px] font-medium text-[#ec5b16]">Auto-connect</span>
+ </div>
)}
</div>
- <div className="flex gap-1">
+ <div className="flex items-center gap-[4px]">
{status === 'connected' ? (
- <Button
- variant="outline"
- size="sm"
+ <button
onClick={() => onDisconnect(server.id)}
disabled={isConnecting}
+ className="px-[12px] py-[6px] border border-[#ededf3] rounded-[8px] text-[12px] font-medium text-[#464646] hover:bg-[#f7f7f7] transition-colors disabled:opacity-50"
>
Disconnect
- </Button>
+ </button>
) : (
- <Button
- variant="outline"
- size="sm"
+ <button
onClick={() => onConnect(server.id)}
disabled={isConnecting || !server.isEnabled}
+ className="px-[12px] py-[6px] bg-[#ec5b16] hover:bg-[#d9520f] rounded-[8px] text-[12px] font-medium text-white transition-colors disabled:opacity-50"
>
{isConnecting ? (
- <Loader2 className="h-4 w-4 animate-spin" />
+ <Loader2 className="h-[14px] w-[14px] animate-spin" />
) : (
'Connect'
)}
- </Button>
+ </button>
)}
- <Button variant="ghost" size="icon" onClick={() => onEdit(server)}>
- <Pencil className="h-4 w-4" />
- </Button>
+ <button
+ onClick={() => onEdit(server)}
+ className="w-[32px] h-[32px] flex items-center justify-center rounded-[8px] hover:bg-[#f7f7f7] transition-colors"
+ >
+ <Pencil className="h-[14px] w-[14px] text-[#464646]" />
+ </button>
<AlertDialog>
<AlertDialogTrigger asChild>
- <Button variant="ghost" size="icon">
- <Trash2 className="h-4 w-4 text-red-500" />
- </Button>
+ <button className="w-[32px] h-[32px] flex items-center justify-center rounded-[8px] hover:bg-[#fef2f2] transition-colors">
+ <Trash2 className="h-[14px] w-[14px] text-[#dc2626]" />
+ </button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
@@ -214,8 +276,8 @@ function ServerCard({
</AlertDialog>
</div>
</div>
- </CardContent>
- </Card>
+ </div>
+ </div>
);
}
@@ -320,14 +382,25 @@ function AddServerDialog({
const selectedTemplateData = templates.find((t) => t.id === selectedTemplate);
+ const templateOptions = templates.map((t) => ({
+ value: t.id,
+ label: t.name,
+ description: t.description,
+ }));
+
+ const transportOptions = [
+ { value: 'stdio', label: 'Stdio (Local Process)' },
+ { value: 'http', label: 'HTTP/SSE (Remote)' },
+ ];
+
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-xl max-h-[85vh] flex flex-col p-0 gap-0">
- <DialogHeader className="shrink-0 px-6 pt-6 pb-4">
- <DialogTitle>
+ <DialogHeader className="shrink-0 px-[24px] pt-[24px] pb-[16px] border-b border-[#ededf3]">
+ <DialogTitle className="text-[18px] font-semibold text-[#141420]">
{editingServer ? 'Edit MCP Server' : 'Add MCP Server'}
</DialogTitle>
- <DialogDescription>
+ <DialogDescription className="text-[13px] text-[#969696]">
{editingServer
? 'Update the server configuration.'
: 'Connect to an MCP server for CRM, docs, or other integrations.'}
@@ -335,97 +408,80 @@ function AddServerDialog({
</DialogHeader>
<ScrollArea className="flex-1">
- <div className="space-y-4 pl-6 pr-8 pb-4">
+ <div className="space-y-[16px] px-[24px] py-[20px]">
{/* Template Selection */}
{!editingServer && (
- <div className="space-y-2">
- <Label>Start from template (optional)</Label>
- <Select value={selectedTemplate} onValueChange={handleTemplateSelect}>
- <SelectTrigger>
- <SelectValue placeholder="Choose a template..." />
- </SelectTrigger>
- <SelectContent>
- {templates.map((template) => (
- <SelectItem key={template.id} value={template.id}>
- <div className="flex items-center gap-2">
- <Server className="h-4 w-4" />
- <span>{template.name}</span>
- </div>
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
+ <div className="space-y-[6px]">
+ <label className="text-[13px] font-medium text-[#141420]">Start from template (optional)</label>
+ <CustomSelect
+ value={selectedTemplate}
+ onChange={handleTemplateSelect}
+ options={templateOptions}
+ placeholder="Choose a template..."
+ />
{selectedTemplateData && (
- <p className="text-xs text-slate-500">{selectedTemplateData.description}</p>
+ <p className="text-[12px] text-[#969696]">{selectedTemplateData.description}</p>
)}
</div>
)}
{/* Name */}
- <div className="space-y-2">
- <Label htmlFor="name">Server Name</Label>
- <Input
- id="name"
+ <div className="space-y-[6px]">
+ <label className="text-[13px] font-medium text-[#141420]">Server Name</label>
+ <input
+ type="text"
value={form.name}
onChange={(e) => setForm({ ...form, name: e.target.value })}
placeholder="e.g., HubSpot CRM"
- required
+ className="w-full px-[12px] py-[10px] text-[14px] text-[#141420] bg-white border border-[#ededf3] rounded-[10px] outline-none focus:border-[#ec5b16] focus:ring-1 focus:ring-[#ec5b16]/20 transition-colors placeholder:text-[#969696]"
/>
</div>
{/* Transport Type */}
- <div className="space-y-2">
- <Label>Transport Type</Label>
- <Select
+ <div className="space-y-[6px]">
+ <label className="text-[13px] font-medium text-[#141420]">Transport Type</label>
+ <CustomSelect
value={form.transport}
- onValueChange={(v) => setForm({ ...form, transport: v as 'stdio' | 'http' })}
- >
- <SelectTrigger>
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- <SelectItem value="stdio">Stdio (Local Process)</SelectItem>
- <SelectItem value="http">HTTP/SSE (Remote)</SelectItem>
- </SelectContent>
- </Select>
+ onChange={(v) => setForm({ ...form, transport: v as 'stdio' | 'http' })}
+ options={transportOptions}
+ />
</div>
{/* Stdio Config */}
{form.transport === 'stdio' && (
<>
- <div className="space-y-2">
- <Label htmlFor="command">Command</Label>
- <Input
- id="command"
+ <div className="space-y-[6px]">
+ <label className="text-[13px] font-medium text-[#141420]">Command</label>
+ <input
+ type="text"
value={form.command}
onChange={(e) => setForm({ ...form, command: e.target.value })}
placeholder="e.g., npx"
- required
+ className="w-full px-[12px] py-[10px] text-[14px] text-[#141420] bg-white border border-[#ededf3] rounded-[10px] outline-none focus:border-[#ec5b16] focus:ring-1 focus:ring-[#ec5b16]/20 transition-colors placeholder:text-[#969696]"
/>
</div>
- <div className="space-y-2">
- <Label htmlFor="args">Arguments (space-separated)</Label>
- <Input
- id="args"
+ <div className="space-y-[6px]">
+ <label className="text-[13px] font-medium text-[#141420]">Arguments (space-separated)</label>
+ <input
+ type="text"
value={form.args}
onChange={(e) => setForm({ ...form, args: e.target.value })}
placeholder="e.g., -y @modelcontextprotocol/server-memory"
+ className="w-full px-[12px] py-[10px] text-[14px] text-[#141420] bg-white border border-[#ededf3] rounded-[10px] outline-none focus:border-[#ec5b16] focus:ring-1 focus:ring-[#ec5b16]/20 transition-colors placeholder:text-[#969696]"
/>
</div>
{/* Environment Variables for STDIO */}
- <div className="space-y-4 p-4 bg-slate-50 dark:bg-slate-800/50 rounded-lg border border-slate-200 dark:border-slate-700">
- <div className="flex items-center justify-between">
+ <div className="p-[16px] bg-[#f7f7f7] rounded-[12px] border border-[#ededf3]">
+ <div className="flex items-center justify-between mb-[12px]">
<div>
- <Label className="text-sm font-medium">Environment Variables</Label>
- <p className="text-xs text-slate-500 mt-1">
+ <p className="text-[13px] font-medium text-[#141420]">Environment Variables</p>
+ <p className="text-[12px] text-[#969696] mt-[2px]">
Add environment variables for the process (e.g., API_KEY, CODA_TOKEN)
</p>
</div>
- <Button
+ <button
type="button"
- variant="outline"
- size="sm"
onClick={() => {
const key = `ENV_VAR_${Object.keys(form.env).length + 1}`;
setForm({
@@ -433,60 +489,57 @@ function AddServerDialog({
env: { ...form.env, [key]: '' },
});
}}
+ className="flex items-center gap-[4px] px-[10px] py-[6px] border border-[#ededf3] rounded-[8px] bg-white hover:bg-[#f7f7f7] text-[12px] font-medium text-[#464646] transition-colors"
>
- <Plus className="h-3 w-3 mr-1" />
+ <Plus className="h-[12px] w-[12px]" />
Add Variable
- </Button>
+ </button>
</div>
{Object.keys(form.env).length > 0 && (
- <div className="space-y-3 pt-2">
+ <div className="space-y-[8px]">
{Object.entries(form.env).map(([key, value], index) => (
- <div key={index} className="flex gap-3 items-center">
- <div className="flex-1">
- <Input
- placeholder="Variable name (e.g., API_KEY)"
- value={key}
- onChange={(e) => {
- const newEnv = { ...form.env };
- delete newEnv[key];
- newEnv[e.target.value] = value;
- setForm({ ...form, env: newEnv });
- }}
- className="font-mono text-sm"
- />
- </div>
- <div className="flex-1">
- <Input
- placeholder="Value (stored securely)"
- type="password"
- value={value}
- onChange={(e) => {
- setForm({
- ...form,
- env: { ...form.env, [key]: e.target.value },
- });
- }}
- />
- </div>
- <Button
+ <div key={index} className="flex gap-[8px] items-center">
+ <input
+ type="text"
+ placeholder="Variable name (e.g., API_KEY)"
+ value={key}
+ onChange={(e) => {
+ const newEnv = { ...form.env };
+ delete newEnv[key];
+ newEnv[e.target.value] = value;
+ setForm({ ...form, env: newEnv });
+ }}
+ className="flex-1 px-[10px] py-[8px] text-[13px] text-[#141420] bg-white border border-[#ededf3] rounded-[8px] outline-none focus:border-[#ec5b16] font-mono placeholder:text-[#969696]"
+ />
+ <input
+ type="password"
+ placeholder="Value (stored securely)"
+ value={value}
+ onChange={(e) => {
+ setForm({
+ ...form,
+ env: { ...form.env, [key]: e.target.value },
+ });
+ }}
+ className="flex-1 px-[10px] py-[8px] text-[13px] text-[#141420] bg-white border border-[#ededf3] rounded-[8px] outline-none focus:border-[#ec5b16] placeholder:text-[#969696]"
+ />
+ <button
type="button"
- variant="ghost"
- size="icon"
- className="shrink-0 hover:bg-red-50 dark:hover:bg-red-950/30"
onClick={() => {
const newEnv = { ...form.env };
delete newEnv[key];
setForm({ ...form, env: newEnv });
}}
+ className="w-[32px] h-[32px] flex items-center justify-center rounded-[8px] hover:bg-[#fef2f2] transition-colors"
>
- <Trash2 className="h-4 w-4 text-red-500" />
- </Button>
+ <Trash2 className="h-[14px] w-[14px] text-[#dc2626]" />
+ </button>
</div>
))}
</div>
)}
{Object.keys(form.env).length === 0 && (
- <p className="text-xs text-slate-400 dark:text-slate-500 italic pt-1">
+ <p className="text-[12px] text-[#969696] italic">
No environment variables configured
</p>
)}
@@ -497,30 +550,28 @@ function AddServerDialog({
{/* HTTP Config */}
{form.transport === 'http' && (
<>
- <div className="space-y-2">
- <Label htmlFor="url">Server URL</Label>
- <Input
- id="url"
+ <div className="space-y-[6px]">
+ <label className="text-[13px] font-medium text-[#141420]">Server URL</label>
+ <input
+ type="url"
value={form.url}
onChange={(e) => setForm({ ...form, url: e.target.value })}
placeholder="https://mcp-server.example.com"
- required
+ className="w-full px-[12px] py-[10px] text-[14px] text-[#141420] bg-white border border-[#ededf3] rounded-[10px] outline-none focus:border-[#ec5b16] focus:ring-1 focus:ring-[#ec5b16]/20 transition-colors placeholder:text-[#969696]"
/>
</div>
{/* Custom Headers */}
- <div className="space-y-4 p-4 bg-slate-50 dark:bg-slate-800/50 rounded-lg border border-slate-200 dark:border-slate-700">
- <div className="flex items-center justify-between">
+ <div className="p-[16px] bg-[#f7f7f7] rounded-[12px] border border-[#ededf3]">
+ <div className="flex items-center justify-between mb-[12px]">
<div>
- <Label className="text-sm font-medium">Custom Headers</Label>
- <p className="text-xs text-slate-500 mt-1">
+ <p className="text-[13px] font-medium text-[#141420]">Custom Headers</p>
+ <p className="text-[12px] text-[#969696] mt-[2px]">
Add custom HTTP headers for authentication (e.g., Authorization, X-API-Key)
</p>
</div>
- <Button
+ <button
type="button"
- variant="outline"
- size="sm"
onClick={() => {
const key = `Header-${Object.keys(form.headers).length + 1}`;
setForm({
@@ -528,60 +579,57 @@ function AddServerDialog({
headers: { ...form.headers, [key]: '' },
});
}}
+ className="flex items-center gap-[4px] px-[10px] py-[6px] border border-[#ededf3] rounded-[8px] bg-white hover:bg-[#f7f7f7] text-[12px] font-medium text-[#464646] transition-colors"
>
- <Plus className="h-3 w-3 mr-1" />
+ <Plus className="h-[12px] w-[12px]" />
Add Header
- </Button>
+ </button>
</div>
{Object.keys(form.headers).length > 0 && (
- <div className="space-y-3 pt-2">
+ <div className="space-y-[8px]">
{Object.entries(form.headers).map(([key, value], index) => (
- <div key={index} className="flex gap-3 items-center">
- <div className="flex-1">
- <Input
- placeholder="Header name (e.g., Authorization)"
- value={key}
- onChange={(e) => {
- const newHeaders = { ...form.headers };
- delete newHeaders[key];
- newHeaders[e.target.value] = value;
- setForm({ ...form, headers: newHeaders });
- }}
- className="font-mono text-sm"
- />
- </div>
- <div className="flex-1">
- <Input
- placeholder="Value (stored securely)"
- type="password"
- value={value}
- onChange={(e) => {
- setForm({
- ...form,
- headers: { ...form.headers, [key]: e.target.value },
- });
- }}
- />
- </div>
- <Button
+ <div key={index} className="flex gap-[8px] items-center">
+ <input
+ type="text"
+ placeholder="Header name (e.g., Authorization)"
+ value={key}
+ onChange={(e) => {
+ const newHeaders = { ...form.headers };
+ delete newHeaders[key];
+ newHeaders[e.target.value] = value;
+ setForm({ ...form, headers: newHeaders });
+ }}
+ className="flex-1 px-[10px] py-[8px] text-[13px] text-[#141420] bg-white border border-[#ededf3] rounded-[8px] outline-none focus:border-[#ec5b16] font-mono placeholder:text-[#969696]"
+ />
+ <input
+ type="password"
+ placeholder="Value (stored securely)"
+ value={value}
+ onChange={(e) => {
+ setForm({
+ ...form,
+ headers: { ...form.headers, [key]: e.target.value },
+ });
+ }}
+ className="flex-1 px-[10px] py-[8px] text-[13px] text-[#141420] bg-white border border-[#ededf3] rounded-[8px] outline-none focus:border-[#ec5b16] placeholder:text-[#969696]"
+ />
+ <button
type="button"
- variant="ghost"
- size="icon"
- className="shrink-0 hover:bg-red-50 dark:hover:bg-red-950/30"
onClick={() => {
const newHeaders = { ...form.headers };
delete newHeaders[key];
setForm({ ...form, headers: newHeaders });
}}
+ className="w-[32px] h-[32px] flex items-center justify-center rounded-[8px] hover:bg-[#fef2f2] transition-colors"
>
- <Trash2 className="h-4 w-4 text-red-500" />
- </Button>
+ <Trash2 className="h-[14px] w-[14px] text-[#dc2626]" />
+ </button>
</div>
))}
</div>
)}
{Object.keys(form.headers).length === 0 && (
- <p className="text-xs text-slate-400 dark:text-slate-500 italic pt-1">
+ <p className="text-[12px] text-[#969696] italic">
No custom headers configured
</p>
)}
@@ -591,21 +639,20 @@ function AddServerDialog({
{/* Environment Variables (for templates that require them) */}
{selectedTemplateData?.requiredEnvVars && selectedTemplateData.requiredEnvVars.length > 0 && (
- <div className="space-y-4 p-4 bg-amber-50 dark:bg-amber-950/20 rounded-lg border border-amber-200 dark:border-amber-800">
- <div>
- <Label className="text-sm font-medium text-amber-800 dark:text-amber-200">Required Credentials</Label>
- <p className="text-xs text-amber-600 dark:text-amber-400 mt-1">
+ <div className="p-[16px] bg-[#fff5ec] rounded-[12px] border border-[#fed7aa]">
+ <div className="mb-[12px]">
+ <p className="text-[13px] font-medium text-[#ec5b16]">Required Credentials</p>
+ <p className="text-[12px] text-[#d9520f] mt-[2px]">
These credentials are required for this template to work
</p>
</div>
- <div className="space-y-4 pt-2">
+ <div className="space-y-[12px]">
{selectedTemplateData.requiredEnvVars.map((envVar) => (
- <div key={envVar.key} className="space-y-2">
- <Label htmlFor={envVar.key} className="text-sm font-medium">
+ <div key={envVar.key} className="space-y-[6px]">
+ <label className="text-[13px] font-medium text-[#141420]">
{envVar.label}
- </Label>
- <Input
- id={envVar.key}
+ </label>
+ <input
type={envVar.secret ? 'password' : 'text'}
value={form.env[envVar.key] || ''}
onChange={(e) =>
@@ -615,9 +662,10 @@ function AddServerDialog({
})
}
placeholder={envVar.placeholder}
+ className="w-full px-[12px] py-[10px] text-[14px] text-[#141420] bg-white border border-[#ededf3] rounded-[10px] outline-none focus:border-[#ec5b16] focus:ring-1 focus:ring-[#ec5b16]/20 transition-colors placeholder:text-[#969696]"
/>
{envVar.description && (
- <p className="text-xs text-slate-500">{envVar.description}</p>
+ <p className="text-[12px] text-[#969696]">{envVar.description}</p>
)}
</div>
))}
@@ -626,36 +674,30 @@ function AddServerDialog({
)}
{/* Options */}
- <div className="flex items-center gap-6 pt-2">
- <div className="flex items-center gap-2">
- <Switch
- checked={form.isEnabled}
- onCheckedChange={(checked) => setForm({ ...form, isEnabled: checked })}
- id="isEnabled"
+ <div className="flex items-center gap-[24px] pt-[8px]">
+ <div className="flex items-center gap-[8px]">
+ <Toggle
+ enabled={form.isEnabled}
+ onChange={(checked) => setForm({ ...form, isEnabled: checked })}
/>
- <Label htmlFor="isEnabled" className="text-sm">
- Enabled
- </Label>
+ <span className="text-[13px] text-[#141420]">Enabled</span>
</div>
- <div className="flex items-center gap-2">
- <Switch
- checked={form.autoConnect}
- onCheckedChange={(checked) => setForm({ ...form, autoConnect: checked })}
- id="autoConnect"
+ <div className="flex items-center gap-[8px]">
+ <Toggle
+ enabled={form.autoConnect}
+ onChange={(checked) => setForm({ ...form, autoConnect: checked })}
/>
- <Label htmlFor="autoConnect" className="text-sm">
- Auto-connect on startup
- </Label>
+ <span className="text-[13px] text-[#141420]">Auto-connect on startup</span>
</div>
</div>
{/* Setup Instructions */}
{selectedTemplateData?.setupInstructions && (
- <div className="p-3 bg-blue-50 dark:bg-blue-950/30 rounded-lg">
- <Label className="text-sm font-medium text-blue-700 dark:text-blue-300">
+ <div className="p-[12px] bg-[#eff6ff] rounded-[10px] border border-[#bfdbfe]">
+ <p className="text-[13px] font-medium text-[#1d4ed8] mb-[4px]">
Setup Instructions
- </Label>
- <p className="text-xs text-blue-600 dark:text-blue-400 mt-1 whitespace-pre-line">
+ </p>
+ <p className="text-[12px] text-[#3b82f6] whitespace-pre-line">
{selectedTemplateData.setupInstructions}
</p>
{selectedTemplateData.docsUrl && (
@@ -663,10 +705,10 @@ function AddServerDialog({
href={selectedTemplateData.docsUrl}
target="_blank"
rel="noopener noreferrer"
- className="text-xs text-blue-500 hover:underline flex items-center gap-1 mt-2"
+ className="text-[12px] text-[#2563eb] hover:underline flex items-center gap-[4px] mt-[8px]"
>
View documentation
- <ExternalLink className="h-3 w-3" />
+ <ExternalLink className="h-[12px] w-[12px]" />
</a>
)}
</div>
@@ -674,20 +716,27 @@ function AddServerDialog({
</div>
</ScrollArea>
- <DialogFooter className="shrink-0 px-6 py-4 border-t border-slate-200 dark:border-slate-700">
- <Button variant="outline" onClick={() => onOpenChange(false)}>
+ <DialogFooter className="shrink-0 px-[24px] py-[16px] border-t border-[#ededf3] gap-[8px]">
+ <button
+ onClick={() => onOpenChange(false)}
+ className="px-[16px] py-[10px] border border-[#ededf3] rounded-[10px] text-[14px] font-medium text-[#464646] hover:bg-[#f7f7f7] transition-colors"
+ >
Cancel
- </Button>
- <Button onClick={handleSubmit} disabled={isSubmitting || !form.name}>
+ </button>
+ <button
+ onClick={handleSubmit}
+ disabled={isSubmitting || !form.name}
+ className="flex items-center gap-[6px] px-[16px] py-[10px] bg-[#ec5b16] hover:bg-[#d9520f] text-white text-[14px] font-medium rounded-[10px] transition-colors disabled:opacity-50"
+ >
{isSubmitting ? (
- <Loader2 className="h-4 w-4 animate-spin mr-2" />
+ <Loader2 className="h-[14px] w-[14px] animate-spin" />
) : editingServer ? (
- <Check className="h-4 w-4 mr-2" />
+ <Check className="h-[14px] w-[14px]" />
) : (
- <Plus className="h-4 w-4 mr-2" />
+ <Plus className="h-[14px] w-[14px]" />
)}
{editingServer ? 'Save Changes' : 'Add Server'}
- </Button>
+ </button>
</DialogFooter>
</DialogContent>
</Dialog>
@@ -703,21 +752,17 @@ export function MCPServersPanel() {
connectionStates,
connectedServerCount,
toolCount,
- customTriggerKeywords,
loadData,
createServer,
updateServer,
deleteServer,
connect,
disconnect,
- updateTriggerKeywords,
} = useMCP();
const [dialogOpen, setDialogOpen] = useState(false);
const [editingServer, setEditingServer] = useState<MCPServerConfig | null>(null);
const [connectingServers, setConnectingServers] = useState<Set<string>>(new Set());
- const [newKeyword, setNewKeyword] = useState('');
- const [isSavingKeywords, setIsSavingKeywords] = useState(false);
const handleConnect = async (serverId: string) => {
setConnectingServers((prev) => new Set([...prev, serverId]));
@@ -765,147 +810,70 @@ export function MCPServersPanel() {
}
};
- const handleAddKeyword = async () => {
- const keyword = newKeyword.trim().toLowerCase();
- if (!keyword || customTriggerKeywords.includes(keyword)) {
- setNewKeyword('');
- return;
- }
-
- setIsSavingKeywords(true);
- try {
- await updateTriggerKeywords([...customTriggerKeywords, keyword]);
- setNewKeyword('');
- } finally {
- setIsSavingKeywords(false);
- }
- };
-
- const handleRemoveKeyword = async (keyword: string) => {
- setIsSavingKeywords(true);
- try {
- await updateTriggerKeywords(customTriggerKeywords.filter(k => k !== keyword));
- } finally {
- setIsSavingKeywords(false);
- }
- };
-
return (
- <div className="space-y-6">
+ <div className="space-y-[16px]">
{/* Header */}
<div className="flex items-center justify-between">
<div>
- <h2 className="text-lg font-semibold flex items-center gap-2">
- <Server className="h-5 w-5" />
+ <h2 className="text-[16px] font-semibold text-[#141420] flex items-center gap-[8px]">
+ <Server className="h-[18px] w-[18px]" />
MCP Servers
</h2>
- <p className="text-sm text-slate-500 dark:text-slate-400">
+ <p className="text-[13px] text-[#969696] mt-[2px]">
Connect external tools like CRMs, docs, and calendars
</p>
</div>
- <div className="flex items-center gap-2">
- <Badge variant="secondary">
- {connectedServerCount}/{servers.length} connected
- </Badge>
+ <div className="flex items-center gap-[8px]">
+ <div className="px-[10px] py-[4px] bg-[#f7f7f7] border border-[#ededf3] rounded-[8px]">
+ <span className="text-[12px] font-medium text-[#464646]">
+ {connectedServerCount}/{servers.length} connected
+ </span>
+ </div>
{toolCount > 0 && (
- <Badge variant="outline">{toolCount} tools available</Badge>
+ <div className="px-[10px] py-[4px] bg-[#fff5ec] border border-[#fed7aa] rounded-[8px]">
+ <span className="text-[12px] font-medium text-[#ec5b16]">{toolCount} tools</span>
+ </div>
)}
- <Button variant="outline" size="icon" onClick={() => loadData()}>
- <RefreshCw className="h-4 w-4" />
- </Button>
- <Button onClick={() => setDialogOpen(true)}>
- <Plus className="h-4 w-4 mr-2" />
+ <button
+ onClick={() => loadData()}
+ className="w-[32px] h-[32px] flex items-center justify-center border border-[#ededf3] rounded-[8px] bg-white hover:bg-[#f7f7f7] transition-colors"
+ >
+ <RefreshCw className="h-[14px] w-[14px] text-[#464646]" />
+ </button>
+ <button
+ onClick={() => setDialogOpen(true)}
+ className="flex items-center gap-[6px] px-[14px] py-[8px] bg-[#ec5b16] hover:bg-[#d9520f] text-white text-[13px] font-medium rounded-[8px] transition-colors"
+ >
+ <Plus className="h-[14px] w-[14px]" />
Add Server
- </Button>
+ </button>
</div>
</div>
- {/* Trigger Keywords Section */}
- <Card>
- <CardHeader className="pb-3">
- <div className="flex items-center gap-2">
- <Zap className="h-4 w-4 text-amber-500" />
- <CardTitle className="text-base">Trigger Keywords</CardTitle>
- </div>
- <CardDescription className="text-xs">
- Custom keywords that trigger MCP tool lookups during calls. These are added to the default keywords.
- </CardDescription>
- </CardHeader>
- <CardContent className="space-y-3">
- {/* Add new keyword */}
- <div className="flex gap-2">
- <Input
- placeholder="Add a keyword (e.g., 'competitor', 'demo')..."
- value={newKeyword}
- onChange={(e) => setNewKeyword(e.target.value)}
- onKeyDown={(e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- handleAddKeyword();
- }
- }}
- className="flex-1"
- />
- <Button
- size="sm"
- onClick={handleAddKeyword}
- disabled={!newKeyword.trim() || isSavingKeywords}
- >
- {isSavingKeywords ? (
- <Loader2 className="h-4 w-4 animate-spin" />
- ) : (
- <Plus className="h-4 w-4" />
- )}
- </Button>
- </div>
-
- {/* Keywords list */}
- {customTriggerKeywords.length > 0 ? (
- <div className="flex flex-wrap gap-2">
- {customTriggerKeywords.map((keyword) => (
- <Badge
- key={keyword}
- variant="secondary"
- className="flex items-center gap-1 pr-1"
- >
- {keyword}
- <button
- onClick={() => handleRemoveKeyword(keyword)}
- className="ml-1 hover:bg-slate-300 dark:hover:bg-slate-600 rounded-full p-0.5"
- disabled={isSavingKeywords}
- >
- <X className="h-3 w-3" />
- </button>
- </Badge>
- ))}
- </div>
- ) : (
- <p className="text-xs text-slate-500 dark:text-slate-400 italic">
- No custom keywords added. Default keywords like "documentation", "CRM", "calendar", etc. are always active.
- </p>
- )}
- </CardContent>
- </Card>
-
{/* Server List */}
{servers.length === 0 ? (
- <Card>
- <CardContent className="flex flex-col items-center justify-center py-12">
- <Server className="h-12 w-12 text-slate-300 dark:text-slate-600 mb-4" />
- <h3 className="font-medium mb-2">No MCP Servers Configured</h3>
- <p className="text-sm text-slate-500 dark:text-slate-400 text-center max-w-sm mb-4">
+ <div className="bg-white border border-[#ededf3] rounded-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)]">
+ <div className="flex flex-col items-center py-[48px] px-[20px]">
+ <div className="w-[48px] h-[48px] flex items-center justify-center bg-[#f7f7f7] rounded-[12px] mb-[16px]">
+ <Server className="h-[24px] w-[24px] text-[#969696]" />
+ </div>
+ <h3 className="text-[15px] font-semibold text-[#141420] mb-[8px]">No MCP Servers Configured</h3>
+ <p className="text-[13px] text-[#969696] text-center max-w-[320px] mb-[16px]">
Add MCP servers to connect CRMs, documentation, calendars, and other tools
that provide contextual insights during calls.
</p>
- <Button onClick={() => setDialogOpen(true)}>
- <Plus className="h-4 w-4 mr-2" />
+ <button
+ onClick={() => setDialogOpen(true)}
+ className="flex items-center gap-[6px] px-[16px] py-[10px] bg-[#ec5b16] hover:bg-[#d9520f] text-white text-[14px] font-medium rounded-[10px] transition-colors"
+ >
+ <Plus className="h-[14px] w-[14px]" />
Add Your First Server
- </Button>
- </CardContent>
- </Card>
+ </button>
+ </div>
+ </div>
) : (
<ScrollArea className="h-[500px]">
- <div className="space-y-3 pr-4">
+ <div className="space-y-[12px] pr-[16px]">
{servers.map((server) => (
<ServerCard
key={server.id}
diff --git a/src/renderer/components/settings/WorkflowsPanel.tsx b/src/renderer/components/settings/WorkflowsPanel.tsx
new file mode 100644
index 0000000..20fb9c8
--- /dev/null
+++ b/src/renderer/components/settings/WorkflowsPanel.tsx
@@ -0,0 +1,459 @@
+/**
+ * Workflows Panel Component
+ *
+ * Settings panel for managing workflow webhooks (n8n, Zapier, etc.)
+ */
+
+import React, { useState, useEffect } from 'react';
+import {
+ Workflow,
+ Plus,
+ Pencil,
+ Trash2,
+ Loader2,
+ Check,
+ AlertCircle,
+ X,
+ Play,
+} from 'lucide-react';
+
+interface WorkflowItem {
+ id: string;
+ name: string;
+ webhookUrl: string;
+ enabled: boolean;
+ createdAt: string;
+ updatedAt: string;
+}
+
+// Toggle Component
+function Toggle({
+ enabled,
+ onChange,
+}: {
+ enabled: boolean;
+ onChange: (enabled: boolean) => void;
+}) {
+ return (
+ <button
+ onClick={() => onChange(!enabled)}
+ className={`w-[38px] h-[22px] rounded-full relative transition-colors ${
+ enabled ? 'bg-[#ec5b16]' : 'bg-[#e4e4ec]'
+ }`}
+ >
+ <div
+ className={`absolute size-[18px] bg-white rounded-full top-[2px] shadow-[0px_1px_3px_0px_rgba(0,0,0,0.15)] transition-all ${
+ enabled ? 'left-[18px]' : 'left-[2px]'
+ }`}
+ />
+ </button>
+ );
+}
+
+export function WorkflowsPanel() {
+ const [workflows, setWorkflows] = useState<WorkflowItem[]>([]);
+ const [isLoading, setIsLoading] = useState(true);
+ const [error, setError] = useState<string | null>(null);
+
+ // Form state
+ const [showForm, setShowForm] = useState(false);
+ const [editingId, setEditingId] = useState<string | null>(null);
+ const [formName, setFormName] = useState('');
+ const [formUrl, setFormUrl] = useState('');
+ const [formEnabled, setFormEnabled] = useState(true);
+ const [isSaving, setIsSaving] = useState(false);
+ const [formError, setFormError] = useState<string | null>(null);
+
+ // Test state
+ const [testingId, setTestingId] = useState<string | null>(null);
+ const [testResult, setTestResult] = useState<{ id: string; success: boolean; message: string } | null>(null);
+
+ // Load workflows on mount
+ useEffect(() => {
+ loadWorkflows();
+ }, []);
+
+ const loadWorkflows = async () => {
+ setIsLoading(true);
+ try {
+ const result = await window.electronAPI.workflows.getAll();
+ if (result.success && result.workflows) {
+ setWorkflows(result.workflows);
+ } else {
+ setError(result.error || 'Failed to load workflows');
+ }
+ } catch (err) {
+ setError('Failed to load workflows');
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ const handleAdd = () => {
+ setEditingId(null);
+ setFormName('');
+ setFormUrl('');
+ setFormEnabled(true);
+ setFormError(null);
+ setShowForm(true);
+ };
+
+ const handleEdit = (workflow: WorkflowItem) => {
+ setEditingId(workflow.id);
+ setFormName(workflow.name);
+ setFormUrl(workflow.webhookUrl);
+ setFormEnabled(workflow.enabled);
+ setFormError(null);
+ setShowForm(true);
+ };
+
+ const handleCancel = () => {
+ setShowForm(false);
+ setEditingId(null);
+ setFormName('');
+ setFormUrl('');
+ setFormError(null);
+ };
+
+ const handleSave = async () => {
+ // Validate
+ if (!formName.trim()) {
+ setFormError('Name is required');
+ return;
+ }
+ if (!formUrl.trim()) {
+ setFormError('Webhook URL is required');
+ return;
+ }
+ try {
+ new URL(formUrl);
+ } catch {
+ setFormError('Invalid URL format');
+ return;
+ }
+
+ setIsSaving(true);
+ setFormError(null);
+
+ try {
+ if (editingId) {
+ // Update existing
+ const result = await window.electronAPI.workflows.update(editingId, {
+ name: formName.trim(),
+ webhookUrl: formUrl.trim(),
+ enabled: formEnabled,
+ });
+ if (result.success) {
+ await loadWorkflows();
+ handleCancel();
+ } else {
+ setFormError(result.error || 'Failed to update workflow');
+ }
+ } else {
+ // Create new
+ const result = await window.electronAPI.workflows.create({
+ name: formName.trim(),
+ webhookUrl: formUrl.trim(),
+ enabled: formEnabled,
+ });
+ if (result.success) {
+ await loadWorkflows();
+ handleCancel();
+ } else {
+ setFormError(result.error || 'Failed to create workflow');
+ }
+ }
+ } catch (err) {
+ setFormError('An error occurred');
+ } finally {
+ setIsSaving(false);
+ }
+ };
+
+ const handleDelete = async (id: string) => {
+ try {
+ const result = await window.electronAPI.workflows.delete(id);
+ if (result.success) {
+ await loadWorkflows();
+ } else {
+ setError(result.error || 'Failed to delete workflow');
+ }
+ } catch (err) {
+ setError('Failed to delete workflow');
+ }
+ };
+
+ const handleToggleEnabled = async (workflow: WorkflowItem) => {
+ try {
+ const result = await window.electronAPI.workflows.update(workflow.id, {
+ enabled: !workflow.enabled,
+ });
+ if (result.success) {
+ await loadWorkflows();
+ }
+ } catch (err) {
+ // Ignore errors
+ }
+ };
+
+ const handleTest = async (workflow: WorkflowItem) => {
+ setTestingId(workflow.id);
+ setTestResult(null);
+
+ try {
+ const result = await window.electronAPI.workflows.test(workflow.webhookUrl);
+ setTestResult({
+ id: workflow.id,
+ success: result.success,
+ message: result.success
+ ? `Success (${result.responseTime}ms)`
+ : result.error || 'Test failed',
+ });
+ } catch (err) {
+ setTestResult({
+ id: workflow.id,
+ success: false,
+ message: 'Test failed',
+ });
+ } finally {
+ setTestingId(null);
+ }
+ };
+
+ if (isLoading) {
+ return (
+ <div className="flex items-center justify-center py-[48px]">
+ <Loader2 className="h-[24px] w-[24px] animate-spin text-[#969696]" />
+ </div>
+ );
+ }
+
+ return (
+ <div className="space-y-[16px]">
+ {/* Header */}
+ <div className="flex items-center justify-between">
+ <div>
+ <h2 className="text-[16px] font-semibold text-[#141420] flex items-center gap-[8px]">
+ <Workflow className="h-[18px] w-[18px]" />
+ Workflows
+ </h2>
+ <p className="text-[13px] text-[#969696] mt-[2px]">
+ Send meeting data to automation tools like n8n and Zapier
+ </p>
+ </div>
+ {!showForm && (
+ <button
+ onClick={handleAdd}
+ className="flex items-center gap-[6px] px-[14px] py-[8px] bg-[#ec5b16] hover:bg-[#d9520f] text-white text-[13px] font-medium rounded-[8px] transition-colors"
+ >
+ <Plus className="h-[14px] w-[14px]" />
+ Add Workflow
+ </button>
+ )}
+ </div>
+
+ {error && (
+ <div className="p-[12px] bg-[#fef2f2] border border-[#fecaca] rounded-[10px]">
+ <p className="text-[13px] text-[#dc2626] flex items-center gap-[8px]">
+ <AlertCircle className="h-[14px] w-[14px]" />
+ {error}
+ </p>
+ </div>
+ )}
+
+ {/* Add/Edit Form */}
+ {showForm && (
+ <div className="bg-white border border-[#ededf3] rounded-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)]">
+ <div className="px-[20px] py-[16px] border-b border-[#ededf3]">
+ <h3 className="text-[15px] font-semibold text-[#141420]">
+ {editingId ? 'Edit Workflow' : 'New Workflow'}
+ </h3>
+ <p className="text-[13px] text-[#969696] mt-[4px]">
+ Configure a webhook URL to receive meeting data after each recording.
+ </p>
+ </div>
+ <div className="px-[20px] py-[20px] space-y-[16px]">
+ {formError && (
+ <div className="p-[12px] bg-[#fef2f2] border border-[#fecaca] rounded-[10px]">
+ <p className="text-[13px] text-[#dc2626] flex items-center gap-[8px]">
+ <AlertCircle className="h-[14px] w-[14px]" />
+ {formError}
+ </p>
+ </div>
+ )}
+
+ <div className="space-y-[6px]">
+ <label className="text-[13px] font-medium text-[#141420]">Name</label>
+ <input
+ type="text"
+ placeholder="e.g., Notion Sync, n8n Workflow"
+ value={formName}
+ onChange={(e) => setFormName(e.target.value)}
+ className="w-full px-[12px] py-[10px] text-[14px] text-[#141420] bg-white border border-[#ededf3] rounded-[10px] outline-none focus:border-[#ec5b16] focus:ring-1 focus:ring-[#ec5b16]/20 transition-colors placeholder:text-[#969696]"
+ />
+ </div>
+
+ <div className="space-y-[6px]">
+ <label className="text-[13px] font-medium text-[#141420]">Webhook URL</label>
+ <input
+ type="url"
+ placeholder="https://your-webhook-url.com/hook"
+ value={formUrl}
+ onChange={(e) => setFormUrl(e.target.value)}
+ className="w-full px-[12px] py-[10px] text-[14px] text-[#141420] bg-white border border-[#ededf3] rounded-[10px] outline-none focus:border-[#ec5b16] focus:ring-1 focus:ring-[#ec5b16]/20 transition-colors placeholder:text-[#969696] font-mono text-[13px]"
+ />
+ <p className="text-[12px] text-[#969696]">
+ The URL that will receive POST requests with meeting data
+ </p>
+ </div>
+
+ <div className="flex items-center justify-between py-[8px]">
+ <div>
+ <p className="text-[13px] font-medium text-[#141420]">Enabled</p>
+ <p className="text-[12px] text-[#969696]">
+ Only enabled workflows will be triggered
+ </p>
+ </div>
+ <Toggle enabled={formEnabled} onChange={setFormEnabled} />
+ </div>
+
+ <div className="flex items-center gap-[8px] pt-[8px]">
+ <button
+ onClick={handleSave}
+ disabled={isSaving}
+ className="flex items-center gap-[6px] px-[16px] py-[10px] bg-[#ec5b16] hover:bg-[#d9520f] text-white text-[14px] font-medium rounded-[10px] transition-colors disabled:opacity-50"
+ >
+ {isSaving && <Loader2 className="h-[14px] w-[14px] animate-spin" />}
+ {editingId ? 'Update' : 'Create'}
+ </button>
+ <button
+ onClick={handleCancel}
+ className="px-[16px] py-[10px] border border-[#ededf3] rounded-[10px] text-[14px] font-medium text-[#464646] hover:bg-[#f7f7f7] transition-colors"
+ >
+ Cancel
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Workflows List */}
+ {workflows.length === 0 && !showForm ? (
+ <div className="bg-white border border-[#ededf3] rounded-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)]">
+ <div className="flex flex-col items-center py-[48px] px-[20px]">
+ <div className="w-[48px] h-[48px] flex items-center justify-center bg-[#f7f7f7] rounded-[12px] mb-[16px]">
+ <Workflow className="h-[24px] w-[24px] text-[#969696]" />
+ </div>
+ <p className="text-[14px] text-[#464646] text-center mb-[8px]">
+ No workflows configured yet
+ </p>
+ <p className="text-[13px] text-[#969696] text-center max-w-[320px] mb-[16px]">
+ Add a webhook URL to automatically send meeting recordings, summaries, and action items to your automation tools.
+ </p>
+ <button
+ onClick={handleAdd}
+ className="flex items-center gap-[6px] px-[16px] py-[10px] bg-[#ec5b16] hover:bg-[#d9520f] text-white text-[14px] font-medium rounded-[10px] transition-colors"
+ >
+ <Plus className="h-[14px] w-[14px]" />
+ Add Your First Workflow
+ </button>
+ </div>
+ </div>
+ ) : (
+ <div className="space-y-[12px]">
+ {workflows.map((workflow) => (
+ <div key={workflow.id} className="bg-white border border-[#ededf3] rounded-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)] px-[16px] py-[14px]">
+ <div className="flex items-start justify-between">
+ <div className="flex-1 min-w-0">
+ <div className="flex items-center gap-[8px] mb-[4px]">
+ <h4 className="text-[14px] font-medium text-[#141420] truncate">{workflow.name}</h4>
+ <div className={`px-[8px] py-[2px] rounded-[6px] ${
+ workflow.enabled
+ ? 'bg-[#ecfdf5] text-[#059669]'
+ : 'bg-[#f7f7f7] text-[#969696]'
+ }`}>
+ <span className="text-[11px] font-medium">
+ {workflow.enabled ? 'Enabled' : 'Disabled'}
+ </span>
+ </div>
+ {testResult && testResult.id === workflow.id && (
+ <div className={`flex items-center gap-[4px] px-[8px] py-[2px] rounded-[6px] ${
+ testResult.success
+ ? 'bg-[#ecfdf5] text-[#059669]'
+ : 'bg-[#fef2f2] text-[#dc2626]'
+ }`}>
+ {testResult.success ? (
+ <Check className="h-[12px] w-[12px]" />
+ ) : (
+ <X className="h-[12px] w-[12px]" />
+ )}
+ <span className="text-[11px] font-medium">{testResult.message}</span>
+ </div>
+ )}
+ </div>
+ <p className="text-[12px] text-[#969696] truncate font-mono">
+ {workflow.webhookUrl}
+ </p>
+ </div>
+
+ <div className="flex items-center gap-[4px] ml-[16px]">
+ <button
+ onClick={() => handleTest(workflow)}
+ disabled={testingId === workflow.id}
+ title="Test webhook"
+ className="w-[32px] h-[32px] flex items-center justify-center rounded-[8px] hover:bg-[#f7f7f7] transition-colors disabled:opacity-50"
+ >
+ {testingId === workflow.id ? (
+ <Loader2 className="h-[16px] w-[16px] animate-spin text-[#464646]" />
+ ) : (
+ <Play className="h-[16px] w-[16px] text-[#464646]" />
+ )}
+ </button>
+ <button
+ onClick={() => handleEdit(workflow)}
+ title="Edit workflow"
+ className="w-[32px] h-[32px] flex items-center justify-center rounded-[8px] hover:bg-[#f7f7f7] transition-colors"
+ >
+ <Pencil className="h-[16px] w-[16px] text-[#464646]" />
+ </button>
+ <button
+ onClick={() => handleDelete(workflow.id)}
+ title="Delete workflow"
+ className="w-[32px] h-[32px] flex items-center justify-center rounded-[8px] hover:bg-[#fef2f2] transition-colors"
+ >
+ <Trash2 className="h-[16px] w-[16px] text-[#dc2626]" />
+ </button>
+ <Toggle
+ enabled={workflow.enabled}
+ onChange={() => handleToggleEnabled(workflow)}
+ />
+ </div>
+ </div>
+ </div>
+ ))}
+ </div>
+ )}
+
+ {/* Info Card */}
+ <div className="bg-white border border-[#ededf3] rounded-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)]">
+ <div className="px-[20px] py-[16px]">
+ <h4 className="text-[14px] font-semibold text-[#141420] mb-[8px]">
+ Webhook Payload
+ </h4>
+ <p className="text-[13px] text-[#464646] mb-[8px]">
+ After each meeting recording, enabled workflows receive a POST request with:
+ </p>
+ <ul className="text-[13px] text-[#969696] space-y-[4px] list-disc list-inside">
+ <li>Meeting title, description, and duration</li>
+ <li>VideoDB video ID and player URL</li>
+ <li>AI-generated summary and topics</li>
+ <li>Action items and post-meeting checklist</li>
+ <li>Full transcript (if available)</li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ );
+}
+
+export default WorkflowsPanel;
diff --git a/src/renderer/hooks/useGlobalRecorderEvents.ts b/src/renderer/hooks/useGlobalRecorderEvents.ts
index cf86e35..18a3c3d 100644
--- a/src/renderer/hooks/useGlobalRecorderEvents.ts
+++ b/src/renderer/hooks/useGlobalRecorderEvents.ts
@@ -75,17 +75,23 @@ export function useGlobalRecorderEvents() {
// Forward transcript to copilot backend (for final segments only)
const currentApi = getElectronAPI();
- if (transcript.isFinal && useCopilotStore.getState().isCallActive && currentApi) {
- // Map source to channel: 'mic' -> 'me', 'system_audio' -> 'them'
- const channel: 'me' | 'them' = transcript.source === 'mic' ? 'me' : 'them';
-
- currentApi.copilot.sendTranscript(channel, {
- text: transcript.text,
- is_final: true,
- start: transcript.start,
- end: transcript.end,
- }).catch((err: Error) => {
- console.warn('[GlobalRecorderEvents] Error forwarding transcript to copilot:', err);
+ if (transcript.isFinal && currentApi) {
+ // Forward to copilot if active
+ if (useCopilotStore.getState().isCallActive) {
+ const channel: 'me' | 'them' = transcript.source === 'mic' ? 'me' : 'them';
+ currentApi.copilot.sendTranscript(channel, {
+ text: transcript.text,
+ is_final: true,
+ start: transcript.start,
+ end: transcript.end,
+ }).catch((err: Error) => {
+ console.warn('[GlobalRecorderEvents] Error forwarding transcript to copilot:', err);
+ });
+ }
+
+ // Forward to live assist service for real-time analysis
+ currentApi.liveAssist.addTranscript(transcript.text, transcript.source).catch((err: Error) => {
+ console.warn('[GlobalRecorderEvents] Error forwarding transcript to live assist:', err);
});
}
}
diff --git a/src/renderer/hooks/useLiveAssist.ts b/src/renderer/hooks/useLiveAssist.ts
new file mode 100644
index 0000000..0091388
--- /dev/null
+++ b/src/renderer/hooks/useLiveAssist.ts
@@ -0,0 +1,71 @@
+/**
+ * useLiveAssist Hook
+ *
+ * Manages the live assist feature lifecycle and subscribes to
+ * assist updates from the main process.
+ */
+
+import { useEffect, useRef } from 'react';
+import { useLiveAssistStore } from '../stores/live-assist.store';
+import { useSessionStore } from '../stores/session.store';
+import { getElectronAPI } from '../api/ipc';
+import type { LiveAssistItem } from '../../shared/types/live-assist.types';
+
+export function useLiveAssist() {
+ const store = useLiveAssistStore();
+ const { status } = useSessionStore();
+ const isRecording = status === 'recording';
+ const wasRecordingRef = useRef(false);
+
+ // Start/stop live assist based on recording state
+ useEffect(() => {
+ const api = getElectronAPI();
+ if (!api) return;
+
+ if (isRecording && !wasRecordingRef.current) {
+ // Recording just started
+ console.log('[LiveAssist] Starting live assist service');
+ api.liveAssist.start().catch(err => {
+ console.error('[LiveAssist] Failed to start:', err);
+ });
+ wasRecordingRef.current = true;
+ } else if (!isRecording && wasRecordingRef.current) {
+ // Recording just stopped
+ console.log('[LiveAssist] Stopping live assist service');
+ api.liveAssist.stop().catch(err => {
+ console.error('[LiveAssist] Failed to stop:', err);
+ });
+ store.clear();
+ wasRecordingRef.current = false;
+ }
+ }, [isRecording, store]);
+
+ // Subscribe to live assist updates
+ useEffect(() => {
+ const api = getElectronAPI();
+ if (!api) return;
+
+ console.log('[LiveAssist] Setting up event listener');
+
+ const unsubscribe = api.liveAssistOn.onUpdate((event) => {
+ console.log('[LiveAssist] Received assists:', event.assists.length);
+ const assists = event.assists as LiveAssistItem[];
+ store.addAssists(assists);
+ });
+
+ return () => {
+ console.log('[LiveAssist] Cleaning up event listener');
+ unsubscribe();
+ };
+ }, [store]);
+
+ return {
+ assists: store.assists,
+ isProcessing: store.isProcessing,
+ lastProcessedAt: store.lastProcessedAt,
+ error: store.error,
+ clear: store.clear,
+ };
+}
+
+export default useLiveAssist;
diff --git a/src/renderer/stores/live-assist.store.ts b/src/renderer/stores/live-assist.store.ts
new file mode 100644
index 0000000..712a3a0
--- /dev/null
+++ b/src/renderer/stores/live-assist.store.ts
@@ -0,0 +1,64 @@
+/**
+ * Live Assist Store
+ *
+ * Manages the state for real-time meeting assists generated
+ * from transcript analysis every 20 seconds.
+ */
+
+import { create } from 'zustand';
+import type { LiveAssistItem } from '../../shared/types/live-assist.types';
+
+interface LiveAssistState {
+ assists: LiveAssistItem[];
+ isProcessing: boolean;
+ lastProcessedAt: number | null;
+ error: string | null;
+
+ // Actions
+ setAssists: (assists: LiveAssistItem[]) => void;
+ addAssists: (assists: LiveAssistItem[]) => void;
+ setProcessing: (isProcessing: boolean) => void;
+ setError: (error: string | null) => void;
+ clear: () => void;
+}
+
+export const useLiveAssistStore = create<LiveAssistState>((set) => ({
+ assists: [],
+ isProcessing: false,
+ lastProcessedAt: null,
+ error: null,
+
+ setAssists: (assists) => set({
+ assists,
+ lastProcessedAt: Date.now(),
+ error: null,
+ }),
+
+ addAssists: (newAssists) => set((state) => {
+ // Deduplicate by text to avoid repeating the same assist
+ const existingTexts = new Set(state.assists.map(a => a.text.toLowerCase()));
+ const uniqueNewAssists = newAssists.filter(
+ a => !existingTexts.has(a.text.toLowerCase())
+ );
+
+ // Keep last 10 assists max
+ const combined = [...state.assists, ...uniqueNewAssists].slice(-10);
+
+ return {
+ assists: combined,
+ lastProcessedAt: Date.now(),
+ error: null,
+ };
+ }),
+
+ setProcessing: (isProcessing) => set({ isProcessing }),
+
+ setError: (error) => set({ error, isProcessing: false }),
+
+ clear: () => set({
+ assists: [],
+ isProcessing: false,
+ lastProcessedAt: null,
+ error: null,
+ }),
+}));
diff --git a/src/shared/schemas/recording.schema.ts b/src/shared/schemas/recording.schema.ts
index ec360ff..6050102 100644
--- a/src/shared/schemas/recording.schema.ts
+++ b/src/shared/schemas/recording.schema.ts
@@ -57,7 +57,6 @@ export const MetricsSnapshotSchema = z.object({
// Meeting Setup schemas
export const ProbingQuestionSchema = z.object({
question: z.string(),
- type: z.enum(['single-choice', 'multi-choice']),
options: z.array(z.string()),
answer: z.string(),
customAnswer: z.string().optional(),
@@ -92,6 +91,8 @@ export const RecordingSchema = z.object({
meetingDescription: z.string().nullable().optional(),
probingQuestions: z.array(ProbingQuestionSchema).nullable().optional(),
meetingChecklist: z.array(z.string()).nullable().optional(),
+ // Post-meeting analysis
+ postMeetingChecklist: z.array(z.string()).nullable().optional(),
});
export const CreateRecordingInputSchema = z.object({
diff --git a/src/shared/types/ipc.types.ts b/src/shared/types/ipc.types.ts
index ae1ff8e..492d4b7 100644
--- a/src/shared/types/ipc.types.ts
+++ b/src/shared/types/ipc.types.ts
@@ -4,6 +4,7 @@ import type {
CalendarEvents,
UpcomingMeeting,
} from './calendar.types';
+import type { Workflow } from './workflow.types';
export interface StartRecordingParams {
config: CaptureConfig;
@@ -167,6 +168,26 @@ export interface CopilotConfig {
enableNudges: boolean;
}
+export interface LiveAssistApi {
+ start: () => Promise<{ success: boolean }>;
+ stop: () => Promise<{ success: boolean }>;
+ addTranscript: (text: string, source: 'mic' | 'system_audio') => Promise<{ success: boolean }>;
+ clear: () => Promise<{ success: boolean }>;
+}
+
+export interface LiveAssistEvents {
+ onUpdate: (callback: (data: { assists: any[]; processedAt: number }) => void) => () => void;
+}
+
+export interface WorkflowsApi {
+ getAll: () => Promise<{ success: boolean; workflows?: Workflow[]; error?: string }>;
+ get: (id: string) => Promise<{ success: boolean; workflow?: Workflow; error?: string }>;
+ create: (request: { name: string; webhookUrl: string; enabled?: boolean }) => Promise<{ success: boolean; workflow?: Workflow; error?: string }>;
+ update: (id: string, request: { name?: string; webhookUrl?: string; enabled?: boolean }) => Promise<{ success: boolean; workflow?: Workflow; error?: string }>;
+ delete: (id: string) => Promise<{ success: boolean; error?: string }>;
+ test: (webhookUrl: string) => Promise<{ success: boolean; statusCode?: number; error?: string; responseTime?: number }>;
+}
+
export interface IpcApi {
capture: {
startRecording: (params: StartRecordingParams) => Promise<StartRecordingResult>;
@@ -175,6 +196,8 @@ export interface IpcApi {
resumeTracks: (tracks: string[]) => Promise<void>;
listChannels: (sessionToken: string, apiUrl?: string) => Promise<Channel[]>;
};
+ liveAssist: LiveAssistApi;
+ liveAssistOn: LiveAssistEvents;
permissions: {
checkMicPermission: () => Promise<boolean>;
checkScreenPermission: () => Promise<boolean>;
@@ -243,6 +266,7 @@ export interface IpcApi {
};
calendar: CalendarApi;
calendarOn: CalendarEvents;
+ workflows: WorkflowsApi;
}
export type IpcChannel =
diff --git a/src/shared/types/live-assist.types.ts b/src/shared/types/live-assist.types.ts
new file mode 100644
index 0000000..b2dee84
--- /dev/null
+++ b/src/shared/types/live-assist.types.ts
@@ -0,0 +1,32 @@
+/**
+ * Live Assist Types
+ *
+ * Types for the real-time meeting assist feature that analyzes
+ * transcript chunks and provides contextual suggestions.
+ */
+
+export type AssistType = 'ask' | 'speak' | 'act';
+export type AssistUrgency = 'now' | 'soon' | 'later';
+
+export interface LiveAssistItem {
+ id: string;
+ type: AssistType;
+ urgency: AssistUrgency;
+ text: string;
+ reason: string;
+ timestamp: number; // When this assist was generated
+}
+
+export interface LiveAssistResponse {
+ assists: Array<{
+ type: AssistType;
+ urgency: AssistUrgency;
+ text: string;
+ reason: string;
+ }>;
+}
+
+export interface LiveAssistEvent {
+ assists: LiveAssistItem[];
+ processedAt: number;
+}
diff --git a/src/shared/types/meeting-setup.types.ts b/src/shared/types/meeting-setup.types.ts
index b916aba..86568d4 100644
--- a/src/shared/types/meeting-setup.types.ts
+++ b/src/shared/types/meeting-setup.types.ts
@@ -5,10 +5,9 @@
export interface ProbingQuestion {
question: string;
- type: 'single-choice' | 'multi-choice';
options: string[];
- answer: string; // comma-separated for multi-choice
- customAnswer?: string; // 5th "other" option for custom input
+ answer: string; // comma-separated selected options
+ customAnswer?: string; // "other" option for custom input
}
export interface MeetingSetup {
@@ -26,9 +25,7 @@ export interface MeetingSetupStep {
export interface ProbingQuestionsResponse {
questions: Array<{
question: string;
- type: 'single-choice' | 'multi-choice';
options: string[];
- answer: string;
}>;
}
diff --git a/src/shared/types/workflow.types.ts b/src/shared/types/workflow.types.ts
new file mode 100644
index 0000000..74ebec3
--- /dev/null
+++ b/src/shared/types/workflow.types.ts
@@ -0,0 +1,104 @@
+/**
+ * Workflow Types
+ *
+ * Types for workflow webhook integrations (n8n, Zapier, etc.)
+ */
+
+export interface Workflow {
+ id: string;
+ name: string;
+ webhookUrl: string;
+ enabled: boolean;
+ createdAt: string;
+ updatedAt: string;
+}
+
+export interface CreateWorkflowRequest {
+ name: string;
+ webhookUrl: string;
+ enabled?: boolean;
+}
+
+export interface UpdateWorkflowRequest {
+ name?: string;
+ webhookUrl?: string;
+ enabled?: boolean;
+}
+
+/**
+ * Payload sent to webhook after meeting completion
+ */
+export interface WorkflowWebhookPayload {
+ /** Unique ID for this webhook call */
+ callId: string;
+
+ /** Timestamp when the webhook was triggered */
+ triggeredAt: string;
+
+ /** Meeting information */
+ meeting: {
+ /** Recording ID in the local database */
+ recordingId: number;
+
+ /** Meeting title/name */
+ title: string;
+
+ /** Meeting description (if provided during setup) */
+ description?: string;
+
+ /** When the recording started */
+ startedAt: string;
+
+ /** When the recording ended */
+ endedAt: string;
+
+ /** Duration in seconds */
+ durationSeconds: number;
+ };
+
+ /** VideoDB export information */
+ videodb: {
+ /** Exported video ID from VideoDB */
+ exportedVideoId: string;
+
+ /** Player URL to view the recording */
+ playerUrl: string;
+
+ /** Stream ID */
+ streamId?: string;
+ };
+
+ /** AI-generated content */
+ content: {
+ /** Meeting summary */
+ summary?: string;
+
+ /** Key topics discussed */
+ topics?: string[];
+
+ /** Action items extracted from the meeting */
+ actionItems?: string[];
+
+ /** Post-meeting checklist items */
+ checklist?: Array<{
+ text: string;
+ completed: boolean;
+ }>;
+ };
+
+ /** Full transcript (if available) */
+ transcript?: Array<{
+ speaker: 'me' | 'them';
+ text: string;
+ timestamp: number;
+ }>;
+}
+
+export interface WorkflowWebhookResult {
+ workflowId: string;
+ workflowName: string;
+ success: boolean;
+ statusCode?: number;
+ error?: string;
+ responseTime?: number;
+}