local-operator-ui 0.12.4 → 0.12.6

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.
Files changed (48) hide show
  1. package/LICENSE +21 -619
  2. package/README.md +3 -2
  3. package/out/main/index.jsc +0 -0
  4. package/out/preload/index.jsc +0 -0
  5. package/out/renderer/assets/{_basePickBy-D-mTy0T7.js → _basePickBy-CV2bZNyc.js} +2 -2
  6. package/out/renderer/assets/{_baseUniq-CVF81xU9.js → _baseUniq-CT1VRxf8.js} +1 -1
  7. package/out/renderer/assets/{arc-BcZxubla.js → arc-BRfzIVaB.js} +1 -1
  8. package/out/renderer/assets/{architectureDiagram-IEHRJDOE-0JBfW8n9.js → architectureDiagram-IEHRJDOE-BE1k5yn0.js} +7 -7
  9. package/out/renderer/assets/{blockDiagram-JOT3LUYC-DIjqxpHX.js → blockDiagram-JOT3LUYC-CKjlYfeC.js} +5 -5
  10. package/out/renderer/assets/{c4Diagram-VJAJSXHY-B8ZTZ0n8.js → c4Diagram-VJAJSXHY-DnUBXdyl.js} +2 -2
  11. package/out/renderer/assets/{channel-BQBOXiqs.js → channel-D5pw1lrZ.js} +1 -1
  12. package/out/renderer/assets/{chunk-4BMEZGHF-BCTXK4C0.js → chunk-4BMEZGHF-C1IeWpO1.js} +1 -1
  13. package/out/renderer/assets/{chunk-A2AXSNBT-Dt4gXQBd.js → chunk-A2AXSNBT-DItzEHfB.js} +2 -2
  14. package/out/renderer/assets/{chunk-AEK57VVT-CAAj-J2-.js → chunk-AEK57VVT-CPn79hs1.js} +2 -2
  15. package/out/renderer/assets/{chunk-D6G4REZN-_hQRwF7v.js → chunk-D6G4REZN-xxtdtOvH.js} +1 -1
  16. package/out/renderer/assets/{chunk-RZ5BOZE2-Vl3-h4SG.js → chunk-RZ5BOZE2-DZzd7XF-.js} +1 -1
  17. package/out/renderer/assets/{chunk-XZIHB7SX-C61iNqnQ.js → chunk-XZIHB7SX-D47Ag_yH.js} +1 -1
  18. package/out/renderer/assets/{classDiagram-GIVACNV2-CNcNWb-o.js → classDiagram-GIVACNV2-BTb1dsm_.js} +3 -3
  19. package/out/renderer/assets/{classDiagram-v2-COTLJTTW-CNcNWb-o.js → classDiagram-v2-COTLJTTW-BTb1dsm_.js} +3 -3
  20. package/out/renderer/assets/{clone-D4Ah0_EU.js → clone-tf2h75F9.js} +1 -1
  21. package/out/renderer/assets/{dagre-OKDRZEBW-DZOFGtWs.js → dagre-OKDRZEBW-uJDV0tEB.js} +6 -6
  22. package/out/renderer/assets/{diagram-SSKATNLV-DGVbLzJc.js → diagram-SSKATNLV-BxlaHBtJ.js} +6 -6
  23. package/out/renderer/assets/{diagram-VNBRO52H-DUz0a2Uz.js → diagram-VNBRO52H-CCeijHj7.js} +6 -6
  24. package/out/renderer/assets/{erDiagram-Q7BY3M3F-CfYzgE98.js → erDiagram-Q7BY3M3F-D66PtkGh.js} +3 -3
  25. package/out/renderer/assets/{flowDiagram-4HSFHLVR-tRJWBVYd.js → flowDiagram-4HSFHLVR-CjBlaiPH.js} +3 -3
  26. package/out/renderer/assets/{ganttDiagram-APWFNJXF-BWG5VLyZ.js → ganttDiagram-APWFNJXF-CifvAN8h.js} +1 -1
  27. package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-Cd11pFbi.js → gitGraphDiagram-7IBYFJ6S-BC17Lxhk.js} +7 -7
  28. package/out/renderer/assets/{graph-P5xyWsnt.js → graph-_Hab34Nn.js} +2 -2
  29. package/out/renderer/assets/{index-CtrEBFNz.js → index-BOEHLAOZ.js} +1 -1
  30. package/out/renderer/assets/{index-C4NwO8de.js → index-Bq43-Afm.js} +373 -150
  31. package/out/renderer/assets/{index-B4xrtp2Z.js → index-CIm5Gpeu.js} +1 -1
  32. package/out/renderer/assets/{infoDiagram-PH2N3AL5-KjJg15gx.js → infoDiagram-PH2N3AL5-Dsj1auFt.js} +5 -5
  33. package/out/renderer/assets/{journeyDiagram-U35MCT3I-Dp2FVK6h.js → journeyDiagram-U35MCT3I-CBWci7yb.js} +3 -3
  34. package/out/renderer/assets/{kanban-definition-NDS4AKOZ-cttuutf_.js → kanban-definition-NDS4AKOZ-BrBwgyJQ.js} +1 -1
  35. package/out/renderer/assets/{layout-Bep2Ed3s.js → layout-BlsQazV2.js} +4 -4
  36. package/out/renderer/assets/{mindmap-definition-ALO5MXBD-DiLxGufv.js → mindmap-definition-ALO5MXBD-e-VrUTAA.js} +1 -1
  37. package/out/renderer/assets/{pieDiagram-IB7DONF6-C7Crt4gw.js → pieDiagram-IB7DONF6-CZvzTYvc.js} +7 -7
  38. package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-BMbHGD_6.js → quadrantDiagram-7GDLP6J5-CJSNfyeY.js} +1 -1
  39. package/out/renderer/assets/{radar-MK3ICKWK-BIBBEO8S.js → radar-MK3ICKWK-hFlyH6N6.js} +4 -4
  40. package/out/renderer/assets/{requirementDiagram-KVF5MWMF-BumPivJk.js → requirementDiagram-KVF5MWMF-BzJ8TKJn.js} +2 -2
  41. package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-D1LzUzj2.js → sankeyDiagram-QLVOVGJD-C1MZHoLs.js} +1 -1
  42. package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-CwnYTtil.js → sequenceDiagram-X6HHIX6F-QlZcg6un.js} +3 -3
  43. package/out/renderer/assets/{stateDiagram-DGXRK772-4yXBR_vP.js → stateDiagram-DGXRK772-lkNrTERo.js} +7 -7
  44. package/out/renderer/assets/{stateDiagram-v2-YXO3MK2T-6p7BdIAB.js → stateDiagram-v2-YXO3MK2T-Cnlxf-OJ.js} +3 -3
  45. package/out/renderer/assets/{timeline-definition-BDJGKUSR-CCdgMyc-.js → timeline-definition-BDJGKUSR-ClHwwcwA.js} +2 -2
  46. package/out/renderer/assets/{xychartDiagram-VJFVF3MP-DD0agc1N.js → xychartDiagram-VJFVF3MP-Jn_L_tBu.js} +1 -1
  47. package/out/renderer/index.html +1 -1
  48. package/package.json +11 -38
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CtrEBFNz.js","./fonts-DqkQ6BY5.js","./fonts-CM-VN_uu.css","./index-B4xrtp2Z.js","./pug-By0kVCfm.js","./javascript-C3MnDRiU.js","./dagre-OKDRZEBW-DZOFGtWs.js","./graph-P5xyWsnt.js","./_baseUniq-CVF81xU9.js","./layout-Bep2Ed3s.js","./_basePickBy-D-mTy0T7.js","./clone-D4Ah0_EU.js","./c4Diagram-VJAJSXHY-B8ZTZ0n8.js","./chunk-D6G4REZN-_hQRwF7v.js","./flowDiagram-4HSFHLVR-tRJWBVYd.js","./chunk-RZ5BOZE2-Vl3-h4SG.js","./channel-BQBOXiqs.js","./erDiagram-Q7BY3M3F-CfYzgE98.js","./gitGraphDiagram-7IBYFJ6S-Cd11pFbi.js","./chunk-4BMEZGHF-BCTXK4C0.js","./chunk-XZIHB7SX-C61iNqnQ.js","./radar-MK3ICKWK-BIBBEO8S.js","./ganttDiagram-APWFNJXF-BWG5VLyZ.js","./infoDiagram-PH2N3AL5-KjJg15gx.js","./pieDiagram-IB7DONF6-C7Crt4gw.js","./arc-BcZxubla.js","./quadrantDiagram-7GDLP6J5-BMbHGD_6.js","./xychartDiagram-VJFVF3MP-DD0agc1N.js","./requirementDiagram-KVF5MWMF-BumPivJk.js","./sequenceDiagram-X6HHIX6F-CwnYTtil.js","./classDiagram-GIVACNV2-CNcNWb-o.js","./chunk-A2AXSNBT-Dt4gXQBd.js","./classDiagram-v2-COTLJTTW-CNcNWb-o.js","./stateDiagram-DGXRK772-4yXBR_vP.js","./chunk-AEK57VVT-CAAj-J2-.js","./stateDiagram-v2-YXO3MK2T-6p7BdIAB.js","./journeyDiagram-U35MCT3I-Dp2FVK6h.js","./timeline-definition-BDJGKUSR-CCdgMyc-.js","./mindmap-definition-ALO5MXBD-DiLxGufv.js","./cytoscape.esm-C0AOj4uS.js","./kanban-definition-NDS4AKOZ-cttuutf_.js","./sankeyDiagram-QLVOVGJD-D1LzUzj2.js","./diagram-VNBRO52H-DUz0a2Uz.js","./diagram-SSKATNLV-DGVbLzJc.js","./blockDiagram-JOT3LUYC-DIjqxpHX.js","./architectureDiagram-IEHRJDOE-0JBfW8n9.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BOEHLAOZ.js","./fonts-DqkQ6BY5.js","./fonts-CM-VN_uu.css","./index-CIm5Gpeu.js","./pug-By0kVCfm.js","./javascript-C3MnDRiU.js","./dagre-OKDRZEBW-uJDV0tEB.js","./graph-_Hab34Nn.js","./_baseUniq-CT1VRxf8.js","./layout-BlsQazV2.js","./_basePickBy-CV2bZNyc.js","./clone-tf2h75F9.js","./c4Diagram-VJAJSXHY-DnUBXdyl.js","./chunk-D6G4REZN-xxtdtOvH.js","./flowDiagram-4HSFHLVR-CjBlaiPH.js","./chunk-RZ5BOZE2-DZzd7XF-.js","./channel-D5pw1lrZ.js","./erDiagram-Q7BY3M3F-D66PtkGh.js","./gitGraphDiagram-7IBYFJ6S-BC17Lxhk.js","./chunk-4BMEZGHF-C1IeWpO1.js","./chunk-XZIHB7SX-D47Ag_yH.js","./radar-MK3ICKWK-hFlyH6N6.js","./ganttDiagram-APWFNJXF-CifvAN8h.js","./infoDiagram-PH2N3AL5-Dsj1auFt.js","./pieDiagram-IB7DONF6-CZvzTYvc.js","./arc-BRfzIVaB.js","./quadrantDiagram-7GDLP6J5-CJSNfyeY.js","./xychartDiagram-VJFVF3MP-Jn_L_tBu.js","./requirementDiagram-KVF5MWMF-BzJ8TKJn.js","./sequenceDiagram-X6HHIX6F-QlZcg6un.js","./classDiagram-GIVACNV2-BTb1dsm_.js","./chunk-A2AXSNBT-DItzEHfB.js","./classDiagram-v2-COTLJTTW-BTb1dsm_.js","./stateDiagram-DGXRK772-lkNrTERo.js","./chunk-AEK57VVT-CPn79hs1.js","./stateDiagram-v2-YXO3MK2T-Cnlxf-OJ.js","./journeyDiagram-U35MCT3I-CBWci7yb.js","./timeline-definition-BDJGKUSR-ClHwwcwA.js","./mindmap-definition-ALO5MXBD-e-VrUTAA.js","./cytoscape.esm-C0AOj4uS.js","./kanban-definition-NDS4AKOZ-BrBwgyJQ.js","./sankeyDiagram-QLVOVGJD-C1MZHoLs.js","./diagram-VNBRO52H-CCeijHj7.js","./diagram-SSKATNLV-BxlaHBtJ.js","./blockDiagram-JOT3LUYC-CKjlYfeC.js","./architectureDiagram-IEHRJDOE-BE1k5yn0.js"])))=>i.map(i=>d[i]);
2
2
  import { i as createStyled, l as resolveProps, m as useTheme, n as useTheme$1, r as reactExports, o as React, p as useEnhancedEffect$1, q as clsx, t as useForkRef$1, v as extendSxProp, j as jsxRuntimeExports, w as handleBreakpoints, x as resolveBreakpointValues, y as createUnarySpacing, z as deepmerge, A as mergeBreakpointsInOrder, F as composeClasses$1, G as generateUtilityClass$1, I as createTheme$1, J as getValue$1, h as React$1, K as requireReactDom, g as getDefaultExportFromCjs, L as defaultTheme$2, M as THEME_ID, N as generateUtilityClasses$1, O as useDefaultProps, s as styled$1, P as capitalize$1, Q as memoTheme, _ as _inheritsLoose, S as _objectWithoutPropertiesLoose$k, U as TransitionGroupContext, V as _extends$w, W as duration, u as useTheme$2, X as useTimeout$1, Y as useId$1, Z as ButtonBase, b as alpha$1, $ as createSimplePaletteValueFilter, a0 as CircularProgress, a1 as Paper, a2 as darken$1, a3 as lighten$1, a4 as useEventCallback$1, a5 as useRtl, a6 as globalCss, a7 as formatMuiErrorMessage$1, a8 as rootShouldForwardProp, T as Typography, a9 as css$1, k as keyframes, aa as getPath$2, ab as isFocusVisible, ac as typographyClasses, ad as slotShouldForwardProp, ae as clamp$1, af as emphasize, ag as Timeout$1, c as createLucideIcon, a as Button, B as Box, ah as FontAwesomeIcon, ai as faExclamationTriangle, D as DEFAULT_THEME, aj as faChevronLeft, ak as faChevronRight, al as faRobot, am as faCheck, an as faTimes, ao as faEraser, ap as faPen, aq as faFileImport, ar as faUpload, as as GlobalStyles, at as requireReact, au as faComment, av as faSave, aw as faEdit, ax as faTrashAlt, ay as faInfoCircle, az as faGear, aA as faPlus, aB as faServer, aC as faStar, aD as faTag, aE as faIdCard, aF as faCalendarAlt, aG as faCodeBranch, aH as faShieldAlt, aI as faArrowLeft, aJ as faClock, C as Code, aK as faHome, aL as faDownload, aM as faFileAlt, aN as faDesktop, aO as faImage, aP as faMusic, aQ as faVideo, aR as faLaptop, aS as faUsers, aT as faDatabase, aU as faBoxOpen, aV as faBook, aW as faHdd, aX as faBox, aY as faArchive, aZ as faNetworkWired, a_ as faFolder, a$ as faFolderOpen, b0 as faFolderTree, b1 as faFile, b2 as faCode, b3 as faSliders, b4 as faTrash, b5 as faArrowDown, b6 as faPaperclip, b7 as faPaperPlane, b8 as faExclamationCircle, b9 as faChevronDown, ba as isDevelopmentMode, bb as faCommentSlash, bc as faArrowRight, bd as faBrain, be as faWandMagicSparkles, bf as faExternalLinkAlt, bg as faKey, bh as radientTheme, bi as faGlobe, bj as faSearch, bk as PropTypes, bl as shouldForwardProp, bm as TransitionGroup, bn as commonjsGlobal, bo as faLock, bp as faPuzzlePiece, H as HardDrive, bq as faSignOut, br as themes$1, bs as faMoon, bt as faSun, bu as faHexagonNodes, bv as faSkull, bw as faLeaf, bx as faMountain, by as faFire, bz as faIcicles, bA as faBolt, bB as faAdjust, bC as faWaveSquare, bD as faUser, bE as faEnvelope, bF as faHistory, bG as faListAlt, bH as faCreditCard, bI as faPlusCircle, bJ as faChartLine, bK as faShield, bL as library$1, bM as icons$1, f as CssBaseline, e as ThemeProvider$1, d as getTheme, R as ReactDOM$1, E as ErrorBoundary } from "./fonts-DqkQ6BY5.js";
3
3
  const styled = createStyled();
4
4
  function getThemeProps(params) {
@@ -40532,9 +40532,9 @@ const useMessageInput = ({
40532
40532
  resetCurrentHistoryIndex(conversationId);
40533
40533
  draftMessageRef.current = "";
40534
40534
  if (scrollToBottom) {
40535
- setTimeout(() => {
40535
+ requestAnimationFrame(() => {
40536
40536
  scrollToBottom();
40537
- }, 150);
40537
+ });
40538
40538
  }
40539
40539
  }, [
40540
40540
  inputValue,
@@ -42221,8 +42221,10 @@ const useScrollToBottom = (buttonThreshold = 50, externalContainerRef, contentKe
42221
42221
  const scrollToBottom = reactExports.useCallback(() => {
42222
42222
  const container = containerRef.current;
42223
42223
  if (!container) return;
42224
- container.scrollTo({ top: 0, behavior: "smooth" });
42225
- requestAnimationFrame(updateScrollPosition);
42224
+ requestAnimationFrame(() => {
42225
+ container.scrollTo({ top: 0, behavior: "smooth" });
42226
+ requestAnimationFrame(updateScrollPosition);
42227
+ });
42226
42228
  }, [containerRef, updateScrollPosition]);
42227
42229
  const handleScroll = reactExports.useCallback(() => {
42228
42230
  if (!containerRef.current || isHandlingScrollRef.current) return;
@@ -42547,6 +42549,22 @@ const useStreamingMessage = ({
42547
42549
  (record) => record.id === messageId
42548
42550
  );
42549
42551
  if (!messageData) {
42552
+ if (registryEntry?.messageData && registryEntry.isComplete) {
42553
+ completeStreamingMessage(messageId, registryEntry.messageData);
42554
+ if (conversationId) {
42555
+ const messageForStore = convertToMessage(
42556
+ registryEntry.messageData,
42557
+ conversationId
42558
+ );
42559
+ const updated = updateMessage(conversationId, messageForStore);
42560
+ if (!updated) {
42561
+ addMessage(conversationId, messageForStore);
42562
+ }
42563
+ }
42564
+ if (onComplete && mountedRef.current) {
42565
+ onComplete(registryEntry.messageData);
42566
+ }
42567
+ }
42550
42568
  return;
42551
42569
  }
42552
42570
  completeStreamingMessage(messageId, messageData);
@@ -42602,78 +42620,42 @@ const useStreamingMessage = ({
42602
42620
  ...registryEntry?.messageData,
42603
42621
  ...update
42604
42622
  };
42605
- if (update.is_complete) {
42623
+ const currentRegistryEntry = globalConnectionRegistry.get(messageId);
42624
+ const alreadyCompleted = currentRegistryEntry?.isComplete;
42625
+ if (update.is_complete && !alreadyCompleted) {
42606
42626
  completeStreamingMessage(messageId, messageData);
42607
- if (refetchOnComplete) {
42627
+ if (currentRegistryEntry) {
42628
+ currentRegistryEntry.isComplete = true;
42629
+ }
42630
+ if (conversationId && messageData.id) {
42631
+ const messageForStore = convertToMessage(messageData, conversationId);
42632
+ const updated = updateMessage(conversationId, messageForStore);
42633
+ if (!updated) {
42634
+ addMessage(conversationId, messageForStore);
42635
+ }
42636
+ }
42637
+ if (refetchOnComplete && !isRefetching) {
42608
42638
  setTimeout(() => {
42609
42639
  if (mountedRef.current) {
42610
- const doRefetch = async () => {
42611
- if (isRefetching) return;
42612
- try {
42613
- setIsRefetching(true);
42614
- const client2 = createLocalOperatorClient(baseUrl);
42615
- const entry = globalConnectionRegistry.get(messageId);
42616
- const agentId = entry?.conversationId || conversationId;
42617
- if (!agentId) return;
42618
- const response = await client2.agents.getAgentExecutionHistory(
42619
- agentId,
42620
- 1,
42621
- 20
42622
- );
42623
- if (response.status >= 400 || !response.result) {
42624
- throw new Error(
42625
- response.message || "Failed to fetch message data"
42626
- );
42627
- }
42628
- const msgData = response.result.history.find(
42629
- (record) => record.id === messageId
42630
- );
42631
- if (!msgData) return;
42632
- completeStreamingMessage(messageId, msgData);
42633
- if (entry) {
42634
- entry.messageData = msgData;
42635
- entry.isComplete = true;
42636
- entry.isStreamable = !!msgData.is_streamable;
42637
- }
42638
- if (conversationId) {
42639
- const msgForStore = convertToMessage(
42640
- msgData,
42641
- conversationId
42642
- );
42643
- const updated = updateMessage(conversationId, msgForStore);
42644
- if (!updated) {
42645
- addMessage(conversationId, msgForStore);
42646
- }
42647
- }
42648
- if (onComplete && mountedRef.current) {
42649
- onComplete(msgData);
42650
- }
42651
- } catch (error2) {
42652
- const errorMessage = error2 instanceof Error ? error2.message : String(error2);
42653
- console.error(
42654
- `Error auto-refetching message: ${errorMessage}`
42655
- );
42656
- } finally {
42657
- setIsRefetching(false);
42658
- }
42659
- };
42660
- doRefetch();
42640
+ refetchMessage().catch((error2) => {
42641
+ console.error("Error during refetch after completion:", error2);
42642
+ });
42661
42643
  }
42662
- }, 500);
42644
+ }, 150);
42663
42645
  }
42664
- } else {
42646
+ } else if (!update.is_complete) {
42665
42647
  updateStreamingMessage(messageId, messageData);
42666
- }
42667
- if (conversationId && messageData.id) {
42668
- const messageForStore = convertToMessage(messageData, conversationId);
42669
- if (!updateChatStoreTimeoutRef.current) {
42670
- updateChatStoreTimeoutRef.current = setTimeout(() => {
42671
- const updated = updateMessage(conversationId, messageForStore);
42672
- if (!updated) {
42673
- addMessage(conversationId, messageForStore);
42674
- }
42675
- updateChatStoreTimeoutRef.current = null;
42676
- }, 100);
42648
+ if (conversationId && messageData.id) {
42649
+ const messageForStore = convertToMessage(messageData, conversationId);
42650
+ if (!updateChatStoreTimeoutRef.current) {
42651
+ updateChatStoreTimeoutRef.current = setTimeout(() => {
42652
+ const updated = updateMessage(conversationId, messageForStore);
42653
+ if (!updated) {
42654
+ addMessage(conversationId, messageForStore);
42655
+ }
42656
+ updateChatStoreTimeoutRef.current = null;
42657
+ }, 50);
42658
+ }
42677
42659
  }
42678
42660
  }
42679
42661
  },
@@ -42681,14 +42663,13 @@ const useStreamingMessage = ({
42681
42663
  messageId,
42682
42664
  conversationId,
42683
42665
  onUpdate,
42684
- onComplete,
42685
42666
  refetchOnComplete,
42686
42667
  updateStreamingMessage,
42687
42668
  completeStreamingMessage,
42688
42669
  updateMessage,
42689
42670
  addMessage,
42690
- baseUrl,
42691
- isRefetching
42671
+ isRefetching,
42672
+ refetchMessage
42692
42673
  ]
42693
42674
  );
42694
42675
  const updateChatStoreTimeoutRef = reactExports.useRef(null);
@@ -42887,7 +42868,11 @@ const useStreamingMessage = ({
42887
42868
  isCompletePrevRef.current = true;
42888
42869
  completeStreamingMessage(messageId, message2);
42889
42870
  if (onComplete) {
42890
- onComplete(message2);
42871
+ setTimeout(() => {
42872
+ if (mountedRef.current) {
42873
+ onComplete(message2);
42874
+ }
42875
+ }, 50);
42891
42876
  }
42892
42877
  if (!keepAlive) {
42893
42878
  safeDisconnect();
@@ -42904,6 +42889,27 @@ const useStreamingMessage = ({
42904
42889
  messageId,
42905
42890
  completeStreamingMessage
42906
42891
  ]);
42892
+ reactExports.useEffect(() => {
42893
+ return () => {
42894
+ if (globalConnectionRegistry.has(messageId)) {
42895
+ const entry = globalConnectionRegistry.get(messageId);
42896
+ if (entry && entry.instanceCount > 0) {
42897
+ entry.instanceCount = Math.max(0, entry.instanceCount - 1);
42898
+ if (entry.instanceCount === 0 && !entry.keepAlive) {
42899
+ try {
42900
+ wsDisconnect();
42901
+ entry.connected = false;
42902
+ entry.connecting = false;
42903
+ entry.connectionPromise = null;
42904
+ entry.wsClient = null;
42905
+ } catch (error2) {
42906
+ console.warn("Error during cleanup:", error2);
42907
+ }
42908
+ }
42909
+ }
42910
+ }
42911
+ };
42912
+ }, [messageId, wsDisconnect]);
42907
42913
  return {
42908
42914
  message: message2,
42909
42915
  isComplete,
@@ -89889,7 +89895,7 @@ const languages = [
89889
89895
  name: "Go",
89890
89896
  extensions: ["go"],
89891
89897
  load() {
89892
- return __vitePreload(() => import("./index-CtrEBFNz.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url).then((m2) => m2.go());
89898
+ return __vitePreload(() => import("./index-BOEHLAOZ.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url).then((m2) => m2.go());
89893
89899
  }
89894
89900
  }),
89895
89901
  /* @__PURE__ */ LanguageDescription.of({
@@ -90066,7 +90072,7 @@ const languages = [
90066
90072
  alias: ["yml"],
90067
90073
  extensions: ["yaml", "yml"],
90068
90074
  load() {
90069
- return __vitePreload(() => import("./index-B4xrtp2Z.js"), true ? __vite__mapDeps([3,1,2]) : void 0, import.meta.url).then((m2) => m2.yaml());
90075
+ return __vitePreload(() => import("./index-CIm5Gpeu.js"), true ? __vite__mapDeps([3,1,2]) : void 0, import.meta.url).then((m2) => m2.yaml());
90070
90076
  }
90071
90077
  }),
90072
90078
  // Legacy modes ported from CodeMirror 5
@@ -229913,7 +229919,7 @@ const FileNameTypography = styled$1(Typography)(({ theme: theme2 }) => ({
229913
229919
  fontSize: "0.7rem",
229914
229920
  padding: theme2.spacing(0, 0)
229915
229921
  }));
229916
- const isImage$2 = (path2) => {
229922
+ const isImage$3 = (path2) => {
229917
229923
  const imageExtensions = [
229918
229924
  ".jpg",
229919
229925
  ".jpeg",
@@ -229935,7 +229941,7 @@ const isImage$2 = (path2) => {
229935
229941
  const lowerPath = path2.toLowerCase();
229936
229942
  return imageExtensions.some((ext) => lowerPath.endsWith(ext));
229937
229943
  };
229938
- const isVideo$2 = (path2) => {
229944
+ const isVideo$3 = (path2) => {
229939
229945
  const videoExtensions = [
229940
229946
  ".mp4",
229941
229947
  ".webm",
@@ -229952,7 +229958,7 @@ const isVideo$2 = (path2) => {
229952
229958
  const lowerPath = path2.toLowerCase();
229953
229959
  return videoExtensions.some((ext) => lowerPath.endsWith(ext));
229954
229960
  };
229955
- const getAttachmentUrl$2 = (client2, path2) => {
229961
+ const getAttachmentUrl$3 = (client2, path2) => {
229956
229962
  if (path2.startsWith("http")) {
229957
229963
  return path2;
229958
229964
  }
@@ -229960,10 +229966,10 @@ const getAttachmentUrl$2 = (client2, path2) => {
229960
229966
  return path2;
229961
229967
  }
229962
229968
  const normalizedPath = path2.startsWith("file://") ? path2 : `file://${path2}`;
229963
- if (isImage$2(path2)) {
229969
+ if (isImage$3(path2)) {
229964
229970
  return client2.static.getImageUrl(normalizedPath);
229965
229971
  }
229966
- if (isVideo$2(path2)) {
229972
+ if (isVideo$3(path2)) {
229967
229973
  return client2.static.getVideoUrl(normalizedPath);
229968
229974
  }
229969
229975
  return path2;
@@ -230025,7 +230031,7 @@ const CanvasFileViewerComponent = ({
230025
230031
  return createLocalOperatorClient(apiConfig.baseUrl);
230026
230032
  }, []);
230027
230033
  const getUrl2 = reactExports.useCallback(
230028
- (path2) => getAttachmentUrl$2(client2, path2),
230034
+ (path2) => getAttachmentUrl$3(client2, path2),
230029
230035
  [client2]
230030
230036
  );
230031
230037
  const handleFileClick = reactExports.useCallback(
@@ -273861,7 +273867,7 @@ var registerDefaultLayoutLoaders = /* @__PURE__ */ __name(() => {
273861
273867
  registerLayoutLoaders([
273862
273868
  {
273863
273869
  name: "dagre",
273864
- loader: /* @__PURE__ */ __name(async () => await __vitePreload(() => import("./dagre-OKDRZEBW-DZOFGtWs.js"), true ? __vite__mapDeps([6,7,8,9,10,11,1,2]) : void 0, import.meta.url), "loader")
273870
+ loader: /* @__PURE__ */ __name(async () => await __vitePreload(() => import("./dagre-OKDRZEBW-uJDV0tEB.js"), true ? __vite__mapDeps([6,7,8,9,10,11,1,2]) : void 0, import.meta.url), "loader")
273865
273871
  }
273866
273872
  ]);
273867
273873
  }, "registerDefaultLayoutLoaders");
@@ -274451,7 +274457,7 @@ var detector = /* @__PURE__ */ __name((txt) => {
274451
274457
  }, "detector");
274452
274458
  var loader = /* @__PURE__ */ __name(async () => {
274453
274459
  const { diagram: diagram2 } = await __vitePreload(async () => {
274454
- const { diagram: diagram22 } = await import("./c4Diagram-VJAJSXHY-B8ZTZ0n8.js");
274460
+ const { diagram: diagram22 } = await import("./c4Diagram-VJAJSXHY-DnUBXdyl.js");
274455
274461
  return { diagram: diagram22 };
274456
274462
  }, true ? __vite__mapDeps([12,13,1,2]) : void 0, import.meta.url);
274457
274463
  return { id, diagram: diagram2 };
@@ -274471,7 +274477,7 @@ var detector2 = /* @__PURE__ */ __name((txt, config2) => {
274471
274477
  }, "detector");
274472
274478
  var loader2 = /* @__PURE__ */ __name(async () => {
274473
274479
  const { diagram: diagram2 } = await __vitePreload(async () => {
274474
- const { diagram: diagram22 } = await import("./flowDiagram-4HSFHLVR-tRJWBVYd.js");
274480
+ const { diagram: diagram22 } = await import("./flowDiagram-4HSFHLVR-CjBlaiPH.js");
274475
274481
  return { diagram: diagram22 };
274476
274482
  }, true ? __vite__mapDeps([14,15,16,1,2]) : void 0, import.meta.url);
274477
274483
  return { id: id2, diagram: diagram2 };
@@ -274497,7 +274503,7 @@ var detector3 = /* @__PURE__ */ __name((txt, config2) => {
274497
274503
  }, "detector");
274498
274504
  var loader3 = /* @__PURE__ */ __name(async () => {
274499
274505
  const { diagram: diagram2 } = await __vitePreload(async () => {
274500
- const { diagram: diagram22 } = await import("./flowDiagram-4HSFHLVR-tRJWBVYd.js");
274506
+ const { diagram: diagram22 } = await import("./flowDiagram-4HSFHLVR-CjBlaiPH.js");
274501
274507
  return { diagram: diagram22 };
274502
274508
  }, true ? __vite__mapDeps([14,15,16,1,2]) : void 0, import.meta.url);
274503
274509
  return { id: id3, diagram: diagram2 };
@@ -274514,7 +274520,7 @@ var detector4 = /* @__PURE__ */ __name((txt) => {
274514
274520
  }, "detector");
274515
274521
  var loader4 = /* @__PURE__ */ __name(async () => {
274516
274522
  const { diagram: diagram2 } = await __vitePreload(async () => {
274517
- const { diagram: diagram22 } = await import("./erDiagram-Q7BY3M3F-CfYzgE98.js");
274523
+ const { diagram: diagram22 } = await import("./erDiagram-Q7BY3M3F-D66PtkGh.js");
274518
274524
  return { diagram: diagram22 };
274519
274525
  }, true ? __vite__mapDeps([17,15,16,1,2]) : void 0, import.meta.url);
274520
274526
  return { id: id4, diagram: diagram2 };
@@ -274531,7 +274537,7 @@ var detector5 = /* @__PURE__ */ __name((txt) => {
274531
274537
  }, "detector");
274532
274538
  var loader5 = /* @__PURE__ */ __name(async () => {
274533
274539
  const { diagram: diagram2 } = await __vitePreload(async () => {
274534
- const { diagram: diagram22 } = await import("./gitGraphDiagram-7IBYFJ6S-Cd11pFbi.js");
274540
+ const { diagram: diagram22 } = await import("./gitGraphDiagram-7IBYFJ6S-BC17Lxhk.js");
274535
274541
  return { diagram: diagram22 };
274536
274542
  }, true ? __vite__mapDeps([18,19,20,21,8,10,11,1,2]) : void 0, import.meta.url);
274537
274543
  return { id: id5, diagram: diagram2 };
@@ -274548,7 +274554,7 @@ var detector6 = /* @__PURE__ */ __name((txt) => {
274548
274554
  }, "detector");
274549
274555
  var loader6 = /* @__PURE__ */ __name(async () => {
274550
274556
  const { diagram: diagram2 } = await __vitePreload(async () => {
274551
- const { diagram: diagram22 } = await import("./ganttDiagram-APWFNJXF-BWG5VLyZ.js");
274557
+ const { diagram: diagram22 } = await import("./ganttDiagram-APWFNJXF-CifvAN8h.js");
274552
274558
  return { diagram: diagram22 };
274553
274559
  }, true ? __vite__mapDeps([22,1,2]) : void 0, import.meta.url);
274554
274560
  return { id: id6, diagram: diagram2 };
@@ -274565,7 +274571,7 @@ var detector7 = /* @__PURE__ */ __name((txt) => {
274565
274571
  }, "detector");
274566
274572
  var loader7 = /* @__PURE__ */ __name(async () => {
274567
274573
  const { diagram: diagram2 } = await __vitePreload(async () => {
274568
- const { diagram: diagram22 } = await import("./infoDiagram-PH2N3AL5-KjJg15gx.js");
274574
+ const { diagram: diagram22 } = await import("./infoDiagram-PH2N3AL5-Dsj1auFt.js");
274569
274575
  return { diagram: diagram22 };
274570
274576
  }, true ? __vite__mapDeps([23,21,8,10,11,1,2]) : void 0, import.meta.url);
274571
274577
  return { id: id7, diagram: diagram2 };
@@ -274581,7 +274587,7 @@ var detector8 = /* @__PURE__ */ __name((txt) => {
274581
274587
  }, "detector");
274582
274588
  var loader8 = /* @__PURE__ */ __name(async () => {
274583
274589
  const { diagram: diagram2 } = await __vitePreload(async () => {
274584
- const { diagram: diagram22 } = await import("./pieDiagram-IB7DONF6-C7Crt4gw.js");
274590
+ const { diagram: diagram22 } = await import("./pieDiagram-IB7DONF6-CZvzTYvc.js");
274585
274591
  return { diagram: diagram22 };
274586
274592
  }, true ? __vite__mapDeps([24,19,21,8,10,11,25,1,2]) : void 0, import.meta.url);
274587
274593
  return { id: id8, diagram: diagram2 };
@@ -274597,7 +274603,7 @@ var detector9 = /* @__PURE__ */ __name((txt) => {
274597
274603
  }, "detector");
274598
274604
  var loader9 = /* @__PURE__ */ __name(async () => {
274599
274605
  const { diagram: diagram2 } = await __vitePreload(async () => {
274600
- const { diagram: diagram22 } = await import("./quadrantDiagram-7GDLP6J5-BMbHGD_6.js");
274606
+ const { diagram: diagram22 } = await import("./quadrantDiagram-7GDLP6J5-CJSNfyeY.js");
274601
274607
  return { diagram: diagram22 };
274602
274608
  }, true ? __vite__mapDeps([26,1,2]) : void 0, import.meta.url);
274603
274609
  return { id: id9, diagram: diagram2 };
@@ -274614,7 +274620,7 @@ var detector10 = /* @__PURE__ */ __name((txt) => {
274614
274620
  }, "detector");
274615
274621
  var loader10 = /* @__PURE__ */ __name(async () => {
274616
274622
  const { diagram: diagram2 } = await __vitePreload(async () => {
274617
- const { diagram: diagram22 } = await import("./xychartDiagram-VJFVF3MP-DD0agc1N.js");
274623
+ const { diagram: diagram22 } = await import("./xychartDiagram-VJFVF3MP-Jn_L_tBu.js");
274618
274624
  return { diagram: diagram22 };
274619
274625
  }, true ? __vite__mapDeps([27,1,2]) : void 0, import.meta.url);
274620
274626
  return { id: id10, diagram: diagram2 };
@@ -274631,7 +274637,7 @@ var detector11 = /* @__PURE__ */ __name((txt) => {
274631
274637
  }, "detector");
274632
274638
  var loader11 = /* @__PURE__ */ __name(async () => {
274633
274639
  const { diagram: diagram2 } = await __vitePreload(async () => {
274634
- const { diagram: diagram22 } = await import("./requirementDiagram-KVF5MWMF-BumPivJk.js");
274640
+ const { diagram: diagram22 } = await import("./requirementDiagram-KVF5MWMF-BzJ8TKJn.js");
274635
274641
  return { diagram: diagram22 };
274636
274642
  }, true ? __vite__mapDeps([28,15,1,2]) : void 0, import.meta.url);
274637
274643
  return { id: id11, diagram: diagram2 };
@@ -274648,7 +274654,7 @@ var detector12 = /* @__PURE__ */ __name((txt) => {
274648
274654
  }, "detector");
274649
274655
  var loader12 = /* @__PURE__ */ __name(async () => {
274650
274656
  const { diagram: diagram2 } = await __vitePreload(async () => {
274651
- const { diagram: diagram22 } = await import("./sequenceDiagram-X6HHIX6F-CwnYTtil.js");
274657
+ const { diagram: diagram22 } = await import("./sequenceDiagram-X6HHIX6F-QlZcg6un.js");
274652
274658
  return { diagram: diagram22 };
274653
274659
  }, true ? __vite__mapDeps([29,13,20,1,2]) : void 0, import.meta.url);
274654
274660
  return { id: id12, diagram: diagram2 };
@@ -274668,7 +274674,7 @@ var detector13 = /* @__PURE__ */ __name((txt, config2) => {
274668
274674
  }, "detector");
274669
274675
  var loader13 = /* @__PURE__ */ __name(async () => {
274670
274676
  const { diagram: diagram2 } = await __vitePreload(async () => {
274671
- const { diagram: diagram22 } = await import("./classDiagram-GIVACNV2-CNcNWb-o.js");
274677
+ const { diagram: diagram22 } = await import("./classDiagram-GIVACNV2-BTb1dsm_.js");
274672
274678
  return { diagram: diagram22 };
274673
274679
  }, true ? __vite__mapDeps([30,31,15,1,2]) : void 0, import.meta.url);
274674
274680
  return { id: id13, diagram: diagram2 };
@@ -274688,7 +274694,7 @@ var detector14 = /* @__PURE__ */ __name((txt, config2) => {
274688
274694
  }, "detector");
274689
274695
  var loader14 = /* @__PURE__ */ __name(async () => {
274690
274696
  const { diagram: diagram2 } = await __vitePreload(async () => {
274691
- const { diagram: diagram22 } = await import("./classDiagram-v2-COTLJTTW-CNcNWb-o.js");
274697
+ const { diagram: diagram22 } = await import("./classDiagram-v2-COTLJTTW-BTb1dsm_.js");
274692
274698
  return { diagram: diagram22 };
274693
274699
  }, true ? __vite__mapDeps([32,31,15,1,2]) : void 0, import.meta.url);
274694
274700
  return { id: id14, diagram: diagram2 };
@@ -274708,7 +274714,7 @@ var detector15 = /* @__PURE__ */ __name((txt, config2) => {
274708
274714
  }, "detector");
274709
274715
  var loader15 = /* @__PURE__ */ __name(async () => {
274710
274716
  const { diagram: diagram2 } = await __vitePreload(async () => {
274711
- const { diagram: diagram22 } = await import("./stateDiagram-DGXRK772-4yXBR_vP.js");
274717
+ const { diagram: diagram22 } = await import("./stateDiagram-DGXRK772-lkNrTERo.js");
274712
274718
  return { diagram: diagram22 };
274713
274719
  }, true ? __vite__mapDeps([33,34,15,7,8,9,10,1,2]) : void 0, import.meta.url);
274714
274720
  return { id: id15, diagram: diagram2 };
@@ -274731,7 +274737,7 @@ var detector16 = /* @__PURE__ */ __name((txt, config2) => {
274731
274737
  }, "detector");
274732
274738
  var loader16 = /* @__PURE__ */ __name(async () => {
274733
274739
  const { diagram: diagram2 } = await __vitePreload(async () => {
274734
- const { diagram: diagram22 } = await import("./stateDiagram-v2-YXO3MK2T-6p7BdIAB.js");
274740
+ const { diagram: diagram22 } = await import("./stateDiagram-v2-YXO3MK2T-Cnlxf-OJ.js");
274735
274741
  return { diagram: diagram22 };
274736
274742
  }, true ? __vite__mapDeps([35,34,15,1,2]) : void 0, import.meta.url);
274737
274743
  return { id: id16, diagram: diagram2 };
@@ -274748,7 +274754,7 @@ var detector17 = /* @__PURE__ */ __name((txt) => {
274748
274754
  }, "detector");
274749
274755
  var loader17 = /* @__PURE__ */ __name(async () => {
274750
274756
  const { diagram: diagram2 } = await __vitePreload(async () => {
274751
- const { diagram: diagram22 } = await import("./journeyDiagram-U35MCT3I-Dp2FVK6h.js");
274757
+ const { diagram: diagram22 } = await import("./journeyDiagram-U35MCT3I-CBWci7yb.js");
274752
274758
  return { diagram: diagram22 };
274753
274759
  }, true ? __vite__mapDeps([36,13,25,1,2]) : void 0, import.meta.url);
274754
274760
  return { id: id17, diagram: diagram2 };
@@ -274818,7 +274824,7 @@ var detector18 = /* @__PURE__ */ __name((txt, config2 = {}) => {
274818
274824
  }, "detector");
274819
274825
  var loader18 = /* @__PURE__ */ __name(async () => {
274820
274826
  const { diagram: diagram2 } = await __vitePreload(async () => {
274821
- const { diagram: diagram22 } = await import("./flowDiagram-4HSFHLVR-tRJWBVYd.js");
274827
+ const { diagram: diagram22 } = await import("./flowDiagram-4HSFHLVR-CjBlaiPH.js");
274822
274828
  return { diagram: diagram22 };
274823
274829
  }, true ? __vite__mapDeps([14,15,16,1,2]) : void 0, import.meta.url);
274824
274830
  return { id: id18, diagram: diagram2 };
@@ -274835,7 +274841,7 @@ var detector19 = /* @__PURE__ */ __name((txt) => {
274835
274841
  }, "detector");
274836
274842
  var loader19 = /* @__PURE__ */ __name(async () => {
274837
274843
  const { diagram: diagram2 } = await __vitePreload(async () => {
274838
- const { diagram: diagram22 } = await import("./timeline-definition-BDJGKUSR-CCdgMyc-.js");
274844
+ const { diagram: diagram22 } = await import("./timeline-definition-BDJGKUSR-ClHwwcwA.js");
274839
274845
  return { diagram: diagram22 };
274840
274846
  }, true ? __vite__mapDeps([37,25,1,2]) : void 0, import.meta.url);
274841
274847
  return { id: id19, diagram: diagram2 };
@@ -274852,7 +274858,7 @@ var detector20 = /* @__PURE__ */ __name((txt) => {
274852
274858
  }, "detector");
274853
274859
  var loader20 = /* @__PURE__ */ __name(async () => {
274854
274860
  const { diagram: diagram2 } = await __vitePreload(async () => {
274855
- const { diagram: diagram22 } = await import("./mindmap-definition-ALO5MXBD-DiLxGufv.js");
274861
+ const { diagram: diagram22 } = await import("./mindmap-definition-ALO5MXBD-e-VrUTAA.js");
274856
274862
  return { diagram: diagram22 };
274857
274863
  }, true ? __vite__mapDeps([38,39,1,2]) : void 0, import.meta.url);
274858
274864
  return { id: id20, diagram: diagram2 };
@@ -274869,7 +274875,7 @@ var detector21 = /* @__PURE__ */ __name((txt) => {
274869
274875
  }, "detector");
274870
274876
  var loader21 = /* @__PURE__ */ __name(async () => {
274871
274877
  const { diagram: diagram2 } = await __vitePreload(async () => {
274872
- const { diagram: diagram22 } = await import("./kanban-definition-NDS4AKOZ-cttuutf_.js");
274878
+ const { diagram: diagram22 } = await import("./kanban-definition-NDS4AKOZ-BrBwgyJQ.js");
274873
274879
  return { diagram: diagram22 };
274874
274880
  }, true ? __vite__mapDeps([40,1,2]) : void 0, import.meta.url);
274875
274881
  return { id: id21, diagram: diagram2 };
@@ -274886,7 +274892,7 @@ var detector22 = /* @__PURE__ */ __name((txt) => {
274886
274892
  }, "detector");
274887
274893
  var loader22 = /* @__PURE__ */ __name(async () => {
274888
274894
  const { diagram: diagram2 } = await __vitePreload(async () => {
274889
- const { diagram: diagram22 } = await import("./sankeyDiagram-QLVOVGJD-D1LzUzj2.js");
274895
+ const { diagram: diagram22 } = await import("./sankeyDiagram-QLVOVGJD-C1MZHoLs.js");
274890
274896
  return { diagram: diagram22 };
274891
274897
  }, true ? __vite__mapDeps([41,1,2]) : void 0, import.meta.url);
274892
274898
  return { id: id22, diagram: diagram2 };
@@ -274903,7 +274909,7 @@ var detector23 = /* @__PURE__ */ __name((txt) => {
274903
274909
  }, "detector");
274904
274910
  var loader23 = /* @__PURE__ */ __name(async () => {
274905
274911
  const { diagram: diagram2 } = await __vitePreload(async () => {
274906
- const { diagram: diagram22 } = await import("./diagram-VNBRO52H-DUz0a2Uz.js");
274912
+ const { diagram: diagram22 } = await import("./diagram-VNBRO52H-CCeijHj7.js");
274907
274913
  return { diagram: diagram22 };
274908
274914
  }, true ? __vite__mapDeps([42,19,21,8,10,11,1,2]) : void 0, import.meta.url);
274909
274915
  return { id: id23, diagram: diagram2 };
@@ -274919,7 +274925,7 @@ var detector24 = /* @__PURE__ */ __name((txt) => {
274919
274925
  }, "detector");
274920
274926
  var loader24 = /* @__PURE__ */ __name(async () => {
274921
274927
  const { diagram: diagram2 } = await __vitePreload(async () => {
274922
- const { diagram: diagram22 } = await import("./diagram-SSKATNLV-DGVbLzJc.js");
274928
+ const { diagram: diagram22 } = await import("./diagram-SSKATNLV-BxlaHBtJ.js");
274923
274929
  return { diagram: diagram22 };
274924
274930
  }, true ? __vite__mapDeps([43,19,21,8,10,11,1,2]) : void 0, import.meta.url);
274925
274931
  return { id: id24, diagram: diagram2 };
@@ -274935,7 +274941,7 @@ var detector25 = /* @__PURE__ */ __name((txt) => {
274935
274941
  }, "detector");
274936
274942
  var loader25 = /* @__PURE__ */ __name(async () => {
274937
274943
  const { diagram: diagram2 } = await __vitePreload(async () => {
274938
- const { diagram: diagram22 } = await import("./blockDiagram-JOT3LUYC-DIjqxpHX.js");
274944
+ const { diagram: diagram22 } = await import("./blockDiagram-JOT3LUYC-CKjlYfeC.js");
274939
274945
  return { diagram: diagram22 };
274940
274946
  }, true ? __vite__mapDeps([44,11,8,7,16,1,2]) : void 0, import.meta.url);
274941
274947
  return { id: id25, diagram: diagram2 };
@@ -274952,7 +274958,7 @@ var detector26 = /* @__PURE__ */ __name((txt) => {
274952
274958
  }, "detector");
274953
274959
  var loader26 = /* @__PURE__ */ __name(async () => {
274954
274960
  const { diagram: diagram2 } = await __vitePreload(async () => {
274955
- const { diagram: diagram22 } = await import("./architectureDiagram-IEHRJDOE-0JBfW8n9.js");
274961
+ const { diagram: diagram22 } = await import("./architectureDiagram-IEHRJDOE-BE1k5yn0.js");
274956
274962
  return { diagram: diagram22 };
274957
274963
  }, true ? __vite__mapDeps([45,19,20,21,8,10,11,39,1,2]) : void 0, import.meta.url);
274958
274964
  return { id: id26, diagram: diagram2 };
@@ -314961,10 +314967,10 @@ const VideoAttachment = reactExports.memo(
314961
314967
  }
314962
314968
  );
314963
314969
  VideoAttachment.displayName = "VideoAttachment";
314964
- const isWebUrl$1 = (path2) => {
314970
+ const isWebUrl$2 = (path2) => {
314965
314971
  return path2.startsWith("http://") || path2.startsWith("https://");
314966
314972
  };
314967
- const isImage$1 = (path2) => {
314973
+ const isImage$2 = (path2) => {
314968
314974
  const imageExtensions = [
314969
314975
  ".jpg",
314970
314976
  ".jpeg",
@@ -314986,7 +314992,7 @@ const isImage$1 = (path2) => {
314986
314992
  const lowerPath = path2.toLowerCase();
314987
314993
  return imageExtensions.some((ext) => lowerPath.endsWith(ext));
314988
314994
  };
314989
- const isVideo$1 = (path2) => {
314995
+ const isVideo$2 = (path2) => {
314990
314996
  const videoExtensions = [
314991
314997
  ".mp4",
314992
314998
  ".webm",
@@ -315003,7 +315009,7 @@ const isVideo$1 = (path2) => {
315003
315009
  const lowerPath = path2.toLowerCase();
315004
315010
  return videoExtensions.some((ext) => lowerPath.endsWith(ext));
315005
315011
  };
315006
- const isAudio$1 = (path2) => {
315012
+ const isAudio$2 = (path2) => {
315007
315013
  const audioExtensions = [
315008
315014
  ".mp3",
315009
315015
  ".wav",
@@ -315016,18 +315022,18 @@ const isAudio$1 = (path2) => {
315016
315022
  const lowerPath = path2.toLowerCase();
315017
315023
  return audioExtensions.some((ext) => lowerPath.endsWith(ext));
315018
315024
  };
315019
- const getAttachmentUrl$1 = (client2, path2) => {
315025
+ const getAttachmentUrl$2 = (client2, path2) => {
315020
315026
  if (path2.startsWith("http")) {
315021
315027
  return path2;
315022
315028
  }
315023
315029
  const normalizedPath = path2.startsWith("file://") ? path2 : `file://${path2}`;
315024
- if (isImage$1(path2)) {
315030
+ if (isImage$2(path2)) {
315025
315031
  return client2.static.getImageUrl(normalizedPath);
315026
315032
  }
315027
- if (isVideo$1(path2)) {
315033
+ if (isVideo$2(path2)) {
315028
315034
  return client2.static.getVideoUrl(normalizedPath);
315029
315035
  }
315030
- if (isAudio$1(path2)) {
315036
+ if (isAudio$2(path2)) {
315031
315037
  return client2.static.getAudioUrl(normalizedPath);
315032
315038
  }
315033
315039
  return path2;
@@ -315068,12 +315074,12 @@ const ActionBlock = ({
315068
315074
  return createLocalOperatorClient(apiConfig.baseUrl);
315069
315075
  }, []);
315070
315076
  const getUrl2 = reactExports.useCallback(
315071
- (path2) => getAttachmentUrl$1(client2, path2),
315077
+ (path2) => getAttachmentUrl$2(client2, path2),
315072
315078
  [client2]
315073
315079
  );
315074
315080
  const handleFileClick = reactExports.useCallback((filePath2) => {
315075
315081
  try {
315076
- if (isWebUrl$1(filePath2)) {
315082
+ if (isWebUrl$2(filePath2)) {
315077
315083
  window.api.openExternal(filePath2);
315078
315084
  } else {
315079
315085
  const normalizedPath = filePath2.startsWith("file://") ? filePath2.substring(7) : filePath2;
@@ -315145,7 +315151,7 @@ const ActionBlock = ({
315145
315151
  ]
315146
315152
  }
315147
315153
  ),
315148
- files && files.length > 0 && !isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2, mt: 2 }, children: files.filter((file) => isImage$1(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
315154
+ files && files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2, mt: 2 }, children: files.filter((file) => isImage$2(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
315149
315155
  ImageAttachment,
315150
315156
  {
315151
315157
  file,
@@ -315155,7 +315161,7 @@ const ActionBlock = ({
315155
315161
  },
315156
315162
  `${file}`
315157
315163
  )) }),
315158
- files && files.length > 0 && !isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2 }, children: files.filter((file) => isVideo$1(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
315164
+ files && files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2 }, children: files.filter((file) => isVideo$2(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
315159
315165
  VideoAttachment,
315160
315166
  {
315161
315167
  file,
@@ -315165,7 +315171,7 @@ const ActionBlock = ({
315165
315171
  },
315166
315172
  `${file}`
315167
315173
  )) }),
315168
- files && files.length > 0 && !isLoading && files.some((file) => isAudio$1(file)) && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2 }, children: files.filter((file) => isAudio$1(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
315174
+ files && files.length > 0 && files.some((file) => isAudio$2(file)) && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2 }, children: files.filter((file) => isAudio$2(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
315169
315175
  AudioAttachment,
315170
315176
  {
315171
315177
  content: getUrl2(file),
@@ -315173,8 +315179,8 @@ const ActionBlock = ({
315173
315179
  },
315174
315180
  `${file}`
315175
315181
  )) }),
315176
- files && files.length > 0 && !isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mt: 2 }, children: files.filter(
315177
- (file) => !isImage$1(file) && !isVideo$1(file) && !isAudio$1(file)
315182
+ files && files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mt: 2 }, children: files.filter(
315183
+ (file) => !isImage$2(file) && !isVideo$2(file) && !isAudio$2(file)
315178
315184
  ).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
315179
315185
  FileAttachment,
315180
315186
  {
@@ -315504,6 +315510,67 @@ const MessageTimestamp = ({
315504
315510
  }
315505
315511
  );
315506
315512
  };
315513
+ const isWebUrl$1 = (path2) => path2.startsWith("http://") || path2.startsWith("https://");
315514
+ const isImage$1 = (path2) => {
315515
+ const imageExtensions = [
315516
+ ".jpg",
315517
+ ".jpeg",
315518
+ ".png",
315519
+ ".gif",
315520
+ ".webp",
315521
+ ".bmp",
315522
+ ".svg",
315523
+ ".tiff",
315524
+ ".tif",
315525
+ ".ico",
315526
+ ".heic",
315527
+ ".heif",
315528
+ ".avif",
315529
+ ".jfif",
315530
+ ".pjpeg",
315531
+ ".pjp"
315532
+ ];
315533
+ const lowerPath = path2.toLowerCase();
315534
+ return imageExtensions.some((ext) => lowerPath.endsWith(ext));
315535
+ };
315536
+ const isVideo$1 = (path2) => {
315537
+ const videoExtensions = [
315538
+ ".mp4",
315539
+ ".webm",
315540
+ ".ogg",
315541
+ ".mov",
315542
+ ".avi",
315543
+ ".wmv",
315544
+ ".flv",
315545
+ ".mkv",
315546
+ ".m4v",
315547
+ ".3gp",
315548
+ ".3g2"
315549
+ ];
315550
+ const lowerPath = path2.toLowerCase();
315551
+ return videoExtensions.some((ext) => lowerPath.endsWith(ext));
315552
+ };
315553
+ const isAudio$1 = (path2) => {
315554
+ const audioExtensions = [
315555
+ ".mp3",
315556
+ ".wav",
315557
+ ".ogg",
315558
+ ".aac",
315559
+ ".flac",
315560
+ ".m4a",
315561
+ ".aiff"
315562
+ ];
315563
+ const lowerPath = path2.toLowerCase();
315564
+ return audioExtensions.some((ext) => lowerPath.endsWith(ext));
315565
+ };
315566
+ const getAttachmentUrl$1 = (client2, path2) => {
315567
+ if (path2.startsWith("http")) return path2;
315568
+ const normalizedPath = path2.startsWith("file://") ? path2 : `file://${path2}`;
315569
+ if (isImage$1(path2)) return client2.static.getImageUrl(normalizedPath);
315570
+ if (isVideo$1(path2)) return client2.static.getVideoUrl(normalizedPath);
315571
+ if (isAudio$1(path2)) return client2.static.getAudioUrl(normalizedPath);
315572
+ return path2;
315573
+ };
315507
315574
  const StreamingContainer = styled$1(Box)(() => ({
315508
315575
  position: "relative",
315509
315576
  overflow: "hidden",
@@ -315543,12 +315610,23 @@ const StreamingMessage = ({
315543
315610
  const isStoreMessageComplete = isMessageStreamingComplete(messageId);
315544
315611
  const handleComplete = reactExports.useCallback(
315545
315612
  (completedMessage) => {
315546
- if (onComplete) {
315547
- onComplete(completedMessage);
315548
- }
315613
+ setTimeout(() => {
315614
+ if (onComplete) {
315615
+ onComplete(completedMessage);
315616
+ }
315617
+ }, 50);
315549
315618
  },
315550
315619
  [onComplete]
315551
315620
  );
315621
+ reactExports.useEffect(() => {
315622
+ if (isStoreMessageComplete && storeMessage?.content && onComplete) {
315623
+ const timer2 = setTimeout(() => {
315624
+ onComplete(storeMessage.content);
315625
+ }, 50);
315626
+ return () => clearTimeout(timer2);
315627
+ }
315628
+ return void 0;
315629
+ }, [isStoreMessageComplete, storeMessage, onComplete]);
315552
315630
  const {
315553
315631
  message: wsMessage,
315554
315632
  isStreamable,
@@ -315621,18 +315699,46 @@ const StreamingMessage = ({
315621
315699
  () => status === "connected" && !isStoreMessageComplete,
315622
315700
  [status, isStoreMessageComplete]
315623
315701
  );
315702
+ const shouldShowStreaming = reactExports.useMemo(() => {
315703
+ return status === "connected" && !isStoreMessageComplete;
315704
+ }, [status, isStoreMessageComplete]);
315705
+ const hasCalledOnCompleteRef = reactExports.useRef(false);
315706
+ reactExports.useEffect(() => {
315707
+ if (!shouldShowStreaming && storeMessage?.content && onComplete && !hasCalledOnCompleteRef.current) {
315708
+ hasCalledOnCompleteRef.current = true;
315709
+ const timer2 = setTimeout(() => {
315710
+ onComplete(storeMessage.content);
315711
+ }, 50);
315712
+ return () => clearTimeout(timer2);
315713
+ }
315714
+ return void 0;
315715
+ }, [shouldShowStreaming, storeMessage, onComplete]);
315716
+ reactExports.useEffect(() => {
315717
+ hasCalledOnCompleteRef.current = false;
315718
+ }, []);
315719
+ reactExports.useEffect(() => {
315720
+ return () => {
315721
+ if (hasCalledOnCompleteRef.current) {
315722
+ hasCalledOnCompleteRef.current = false;
315723
+ }
315724
+ };
315725
+ }, []);
315624
315726
  const lastValidMessageRef = reactExports.useRef(null);
315625
315727
  const message2 = reactExports.useMemo(() => {
315626
- if (isActivelyStreaming && wsMessage) {
315728
+ if (wsMessage) {
315627
315729
  lastValidMessageRef.current = wsMessage;
315628
315730
  return wsMessage;
315629
315731
  }
315630
- const result = storeMessage?.content || wsMessage || lastValidMessageRef.current;
315631
- if (result) {
315632
- lastValidMessageRef.current = result;
315732
+ if (isStoreMessageComplete && storeMessage?.content) {
315733
+ lastValidMessageRef.current = storeMessage.content;
315734
+ return storeMessage.content;
315633
315735
  }
315634
- return result;
315635
- }, [isActivelyStreaming, wsMessage, storeMessage]);
315736
+ if (storeMessage?.content) {
315737
+ lastValidMessageRef.current = storeMessage.content;
315738
+ return storeMessage.content;
315739
+ }
315740
+ return lastValidMessageRef.current || null;
315741
+ }, [wsMessage, storeMessage, isStoreMessageComplete]);
315636
315742
  const connectionControls = reactExports.useMemo(
315637
315743
  () => ({
315638
315744
  connect,
@@ -315776,6 +315882,29 @@ const StreamingMessage = ({
315776
315882
  message2?.execution_type === "action" && message2?.action
315777
315883
  );
315778
315884
  const fileLanguage = getLanguageFromExtension(message2?.file_path || "");
315885
+ const client2 = reactExports.useMemo(
315886
+ () => createLocalOperatorClient(apiConfig.baseUrl),
315887
+ []
315888
+ );
315889
+ const getUrl2 = reactExports.useCallback(
315890
+ (path2) => getAttachmentUrl$1(client2, path2),
315891
+ [client2]
315892
+ );
315893
+ const handleFileClick = reactExports.useCallback(async (filePath) => {
315894
+ try {
315895
+ if (isWebUrl$1(filePath)) {
315896
+ await window.api.openExternal(filePath);
315897
+ } else {
315898
+ const normalizedPath = filePath.startsWith("file://") ? filePath.substring(7) : filePath;
315899
+ await window.api.openFile(normalizedPath);
315900
+ }
315901
+ } catch (error2) {
315902
+ console.error("Error opening file:", error2);
315903
+ alert(
315904
+ `Unable to open file: ${filePath}. The file may be incomplete, deleted, or moved.`
315905
+ );
315906
+ }
315907
+ }, []);
315779
315908
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
315780
315909
  StreamingContainer,
315781
315910
  {
@@ -315843,6 +315972,45 @@ const StreamingMessage = ({
315843
315972
  ]
315844
315973
  }
315845
315974
  ),
315975
+ message2?.files && message2.files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2, mt: 2 }, children: message2.files.filter((file) => isImage$1(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
315976
+ ImageAttachment,
315977
+ {
315978
+ file,
315979
+ src: getUrl2(file),
315980
+ onClick: handleFileClick,
315981
+ conversationId: conversationId ?? ""
315982
+ },
315983
+ `${messageId}-${file}`
315984
+ )) }),
315985
+ message2?.files && message2.files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2 }, children: message2.files.filter((file) => isVideo$1(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
315986
+ VideoAttachment,
315987
+ {
315988
+ file,
315989
+ src: getUrl2(file),
315990
+ onClick: handleFileClick,
315991
+ conversationId: conversationId ?? ""
315992
+ },
315993
+ `${messageId}-${file}`
315994
+ )) }),
315995
+ message2?.files && message2.files.length > 0 && message2.files.some((file) => isAudio$1(file)) && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2 }, children: message2.files.filter((file) => isAudio$1(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
315996
+ AudioAttachment,
315997
+ {
315998
+ content: getUrl2(file),
315999
+ isUser: false
316000
+ },
316001
+ `${messageId}-${file}`
316002
+ )) }),
316003
+ message2?.files && message2.files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mt: 2 }, children: message2.files.filter(
316004
+ (file) => !isImage$1(file) && !isVideo$1(file) && !isAudio$1(file)
316005
+ ).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
316006
+ FileAttachment,
316007
+ {
316008
+ file,
316009
+ onClick: handleFileClick,
316010
+ conversationId: conversationId ?? ""
316011
+ },
316012
+ `${messageId}-${file}`
316013
+ )) }),
315846
316014
  errorDisplay,
315847
316015
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: scrollRef, style: { height: 1, width: 1, opacity: 0 } })
315848
316016
  ]
@@ -315956,6 +316124,39 @@ const MessagePaper = React$1.memo(
315956
316124
  () => message2?.is_streamable === true && message2?.is_complete === false && !isUser,
315957
316125
  [message2?.is_streamable, message2?.is_complete, isUser]
315958
316126
  );
316127
+ const { isMessageStreamingComplete } = useStreamingMessagesStore();
316128
+ const isStreamingActuallyComplete = reactExports.useMemo(() => {
316129
+ if (!message2?.id) return true;
316130
+ return isMessageStreamingComplete(message2.id);
316131
+ }, [message2?.id, isMessageStreamingComplete]);
316132
+ const shouldShowStreaming = reactExports.useMemo(() => {
316133
+ if (!isStreamable) return false;
316134
+ if (isStreamingActuallyComplete) return false;
316135
+ return isJobRunning;
316136
+ }, [isStreamable, isStreamingActuallyComplete, isJobRunning]);
316137
+ const hasHandledCompletionRef = reactExports.useRef(false);
316138
+ reactExports.useEffect(() => {
316139
+ if (!shouldShowStreaming && message2 && !hasHandledCompletionRef.current) {
316140
+ hasHandledCompletionRef.current = true;
316141
+ const timer2 = setTimeout(() => {
316142
+ if (onMessageComplete) {
316143
+ onMessageComplete();
316144
+ }
316145
+ }, 50);
316146
+ return () => clearTimeout(timer2);
316147
+ }
316148
+ return void 0;
316149
+ }, [shouldShowStreaming, message2, onMessageComplete]);
316150
+ reactExports.useEffect(() => {
316151
+ hasHandledCompletionRef.current = false;
316152
+ }, []);
316153
+ reactExports.useEffect(() => {
316154
+ return () => {
316155
+ if (hasHandledCompletionRef.current) {
316156
+ hasHandledCompletionRef.current = false;
316157
+ }
316158
+ };
316159
+ }, []);
315959
316160
  const messageStyles = reactExports.useMemo(
315960
316161
  () => ({
315961
316162
  borderRadius: 2,
@@ -315977,7 +316178,7 @@ const MessagePaper = React$1.memo(
315977
316178
  const isNearBottom = !isFarFromBottom;
315978
316179
  const shouldAutoScrollRef = reactExports.useRef(true);
315979
316180
  reactExports.useEffect(() => {
315980
- if (!isLastMessage || !isStreamable || !message2) return;
316181
+ if (!isLastMessage || !shouldShowStreaming || !message2) return;
315981
316182
  shouldAutoScrollRef.current = isNearBottom;
315982
316183
  const scrollInterval = setInterval(() => {
315983
316184
  if (shouldAutoScrollRef.current) {
@@ -315987,12 +316188,18 @@ const MessagePaper = React$1.memo(
315987
316188
  return () => {
315988
316189
  clearInterval(scrollInterval);
315989
316190
  };
315990
- }, [isStreamable, message2, scrollToBottom, isNearBottom, isLastMessage]);
316191
+ }, [
316192
+ shouldShowStreaming,
316193
+ message2,
316194
+ scrollToBottom,
316195
+ isNearBottom,
316196
+ isLastMessage
316197
+ ]);
315991
316198
  reactExports.useEffect(() => {
315992
316199
  shouldAutoScrollRef.current = isNearBottom;
315993
316200
  }, [isNearBottom]);
315994
316201
  const streamingMessageComponent = reactExports.useMemo(() => {
315995
- if (!isStreamable || !message2 || !isJobRunning) return null;
316202
+ if (!shouldShowStreaming || !message2) return null;
315996
316203
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
315997
316204
  StreamingMessage,
315998
316205
  {
@@ -316012,11 +316219,10 @@ const MessagePaper = React$1.memo(
316012
316219
  }
316013
316220
  );
316014
316221
  }, [
316015
- isStreamable,
316222
+ shouldShowStreaming,
316016
316223
  message2,
316017
316224
  messageStyles,
316018
316225
  onMessageComplete,
316019
- isJobRunning,
316020
316226
  markdownStyleProps
316021
316227
  ]);
316022
316228
  const [isThinkingExpanded, setIsThinkingExpanded] = reactExports.useState(false);
@@ -316029,7 +316235,7 @@ const MessagePaper = React$1.memo(
316029
316235
  setIsThinkingExpanded(false);
316030
316236
  }, []);
316031
316237
  const regularMessageComponents = reactExports.useMemo(() => {
316032
- if (isStreamable && isJobRunning || !message2) return null;
316238
+ if (shouldShowStreaming || !message2) return null;
316033
316239
  const childrenWithRemainingContent = React$1.Children.map(
316034
316240
  children2,
316035
316241
  (child) => {
@@ -316068,12 +316274,11 @@ const MessagePaper = React$1.memo(
316068
316274
  )
316069
316275
  ] });
316070
316276
  }, [
316071
- isStreamable,
316277
+ shouldShowStreaming,
316278
+ message2,
316072
316279
  messageStyles,
316073
316280
  children2,
316074
- message2,
316075
316281
  isUser,
316076
- isJobRunning,
316077
316282
  isThinkingExpanded,
316078
316283
  handleThinkingExpand,
316079
316284
  handleThinkingCollapse,
@@ -316081,7 +316286,7 @@ const MessagePaper = React$1.memo(
316081
316286
  replies,
316082
316287
  remainingContent,
316083
316288
  markdownStyleProps
316084
- ]);
316289
+ ]) || null;
316085
316290
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
316086
316291
  Box,
316087
316292
  {
@@ -316313,7 +316518,8 @@ const MessageItem = reactExports.memo(
316313
316518
  }
316314
316519
  }, []);
316315
316520
  const isMessageContentEmpty = !message2.message && (!message2.files || message2.files.length === 0) && !message2.code && !message2.stdout && !message2.stderr && !message2.logging;
316316
- const shouldHide = (message2.action === "DONE" || message2.action === "ASK") && message2.execution_type === "action" && message2.task_classification === "conversation" || isMessageContentEmpty && message2.is_complete || message2.is_streamable && !message2.is_complete && isMessageContentEmpty && !currentExecution;
316521
+ const isActionish = message2.execution_type === "action" || message2.execution_type === "reflection" || message2.execution_type === "security_check";
316522
+ const shouldHide = (message2.action === "DONE" || message2.action === "ASK") && message2.execution_type === "action" && message2.task_classification === "conversation" || isMessageContentEmpty && message2.is_complete && !isActionish;
316317
316523
  if (shouldHide) {
316318
316524
  return null;
316319
316525
  }
@@ -316636,12 +316842,27 @@ const MessagesView = React$1.memo(
316636
316842
  isSmallView
316637
316843
  }) => {
316638
316844
  const collapsed = messages.length === 0 && !isLoadingMessages && !isFetchingMore;
316639
- const lastMessageIsStreaming = messages[messages.length - 1]?.is_streamable && !messages[messages.length - 1]?.is_complete;
316845
+ const lastMessage = messages[messages.length - 1];
316846
+ const { isMessageStreamingComplete } = useStreamingMessagesStore();
316847
+ const lastStreamComplete = lastMessage?.id ? isMessageStreamingComplete(lastMessage.id) : false;
316848
+ const lastMessageIsStreaming = Boolean(
316849
+ lastMessage?.is_streamable && !(lastMessage?.is_complete || lastStreamComplete)
316850
+ );
316640
316851
  const handleMessageComplete = reactExports.useCallback(() => {
316641
- if (refetch) {
316642
- refetch();
316643
- }
316852
+ setTimeout(() => {
316853
+ if (refetch) {
316854
+ refetch();
316855
+ }
316856
+ }, 200);
316644
316857
  }, [refetch]);
316858
+ reactExports.useEffect(() => {
316859
+ if (messages.length > 0) {
316860
+ const lastMessage2 = messages[messages.length - 1];
316861
+ if (lastMessage2?.is_complete && lastMessage2?.is_streamable) {
316862
+ console.debug("Last message completed:", lastMessage2.id);
316863
+ }
316864
+ }
316865
+ }, [messages]);
316645
316866
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(MessagesViewWrapper, { collapsed, children: [
316646
316867
  isFetchingMore && /* @__PURE__ */ jsxRuntimeExports.jsxs(LoadingMoreIndicator, { isSmallView, children: [
316647
316868
  /* @__PURE__ */ jsxRuntimeExports.jsx(CircularProgress, { size: 16, sx: { mr: 1 } }),
@@ -317720,7 +317941,9 @@ const ChatPage = () => {
317720
317941
  files: attachments.length > 0 ? attachments : void 0
317721
317942
  };
317722
317943
  addMessage(conversationId, userMessage);
317723
- scrollToBottom();
317944
+ requestAnimationFrame(() => {
317945
+ scrollToBottom();
317946
+ });
317724
317947
  setIsLoading(true);
317725
317948
  try {
317726
317949
  const options = {