);
}
// ─────────────────────────────────────────────────────────────
// AgentChatScreen — converse with one agent
// ─────────────────────────────────────────────────────────────
function AgentChatScreen({ persona, go, params }) {
const agent = Dp().agents[persona].find(a => a.id === params?.id) || Dp().agents[persona][0];
const seed = persona === 'principal' ? [
{ from: 'agent', body: `Aurélien — I pulled three things for Sequoia at 09:30.\n\n1. Roelof opened the cap table 04:12 ago and spent 4 minutes on slide 7. He's anchoring on dilution.\n\n2. Jess Lee has never been in a Helix call. I added her LinkedIn and the four founders she's backed in the last 12 months to your brief.\n\n3. Two open threads from last call. The September close timeline is the riskier one to address.` },
{ from: 'user', body: 'What\'s my best move on the timeline?' },
{ from: 'agent', body: `Buy two weeks. Frame it as diligence depth, not hesitation. Suggested line: "We're nine days out from clean Q1 numbers and a hiring close. I'd like the term sheet in hand by August 5, signed by August 19." That gives you headroom without losing momentum.` },
] : [
{ from: 'agent', body: `Sana — Mae Chen at 09:30. Three things to know.\n\n1. Devon's round-1 notes landed last night: 7/10 systems design, hesitation on cross-functional conflict. I've prepped a probe for that.\n\n2. Mae is at final stage at Anthropic. Their offer hits her inbox by Friday. We have today and tomorrow.\n\n3. Comp expectation in round 1: $340 base, 1.0% equity. That's inside our band.` },
{ from: 'user', body: 'Compare Mae and Yara for me.' },
{ from: 'agent', body: `Opening the comparison view. Mae leads on cultural fit (8 vs 6), Yara on scale jump readiness (9 vs 6). Compensation ask is similar. Decision frame: do you need a builder (Mae) or a scaler (Yara)?` },
];
const [messages, setMessages] = React.useState(seed);
const [input, setInput] = React.useState('');
const scrollRef = React.useRef(null);
React.useEffect(() => {
if (scrollRef.current) scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
}, [messages]);
const send = () => {
if (!input.trim()) return;
const q = input.trim();
setMessages(m => [...m, { from: 'user', body: q }]);
setInput('');
setTimeout(() => {
setMessages(m => [...m, { from: 'agent', body: `Working on it. Pulling from CRM, your inbox, and the dataroom. A draft is ready — review it in 30 seconds.`, thinking: true }]);
}, 600);
};
return (
go('agents')}
title={
{agent.name}
Active · {agent.skills} skills
}
trailing={} />
{messages.map((msg, i) => (
{msg.body}
))}
{/* Quick-action chips */}
{['Brief me on next', 'Draft a follow-up', 'Compare candidates', 'Status on Series C'].map((s, i) => (
))}