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:
@@ -50,6 +50,11 @@
|
||||
background: ${BRAND}; color: #fff; border-bottom-right-radius: 4px; align-self: flex-end;
|
||||
}
|
||||
.smcp-msg.typing { color: #888; font-style: italic; }
|
||||
.smcp-tools-used {
|
||||
font-size: 11px; color: #6c47ff; background: #f1f0fe;
|
||||
border-radius: 6px; padding: 4px 8px; align-self: flex-start;
|
||||
display: flex; align-items: center; gap: 5px;
|
||||
}
|
||||
#smcp-input-row {
|
||||
padding: 10px 12px; border-top: 1px solid #eee;
|
||||
display: flex; gap: 8px; flex-shrink: 0;
|
||||
@@ -152,6 +157,12 @@
|
||||
indicator.textContent = reply;
|
||||
indicator.classList.remove('typing');
|
||||
history.push({ role: 'assistant', content: reply });
|
||||
if (data.toolsUsed && data.toolsUsed.length > 0) {
|
||||
const pill = document.createElement('div');
|
||||
pill.className = 'smcp-tools-used';
|
||||
pill.textContent = '⚡ Live: ' + data.toolsUsed.join(', ');
|
||||
messages.appendChild(pill);
|
||||
}
|
||||
} catch {
|
||||
indicator.textContent = 'Network error. Please try again.';
|
||||
indicator.classList.remove('typing');
|
||||
|
||||
Reference in New Issue
Block a user