local-operator-ui 0.1.4 → 0.1.5

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.
@@ -1,4 +1,4 @@
1
- import { c as createStyled, r as resolveProps, u as useTheme, a as reactExports, b as clsx, d as useForkRef, j as jsxRuntimeExports, e as capitalize, f as composeClasses, g as createTheme, h as generateUtilityClass, i as generateUtilityClasses, k as useDefaultProps, s as styled$1, m as memoTheme, l as getDefaultExportFromCjs, n as requireReactDom, _ as _inheritsLoose, o as _objectWithoutPropertiesLoose$1, R as React, T as TransitionGroupContext, p as duration, q as useTheme$1, t as useTimeout, v as useId, B as ButtonBase, w as alpha, x as createSimplePaletteValueFilter, C as CircularProgress, P as Paper, y as darken, z as lighten, A as useEventCallback, D as setRef, E as useEnhancedEffect, F as useRtl, G as globalCss, H as formatMuiErrorMessage, I as rootShouldForwardProp, J as Typography, K as deepmerge, L as extendSxProp, M as resolveBreakpointValues, N as handleBreakpoints, O as getPath, Q as isFocusVisible, S as typographyClasses, U as slotShouldForwardProp, V as clamp, W as emphasize, X as Timeout, Y as React$1, Z as Box, $ as FontAwesomeIcon, a0 as faRobot, a1 as faSliders, a2 as Button, a3 as faExclamationTriangle, a4 as faCheck, a5 as faTimes, a6 as faEraser, a7 as faPen, a8 as faInfoCircle, a9 as faGear, aa as faServer, ab as faStar, ac as faTrash, ad as faCommentDots, ae as faCode, af as faHome, ag as faDownload, ah as faFileAlt, ai as faDesktop, aj as faImage, ak as faMusic, al as faVideo, am as faLaptop, an as faUsers, ao as faDatabase, ap as faBoxOpen, aq as faBook, ar as faHdd, as as faBox, at as faArchive, au as faNetworkWired, av as faFolder, aw as faFolderOpen, ax as faClock, ay as faChevronDown, az as faTools, aA as faArrowDown, aB as faPaperclip, aC as faStop, aD as faPaperPlane, aE as faQuestion, aF as faLightbulb, aG as faChevronRight, aH as faFile, aI as faUser, aJ as faEllipsisVertical, aK as faComment, aL as faChevronLeft, aM as faPlus, aN as faSearch, aO as faCommentSlash, aP as faArrowRight, aQ as faComments, aR as faTag, aS as faIdCard, aT as faCalendarAlt, aU as faCodeBranch, aV as faShieldAlt, aW as faArrowLeft, aX as requireReact, aY as LinearProgress, aZ as keyframes, a_ as faShield, a$ as faSignOut, b0 as faMagicWandSparkles, b1 as faBrain, b2 as faWandMagicSparkles, b3 as faExternalLinkAlt, b4 as faKey, b5 as faGlobe, b6 as faLock, b7 as faEdit, b8 as faSave, b9 as faEnvelope, ba as faCloudUploadAlt, bb as faHistory, bc as faListAlt, bd as library$1, be as icons$1, bf as CssBaseline, bg as ReactDOM$1, bh as ThemeProvider, bi as theme, bj as ErrorBoundary } from "./theme-DWJi6s4t.js";
1
+ import { c as createStyled, r as resolveProps, u as useTheme, a as reactExports, b as clsx, d as useForkRef, j as jsxRuntimeExports, e as capitalize, f as composeClasses, g as createTheme, h as generateUtilityClass, i as generateUtilityClasses, k as useDefaultProps, s as styled$1, m as memoTheme, l as getDefaultExportFromCjs, n as requireReactDom, _ as _inheritsLoose, o as _objectWithoutPropertiesLoose$1, R as React, T as TransitionGroupContext, p as duration, q as useTheme$1, t as useTimeout, v as useId, B as ButtonBase, w as alpha, x as createSimplePaletteValueFilter, C as CircularProgress, P as Paper, y as darken, z as lighten, A as useEventCallback, D as setRef, E as useEnhancedEffect, F as useRtl, G as globalCss, H as formatMuiErrorMessage, I as rootShouldForwardProp, J as Typography, K as deepmerge, L as extendSxProp, M as resolveBreakpointValues, N as handleBreakpoints, O as getPath, Q as isFocusVisible, S as typographyClasses, U as slotShouldForwardProp, V as clamp, W as emphasize, X as Timeout, Y as React$1, Z as Box, $ as FontAwesomeIcon, a0 as faRobot, a1 as faSliders, a2 as Button, a3 as faExclamationTriangle, a4 as faCheck, a5 as faTimes, a6 as faEraser, a7 as faPen, a8 as faInfoCircle, a9 as faGear, aa as faServer, ab as faStar, ac as faTrash, ad as faCommentDots, ae as faCode, af as faHome, ag as faDownload, ah as faFileAlt, ai as faDesktop, aj as faImage, ak as faMusic, al as faVideo, am as faLaptop, an as faUsers, ao as faDatabase, ap as faBoxOpen, aq as faBook, ar as faHdd, as as faBox, at as faArchive, au as faNetworkWired, av as faFolder, aw as faFolderOpen, ax as faClock, ay as faChevronDown, az as faTools, aA as faArrowDown, aB as faPaperclip, aC as faStop, aD as faPaperPlane, aE as keyframes, aF as faChevronUp, aG as faQuestion, aH as faLightbulb, aI as faChevronRight, aJ as faFile, aK as faUser, aL as faEllipsisVertical, aM as faComment, aN as faChevronLeft, aO as faPlus, aP as faSearch, aQ as faCommentSlash, aR as faArrowRight, aS as faComments, aT as faTag, aU as faIdCard, aV as faCalendarAlt, aW as faCodeBranch, aX as faShieldAlt, aY as faArrowLeft, aZ as requireReact, a_ as LinearProgress, a$ as faShield, b0 as faSignOut, b1 as faMagicWandSparkles, b2 as faBrain, b3 as faWandMagicSparkles, b4 as faExternalLinkAlt, b5 as faKey, b6 as faGlobe, b7 as faLock, b8 as faEdit, b9 as faSave, ba as faEnvelope, bb as faCloudUploadAlt, bc as faHistory, bd as faListAlt, be as library$1, bf as icons$1, bg as CssBaseline, bh as ReactDOM$1, bi as ThemeProvider, bj as theme, bk as ErrorBoundary } from "./theme-CHCNkogj.js";
2
2
  const styled = createStyled();
3
3
  function getThemeProps(params) {
4
4
  const {
@@ -25844,8 +25844,18 @@ const getImageUrl = (baseUrl, imagePath) => {
25844
25844
  const encodedPath = encodeURIComponent(normalizedPath);
25845
25845
  return `${normalizedBaseUrl}/v1/static/images?path=${encodedPath}`;
25846
25846
  };
25847
+ const getVideoUrl = (baseUrl, videoPath) => {
25848
+ const normalizedBaseUrl = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
25849
+ let normalizedPath = videoPath;
25850
+ if (normalizedPath.startsWith("file://")) {
25851
+ normalizedPath = normalizedPath.substring(7);
25852
+ }
25853
+ const encodedPath = encodeURIComponent(normalizedPath);
25854
+ return `${normalizedBaseUrl}/v1/static/videos?path=${encodedPath}`;
25855
+ };
25847
25856
  const StaticApi = {
25848
- getImageUrl
25857
+ getImageUrl,
25858
+ getVideoUrl
25849
25859
  };
25850
25860
  class LocalOperatorClient {
25851
25861
  baseUrl;
@@ -30738,8 +30748,15 @@ const useJobPolling = ({
30738
30748
  conversationId,
30739
30749
  addMessage
30740
30750
  }) => {
30741
- const [currentJobId, setCurrentJobId] = reactExports.useState(null);
30751
+ const [currentJobId, setCurrentJobIdInternal] = reactExports.useState(null);
30742
30752
  const [isLoading, setIsLoading] = reactExports.useState(false);
30753
+ const [currentExecution, setCurrentExecution] = reactExports.useState(null);
30754
+ const setCurrentJobId = reactExports.useCallback((jobId) => {
30755
+ setCurrentJobIdInternal(jobId);
30756
+ if (jobId === null) {
30757
+ setCurrentExecution(null);
30758
+ }
30759
+ }, []);
30743
30760
  const queryClient2 = useQueryClient();
30744
30761
  const { getMessages, setMessages } = useChatStore();
30745
30762
  const lastProcessedJobDataRef = reactExports.useRef(null);
@@ -30786,7 +30803,13 @@ const useJobPolling = ({
30786
30803
  return false;
30787
30804
  }
30788
30805
  },
30789
- [client.jobs, currentJobId, shouldEnableQuery, getConnectivityError]
30806
+ [
30807
+ client.jobs,
30808
+ currentJobId,
30809
+ shouldEnableQuery,
30810
+ getConnectivityError,
30811
+ setCurrentJobId
30812
+ ]
30790
30813
  );
30791
30814
  reactExports.useEffect(() => {
30792
30815
  if (conversationId !== previousConversationIdRef.current) {
@@ -30833,7 +30856,13 @@ const useJobPolling = ({
30833
30856
  }
30834
30857
  }
30835
30858
  previousConversationIdRef.current = conversationId;
30836
- }, [conversationId, client.jobs, shouldEnableQuery, getConnectivityError]);
30859
+ }, [
30860
+ conversationId,
30861
+ client.jobs,
30862
+ shouldEnableQuery,
30863
+ getConnectivityError,
30864
+ setCurrentJobId
30865
+ ]);
30837
30866
  const updateConversationMessages = reactExports.useCallback(
30838
30867
  async (agentId) => {
30839
30868
  if (!agentId) return;
@@ -30922,7 +30951,7 @@ const useJobPolling = ({
30922
30951
  setCurrentJobId(null);
30923
30952
  setIsLoading(false);
30924
30953
  },
30925
- [conversationId, addMessage, updateConversationMessages]
30954
+ [conversationId, addMessage, updateConversationMessages, setCurrentJobId]
30926
30955
  );
30927
30956
  const {
30928
30957
  data: jobData,
@@ -30956,6 +30985,9 @@ const useJobPolling = ({
30956
30985
  const jobDataSignature = `${jobData.id}-${jobData.status}-${dataUpdatedAt}`;
30957
30986
  if (jobDataSignature !== lastProcessedJobDataRef.current) {
30958
30987
  lastProcessedJobDataRef.current = jobDataSignature;
30988
+ if (jobData.current_execution) {
30989
+ setCurrentExecution(jobData.current_execution);
30990
+ }
30959
30991
  if (jobData.status === "processing") {
30960
30992
  const debounceTimeout = setTimeout(() => {
30961
30993
  updateConversationMessages(conversationId);
@@ -30964,6 +30996,7 @@ const useJobPolling = ({
30964
30996
  }
30965
30997
  if (jobData.status === "completed" || jobData.status === "failed") {
30966
30998
  handleJobCompletion(jobData);
30999
+ setCurrentExecution(null);
30967
31000
  }
30968
31001
  }
30969
31002
  return void 0;
@@ -30972,7 +31005,9 @@ const useJobPolling = ({
30972
31005
  dataUpdatedAt,
30973
31006
  handleJobCompletion,
30974
31007
  conversationId,
30975
- updateConversationMessages
31008
+ updateConversationMessages,
31009
+ setCurrentExecution,
31010
+ setCurrentJobId
30976
31011
  ]);
30977
31012
  reactExports.useEffect(() => {
30978
31013
  if (error) {
@@ -30988,7 +31023,8 @@ const useJobPolling = ({
30988
31023
  jobStatus: jobData?.status || null,
30989
31024
  isLoading,
30990
31025
  setIsLoading,
30991
- checkForActiveJobs
31026
+ checkForActiveJobs,
31027
+ currentExecution
30992
31028
  };
30993
31029
  };
30994
31030
  const useScrollToBottom = (dependencies = [], threshold = 300, buttonThreshold = 50) => {
@@ -31090,7 +31126,7 @@ const SidebarContainer$6 = styled$1(Box)({
31090
31126
  width: 280,
31091
31127
  height: "100%"
31092
31128
  });
31093
- const ContentContainer$3 = styled$1(Box)({
31129
+ const ContentContainer$4 = styled$1(Box)({
31094
31130
  flexGrow: 1,
31095
31131
  height: "100%",
31096
31132
  overflow: "hidden"
@@ -31101,7 +31137,7 @@ const StyledDivider = styled$1(Divider)({
31101
31137
  const ChatLayout = ({ sidebar, content: content2 }) => {
31102
31138
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$1, { children: [
31103
31139
  /* @__PURE__ */ jsxRuntimeExports.jsx(SidebarContainer$6, { children: sidebar }),
31104
- /* @__PURE__ */ jsxRuntimeExports.jsx(ContentContainer$3, { children: content2 })
31140
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ContentContainer$4, { children: content2 })
31105
31141
  ] });
31106
31142
  };
31107
31143
  const useAgentRouteParam = () => {
@@ -31528,6 +31564,9 @@ const useClearAgentConversation = () => {
31528
31564
  queryClient2.invalidateQueries({
31529
31565
  queryKey: ["agent", variables.agentId, "conversation"]
31530
31566
  });
31567
+ queryClient2.invalidateQueries({
31568
+ queryKey: ["conversation-messages", variables.agentId]
31569
+ });
31531
31570
  clearChatMessages(variables.agentId);
31532
31571
  clearMessageHistory(variables.agentId);
31533
31572
  y$1.success("Conversation cleared successfully");
@@ -42975,12 +43014,19 @@ const ModelSelect = ({
42975
43014
  }, [hostingId]);
42976
43015
  const { refreshModels } = useModels();
42977
43016
  const previousHostingIdRef = reactExports.useRef(null);
43017
+ const refreshTimeRef = reactExports.useRef(null);
42978
43018
  reactExports.useEffect(() => {
42979
43019
  if (hostingId && previousHostingIdRef.current !== hostingId) {
42980
43020
  previousHostingIdRef.current = hostingId;
42981
43021
  const timeoutId = setTimeout(() => {
42982
- refreshModels();
42983
- }, 0);
43022
+ const now = Date.now();
43023
+ const lastRefreshTime = refreshTimeRef.current;
43024
+ const THROTTLE_DURATION = 2e3;
43025
+ if (!lastRefreshTime || now - lastRefreshTime > THROTTLE_DURATION) {
43026
+ refreshModels();
43027
+ refreshTimeRef.current = now;
43028
+ }
43029
+ }, 100);
42984
43030
  return () => clearTimeout(timeoutId);
42985
43031
  }
42986
43032
  return void 0;
@@ -44500,366 +44546,6 @@ const MessageInput = ({
44500
44546
  )
44501
44547
  ] });
44502
44548
  };
44503
- const LoadingIndicator = ({ status, agentName = "Agent" }) => {
44504
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
44505
- Box,
44506
- {
44507
- sx: {
44508
- display: "flex",
44509
- alignItems: "center",
44510
- gap: 2
44511
- },
44512
- children: [
44513
- /* @__PURE__ */ jsxRuntimeExports.jsx(
44514
- Avatar,
44515
- {
44516
- sx: {
44517
- bgcolor: "rgba(56, 201, 106, 0.2)",
44518
- color: "primary.main"
44519
- },
44520
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faRobot, size: "sm" })
44521
- }
44522
- ),
44523
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
44524
- Box,
44525
- {
44526
- sx: {
44527
- bgcolor: "background.paper",
44528
- p: 2,
44529
- borderRadius: 2,
44530
- border: "1px solid rgba(255, 255, 255, 0.1)",
44531
- display: "flex",
44532
- alignItems: "center",
44533
- gap: 1
44534
- },
44535
- children: [
44536
- /* @__PURE__ */ jsxRuntimeExports.jsx(CircularProgress, { size: 16, color: "primary" }),
44537
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", children: status ? `${agentName} is ${getStatusText(status)}...` : `${agentName} is thinking...` })
44538
- ]
44539
- }
44540
- )
44541
- ]
44542
- }
44543
- );
44544
- };
44545
- const getStatusText = (status) => {
44546
- switch (status) {
44547
- case "pending":
44548
- return "waiting to start";
44549
- case "processing":
44550
- return "thinking";
44551
- case "completed":
44552
- return "finishing up";
44553
- case "failed":
44554
- return "having trouble";
44555
- case "cancelled":
44556
- return "was cancelled";
44557
- default:
44558
- return "thinking";
44559
- }
44560
- };
44561
- const HighlightContainer$1 = styled$1(Box, {
44562
- shouldForwardProp: (prop) => prop !== "action" && prop !== "isUser"
44563
- })(({ action }) => ({
44564
- position: "relative",
44565
- padding: "16px",
44566
- borderRadius: "8px",
44567
- marginBottom: "16px",
44568
- boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
44569
- width: "100%",
44570
- border: `1px solid ${action === "DONE" ? "rgba(76, 175, 80, 0.5)" : "rgba(33, 150, 243, 0.5)"}`,
44571
- backgroundColor: action === "DONE" ? "rgba(76, 175, 80, 0.1)" : "rgba(33, 150, 243, 0.1)",
44572
- transition: "all 0.2s ease",
44573
- "&:hover": {
44574
- boxShadow: "0 6px 16px rgba(0, 0, 0, 0.2)"
44575
- }
44576
- }));
44577
- const ActionBadge = styled$1(Box, {
44578
- shouldForwardProp: (prop) => prop !== "action"
44579
- })(({ theme: theme2, action }) => ({
44580
- position: "absolute",
44581
- top: "-10px",
44582
- right: "16px",
44583
- padding: "4px 8px",
44584
- borderRadius: "12px",
44585
- fontSize: "0.7rem",
44586
- fontWeight: "bold",
44587
- backgroundColor: action === "DONE" ? theme2.palette.success.main : theme2.palette.info.main,
44588
- color: "#fff",
44589
- display: "flex",
44590
- alignItems: "center",
44591
- gap: "4px",
44592
- boxShadow: "0 2px 4px rgba(0, 0, 0, 0.2)"
44593
- }));
44594
- const ActionHighlight = ({
44595
- children,
44596
- action,
44597
- isUser,
44598
- taskClassification,
44599
- executionType
44600
- }) => {
44601
- const shouldHighlight = (action === "DONE" || action === "ASK") && taskClassification !== "conversation" || executionType === "response" && taskClassification !== "conversation";
44602
- if (!shouldHighlight) {
44603
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children });
44604
- }
44605
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(HighlightContainer$1, { action, isUser, children: [
44606
- /* @__PURE__ */ jsxRuntimeExports.jsxs(ActionBadge, { action, children: [
44607
- /* @__PURE__ */ jsxRuntimeExports.jsx(
44608
- FontAwesomeIcon,
44609
- {
44610
- icon: action === "DONE" ? faCheck : faQuestion,
44611
- size: "xs"
44612
- }
44613
- ),
44614
- action === "DONE" ? "COMPLETE" : "QUESTION"
44615
- ] }),
44616
- children
44617
- ] });
44618
- };
44619
- const MarkdownContent = styled$1(Box, {
44620
- shouldForwardProp: (prop) => ![
44621
- "fontSize",
44622
- "lineHeight",
44623
- "paragraphSpacing",
44624
- "headingScale",
44625
- "codeSize"
44626
- ].includes(prop)
44627
- })(
44628
- ({
44629
- fontSize = "1.05rem",
44630
- lineHeight = 1.6,
44631
- paragraphSpacing = "8px",
44632
- headingScale = 1,
44633
- codeSize = "0.85em"
44634
- }) => ({
44635
- wordBreak: "break-word",
44636
- overflowWrap: "break-word",
44637
- lineHeight,
44638
- fontSize,
44639
- "& code": {
44640
- fontFamily: '"Roboto Mono", monospace',
44641
- backgroundColor: "rgba(0, 0, 0, 0.3)",
44642
- padding: "3px 6px",
44643
- borderRadius: "4px",
44644
- fontSize: codeSize,
44645
- whiteSpace: "pre-wrap",
44646
- wordBreak: "break-word",
44647
- color: "#e6e6e6"
44648
- },
44649
- "& pre": {
44650
- backgroundColor: "rgba(0, 0, 0, 0.3)",
44651
- padding: "16px",
44652
- borderRadius: "8px",
44653
- overflowX: "auto",
44654
- fontFamily: '"Roboto Mono", monospace',
44655
- fontSize: codeSize,
44656
- margin: "12px 0",
44657
- maxWidth: "100%",
44658
- border: "1px solid rgba(255, 255, 255, 0.1)"
44659
- },
44660
- "& pre code": {
44661
- whiteSpace: "pre-wrap",
44662
- wordBreak: "break-word",
44663
- backgroundColor: "transparent",
44664
- padding: 0,
44665
- borderRadius: 0
44666
- },
44667
- "& h1": {
44668
- fontSize: `calc(1.5rem * ${headingScale})`,
44669
- fontWeight: 600,
44670
- margin: "20px 0 12px 0",
44671
- borderBottom: "1px solid rgba(255, 255, 255, 0.1)",
44672
- paddingBottom: "8px"
44673
- },
44674
- "& h2": {
44675
- fontSize: `calc(1.3rem * ${headingScale})`,
44676
- fontWeight: 600,
44677
- margin: "18px 0 10px 0"
44678
- },
44679
- "& h3": {
44680
- fontSize: `calc(1.1rem * ${headingScale})`,
44681
- fontWeight: 600,
44682
- margin: "16px 0 8px 0"
44683
- },
44684
- "& ul": {
44685
- paddingLeft: "24px",
44686
- margin: "10px 0"
44687
- },
44688
- "& li": {
44689
- margin: "4px 0"
44690
- },
44691
- "& a": {
44692
- color: "#90caf9",
44693
- textDecoration: "none",
44694
- borderBottom: "1px dotted rgba(144, 202, 249, 0.5)",
44695
- transition: "all 0.2s ease",
44696
- "&:hover": {
44697
- textDecoration: "none",
44698
- borderBottom: "1px solid #90caf9",
44699
- color: "#bbdefb"
44700
- }
44701
- },
44702
- "& strong": {
44703
- fontWeight: 600,
44704
- color: "#e6e6e6"
44705
- },
44706
- "& em": {
44707
- fontStyle: "italic",
44708
- color: "#e0e0e0"
44709
- },
44710
- "& br": {
44711
- display: "block",
44712
- content: '""',
44713
- marginTop: "8px"
44714
- },
44715
- "& p:first-of-type": {
44716
- marginTop: "2px"
44717
- },
44718
- "& p": {
44719
- margin: `${paragraphSpacing} 0`
44720
- }
44721
- })
44722
- );
44723
- const convertUrlsToMarkdownLinks = (text2) => {
44724
- const urlRegex = /(?<!\]\()(https?:\/\/\S+?)([,.;:!?"'\)\]]+)?(?=\s|$)/g;
44725
- return text2.replace(
44726
- urlRegex,
44727
- (_match, url, punctuation) => `[${url}](${url})${punctuation || ""}`
44728
- );
44729
- };
44730
- const MarkdownRenderer = reactExports.memo(
44731
- ({ content: content2, styleProps }) => {
44732
- const processedContent = reactExports.useMemo(() => {
44733
- return convertUrlsToMarkdownLinks(content2.trim());
44734
- }, [content2]);
44735
- return /* @__PURE__ */ jsxRuntimeExports.jsx(MarkdownContent, { ...styleProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
44736
- Markdown,
44737
- {
44738
- components: {
44739
- a: ({ href, children }) => /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href, target: "_blank", rel: "noopener noreferrer", children })
44740
- },
44741
- children: processedContent
44742
- }
44743
- ) });
44744
- }
44745
- );
44746
- const BlockContainer = styled$1(Box)(() => ({
44747
- width: "95%",
44748
- cursor: "pointer",
44749
- transition: "all 0.2s ease",
44750
- marginLeft: 56,
44751
- "&:hover": {
44752
- opacity: 0.9
44753
- }
44754
- }));
44755
- const BlockHeader = styled$1(Box, {
44756
- shouldForwardProp: (prop) => prop !== "executionType" && prop !== "isUser"
44757
- })(
44758
- ({ theme: theme2, executionType }) => ({
44759
- display: "flex",
44760
- alignItems: "center",
44761
- padding: "8px 12px",
44762
- backgroundColor: "rgba(0, 0, 0, 0.2)",
44763
- borderLeft: `3px solid ${executionType === "plan" ? theme2.palette.grey[600] : theme2.palette.grey[600]}`
44764
- })
44765
- );
44766
- const BlockIcon = styled$1(Box)(({ theme: theme2 }) => ({
44767
- marginRight: 8,
44768
- display: "flex",
44769
- alignItems: "center",
44770
- justifyContent: "flex-start",
44771
- color: theme2.palette.grey[500]
44772
- }));
44773
- const BlockTitle = styled$1(Typography)(({ theme: theme2 }) => ({
44774
- fontWeight: 500,
44775
- fontSize: "0.85rem",
44776
- color: theme2.palette.grey[500]
44777
- }));
44778
- const BlockContent = styled$1(Typography)(({ theme: theme2 }) => ({
44779
- fontSize: "0.85rem",
44780
- color: theme2.palette.grey[400],
44781
- overflow: "hidden",
44782
- textOverflow: "ellipsis",
44783
- marginTop: 2
44784
- }));
44785
- const ExpandedContent = styled$1(Box)(({ theme: theme2 }) => ({
44786
- padding: "12px 16px",
44787
- backgroundColor: "rgba(0, 0, 0, 0.2)",
44788
- borderBottomLeftRadius: 4,
44789
- borderBottomRightRadius: 4,
44790
- fontSize: "0.85rem",
44791
- color: theme2.palette.grey[300],
44792
- borderLeft: `3px solid ${theme2.palette.grey[600]}`,
44793
- marginLeft: 0
44794
- }));
44795
- const BackgroundBlock = ({
44796
- content: content2,
44797
- action,
44798
- executionType,
44799
- isUser
44800
- }) => {
44801
- const [isExpanded, setIsExpanded] = reactExports.useState(false);
44802
- const toggleExpand = () => {
44803
- setIsExpanded(!isExpanded);
44804
- };
44805
- const getTitle = () => {
44806
- switch (action) {
44807
- case "DONE":
44808
- return "Task Complete";
44809
- case "ASK":
44810
- return "Asking a Question";
44811
- default:
44812
- return executionType === "plan" ? "Planning" : "Reflection";
44813
- }
44814
- };
44815
- const getIcon = () => {
44816
- switch (action) {
44817
- case "DONE":
44818
- return faCheck;
44819
- case "ASK":
44820
- return faQuestion;
44821
- default:
44822
- return executionType === "plan" ? faLightbulb : faCommentDots;
44823
- }
44824
- };
44825
- const getTruncatedContent = (content22, maxLength = 140) => {
44826
- return content22.length > maxLength ? `${content22.slice(0, maxLength)}...` : content22;
44827
- };
44828
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(BlockContainer, { onClick: toggleExpand, children: [
44829
- /* @__PURE__ */ jsxRuntimeExports.jsxs(BlockHeader, { executionType, isUser, children: [
44830
- /* @__PURE__ */ jsxRuntimeExports.jsx(BlockIcon, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: getIcon(), size: "sm" }) }),
44831
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { flexGrow: 1 }, children: [
44832
- /* @__PURE__ */ jsxRuntimeExports.jsx(BlockTitle, { variant: "subtitle2", children: getTitle() }),
44833
- !isExpanded && /* @__PURE__ */ jsxRuntimeExports.jsx(BlockContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
44834
- MarkdownRenderer,
44835
- {
44836
- content: getTruncatedContent(content2),
44837
- styleProps: {
44838
- fontSize: "0.85rem",
44839
- lineHeight: 1.5,
44840
- paragraphSpacing: "4px",
44841
- headingScale: 0.9,
44842
- codeSize: "0.85em"
44843
- }
44844
- }
44845
- ) })
44846
- ] })
44847
- ] }),
44848
- /* @__PURE__ */ jsxRuntimeExports.jsx(Collapse, { in: isExpanded, timeout: "auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandedContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
44849
- MarkdownRenderer,
44850
- {
44851
- content: content2,
44852
- styleProps: {
44853
- fontSize: "0.85rem",
44854
- lineHeight: 1.5,
44855
- paragraphSpacing: "4px",
44856
- headingScale: 0.9,
44857
- codeSize: "0.85em"
44858
- }
44859
- }
44860
- ) }) })
44861
- ] });
44862
- };
44863
44549
  function _objectWithoutPropertiesLoose(r, e) {
44864
44550
  if (null == r) return {};
44865
44551
  var t = {};
@@ -82181,6 +81867,574 @@ function ft(n2) {
82181
81867
  }
82182
81868
  return React.memo(l2);
82183
81869
  }
81870
+ const SyntaxHighlighterStyles$1 = ft`
81871
+ .loading-syntax-highlighter * {
81872
+ font-family: 'Roboto Mono', monospace !important;
81873
+ }
81874
+ `;
81875
+ const dotAnimation = keyframes`
81876
+ 0%, 100% { opacity: 0.3; }
81877
+ 50% { opacity: 1; }
81878
+ `;
81879
+ const textStrobeAnimation = keyframes`
81880
+ 0% { opacity: 0.6; }
81881
+ 50% { opacity: 1; }
81882
+ 100% { opacity: 0.6; }
81883
+ `;
81884
+ const LoadingContainer$5 = styled$1(Box)(() => ({
81885
+ display: "flex",
81886
+ alignItems: "center",
81887
+ gap: 0
81888
+ }));
81889
+ const AgentAvatar$2 = styled$1(Avatar)(({ theme: theme2 }) => ({
81890
+ backgroundColor: "rgba(56, 201, 106, 0.2)",
81891
+ color: theme2.palette.primary.main
81892
+ }));
81893
+ const ContentContainer$3 = styled$1(Box)(() => ({
81894
+ display: "flex",
81895
+ flexDirection: "column",
81896
+ gap: 8,
81897
+ maxWidth: "calc(100% - 60px)"
81898
+ }));
81899
+ const StatusContainer = styled$1(Box)(() => ({
81900
+ display: "flex",
81901
+ alignItems: "center",
81902
+ gap: 8
81903
+ }));
81904
+ const StatusText = styled$1(Typography)(({ theme: theme2 }) => ({
81905
+ color: theme2.palette.text.secondary,
81906
+ display: "flex",
81907
+ marginLeft: 16,
81908
+ position: "relative",
81909
+ animation: `${textStrobeAnimation} 3s ease-in-out infinite`
81910
+ }));
81911
+ const StatusTextContent = styled$1("span")(() => ({
81912
+ wordBreak: "break-word",
81913
+ display: "inline"
81914
+ }));
81915
+ const StatusControls = styled$1("span")(() => ({
81916
+ display: "inline-flex",
81917
+ alignItems: "center",
81918
+ marginLeft: 4,
81919
+ whiteSpace: "nowrap"
81920
+ }));
81921
+ const DotContainer = styled$1("span")(() => ({
81922
+ display: "inline-flex",
81923
+ alignItems: "center",
81924
+ position: "relative",
81925
+ zIndex: 2,
81926
+ marginLeft: 4
81927
+ }));
81928
+ const Dot = styled$1("span")(({ theme: theme2, delay }) => ({
81929
+ width: 4,
81930
+ height: 4,
81931
+ borderRadius: "50%",
81932
+ backgroundColor: theme2.palette.text.secondary,
81933
+ margin: "0 1px",
81934
+ animation: `${dotAnimation} 1.4s infinite ease-in-out`,
81935
+ animationDelay: `${delay}s`
81936
+ }));
81937
+ const CodeToggleButton = styled$1(Button)(({ theme: theme2 }) => ({
81938
+ color: theme2.palette.text.secondary,
81939
+ padding: "0 4px",
81940
+ minWidth: "auto",
81941
+ textTransform: "none",
81942
+ marginLeft: 8,
81943
+ height: "auto",
81944
+ fontSize: "0.75rem",
81945
+ lineHeight: 1,
81946
+ opacity: 0.7,
81947
+ borderRadius: "12px",
81948
+ transition: "all 0.2s ease",
81949
+ position: "relative",
81950
+ zIndex: 2,
81951
+ "&:hover": {
81952
+ backgroundColor: "transparent",
81953
+ opacity: 1,
81954
+ color: theme2.palette.primary.light
81955
+ },
81956
+ "& .MuiButton-startIcon": {
81957
+ marginRight: 2,
81958
+ marginLeft: 0
81959
+ }
81960
+ }));
81961
+ const CodeContainer$4 = styled$1(Box)(() => ({
81962
+ maxWidth: "100%",
81963
+ marginLeft: 16,
81964
+ marginTop: 8
81965
+ }));
81966
+ const LoadingCodeBlock = ({ code: code2 }) => {
81967
+ if (!code2) return null;
81968
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
81969
+ Box,
81970
+ {
81971
+ sx: {
81972
+ width: "100%",
81973
+ maxHeight: "300px",
81974
+ overflow: "auto",
81975
+ "&::-webkit-scrollbar": {
81976
+ width: "6px",
81977
+ height: "6px"
81978
+ },
81979
+ "&::-webkit-scrollbar-thumb": {
81980
+ backgroundColor: "rgba(255, 255, 255, 0.1)",
81981
+ borderRadius: "3px"
81982
+ },
81983
+ "&::-webkit-scrollbar-corner": {
81984
+ backgroundColor: "rgba(0, 0, 0, 0.3)"
81985
+ },
81986
+ borderRadius: "8px"
81987
+ },
81988
+ children: [
81989
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SyntaxHighlighterStyles$1, {}),
81990
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
81991
+ highlighter,
81992
+ {
81993
+ language: "python",
81994
+ style: atomOneDark,
81995
+ customStyle: {
81996
+ fontSize: "0.85rem",
81997
+ width: "100%",
81998
+ boxShadow: "0 2px 6px rgba(0, 0, 0, 0.2)",
81999
+ padding: "0.75rem",
82000
+ margin: 0
82001
+ // Remove margin to make it more compact
82002
+ },
82003
+ codeTagProps: {
82004
+ style: {
82005
+ fontFamily: '"Roboto Mono", monospace !important'
82006
+ }
82007
+ },
82008
+ className: "loading-syntax-highlighter",
82009
+ wrapLines: true,
82010
+ wrapLongLines: true,
82011
+ children: code2
82012
+ }
82013
+ )
82014
+ ]
82015
+ }
82016
+ );
82017
+ };
82018
+ const getStatusText = (status) => {
82019
+ switch (status) {
82020
+ case "pending":
82021
+ return "Waiting to start";
82022
+ case "processing":
82023
+ return "Thinking";
82024
+ case "completed":
82025
+ return "Finishing up";
82026
+ case "failed":
82027
+ return "Had trouble";
82028
+ case "cancelled":
82029
+ return "Had to stop";
82030
+ default:
82031
+ return "Thinking";
82032
+ }
82033
+ };
82034
+ const getDetailedStatusText = (status, execution) => {
82035
+ if (execution.action) {
82036
+ switch (execution.action) {
82037
+ case "CODE":
82038
+ return "Executing code";
82039
+ case "WRITE":
82040
+ return "Writing content";
82041
+ case "EDIT":
82042
+ return "Editing content";
82043
+ case "READ":
82044
+ return "Reading content";
82045
+ case "ASK":
82046
+ return "Formulating a question";
82047
+ case "DONE":
82048
+ return "Completing the task";
82049
+ case "BYE":
82050
+ return "Ending the conversation";
82051
+ }
82052
+ }
82053
+ if (execution.execution_type) {
82054
+ switch (execution.execution_type) {
82055
+ case "plan":
82056
+ return "Planning my approach";
82057
+ case "action":
82058
+ return "Thinking";
82059
+ case "reflection":
82060
+ return "Reflecting on next steps";
82061
+ case "response":
82062
+ return "Writing a response";
82063
+ case "security_check":
82064
+ return "Performing security checks";
82065
+ case "classification":
82066
+ return "Thinking about my response";
82067
+ case "system":
82068
+ return "Processing system tasks";
82069
+ case "user_input":
82070
+ return "Processing your input";
82071
+ }
82072
+ }
82073
+ return status ? getStatusText(status) : "thinking";
82074
+ };
82075
+ const LoadingIndicator = ({ status, currentExecution, scrollToBottom }) => {
82076
+ const statusText = currentExecution ? getDetailedStatusText(status, currentExecution) : status ? getStatusText(status) : "Thinking";
82077
+ const codeSnippet = currentExecution?.code || null;
82078
+ const message2 = currentExecution?.message || null;
82079
+ const [isCodeExpanded, setIsCodeExpanded] = reactExports.useState(false);
82080
+ const { ref, scrollToBottom: scrollToBottomHook } = useScrollToBottom(
82081
+ [status, currentExecution, message2],
82082
+ 300,
82083
+ // Default threshold
82084
+ 50
82085
+ // Default button threshold
82086
+ );
82087
+ reactExports.useEffect(() => {
82088
+ if (codeSnippet && isCodeExpanded) {
82089
+ requestAnimationFrame(() => {
82090
+ if (scrollToBottomHook) {
82091
+ scrollToBottomHook();
82092
+ } else if (scrollToBottom) {
82093
+ scrollToBottom();
82094
+ }
82095
+ });
82096
+ }
82097
+ }, [codeSnippet, isCodeExpanded, scrollToBottom, scrollToBottomHook]);
82098
+ const toggleCodeExpansion = () => {
82099
+ setIsCodeExpanded((prev2) => !prev2);
82100
+ };
82101
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(LoadingContainer$5, { children: [
82102
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, style: { height: 0, width: 0 } }),
82103
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AgentAvatar$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faRobot, size: "sm" }) }),
82104
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(ContentContainer$3, { children: [
82105
+ /* @__PURE__ */ jsxRuntimeExports.jsx(StatusContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(StatusText, { variant: "body2", children: [
82106
+ /* @__PURE__ */ jsxRuntimeExports.jsx(StatusTextContent, { children: message2 ? message2 : `${statusText}` }),
82107
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(StatusControls, { children: [
82108
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(DotContainer, { children: [
82109
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Dot, { delay: 0 }),
82110
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Dot, { delay: 0.2 }),
82111
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Dot, { delay: 0.4 })
82112
+ ] }),
82113
+ codeSnippet && /* @__PURE__ */ jsxRuntimeExports.jsx(
82114
+ CodeToggleButton,
82115
+ {
82116
+ onClick: toggleCodeExpansion,
82117
+ size: "small",
82118
+ variant: "text",
82119
+ startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(
82120
+ FontAwesomeIcon,
82121
+ {
82122
+ icon: isCodeExpanded ? faChevronUp : faChevronDown,
82123
+ size: "xs",
82124
+ style: { fontSize: "0.75rem" }
82125
+ }
82126
+ ),
82127
+ children: isCodeExpanded ? "(Hide code)" : "(Show code)"
82128
+ }
82129
+ )
82130
+ ] })
82131
+ ] }) }),
82132
+ codeSnippet && isCodeExpanded && /* @__PURE__ */ jsxRuntimeExports.jsx(CodeContainer$4, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingCodeBlock, { code: codeSnippet }) })
82133
+ ] })
82134
+ ] });
82135
+ };
82136
+ const HighlightContainer$1 = styled$1(Box, {
82137
+ shouldForwardProp: (prop) => prop !== "action" && prop !== "isUser"
82138
+ })(({ action }) => ({
82139
+ position: "relative",
82140
+ padding: "16px",
82141
+ borderRadius: "8px",
82142
+ marginBottom: "16px",
82143
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
82144
+ width: "100%",
82145
+ border: `1px solid ${action === "DONE" ? "rgba(76, 175, 80, 0.5)" : "rgba(33, 150, 243, 0.5)"}`,
82146
+ backgroundColor: action === "DONE" ? "rgba(76, 175, 80, 0.1)" : "rgba(33, 150, 243, 0.1)",
82147
+ transition: "all 0.2s ease",
82148
+ "&:hover": {
82149
+ boxShadow: "0 6px 16px rgba(0, 0, 0, 0.2)"
82150
+ }
82151
+ }));
82152
+ const ActionBadge = styled$1(Box, {
82153
+ shouldForwardProp: (prop) => prop !== "action"
82154
+ })(({ theme: theme2, action }) => ({
82155
+ position: "absolute",
82156
+ top: "-10px",
82157
+ right: "16px",
82158
+ padding: "4px 8px",
82159
+ borderRadius: "12px",
82160
+ fontSize: "0.7rem",
82161
+ fontWeight: "bold",
82162
+ backgroundColor: action === "DONE" ? theme2.palette.success.main : theme2.palette.info.main,
82163
+ color: "#fff",
82164
+ display: "flex",
82165
+ alignItems: "center",
82166
+ gap: "4px",
82167
+ boxShadow: "0 2px 4px rgba(0, 0, 0, 0.2)"
82168
+ }));
82169
+ const ActionHighlight = ({
82170
+ children,
82171
+ action,
82172
+ isUser,
82173
+ taskClassification,
82174
+ executionType
82175
+ }) => {
82176
+ const shouldHighlight = (action === "DONE" || action === "ASK") && taskClassification !== "conversation" || executionType === "response" && taskClassification !== "conversation";
82177
+ if (!shouldHighlight) {
82178
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children });
82179
+ }
82180
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(HighlightContainer$1, { action, isUser, children: [
82181
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(ActionBadge, { action, children: [
82182
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
82183
+ FontAwesomeIcon,
82184
+ {
82185
+ icon: action === "DONE" ? faCheck : faQuestion,
82186
+ size: "xs"
82187
+ }
82188
+ ),
82189
+ action === "DONE" ? "COMPLETE" : "QUESTION"
82190
+ ] }),
82191
+ children
82192
+ ] });
82193
+ };
82194
+ const MarkdownContent = styled$1(Box, {
82195
+ shouldForwardProp: (prop) => ![
82196
+ "fontSize",
82197
+ "lineHeight",
82198
+ "paragraphSpacing",
82199
+ "headingScale",
82200
+ "codeSize"
82201
+ ].includes(prop)
82202
+ })(
82203
+ ({
82204
+ fontSize = "1.05rem",
82205
+ lineHeight = 1.6,
82206
+ paragraphSpacing = "8px",
82207
+ headingScale = 1,
82208
+ codeSize = "0.85em"
82209
+ }) => ({
82210
+ wordBreak: "break-word",
82211
+ overflowWrap: "break-word",
82212
+ lineHeight,
82213
+ fontSize,
82214
+ "& code": {
82215
+ fontFamily: '"Roboto Mono", monospace',
82216
+ backgroundColor: "rgba(0, 0, 0, 0.3)",
82217
+ padding: "3px 6px",
82218
+ borderRadius: "4px",
82219
+ fontSize: codeSize,
82220
+ whiteSpace: "pre-wrap",
82221
+ wordBreak: "break-word",
82222
+ color: "#e6e6e6"
82223
+ },
82224
+ "& pre": {
82225
+ backgroundColor: "rgba(0, 0, 0, 0.3)",
82226
+ padding: "16px",
82227
+ borderRadius: "8px",
82228
+ overflowX: "auto",
82229
+ fontFamily: '"Roboto Mono", monospace',
82230
+ fontSize: codeSize,
82231
+ margin: "12px 0",
82232
+ maxWidth: "100%",
82233
+ border: "1px solid rgba(255, 255, 255, 0.1)"
82234
+ },
82235
+ "& pre code": {
82236
+ whiteSpace: "pre-wrap",
82237
+ wordBreak: "break-word",
82238
+ backgroundColor: "transparent",
82239
+ padding: 0,
82240
+ borderRadius: 0
82241
+ },
82242
+ "& h1": {
82243
+ fontSize: `calc(1.5rem * ${headingScale})`,
82244
+ fontWeight: 600,
82245
+ margin: "20px 0 12px 0",
82246
+ borderBottom: "1px solid rgba(255, 255, 255, 0.1)",
82247
+ paddingBottom: "8px"
82248
+ },
82249
+ "& h2": {
82250
+ fontSize: `calc(1.3rem * ${headingScale})`,
82251
+ fontWeight: 600,
82252
+ margin: "18px 0 10px 0"
82253
+ },
82254
+ "& h3": {
82255
+ fontSize: `calc(1.1rem * ${headingScale})`,
82256
+ fontWeight: 600,
82257
+ margin: "16px 0 8px 0"
82258
+ },
82259
+ "& ul": {
82260
+ paddingLeft: "24px",
82261
+ margin: "10px 0"
82262
+ },
82263
+ "& li": {
82264
+ margin: "4px 0"
82265
+ },
82266
+ "& a": {
82267
+ color: "#90caf9",
82268
+ textDecoration: "none",
82269
+ borderBottom: "1px dotted rgba(144, 202, 249, 0.5)",
82270
+ transition: "all 0.2s ease",
82271
+ "&:hover": {
82272
+ textDecoration: "none",
82273
+ borderBottom: "1px solid #90caf9",
82274
+ color: "#bbdefb"
82275
+ }
82276
+ },
82277
+ "& strong": {
82278
+ fontWeight: 600,
82279
+ color: "#e6e6e6"
82280
+ },
82281
+ "& em": {
82282
+ fontStyle: "italic",
82283
+ color: "#e0e0e0"
82284
+ },
82285
+ "& br": {
82286
+ display: "block",
82287
+ content: '""',
82288
+ marginTop: "8px"
82289
+ },
82290
+ "& p:first-of-type": {
82291
+ marginTop: "2px"
82292
+ },
82293
+ "& p": {
82294
+ margin: `${paragraphSpacing} 0`
82295
+ }
82296
+ })
82297
+ );
82298
+ const convertUrlsToMarkdownLinks = (text2) => {
82299
+ const urlRegex = /(?<!\]\()(https?:\/\/\S+?)([,.;:!?"'\)\]]+)?(?=\s|$)/g;
82300
+ return text2.replace(
82301
+ urlRegex,
82302
+ (_match, url, punctuation) => `[${url}](${url})${punctuation || ""}`
82303
+ );
82304
+ };
82305
+ const MarkdownRenderer = reactExports.memo(
82306
+ ({ content: content2, styleProps }) => {
82307
+ const processedContent = reactExports.useMemo(() => {
82308
+ return convertUrlsToMarkdownLinks(content2.trim());
82309
+ }, [content2]);
82310
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(MarkdownContent, { ...styleProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
82311
+ Markdown,
82312
+ {
82313
+ components: {
82314
+ a: ({ href, children }) => /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href, target: "_blank", rel: "noopener noreferrer", children })
82315
+ },
82316
+ children: processedContent
82317
+ }
82318
+ ) });
82319
+ }
82320
+ );
82321
+ const BlockContainer = styled$1(Box)(() => ({
82322
+ width: "95%",
82323
+ cursor: "pointer",
82324
+ transition: "all 0.2s ease",
82325
+ marginLeft: 56,
82326
+ "&:hover": {
82327
+ opacity: 0.9
82328
+ }
82329
+ }));
82330
+ const BlockHeader = styled$1(Box, {
82331
+ shouldForwardProp: (prop) => prop !== "executionType" && prop !== "isUser"
82332
+ })(
82333
+ ({ theme: theme2, executionType }) => ({
82334
+ display: "flex",
82335
+ alignItems: "center",
82336
+ padding: "8px 12px",
82337
+ backgroundColor: "rgba(0, 0, 0, 0.2)",
82338
+ borderLeft: `3px solid ${executionType === "plan" ? theme2.palette.grey[600] : theme2.palette.grey[600]}`
82339
+ })
82340
+ );
82341
+ const BlockIcon = styled$1(Box)(({ theme: theme2 }) => ({
82342
+ marginRight: 8,
82343
+ display: "flex",
82344
+ alignItems: "center",
82345
+ justifyContent: "flex-start",
82346
+ color: theme2.palette.grey[500]
82347
+ }));
82348
+ const BlockTitle = styled$1(Typography)(({ theme: theme2 }) => ({
82349
+ fontWeight: 500,
82350
+ fontSize: "0.85rem",
82351
+ color: theme2.palette.grey[500]
82352
+ }));
82353
+ const BlockContent = styled$1(Typography)(({ theme: theme2 }) => ({
82354
+ fontSize: "0.85rem",
82355
+ color: theme2.palette.grey[400],
82356
+ overflow: "hidden",
82357
+ textOverflow: "ellipsis",
82358
+ marginTop: 2
82359
+ }));
82360
+ const ExpandedContent = styled$1(Box)(({ theme: theme2 }) => ({
82361
+ padding: "12px 16px",
82362
+ backgroundColor: "rgba(0, 0, 0, 0.2)",
82363
+ borderBottomLeftRadius: 4,
82364
+ borderBottomRightRadius: 4,
82365
+ fontSize: "0.85rem",
82366
+ color: theme2.palette.grey[300],
82367
+ borderLeft: `3px solid ${theme2.palette.grey[600]}`,
82368
+ marginLeft: 0
82369
+ }));
82370
+ const BackgroundBlock = ({
82371
+ content: content2,
82372
+ action,
82373
+ executionType,
82374
+ isUser
82375
+ }) => {
82376
+ const [isExpanded, setIsExpanded] = reactExports.useState(false);
82377
+ const toggleExpand = () => {
82378
+ setIsExpanded(!isExpanded);
82379
+ };
82380
+ const getTitle = () => {
82381
+ switch (action) {
82382
+ case "DONE":
82383
+ return "Task Complete";
82384
+ case "ASK":
82385
+ return "Asking a Question";
82386
+ default:
82387
+ return executionType === "plan" ? "Planning" : "Reflection";
82388
+ }
82389
+ };
82390
+ const getIcon = () => {
82391
+ switch (action) {
82392
+ case "DONE":
82393
+ return faCheck;
82394
+ case "ASK":
82395
+ return faQuestion;
82396
+ default:
82397
+ return executionType === "plan" ? faLightbulb : faCommentDots;
82398
+ }
82399
+ };
82400
+ const getTruncatedContent = (content22, maxLength = 140) => {
82401
+ return content22.length > maxLength ? `${content22.slice(0, maxLength)}...` : content22;
82402
+ };
82403
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(BlockContainer, { onClick: toggleExpand, children: [
82404
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(BlockHeader, { executionType, isUser, children: [
82405
+ /* @__PURE__ */ jsxRuntimeExports.jsx(BlockIcon, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: getIcon(), size: "sm" }) }),
82406
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { flexGrow: 1 }, children: [
82407
+ /* @__PURE__ */ jsxRuntimeExports.jsx(BlockTitle, { variant: "subtitle2", children: getTitle() }),
82408
+ !isExpanded && /* @__PURE__ */ jsxRuntimeExports.jsx(BlockContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
82409
+ MarkdownRenderer,
82410
+ {
82411
+ content: getTruncatedContent(content2),
82412
+ styleProps: {
82413
+ fontSize: "0.85rem",
82414
+ lineHeight: 1.5,
82415
+ paragraphSpacing: "4px",
82416
+ headingScale: 0.9,
82417
+ codeSize: "0.85em"
82418
+ }
82419
+ }
82420
+ ) })
82421
+ ] })
82422
+ ] }),
82423
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Collapse, { in: isExpanded, timeout: "auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandedContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
82424
+ MarkdownRenderer,
82425
+ {
82426
+ content: content2,
82427
+ styleProps: {
82428
+ fontSize: "0.85rem",
82429
+ lineHeight: 1.5,
82430
+ paragraphSpacing: "4px",
82431
+ headingScale: 0.9,
82432
+ codeSize: "0.85em"
82433
+ }
82434
+ }
82435
+ ) }) })
82436
+ ] });
82437
+ };
82184
82438
  const CodeContainer$3 = styled$1(Box)({
82185
82439
  marginBottom: 16,
82186
82440
  width: "100%"
@@ -82348,7 +82602,7 @@ const FileName = styled$1(Typography)({
82348
82602
  textDecoration: "underline"
82349
82603
  }
82350
82604
  });
82351
- const getFileName$1 = (path) => {
82605
+ const getFileName$2 = (path) => {
82352
82606
  const parts = path.split(/[/\\]/);
82353
82607
  return parts[parts.length - 1];
82354
82608
  };
@@ -82360,10 +82614,10 @@ const FileAttachment = ({ file, onClick }) => {
82360
82614
  FileAttachmentContainer,
82361
82615
  {
82362
82616
  onClick: handleClick,
82363
- title: `Click to open ${getFileName$1(file)}`,
82617
+ title: `Click to open ${getFileName$2(file)}`,
82364
82618
  children: [
82365
82619
  /* @__PURE__ */ jsxRuntimeExports.jsx(FileIcon, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faFile, size: "sm" }) }),
82366
- /* @__PURE__ */ jsxRuntimeExports.jsx(FileName, { variant: "body2", children: getFileName$1(file) })
82620
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FileName, { variant: "body2", children: getFileName$2(file) })
82367
82621
  ]
82368
82622
  }
82369
82623
  );
@@ -82381,7 +82635,7 @@ const AttachmentImage = styled$1("img")({
82381
82635
  boxShadow: "0 4px 12px rgba(0, 0, 0, 0.25)"
82382
82636
  }
82383
82637
  });
82384
- const getFileName = (path) => {
82638
+ const getFileName$1 = (path) => {
82385
82639
  const parts = path.split(/[/\\]/);
82386
82640
  return parts[parts.length - 1];
82387
82641
  };
@@ -82397,9 +82651,9 @@ const ImageAttachment = ({
82397
82651
  AttachmentImage,
82398
82652
  {
82399
82653
  src,
82400
- alt: getFileName(file),
82654
+ alt: getFileName$1(file),
82401
82655
  onClick: handleClick,
82402
- title: `Click to open ${getFileName(file)}`
82656
+ title: `Click to open ${getFileName$1(file)}`
82403
82657
  }
82404
82658
  );
82405
82659
  };
@@ -82631,6 +82885,42 @@ const StatusIndicator = ({ status }) => {
82631
82885
  if (!status) return null;
82632
82886
  return /* @__PURE__ */ jsxRuntimeExports.jsx(StyledStatusIndicator, { status, children: status });
82633
82887
  };
82888
+ const AttachmentVideo = styled$1("video")({
82889
+ maxWidth: "100%",
82890
+ maxHeight: 300,
82891
+ borderRadius: 8,
82892
+ marginBottom: 8,
82893
+ boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
82894
+ cursor: "pointer",
82895
+ transition: "transform 0.2s ease, box-shadow 0.2s ease",
82896
+ "&:hover": {
82897
+ transform: "scale(1.02)",
82898
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.25)"
82899
+ }
82900
+ });
82901
+ const getFileName = (path) => {
82902
+ const parts = path.split(/[/\\]/);
82903
+ return parts[parts.length - 1];
82904
+ };
82905
+ const VideoAttachment = ({
82906
+ file,
82907
+ src,
82908
+ onClick
82909
+ }) => {
82910
+ const handleClick = () => {
82911
+ onClick(file);
82912
+ };
82913
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
82914
+ AttachmentVideo,
82915
+ {
82916
+ src,
82917
+ controls: true,
82918
+ preload: "metadata",
82919
+ onClick: handleClick,
82920
+ title: `Click to open ${getFileName(file)}`
82921
+ }
82922
+ );
82923
+ };
82634
82924
  const isWebUrl = (path) => {
82635
82925
  return path.startsWith("http://") || path.startsWith("https://");
82636
82926
  };
@@ -82656,11 +82946,34 @@ const isImage = (path) => {
82656
82946
  const lowerPath = path.toLowerCase();
82657
82947
  return imageExtensions.some((ext) => lowerPath.endsWith(ext));
82658
82948
  };
82949
+ const isVideo = (path) => {
82950
+ const videoExtensions = [
82951
+ ".mp4",
82952
+ ".webm",
82953
+ ".ogg",
82954
+ ".mov",
82955
+ ".avi",
82956
+ ".wmv",
82957
+ ".flv",
82958
+ ".mkv",
82959
+ ".m4v",
82960
+ ".3gp",
82961
+ ".3g2"
82962
+ ];
82963
+ const lowerPath = path.toLowerCase();
82964
+ return videoExtensions.some((ext) => lowerPath.endsWith(ext));
82965
+ };
82659
82966
  const getAttachmentUrl = (client, path) => {
82660
- if (isImage(path) && !path.startsWith("http")) {
82661
- const normalizedPath = path.startsWith("file://") ? path : `file://${path}`;
82967
+ if (path.startsWith("http")) {
82968
+ return path;
82969
+ }
82970
+ const normalizedPath = path.startsWith("file://") ? path : `file://${path}`;
82971
+ if (isImage(path)) {
82662
82972
  return client.static.getImageUrl(normalizedPath);
82663
82973
  }
82974
+ if (isVideo(path)) {
82975
+ return client.static.getVideoUrl(normalizedPath);
82976
+ }
82664
82977
  return path;
82665
82978
  };
82666
82979
  const MessageItem = reactExports.memo(
@@ -82716,6 +83029,15 @@ const MessageItem = reactExports.memo(
82716
83029
  },
82717
83030
  `${message2.id}-${file}`
82718
83031
  )) }),
83032
+ message2.files && message2.files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2 }, children: message2.files.filter((file) => isVideo(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
83033
+ VideoAttachment,
83034
+ {
83035
+ file,
83036
+ src: getUrl(file),
83037
+ onClick: handleFileClick
83038
+ },
83039
+ `${message2.id}-${file}`
83040
+ )) }),
82719
83041
  message2.message && /* @__PURE__ */ jsxRuntimeExports.jsx(MessageContent, { content: message2.message, isUser }),
82720
83042
  (() => {
82721
83043
  const hasCollapsibleContent = isSecurityCheck && (message2.code || message2.stdout || message2.stderr || message2.logging);
@@ -82738,7 +83060,7 @@ const MessageItem = reactExports.memo(
82738
83060
  return contentBlocks;
82739
83061
  })(),
82740
83062
  message2.status && /* @__PURE__ */ jsxRuntimeExports.jsx(StatusIndicator, { status: message2.status }),
82741
- message2.files && message2.files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mt: 2 }, children: message2.files.filter((file) => !isImage(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
83063
+ message2.files && message2.files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mt: 2 }, children: message2.files.filter((file) => !isImage(file) && !isVideo(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
82742
83064
  FileAttachment,
82743
83065
  {
82744
83066
  file,
@@ -82764,6 +83086,15 @@ const MessageItem = reactExports.memo(
82764
83086
  },
82765
83087
  `${message2.id}-${file}`
82766
83088
  )) }),
83089
+ message2.files && message2.files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2 }, children: message2.files.filter((file) => isVideo(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
83090
+ VideoAttachment,
83091
+ {
83092
+ file,
83093
+ src: getUrl(file),
83094
+ onClick: handleFileClick
83095
+ },
83096
+ `${message2.id}-${file}`
83097
+ )) }),
82767
83098
  message2.message && /* @__PURE__ */ jsxRuntimeExports.jsx(MessageContent, { content: message2.message, isUser }),
82768
83099
  (() => {
82769
83100
  const hasCollapsibleContent = isAction && (message2.code || message2.stdout || message2.stderr || message2.logging);
@@ -82786,7 +83117,7 @@ const MessageItem = reactExports.memo(
82786
83117
  return contentBlocks;
82787
83118
  })(),
82788
83119
  message2.status && /* @__PURE__ */ jsxRuntimeExports.jsx(StatusIndicator, { status: message2.status }),
82789
- message2.files && message2.files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mt: 2 }, children: message2.files.filter((file) => !isImage(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
83120
+ message2.files && message2.files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mt: 2 }, children: message2.files.filter((file) => !isImage(file) && !isVideo(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
82790
83121
  FileAttachment,
82791
83122
  {
82792
83123
  file,
@@ -82850,8 +83181,10 @@ const MessagesView = ({
82850
83181
  isFetchingMore,
82851
83182
  jobStatus,
82852
83183
  agentName,
83184
+ currentExecution,
82853
83185
  messagesContainerRef,
82854
- messagesEndRef
83186
+ messagesEndRef,
83187
+ scrollToBottom
82855
83188
  }) => {
82856
83189
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(MessagesContainer, { ref: messagesContainerRef, children: [
82857
83190
  isFetchingMore && /* @__PURE__ */ jsxRuntimeExports.jsxs(LoadingMoreIndicator, { children: [
@@ -82876,7 +83209,15 @@ const MessagesView = ({
82876
83209
  ),
82877
83210
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", children: "No messages yet. Start a conversation!" })
82878
83211
  ] }),
82879
- isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingIndicator, { status: jobStatus, agentName }),
83212
+ isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(
83213
+ LoadingIndicator,
83214
+ {
83215
+ status: jobStatus,
83216
+ agentName,
83217
+ currentExecution,
83218
+ scrollToBottom
83219
+ }
83220
+ ),
82880
83221
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: messagesEndRef })
82881
83222
  ] })
82882
83223
  ] });
@@ -82930,6 +83271,7 @@ const ChatContent = ({
82930
83271
  isFetchingMore,
82931
83272
  isFarFromBottom,
82932
83273
  jobStatus,
83274
+ currentExecution,
82933
83275
  messagesContainerRef,
82934
83276
  messagesEndRef,
82935
83277
  scrollToBottom,
@@ -82968,8 +83310,10 @@ const ChatContent = ({
82968
83310
  isFetchingMore,
82969
83311
  jobStatus,
82970
83312
  agentName,
83313
+ currentExecution,
82971
83314
  messagesContainerRef,
82972
- messagesEndRef
83315
+ messagesEndRef,
83316
+ scrollToBottom
82973
83317
  }
82974
83318
  )
82975
83319
  ) : (
@@ -85420,7 +85764,8 @@ const ChatPage = () => {
85420
85764
  jobStatus,
85421
85765
  isLoading,
85422
85766
  setIsLoading,
85423
- checkForActiveJobs
85767
+ checkForActiveJobs,
85768
+ currentExecution
85424
85769
  } = useJobPolling({
85425
85770
  conversationId,
85426
85771
  addMessage
@@ -85656,6 +86001,7 @@ Store messages: ${JSON.stringify(getMessages(conversationId || ""), null, 2)}`;
85656
86001
  isFetchingMore,
85657
86002
  isFarFromBottom,
85658
86003
  jobStatus,
86004
+ currentExecution,
85659
86005
  messagesContainerRef,
85660
86006
  messagesEndRef,
85661
86007
  scrollToBottom,
@@ -90231,6 +90577,26 @@ const UserProfileSidebar = ({
90231
90577
  ) : null
90232
90578
  ] });
90233
90579
  };
90580
+ const useUiPreferencesStore = create$1()(
90581
+ persist(
90582
+ (set) => ({
90583
+ isSidebarCollapsed: false,
90584
+ toggleSidebar: () => {
90585
+ set((state) => ({
90586
+ isSidebarCollapsed: !state.isSidebarCollapsed
90587
+ }));
90588
+ },
90589
+ setSidebarCollapsed: (collapsed) => {
90590
+ set({
90591
+ isSidebarCollapsed: collapsed
90592
+ });
90593
+ }
90594
+ }),
90595
+ {
90596
+ name: "ui-preferences-storage"
90597
+ }
90598
+ )
90599
+ );
90234
90600
  const StyledDrawer = styled$1(Drawer, {
90235
90601
  shouldForwardProp: (prop) => prop !== "width"
90236
90602
  })(({ theme: theme2, width }) => ({
@@ -90346,12 +90712,10 @@ const ToggleButton = styled$1(IconButton)(() => ({
90346
90712
  }
90347
90713
  }));
90348
90714
  const SidebarNavigation = () => {
90349
- const [expanded, setExpanded] = reactExports.useState(true);
90350
90715
  const navigate = useNavigate();
90351
90716
  const currentView = useCurrentView();
90352
- const toggleSidebar = () => {
90353
- setExpanded(!expanded);
90354
- };
90717
+ const { isSidebarCollapsed, toggleSidebar } = useUiPreferencesStore();
90718
+ const expanded = !isSidebarCollapsed;
90355
90719
  const navItems = [
90356
90720
  {
90357
90721
  icon: faCode,
@@ -90426,6 +90790,7 @@ const SidebarNavigation = () => {
90426
90790
  onClick: toggleSidebar,
90427
90791
  size: "small",
90428
90792
  title: expanded ? "Collapse sidebar" : "Expand sidebar",
90793
+ "aria-label": expanded ? "Collapse sidebar" : "Expand sidebar",
90429
90794
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
90430
90795
  FontAwesomeIcon,
90431
90796
  {