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: simple meeting summary support

Om Gated3d5683f7055
diff --git a/src/main/services/copilot/index.ts b/src/main/services/copilot/index.ts
index 13f5d99..5317013 100644
--- a/src/main/services/copilot/index.ts
+++ b/src/main/services/copilot/index.ts
@@ -101,10 +101,5 @@ export {
getSummaryGenerator,
resetSummaryGenerator,
type CallSummary,
- type ActionItem,
- type Concern,
- type Objection,
- type Commitment,
- type Evidence,
type FullCallReport,
} from './summary-generator.service';
diff --git a/src/main/services/copilot/sales-copilot.service.ts b/src/main/services/copilot/sales-copilot.service.ts
index 280eec8..445c35a 100644
--- a/src/main/services/copilot/sales-copilot.service.ts
+++ b/src/main/services/copilot/sales-copilot.service.ts
@@ -666,31 +666,20 @@ export class MeetingCopilotService extends EventEmitter {
log.info({
recordingId,
elapsedMs: summaryElapsed,
- bullets: summary.bullets.length,
- concerns: summary.concerns?.length || 0,
- nextSteps: summary.nextSteps.length,
+ summaryLength: summary.summary.length,
}, 'Summary generation completed');
} catch (error) {
const errMsg = error instanceof Error ? error.message : 'Unknown error';
log.error({ err: error, errorMessage: errMsg, recordingId }, 'Failed to generate summary');
summary = {
- bullets: [],
- customerPain: [],
- customerGoals: [],
- concerns: [],
- objections: [],
- commitments: [],
- nextSteps: [],
- keyDecisions: [],
- openQuestions: [],
- riskFlags: ['Summary generation failed: ' + errMsg],
+ summary: `## Meeting Summary\n\nSummary generation failed: ${errMsg}`,
generatedAt: Date.now(),
};
}
// Save to database
try {
- log.info({ recordingId, hasSummary: summary.bullets.length > 0 }, 'Saving call data to database');
+ log.info({ recordingId, hasSummary: summary.summary.length > 0 }, 'Saving call data to database');
updateRecording(recordingId, {
callSummary: JSON.stringify(summary),
playbookSnapshot: playbookSnapshot ? JSON.stringify(playbookSnapshot) : undefined,
@@ -704,7 +693,7 @@ export class MeetingCopilotService extends EventEmitter {
}
// Emit end event
- log.info({ recordingId, hasSummary: summary.bullets.length > 0 }, 'Emitting call-ended event');
+ log.info({ recordingId, hasSummary: summary.summary.length > 0 }, 'Emitting call-ended event');
this.emit('call-ended', {
summary,
playbook: playbookSnapshot || undefined,
diff --git a/src/main/services/copilot/summary-generator.service.ts b/src/main/services/copilot/summary-generator.service.ts
index b70e745..5d90f5e 100644
--- a/src/main/services/copilot/summary-generator.service.ts
+++ b/src/main/services/copilot/summary-generator.service.ts
@@ -1,9 +1,8 @@
/**
* Summary Generator Service
*
- * Fast extraction of key meeting outcomes using parallel LLM calls.
- * Generates summary bullets, pain points, concerns, commitments,
- * and next steps with evidence linking to transcript timestamps.
+ * Generates a clean, high-quality meeting summary using a single LLM call.
+ * Outputs a well-formatted markdown summary with action items.
*/
import { logger } from '../../lib/logger';
@@ -16,52 +15,11 @@ const log = logger.child({ module: 'summary-generator' });
// Types
-export interface Evidence {
- segmentId: string;
- timestamp: number;
- excerpt: string;
- channel: 'me' | 'them';
-}
-
-export interface ActionItem {
- action: string;
- owner: 'me' | 'them' | 'both';
- deadline?: string;
- priority: 'high' | 'medium' | 'low';
- evidence: Evidence[];
-}
-
-export interface Concern {
- type: string;
- text: string;
- response?: string;
- resolved: boolean;
- timestamp: number;
-}
-
-// Backwards compatibility alias
-export type Objection = Concern;
-
-export interface Commitment {
- who: 'me' | 'them';
- commitment: string;
- timestamp: number;
- context?: string;
-}
-
export interface CallSummary {
- bullets: string[]; // 5-10 bullet summary
- customerPain: string[]; // Challenges discussed (field name kept for backwards compat)
- customerGoals: string[]; // Objectives identified (field name kept for backwards compat)
- concerns: Concern[]; // Concerns raised during the meeting
- commitments: Commitment[];
- nextSteps: ActionItem[];
- keyDecisions: string[];
- openQuestions: string[]; // Unresolved questions
- riskFlags: string[];
+ /** The complete meeting summary as markdown text */
+ summary: string;
+ /** When the summary was generated */
generatedAt: number;
- // Backwards compatibility aliases
- objections?: Concern[];
}
export interface FullCallReport {
@@ -78,7 +36,7 @@ export class SummaryGeneratorService {
constructor() {}
/**
- * Generate full call summary using parallel extraction
+ * Generate a comprehensive meeting summary
*/
async generate(segments: TranscriptSegmentData[]): Promise<CallSummary> {
const finalSegments = segments.filter(s => s.isFinal);
@@ -87,440 +45,198 @@ export class SummaryGeneratorService {
return this.emptyResults();
}
- log.info({ segmentCount: finalSegments.length }, 'Generating call summary');
+ log.info({ segmentCount: finalSegments.length }, 'Generating meeting summary');
- // Run extractions in parallel for speed with error handling
- let bullets: string[] = [];
- let painAndGoals: { pain: string[]; goals: string[] } = { pain: [], goals: [] };
- let concerns: Concern[] = [];
- let commitments: Commitment[] = [];
- let nextSteps: ActionItem[] = [];
- let decisions: string[] = [];
- let openQuestions: string[] = [];
+ const transcript = this.formatTranscript(finalSegments);
+ const duration = this.calculateDuration(finalSegments);
+ const llm = getLLMService();
- try {
- const results = await Promise.allSettled([
- this.extractBullets(finalSegments),
- this.extractPainAndGoals(finalSegments),
- this.extractConcerns(finalSegments),
- this.extractCommitments(finalSegments),
- this.extractNextSteps(finalSegments),
- this.extractDecisions(finalSegments),
- this.extractOpenQuestions(finalSegments),
- ]);
-
- // Process results, using defaults for any that failed
- bullets = results[0].status === 'fulfilled' ? results[0].value : [];
- painAndGoals = results[1].status === 'fulfilled' ? results[1].value : { pain: [], goals: [] };
- concerns = results[2].status === 'fulfilled' ? results[2].value : [];
- commitments = results[3].status === 'fulfilled' ? results[3].value : [];
- nextSteps = results[4].status === 'fulfilled' ? results[4].value : [];
- decisions = results[5].status === 'fulfilled' ? results[5].value : [];
- openQuestions = results[6].status === 'fulfilled' ? results[6].value : [];
-
- // Log any failures
- const failures = results.filter(r => r.status === 'rejected');
- if (failures.length > 0) {
- log.warn({
- failedCount: failures.length,
- errors: failures.map((f, i) => ({
- index: i,
- reason: f.status === 'rejected' ? f.reason?.message || f.reason : 'unknown'
- }))
- }, 'Some summary extractions failed');
- }
+ const prompt = `You are an expert meeting note-taker. Generate a comprehensive, well-organized meeting summary from the following transcript.
- log.info({
- bullets: bullets.length,
- painPoints: painAndGoals.pain.length,
- goals: painAndGoals.goals.length,
- concerns: concerns.length,
- commitments: commitments.length,
- nextSteps: nextSteps.length,
- decisions: decisions.length,
- openQuestions: openQuestions.length,
- }, 'Summary extraction complete');
- } catch (error) {
- log.error({ error }, 'Summary generation failed completely');
- }
+MEETING DURATION: ${this.formatDuration(duration)}
- // Extract risk flags from various sources
- const riskFlags = this.identifyRisks(concerns, painAndGoals.pain, commitments);
+TRANSCRIPT:
+${transcript}
- return {
- bullets,
- customerPain: painAndGoals.pain,
- customerGoals: painAndGoals.goals,
- concerns,
- objections: concerns, // Backwards compatibility
- commitments,
- nextSteps,
- keyDecisions: decisions,
- openQuestions,
- riskFlags,
- generatedAt: Date.now(),
- };
- }
+---
- /**
- * Generate quick summary (faster, less detailed)
- */
- async generateQuick(segments: TranscriptSegmentData[]): Promise<Partial<CallSummary>> {
- const finalSegments = segments.filter(s => s.isFinal);
+Generate a professional meeting summary in markdown format. The summary should be:
+- Clear and concise
+- Well-organized with proper headings
+- Actionable with specific to-dos
- if (finalSegments.length === 0) {
- return { bullets: [], nextSteps: [] };
- }
+Use this structure:
- // Just extract bullets and next steps
- const [bullets, nextSteps] = await Promise.all([
- this.extractBullets(finalSegments),
- this.extractNextSteps(finalSegments),
- ]);
+## Meeting Summary
- return {
- bullets,
- nextSteps,
- generatedAt: Date.now(),
- };
- }
+A 2-3 sentence overview of what this meeting was about and the main outcome.
- /**
- * Extract summary bullets
- */
- private async extractBullets(segments: TranscriptSegmentData[]): Promise<string[]> {
- const transcript = this.formatTranscript(segments);
- const llm = getLLMService();
+## Key Discussion Points
- const prompt = `Summarize this meeting in 5-8 concise bullet points.
-Focus on: what was discussed, key decisions, main concerns, and outcomes.
+- Bullet points of the main topics discussed
+- Include important details and context
+- Note any significant points raised by participants
-${transcript}
+## Decisions Made
-Respond with JSON:
-{
- "bullets": ["bullet 1", "bullet 2", ...]
-}`;
+- List any decisions that were reached
+- Include the reasoning if discussed
+- Skip this section if no clear decisions were made
- try {
- const response = await llm.completeJSON<{ bullets: string[] }>(
- prompt,
- 'You are a meeting summarization expert. Return valid JSON only.'
- );
+## Action Items
- if (response.success && response.data) {
- return response.data.bullets || [];
- }
- } catch (error) {
- log.warn({ error }, 'Bullet extraction failed');
- }
+- [ ] Specific task - Owner (if mentioned)
+- [ ] Another task - Owner
+- List all commitments and follow-ups mentioned
+- Include deadlines if specified
- return [];
- }
+## Notes
- /**
- * Extract challenges and objectives discussed
- */
- private async extractPainAndGoals(
- segments: TranscriptSegmentData[]
- ): Promise<{ pain: string[]; goals: string[] }> {
- // Focus on other participant statements
- const themSegments = segments.filter(s => s.channel === 'them');
- const transcript = this.formatTranscript(themSegments);
- const llm = getLLMService();
-
- const prompt = `Extract challenges discussed and objectives/goals mentioned from this meeting.
+- Any other important information
+- Open questions or items needing follow-up
+- Skip this section if nothing additional to note
-Participant statements:
-${transcript}
+---
-Respond with JSON:
-{
- "pain_points": ["challenge 1", "challenge 2"],
- "goals": ["objective 1", "objective 2"]
-}`;
+Important:
+- Write in a professional but conversational tone
+- Be specific - use names, dates, and details from the transcript
+- Focus on what's actionable and important
+- Don't include filler or obvious statements
+- If something wasn't discussed, don't make it up`;
try {
- const response = await llm.completeJSON<{
- pain_points: string[];
- goals: string[];
- }>(prompt, 'You are a meeting analysis expert. Return valid JSON only.');
+ const response = await llm.complete(
+ prompt,
+ 'You are a professional meeting summarizer. Generate clear, actionable meeting notes.'
+ );
- if (response.success && response.data) {
+ if (response.success && response.content) {
+ log.info('Meeting summary generated successfully');
return {
- pain: response.data.pain_points || [],
- goals: response.data.goals || [],
+ summary: response.content.trim(),
+ generatedAt: Date.now(),
};
}
} catch (error) {
- log.warn({ error }, 'Pain/goals extraction failed');
+ log.error({ error }, 'Summary generation failed');
}
- return { pain: [], goals: [] };
+ // Fallback: generate a basic summary
+ return this.generateFallbackSummary(finalSegments);
}
/**
- * Extract concerns raised and how they were addressed
+ * Generate a quick summary (for shorter meetings or quick review)
*/
- private async extractConcerns(segments: TranscriptSegmentData[]): Promise<Concern[]> {
- const transcript = this.formatFullTranscript(segments);
- const llm = getLLMService();
-
- const prompt = `Extract concerns, hesitations, or pushback raised during this meeting and how they were addressed.
-
-${transcript}
-
-Respond with JSON:
-{
- "concerns": [
- {
- "type": "budget|timeline|risk|scope|resource|technical|other",
- "text": "what was said",
- "response": "how it was addressed (if captured)",
- "resolved": true/false,
- "timestamp": seconds from start
- }
- ]
-}`;
+ async generateQuick(segments: TranscriptSegmentData[]): Promise<CallSummary> {
+ const finalSegments = segments.filter(s => s.isFinal);
- try {
- const response = await llm.completeJSON<{
- concerns: Array<{
- type: string;
- text: string;
- response?: string;
- resolved: boolean;
- timestamp: number;
- }>;
- }>(prompt, 'You are a meeting analysis expert. Return valid JSON only.');
-
- if (response.success && response.data) {
- return response.data.concerns || [];
- }
- } catch (error) {
- log.warn({ error }, 'Concern extraction failed');
+ if (finalSegments.length === 0) {
+ return this.emptyResults();
}
- return [];
- }
-
- /**
- * Extract open questions that weren't fully answered
- */
- private async extractOpenQuestions(segments: TranscriptSegmentData[]): Promise<string[]> {
- const transcript = this.formatFullTranscript(segments);
+ const transcript = this.formatTranscript(finalSegments);
const llm = getLLMService();
- const prompt = `Identify questions that were asked during this meeting but weren't fully answered or need follow-up.
+ const prompt = `Summarize this meeting in a brief format:
${transcript}
-Respond with JSON:
-{
- "open_questions": ["question 1", "question 2"]
-}`;
+Generate a quick summary with:
+1. One sentence overview
+2. 3-5 key points as bullets
+3. Action items as a checklist
+
+Keep it concise and actionable.`;
try {
- const response = await llm.completeJSON<{ open_questions: string[] }>(
+ const response = await llm.complete(
prompt,
- 'You are a meeting analysis expert. Return valid JSON only.'
+ 'You are a meeting summarizer. Be brief and actionable.'
);
- if (response.success && response.data) {
- return response.data.open_questions || [];
+ if (response.success && response.content) {
+ return {
+ summary: response.content.trim(),
+ generatedAt: Date.now(),
+ };
}
} catch (error) {
- log.warn({ error }, 'Open questions extraction failed');
+ log.warn({ error }, 'Quick summary generation failed');
}
- return [];
+ return this.emptyResults();
}
/**
- * Extract commitments
+ * Format transcript for the LLM
*/
- private async extractCommitments(segments: TranscriptSegmentData[]): Promise<Commitment[]> {
- const transcript = this.formatFullTranscript(segments);
- const llm = getLLMService();
-
- const prompt = `Extract commitments or promises made by either party in this meeting.
-Look for statements like "I will...", "We'll send...", "Let me...", "I promise...".
-
-${transcript}
-
-Respond with JSON:
-{
- "commitments": [
- {
- "who": "me" | "them",
- "commitment": "what was committed to",
- "timestamp": seconds from start,
- "context": "surrounding context"
- }
- ]
-}`;
-
- try {
- const response = await llm.completeJSON<{
- commitments: Array<{
- who: 'me' | 'them';
- commitment: string;
- timestamp: number;
- context?: string;
- }>;
- }>(prompt, 'You are a meeting commitment tracking expert. Return valid JSON only.');
-
- if (response.success && response.data) {
- return response.data.commitments || [];
- }
- } catch (error) {
- log.warn({ error }, 'Commitment extraction failed');
- }
-
- return [];
+ private formatTranscript(segments: TranscriptSegmentData[]): string {
+ return segments
+ .map(s => {
+ const speaker = s.channel === 'me' ? 'You' : 'Them';
+ const time = this.formatTime(s.startTime);
+ return `[${time}] ${speaker}: ${s.text}`;
+ })
+ .join('\n');
}
/**
- * Extract next steps and action items
+ * Calculate meeting duration from segments
*/
- private async extractNextSteps(segments: TranscriptSegmentData[]): Promise<ActionItem[]> {
- // Focus on last 30% of call for next steps
- const endSegments = segments.slice(-Math.max(10, Math.floor(segments.length * 0.3)));
- const transcript = this.formatFullTranscript(endSegments);
- const llm = getLLMService();
-
- const prompt = `Extract action items and next steps from the end of this meeting.
-
-${transcript}
-
-Respond with JSON:
-{
- "action_items": [
- {
- "action": "what needs to be done",
- "owner": "me" | "them" | "both",
- "deadline": "when (if mentioned)" | null,
- "priority": "high" | "medium" | "low"
- }
- ]
-}`;
-
- try {
- const response = await llm.completeJSON<{
- action_items: Array<{
- action: string;
- owner: 'me' | 'them' | 'both';
- deadline?: string;
- priority: 'high' | 'medium' | 'low';
- }>;
- }>(prompt, 'You are a meeting action item expert. Return valid JSON only.');
-
- if (response.success && response.data) {
- return (response.data.action_items || []).map(item => ({
- ...item,
- evidence: [],
- }));
- }
- } catch (error) {
- log.warn({ error }, 'Next steps extraction failed');
- }
-
- return [];
+ private calculateDuration(segments: TranscriptSegmentData[]): number {
+ if (segments.length === 0) return 0;
+ const firstTime = segments[0].startTime;
+ const lastTime = segments[segments.length - 1].endTime;
+ return lastTime - firstTime;
}
/**
- * Extract key decisions
+ * Format duration as human readable
*/
- private async extractDecisions(segments: TranscriptSegmentData[]): Promise<string[]> {
- const transcript = this.formatTranscript(segments);
- const llm = getLLMService();
-
- const prompt = `Extract key decisions made during this meeting.
-Look for agreements, choices made, or conclusions reached.
-
-${transcript}
-
-Respond with JSON:
-{
- "decisions": ["decision 1", "decision 2"]
-}`;
-
- try {
- const response = await llm.completeJSON<{ decisions: string[] }>(
- prompt,
- 'You are a meeting analysis expert. Return valid JSON only.'
- );
-
- if (response.success && response.data) {
- return response.data.decisions || [];
- }
- } catch (error) {
- log.warn({ error }, 'Decision extraction failed');
- }
+ private formatDuration(seconds: number): string {
+ const mins = Math.floor(seconds / 60);
+ const secs = Math.floor(seconds % 60);
+ if (mins === 0) return `${secs} seconds`;
+ if (secs === 0) return `${mins} minute${mins > 1 ? 's' : ''}`;
+ return `${mins} minute${mins > 1 ? 's' : ''} ${secs} second${secs > 1 ? 's' : ''}`;
+ }
- return [];
+ /**
+ * Format time as MM:SS
+ */
+ private formatTime(seconds: number): string {
+ const mins = Math.floor(seconds / 60);
+ const secs = Math.floor(seconds % 60);
+ return `${mins}:${secs.toString().padStart(2, '0')}`;
}
/**
- * Identify risk flags from extracted data
+ * Generate fallback summary if LLM fails
*/
- private identifyRisks(
- concerns: Concern[],
- painPoints: string[],
- commitments: Commitment[]
- ): string[] {
- const risks: string[] = [];
-
- // Unresolved concerns
- const unresolvedConcerns = concerns.filter(c => !c.resolved);
- if (unresolvedConcerns.length > 0) {
- risks.push(`${unresolvedConcerns.length} unresolved concern(s)`);
- }
+ private generateFallbackSummary(segments: TranscriptSegmentData[]): CallSummary {
+ const duration = this.calculateDuration(segments);
+ const mySegments = segments.filter(s => s.channel === 'me');
+ const theirSegments = segments.filter(s => s.channel === 'them');
- // Risk-related concerns
- if (concerns.some(c => c.type === 'risk' || c.type === 'blocker')) {
- risks.push('Risk or blocker identified');
- }
+ const summary = `## Meeting Summary
- // No pain points identified
- if (painPoints.length === 0) {
- risks.push('Key challenges not clearly identified');
- }
+This meeting lasted ${this.formatDuration(duration)} with ${segments.length} exchanges.
- // No commitments from other participant
- const theirCommitments = commitments.filter(c => c.who === 'them');
- if (theirCommitments.length === 0) {
- risks.push('No commitments from other participant');
- }
+## Transcript Overview
- return risks;
- }
+- You spoke ${mySegments.length} times
+- They spoke ${theirSegments.length} times
- /**
- * Format transcript as simple text
- */
- private formatTranscript(segments: TranscriptSegmentData[]): string {
- return segments
- .map(s => `[${s.channel.toUpperCase()}] ${s.text}`)
- .join('\n');
- }
+## Notes
- /**
- * Format transcript with timestamps
- */
- private formatFullTranscript(segments: TranscriptSegmentData[]): string {
- return segments
- .map(s => `[${s.channel.toUpperCase()} @ ${this.formatTime(s.startTime)}] ${s.text}`)
- .join('\n');
- }
+The full summary could not be generated. Please review the transcript directly.`;
- /**
- * Format time as MM:SS
- */
- private formatTime(seconds: number): string {
- const mins = Math.floor(seconds / 60);
- const secs = Math.floor(seconds % 60);
- return `${mins}:${secs.toString().padStart(2, '0')}`;
+ return {
+ summary,
+ generatedAt: Date.now(),
+ };
}
/**
@@ -528,16 +244,7 @@ Respond with JSON:
*/
private emptyResults(): CallSummary {
return {
- bullets: [],
- customerPain: [],
- customerGoals: [],
- concerns: [],
- objections: [], // Backwards compatibility
- commitments: [],
- nextSteps: [],
- keyDecisions: [],
- openQuestions: [],
- riskFlags: [],
+ summary: '## Meeting Summary\n\nNo transcript available to summarize.',
generatedAt: Date.now(),
};
}
diff --git a/src/preload/index.ts b/src/preload/index.ts
index 6389c5b..eecdcd9 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -81,14 +81,7 @@ export interface CopilotPlaybookSnapshot {
}
export interface CopilotCallSummary {
- bullets: string[];
- customerPain: string[];
- customerGoals: string[];
- objections: Array<{ type: string; text: string; response?: string; resolved: boolean; timestamp: number }>;
- commitments: Array<{ who: 'me' | 'them'; commitment: string; timestamp: number }>;
- nextSteps: Array<{ action: string; owner: 'me' | 'them' | 'both'; priority: string; deadline?: string }>;
- keyDecisions: string[];
- riskFlags: string[];
+ summary: string;
generatedAt: number;
}
diff --git a/src/renderer/components/copilot/CallSummaryView.tsx b/src/renderer/components/copilot/CallSummaryView.tsx
index c648e7f..a71223f 100644
--- a/src/renderer/components/copilot/CallSummaryView.tsx
+++ b/src/renderer/components/copilot/CallSummaryView.tsx
@@ -1,209 +1,28 @@
/**
* Meeting Summary View Component
*
- * Displays post-meeting AI-generated summary with:
- * - Summary bullets
- * - Challenges and objectives identified
- * - Concerns raised and responses
- * - Commitments
- * - Next steps / action items
- * - Risk flags
+ * Displays the AI-generated meeting summary as formatted markdown.
*/
-import React, { useState } from 'react';
+import { useState } from 'react';
+import ReactMarkdown from 'react-markdown';
import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';
import { Button } from '../ui/button';
import { Badge } from '../ui/badge';
-import {
- FileText,
- Target,
- AlertTriangle,
- CheckCircle2,
- Clock,
- ChevronDown,
- ChevronUp,
- Copy,
- MessageSquare,
- Users,
- Flag,
- Lightbulb,
- ArrowRight,
-} from 'lucide-react';
+import { FileText, Copy, Check, Clock } from 'lucide-react';
import { useCopilotStore } from '../../stores/copilot.store';
import { cn } from '../../lib/utils';
-import type { CopilotCallSummary, CopilotPlaybookSnapshot } from '../../../shared/types/ipc.types';
-
-interface SectionProps {
- title: string;
- icon: React.ReactNode;
- children: React.ReactNode;
- defaultOpen?: boolean;
- count?: number;
- badge?: { text: string; variant?: 'default' | 'secondary' | 'destructive' };
-}
-
-function Section({ title, icon, children, defaultOpen = true, count, badge }: SectionProps) {
- const [isOpen, setIsOpen] = useState(defaultOpen);
-
- return (
- <div className="border rounded-lg">
- <button
- className="w-full flex items-center justify-between p-3 hover:bg-muted/50 transition-colors"
- onClick={() => setIsOpen(!isOpen)}
- >
- <div className="flex items-center gap-2">
- {icon}
- <span className="font-medium text-sm">{title}</span>
- {count !== undefined && (
- <Badge variant="secondary" className="text-xs">
- {count}
- </Badge>
- )}
- {badge && (
- <Badge variant={badge.variant || 'default'} className="text-xs">
- {badge.text}
- </Badge>
- )}
- </div>
- {isOpen ? (
- <ChevronUp className="h-4 w-4 text-muted-foreground" />
- ) : (
- <ChevronDown className="h-4 w-4 text-muted-foreground" />
- )}
- </button>
- {isOpen && <div className="px-3 pb-3">{children}</div>}
- </div>
- );
-}
-
-function BulletList({ items, icon }: { items: string[]; icon?: React.ReactNode }) {
- if (!items || items.length === 0) {
- return <p className="text-sm text-muted-foreground italic">None identified</p>;
- }
-
- return (
- <ul className="space-y-1.5">
- {items.map((item, i) => (
- <li key={i} className="text-sm flex items-start gap-2">
- {icon || <ArrowRight className="h-3 w-3 mt-1 text-muted-foreground shrink-0" />}
- <span>{item}</span>
- </li>
- ))}
- </ul>
- );
-}
-
-function ConcernsList({ concerns }: { concerns: CopilotCallSummary['objections'] }) {
- if (!concerns || concerns.length === 0) {
- return <p className="text-sm text-muted-foreground italic">No concerns raised</p>;
- }
-
- return (
- <div className="space-y-2">
- {concerns.map((obj, i) => (
- <div key={i} className="p-2 bg-muted/50 rounded-lg">
- <div className="flex items-center gap-2 mb-1">
- <Badge variant="outline" className="text-xs capitalize">
- {obj.type}
- </Badge>
- {obj.resolved ? (
- <Badge variant="default" className="text-xs bg-green-500">
- Resolved
- </Badge>
- ) : (
- <Badge variant="destructive" className="text-xs">
- Open
- </Badge>
- )}
- </div>
- <p className="text-sm">{obj.text}</p>
- {obj.response && (
- <p className="text-xs text-muted-foreground mt-1 italic">
- Response: "{obj.response}"
- </p>
- )}
- </div>
- ))}
- </div>
- );
-}
-
-function CommitmentsList({ commitments }: { commitments: CopilotCallSummary['commitments'] }) {
- if (!commitments || commitments.length === 0) {
- return <p className="text-sm text-muted-foreground italic">No commitments made</p>;
- }
-
- return (
- <div className="space-y-2">
- {commitments.map((com, i) => (
- <div key={i} className="flex items-start gap-2 p-2 bg-muted/50 rounded-lg">
- <Badge variant={com.who === 'me' ? 'default' : 'secondary'} className="text-xs shrink-0">
- {com.who === 'me' ? 'You' : 'Them'}
- </Badge>
- <p className="text-sm">{com.commitment}</p>
- </div>
- ))}
- </div>
- );
-}
-
-function NextStepsList({ nextSteps }: { nextSteps: CopilotCallSummary['nextSteps'] }) {
- if (!nextSteps || nextSteps.length === 0) {
- return <p className="text-sm text-muted-foreground italic">No next steps identified</p>;
- }
-
- const getPriorityColor = (priority: string) => {
- switch (priority) {
- case 'high':
- return 'bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200';
- case 'medium':
- return 'bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200';
- default:
- return 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200';
- }
- };
-
- return (
- <div className="space-y-2">
- {nextSteps.map((step, i) => (
- <div key={i} className="flex items-start gap-2 p-2 bg-muted/50 rounded-lg">
- <CheckCircle2 className="h-4 w-4 text-muted-foreground shrink-0 mt-0.5" />
- <div className="flex-1 min-w-0">
- <p className="text-sm">{step.action}</p>
- <div className="flex items-center gap-2 mt-1">
- <Badge variant="outline" className="text-xs">
- {step.owner === 'me' ? 'You' : step.owner === 'them' ? 'Them' : 'Both'}
- </Badge>
- <Badge className={cn("text-xs", getPriorityColor(step.priority))}>
- {step.priority}
- </Badge>
- {step.deadline && (
- <span className="text-xs text-muted-foreground flex items-center gap-1">
- <Clock className="h-3 w-3" />
- {step.deadline}
- </span>
- )}
- </div>
- </div>
- </div>
- ))}
- </div>
- );
-}
-
-// Main Component
+import type { CopilotCallSummary } from '../../../shared/types/ipc.types';
interface CallSummaryViewProps {
className?: string;
summary?: CopilotCallSummary;
- playbook?: CopilotPlaybookSnapshot;
duration?: number;
}
-export function CallSummaryView({ className, summary: propSummary, playbook: propPlaybook, duration: propDuration }: CallSummaryViewProps) {
+export function CallSummaryView({ className, summary: propSummary, duration: propDuration }: CallSummaryViewProps) {
const store = useCopilotStore();
const summary = propSummary || store.callSummary;
- const playbook = propPlaybook || store.playbook;
const duration = propDuration || store.callDuration;
const [copied, setCopied] = useState(false);
@@ -218,7 +37,7 @@ export function CallSummaryView({ className, summary: propSummary, playbook: pro
</CardHeader>
<CardContent>
<p className="text-muted-foreground text-center py-8">
- Call summary will appear here after the recording ends
+ Meeting summary will appear here after the recording ends
</p>
</CardContent>
</Card>
@@ -228,30 +47,16 @@ export function CallSummaryView({ className, summary: propSummary, playbook: pro
const formatDuration = (seconds: number) => {
const mins = Math.floor(seconds / 60);
const secs = Math.floor(seconds % 60);
- return `${mins}:${secs.toString().padStart(2, '0')}`;
+ if (mins === 0) return `${secs}s`;
+ return `${mins}m ${secs}s`;
};
const copyToClipboard = () => {
- const text = [
- '# Meeting Summary',
- '',
- '## Key Points',
- ...summary.bullets.map(b => `- ${b}`),
- '',
- '## Challenges Discussed',
- ...summary.customerPain.map(p => `- ${p}`),
- '',
- '## Next Steps',
- ...summary.nextSteps.map(s => `- [${s.owner}] ${s.action}`),
- ].join('\n');
-
- navigator.clipboard.writeText(text);
+ navigator.clipboard.writeText(summary.summary);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
};
- const unresolvedConcerns = summary.objections?.filter(o => !o.resolved).length || 0;
-
return (
<Card className={cn("", className)}>
<CardHeader className="pb-2">
@@ -261,135 +66,73 @@ export function CallSummaryView({ className, summary: propSummary, playbook: pro
Meeting Summary
</CardTitle>
<div className="flex items-center gap-2">
- <Badge variant="outline" className="text-xs">
- {formatDuration(duration)}
- </Badge>
+ {duration > 0 && (
+ <Badge variant="outline" className="text-xs flex items-center gap-1">
+ <Clock className="h-3 w-3" />
+ {formatDuration(duration)}
+ </Badge>
+ )}
<Button variant="outline" size="sm" onClick={copyToClipboard}>
- <Copy className="h-3 w-3 mr-1" />
- {copied ? 'Copied!' : 'Copy'}
+ {copied ? (
+ <>
+ <Check className="h-3 w-3 mr-1" />
+ Copied!
+ </>
+ ) : (
+ <>
+ <Copy className="h-3 w-3 mr-1" />
+ Copy
+ </>
+ )}
</Button>
</div>
</div>
</CardHeader>
<CardContent>
- <div className="space-y-3">
- {/* Risk Flags */}
- {summary.riskFlags && summary.riskFlags.length > 0 && (
- <div className="p-3 bg-red-50 dark:bg-red-950/20 rounded-lg border border-red-200 dark:border-red-800">
- <p className="text-sm font-medium text-red-700 dark:text-red-400 flex items-center gap-2 mb-2">
- <AlertTriangle className="h-4 w-4" />
- Risk Flags
- </p>
- <ul className="space-y-1">
- {summary.riskFlags.map((flag, i) => (
- <li key={i} className="text-sm text-red-600 dark:text-red-300 flex items-center gap-2">
- <Flag className="h-3 w-3" />
- {flag}
- </li>
- ))}
- </ul>
- </div>
- )}
-
- {/* Summary Bullets */}
- <Section
- title="Summary"
- icon={<FileText className="h-4 w-4" />}
- count={summary.bullets?.length}
- >
- <BulletList items={summary.bullets} />
- </Section>
-
- {/* Challenges & Objectives */}
- <Section
- title="Challenges Discussed"
- icon={<Target className="h-4 w-4" />}
- count={summary.customerPain?.length}
- >
- <BulletList items={summary.customerPain} />
- </Section>
-
- {summary.customerGoals && summary.customerGoals.length > 0 && (
- <Section
- title="Objectives Identified"
- icon={<Lightbulb className="h-4 w-4" />}
- count={summary.customerGoals.length}
- defaultOpen={false}
- >
- <BulletList items={summary.customerGoals} />
- </Section>
- )}
-
- {/* Concerns */}
- <Section
- title="Concerns Raised"
- icon={<MessageSquare className="h-4 w-4" />}
- count={summary.objections?.length}
- badge={unresolvedConcerns > 0 ? { text: `${unresolvedConcerns} open`, variant: 'destructive' } : undefined}
- >
- <ConcernsList concerns={summary.objections} />
- </Section>
-
- {/* Commitments */}
- <Section
- title="Commitments"
- icon={<Users className="h-4 w-4" />}
- count={summary.commitments?.length}
- defaultOpen={false}
- >
- <CommitmentsList commitments={summary.commitments} />
- </Section>
-
- {/* Next Steps */}
- <Section
- title="Next Steps"
- icon={<CheckCircle2 className="h-4 w-4" />}
- count={summary.nextSteps?.length}
- >
- <NextStepsList nextSteps={summary.nextSteps} />
- </Section>
-
- {/* Key Decisions */}
- {summary.keyDecisions && summary.keyDecisions.length > 0 && (
- <Section
- title="Key Decisions"
- icon={<Flag className="h-4 w-4" />}
- count={summary.keyDecisions.length}
- defaultOpen={false}
- >
- <BulletList items={summary.keyDecisions} />
- </Section>
- )}
-
- {/* Playbook Summary */}
- {playbook && (
- <Section
- title={`Playbook: ${playbook.playbookName}`}
- icon={<Target className="h-4 w-4" />}
- badge={{ text: `${playbook.coveragePercentage}%`, variant: playbook.coveragePercentage >= 70 ? 'default' : 'secondary' }}
- defaultOpen={false}
- >
- <div className="space-y-2">
- <div className="flex items-center gap-2 text-sm">
- <span className="text-green-600">✓ {playbook.covered} covered</span>
- <span className="text-amber-600">◐ {playbook.partial} partial</span>
- <span className="text-muted-foreground">○ {playbook.missing} missing</span>
- </div>
- {playbook.recommendations && playbook.recommendations.length > 0 && (
- <div className="pt-2">
- <p className="text-xs font-medium text-muted-foreground mb-1">Recommendations:</p>
- <ul className="space-y-1">
- {playbook.recommendations.slice(0, 3).map((rec, i) => (
- <li key={i} className="text-xs text-muted-foreground">• {rec}</li>
- ))}
- </ul>
- </div>
- )}
- </div>
- </Section>
- )}
- </div>
+ <div className="prose prose-sm dark:prose-invert max-w-none">
+ <ReactMarkdown
+ components={{
+ h2: ({ children }) => (
+ <h2 className="text-base font-semibold mt-4 mb-2 first:mt-0 border-b pb-1">{children}</h2>
+ ),
+ h3: ({ children }) => (
+ <h3 className="text-sm font-semibold mt-3 mb-1">{children}</h3>
+ ),
+ ul: ({ children }) => (
+ <ul className="list-disc list-inside space-y-1 my-2 ml-2">{children}</ul>
+ ),
+ ol: ({ children }) => (
+ <ol className="list-decimal list-inside space-y-1 my-2 ml-2">{children}</ol>
+ ),
+ li: ({ children }) => (
+ <li className="text-sm">{children}</li>
+ ),
+ p: ({ children }) => (
+ <p className="text-sm my-2 leading-relaxed">{children}</p>
+ ),
+ // Style checkboxes in action items
+ input: ({ type, checked }) => {
+ if (type === 'checkbox') {
+ return (
+ <input
+ type="checkbox"
+ checked={checked}
+ readOnly
+ className="mr-2 rounded border-gray-300"
+ />
+ );
+ }
+ return null;
+ },
+ strong: ({ children }) => (
+ <strong className="font-semibold">{children}</strong>
+ ),
+ }}
+ >
+ {summary.summary}
+ </ReactMarkdown>
+ </div>
</CardContent>
</Card>
);
diff --git a/src/renderer/components/history/RecordingDetailsModal.tsx b/src/renderer/components/history/RecordingDetailsModal.tsx
index 97359bb..e0b80c6 100644
--- a/src/renderer/components/history/RecordingDetailsModal.tsx
+++ b/src/renderer/components/history/RecordingDetailsModal.tsx
@@ -12,7 +12,6 @@ import {
Target,
ChevronDown,
ChevronUp,
- AlertTriangle,
CheckCircle2,
MessageSquare,
} from 'lucide-react';
@@ -310,88 +309,34 @@ export function RecordingDetailsModal({
</CollapsibleSection>
)}
- {/* Call Summary (Real-time) - Primary section */}
- {callSummary && (
+ {/* Meeting Summary */}
+ {callSummary && callSummary.summary && (
<CollapsibleSection
- title="Call Summary"
+ title="Meeting Summary"
icon={<MessageSquare className="h-4 w-4" />}
defaultOpen={true}
- badge={`${callSummary.bullets?.length || 0} points`}
>
- <div className="space-y-3 pt-2">
- {/* Risk Flags */}
- {callSummary.riskFlags && callSummary.riskFlags.length > 0 && (
- <div className="p-2 bg-red-50 dark:bg-red-950/20 rounded-lg border border-red-200 dark:border-red-800">
- <p className="text-xs font-medium text-red-700 dark:text-red-400 flex items-center gap-1 mb-1">
- <AlertTriangle className="h-3 w-3" />
- Risk Flags
- </p>
- <ul className="space-y-0.5">
- {callSummary.riskFlags.map((flag, i) => (
- <li key={i} className="text-xs text-red-600 dark:text-red-300">• {flag}</li>
- ))}
- </ul>
- </div>
- )}
-
- {/* Summary Bullets */}
- {callSummary.bullets && callSummary.bullets.length > 0 && (
- <div>
- <p className="text-xs font-medium text-muted-foreground mb-1">Key Points</p>
- <ul className="space-y-0.5">
- {callSummary.bullets.map((bullet, i) => (
- <li key={i} className="text-sm">• {bullet}</li>
- ))}
- </ul>
- </div>
- )}
-
- {/* Challenges Discussed */}
- {callSummary.customerPain && callSummary.customerPain.length > 0 && (
- <div>
- <p className="text-xs font-medium text-muted-foreground mb-1">Challenges Discussed</p>
- <ul className="space-y-0.5">
- {callSummary.customerPain.map((pain, i) => (
- <li key={i} className="text-sm">• {pain}</li>
- ))}
- </ul>
- </div>
- )}
-
- {/* Next Steps */}
- {callSummary.nextSteps && callSummary.nextSteps.length > 0 && (
- <div>
- <p className="text-xs font-medium text-muted-foreground mb-1">Next Steps</p>
- <div className="space-y-1">
- {callSummary.nextSteps.map((step, i) => (
- <div key={i} className="flex items-center gap-2 text-sm">
- <Badge variant="outline" className="text-xs">
- {step.owner === 'me' ? 'You' : step.owner === 'them' ? 'Them' : 'Both'}
- </Badge>
- <span>{step.action}</span>
- </div>
- ))}
- </div>
- </div>
- )}
-
- {/* Concerns */}
- {callSummary.objections && callSummary.objections.length > 0 && (
- <div>
- <p className="text-xs font-medium text-muted-foreground mb-1">Concerns Raised</p>
- <div className="space-y-1">
- {callSummary.objections.map((obj, i) => (
- <div key={i} className="p-2 bg-muted/30 rounded text-sm">
- <div className="flex items-center gap-2 mb-0.5">
- <Badge variant="outline" className="text-xs">{obj.type}</Badge>
- {obj.resolved && <Badge className="text-xs bg-green-500">Resolved</Badge>}
- </div>
- <p className="text-sm">{obj.text}</p>
- </div>
- ))}
- </div>
- </div>
- )}
+ <div className="prose prose-sm dark:prose-invert max-w-none pt-2">
+ <ReactMarkdown
+ components={{
+ h2: ({ children }) => (
+ <h2 className="text-base font-semibold mt-4 mb-2 first:mt-0 border-b pb-1">{children}</h2>
+ ),
+ h3: ({ children }) => (
+ <h3 className="text-sm font-semibold mt-3 mb-1">{children}</h3>
+ ),
+ ul: ({ children }) => (
+ <ul className="list-disc list-inside space-y-1 my-2 ml-2">{children}</ul>
+ ),
+ ol: ({ children }) => (
+ <ol className="list-decimal list-inside space-y-1 my-2 ml-2">{children}</ol>
+ ),
+ li: ({ children }) => <li className="text-sm">{children}</li>,
+ p: ({ children }) => <p className="text-sm my-2">{children}</p>,
+ }}
+ >
+ {callSummary.summary}
+ </ReactMarkdown>
</div>
</CollapsibleSection>
)}
diff --git a/src/shared/schemas/recording.schema.ts b/src/shared/schemas/recording.schema.ts
index 411fd72..1fdfed5 100644
--- a/src/shared/schemas/recording.schema.ts
+++ b/src/shared/schemas/recording.schema.ts
@@ -3,29 +3,8 @@ import { z } from 'zod';
export const RecordingStatusSchema = z.enum(['recording', 'processing', 'available', 'failed']);
export const InsightsStatusSchema = z.enum(['pending', 'processing', 'ready', 'failed']);
-// Copilot data schemas
export const CallSummarySchema = z.object({
- bullets: z.array(z.string()).optional(),
- customerPain: z.array(z.string()).optional(),
- customerGoals: z.array(z.string()).optional(),
- objections: z.array(z.object({
- type: z.string(),
- text: z.string(),
- response: z.string().optional(),
- resolved: z.boolean().optional(),
- })).optional(),
- commitments: z.array(z.object({
- who: z.enum(['me', 'them']),
- commitment: z.string(),
- })).optional(),
- nextSteps: z.array(z.object({
- action: z.string(),
- owner: z.enum(['me', 'them', 'both']),
- priority: z.enum(['high', 'medium', 'low']),
- deadline: z.string().optional(),
- })).optional(),
- keyDecisions: z.array(z.string()).optional(),
- riskFlags: z.array(z.string()).optional(),
+ summary: z.string(), // The complete meeting summary as markdown
generatedAt: z.number().optional(),
}).nullable();
diff --git a/src/shared/types/ipc.types.ts b/src/shared/types/ipc.types.ts
index afb6c7b..34f18ee 100644
--- a/src/shared/types/ipc.types.ts
+++ b/src/shared/types/ipc.types.ts
@@ -134,14 +134,7 @@ export interface CopilotPlaybookSnapshot {
}
export interface CopilotCallSummary {
- bullets: string[];
- customerPain: string[]; // Challenges discussed (field name kept for backwards compat)
- customerGoals: string[]; // Objectives identified (field name kept for backwards compat)
- objections: Array<{ type: string; text: string; response?: string; resolved: boolean; timestamp: number }>; // Concerns raised
- commitments: Array<{ who: 'me' | 'them'; commitment: string; timestamp: number }>;
- nextSteps: Array<{ action: string; owner: 'me' | 'them' | 'both'; priority: string; deadline?: string }>;
- keyDecisions: string[];
- riskFlags: string[];
+ summary: string;
generatedAt: number;
}