@webless/agent 0.10.1 → 0.10.2
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/{chunk-ZYTNNMZS.js → chunk-Q7H4RRS4.js} +19 -21
- package/dist/chunk-Q7H4RRS4.js.map +1 -0
- package/dist/embed.cjs +18 -20
- package/dist/embed.cjs.map +1 -1
- package/dist/embed.js +1 -1
- package/dist/react.cjs +18 -20
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-ZYTNNMZS.js.map +0 -1
|
@@ -5441,7 +5441,7 @@ function MessageBubble({
|
|
|
5441
5441
|
/* @__PURE__ */ jsx8(
|
|
5442
5442
|
Streamdown,
|
|
5443
5443
|
{
|
|
5444
|
-
animated:
|
|
5444
|
+
animated: false,
|
|
5445
5445
|
caret: "circle",
|
|
5446
5446
|
className: "message-bubble__markdown",
|
|
5447
5447
|
controls: false,
|
|
@@ -6338,14 +6338,21 @@ function AgentRail({
|
|
|
6338
6338
|
const activeVisitorToolInput = [...visitorToolResults].reverse().find((result) => result.kind === "input");
|
|
6339
6339
|
const visibleVisitorToolResults = activeVisitorToolInput ? [activeVisitorToolInput] : visitorToolResults;
|
|
6340
6340
|
const activityActive = state.toolSteps.some((step) => step.state === "active");
|
|
6341
|
-
const showActivity = state.toolSteps.length > 0 && pendingInputRequests.length === 0 && !state.pendingOffer && activityActive;
|
|
6341
|
+
const showActivity = state.toolSteps.length > 0 && pendingInputRequests.length === 0 && !state.pendingOffer && (activityActive || isBusy && !state.streamingText);
|
|
6342
|
+
const activitySteps = activityActive || !isBusy || state.streamingText ? state.toolSteps : [...state.toolSteps, {
|
|
6343
|
+
id: "preparing-answer",
|
|
6344
|
+
kind: "tool",
|
|
6345
|
+
label: "Preparing your answer",
|
|
6346
|
+
detail: "Preparing your answer",
|
|
6347
|
+
state: "active"
|
|
6348
|
+
}];
|
|
6342
6349
|
const hasVisitorMessages2 = state.messages.some(
|
|
6343
6350
|
(message) => message.role === "visitor"
|
|
6344
6351
|
);
|
|
6345
6352
|
const hasAgentResponseAfterVisitor = state.messages.some(
|
|
6346
6353
|
(message) => message.role === "agent" && message.id !== "greeting"
|
|
6347
6354
|
);
|
|
6348
|
-
const showDisclaimerLabel = Boolean(resolvedDisclaimerLabel) && hasVisitorMessages2 && (hasAgentResponseAfterVisitor ||
|
|
6355
|
+
const showDisclaimerLabel = Boolean(resolvedDisclaimerLabel) && hasVisitorMessages2 && (hasAgentResponseAfterVisitor || Boolean(state.streamingText));
|
|
6349
6356
|
const showIdleFollowUps = !hasVisitorMessages2 && state.followUps.length > 0;
|
|
6350
6357
|
const greeting = state.messages.find(
|
|
6351
6358
|
(message) => message.role === "agent" && message.id === "greeting"
|
|
@@ -6368,11 +6375,11 @@ function AgentRail({
|
|
|
6368
6375
|
}
|
|
6369
6376
|
const lastIsAgent = lastMessage?.role === "agent";
|
|
6370
6377
|
const showMessageActions = state.phase === "complete" && lastIsAgent && hasVisitorMessages2 && Boolean(hideToolCardFences(lastMessage.text).trim());
|
|
6371
|
-
const streamingMessage = state.
|
|
6378
|
+
const streamingMessage = state.streamingText && !lastIsAgent ? {
|
|
6372
6379
|
createdAt: 0,
|
|
6373
6380
|
id: "streaming-response",
|
|
6374
6381
|
role: "agent",
|
|
6375
|
-
streaming:
|
|
6382
|
+
streaming: isBusy,
|
|
6376
6383
|
text: state.streamingText,
|
|
6377
6384
|
searchResults: (state.toolResults ?? []).filter(
|
|
6378
6385
|
(result) => result.kind === "search"
|
|
@@ -6384,6 +6391,7 @@ function AgentRail({
|
|
|
6384
6391
|
streaming: false,
|
|
6385
6392
|
text: "Pick a date and time that works for you."
|
|
6386
6393
|
} : null;
|
|
6394
|
+
const transcriptMessages = streamingMessage ? [...visibleMessages, streamingMessage] : visibleMessages;
|
|
6387
6395
|
const bookingReadyText = state.streamingText || (lastIsAgent && lastMessage?.role === "agent" ? lastMessage.text : "");
|
|
6388
6396
|
const waitingForBooking = !state.pendingOffer && looksLikeBookingReady(bookingReadyText) && (state.phase === "thinking" || state.phase === "running-tools" || state.phase === "streaming");
|
|
6389
6397
|
const lastAgentText = lastIsAgent && lastMessage?.role === "agent" ? lastMessage.text : "";
|
|
@@ -6616,7 +6624,7 @@ function AgentRail({
|
|
|
6616
6624
|
brandLabel: resolvedBrandLabel,
|
|
6617
6625
|
brandLogoUrl: showBrandLogo ? resolvedBrandLogoUrl : void 0,
|
|
6618
6626
|
failed: state.phase === "error",
|
|
6619
|
-
steps:
|
|
6627
|
+
steps: activitySteps
|
|
6620
6628
|
}
|
|
6621
6629
|
) : null,
|
|
6622
6630
|
visibleVisitorToolResults.map((result) => /* @__PURE__ */ jsx17(
|
|
@@ -6637,7 +6645,7 @@ function AgentRail({
|
|
|
6637
6645
|
request.requestId
|
|
6638
6646
|
))
|
|
6639
6647
|
] }) : null,
|
|
6640
|
-
|
|
6648
|
+
transcriptMessages.map((message, index) => /* @__PURE__ */ jsxs16(
|
|
6641
6649
|
"div",
|
|
6642
6650
|
{
|
|
6643
6651
|
ref: index === lastVisitorIndex + 1 ? responseRef : void 0,
|
|
@@ -6650,7 +6658,7 @@ function AgentRail({
|
|
|
6650
6658
|
message,
|
|
6651
6659
|
bookingDisabled: isBusy,
|
|
6652
6660
|
brandLogoUrl: showBrandLogo ? resolvedBrandLogoUrl : void 0,
|
|
6653
|
-
offer: index ===
|
|
6661
|
+
offer: index === transcriptMessages.length - 1 ? state.pendingOffer : void 0,
|
|
6654
6662
|
onBook
|
|
6655
6663
|
}
|
|
6656
6664
|
),
|
|
@@ -6673,7 +6681,7 @@ function AgentRail({
|
|
|
6673
6681
|
brandLabel: resolvedBrandLabel,
|
|
6674
6682
|
brandLogoUrl: showBrandLogo ? resolvedBrandLogoUrl : void 0,
|
|
6675
6683
|
failed: state.phase === "error",
|
|
6676
|
-
steps:
|
|
6684
|
+
steps: activitySteps
|
|
6677
6685
|
}
|
|
6678
6686
|
) : null,
|
|
6679
6687
|
visibleVisitorToolResults.map((result) => /* @__PURE__ */ jsx17(
|
|
@@ -6696,18 +6704,8 @@ function AgentRail({
|
|
|
6696
6704
|
] }) : null
|
|
6697
6705
|
]
|
|
6698
6706
|
},
|
|
6699
|
-
message.id
|
|
6707
|
+
message.role === "agent" && transcriptMessages[index - 1]?.role === "visitor" ? `answer-${transcriptMessages[index - 1]?.id}` : message.id
|
|
6700
6708
|
)),
|
|
6701
|
-
streamingMessage ? /* @__PURE__ */ jsx17("div", { ref: responseRef, children: /* @__PURE__ */ jsx17(
|
|
6702
|
-
MessageBubble,
|
|
6703
|
-
{
|
|
6704
|
-
message: streamingMessage,
|
|
6705
|
-
bookingDisabled: isBusy,
|
|
6706
|
-
brandLogoUrl: showBrandLogo ? resolvedBrandLogoUrl : void 0,
|
|
6707
|
-
offer: state.pendingOffer,
|
|
6708
|
-
onBook
|
|
6709
|
-
}
|
|
6710
|
-
) }) : null,
|
|
6711
6709
|
waitingForBooking ? /* @__PURE__ */ jsx17(BookingCardLoader, {}) : null,
|
|
6712
6710
|
state.error ? /* @__PURE__ */ jsxs16("section", { className: "agent-rail__error", role: "alert", children: [
|
|
6713
6711
|
/* @__PURE__ */ jsxs16("div", { children: [
|
|
@@ -7434,4 +7432,4 @@ export {
|
|
|
7434
7432
|
sendAgentAnswerFeedback,
|
|
7435
7433
|
AgentWidget
|
|
7436
7434
|
};
|
|
7437
|
-
//# sourceMappingURL=chunk-
|
|
7435
|
+
//# sourceMappingURL=chunk-Q7H4RRS4.js.map
|