const { aparteGlobalConfig } = window.aparte;
// Quiet, the default: a shimmer instead of a spinner and "Running", and nothing once it is
// done — the label's tense says it. A refusal, a failure or a stop still says so.
aparteGlobalConfig.registerToolDisplay('web_search', {
label: (segment) => segment.status === 'pending' ? 'Searching the web…' : segment.status === 'resolved' ? 'Searched the web' : 'Search the web',
summary: (segment) => '“' + segment.toolCall.input.query + '”',
details: false,
});
document.querySelector('aparte-chat-bubble').setSegments([
{ id: 's1', type: 'tool_call', status: 'pending', toolCall: { id: 't1', name: 'web_search', input: { query: 'quiet weekend near a lake' } } },
{ id: 's2', type: 'tool_call', status: 'resolved', toolCall: { id: 't2', name: 'web_search', input: { query: 'release checklist' } }, result: '3 pages' },
{ id: 's3', type: 'tool_call', status: 'failed', toolCall: { id: 't3', name: 'web_search', input: { query: 'ferry timetable' } }, result: 'The search service did not answer.' },
]);