@apteva/apteva-kit 0.1.38 → 0.1.40

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/index.mjs CHANGED
@@ -972,71 +972,71 @@ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
972
972
  function WidgetSkeleton({ type, className }) {
973
973
  switch (type) {
974
974
  case "card":
975
- return /* @__PURE__ */ jsx8("div", { className: cn("animate-pulse rounded-lg border border-gray-200 dark:border-gray-500 overflow-hidden", className), children: /* @__PURE__ */ jsxs5("div", { className: "p-4 space-y-3", children: [
976
- /* @__PURE__ */ jsx8("div", { className: "h-4 bg-gray-200 dark:bg-gray-500 rounded w-3/4" }),
977
- /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-500 rounded w-full" }),
978
- /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-500 rounded w-5/6" })
975
+ return /* @__PURE__ */ jsx8("div", { className: cn("animate-pulse rounded-lg border border-gray-200 dark:border-gray-600 overflow-hidden", className), children: /* @__PURE__ */ jsxs5("div", { className: "p-4 space-y-3", children: [
976
+ /* @__PURE__ */ jsx8("div", { className: "h-4 bg-gray-200 dark:bg-gray-600 rounded w-3/4" }),
977
+ /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-600 rounded w-full" }),
978
+ /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-600 rounded w-5/6" })
979
979
  ] }) });
980
980
  case "list":
981
- return /* @__PURE__ */ jsx8("div", { className: cn("animate-pulse space-y-2", className), children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-3 p-3 rounded-lg border border-gray-200 dark:border-gray-500", children: [
982
- /* @__PURE__ */ jsx8("div", { className: "w-10 h-10 bg-gray-200 dark:bg-gray-500 rounded-full flex-shrink-0" }),
981
+ return /* @__PURE__ */ jsx8("div", { className: cn("animate-pulse space-y-2", className), children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-3 p-3 rounded-lg border border-gray-200 dark:border-gray-600", children: [
982
+ /* @__PURE__ */ jsx8("div", { className: "w-10 h-10 bg-gray-200 dark:bg-gray-600 rounded-full flex-shrink-0" }),
983
983
  /* @__PURE__ */ jsxs5("div", { className: "flex-1 space-y-2", children: [
984
- /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-500 rounded w-1/2" }),
985
- /* @__PURE__ */ jsx8("div", { className: "h-2 bg-gray-200 dark:bg-gray-500 rounded w-3/4" })
984
+ /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-600 rounded w-1/2" }),
985
+ /* @__PURE__ */ jsx8("div", { className: "h-2 bg-gray-200 dark:bg-gray-600 rounded w-3/4" })
986
986
  ] })
987
987
  ] }, i)) });
988
988
  case "button_group":
989
989
  return /* @__PURE__ */ jsxs5("div", { className: cn("animate-pulse flex gap-2", className), children: [
990
- /* @__PURE__ */ jsx8("div", { className: "h-9 bg-gray-200 dark:bg-gray-500 rounded-lg w-20" }),
991
- /* @__PURE__ */ jsx8("div", { className: "h-9 bg-gray-200 dark:bg-gray-500 rounded-lg w-20" }),
992
- /* @__PURE__ */ jsx8("div", { className: "h-9 bg-gray-200 dark:bg-gray-500 rounded-lg w-20" })
990
+ /* @__PURE__ */ jsx8("div", { className: "h-9 bg-gray-200 dark:bg-gray-600 rounded-lg w-20" }),
991
+ /* @__PURE__ */ jsx8("div", { className: "h-9 bg-gray-200 dark:bg-gray-600 rounded-lg w-20" }),
992
+ /* @__PURE__ */ jsx8("div", { className: "h-9 bg-gray-200 dark:bg-gray-600 rounded-lg w-20" })
993
993
  ] });
994
994
  case "form":
995
- return /* @__PURE__ */ jsxs5("div", { className: cn("animate-pulse rounded-lg border border-gray-200 dark:border-gray-500 p-4 space-y-4", className), children: [
996
- /* @__PURE__ */ jsx8("div", { className: "h-4 bg-gray-200 dark:bg-gray-500 rounded w-1/3" }),
995
+ return /* @__PURE__ */ jsxs5("div", { className: cn("animate-pulse rounded-lg border border-gray-200 dark:border-gray-600 p-4 space-y-4", className), children: [
996
+ /* @__PURE__ */ jsx8("div", { className: "h-4 bg-gray-200 dark:bg-gray-600 rounded w-1/3" }),
997
997
  /* @__PURE__ */ jsxs5("div", { className: "space-y-3", children: [
998
- /* @__PURE__ */ jsx8("div", { className: "h-10 bg-gray-200 dark:bg-gray-500 rounded" }),
999
- /* @__PURE__ */ jsx8("div", { className: "h-10 bg-gray-200 dark:bg-gray-500 rounded" })
998
+ /* @__PURE__ */ jsx8("div", { className: "h-10 bg-gray-200 dark:bg-gray-600 rounded" }),
999
+ /* @__PURE__ */ jsx8("div", { className: "h-10 bg-gray-200 dark:bg-gray-600 rounded" })
1000
1000
  ] }),
1001
- /* @__PURE__ */ jsx8("div", { className: "h-9 bg-gray-200 dark:bg-gray-500 rounded w-24" })
1001
+ /* @__PURE__ */ jsx8("div", { className: "h-9 bg-gray-200 dark:bg-gray-600 rounded w-24" })
1002
1002
  ] });
1003
1003
  case "chart":
1004
- return /* @__PURE__ */ jsxs5("div", { className: cn("animate-pulse rounded-lg border border-gray-200 dark:border-gray-500 p-4", className), children: [
1005
- /* @__PURE__ */ jsx8("div", { className: "h-4 bg-gray-200 dark:bg-gray-500 rounded w-1/4 mb-4" }),
1004
+ return /* @__PURE__ */ jsxs5("div", { className: cn("animate-pulse rounded-lg border border-gray-200 dark:border-gray-600 p-4", className), children: [
1005
+ /* @__PURE__ */ jsx8("div", { className: "h-4 bg-gray-200 dark:bg-gray-600 rounded w-1/4 mb-4" }),
1006
1006
  /* @__PURE__ */ jsxs5("div", { className: "flex items-end gap-2 h-32", children: [
1007
- /* @__PURE__ */ jsx8("div", { className: "flex-1 bg-gray-200 dark:bg-gray-500 rounded-t h-1/2" }),
1008
- /* @__PURE__ */ jsx8("div", { className: "flex-1 bg-gray-200 dark:bg-gray-500 rounded-t h-3/4" }),
1009
- /* @__PURE__ */ jsx8("div", { className: "flex-1 bg-gray-200 dark:bg-gray-500 rounded-t h-1/3" }),
1010
- /* @__PURE__ */ jsx8("div", { className: "flex-1 bg-gray-200 dark:bg-gray-500 rounded-t h-full" }),
1011
- /* @__PURE__ */ jsx8("div", { className: "flex-1 bg-gray-200 dark:bg-gray-500 rounded-t h-2/3" })
1007
+ /* @__PURE__ */ jsx8("div", { className: "flex-1 bg-gray-200 dark:bg-gray-600 rounded-t h-1/2" }),
1008
+ /* @__PURE__ */ jsx8("div", { className: "flex-1 bg-gray-200 dark:bg-gray-600 rounded-t h-3/4" }),
1009
+ /* @__PURE__ */ jsx8("div", { className: "flex-1 bg-gray-200 dark:bg-gray-600 rounded-t h-1/3" }),
1010
+ /* @__PURE__ */ jsx8("div", { className: "flex-1 bg-gray-200 dark:bg-gray-600 rounded-t h-full" }),
1011
+ /* @__PURE__ */ jsx8("div", { className: "flex-1 bg-gray-200 dark:bg-gray-600 rounded-t h-2/3" })
1012
1012
  ] })
1013
1013
  ] });
1014
1014
  case "image":
1015
- return /* @__PURE__ */ jsx8("div", { className: cn("animate-pulse", className), children: /* @__PURE__ */ jsx8("div", { className: "aspect-video bg-gray-200 dark:bg-gray-500 rounded-lg" }) });
1015
+ return /* @__PURE__ */ jsx8("div", { className: cn("animate-pulse", className), children: /* @__PURE__ */ jsx8("div", { className: "aspect-video bg-gray-200 dark:bg-gray-600 rounded-lg" }) });
1016
1016
  case "gallery":
1017
- return /* @__PURE__ */ jsx8("div", { className: cn("animate-pulse grid grid-cols-3 gap-2", className), children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx8("div", { className: "aspect-square bg-gray-200 dark:bg-gray-500 rounded-lg" }, i)) });
1017
+ return /* @__PURE__ */ jsx8("div", { className: cn("animate-pulse grid grid-cols-3 gap-2", className), children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx8("div", { className: "aspect-square bg-gray-200 dark:bg-gray-600 rounded-lg" }, i)) });
1018
1018
  case "map":
1019
- return /* @__PURE__ */ jsx8("div", { className: cn("animate-pulse", className), children: /* @__PURE__ */ jsx8("div", { className: "h-48 bg-gray-200 dark:bg-gray-500 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsxs5("svg", { className: "w-8 h-8 text-gray-300 dark:text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: [
1019
+ return /* @__PURE__ */ jsx8("div", { className: cn("animate-pulse", className), children: /* @__PURE__ */ jsx8("div", { className: "h-48 bg-gray-200 dark:bg-gray-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsxs5("svg", { className: "w-8 h-8 text-gray-300 dark:text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: [
1020
1020
  /* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }),
1021
1021
  /* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
1022
1022
  ] }) }) });
1023
1023
  case "table":
1024
- return /* @__PURE__ */ jsxs5("div", { className: cn("animate-pulse rounded-lg border border-gray-200 dark:border-gray-500 overflow-hidden", className), children: [
1025
- /* @__PURE__ */ jsxs5("div", { className: "flex bg-gray-100 dark:bg-gray-600 border-b border-gray-200 dark:border-gray-500", children: [
1024
+ return /* @__PURE__ */ jsxs5("div", { className: cn("animate-pulse rounded-lg border border-gray-200 dark:border-gray-600 overflow-hidden", className), children: [
1025
+ /* @__PURE__ */ jsxs5("div", { className: "flex bg-gray-100 dark:bg-gray-600 border-b border-gray-200 dark:border-gray-600", children: [
1026
1026
  /* @__PURE__ */ jsx8("div", { className: "flex-1 px-4 py-3", children: /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-300 dark:bg-gray-400 rounded w-16" }) }),
1027
1027
  /* @__PURE__ */ jsx8("div", { className: "flex-1 px-4 py-3", children: /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-300 dark:bg-gray-400 rounded w-20" }) }),
1028
1028
  /* @__PURE__ */ jsx8("div", { className: "flex-1 px-4 py-3", children: /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-300 dark:bg-gray-400 rounded w-14" }) })
1029
1029
  ] }),
1030
- [1, 2, 3].map((i) => /* @__PURE__ */ jsxs5("div", { className: "flex border-b border-gray-200 dark:border-gray-500 last:border-b-0", children: [
1031
- /* @__PURE__ */ jsx8("div", { className: "flex-1 px-4 py-3", children: /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-500 rounded w-24" }) }),
1032
- /* @__PURE__ */ jsx8("div", { className: "flex-1 px-4 py-3", children: /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-500 rounded w-16" }) }),
1033
- /* @__PURE__ */ jsx8("div", { className: "flex-1 px-4 py-3", children: /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-500 rounded w-20" }) })
1030
+ [1, 2, 3].map((i) => /* @__PURE__ */ jsxs5("div", { className: "flex border-b border-gray-200 dark:border-gray-600 last:border-b-0", children: [
1031
+ /* @__PURE__ */ jsx8("div", { className: "flex-1 px-4 py-3", children: /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-600 rounded w-24" }) }),
1032
+ /* @__PURE__ */ jsx8("div", { className: "flex-1 px-4 py-3", children: /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-600 rounded w-16" }) }),
1033
+ /* @__PURE__ */ jsx8("div", { className: "flex-1 px-4 py-3", children: /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-600 rounded w-20" }) })
1034
1034
  ] }, i))
1035
1035
  ] });
1036
1036
  default:
1037
- return /* @__PURE__ */ jsxs5("div", { className: cn("animate-pulse rounded-lg border border-gray-200 dark:border-gray-500 p-4", className), children: [
1038
- /* @__PURE__ */ jsx8("div", { className: "h-4 bg-gray-200 dark:bg-gray-500 rounded w-1/2 mb-2" }),
1039
- /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-500 rounded w-full" })
1037
+ return /* @__PURE__ */ jsxs5("div", { className: cn("animate-pulse rounded-lg border border-gray-200 dark:border-gray-600 p-4", className), children: [
1038
+ /* @__PURE__ */ jsx8("div", { className: "h-4 bg-gray-200 dark:bg-gray-600 rounded w-1/2 mb-2" }),
1039
+ /* @__PURE__ */ jsx8("div", { className: "h-3 bg-gray-200 dark:bg-gray-600 rounded w-full" })
1040
1040
  ] });
1041
1041
  }
1042
1042
  }
@@ -1251,7 +1251,7 @@ function ToolCall({ name, status }) {
1251
1251
  }
1252
1252
 
1253
1253
  // src/components/Chat/Message.tsx
1254
- import { Fragment, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
1254
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
1255
1255
  function Message({ message, onAction, enableWidgets, onWidgetRender }) {
1256
1256
  const isUser = message.role === "user";
1257
1257
  const contentSegments = message.metadata?.content_segments;
@@ -1290,21 +1290,50 @@ function Message({ message, onAction, enableWidgets, onWidgetRender }) {
1290
1290
  return /* @__PURE__ */ jsx11(MarkdownContent, { content: text });
1291
1291
  }
1292
1292
  const parsed = parseWidgetsFromText(text);
1293
- if (parsed.segments.length === 0) {
1293
+ const cleanedText = parsed.segments.filter((seg) => seg.type === "text" && seg.content).map((seg) => seg.content).join("");
1294
+ if (!cleanedText.trim()) {
1294
1295
  return null;
1295
1296
  }
1296
- return /* @__PURE__ */ jsx11(Fragment, { children: parsed.segments.map((segment, index) => {
1297
+ return /* @__PURE__ */ jsx11(MarkdownContent, { content: cleanedText });
1298
+ };
1299
+ const renderContentWithWidgets = () => {
1300
+ if (!enableWidgets || isUser || !message.content) {
1301
+ return null;
1302
+ }
1303
+ const parsed = parseWidgetsFromText(message.content);
1304
+ const elements = [];
1305
+ let textBuffer = "";
1306
+ parsed.segments.forEach((segment, index) => {
1297
1307
  if (segment.type === "text" && segment.content) {
1298
- return /* @__PURE__ */ jsx11(MarkdownContent, { content: segment.content }, `text-${index}`);
1299
- }
1300
- if (segment.type === "widget" && segment.widget) {
1301
- return /* @__PURE__ */ jsx11("div", { className: "my-3", children: /* @__PURE__ */ jsx11(WidgetRenderer, { widget: segment.widget, onAction }) }, `widget-${index}`);
1302
- }
1303
- if (segment.type === "widget_pending" && segment.pendingType) {
1304
- return /* @__PURE__ */ jsx11("div", { className: "my-3", children: /* @__PURE__ */ jsx11(WidgetSkeleton, { type: segment.pendingType }) }, `pending-${index}`);
1308
+ textBuffer += segment.content;
1309
+ } else if (segment.type === "widget" && segment.widget) {
1310
+ if (textBuffer.trim()) {
1311
+ elements.push(
1312
+ /* @__PURE__ */ jsx11("div", { className: "apteva-message-bubble apteva-message-assistant", children: /* @__PURE__ */ jsx11("div", { className: "apteva-message-content-assistant", children: /* @__PURE__ */ jsx11(MarkdownContent, { content: textBuffer }) }) }, `text-${index}`)
1313
+ );
1314
+ textBuffer = "";
1315
+ }
1316
+ elements.push(
1317
+ /* @__PURE__ */ jsx11("div", { className: "apteva-widget-standalone", children: /* @__PURE__ */ jsx11(WidgetRenderer, { widget: segment.widget, onAction }) }, `widget-${index}`)
1318
+ );
1319
+ } else if (segment.type === "widget_pending" && segment.pendingType) {
1320
+ if (textBuffer.trim()) {
1321
+ elements.push(
1322
+ /* @__PURE__ */ jsx11("div", { className: "apteva-message-bubble apteva-message-assistant", children: /* @__PURE__ */ jsx11("div", { className: "apteva-message-content-assistant", children: /* @__PURE__ */ jsx11(MarkdownContent, { content: textBuffer }) }) }, `text-${index}`)
1323
+ );
1324
+ textBuffer = "";
1325
+ }
1326
+ elements.push(
1327
+ /* @__PURE__ */ jsx11("div", { className: "apteva-widget-standalone", children: /* @__PURE__ */ jsx11(WidgetSkeleton, { type: segment.pendingType }) }, `pending-${index}`)
1328
+ );
1305
1329
  }
1306
- return null;
1307
- }) });
1330
+ });
1331
+ if (textBuffer.trim()) {
1332
+ elements.push(
1333
+ /* @__PURE__ */ jsx11("div", { className: "apteva-message-bubble apteva-message-assistant", children: /* @__PURE__ */ jsx11("div", { className: "apteva-message-content-assistant", children: /* @__PURE__ */ jsx11(MarkdownContent, { content: textBuffer }) }) }, "text-final")
1334
+ );
1335
+ }
1336
+ return elements.length > 0 ? elements : null;
1308
1337
  };
1309
1338
  const renderContent = () => {
1310
1339
  if (isUser) {
@@ -1356,7 +1385,15 @@ function Message({ message, onAction, enableWidgets, onWidgetRender }) {
1356
1385
  if (!isUser && contentSegments && contentSegments.length > 0) {
1357
1386
  return /* @__PURE__ */ jsxs8("div", { className: "apteva-message-segmented", children: [
1358
1387
  renderSegmentedContent(),
1359
- message.widgets && message.widgets.length > 0 && /* @__PURE__ */ jsx11("div", { className: "apteva-message-widgets", children: /* @__PURE__ */ jsx11(Widgets, { widgets: message.widgets, onAction, layout: "stack" }) }),
1388
+ message.widgets && message.widgets.length > 0 && /* @__PURE__ */ jsx11("div", { className: "apteva-widget-standalone", children: /* @__PURE__ */ jsx11(Widgets, { widgets: message.widgets, onAction, layout: "stack" }) }),
1389
+ /* @__PURE__ */ jsx11("div", { className: "apteva-message-timestamp apteva-message-timestamp-assistant", suppressHydrationWarning: true, children: message.timestamp.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) })
1390
+ ] });
1391
+ }
1392
+ const widgetContent = renderContentWithWidgets();
1393
+ if (!isUser && enableWidgets && widgetContent) {
1394
+ return /* @__PURE__ */ jsxs8("div", { className: "apteva-message-segmented", children: [
1395
+ widgetContent,
1396
+ message.widgets && message.widgets.length > 0 && /* @__PURE__ */ jsx11("div", { className: "apteva-widget-standalone", children: /* @__PURE__ */ jsx11(Widgets, { widgets: message.widgets, onAction, layout: "stack" }) }),
1360
1397
  /* @__PURE__ */ jsx11("div", { className: "apteva-message-timestamp apteva-message-timestamp-assistant", suppressHydrationWarning: true, children: message.timestamp.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) })
1361
1398
  ] });
1362
1399
  }
@@ -1369,7 +1406,7 @@ function Message({ message, onAction, enableWidgets, onWidgetRender }) {
1369
1406
  ),
1370
1407
  children: [
1371
1408
  /* @__PURE__ */ jsx11("div", { className: isUser ? "apteva-message-content-user" : "apteva-message-content-assistant", children: renderContent() }),
1372
- message.widgets && message.widgets.length > 0 && /* @__PURE__ */ jsx11("div", { className: "apteva-message-widgets", children: /* @__PURE__ */ jsx11(Widgets, { widgets: message.widgets, onAction, layout: "stack" }) }),
1409
+ message.widgets && message.widgets.length > 0 && /* @__PURE__ */ jsx11("div", { className: "apteva-widget-standalone", children: /* @__PURE__ */ jsx11(Widgets, { widgets: message.widgets, onAction, layout: "stack" }) }),
1373
1410
  /* @__PURE__ */ jsx11("div", { className: cn("apteva-message-timestamp", isUser ? "apteva-message-timestamp-user" : "apteva-message-timestamp-assistant"), suppressHydrationWarning: true, children: message.timestamp.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) })
1374
1411
  ]
1375
1412
  }
@@ -1553,7 +1590,7 @@ function MessageList({
1553
1590
 
1554
1591
  // src/components/Chat/Composer.tsx
1555
1592
  import { useState, useRef as useRef3 } from "react";
1556
- import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
1593
+ import { Fragment, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
1557
1594
  function Composer({ onSendMessage, placeholder = "Type a message...", disabled = false, isLoading = false, onStop, onFileUpload, onSwitchMode }) {
1558
1595
  const [text, setText] = useState("");
1559
1596
  const [showMenu, setShowMenu] = useState(false);
@@ -1674,7 +1711,7 @@ function Composer({ onSendMessage, placeholder = "Type a message...", disabled =
1674
1711
  children: /* @__PURE__ */ jsx14("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx14("path", { d: "M10 5v10M5 10h10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
1675
1712
  }
1676
1713
  ),
1677
- showMenu && /* @__PURE__ */ jsxs10(Fragment2, { children: [
1714
+ showMenu && /* @__PURE__ */ jsxs10(Fragment, { children: [
1678
1715
  /* @__PURE__ */ jsx14("div", { className: "fixed inset-0 z-[9998]", onClick: () => setShowMenu(false) }),
1679
1716
  /* @__PURE__ */ jsxs10(
1680
1717
  "div",
@@ -1767,7 +1804,7 @@ function Composer({ onSendMessage, placeholder = "Type a message...", disabled =
1767
1804
 
1768
1805
  // src/components/Chat/CommandComposer.tsx
1769
1806
  import { useState as useState2, useRef as useRef4 } from "react";
1770
- import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
1807
+ import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
1771
1808
  function CommandComposer({
1772
1809
  onExecute,
1773
1810
  state,
@@ -1916,7 +1953,7 @@ function CommandComposer({
1916
1953
  children: /* @__PURE__ */ jsx15("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx15("path", { d: "M10 5v10M5 10h10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
1917
1954
  }
1918
1955
  ),
1919
- showMenu && /* @__PURE__ */ jsxs11(Fragment3, { children: [
1956
+ showMenu && /* @__PURE__ */ jsxs11(Fragment2, { children: [
1920
1957
  /* @__PURE__ */ jsx15("div", { className: "fixed inset-0 z-[9998]", onClick: () => setShowMenu(false) }),
1921
1958
  /* @__PURE__ */ jsxs11(
1922
1959
  "div",
@@ -2012,7 +2049,7 @@ function CommandComposer({
2012
2049
  state === "error" && "!text-red-600 dark:!text-red-400",
2013
2050
  state === "plan-pending" && "!text-amber-700 dark:!text-amber-300"
2014
2051
  ),
2015
- children: isToolCall ? /* @__PURE__ */ jsxs11(Fragment3, { children: [
2052
+ children: isToolCall ? /* @__PURE__ */ jsxs11(Fragment2, { children: [
2016
2053
  /* @__PURE__ */ jsx15("span", { className: "font-mono", children: displayContent }),
2017
2054
  /* @__PURE__ */ jsx15("span", { className: "text-gray-400 dark:text-gray-500", children: "Running..." })
2018
2055
  ] }) : displayContent
@@ -2035,7 +2072,7 @@ function CommandComposer({
2035
2072
  children: "Modify"
2036
2073
  }
2037
2074
  )
2038
- ] }) : /* @__PURE__ */ jsxs11(Fragment3, { children: [
2075
+ ] }) : /* @__PURE__ */ jsxs11(Fragment2, { children: [
2039
2076
  state === "loading" && onStop && /* @__PURE__ */ jsx15(
2040
2077
  "button",
2041
2078
  {
@@ -2273,7 +2310,7 @@ var AptevaClient = class {
2273
2310
  var aptevaClient = new AptevaClient();
2274
2311
 
2275
2312
  // src/components/Chat/Chat.tsx
2276
- import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
2313
+ import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
2277
2314
  var Chat = forwardRef(function Chat2({
2278
2315
  agentId,
2279
2316
  threadId,
@@ -2832,7 +2869,7 @@ ${planToExecute}`;
2832
2869
  isLoading ? chatToolName ? "apteva-chat-status-tool" : "apteva-chat-status-thinking" : "apteva-chat-status-ready"
2833
2870
  ), children: isLoading ? chatToolName ? `Using ${chatToolName}...` : "Thinking..." : "Ready" })
2834
2871
  ] }) }),
2835
- mode === "chat" && /* @__PURE__ */ jsxs12(Fragment4, { children: [
2872
+ mode === "chat" && /* @__PURE__ */ jsxs12(Fragment3, { children: [
2836
2873
  /* @__PURE__ */ jsx16(
2837
2874
  MessageList,
2838
2875
  {
@@ -2905,7 +2942,7 @@ import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
2905
2942
 
2906
2943
  // src/components/Command/Command.tsx
2907
2944
  import React, { useState as useState5, useEffect as useEffect5 } from "react";
2908
- import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
2945
+ import { Fragment as Fragment4, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
2909
2946
  function Command({
2910
2947
  agentId,
2911
2948
  command: initialCommand,
@@ -3371,7 +3408,7 @@ ${planToExecute}`;
3371
3408
  style: { minHeight: isCompact ? "auto" : "180px" },
3372
3409
  children: [
3373
3410
  /* @__PURE__ */ jsxs14("div", { className: cn("flex-1 flex", isCompact ? "flex-row items-center p-3 gap-3" : "flex-col p-4"), children: [
3374
- state === "idle" && allowInput && !isCompact && /* @__PURE__ */ jsxs14(Fragment5, { children: [
3411
+ state === "idle" && allowInput && !isCompact && /* @__PURE__ */ jsxs14(Fragment4, { children: [
3375
3412
  /* @__PURE__ */ jsx18(
3376
3413
  "textarea",
3377
3414
  {
@@ -3411,7 +3448,7 @@ ${planToExecute}`;
3411
3448
  )
3412
3449
  ] }, index)) })
3413
3450
  ] }),
3414
- state === "idle" && allowInput && isCompact && /* @__PURE__ */ jsxs14(Fragment5, { children: [
3451
+ state === "idle" && allowInput && isCompact && /* @__PURE__ */ jsxs14(Fragment4, { children: [
3415
3452
  /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-0.5 flex-shrink-0", children: [
3416
3453
  enableFileUpload && /* @__PURE__ */ jsx18(
3417
3454
  "button",
@@ -3551,7 +3588,7 @@ ${planToExecute}`;
3551
3588
  ] })
3552
3589
  ] })
3553
3590
  ] }),
3554
- state === "loading" && isCompact && /* @__PURE__ */ jsxs14(Fragment5, { children: [
3591
+ state === "loading" && isCompact && /* @__PURE__ */ jsxs14(Fragment4, { children: [
3555
3592
  /* @__PURE__ */ jsxs14("div", { className: "flex-1 flex items-center gap-3 py-1", children: [
3556
3593
  /* @__PURE__ */ jsx18("div", { className: "w-4 h-4 border-2 border-gray-300 border-t-blue-500 rounded-full animate-spin" }),
3557
3594
  /* @__PURE__ */ jsx18("div", { className: "text-gray-600 dark:text-gray-400 text-sm truncate", children: enableStreaming && streamedContent ? streamedContent : loadingText })
@@ -3599,7 +3636,7 @@ ${planToExecute}`;
3599
3636
  )
3600
3637
  ] })
3601
3638
  ] }) }),
3602
- state === "plan-pending" && isCompact && /* @__PURE__ */ jsxs14(Fragment5, { children: [
3639
+ state === "plan-pending" && isCompact && /* @__PURE__ */ jsxs14(Fragment4, { children: [
3603
3640
  /* @__PURE__ */ jsxs14(
3604
3641
  "button",
3605
3642
  {
@@ -3673,7 +3710,7 @@ ${planToExecute}`;
3673
3710
  widget.id
3674
3711
  )) })
3675
3712
  ] }) }),
3676
- state === "success" && result && isCompact && /* @__PURE__ */ jsxs14(Fragment5, { children: [
3713
+ state === "success" && result && isCompact && /* @__PURE__ */ jsxs14(Fragment4, { children: [
3677
3714
  /* @__PURE__ */ jsxs14(
3678
3715
  "div",
3679
3716
  {
@@ -3710,7 +3747,7 @@ ${planToExecute}`;
3710
3747
  ] })
3711
3748
  ] }),
3712
3749
  !isCompact && /* @__PURE__ */ jsxs14("div", { className: "p-3 flex items-center justify-between gap-2", children: [
3713
- /* @__PURE__ */ jsx18("div", { className: "flex items-center gap-1", children: state === "idle" && allowInput && /* @__PURE__ */ jsxs14(Fragment5, { children: [
3750
+ /* @__PURE__ */ jsx18("div", { className: "flex items-center gap-1", children: state === "idle" && allowInput && /* @__PURE__ */ jsxs14(Fragment4, { children: [
3714
3751
  enableFileUpload && /* @__PURE__ */ jsx18(
3715
3752
  "button",
3716
3753
  {