feat(chat): upgrade to full agentic demo bot (Option B)

Chat widget now runs a live tool-use loop via Claude Haiku. Exposes
slack, discord, and telegram demo tools — bot can actually send messages
and read channels to prove the platform works in real time. Widget shows
a purple pill with tool names when the agent calls a live platform.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Garfield
2026-05-15 10:49:18 -04:00
parent 4bf93d6763
commit be1a14f783
3 changed files with 111 additions and 26 deletions

View File

@@ -1988,8 +1988,8 @@ app.post('/api/chat', async (req, res) => {
return;
}
try {
const reply = await handleChat(messages);
res.json({ reply });
const { reply, toolsUsed } = await handleChat(messages);
res.json({ reply, toolsUsed });
} catch (err) {
console.error('[chat] error:', (err as Error).message);
res.status(500).json({ error: 'Chat unavailable' });