@eshal-bot/chat-widget 0.1.108 → 0.1.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat-widget.js +15 -12
- package/package.json +1 -1
package/dist/chat-widget.js
CHANGED
|
@@ -8523,8 +8523,11 @@
|
|
|
8523
8523
|
// unlocks at last-token time) and delivers the chips afterwards
|
|
8524
8524
|
// as their own {type:'follow_up_prompts'} chunk on the same
|
|
8525
8525
|
// stream. Attach them to the already-finalized assistant
|
|
8526
|
-
// message.
|
|
8527
|
-
//
|
|
8526
|
+
// message. EV-3081: this chunk now arrives on EVERY outcome and
|
|
8527
|
+
// carries `promptsStatus` ("delivered" | "empty" | "timeout" |
|
|
8528
|
+
// "error"); a dropped set arrives as the chunk with no `prompts`,
|
|
8529
|
+
// where it used to be no chunk at all. The empty guard below is
|
|
8530
|
+
// what keeps that a no-op here rather than a chip-clearing write.
|
|
8528
8531
|
if (parsed.type === 'follow_up_prompts') {
|
|
8529
8532
|
const latePrompts = Array.isArray(parsed.prompts) ? parsed.prompts : [];
|
|
8530
8533
|
if (latePrompts.length > 0) {
|
|
@@ -8584,8 +8587,8 @@
|
|
|
8584
8587
|
// Retrieval resolves before generation; the backend emits
|
|
8585
8588
|
// {type:'sources'} as soon as the source set is known so the
|
|
8586
8589
|
// user sees grounding during the pre-token wait. PRELIMINARY:
|
|
8587
|
-
// the complete event's overlap-filtered list replaces
|
|
8588
|
-
// clears
|
|
8590
|
+
// the complete event's overlap-filtered list replaces - or
|
|
8591
|
+
// clears - it.
|
|
8589
8592
|
if (parsed.type === 'sources') {
|
|
8590
8593
|
const early = normalizeSources(parsed);
|
|
8591
8594
|
if (early.length > 0) {
|
|
@@ -8646,7 +8649,7 @@
|
|
|
8646
8649
|
|
|
8647
8650
|
// Attach the AUTHORITATIVE (overlap-filtered) sources. When an
|
|
8648
8651
|
// EV-3046 preliminary strip was shown, an empty final list must
|
|
8649
|
-
// CLEAR it
|
|
8652
|
+
// CLEAR it - the filter decided nothing was actually cited.
|
|
8650
8653
|
setMessages(prev => {
|
|
8651
8654
|
const updatedMessages = [...(prev || [])];
|
|
8652
8655
|
const lastMessage = updatedMessages[updatedMessages.length - 1];
|
|
@@ -8723,7 +8726,7 @@
|
|
|
8723
8726
|
}
|
|
8724
8727
|
} catch (err) {
|
|
8725
8728
|
// EV-3045: the user pressed Stop (fetch aborted). The partial answer
|
|
8726
|
-
// stays on screen, finalized
|
|
8729
|
+
// stays on screen, finalized - NOT an error, NOT a retry (retrying a
|
|
8727
8730
|
// deliberately-stopped answer re-asks the question the user killed).
|
|
8728
8731
|
if (err && err.name === 'AbortError') {
|
|
8729
8732
|
if (accumulatedText.current) {
|
|
@@ -8731,7 +8734,7 @@
|
|
|
8731
8734
|
stoppedByUser: true
|
|
8732
8735
|
});
|
|
8733
8736
|
} else {
|
|
8734
|
-
// nothing arrived yet
|
|
8737
|
+
// nothing arrived yet - just drop the skeleton bubble
|
|
8735
8738
|
setMessages(prev => (prev || []).filter(msg => !msg.isProcessing));
|
|
8736
8739
|
}
|
|
8737
8740
|
return;
|
|
@@ -10187,7 +10190,7 @@
|
|
|
10187
10190
|
});
|
|
10188
10191
|
}, [getNextMessageId]);
|
|
10189
10192
|
|
|
10190
|
-
// EV-3045: Stop control. Aborting the fetch is the cancellation signal
|
|
10193
|
+
// EV-3045: Stop control. Aborting the fetch is the cancellation signal -
|
|
10191
10194
|
// the server tears the generator down on disconnect (cancelling the ADK
|
|
10192
10195
|
// run, tool calls and delegation), and persists the partial answer to
|
|
10193
10196
|
// history with a "stopped" marker. Client-side, processStream finalizes
|
|
@@ -10439,7 +10442,7 @@
|
|
|
10439
10442
|
let lastErr;
|
|
10440
10443
|
for (let attempt = 0; attempt <= STREAM_RETRY_DELAYS_MS.length; attempt += 1) {
|
|
10441
10444
|
try {
|
|
10442
|
-
// EV-3045: one controller per attempt
|
|
10445
|
+
// EV-3045: one controller per attempt - the Stop button aborts
|
|
10443
10446
|
// exactly the attempt that is streaming.
|
|
10444
10447
|
streamAbortRef.current = new AbortController();
|
|
10445
10448
|
const stream = await sendStreamingRequest(chatRequest, apiBaseUrl, getAuthToken, streamAbortRef.current.signal);
|
|
@@ -10453,7 +10456,7 @@
|
|
|
10453
10456
|
// EV-3045: a user Stop that aborted BEFORE any bytes arrived
|
|
10454
10457
|
// rejects the fetch itself with AbortError (processStream's
|
|
10455
10458
|
// own AbortError handling covers mid-stream aborts). Treat as
|
|
10456
|
-
// a successful, deliberate end
|
|
10459
|
+
// a successful, deliberate end - never retry a stopped turn.
|
|
10457
10460
|
if (err && err.name === 'AbortError') {
|
|
10458
10461
|
setMessages(prev => (prev || []).filter(msg => !msg.isProcessing));
|
|
10459
10462
|
return {
|
|
@@ -12447,7 +12450,7 @@
|
|
|
12447
12450
|
scrollLeft: "Scroll left",
|
|
12448
12451
|
scrollRight: "Scroll right",
|
|
12449
12452
|
sendMessage: "Send message",
|
|
12450
|
-
// EV-3045: Stop control aria-label. EN-only for now
|
|
12453
|
+
// EV-3045: Stop control aria-label. EN-only for now - translate() falls
|
|
12451
12454
|
// back to EN for locales without the key.
|
|
12452
12455
|
stopGenerating: "Stop generating",
|
|
12453
12456
|
startVoiceInput: "Start voice input",
|
|
@@ -17959,7 +17962,7 @@
|
|
|
17959
17962
|
}), document.body)]
|
|
17960
17963
|
}), isLoading && !isVoiceSessionActive && typeof onStopGeneration === "function" ?
|
|
17961
17964
|
/*#__PURE__*/
|
|
17962
|
-
// EV-3045: Stop replaces Send while a reply streams
|
|
17965
|
+
// EV-3045: Stop replaces Send while a reply streams - the
|
|
17963
17966
|
// convention every benchmark assistant uses. Always enabled;
|
|
17964
17967
|
// the partial answer stays on screen and in history.
|
|
17965
17968
|
jsxRuntimeExports.jsx("button", {
|