import { Lightbulb } from 'lucide-react'; import { ReportSection } from '../ReportSection'; import type { OutOfScopeFindings, ReportAgentTree, ReportBashCommands, SkillInvocation, SubagentBasicEntry, UserQuestion, } from '@renderer/types/sessionReport'; interface InsightsSectionProps { skills: SkillInvocation[]; bash: ReportBashCommands; lifecycleTasks: string[]; userQuestions: UserQuestion[]; outOfScope: OutOfScopeFindings[]; agentTree: ReportAgentTree; subagentsList: SubagentBasicEntry[]; defaultCollapsed?: boolean; } export const InsightsSection = ({ skills, bash, lifecycleTasks, userQuestions, outOfScope, agentTree, subagentsList, defaultCollapsed, }: InsightsSectionProps) => { return ( {/* Skills invoked */} {skills.length > 0 && (
Skills Invoked ({skills.length})
{skills.map((s, idx) => (
{s.skill} {s.argsPreview && {s.argsPreview}}
))}
)} {/* Bash commands */}
Bash Commands
Total
{bash.total}
Unique
{bash.unique}
Repeated
{Object.keys(bash.repeated).length}
{Object.keys(bash.repeated).length > 0 && (
{Object.entries(bash.repeated) .slice(0, 10) .map(([cmd, count], idx) => (
{count}x {cmd}
))}
)}
{/* Task tool subagent list */} {subagentsList.length > 0 && (
Task Dispatches ({subagentsList.length})
{subagentsList.map((s, idx) => (
{s.subagentType} {s.description} {s.runInBackground && (background)}
))}
)} {/* Lifecycle tasks */} {lifecycleTasks.length > 0 && (
Tasks Created ({lifecycleTasks.length})
{lifecycleTasks.map((task, idx) => (
{task}
))}
)} {/* User questions */} {userQuestions.length > 0 && (
Questions Asked ({userQuestions.length})
{userQuestions.map((q, idx) => (
{q.question}
{q.options.length > 0 && (
{q.options.map((opt, optIdx) => ( {opt} ))}
)}
))}
)} {/* Agent tree */} {agentTree.agentCount > 0 && (
Agent Tree ({agentTree.agentCount} agent{agentTree.agentCount !== 1 ? 's' : ''}) {agentTree.hasTeamMode && ( Team Mode )}
{agentTree.teamNames.length > 0 && (
Teams: {agentTree.teamNames.join(', ')}
)}
{agentTree.agents.map((agent, idx) => (
{agent.agentType} {agent.agentId.slice(0, 12)}...
))}
)} {/* Out-of-scope findings */} {outOfScope.length > 0 && (
Out-of-Scope Findings ({outOfScope.length})
{outOfScope.map((f, idx) => (
{f.keyword} {f.snippet}
))}
)}
); };