@mgamadeus/ddd-agents 0.5.17 → 0.6.1
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/README.md +162 -6
- package/boundary.json +13 -0
- package/dist/chat.js +148 -773
- package/dist/chat.js.map +1 -1
- package/dist/chunks/{canvas-title-slot-context-DK4sfhkl.js → ConversationMarkdown-BsCjyhj4.js} +14 -43
- package/dist/chunks/ConversationMarkdown-BsCjyhj4.js.map +1 -0
- package/dist/chunks/{ConversationMessageInputComposerWidgets-B3Zf69rD.js → ConversationMessageInputComposerWidgets-CE8LpyXY.js} +10 -37
- package/dist/chunks/ConversationMessageInputComposerWidgets-CE8LpyXY.js.map +1 -0
- package/dist/chunks/VoiceBarsIcon-BIcURsBF.js +643 -0
- package/dist/chunks/VoiceBarsIcon-BIcURsBF.js.map +1 -0
- package/dist/chunks/{WebSearchResultsConversationWidget-887v8Wen.js → WebSearchResultsConversationWidget-DXhfSikV.js} +2 -2
- package/dist/chunks/{WebSearchResultsConversationWidget-887v8Wen.js.map → WebSearchResultsConversationWidget-DXhfSikV.js.map} +1 -1
- package/dist/chunks/{browser-request-interception-BdKjYz31.js → browser-request-interception-BnzFbH0m.js} +2 -2
- package/dist/chunks/{browser-request-interception-BdKjYz31.js.map → browser-request-interception-BnzFbH0m.js.map} +1 -1
- package/dist/chunks/{canvas-reducers-CwFA3rQ6.js → canvas-reducers-D-YxAR4B.js} +2 -2
- package/dist/chunks/{canvas-reducers-CwFA3rQ6.js.map → canvas-reducers-D-YxAR4B.js.map} +1 -1
- package/dist/chunks/canvas-title-slot-context-D6UXrkdJ.js +36 -0
- package/dist/chunks/canvas-title-slot-context-D6UXrkdJ.js.map +1 -0
- package/dist/chunks/{canvasBodies-C7qqThc9.js → canvasBodies-CQEBkIVw.js} +4 -4
- package/dist/chunks/{canvasBodies-C7qqThc9.js.map → canvasBodies-CQEBkIVw.js.map} +1 -1
- package/dist/chunks/{canvasStorage-i2wKVSBf.js → canvasStorage-BbEI3h-8.js} +2 -2
- package/dist/chunks/{canvasStorage-i2wKVSBf.js.map → canvasStorage-BbEI3h-8.js.map} +1 -1
- package/dist/chunks/format-agent-voice-call-duration-C-3hRc9p.js +10 -0
- package/dist/chunks/format-agent-voice-call-duration-C-3hRc9p.js.map +1 -0
- package/dist/chunks/{link-navigation-CNX8Am2L.js → link-navigation-BUcy5qWW.js} +2 -2
- package/dist/chunks/{link-navigation-CNX8Am2L.js.map → link-navigation-BUcy5qWW.js.map} +1 -1
- package/dist/chunks/{realtime-arrival-BTLE3jjt.js → realtime-arrival-BfsAPwqQ.js} +8 -3
- package/dist/chunks/realtime-arrival-BfsAPwqQ.js.map +1 -0
- package/dist/chunks/use-agents-chat-store-CuIkCz9v.js +34 -0
- package/dist/chunks/use-agents-chat-store-CuIkCz9v.js.map +1 -0
- package/dist/chunks/{widget-name-resolver-BVEuAsW5.js → widget-name-resolver-B9k-s_cF.js} +3 -3
- package/dist/chunks/{widget-name-resolver-BVEuAsW5.js.map → widget-name-resolver-B9k-s_cF.js.map} +1 -1
- package/dist/chunks/withPollingChangeSubscription-CnQnubfK.js.map +1 -1
- package/dist/client-testing.js +4 -4
- package/dist/client.js +14 -3
- package/dist/client.js.map +1 -1
- package/dist/files/i18n-keys.json +1128 -100
- package/dist/image-render.js +7 -7
- package/dist/index.js +6 -6
- package/dist/kit.js +2 -2
- package/dist/preview.js +7 -7
- package/dist/provider.js +1 -1
- package/dist/renderer.js +25 -24
- package/dist/renderer.js.map +1 -1
- package/dist/styles.css +531 -93
- package/dist/types/client/AgentsConversationClient.d.ts +4 -1
- package/dist/types/client/http/createAgentsHttpConversationClient.d.ts +2 -1
- package/dist/types/entries/voice-admin.d.ts +7 -0
- package/dist/types/entries/voice.d.ts +24 -0
- package/dist/types/ui/account-realtime.d.ts +50 -11
- package/dist/types/voice/AgentVoiceCallBand/AgentVoiceCallBand.d.ts +49 -0
- package/dist/types/voice/AgentVoiceCallBand/agent-voice-call-outcome-title-text-key.d.ts +8 -0
- package/dist/types/voice/AgentVoiceCallCaptions/AgentVoiceCallCaptions.d.ts +15 -0
- package/dist/types/voice/AgentVoiceCallCaptions/saved-messages-of-agent-voice-chat.d.ts +12 -0
- package/dist/types/voice/AgentVoiceCallProvider/AgentVoiceCallProvider.d.ts +21 -0
- package/dist/types/voice/AgentVoiceCallProvider/agent-voice-call-context.d.ts +17 -0
- package/dist/types/voice/AgentVoiceChatStartButton/AgentVoiceChatStartButton.d.ts +15 -0
- package/dist/types/voice/AgentVoiceIcons/AgentVoiceIcons.d.ts +10 -0
- package/dist/types/voice/AgentVoiceIncomingCall/AgentVoiceIncomingCall.d.ts +28 -0
- package/dist/types/voice/AgentVoiceInputGlow/AgentVoiceInputGlow.d.ts +11 -0
- package/dist/types/voice/AgentVoiceInputGlow/agent-voice-input-glow-voice.d.ts +8 -0
- package/dist/types/voice/admin/AgentVoiceCallConversationLink/AgentVoiceCallConversationLink.d.ts +10 -0
- package/dist/types/voice/admin/AgentVoiceCallDetailScreen/AgentVoiceCallDetailScreen.d.ts +27 -0
- package/dist/types/voice/admin/AgentVoiceCallStateBadges/AgentVoiceCallStateBadges.d.ts +12 -0
- package/dist/types/voice/admin/AgentVoiceCallsScreen/AgentVoiceCallsScreen.d.ts +33 -0
- package/dist/types/voice/admin/agent-voice-admin-api.d.ts +59 -0
- package/dist/types/voice/admin/agent-voice-admin-format.d.ts +39 -0
- package/dist/types/voice/admin/agent-voice-admin-types.d.ts +114 -0
- package/dist/types/voice/agent-voice-api.d.ts +114 -0
- package/dist/types/voice/call/agent-voice-call-elapsed-seconds.d.ts +6 -0
- package/dist/types/voice/call/agent-voice-call-end-reasons.d.ts +3 -0
- package/dist/types/voice/call/agent-voice-call-store.d.ts +111 -0
- package/dist/types/voice/call/agent-voice-call-turn.d.ts +4 -0
- package/dist/types/voice/call/build-unsaved-agent-voice-call-lines.d.ts +14 -0
- package/dist/types/voice/call/format-agent-voice-call-duration.d.ts +2 -0
- package/dist/types/voice/call/use-agent-voice-call-elapsed-seconds.d.ts +3 -0
- package/dist/types/voice/call/use-agent-voice-call-server-end.d.ts +15 -0
- package/dist/types/voice/call/use-agent-voice-call.d.ts +12 -0
- package/dist/types/voice/call/use-follow-agent-voice-call-conversation.d.ts +9 -0
- package/dist/types/voice/ring/agent-voice-caller-label.d.ts +21 -0
- package/dist/types/voice/ring/agent-voice-incoming-ring-list.d.ts +10 -0
- package/dist/types/voice/ring/agent-voice-incoming-ring-store.d.ts +47 -0
- package/dist/types/voice/ring/agent-voice-ring-source.d.ts +60 -0
- package/dist/types/voice/ring/agent-voice-ring.d.ts +35 -0
- package/dist/types/voice/ring/answer-incoming-agent-voice-call.d.ts +13 -0
- package/dist/types/voice/ring/use-agent-voice-incoming-rings.d.ts +14 -0
- package/dist/types/voice/ring/use-agent-voice-ring-tone.d.ts +6 -0
- package/dist/ui.js +82 -19
- package/dist/ui.js.map +1 -1
- package/dist/voice-admin.js +738 -0
- package/dist/voice-admin.js.map +1 -0
- package/dist/voice.js +1568 -0
- package/dist/voice.js.map +1 -0
- package/dist/widgets.js +4 -4
- package/package.json +27 -1
- package/public-api.json +155 -0
- package/dist/chunks/ConversationMessageInputComposerWidgets-B3Zf69rD.js.map +0 -1
- package/dist/chunks/canvas-title-slot-context-DK4sfhkl.js.map +0 -1
- package/dist/chunks/realtime-arrival-BTLE3jjt.js.map +0 -1
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { s as Text, F as classNames, I as Icon, a5 as useAgentsEnvironment, B as Button } from "./link-navigation-BUcy5qWW.js";
|
|
4
|
+
import { useMemo, useState, useRef, useCallback, useEffect, useContext, useLayoutEffect, memo } from "react";
|
|
5
|
+
import { f as findBalancedJsonObjectEnd, s as splitComposerWidgetFencesFromMessageText, e as WidgetWindowRootContext, C as ConversationMarkdown } from "./ConversationMarkdown-BsCjyhj4.js";
|
|
6
|
+
import { W as WIDGET_FENCE_LANG, G as resolveWidgetName, j as conversationWidgetRegistry, o as ConversationWidgetErrorBoundary } from "./widget-name-resolver-B9k-s_cF.js";
|
|
7
|
+
const ANY_FENCE_DELIM_LINE = /^ {0,3}(`{3,}|~{3,})(.*)$/;
|
|
8
|
+
const parseFenceDelimiterLine = (line) => {
|
|
9
|
+
const match = ANY_FENCE_DELIM_LINE.exec(line);
|
|
10
|
+
if (!match) return null;
|
|
11
|
+
const marker = match[1];
|
|
12
|
+
const char = marker[0];
|
|
13
|
+
const info = match[2].trim();
|
|
14
|
+
if (char === "`" && info.includes("`")) return null;
|
|
15
|
+
return { char, length: marker.length, info };
|
|
16
|
+
};
|
|
17
|
+
const isWidgetFenceInfo = (info) => new RegExp(`^${WIDGET_FENCE_LANG}\\b`).test(info.trim());
|
|
18
|
+
const widgetOpenerPattern = () => new RegExp("```[ \\t]*" + WIDGET_FENCE_LANG + "\\b");
|
|
19
|
+
const readLine = (text, lineStart) => {
|
|
20
|
+
const newlineIndex = text.indexOf("\n", lineStart);
|
|
21
|
+
const lineEnd = newlineIndex === -1 ? text.length : newlineIndex;
|
|
22
|
+
const afterLine = newlineIndex === -1 ? text.length : newlineIndex + 1;
|
|
23
|
+
const rawContent = text.slice(lineStart, lineEnd);
|
|
24
|
+
return { content: rawContent.endsWith("\r") ? rawContent.slice(0, -1) : rawContent, afterLine };
|
|
25
|
+
};
|
|
26
|
+
const findClosingFenceEnd = (text, bodyStart, opener) => {
|
|
27
|
+
let cursor = bodyStart;
|
|
28
|
+
while (cursor < text.length) {
|
|
29
|
+
const { content, afterLine } = readLine(text, cursor);
|
|
30
|
+
const delimiter = parseFenceDelimiterLine(content);
|
|
31
|
+
if (delimiter && delimiter.char === opener.char && delimiter.length >= opener.length && delimiter.info === "") {
|
|
32
|
+
return afterLine;
|
|
33
|
+
}
|
|
34
|
+
cursor = afterLine;
|
|
35
|
+
}
|
|
36
|
+
return text.length;
|
|
37
|
+
};
|
|
38
|
+
const findFencedBlockRanges = (text) => {
|
|
39
|
+
const ranges = [];
|
|
40
|
+
let cursor = 0;
|
|
41
|
+
while (cursor < text.length) {
|
|
42
|
+
const { content, afterLine } = readLine(text, cursor);
|
|
43
|
+
const opener = parseFenceDelimiterLine(content);
|
|
44
|
+
if (opener) {
|
|
45
|
+
const end = findClosingFenceEnd(text, afterLine, opener);
|
|
46
|
+
ranges.push([cursor, end]);
|
|
47
|
+
cursor = end;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
cursor = afterLine;
|
|
51
|
+
}
|
|
52
|
+
return ranges;
|
|
53
|
+
};
|
|
54
|
+
const findFenceEnd = (text, bodyStart) => {
|
|
55
|
+
let cursor = bodyStart;
|
|
56
|
+
while (cursor < text.length) {
|
|
57
|
+
const { content, afterLine } = readLine(text, cursor);
|
|
58
|
+
const delimiter = parseFenceDelimiterLine(content);
|
|
59
|
+
if (delimiter && delimiter.char === "`") {
|
|
60
|
+
return delimiter.info === "" ? { closesAt: afterLine } : { unclosedBoundary: cursor };
|
|
61
|
+
}
|
|
62
|
+
cursor = afterLine;
|
|
63
|
+
}
|
|
64
|
+
return { unclosedBoundary: text.length };
|
|
65
|
+
};
|
|
66
|
+
const closeWidgetFenceBody = (text, bodyStart) => {
|
|
67
|
+
const end = findFenceEnd(text, bodyStart);
|
|
68
|
+
if ("closesAt" in end) {
|
|
69
|
+
return { appended: text.slice(bodyStart, end.closesAt), resumeAt: end.closesAt };
|
|
70
|
+
}
|
|
71
|
+
const jsonObjectEnd = findBalancedJsonObjectEnd(text, bodyStart);
|
|
72
|
+
if (jsonObjectEnd === null) {
|
|
73
|
+
return { appended: text.slice(bodyStart), resumeAt: text.length };
|
|
74
|
+
}
|
|
75
|
+
return { appended: text.slice(bodyStart, jsonObjectEnd + 1) + "\n```", resumeAt: jsonObjectEnd + 1 };
|
|
76
|
+
};
|
|
77
|
+
const repairMalformedWidgetFences = (text) => {
|
|
78
|
+
if (!widgetOpenerPattern().test(text)) return text;
|
|
79
|
+
let result = "";
|
|
80
|
+
let cursor = 0;
|
|
81
|
+
while (cursor < text.length) {
|
|
82
|
+
const { content, afterLine } = readLine(text, cursor);
|
|
83
|
+
const delimiter = parseFenceDelimiterLine(content);
|
|
84
|
+
if (delimiter && delimiter.char === "`") {
|
|
85
|
+
const info = delimiter.info;
|
|
86
|
+
if (info !== "" && isWidgetFenceInfo(info)) {
|
|
87
|
+
result += content + text.slice(cursor + content.length, afterLine);
|
|
88
|
+
const { appended, resumeAt } = closeWidgetFenceBody(text, afterLine);
|
|
89
|
+
result += appended;
|
|
90
|
+
cursor = resumeAt;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (info !== "") {
|
|
94
|
+
const otherFenceEnd = findFenceEnd(text, afterLine);
|
|
95
|
+
const bodyEnd = "closesAt" in otherFenceEnd ? otherFenceEnd.closesAt : text.length;
|
|
96
|
+
result += text.slice(cursor, bodyEnd);
|
|
97
|
+
cursor = bodyEnd;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const gluedMatch = widgetOpenerPattern().exec(content);
|
|
102
|
+
if (gluedMatch && gluedMatch.index > 0 && content.slice(0, gluedMatch.index).trim() !== "") {
|
|
103
|
+
const bodyStart = afterLine;
|
|
104
|
+
if (findBalancedJsonObjectEnd(text, bodyStart) !== null) {
|
|
105
|
+
const openerLine = content.slice(gluedMatch.index) + text.slice(cursor + content.length, afterLine);
|
|
106
|
+
result += content.slice(0, gluedMatch.index) + "\n" + openerLine;
|
|
107
|
+
const { appended, resumeAt } = closeWidgetFenceBody(text, bodyStart);
|
|
108
|
+
result += appended;
|
|
109
|
+
cursor = resumeAt;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
result += text.slice(cursor, afterLine);
|
|
114
|
+
cursor = afterLine;
|
|
115
|
+
}
|
|
116
|
+
return result;
|
|
117
|
+
};
|
|
118
|
+
const scanLineStartingJsonSpans = (text) => {
|
|
119
|
+
const spans = [];
|
|
120
|
+
const lines = text.split("\n");
|
|
121
|
+
let offset = 0;
|
|
122
|
+
for (const line of lines) {
|
|
123
|
+
const lineStart = offset;
|
|
124
|
+
offset += line.length + 1;
|
|
125
|
+
if (!line.trimStart().startsWith("{")) continue;
|
|
126
|
+
const openIndex = lineStart + line.indexOf("{");
|
|
127
|
+
const jsonObjectEnd = findBalancedJsonObjectEnd(text, openIndex);
|
|
128
|
+
if (jsonObjectEnd !== null) {
|
|
129
|
+
spans.push({ json: text.slice(openIndex, jsonObjectEnd + 1), start: openIndex, end: jsonObjectEnd + 1 });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return spans;
|
|
133
|
+
};
|
|
134
|
+
const widgetTypeOf = (jsonCandidate) => {
|
|
135
|
+
let parsed;
|
|
136
|
+
try {
|
|
137
|
+
parsed = JSON.parse(jsonCandidate);
|
|
138
|
+
} catch {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
if (typeof parsed !== "object" || parsed === null) return null;
|
|
142
|
+
const type = parsed.type;
|
|
143
|
+
return typeof type === "string" && type !== "" ? type : null;
|
|
144
|
+
};
|
|
145
|
+
const referenceNakedWidgetJson = (text) => {
|
|
146
|
+
if (!text.includes('"type"')) return text;
|
|
147
|
+
const fencedRanges = findFencedBlockRanges(text);
|
|
148
|
+
const isInsideFence = (position) => fencedRanges.some(([start, end]) => position >= start && position < end);
|
|
149
|
+
const spans = scanLineStartingJsonSpans(text).filter((span) => !isInsideFence(span.start)).reverse();
|
|
150
|
+
let result = text;
|
|
151
|
+
for (const span of spans) {
|
|
152
|
+
const type = widgetTypeOf(span.json);
|
|
153
|
+
if (type === null || resolveWidgetName(type) === void 0) continue;
|
|
154
|
+
const fencedBlock = "```widget\n" + span.json + "\n```";
|
|
155
|
+
result = result.slice(0, span.start) + fencedBlock + result.slice(span.end);
|
|
156
|
+
}
|
|
157
|
+
return result;
|
|
158
|
+
};
|
|
159
|
+
const PRE_CALL_MESSAGE_MARKER = "{preCallMessage}";
|
|
160
|
+
const MANGLED_PRE_CALL_RE = /\{\s*"preCallMessage"\s*:\s*"((?:[^"\\]|\\.)*)"\s*,?\s*[^}]*\}\s*(?:<\S*)?/g;
|
|
161
|
+
const stripPreCallMessageMarker = (text) => {
|
|
162
|
+
if (!text) return text;
|
|
163
|
+
const leading = text.replace(/^\s+/, "");
|
|
164
|
+
if (leading.length < PRE_CALL_MESSAGE_MARKER.length && PRE_CALL_MESSAGE_MARKER.startsWith(leading)) return "";
|
|
165
|
+
const mangledPrefix = '{ "preCallMessage"';
|
|
166
|
+
const normalizedLeading = leading.replace(/\s+/g, " ");
|
|
167
|
+
if (normalizedLeading.length < mangledPrefix.length && mangledPrefix.startsWith(normalizedLeading) || normalizedLeading.startsWith(mangledPrefix) && !normalizedLeading.includes("}")) {
|
|
168
|
+
return "";
|
|
169
|
+
}
|
|
170
|
+
const withMangledNormalized = text.replace(MANGLED_PRE_CALL_RE, (_match, escapedStatusLine) => {
|
|
171
|
+
try {
|
|
172
|
+
return JSON.parse(`"${escapedStatusLine}"`);
|
|
173
|
+
} catch {
|
|
174
|
+
return escapedStatusLine;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
const withMarkerRemoved = withMangledNormalized.split(PRE_CALL_MESSAGE_MARKER).join("");
|
|
178
|
+
const markerWasLeading = leading.startsWith(PRE_CALL_MESSAGE_MARKER) || normalizedLeading.startsWith(mangledPrefix);
|
|
179
|
+
return markerWasLeading ? withMarkerRemoved.replace(/^\s+/, "") : withMarkerRemoved;
|
|
180
|
+
};
|
|
181
|
+
const WIDGET_ATTR_KEY = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/;
|
|
182
|
+
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
183
|
+
const isTextPart = (part) => isRecord(part) && part.type === "text";
|
|
184
|
+
const isComponentPart = (part) => isRecord(part) && part.type === "component" && typeof part.name === "string" && part.name.length > 0;
|
|
185
|
+
const isToolUsePart = (part) => isRecord(part) && part.type === "tool_use";
|
|
186
|
+
const isMessagePart = (part) => isTextPart(part) || isComponentPart(part) || isToolUsePart(part);
|
|
187
|
+
const isPayload = (value) => {
|
|
188
|
+
if (!isRecord(value)) return false;
|
|
189
|
+
const parts = value.content ?? value.parts;
|
|
190
|
+
return Array.isArray(parts) && parts.every(isMessagePart);
|
|
191
|
+
};
|
|
192
|
+
const coerceSinglePartPayload = (value) => {
|
|
193
|
+
if (!isRecord(value)) return null;
|
|
194
|
+
const part = value.content ?? value.parts;
|
|
195
|
+
if (!isMessagePart(part)) return null;
|
|
196
|
+
const rest = { ...value };
|
|
197
|
+
delete rest.parts;
|
|
198
|
+
return { ...rest, content: [part] };
|
|
199
|
+
};
|
|
200
|
+
const encodeAttrValue = (value) => JSON.stringify(value).replace(/'/g, "\\u0027");
|
|
201
|
+
const propsToAttrs = (props) => Object.entries(props).filter(([key, value]) => value !== void 0 && WIDGET_ATTR_KEY.test(key)).map(([key, value]) => `${key}='${encodeAttrValue(value)}'`).join(" ");
|
|
202
|
+
const componentPartToWidget = (part) => {
|
|
203
|
+
const attrs = propsToAttrs(part.props ?? {});
|
|
204
|
+
return attrs ? `::${part.name}{${attrs}}` : `::${part.name}`;
|
|
205
|
+
};
|
|
206
|
+
const toolUsePartToWidget = (part) => {
|
|
207
|
+
const payload = encodeAttrValue({ name: part.name, input: part.input });
|
|
208
|
+
return `::ToolTrace{payload='${payload}'}`;
|
|
209
|
+
};
|
|
210
|
+
const partToMarkdown = (part) => {
|
|
211
|
+
if (isTextPart(part)) return part.text?.trim() ?? "";
|
|
212
|
+
if (isToolUsePart(part)) return toolUsePartToWidget(part);
|
|
213
|
+
return componentPartToWidget(part);
|
|
214
|
+
};
|
|
215
|
+
const payloadToMarkdown = (payload) => {
|
|
216
|
+
return (payload.content ?? payload.parts ?? []).map(partToMarkdown).filter(Boolean).join("\n\n");
|
|
217
|
+
};
|
|
218
|
+
const tryParsePayload = (value) => {
|
|
219
|
+
try {
|
|
220
|
+
const parsed = JSON.parse(value);
|
|
221
|
+
return isPayload(parsed) ? parsed : coerceSinglePartPayload(parsed);
|
|
222
|
+
} catch {
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
const normalizeServerMessageToMarkdown = (message2) => {
|
|
227
|
+
let result;
|
|
228
|
+
if (typeof message2 === "string") {
|
|
229
|
+
const parsed = tryParsePayload(message2);
|
|
230
|
+
result = parsed ? payloadToMarkdown(parsed) : message2;
|
|
231
|
+
} else if (isPayload(message2)) {
|
|
232
|
+
result = payloadToMarkdown(message2);
|
|
233
|
+
} else {
|
|
234
|
+
const coerced = coerceSinglePartPayload(message2);
|
|
235
|
+
if (coerced) {
|
|
236
|
+
result = payloadToMarkdown(coerced);
|
|
237
|
+
} else {
|
|
238
|
+
console.warn("[AIExtensions] normalizeServerMessageToMarkdown: unrecognized message shape", message2);
|
|
239
|
+
result = "";
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return referenceNakedWidgetJson(repairMalformedWidgetFences(stripPreCallMessageMarker(result)));
|
|
243
|
+
};
|
|
244
|
+
const message = "agents_message_BScH1l";
|
|
245
|
+
const messageWithWidgetsAboveBubble = "agents_messageWithWidgetsAboveBubble_bWTYWp";
|
|
246
|
+
const whiteBubble = "agents_whiteBubble_4-I21V";
|
|
247
|
+
const darkBubble = "agents_darkBubble_YdEIoi";
|
|
248
|
+
const primaryBubble = "agents_primaryBubble_jo9Zj-";
|
|
249
|
+
const styles$3 = {
|
|
250
|
+
message,
|
|
251
|
+
messageWithWidgetsAboveBubble,
|
|
252
|
+
whiteBubble,
|
|
253
|
+
darkBubble,
|
|
254
|
+
primaryBubble
|
|
255
|
+
};
|
|
256
|
+
const ConversationMessageUserWidgets = (props) => {
|
|
257
|
+
const { widgets } = props;
|
|
258
|
+
if (widgets.length === 0) return null;
|
|
259
|
+
return /* @__PURE__ */ jsx(Fragment, { children: widgets.map((widget) => {
|
|
260
|
+
const entry = conversationWidgetRegistry.widgets.find((candidate) => candidate.name === widget.widgetName);
|
|
261
|
+
if (!entry) return null;
|
|
262
|
+
const Component = entry.component;
|
|
263
|
+
return /* @__PURE__ */ jsx(ConversationWidgetErrorBoundary, { widgetName: entry.name, children: /* @__PURE__ */ jsx(Component, { payload: JSON.stringify(widget.fields), fresh: false }) }, widget.composerWidgetId);
|
|
264
|
+
}) });
|
|
265
|
+
};
|
|
266
|
+
const isShownAboveBubble = (widget) => conversationWidgetRegistry.widgets.find((entry) => entry.name === widget.widgetName)?.customerMessagePlacement === "aboveBubble";
|
|
267
|
+
const ConversationMessageUser = (props) => {
|
|
268
|
+
const { text, isGenericChat, theme = "default" } = props;
|
|
269
|
+
const { text: proseText, widgets } = useMemo(() => splitComposerWidgetFencesFromMessageText(text), [text]);
|
|
270
|
+
const widgetsAboveBubble = useMemo(() => widgets.filter(isShownAboveBubble), [widgets]);
|
|
271
|
+
const widgetsInsideBubble = useMemo(() => widgets.filter((widget) => !isShownAboveBubble(widget)), [widgets]);
|
|
272
|
+
const bubbleClass = theme === "light" ? styles$3.whiteBubble : theme === "dark" ? styles$3.darkBubble : theme === "primary" ? styles$3.primaryBubble : void 0;
|
|
273
|
+
const textColor = theme === "light" ? "var(--agents-fg)" : theme === "dark" ? "var(--agents-chat-user-bubble-text)" : "var(--agents-fg-on-accent)";
|
|
274
|
+
const bubble = /* @__PURE__ */ jsxs("div", { className: classNames(styles$3.message, bubbleClass), "data-testid": "chat-message-user", children: [
|
|
275
|
+
/* @__PURE__ */ jsx(ConversationMessageUserWidgets, { widgets: widgetsInsideBubble }),
|
|
276
|
+
proseText !== "" && /* @__PURE__ */ jsx(Text, { allowNewLines: true, translate: false, color: textColor, children: proseText })
|
|
277
|
+
] });
|
|
278
|
+
if (widgetsAboveBubble.length === 0) return bubble;
|
|
279
|
+
return /* @__PURE__ */ jsxs("div", { className: styles$3.messageWithWidgetsAboveBubble, children: [
|
|
280
|
+
/* @__PURE__ */ jsx(ConversationMessageUserWidgets, { widgets: widgetsAboveBubble }),
|
|
281
|
+
(proseText !== "" || widgetsInsideBubble.length > 0) && bubble
|
|
282
|
+
] });
|
|
283
|
+
};
|
|
284
|
+
const responseContainer = "agents_responseContainer_1-FSNs";
|
|
285
|
+
const responseMessage = "agents_responseMessage_Xrs7fL";
|
|
286
|
+
const styles$2 = {
|
|
287
|
+
responseContainer,
|
|
288
|
+
responseMessage
|
|
289
|
+
};
|
|
290
|
+
const useTypewriter = (options = {}) => {
|
|
291
|
+
const { speed = 200, commitIntervalMs = 50 } = options;
|
|
292
|
+
const [displayedText, setDisplayedText] = useState("");
|
|
293
|
+
const [isFinished, setIsFinished] = useState(false);
|
|
294
|
+
const fullTextRef = useRef("");
|
|
295
|
+
const typeRAFRef = useRef(null);
|
|
296
|
+
const lastTimestampRef = useRef(null);
|
|
297
|
+
const renderedLengthRef = useRef(0);
|
|
298
|
+
const speedRef = useRef(speed);
|
|
299
|
+
const commitIntervalRef = useRef(commitIntervalMs);
|
|
300
|
+
const lastCommitTsRef = useRef(0);
|
|
301
|
+
const startTypewriter = useCallback(() => {
|
|
302
|
+
if (typeRAFRef.current !== null) return;
|
|
303
|
+
if (renderedLengthRef.current >= fullTextRef.current.length) return;
|
|
304
|
+
const animate = (timestamp) => {
|
|
305
|
+
if (lastTimestampRef.current === null) {
|
|
306
|
+
lastTimestampRef.current = timestamp;
|
|
307
|
+
}
|
|
308
|
+
const elapsedSeconds = (timestamp - lastTimestampRef.current) / 1e3;
|
|
309
|
+
lastTimestampRef.current = timestamp;
|
|
310
|
+
const charactersToAdd = Math.max(1, Math.floor(elapsedSeconds * speedRef.current));
|
|
311
|
+
const nextLength = Math.min(fullTextRef.current.length, renderedLengthRef.current + charactersToAdd);
|
|
312
|
+
renderedLengthRef.current = nextLength;
|
|
313
|
+
if (timestamp - lastCommitTsRef.current >= commitIntervalRef.current || nextLength === fullTextRef.current.length) {
|
|
314
|
+
const nextText = fullTextRef.current.slice(0, nextLength);
|
|
315
|
+
setDisplayedText(nextText);
|
|
316
|
+
lastCommitTsRef.current = timestamp;
|
|
317
|
+
}
|
|
318
|
+
if (nextLength < fullTextRef.current.length) {
|
|
319
|
+
typeRAFRef.current = requestAnimationFrame(animate);
|
|
320
|
+
} else {
|
|
321
|
+
typeRAFRef.current = null;
|
|
322
|
+
lastTimestampRef.current = null;
|
|
323
|
+
setIsFinished(true);
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
typeRAFRef.current = requestAnimationFrame(animate);
|
|
327
|
+
}, []);
|
|
328
|
+
const appendText = useCallback(
|
|
329
|
+
(text) => {
|
|
330
|
+
if (!text) return;
|
|
331
|
+
fullTextRef.current += text;
|
|
332
|
+
setIsFinished(false);
|
|
333
|
+
startTypewriter();
|
|
334
|
+
},
|
|
335
|
+
[startTypewriter]
|
|
336
|
+
);
|
|
337
|
+
const stopTypewriter = useCallback(() => {
|
|
338
|
+
if (typeRAFRef.current !== null) {
|
|
339
|
+
cancelAnimationFrame(typeRAFRef.current);
|
|
340
|
+
typeRAFRef.current = null;
|
|
341
|
+
lastTimestampRef.current = null;
|
|
342
|
+
}
|
|
343
|
+
}, []);
|
|
344
|
+
const finishTypewriter = useCallback(() => {
|
|
345
|
+
stopTypewriter();
|
|
346
|
+
setDisplayedText(fullTextRef.current);
|
|
347
|
+
renderedLengthRef.current = fullTextRef.current.length;
|
|
348
|
+
setIsFinished(true);
|
|
349
|
+
}, [stopTypewriter]);
|
|
350
|
+
return {
|
|
351
|
+
displayedText,
|
|
352
|
+
appendText,
|
|
353
|
+
stopTypewriter,
|
|
354
|
+
finishTypewriter,
|
|
355
|
+
isFinished
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
const useStreamingText = ({ eventSource, onTextChunk, onError, onDone }) => {
|
|
359
|
+
const bufferRef = useRef("");
|
|
360
|
+
const flushRAFRef = useRef(null);
|
|
361
|
+
const onTextChunkRef = useRef(null);
|
|
362
|
+
const onErrorRef = useRef(null);
|
|
363
|
+
const onDoneRef = useRef(null);
|
|
364
|
+
onTextChunkRef.current = onTextChunk;
|
|
365
|
+
onErrorRef.current = onError;
|
|
366
|
+
onDoneRef.current = onDone;
|
|
367
|
+
const flushBuffer = useCallback(() => {
|
|
368
|
+
flushRAFRef.current = null;
|
|
369
|
+
if (!bufferRef.current) return;
|
|
370
|
+
const chunk = bufferRef.current;
|
|
371
|
+
bufferRef.current = "";
|
|
372
|
+
onTextChunkRef.current?.(chunk);
|
|
373
|
+
}, []);
|
|
374
|
+
const finish = useCallback(() => {
|
|
375
|
+
if (flushRAFRef.current !== null) {
|
|
376
|
+
cancelAnimationFrame(flushRAFRef.current);
|
|
377
|
+
flushRAFRef.current = null;
|
|
378
|
+
}
|
|
379
|
+
flushBuffer();
|
|
380
|
+
onDoneRef.current?.();
|
|
381
|
+
}, [flushBuffer]);
|
|
382
|
+
const handleMessage = useCallback(
|
|
383
|
+
(event) => {
|
|
384
|
+
if (event.data === "[DONE]") {
|
|
385
|
+
finish();
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
try {
|
|
389
|
+
const parsed = JSON.parse(event.data);
|
|
390
|
+
const piece = parsed?.choices?.[0]?.delta?.content ?? // fallback: support simple formats too
|
|
391
|
+
(typeof parsed === "string" ? parsed : parsed?.text ?? "");
|
|
392
|
+
const finishReason = parsed?.choices?.[0]?.finish_reason;
|
|
393
|
+
if (piece) {
|
|
394
|
+
bufferRef.current += piece;
|
|
395
|
+
if (flushRAFRef.current === null) {
|
|
396
|
+
flushRAFRef.current = requestAnimationFrame(flushBuffer);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
if (finishReason === "stop") {
|
|
400
|
+
finish();
|
|
401
|
+
}
|
|
402
|
+
} catch (error) {
|
|
403
|
+
console.error("Error parsing SSE message:", error, event.data);
|
|
404
|
+
onErrorRef.current?.();
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
[flushBuffer, finish]
|
|
408
|
+
);
|
|
409
|
+
const handleError = useCallback(() => {
|
|
410
|
+
onErrorRef.current?.();
|
|
411
|
+
if (flushRAFRef.current !== null) {
|
|
412
|
+
cancelAnimationFrame(flushRAFRef.current);
|
|
413
|
+
flushRAFRef.current = null;
|
|
414
|
+
}
|
|
415
|
+
flushBuffer();
|
|
416
|
+
}, [flushBuffer]);
|
|
417
|
+
useEffect(() => {
|
|
418
|
+
if (typeof window === "undefined" || !eventSource) return;
|
|
419
|
+
eventSource.addEventListener("message", handleMessage);
|
|
420
|
+
eventSource.addEventListener("error", handleError);
|
|
421
|
+
return () => {
|
|
422
|
+
eventSource.removeEventListener("message", handleMessage);
|
|
423
|
+
eventSource.removeEventListener("error", handleError);
|
|
424
|
+
if (flushRAFRef.current !== null) {
|
|
425
|
+
cancelAnimationFrame(flushRAFRef.current);
|
|
426
|
+
flushRAFRef.current = null;
|
|
427
|
+
}
|
|
428
|
+
flushBuffer();
|
|
429
|
+
};
|
|
430
|
+
}, [eventSource, handleMessage, handleError, flushBuffer]);
|
|
431
|
+
};
|
|
432
|
+
const STAGGER_STEP_MS = 90;
|
|
433
|
+
const STAGGER_CAP_MS = 720;
|
|
434
|
+
const INITIAL_FADE_MS = 550;
|
|
435
|
+
const SCROLL_REVEAL_ROOT_MARGIN = "0px";
|
|
436
|
+
const VISIBILITY_DEADLINE_MS = 2500;
|
|
437
|
+
const alreadyRevealedMessageIds = /* @__PURE__ */ new Set();
|
|
438
|
+
const useFreshMessageBlockReveal = (options) => {
|
|
439
|
+
const { containerRef, enabled, messageId } = options;
|
|
440
|
+
const scrollRoot = useContext(WidgetWindowRootContext);
|
|
441
|
+
useLayoutEffect(() => {
|
|
442
|
+
if (!enabled) return;
|
|
443
|
+
if (messageId != null && alreadyRevealedMessageIds.has(messageId)) return;
|
|
444
|
+
if (typeof IntersectionObserver === "undefined") return;
|
|
445
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
446
|
+
if (scrollRoot == null) return;
|
|
447
|
+
const blocksRoot = containerRef.current?.querySelector(":scope > [data-markdown-blocks-root]");
|
|
448
|
+
if (blocksRoot == null) return;
|
|
449
|
+
const blocks = Array.from(blocksRoot.children);
|
|
450
|
+
if (blocks.length === 0) return;
|
|
451
|
+
for (const block of blocks) block.dataset.blockReveal = "hidden";
|
|
452
|
+
if (messageId != null) alreadyRevealedMessageIds.add(messageId);
|
|
453
|
+
let finalized = false;
|
|
454
|
+
let scrollRevealObserver = null;
|
|
455
|
+
let initialViewportObserver = null;
|
|
456
|
+
const finalize = () => {
|
|
457
|
+
if (finalized) return;
|
|
458
|
+
finalized = true;
|
|
459
|
+
initialViewportObserver?.disconnect();
|
|
460
|
+
scrollRevealObserver?.disconnect();
|
|
461
|
+
for (const block of blocks) {
|
|
462
|
+
if (block.dataset.blockReveal === "hidden") {
|
|
463
|
+
delete block.dataset.blockReveal;
|
|
464
|
+
block.style.animationDelay = "";
|
|
465
|
+
block.style.animationDuration = "";
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
const deadline = window.setTimeout(finalize, VISIBILITY_DEADLINE_MS);
|
|
470
|
+
scrollRevealObserver = new IntersectionObserver(
|
|
471
|
+
(entries, observer) => {
|
|
472
|
+
if (finalized) return;
|
|
473
|
+
for (const entry of entries) {
|
|
474
|
+
if (!entry.isIntersecting) continue;
|
|
475
|
+
entry.target.dataset.blockReveal = "revealed";
|
|
476
|
+
observer.unobserve(entry.target);
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
{ root: scrollRoot, rootMargin: SCROLL_REVEAL_ROOT_MARGIN, threshold: 0 }
|
|
480
|
+
);
|
|
481
|
+
initialViewportObserver = new IntersectionObserver(
|
|
482
|
+
(entries, observer) => {
|
|
483
|
+
if (finalized) return;
|
|
484
|
+
let staggerIndex = 0;
|
|
485
|
+
for (const entry of entries) {
|
|
486
|
+
const block = entry.target;
|
|
487
|
+
if (entry.isIntersecting) {
|
|
488
|
+
block.style.animationDelay = `${Math.min(staggerIndex * STAGGER_STEP_MS, STAGGER_CAP_MS)}ms`;
|
|
489
|
+
block.style.animationDuration = `${INITIAL_FADE_MS}ms`;
|
|
490
|
+
staggerIndex++;
|
|
491
|
+
block.dataset.blockReveal = "revealed";
|
|
492
|
+
} else {
|
|
493
|
+
scrollRevealObserver?.observe(block);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
observer.disconnect();
|
|
497
|
+
},
|
|
498
|
+
{ root: scrollRoot, threshold: 0 }
|
|
499
|
+
);
|
|
500
|
+
for (const block of blocks) initialViewportObserver.observe(block);
|
|
501
|
+
return () => {
|
|
502
|
+
window.clearTimeout(deadline);
|
|
503
|
+
finalize();
|
|
504
|
+
};
|
|
505
|
+
}, [enabled, messageId, scrollRoot, containerRef]);
|
|
506
|
+
};
|
|
507
|
+
const iconContainer = "agents_iconContainer_JupHNn";
|
|
508
|
+
const responseHeader = "agents_responseHeader_ulXYcn";
|
|
509
|
+
const styles$1 = {
|
|
510
|
+
iconContainer,
|
|
511
|
+
responseHeader
|
|
512
|
+
};
|
|
513
|
+
const ConversationMessageHeader = memo((props) => {
|
|
514
|
+
const { aiPromptExtensionCategory, aiPromptExtension } = props;
|
|
515
|
+
const iconName = aiPromptExtension?.iconClass ?? "ai";
|
|
516
|
+
return /* @__PURE__ */ jsxs("div", { className: styles$1.responseHeader, children: [
|
|
517
|
+
/* @__PURE__ */ jsx("span", { className: styles$1.iconContainer, children: /* @__PURE__ */ jsx(Icon, { color: "var(--agents-fg-on-accent)", hostIconName: iconName }) }),
|
|
518
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
519
|
+
/* @__PURE__ */ jsx(Text, { role: "help", weight: "bold", children: aiPromptExtension?.name ?? "AI Extensions" }),
|
|
520
|
+
aiPromptExtensionCategory !== void 0 ? /* @__PURE__ */ jsx(Text, { role: "caption", replacements: { productName: aiPromptExtensionCategory?.name }, children: "%productName% Assistant" }) : null,
|
|
521
|
+
aiPromptExtensionCategory === void 0 ? /* @__PURE__ */ jsx(Text, { role: "caption", children: "Assistant" }) : null
|
|
522
|
+
] })
|
|
523
|
+
] });
|
|
524
|
+
});
|
|
525
|
+
async function copyRichToClipboard(plainText, html) {
|
|
526
|
+
if (!plainText) {
|
|
527
|
+
console.warn("No text to copy");
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
if (!navigator.clipboard) {
|
|
531
|
+
console.warn("Clipboard API not available");
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
if (!(html && typeof ClipboardItem !== "undefined" && navigator.clipboard.write)) {
|
|
535
|
+
console.warn("Clipboard does not support rich text, copying plain text only");
|
|
536
|
+
return navigator.clipboard.writeText(plainText);
|
|
537
|
+
}
|
|
538
|
+
try {
|
|
539
|
+
const item = new ClipboardItem({
|
|
540
|
+
"text/plain": new Blob([plainText], { type: "text/plain" }),
|
|
541
|
+
"text/html": new Blob([html], { type: "text/html" })
|
|
542
|
+
});
|
|
543
|
+
return navigator.clipboard.write([item]);
|
|
544
|
+
} catch (error) {
|
|
545
|
+
console.error("Failed to copy rich text to clipboard:", error);
|
|
546
|
+
return navigator.clipboard.writeText(plainText);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
const ConversationMessageWidgets = memo((props) => {
|
|
550
|
+
const {
|
|
551
|
+
aiPromptExtensionCategory,
|
|
552
|
+
aiPromptExtension,
|
|
553
|
+
eventSource,
|
|
554
|
+
message: message2,
|
|
555
|
+
interactive = false,
|
|
556
|
+
justDelivered = false,
|
|
557
|
+
hideWidgets = false,
|
|
558
|
+
hideAssistantMeta = false,
|
|
559
|
+
enableFreshMessageBlockReveal = false,
|
|
560
|
+
messageId
|
|
561
|
+
} = props;
|
|
562
|
+
const { MessageFooter } = useAgentsEnvironment();
|
|
563
|
+
const [copied, setCopied] = useState(false);
|
|
564
|
+
const timeoutRef = useRef(null);
|
|
565
|
+
const renderedRef = useRef(null);
|
|
566
|
+
const { displayedText, appendText, finishTypewriter } = useTypewriter({
|
|
567
|
+
speed: 200,
|
|
568
|
+
commitIntervalMs: 100
|
|
569
|
+
});
|
|
570
|
+
useEffect(() => {
|
|
571
|
+
return () => {
|
|
572
|
+
if (timeoutRef.current != null) window.clearTimeout(timeoutRef.current);
|
|
573
|
+
};
|
|
574
|
+
}, []);
|
|
575
|
+
useStreamingText({
|
|
576
|
+
eventSource: message2 != null ? void 0 : eventSource,
|
|
577
|
+
onTextChunk: appendText,
|
|
578
|
+
onError: finishTypewriter,
|
|
579
|
+
onDone: finishTypewriter
|
|
580
|
+
});
|
|
581
|
+
const textToRender = message2 != null ? normalizeServerMessageToMarkdown(message2) : stripPreCallMessageMarker(displayedText);
|
|
582
|
+
useFreshMessageBlockReveal({
|
|
583
|
+
containerRef: renderedRef,
|
|
584
|
+
enabled: enableFreshMessageBlockReveal && justDelivered && message2 != null,
|
|
585
|
+
messageId
|
|
586
|
+
});
|
|
587
|
+
const onCopy = useCallback(async () => {
|
|
588
|
+
const fallbackText = textToRender || "";
|
|
589
|
+
const plain = renderedRef.current?.innerText?.trim() || fallbackText;
|
|
590
|
+
const html = renderedRef.current?.innerHTML || "";
|
|
591
|
+
await copyRichToClipboard(plain, html);
|
|
592
|
+
setCopied(true);
|
|
593
|
+
if (timeoutRef.current != null) window.clearTimeout(timeoutRef.current);
|
|
594
|
+
timeoutRef.current = window.setTimeout(() => setCopied(false), 2e3);
|
|
595
|
+
}, [textToRender]);
|
|
596
|
+
return /* @__PURE__ */ jsxs("div", { className: styles$2.responseContainer, children: [
|
|
597
|
+
!hideAssistantMeta ? /* @__PURE__ */ jsx(
|
|
598
|
+
ConversationMessageHeader,
|
|
599
|
+
{
|
|
600
|
+
aiPromptExtensionCategory,
|
|
601
|
+
aiPromptExtension
|
|
602
|
+
}
|
|
603
|
+
) : null,
|
|
604
|
+
/* @__PURE__ */ jsxs("div", { className: styles$2.responseMessage, children: [
|
|
605
|
+
/* @__PURE__ */ jsx("div", { ref: renderedRef, children: /* @__PURE__ */ jsx(
|
|
606
|
+
ConversationMarkdown,
|
|
607
|
+
{
|
|
608
|
+
markdown: textToRender,
|
|
609
|
+
interactive,
|
|
610
|
+
justDelivered,
|
|
611
|
+
messageId: messageId ?? void 0,
|
|
612
|
+
hideWidgets
|
|
613
|
+
}
|
|
614
|
+
) }),
|
|
615
|
+
!hideAssistantMeta ? /* @__PURE__ */ jsx(
|
|
616
|
+
Button,
|
|
617
|
+
{
|
|
618
|
+
variant: "muted",
|
|
619
|
+
icon: copied ? "check" : "duplicate",
|
|
620
|
+
onClick: onCopy,
|
|
621
|
+
size: "small"
|
|
622
|
+
}
|
|
623
|
+
) : null
|
|
624
|
+
] }),
|
|
625
|
+
MessageFooter ? /* @__PURE__ */ jsx(MessageFooter, { message: message2 }) : null
|
|
626
|
+
] });
|
|
627
|
+
});
|
|
628
|
+
const icon = "agents_icon_DD3OXD";
|
|
629
|
+
const styles = {
|
|
630
|
+
icon
|
|
631
|
+
};
|
|
632
|
+
const VoiceBarsIcon = (props) => {
|
|
633
|
+
const { size = 18 } = props;
|
|
634
|
+
return /* @__PURE__ */ jsx("svg", { className: styles.icon, width: size, height: size, viewBox: "0 0 24 24", "aria-hidden": true, focusable: "false", children: /* @__PURE__ */ jsx("path", { d: "M3.5 10.5v3M7.75 8v8M12 4.5v15M16.25 8v8M20.5 10.5v3" }) });
|
|
635
|
+
};
|
|
636
|
+
export {
|
|
637
|
+
ConversationMessageWidgets as C,
|
|
638
|
+
VoiceBarsIcon as V,
|
|
639
|
+
ConversationMessageUser as a,
|
|
640
|
+
ConversationMessageHeader as b,
|
|
641
|
+
normalizeServerMessageToMarkdown as n
|
|
642
|
+
};
|
|
643
|
+
//# sourceMappingURL=VoiceBarsIcon-BIcURsBF.js.map
|