local-operator-ui 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/out/main/index.jsc +0 -0
- package/out/preload/index.jsc +0 -0
- package/out/renderer/assets/{error-boundary-GcWSKAk-.js → error-boundary-HK_94N6W.js} +95 -125
- package/out/renderer/assets/{index-BZlgXU2r.js → index-mDCtISs5.js} +986 -532
- package/out/renderer/assets/{installer-BobUZ6f3.js → installer-XvyKuNSZ.js} +1 -1
- package/out/renderer/index.html +2 -2
- package/out/renderer/installer.html +2 -2
- package/package.json +6 -4
|
@@ -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 getDefaultExportFromCjs, k as requireReactDom, R as React, l as generateUtilityClasses, m as useDefaultProps, s as styled$1, n as memoTheme, _ as _inheritsLoose, o as _objectWithoutPropertiesLoose$1, p as React$1, T as TransitionGroupContext, q as duration, t as useTheme$1, v as useTimeout, w as useId, B as ButtonBase, x as alpha, y as createSimplePaletteValueFilter, C as CircularProgress, P as Paper, z as darken, A as lighten, D as useEventCallback, E as setRef, F as useEnhancedEffect, G as useRtl, H as globalCss, I as formatMuiErrorMessage, J as rootShouldForwardProp, K as Typography, L as deepmerge, M as extendSxProp, N as resolveBreakpointValues, O as handleBreakpoints, Q as getPath, S as isFocusVisible, U as typographyClasses, V as slotShouldForwardProp, W as clamp, X as emphasize, Y as Timeout, Z as requireReact, $ as LinearProgress, a0 as Button, a1 as Box, a2 as FontAwesomeIcon, a3 as faRobot, a4 as faSliders, a5 as faExclamationTriangle, a6 as faCheck, a7 as faTimes, a8 as faEraser, a9 as faPen, aa as faInfoCircle, ab as faGear, ac as faServer, ad as faStar, ae as faTrash, af as
|
|
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 getDefaultExportFromCjs, k as requireReactDom, R as React, l as generateUtilityClasses, m as useDefaultProps, s as styled$1, n as memoTheme, _ as _inheritsLoose, o as _objectWithoutPropertiesLoose$1, p as React$1, T as TransitionGroupContext, q as duration, t as useTheme$1, v as useTimeout, w as useId, B as ButtonBase, x as alpha, y as createSimplePaletteValueFilter, C as CircularProgress, P as Paper, z as darken, A as lighten, D as useEventCallback, E as setRef, F as useEnhancedEffect, G as useRtl, H as globalCss, I as formatMuiErrorMessage, J as rootShouldForwardProp, K as Typography, L as deepmerge, M as extendSxProp, N as resolveBreakpointValues, O as handleBreakpoints, Q as getPath, S as isFocusVisible, U as typographyClasses, V as slotShouldForwardProp, W as clamp, X as emphasize, Y as Timeout, Z as requireReact, $ as LinearProgress, a0 as Button, a1 as Box, a2 as FontAwesomeIcon, a3 as faRobot, a4 as faSliders, a5 as faExclamationTriangle, a6 as faCheck, a7 as faTimes, a8 as faEraser, a9 as faPen, aa as faInfoCircle, ab as faGear, ac as faServer, ad as faStar, ae as faTrash, 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 faFile, aI as faLightbulb, aJ as faCode, aK as faCommentDots, aL as faEdit, aM as faPencilAlt, aN as faChevronRight, aO as faUser, aP as faCopy, aQ as isDevelopmentMode, aR as faEllipsisVertical, aS as faComment, aT as faFileExport, aU as faChevronLeft, aV as faFileImport, aW as faUpload, aX as faPlus, aY as faSearch, aZ as faCommentSlash, a_ as faArrowRight, a$ as faComments, b0 as faTag, b1 as faIdCard, b2 as faCalendarAlt, b3 as faCodeBranch, b4 as faShieldAlt, b5 as faArrowLeft, b6 as faShield, b7 as faSignOut, b8 as darkTheme, b9 as lightTheme, ba as draculaTheme, bb as sageTheme, bc as monokaiTheme, bd as tokyoNightTheme, be as duneTheme, bf as icebergTheme, bg as faMagicWandSparkles, bh as faBrain, bi as faWandMagicSparkles, bj as faExternalLinkAlt, bk as faKey, bl as faGlobe, bm as faLock, bn as faAdjust, bo as faSave, bp as faMoon, bq as faSun, br as faSkull, bs as faLeaf, bt as faMountain, bu as faFire, bv as faIcicles, bw as faEnvelope, bx as faCloudUploadAlt, by as faHistory, bz as faListAlt, bA as library$1, bB as icons$1, bC as CssBaseline, bD as ThemeProvider$1, bE as ReactDOM$1, bF as ErrorBoundary } from "./error-boundary-HK_94N6W.js";
|
|
2
2
|
const styled = createStyled();
|
|
3
3
|
function getThemeProps(params) {
|
|
4
4
|
const {
|
|
@@ -46600,7 +46600,7 @@ const ChatOptionsSidebar = ({
|
|
|
46600
46600
|
}
|
|
46601
46601
|
);
|
|
46602
46602
|
};
|
|
46603
|
-
|
|
46603
|
+
styled$1(Tabs)(({ theme }) => ({
|
|
46604
46604
|
borderBottom: `1px solid ${alpha(theme.palette.divider, 0.05)}`,
|
|
46605
46605
|
minHeight: "42px",
|
|
46606
46606
|
"& .MuiTabs-indicator": {
|
|
@@ -46608,7 +46608,7 @@ const StyledTabs = styled$1(Tabs)(({ theme }) => ({
|
|
|
46608
46608
|
borderRadius: "2px 2px 0 0"
|
|
46609
46609
|
}
|
|
46610
46610
|
}));
|
|
46611
|
-
|
|
46611
|
+
styled$1(Tab, {
|
|
46612
46612
|
shouldForwardProp: (prop) => prop !== "isActive"
|
|
46613
46613
|
})(({ theme, isActive }) => ({
|
|
46614
46614
|
minHeight: "42px",
|
|
@@ -46630,43 +46630,6 @@ const StyledTab = styled$1(Tab, {
|
|
|
46630
46630
|
fontSize: "0.9rem"
|
|
46631
46631
|
}
|
|
46632
46632
|
}));
|
|
46633
|
-
const ChatTabs = ({ activeTab, onChange }) => {
|
|
46634
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
46635
|
-
StyledTabs,
|
|
46636
|
-
{
|
|
46637
|
-
value: activeTab,
|
|
46638
|
-
onChange: (_2, newValue) => onChange(newValue),
|
|
46639
|
-
variant: "fullWidth",
|
|
46640
|
-
TabIndicatorProps: {
|
|
46641
|
-
style: {
|
|
46642
|
-
transition: "all 0.3s ease"
|
|
46643
|
-
}
|
|
46644
|
-
},
|
|
46645
|
-
children: [
|
|
46646
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
46647
|
-
StyledTab,
|
|
46648
|
-
{
|
|
46649
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faCommentDots }),
|
|
46650
|
-
iconPosition: "start",
|
|
46651
|
-
label: "Chat",
|
|
46652
|
-
value: "chat",
|
|
46653
|
-
isActive: activeTab === "chat"
|
|
46654
|
-
}
|
|
46655
|
-
),
|
|
46656
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
46657
|
-
StyledTab,
|
|
46658
|
-
{
|
|
46659
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faCode }),
|
|
46660
|
-
iconPosition: "start",
|
|
46661
|
-
label: "Raw",
|
|
46662
|
-
value: "raw",
|
|
46663
|
-
isActive: activeTab === "raw"
|
|
46664
|
-
}
|
|
46665
|
-
)
|
|
46666
|
-
]
|
|
46667
|
-
}
|
|
46668
|
-
);
|
|
46669
|
-
};
|
|
46670
46633
|
const MAX_RECENT_DIRECTORIES = 5;
|
|
46671
46634
|
const useRecentDirectoriesStore = create$1()(
|
|
46672
46635
|
persist(
|
|
@@ -85377,26 +85340,12 @@ const LoadingIndicator = ({ status, currentExecution, scrollToBottom }) => {
|
|
|
85377
85340
|
};
|
|
85378
85341
|
const HighlightContainer$1 = styled$1(Box, {
|
|
85379
85342
|
shouldForwardProp: (prop) => prop !== "action" && prop !== "isUser"
|
|
85380
|
-
})((
|
|
85381
|
-
|
|
85382
|
-
padding: "16px",
|
|
85383
|
-
borderRadius: "8px",
|
|
85384
|
-
marginBottom: "16px",
|
|
85385
|
-
boxShadow: `0 4px 12px ${alpha(theme.palette.common.black, theme.palette.mode === "dark" ? 0.15 : 0.1)}`,
|
|
85386
|
-
width: "100%",
|
|
85387
|
-
border: `1px solid ${action === "DONE" ? theme.palette.actionHighlight.done.border : theme.palette.actionHighlight.ask.border}`,
|
|
85388
|
-
backgroundColor: action === "DONE" ? theme.palette.actionHighlight.done.background : theme.palette.actionHighlight.ask.background,
|
|
85389
|
-
transition: "all 0.2s ease",
|
|
85390
|
-
"&:hover": {
|
|
85391
|
-
boxShadow: `0 6px 16px ${alpha(theme.palette.common.black, theme.palette.mode === "dark" ? 0.2 : 0.15)}`
|
|
85392
|
-
}
|
|
85343
|
+
})(() => ({
|
|
85344
|
+
marginBottom: "16px"
|
|
85393
85345
|
}));
|
|
85394
|
-
const ActionBadge = styled$1(Box, {
|
|
85346
|
+
const ActionBadge$1 = styled$1(Box, {
|
|
85395
85347
|
shouldForwardProp: (prop) => prop !== "action"
|
|
85396
85348
|
})(({ theme, action }) => ({
|
|
85397
|
-
position: "absolute",
|
|
85398
|
-
top: "-10px",
|
|
85399
|
-
right: "16px",
|
|
85400
85349
|
padding: "4px 8px",
|
|
85401
85350
|
borderRadius: "12px",
|
|
85402
85351
|
fontSize: "0.7rem",
|
|
@@ -85405,8 +85354,15 @@ const ActionBadge = styled$1(Box, {
|
|
|
85405
85354
|
color: "#fff",
|
|
85406
85355
|
display: "flex",
|
|
85407
85356
|
alignItems: "center",
|
|
85357
|
+
justifyContent: "flex-end",
|
|
85408
85358
|
gap: "4px",
|
|
85409
|
-
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.2)"
|
|
85359
|
+
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.2)",
|
|
85360
|
+
marginBottom: "8px",
|
|
85361
|
+
// Add space between badge and content
|
|
85362
|
+
alignSelf: "flex-end",
|
|
85363
|
+
// Align to the right
|
|
85364
|
+
width: "fit-content"
|
|
85365
|
+
// Only take up as much width as needed
|
|
85410
85366
|
}));
|
|
85411
85367
|
const ActionHighlight = ({
|
|
85412
85368
|
children,
|
|
@@ -85420,7 +85376,7 @@ const ActionHighlight = ({
|
|
|
85420
85376
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children });
|
|
85421
85377
|
}
|
|
85422
85378
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(HighlightContainer$1, { action, isUser, children: [
|
|
85423
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(ActionBadge, { action, children: [
|
|
85379
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(ActionBadge$1, { action, children: [
|
|
85424
85380
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
85425
85381
|
FontAwesomeIcon,
|
|
85426
85382
|
{
|
|
@@ -104358,127 +104314,6 @@ const MarkdownRenderer = reactExports.memo(
|
|
|
104358
104314
|
) });
|
|
104359
104315
|
}
|
|
104360
104316
|
);
|
|
104361
|
-
const BlockContainer = styled$1(Box)(() => ({
|
|
104362
|
-
width: "95%",
|
|
104363
|
-
cursor: "pointer",
|
|
104364
|
-
transition: "all 0.2s ease",
|
|
104365
|
-
marginLeft: 56,
|
|
104366
|
-
"&:hover": {
|
|
104367
|
-
opacity: 0.9
|
|
104368
|
-
}
|
|
104369
|
-
}));
|
|
104370
|
-
const BlockHeader = styled$1(Box, {
|
|
104371
|
-
shouldForwardProp: (prop) => prop !== "executionType" && prop !== "isUser"
|
|
104372
|
-
})(({ theme }) => ({
|
|
104373
|
-
display: "flex",
|
|
104374
|
-
alignItems: "center",
|
|
104375
|
-
padding: "8px 12px",
|
|
104376
|
-
backgroundColor: alpha(
|
|
104377
|
-
theme.palette.common.black,
|
|
104378
|
-
theme.palette.mode === "dark" ? 0.2 : 0.05
|
|
104379
|
-
),
|
|
104380
|
-
borderLeft: `3px solid ${theme.palette.grey[theme.palette.mode === "dark" ? 600 : 400]}`
|
|
104381
|
-
}));
|
|
104382
|
-
const BlockIcon = styled$1(Box)(({ theme }) => ({
|
|
104383
|
-
marginRight: 8,
|
|
104384
|
-
display: "flex",
|
|
104385
|
-
alignItems: "center",
|
|
104386
|
-
justifyContent: "flex-start",
|
|
104387
|
-
color: theme.palette.icon.text
|
|
104388
|
-
}));
|
|
104389
|
-
const BlockTitle = styled$1(Typography)(({ theme }) => ({
|
|
104390
|
-
fontWeight: 500,
|
|
104391
|
-
fontSize: "0.85rem",
|
|
104392
|
-
color: theme.palette.text.secondary
|
|
104393
|
-
}));
|
|
104394
|
-
const BlockContent = styled$1(Box)(({ theme }) => ({
|
|
104395
|
-
fontSize: "0.85rem",
|
|
104396
|
-
color: theme.palette.text.secondary,
|
|
104397
|
-
overflow: "hidden",
|
|
104398
|
-
textOverflow: "ellipsis",
|
|
104399
|
-
marginTop: 2
|
|
104400
|
-
}));
|
|
104401
|
-
const ExpandedContent = styled$1(Box)(({ theme }) => ({
|
|
104402
|
-
padding: "12px 16px",
|
|
104403
|
-
backgroundColor: alpha(
|
|
104404
|
-
theme.palette.common.black,
|
|
104405
|
-
theme.palette.mode === "dark" ? 0.2 : 0.05
|
|
104406
|
-
),
|
|
104407
|
-
borderBottomLeftRadius: 4,
|
|
104408
|
-
borderBottomRightRadius: 4,
|
|
104409
|
-
fontSize: "0.85rem",
|
|
104410
|
-
color: theme.palette.text.primary,
|
|
104411
|
-
borderLeft: `3px solid ${theme.palette.grey[theme.palette.mode === "dark" ? 600 : 400]}`,
|
|
104412
|
-
marginLeft: 0
|
|
104413
|
-
}));
|
|
104414
|
-
const BackgroundBlock = ({
|
|
104415
|
-
content: content2,
|
|
104416
|
-
action,
|
|
104417
|
-
executionType,
|
|
104418
|
-
isUser
|
|
104419
|
-
}) => {
|
|
104420
|
-
const [isExpanded, setIsExpanded] = reactExports.useState(false);
|
|
104421
|
-
const toggleExpand = () => {
|
|
104422
|
-
setIsExpanded(!isExpanded);
|
|
104423
|
-
};
|
|
104424
|
-
const getTitle = () => {
|
|
104425
|
-
switch (action) {
|
|
104426
|
-
case "DONE":
|
|
104427
|
-
return "Task Complete";
|
|
104428
|
-
case "ASK":
|
|
104429
|
-
return "Asking a Question";
|
|
104430
|
-
default:
|
|
104431
|
-
return executionType === "plan" ? "Planning" : "Reflection";
|
|
104432
|
-
}
|
|
104433
|
-
};
|
|
104434
|
-
const getIcon = () => {
|
|
104435
|
-
switch (action) {
|
|
104436
|
-
case "DONE":
|
|
104437
|
-
return faCheck;
|
|
104438
|
-
case "ASK":
|
|
104439
|
-
return faQuestion;
|
|
104440
|
-
default:
|
|
104441
|
-
return executionType === "plan" ? faLightbulb : faCommentDots;
|
|
104442
|
-
}
|
|
104443
|
-
};
|
|
104444
|
-
const getTruncatedContent = (content22, maxLength = 140) => {
|
|
104445
|
-
return content22.length > maxLength ? `${content22.slice(0, maxLength)}...` : content22;
|
|
104446
|
-
};
|
|
104447
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(BlockContainer, { onClick: toggleExpand, children: [
|
|
104448
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(BlockHeader, { executionType, isUser, children: [
|
|
104449
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(BlockIcon, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: getIcon(), size: "sm" }) }),
|
|
104450
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { flexGrow: 1 }, children: [
|
|
104451
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(BlockTitle, { variant: "subtitle2", children: getTitle() }),
|
|
104452
|
-
!isExpanded && /* @__PURE__ */ jsxRuntimeExports.jsx(BlockContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
104453
|
-
MarkdownRenderer,
|
|
104454
|
-
{
|
|
104455
|
-
content: getTruncatedContent(content2),
|
|
104456
|
-
styleProps: {
|
|
104457
|
-
fontSize: "0.85rem",
|
|
104458
|
-
lineHeight: 1.5,
|
|
104459
|
-
paragraphSpacing: "4px",
|
|
104460
|
-
headingScale: 0.9,
|
|
104461
|
-
codeSize: "0.85em"
|
|
104462
|
-
}
|
|
104463
|
-
}
|
|
104464
|
-
) })
|
|
104465
|
-
] })
|
|
104466
|
-
] }),
|
|
104467
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Collapse, { in: isExpanded, timeout: "auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandedContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
104468
|
-
MarkdownRenderer,
|
|
104469
|
-
{
|
|
104470
|
-
content: content2,
|
|
104471
|
-
styleProps: {
|
|
104472
|
-
fontSize: "0.85rem",
|
|
104473
|
-
lineHeight: 1.5,
|
|
104474
|
-
paragraphSpacing: "4px",
|
|
104475
|
-
headingScale: 0.9,
|
|
104476
|
-
codeSize: "0.85em"
|
|
104477
|
-
}
|
|
104478
|
-
}
|
|
104479
|
-
) }) })
|
|
104480
|
-
] });
|
|
104481
|
-
};
|
|
104482
104317
|
const CodeContainer$3 = styled$1(Box)({
|
|
104483
104318
|
marginBottom: 16,
|
|
104484
104319
|
width: "100%"
|
|
@@ -104523,60 +104358,11 @@ const CodeBlock = ({ code: code2 }) => {
|
|
|
104523
104358
|
)
|
|
104524
104359
|
] });
|
|
104525
104360
|
};
|
|
104526
|
-
const SectionHeader = styled$1(Box)(({ theme }) => ({
|
|
104527
|
-
display: "flex",
|
|
104528
|
-
alignItems: "center",
|
|
104529
|
-
marginBottom: 8,
|
|
104530
|
-
cursor: "pointer",
|
|
104531
|
-
userSelect: "none",
|
|
104532
|
-
"&:hover": {
|
|
104533
|
-
backgroundColor: alpha(
|
|
104534
|
-
theme.palette.mode === "dark" ? theme.palette.common.white : theme.palette.primary.main,
|
|
104535
|
-
theme.palette.mode === "dark" ? 0.05 : 0.05
|
|
104536
|
-
)
|
|
104537
|
-
},
|
|
104538
|
-
borderRadius: 4,
|
|
104539
|
-
padding: "4px 8px",
|
|
104540
|
-
color: theme.palette.primary.main,
|
|
104541
|
-
transition: "all 0.2s ease"
|
|
104542
|
-
}));
|
|
104543
|
-
const SectionLabel$3 = styled$1(Typography)(({ theme }) => ({
|
|
104544
|
-
display: "block",
|
|
104545
|
-
color: theme.palette.primary.main,
|
|
104546
|
-
fontWeight: 500,
|
|
104547
|
-
fontSize: "0.85rem"
|
|
104548
|
-
}));
|
|
104549
|
-
const ToggleButton$1 = styled$1(IconButton)({
|
|
104550
|
-
padding: 2,
|
|
104551
|
-
marginRight: 4
|
|
104552
|
-
});
|
|
104553
|
-
const CollapsibleMessage = ({ children, defaultCollapsed = true, hasContent }) => {
|
|
104554
|
-
const [isCollapsed, setIsCollapsed] = reactExports.useState(defaultCollapsed);
|
|
104555
|
-
if (!hasContent) {
|
|
104556
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children });
|
|
104557
|
-
}
|
|
104558
|
-
const toggleCollapse = () => {
|
|
104559
|
-
setIsCollapsed(!isCollapsed);
|
|
104560
|
-
};
|
|
104561
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { width: "100%" }, children: [
|
|
104562
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(SectionHeader, { onClick: toggleCollapse, children: [
|
|
104563
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ToggleButton$1, { size: "small", disableRipple: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
104564
|
-
FontAwesomeIcon,
|
|
104565
|
-
{
|
|
104566
|
-
icon: isCollapsed ? faChevronRight : faChevronDown,
|
|
104567
|
-
size: "sm"
|
|
104568
|
-
}
|
|
104569
|
-
) }),
|
|
104570
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionLabel$3, { variant: "caption", children: isCollapsed ? "Show technical details" : "Hide technical details" })
|
|
104571
|
-
] }),
|
|
104572
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Collapse, { in: !isCollapsed, timeout: "auto", children })
|
|
104573
|
-
] });
|
|
104574
|
-
};
|
|
104575
104361
|
const CodeContainer$2 = styled$1(Box)({
|
|
104576
104362
|
marginBottom: 16,
|
|
104577
104363
|
width: "100%"
|
|
104578
104364
|
});
|
|
104579
|
-
const SectionLabel$
|
|
104365
|
+
const SectionLabel$3 = styled$1(Typography)(({ theme }) => ({
|
|
104580
104366
|
display: "block",
|
|
104581
104367
|
marginBottom: 4,
|
|
104582
104368
|
color: theme.palette.error.light
|
|
@@ -104612,7 +104398,7 @@ const ErrorContainer$2 = styled$1(Box, {
|
|
|
104612
104398
|
const ErrorBlock = ({ error, isUser }) => {
|
|
104613
104399
|
if (!error || error === "[No error output]") return null;
|
|
104614
104400
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(CodeContainer$2, { children: [
|
|
104615
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionLabel$
|
|
104401
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionLabel$3, { variant: "caption", children: "Error" }),
|
|
104616
104402
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ErrorContainer$2, { isUser, children: error })
|
|
104617
104403
|
] });
|
|
104618
104404
|
};
|
|
@@ -104720,7 +104506,7 @@ const CodeContainer$1 = styled$1(Box)({
|
|
|
104720
104506
|
marginBottom: 16,
|
|
104721
104507
|
width: "100%"
|
|
104722
104508
|
});
|
|
104723
|
-
const SectionLabel$
|
|
104509
|
+
const SectionLabel$2 = styled$1(Typography)(({ theme }) => ({
|
|
104724
104510
|
display: "block",
|
|
104725
104511
|
marginBottom: 4,
|
|
104726
104512
|
color: theme.palette.text.secondary
|
|
@@ -104756,109 +104542,15 @@ const LogContainer = styled$1(Box, {
|
|
|
104756
104542
|
const LogBlock = ({ log, isUser }) => {
|
|
104757
104543
|
if (!log || log === "[No logger output]") return null;
|
|
104758
104544
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(CodeContainer$1, { children: [
|
|
104759
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionLabel$
|
|
104545
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionLabel$2, { variant: "caption", children: "Logs" }),
|
|
104760
104546
|
/* @__PURE__ */ jsxRuntimeExports.jsx(LogContainer, { isUser, children: log })
|
|
104761
104547
|
] });
|
|
104762
104548
|
};
|
|
104763
|
-
const StyledAvatar = styled$1(Avatar, {
|
|
104764
|
-
shouldForwardProp: (prop) => prop !== "isUser"
|
|
104765
|
-
})(({ isUser, theme }) => ({
|
|
104766
|
-
backgroundColor: isUser ? theme.palette.userMessage.background : theme.palette.icon.background,
|
|
104767
|
-
color: isUser ? "white" : theme.palette.icon.text,
|
|
104768
|
-
boxShadow: isUser ? theme.palette.userMessage.shadow : "none",
|
|
104769
|
-
border: isUser ? `1px solid ${theme.palette.userMessage.border}` : "none"
|
|
104770
|
-
}));
|
|
104771
|
-
const MessageAvatar = ({ isUser }) => {
|
|
104772
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(StyledAvatar, { isUser, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: isUser ? faUser : faRobot, size: "sm" }) });
|
|
104773
|
-
};
|
|
104774
|
-
const StyledContainer$1 = styled$1(Box, {
|
|
104775
|
-
shouldForwardProp: (prop) => prop !== "isUser"
|
|
104776
|
-
})(({ isUser }) => ({
|
|
104777
|
-
display: "flex",
|
|
104778
|
-
flexDirection: isUser ? "row-reverse" : "row",
|
|
104779
|
-
alignItems: "flex-start",
|
|
104780
|
-
gap: 16,
|
|
104781
|
-
marginBottom: 16
|
|
104782
|
-
}));
|
|
104783
|
-
const MessageContainer = ({
|
|
104784
|
-
isUser,
|
|
104785
|
-
children
|
|
104786
|
-
}) => {
|
|
104787
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(StyledContainer$1, { isUser, children });
|
|
104788
|
-
};
|
|
104789
|
-
const ContentContainer$2 = styled$1(Box)(() => ({
|
|
104790
|
-
marginBottom: 16
|
|
104791
|
-
}));
|
|
104792
|
-
const MessageContent = ({ content: content2 }) => {
|
|
104793
|
-
if (!content2) return null;
|
|
104794
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(ContentContainer$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(MarkdownRenderer, { content: content2 }) });
|
|
104795
|
-
};
|
|
104796
|
-
const StyledPaper$1 = styled$1(Paper)(({ theme }) => ({
|
|
104797
|
-
[theme.breakpoints.down("sm")]: {
|
|
104798
|
-
maxWidth: "85%"
|
|
104799
|
-
},
|
|
104800
|
-
[theme.breakpoints.between("sm", "md")]: {
|
|
104801
|
-
maxWidth: "75%"
|
|
104802
|
-
},
|
|
104803
|
-
[theme.breakpoints.up("md")]: {
|
|
104804
|
-
maxWidth: "65%"
|
|
104805
|
-
},
|
|
104806
|
-
width: "auto",
|
|
104807
|
-
padding: 16,
|
|
104808
|
-
borderRadius: 8,
|
|
104809
|
-
wordBreak: "break-word",
|
|
104810
|
-
overflowWrap: "break-word",
|
|
104811
|
-
position: "relative"
|
|
104812
|
-
}));
|
|
104813
|
-
const MessagePaper = ({
|
|
104814
|
-
isUser,
|
|
104815
|
-
elevation = isUser ? 2 : 1,
|
|
104816
|
-
children
|
|
104817
|
-
}) => {
|
|
104818
|
-
const theme = useTheme$1();
|
|
104819
|
-
const isDarkMode = theme.palette.mode === "dark";
|
|
104820
|
-
const assistantBorderColor = isDarkMode ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.1)";
|
|
104821
|
-
const assistantShadow = isDarkMode ? "0 2px 8px rgba(0, 0, 0, 0.15)" : "0 2px 8px rgba(0, 0, 0, 0.05)";
|
|
104822
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
104823
|
-
StyledPaper$1,
|
|
104824
|
-
{
|
|
104825
|
-
elevation,
|
|
104826
|
-
sx: {
|
|
104827
|
-
backgroundColor: isUser ? theme.palette.userMessage.background : theme.palette.background.paper,
|
|
104828
|
-
// Theme-appropriate background for assistant
|
|
104829
|
-
border: isUser ? `1px solid ${theme.palette.userMessage.border}` : `1px solid ${assistantBorderColor}`,
|
|
104830
|
-
boxShadow: isUser ? theme.palette.userMessage.shadow : assistantShadow,
|
|
104831
|
-
color: theme.palette.text.primary
|
|
104832
|
-
// Use theme text color
|
|
104833
|
-
},
|
|
104834
|
-
children
|
|
104835
|
-
}
|
|
104836
|
-
);
|
|
104837
|
-
};
|
|
104838
|
-
const StyledTimestamp = styled$1(Typography, {
|
|
104839
|
-
shouldForwardProp: (prop) => prop !== "isUser"
|
|
104840
|
-
})(({ isUser, theme }) => ({
|
|
104841
|
-
display: "block",
|
|
104842
|
-
marginTop: 8,
|
|
104843
|
-
textAlign: isUser ? "left" : "right",
|
|
104844
|
-
color: theme.palette.text.secondary,
|
|
104845
|
-
fontSize: "0.7rem"
|
|
104846
|
-
}));
|
|
104847
|
-
const MessageTimestamp = ({
|
|
104848
|
-
timestamp,
|
|
104849
|
-
isUser
|
|
104850
|
-
}) => {
|
|
104851
|
-
const formattedTime = timestamp.toLocaleTimeString([], {
|
|
104852
|
-
hour: "2-digit",
|
|
104853
|
-
minute: "2-digit"
|
|
104854
|
-
});
|
|
104855
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(StyledTimestamp, { variant: "caption", isUser, children: formattedTime });
|
|
104856
|
-
};
|
|
104857
104549
|
const CodeContainer = styled$1(Box)({
|
|
104858
104550
|
marginBottom: 16,
|
|
104859
104551
|
width: "100%"
|
|
104860
104552
|
});
|
|
104861
|
-
const SectionLabel = styled$1(Typography)(({ theme }) => ({
|
|
104553
|
+
const SectionLabel$1 = styled$1(Typography)(({ theme }) => ({
|
|
104862
104554
|
display: "block",
|
|
104863
104555
|
marginBottom: 4,
|
|
104864
104556
|
color: theme.palette.text.secondary
|
|
@@ -104900,10 +104592,710 @@ const OutputContainer = styled$1(Box)(({ theme }) => ({
|
|
|
104900
104592
|
const OutputBlock = ({ output }) => {
|
|
104901
104593
|
if (!output) return null;
|
|
104902
104594
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(CodeContainer, { children: [
|
|
104903
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionLabel, { variant: "caption", children: "Output" }),
|
|
104595
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionLabel$1, { variant: "caption", children: "Output" }),
|
|
104904
104596
|
/* @__PURE__ */ jsxRuntimeExports.jsx(OutputContainer, { children: output })
|
|
104905
104597
|
] });
|
|
104906
104598
|
};
|
|
104599
|
+
const AttachmentVideo = styled$1("video")(({ theme }) => ({
|
|
104600
|
+
maxWidth: "100%",
|
|
104601
|
+
maxHeight: 300,
|
|
104602
|
+
borderRadius: 8,
|
|
104603
|
+
marginBottom: 8,
|
|
104604
|
+
boxShadow: `0 2px 8px ${alpha(theme.palette.common.black, theme.palette.mode === "dark" ? 0.15 : 0.1)}`,
|
|
104605
|
+
cursor: "pointer",
|
|
104606
|
+
transition: "transform 0.2s ease, box-shadow 0.2s ease",
|
|
104607
|
+
"&:hover": {
|
|
104608
|
+
transform: "scale(1.02)",
|
|
104609
|
+
boxShadow: `0 4px 12px ${alpha(theme.palette.common.black, theme.palette.mode === "dark" ? 0.25 : 0.15)}`
|
|
104610
|
+
}
|
|
104611
|
+
}));
|
|
104612
|
+
const getFileName = (path2) => {
|
|
104613
|
+
const parts = path2.split(/[/\\]/);
|
|
104614
|
+
return parts[parts.length - 1];
|
|
104615
|
+
};
|
|
104616
|
+
const VideoAttachment = ({
|
|
104617
|
+
file,
|
|
104618
|
+
src,
|
|
104619
|
+
onClick
|
|
104620
|
+
}) => {
|
|
104621
|
+
const handleClick = () => {
|
|
104622
|
+
onClick(file);
|
|
104623
|
+
};
|
|
104624
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
104625
|
+
AttachmentVideo,
|
|
104626
|
+
{
|
|
104627
|
+
src,
|
|
104628
|
+
controls: true,
|
|
104629
|
+
preload: "metadata",
|
|
104630
|
+
onClick: handleClick,
|
|
104631
|
+
title: `Click to open ${getFileName(file)}`
|
|
104632
|
+
}
|
|
104633
|
+
);
|
|
104634
|
+
};
|
|
104635
|
+
const BlockContainer = styled$1(Box, {
|
|
104636
|
+
shouldForwardProp: (prop) => prop !== "mounted"
|
|
104637
|
+
})(({ theme, mounted }) => ({
|
|
104638
|
+
width: "calc(100% - 2*56px)",
|
|
104639
|
+
marginLeft: 56,
|
|
104640
|
+
opacity: mounted ? 1 : 0,
|
|
104641
|
+
// Start invisible before animation
|
|
104642
|
+
transform: mounted ? "translateY(0)" : "translateY(20px)",
|
|
104643
|
+
transition: `opacity 0.4s ${theme.transitions.easing.easeOut}, transform 0.4s ${theme.transitions.easing.easeOut}`
|
|
104644
|
+
}));
|
|
104645
|
+
const BlockHeader = styled$1(Box, {
|
|
104646
|
+
shouldForwardProp: (prop) => prop !== "executionType" && prop !== "isUser" && prop !== "isExpanded"
|
|
104647
|
+
})(
|
|
104648
|
+
({ theme, isExpanded }) => ({
|
|
104649
|
+
cursor: "pointer",
|
|
104650
|
+
"&:hover": {
|
|
104651
|
+
opacity: 0.9
|
|
104652
|
+
},
|
|
104653
|
+
display: "flex",
|
|
104654
|
+
alignItems: "center",
|
|
104655
|
+
padding: "8px 12px",
|
|
104656
|
+
backgroundColor: alpha(
|
|
104657
|
+
theme.palette.common.black,
|
|
104658
|
+
theme.palette.mode === "dark" ? 0.2 : 0.05
|
|
104659
|
+
),
|
|
104660
|
+
borderRadius: isExpanded ? "8px 8px 0 0" : "8px",
|
|
104661
|
+
transition: `background-color 0.3s ${theme.transitions.easing.easeInOut},
|
|
104662
|
+
border-radius 0.3s ${theme.transitions.easing.easeInOut}`
|
|
104663
|
+
})
|
|
104664
|
+
);
|
|
104665
|
+
const BlockIcon = styled$1(Box)(({ theme }) => ({
|
|
104666
|
+
marginRight: 8,
|
|
104667
|
+
width: 40,
|
|
104668
|
+
height: 40,
|
|
104669
|
+
flexShrink: 0,
|
|
104670
|
+
borderRadius: "100%",
|
|
104671
|
+
backgroundColor: alpha(
|
|
104672
|
+
theme.palette.common.black,
|
|
104673
|
+
theme.palette.mode === "dark" ? 0.2 : 0.05
|
|
104674
|
+
),
|
|
104675
|
+
display: "flex",
|
|
104676
|
+
alignItems: "center",
|
|
104677
|
+
justifyContent: "center",
|
|
104678
|
+
color: theme.palette.icon.text,
|
|
104679
|
+
transform: "scale(1) rotate(0deg)",
|
|
104680
|
+
transition: `transform 0.4s ${theme.transitions.easing.easeOut}`,
|
|
104681
|
+
"&.animate": {
|
|
104682
|
+
animation: "iconAppear 0.4s forwards"
|
|
104683
|
+
},
|
|
104684
|
+
"@keyframes iconAppear": {
|
|
104685
|
+
"0%": {
|
|
104686
|
+
transform: "scale(0.8) rotate(-10deg)"
|
|
104687
|
+
},
|
|
104688
|
+
"100%": {
|
|
104689
|
+
transform: "scale(1) rotate(0deg)"
|
|
104690
|
+
}
|
|
104691
|
+
}
|
|
104692
|
+
}));
|
|
104693
|
+
const BlockTitle = styled$1(Typography)(({ theme }) => ({
|
|
104694
|
+
fontWeight: 500,
|
|
104695
|
+
fontSize: "0.85rem",
|
|
104696
|
+
color: theme.palette.text.secondary,
|
|
104697
|
+
transform: "translateX(0)",
|
|
104698
|
+
transition: `transform 0.4s ${theme.transitions.easing.easeOut}`,
|
|
104699
|
+
"&.animate": {
|
|
104700
|
+
animation: "titleFadeIn 0.4s forwards"
|
|
104701
|
+
},
|
|
104702
|
+
"@keyframes titleFadeIn": {
|
|
104703
|
+
"0%": {
|
|
104704
|
+
transform: "translateX(-5px)"
|
|
104705
|
+
},
|
|
104706
|
+
"100%": {
|
|
104707
|
+
transform: "translateX(0)"
|
|
104708
|
+
}
|
|
104709
|
+
}
|
|
104710
|
+
}));
|
|
104711
|
+
const BlockContent = styled$1(Box)(({ theme }) => ({
|
|
104712
|
+
fontSize: "0.85rem",
|
|
104713
|
+
color: theme.palette.text.secondary,
|
|
104714
|
+
overflow: "hidden",
|
|
104715
|
+
textOverflow: "ellipsis",
|
|
104716
|
+
marginTop: 2,
|
|
104717
|
+
transform: "translateY(0)",
|
|
104718
|
+
transition: `transform 0.4s ${theme.transitions.easing.easeOut}`,
|
|
104719
|
+
"&.animate": {
|
|
104720
|
+
animation: "contentFadeIn 0.4s forwards"
|
|
104721
|
+
},
|
|
104722
|
+
"@keyframes contentFadeIn": {
|
|
104723
|
+
"0%": {
|
|
104724
|
+
transform: "translateY(5px)"
|
|
104725
|
+
},
|
|
104726
|
+
"100%": {
|
|
104727
|
+
transform: "translateY(0)"
|
|
104728
|
+
}
|
|
104729
|
+
}
|
|
104730
|
+
}));
|
|
104731
|
+
const ExpandedContent = styled$1(Box)(({ theme }) => ({
|
|
104732
|
+
padding: "12px 16px",
|
|
104733
|
+
backgroundColor: alpha(
|
|
104734
|
+
theme.palette.common.black,
|
|
104735
|
+
theme.palette.mode === "dark" ? 0.2 : 0.05
|
|
104736
|
+
),
|
|
104737
|
+
borderBottomLeftRadius: 4,
|
|
104738
|
+
borderBottomRightRadius: 4,
|
|
104739
|
+
fontSize: "0.85rem",
|
|
104740
|
+
color: theme.palette.text.primary,
|
|
104741
|
+
borderLeft: `3px solid ${theme.palette.grey[theme.palette.mode === "dark" ? 600 : 400]}`,
|
|
104742
|
+
marginLeft: 0,
|
|
104743
|
+
transition: `border-left-width 0.3s ${theme.transitions.easing.easeInOut}`,
|
|
104744
|
+
"&.animate": {
|
|
104745
|
+
animation: "expandedContentAppear 0.3s forwards"
|
|
104746
|
+
},
|
|
104747
|
+
"@keyframes expandedContentAppear": {
|
|
104748
|
+
"0%": {
|
|
104749
|
+
borderLeftWidth: "0px"
|
|
104750
|
+
},
|
|
104751
|
+
"100%": {
|
|
104752
|
+
borderLeftWidth: "3px"
|
|
104753
|
+
}
|
|
104754
|
+
}
|
|
104755
|
+
}));
|
|
104756
|
+
const ActionBadge = styled$1(Box)(({ theme }) => ({
|
|
104757
|
+
position: "absolute",
|
|
104758
|
+
top: "-10px",
|
|
104759
|
+
right: "16px",
|
|
104760
|
+
padding: "4px 8px",
|
|
104761
|
+
borderRadius: "12px",
|
|
104762
|
+
fontSize: "0.7rem",
|
|
104763
|
+
fontWeight: "bold",
|
|
104764
|
+
backgroundColor: alpha(theme.palette.primary.main, 0.9),
|
|
104765
|
+
color: "#fff",
|
|
104766
|
+
display: "flex",
|
|
104767
|
+
alignItems: "center",
|
|
104768
|
+
gap: "4px",
|
|
104769
|
+
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.2)",
|
|
104770
|
+
zIndex: 1,
|
|
104771
|
+
// Ensure badge is above other content
|
|
104772
|
+
transform: "scale(1)",
|
|
104773
|
+
transition: `transform 0.5s ${theme.transitions.easing.easeOut}`,
|
|
104774
|
+
"&.animate": {
|
|
104775
|
+
animation: "badgeBounceIn 0.5s forwards"
|
|
104776
|
+
},
|
|
104777
|
+
"@keyframes badgeBounceIn": {
|
|
104778
|
+
"0%": {
|
|
104779
|
+
transform: "scale(0)"
|
|
104780
|
+
},
|
|
104781
|
+
"60%": {
|
|
104782
|
+
transform: "scale(1.2)"
|
|
104783
|
+
},
|
|
104784
|
+
"100%": {
|
|
104785
|
+
transform: "scale(1)"
|
|
104786
|
+
}
|
|
104787
|
+
}
|
|
104788
|
+
}));
|
|
104789
|
+
const CollapseButton = styled$1(Box)(({ theme }) => ({
|
|
104790
|
+
display: "flex",
|
|
104791
|
+
justifyContent: "center",
|
|
104792
|
+
alignItems: "center",
|
|
104793
|
+
padding: "8px",
|
|
104794
|
+
marginTop: "8px",
|
|
104795
|
+
cursor: "pointer",
|
|
104796
|
+
borderRadius: "4px",
|
|
104797
|
+
backgroundColor: alpha(
|
|
104798
|
+
theme.palette.common.black,
|
|
104799
|
+
theme.palette.mode === "dark" ? 0.1 : 0.03
|
|
104800
|
+
),
|
|
104801
|
+
transition: `all 0.2s ${theme.transitions.easing.easeInOut}`,
|
|
104802
|
+
"&:hover": {
|
|
104803
|
+
backgroundColor: alpha(
|
|
104804
|
+
theme.palette.common.black,
|
|
104805
|
+
theme.palette.mode === "dark" ? 0.15 : 0.05
|
|
104806
|
+
),
|
|
104807
|
+
transform: "translateY(-1px)",
|
|
104808
|
+
boxShadow: `0 2px 4px ${alpha(theme.palette.common.black, 0.1)}`
|
|
104809
|
+
},
|
|
104810
|
+
"&:active": {
|
|
104811
|
+
transform: "translateY(0px)",
|
|
104812
|
+
boxShadow: "none"
|
|
104813
|
+
}
|
|
104814
|
+
}));
|
|
104815
|
+
const isWebUrl$1 = (path2) => {
|
|
104816
|
+
return path2.startsWith("http://") || path2.startsWith("https://");
|
|
104817
|
+
};
|
|
104818
|
+
const isImage$1 = (path2) => {
|
|
104819
|
+
const imageExtensions = [
|
|
104820
|
+
".jpg",
|
|
104821
|
+
".jpeg",
|
|
104822
|
+
".png",
|
|
104823
|
+
".gif",
|
|
104824
|
+
".webp",
|
|
104825
|
+
".bmp",
|
|
104826
|
+
".svg",
|
|
104827
|
+
".tiff",
|
|
104828
|
+
".tif",
|
|
104829
|
+
".ico",
|
|
104830
|
+
".heic",
|
|
104831
|
+
".heif",
|
|
104832
|
+
".avif",
|
|
104833
|
+
".jfif",
|
|
104834
|
+
".pjpeg",
|
|
104835
|
+
".pjp"
|
|
104836
|
+
];
|
|
104837
|
+
const lowerPath = path2.toLowerCase();
|
|
104838
|
+
return imageExtensions.some((ext) => lowerPath.endsWith(ext));
|
|
104839
|
+
};
|
|
104840
|
+
const isVideo$1 = (path2) => {
|
|
104841
|
+
const videoExtensions = [
|
|
104842
|
+
".mp4",
|
|
104843
|
+
".webm",
|
|
104844
|
+
".ogg",
|
|
104845
|
+
".mov",
|
|
104846
|
+
".avi",
|
|
104847
|
+
".wmv",
|
|
104848
|
+
".flv",
|
|
104849
|
+
".mkv",
|
|
104850
|
+
".m4v",
|
|
104851
|
+
".3gp",
|
|
104852
|
+
".3g2"
|
|
104853
|
+
];
|
|
104854
|
+
const lowerPath = path2.toLowerCase();
|
|
104855
|
+
return videoExtensions.some((ext) => lowerPath.endsWith(ext));
|
|
104856
|
+
};
|
|
104857
|
+
const getAttachmentUrl$1 = (client, path2) => {
|
|
104858
|
+
if (path2.startsWith("http")) {
|
|
104859
|
+
return path2;
|
|
104860
|
+
}
|
|
104861
|
+
const normalizedPath = path2.startsWith("file://") ? path2 : `file://${path2}`;
|
|
104862
|
+
if (isImage$1(path2)) {
|
|
104863
|
+
return client.static.getImageUrl(normalizedPath);
|
|
104864
|
+
}
|
|
104865
|
+
if (isVideo$1(path2)) {
|
|
104866
|
+
return client.static.getVideoUrl(normalizedPath);
|
|
104867
|
+
}
|
|
104868
|
+
return path2;
|
|
104869
|
+
};
|
|
104870
|
+
const BackgroundBlock = ({
|
|
104871
|
+
content: content2,
|
|
104872
|
+
action,
|
|
104873
|
+
executionType,
|
|
104874
|
+
isUser,
|
|
104875
|
+
code: code2,
|
|
104876
|
+
stdout,
|
|
104877
|
+
stderr,
|
|
104878
|
+
logging,
|
|
104879
|
+
files
|
|
104880
|
+
}) => {
|
|
104881
|
+
const [isExpanded, setIsExpanded] = reactExports.useState(false);
|
|
104882
|
+
const [mounted, setMounted] = reactExports.useState(false);
|
|
104883
|
+
const mountedRef = reactExports.useRef(false);
|
|
104884
|
+
reactExports.useEffect(() => {
|
|
104885
|
+
if (!mountedRef.current) {
|
|
104886
|
+
mountedRef.current = true;
|
|
104887
|
+
const timer = setTimeout(() => {
|
|
104888
|
+
setMounted(true);
|
|
104889
|
+
}, 50);
|
|
104890
|
+
return () => clearTimeout(timer);
|
|
104891
|
+
}
|
|
104892
|
+
return void 0;
|
|
104893
|
+
}, []);
|
|
104894
|
+
const handleExpand = () => {
|
|
104895
|
+
setIsExpanded(true);
|
|
104896
|
+
};
|
|
104897
|
+
const handleCollapse = (e) => {
|
|
104898
|
+
e.stopPropagation();
|
|
104899
|
+
setIsExpanded(false);
|
|
104900
|
+
};
|
|
104901
|
+
const getTitle = () => {
|
|
104902
|
+
switch (action) {
|
|
104903
|
+
case "DONE":
|
|
104904
|
+
return "Task Complete";
|
|
104905
|
+
case "ASK":
|
|
104906
|
+
return "Asking a Question";
|
|
104907
|
+
case "CODE":
|
|
104908
|
+
return "Executing Code";
|
|
104909
|
+
case "WRITE":
|
|
104910
|
+
return "Writing Content";
|
|
104911
|
+
case "EDIT":
|
|
104912
|
+
return "Editing Content";
|
|
104913
|
+
case "READ":
|
|
104914
|
+
return "Reading Content";
|
|
104915
|
+
default:
|
|
104916
|
+
return executionType === "plan" ? "Planning" : executionType === "action" ? "Action" : "Reflection";
|
|
104917
|
+
}
|
|
104918
|
+
};
|
|
104919
|
+
const getIcon = () => {
|
|
104920
|
+
switch (action) {
|
|
104921
|
+
case "DONE":
|
|
104922
|
+
return faCheck;
|
|
104923
|
+
case "ASK":
|
|
104924
|
+
return faQuestion;
|
|
104925
|
+
case "CODE":
|
|
104926
|
+
return faCode;
|
|
104927
|
+
case "WRITE":
|
|
104928
|
+
return faPencilAlt;
|
|
104929
|
+
case "EDIT":
|
|
104930
|
+
return faEdit;
|
|
104931
|
+
case "READ":
|
|
104932
|
+
return faBook;
|
|
104933
|
+
default:
|
|
104934
|
+
return executionType === "plan" ? faLightbulb : executionType === "action" ? faCode : faCommentDots;
|
|
104935
|
+
}
|
|
104936
|
+
};
|
|
104937
|
+
const getTruncatedContent = (content22, maxLength = 140) => {
|
|
104938
|
+
return content22.length > maxLength ? `${content22.slice(0, maxLength)}...` : content22;
|
|
104939
|
+
};
|
|
104940
|
+
const client = reactExports.useMemo(() => {
|
|
104941
|
+
return createLocalOperatorClient(apiConfig.baseUrl);
|
|
104942
|
+
}, []);
|
|
104943
|
+
const getUrl = reactExports.useCallback(
|
|
104944
|
+
(path2) => getAttachmentUrl$1(client, path2),
|
|
104945
|
+
[client]
|
|
104946
|
+
);
|
|
104947
|
+
const handleFileClick = reactExports.useCallback((filePath) => {
|
|
104948
|
+
try {
|
|
104949
|
+
if (isWebUrl$1(filePath)) {
|
|
104950
|
+
window.api.openExternal(filePath);
|
|
104951
|
+
} else {
|
|
104952
|
+
const normalizedPath = filePath.startsWith("file://") ? filePath.substring(7) : filePath;
|
|
104953
|
+
window.api.openFile(normalizedPath);
|
|
104954
|
+
}
|
|
104955
|
+
} catch (error) {
|
|
104956
|
+
console.error("Error opening file:", error);
|
|
104957
|
+
}
|
|
104958
|
+
}, []);
|
|
104959
|
+
const hasCollapsibleContent = executionType === "action" && (code2 || stdout || stderr || logging);
|
|
104960
|
+
reactExports.useEffect(() => {
|
|
104961
|
+
setMounted(true);
|
|
104962
|
+
}, []);
|
|
104963
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(BlockContainer, { sx: { position: "relative" }, mounted, children: [
|
|
104964
|
+
executionType === "action" && !isUser && /* @__PURE__ */ jsxRuntimeExports.jsxs(ActionBadge, { className: mounted ? "animate" : "", children: [
|
|
104965
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: getIcon(), size: "xs" }),
|
|
104966
|
+
"ACTION"
|
|
104967
|
+
] }),
|
|
104968
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
104969
|
+
BlockHeader,
|
|
104970
|
+
{
|
|
104971
|
+
executionType,
|
|
104972
|
+
isUser,
|
|
104973
|
+
isExpanded,
|
|
104974
|
+
onClick: isExpanded ? handleCollapse : handleExpand,
|
|
104975
|
+
children: [
|
|
104976
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(BlockIcon, { className: mounted ? "animate" : "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: getIcon(), size: "sm" }) }),
|
|
104977
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { flexGrow: 1, position: "relative" }, children: [
|
|
104978
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(BlockTitle, { variant: "subtitle2", className: mounted ? "animate" : "", children: getTitle() }),
|
|
104979
|
+
!isExpanded && /* @__PURE__ */ jsxRuntimeExports.jsx(BlockContent, { className: mounted ? "animate" : "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
104980
|
+
MarkdownRenderer,
|
|
104981
|
+
{
|
|
104982
|
+
content: getTruncatedContent(content2),
|
|
104983
|
+
styleProps: {
|
|
104984
|
+
fontSize: "0.85rem",
|
|
104985
|
+
lineHeight: 1.5,
|
|
104986
|
+
paragraphSpacing: "4px",
|
|
104987
|
+
headingScale: 0.9,
|
|
104988
|
+
codeSize: "0.85em"
|
|
104989
|
+
}
|
|
104990
|
+
}
|
|
104991
|
+
) })
|
|
104992
|
+
] })
|
|
104993
|
+
]
|
|
104994
|
+
}
|
|
104995
|
+
),
|
|
104996
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Collapse, { in: isExpanded, timeout: "auto", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ExpandedContent, { className: isExpanded ? "animate" : "", children: [
|
|
104997
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
104998
|
+
MarkdownRenderer,
|
|
104999
|
+
{
|
|
105000
|
+
content: content2,
|
|
105001
|
+
styleProps: {
|
|
105002
|
+
fontSize: "0.85rem",
|
|
105003
|
+
lineHeight: 1.5,
|
|
105004
|
+
paragraphSpacing: "4px",
|
|
105005
|
+
headingScale: 0.9,
|
|
105006
|
+
codeSize: "0.85em"
|
|
105007
|
+
}
|
|
105008
|
+
}
|
|
105009
|
+
),
|
|
105010
|
+
hasCollapsibleContent && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
105011
|
+
code2 && /* @__PURE__ */ jsxRuntimeExports.jsx(CodeBlock, { code: code2, isUser }),
|
|
105012
|
+
stdout && /* @__PURE__ */ jsxRuntimeExports.jsx(OutputBlock, { output: stdout, isUser }),
|
|
105013
|
+
stderr && /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBlock, { error: stderr, isUser }),
|
|
105014
|
+
logging && /* @__PURE__ */ jsxRuntimeExports.jsx(LogBlock, { log: logging, isUser })
|
|
105015
|
+
] }),
|
|
105016
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(CollapseButton, { onClick: handleCollapse, children: [
|
|
105017
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faChevronUp, size: "sm" }),
|
|
105018
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "caption", sx: { ml: 1 }, children: "Collapse" })
|
|
105019
|
+
] })
|
|
105020
|
+
] }) }),
|
|
105021
|
+
files && files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2, mt: 2 }, children: files.filter((file) => isImage$1(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105022
|
+
ImageAttachment,
|
|
105023
|
+
{
|
|
105024
|
+
file,
|
|
105025
|
+
src: getUrl(file),
|
|
105026
|
+
onClick: handleFileClick
|
|
105027
|
+
},
|
|
105028
|
+
`${file}`
|
|
105029
|
+
)) }),
|
|
105030
|
+
files && files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2 }, children: files.filter((file) => isVideo$1(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105031
|
+
VideoAttachment,
|
|
105032
|
+
{
|
|
105033
|
+
file,
|
|
105034
|
+
src: getUrl(file),
|
|
105035
|
+
onClick: handleFileClick
|
|
105036
|
+
},
|
|
105037
|
+
`${file}`
|
|
105038
|
+
)) }),
|
|
105039
|
+
files && files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mt: 2 }, children: files.filter((file) => !isImage$1(file) && !isVideo$1(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105040
|
+
FileAttachment,
|
|
105041
|
+
{
|
|
105042
|
+
file,
|
|
105043
|
+
onClick: handleFileClick
|
|
105044
|
+
},
|
|
105045
|
+
`${file}`
|
|
105046
|
+
)) })
|
|
105047
|
+
] });
|
|
105048
|
+
};
|
|
105049
|
+
const SectionHeader = styled$1(Box)(({ theme }) => ({
|
|
105050
|
+
display: "flex",
|
|
105051
|
+
alignItems: "center",
|
|
105052
|
+
marginBottom: 8,
|
|
105053
|
+
cursor: "pointer",
|
|
105054
|
+
userSelect: "none",
|
|
105055
|
+
"&:hover": {
|
|
105056
|
+
backgroundColor: alpha(
|
|
105057
|
+
theme.palette.mode === "dark" ? theme.palette.common.white : theme.palette.primary.main,
|
|
105058
|
+
theme.palette.mode === "dark" ? 0.05 : 0.05
|
|
105059
|
+
)
|
|
105060
|
+
},
|
|
105061
|
+
borderRadius: 4,
|
|
105062
|
+
padding: "4px 8px",
|
|
105063
|
+
color: theme.palette.primary.main,
|
|
105064
|
+
transition: "all 0.2s ease"
|
|
105065
|
+
}));
|
|
105066
|
+
const SectionLabel = styled$1(Typography)(({ theme }) => ({
|
|
105067
|
+
display: "block",
|
|
105068
|
+
color: theme.palette.primary.main,
|
|
105069
|
+
fontWeight: 500,
|
|
105070
|
+
fontSize: "0.85rem"
|
|
105071
|
+
}));
|
|
105072
|
+
const ToggleButton$1 = styled$1(IconButton)({
|
|
105073
|
+
padding: 2,
|
|
105074
|
+
marginRight: 4
|
|
105075
|
+
});
|
|
105076
|
+
const CollapsibleMessage = ({ children, defaultCollapsed = true, hasContent }) => {
|
|
105077
|
+
const [isCollapsed, setIsCollapsed] = reactExports.useState(defaultCollapsed);
|
|
105078
|
+
if (!hasContent) {
|
|
105079
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children });
|
|
105080
|
+
}
|
|
105081
|
+
const toggleCollapse = () => {
|
|
105082
|
+
setIsCollapsed(!isCollapsed);
|
|
105083
|
+
};
|
|
105084
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { width: "100%" }, children: [
|
|
105085
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(SectionHeader, { onClick: toggleCollapse, children: [
|
|
105086
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ToggleButton$1, { size: "small", disableRipple: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105087
|
+
FontAwesomeIcon,
|
|
105088
|
+
{
|
|
105089
|
+
icon: isCollapsed ? faChevronRight : faChevronDown,
|
|
105090
|
+
size: "sm"
|
|
105091
|
+
}
|
|
105092
|
+
) }),
|
|
105093
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionLabel, { variant: "caption", children: isCollapsed ? "Show technical details" : "Hide technical details" })
|
|
105094
|
+
] }),
|
|
105095
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Collapse, { in: !isCollapsed, timeout: "auto", children })
|
|
105096
|
+
] });
|
|
105097
|
+
};
|
|
105098
|
+
const StyledAvatar = styled$1(Avatar, {
|
|
105099
|
+
shouldForwardProp: (prop) => prop !== "isUser"
|
|
105100
|
+
})(({ isUser, theme }) => ({
|
|
105101
|
+
backgroundColor: isUser ? theme.palette.userMessage.background : theme.palette.icon.background,
|
|
105102
|
+
color: isUser ? "white" : theme.palette.icon.text,
|
|
105103
|
+
boxShadow: isUser ? theme.palette.userMessage.shadow : "none",
|
|
105104
|
+
border: isUser ? `1px solid ${theme.palette.userMessage.border}` : "none"
|
|
105105
|
+
}));
|
|
105106
|
+
const MessageAvatar = ({ isUser }) => {
|
|
105107
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(StyledAvatar, { isUser, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: isUser ? faUser : faRobot, size: "sm" }) });
|
|
105108
|
+
};
|
|
105109
|
+
const StyledContainer$1 = styled$1(Box, {
|
|
105110
|
+
shouldForwardProp: (prop) => prop !== "isUser"
|
|
105111
|
+
})(({ isUser }) => ({
|
|
105112
|
+
display: "flex",
|
|
105113
|
+
flexDirection: isUser ? "row-reverse" : "row",
|
|
105114
|
+
alignItems: "flex-start",
|
|
105115
|
+
gap: 16,
|
|
105116
|
+
marginBottom: 24,
|
|
105117
|
+
marginTop: 8
|
|
105118
|
+
}));
|
|
105119
|
+
const MessageContainer = ({
|
|
105120
|
+
isUser,
|
|
105121
|
+
children
|
|
105122
|
+
}) => {
|
|
105123
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(StyledContainer$1, { isUser, children });
|
|
105124
|
+
};
|
|
105125
|
+
const ContentContainer$2 = styled$1(Box)(() => ({
|
|
105126
|
+
marginBottom: 16
|
|
105127
|
+
}));
|
|
105128
|
+
const MessageContent = ({ content: content2 }) => {
|
|
105129
|
+
if (!content2) return null;
|
|
105130
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ContentContainer$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(MarkdownRenderer, { content: content2 }) });
|
|
105131
|
+
};
|
|
105132
|
+
const ControlsContainer = styled$1(Box, {
|
|
105133
|
+
shouldForwardProp: (prop) => prop !== "isUser"
|
|
105134
|
+
})(({ isUser }) => ({
|
|
105135
|
+
position: "absolute",
|
|
105136
|
+
bottom: isUser ? 12 : -12,
|
|
105137
|
+
// Position below the message
|
|
105138
|
+
display: "flex",
|
|
105139
|
+
alignItems: "center",
|
|
105140
|
+
justifyContent: isUser ? "flex-end" : "flex-start",
|
|
105141
|
+
width: "100%",
|
|
105142
|
+
opacity: 0,
|
|
105143
|
+
transition: "opacity 0.2s ease-in-out",
|
|
105144
|
+
zIndex: 1
|
|
105145
|
+
}));
|
|
105146
|
+
const ControlsWrapper = styled$1(Box)(() => ({
|
|
105147
|
+
display: "flex",
|
|
105148
|
+
alignItems: "flex-start"
|
|
105149
|
+
}));
|
|
105150
|
+
const MessageControls = ({
|
|
105151
|
+
isUser,
|
|
105152
|
+
content: content2
|
|
105153
|
+
}) => {
|
|
105154
|
+
const theme = useTheme$1();
|
|
105155
|
+
const [copied, setCopied] = reactExports.useState(false);
|
|
105156
|
+
const showCopyButton = content2;
|
|
105157
|
+
const handleCopy = async () => {
|
|
105158
|
+
try {
|
|
105159
|
+
if (content2) {
|
|
105160
|
+
await navigator.clipboard.writeText(content2);
|
|
105161
|
+
setCopied(true);
|
|
105162
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
105163
|
+
}
|
|
105164
|
+
} catch (error) {
|
|
105165
|
+
console.error("Failed to copy text:", error);
|
|
105166
|
+
}
|
|
105167
|
+
};
|
|
105168
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ControlsContainer, { isUser, className: "message-controls", children: showCopyButton && /* @__PURE__ */ jsxRuntimeExports.jsx(ControlsWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105169
|
+
Tooltip,
|
|
105170
|
+
{
|
|
105171
|
+
title: copied ? "Copied!" : "Copy message",
|
|
105172
|
+
placement: "top",
|
|
105173
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105174
|
+
IconButton,
|
|
105175
|
+
{
|
|
105176
|
+
size: "small",
|
|
105177
|
+
onClick: handleCopy,
|
|
105178
|
+
sx: {
|
|
105179
|
+
color: theme.palette.text.secondary,
|
|
105180
|
+
width: "34px",
|
|
105181
|
+
height: "34px",
|
|
105182
|
+
"&:hover": {
|
|
105183
|
+
color: theme.palette.primary.main,
|
|
105184
|
+
backgroundColor: "rgba(56, 201, 106, 0.1)"
|
|
105185
|
+
}
|
|
105186
|
+
},
|
|
105187
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faCopy, size: "sm" })
|
|
105188
|
+
}
|
|
105189
|
+
)
|
|
105190
|
+
}
|
|
105191
|
+
) }) });
|
|
105192
|
+
};
|
|
105193
|
+
const StyledPaper$1 = styled$1(Paper)(({ theme }) => ({
|
|
105194
|
+
[theme.breakpoints.down("sm")]: {
|
|
105195
|
+
maxWidth: "85%"
|
|
105196
|
+
},
|
|
105197
|
+
[theme.breakpoints.between("sm", "md")]: {
|
|
105198
|
+
maxWidth: "80%"
|
|
105199
|
+
},
|
|
105200
|
+
[theme.breakpoints.up("md")]: {
|
|
105201
|
+
maxWidth: "80%"
|
|
105202
|
+
},
|
|
105203
|
+
width: "auto",
|
|
105204
|
+
padding: 16,
|
|
105205
|
+
borderRadius: 8,
|
|
105206
|
+
wordBreak: "break-word",
|
|
105207
|
+
overflowWrap: "break-word",
|
|
105208
|
+
position: "relative"
|
|
105209
|
+
}));
|
|
105210
|
+
const MessagePaper = ({
|
|
105211
|
+
isUser,
|
|
105212
|
+
elevation = isUser ? 2 : 0,
|
|
105213
|
+
children,
|
|
105214
|
+
content: content2
|
|
105215
|
+
}) => {
|
|
105216
|
+
const theme = useTheme$1();
|
|
105217
|
+
if (isUser) {
|
|
105218
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
105219
|
+
Box,
|
|
105220
|
+
{
|
|
105221
|
+
sx: {
|
|
105222
|
+
position: "relative",
|
|
105223
|
+
width: "100%",
|
|
105224
|
+
display: "flex",
|
|
105225
|
+
justifyContent: "flex-end",
|
|
105226
|
+
"&:hover .message-controls": {
|
|
105227
|
+
opacity: 1
|
|
105228
|
+
}
|
|
105229
|
+
},
|
|
105230
|
+
children: [
|
|
105231
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105232
|
+
StyledPaper$1,
|
|
105233
|
+
{
|
|
105234
|
+
elevation,
|
|
105235
|
+
sx: {
|
|
105236
|
+
backgroundColor: theme.palette.userMessage.background,
|
|
105237
|
+
border: `1px solid ${theme.palette.userMessage.border}`,
|
|
105238
|
+
boxShadow: theme.palette.userMessage.shadow,
|
|
105239
|
+
color: theme.palette.text.primary
|
|
105240
|
+
},
|
|
105241
|
+
children
|
|
105242
|
+
}
|
|
105243
|
+
),
|
|
105244
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(MessageControls, { isUser, content: content2 })
|
|
105245
|
+
]
|
|
105246
|
+
}
|
|
105247
|
+
);
|
|
105248
|
+
}
|
|
105249
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
105250
|
+
Box,
|
|
105251
|
+
{
|
|
105252
|
+
sx: {
|
|
105253
|
+
position: "relative",
|
|
105254
|
+
width: "100%",
|
|
105255
|
+
"&:hover .message-controls": {
|
|
105256
|
+
opacity: 1
|
|
105257
|
+
}
|
|
105258
|
+
},
|
|
105259
|
+
children: [
|
|
105260
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105261
|
+
Box,
|
|
105262
|
+
{
|
|
105263
|
+
sx: {
|
|
105264
|
+
borderRadius: 2,
|
|
105265
|
+
color: theme.palette.text.primary,
|
|
105266
|
+
width: "calc(100% - 52px)",
|
|
105267
|
+
// Take full width minus padding
|
|
105268
|
+
wordBreak: "break-word",
|
|
105269
|
+
overflowWrap: "break-word",
|
|
105270
|
+
position: "relative"
|
|
105271
|
+
},
|
|
105272
|
+
children
|
|
105273
|
+
}
|
|
105274
|
+
),
|
|
105275
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(MessageControls, { isUser, content: content2 })
|
|
105276
|
+
]
|
|
105277
|
+
}
|
|
105278
|
+
);
|
|
105279
|
+
};
|
|
105280
|
+
const StyledTimestamp = styled$1(Typography, {
|
|
105281
|
+
shouldForwardProp: (prop) => prop !== "isUser"
|
|
105282
|
+
})(({ isUser, theme }) => ({
|
|
105283
|
+
display: "block",
|
|
105284
|
+
marginTop: 8,
|
|
105285
|
+
textAlign: isUser ? "left" : "right",
|
|
105286
|
+
color: theme.palette.text.secondary,
|
|
105287
|
+
fontSize: "0.7rem"
|
|
105288
|
+
}));
|
|
105289
|
+
const MessageTimestamp = ({
|
|
105290
|
+
timestamp,
|
|
105291
|
+
isUser
|
|
105292
|
+
}) => {
|
|
105293
|
+
const formattedTime = timestamp.toLocaleTimeString([], {
|
|
105294
|
+
hour: "2-digit",
|
|
105295
|
+
minute: "2-digit"
|
|
105296
|
+
});
|
|
105297
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(StyledTimestamp, { variant: "caption", isUser, children: formattedTime });
|
|
105298
|
+
};
|
|
104907
105299
|
const HighlightContainer = styled$1(Box, {
|
|
104908
105300
|
shouldForwardProp: (prop) => prop !== "isUser"
|
|
104909
105301
|
})(({ theme }) => ({
|
|
@@ -104969,42 +105361,6 @@ const StatusIndicator = ({ status }) => {
|
|
|
104969
105361
|
if (!status) return null;
|
|
104970
105362
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(StyledStatusIndicator, { status, children: status });
|
|
104971
105363
|
};
|
|
104972
|
-
const AttachmentVideo = styled$1("video")(({ theme }) => ({
|
|
104973
|
-
maxWidth: "100%",
|
|
104974
|
-
maxHeight: 300,
|
|
104975
|
-
borderRadius: 8,
|
|
104976
|
-
marginBottom: 8,
|
|
104977
|
-
boxShadow: `0 2px 8px ${alpha(theme.palette.common.black, theme.palette.mode === "dark" ? 0.15 : 0.1)}`,
|
|
104978
|
-
cursor: "pointer",
|
|
104979
|
-
transition: "transform 0.2s ease, box-shadow 0.2s ease",
|
|
104980
|
-
"&:hover": {
|
|
104981
|
-
transform: "scale(1.02)",
|
|
104982
|
-
boxShadow: `0 4px 12px ${alpha(theme.palette.common.black, theme.palette.mode === "dark" ? 0.25 : 0.15)}`
|
|
104983
|
-
}
|
|
104984
|
-
}));
|
|
104985
|
-
const getFileName = (path2) => {
|
|
104986
|
-
const parts = path2.split(/[/\\]/);
|
|
104987
|
-
return parts[parts.length - 1];
|
|
104988
|
-
};
|
|
104989
|
-
const VideoAttachment = ({
|
|
104990
|
-
file,
|
|
104991
|
-
src,
|
|
104992
|
-
onClick
|
|
104993
|
-
}) => {
|
|
104994
|
-
const handleClick = () => {
|
|
104995
|
-
onClick(file);
|
|
104996
|
-
};
|
|
104997
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
104998
|
-
AttachmentVideo,
|
|
104999
|
-
{
|
|
105000
|
-
src,
|
|
105001
|
-
controls: true,
|
|
105002
|
-
preload: "metadata",
|
|
105003
|
-
onClick: handleClick,
|
|
105004
|
-
title: `Click to open ${getFileName(file)}`
|
|
105005
|
-
}
|
|
105006
|
-
);
|
|
105007
|
-
};
|
|
105008
105364
|
const isWebUrl = (path2) => {
|
|
105009
105365
|
return path2.startsWith("http://") || path2.startsWith("https://");
|
|
105010
105366
|
};
|
|
@@ -105062,14 +105418,14 @@ const getAttachmentUrl = (client, path2) => {
|
|
|
105062
105418
|
};
|
|
105063
105419
|
const MessageItem = reactExports.memo(
|
|
105064
105420
|
({ message: message2 }) => {
|
|
105065
|
-
const shouldHide = (message2.action === "DONE" || message2.action === "ASK") && message2.execution_type === "action" && message2.task_classification === "conversation";
|
|
105421
|
+
const shouldHide = (message2.action === "DONE" || message2.action === "ASK") && message2.execution_type === "action" && message2.task_classification === "conversation" || !message2.message && (!message2.files || message2.files.length === 0) && !message2.code && !message2.stdout && !message2.stderr && !message2.logging;
|
|
105066
105422
|
if (shouldHide) {
|
|
105067
105423
|
return null;
|
|
105068
105424
|
}
|
|
105069
105425
|
const isUser = message2.role === "user";
|
|
105070
105426
|
const isAction = message2.execution_type === "action";
|
|
105071
105427
|
const isSecurityCheck = message2.execution_type === "security_check";
|
|
105072
|
-
const
|
|
105428
|
+
const shouldUseBackgroundBlock = message2.execution_type === "reflection" || message2.execution_type === "action";
|
|
105073
105429
|
const client = reactExports.useMemo(() => {
|
|
105074
105430
|
return createLocalOperatorClient(apiConfig.baseUrl);
|
|
105075
105431
|
}, []);
|
|
@@ -105089,21 +105445,25 @@ const MessageItem = reactExports.memo(
|
|
|
105089
105445
|
console.error("Error opening file:", error);
|
|
105090
105446
|
}
|
|
105091
105447
|
}, []);
|
|
105092
|
-
if (
|
|
105093
|
-
const executionType = isAction && message2.action === "DONE" ? "action" : message2.execution_type || "action";
|
|
105448
|
+
if (shouldUseBackgroundBlock && message2.message) {
|
|
105094
105449
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105095
105450
|
BackgroundBlock,
|
|
105096
105451
|
{
|
|
105097
105452
|
content: message2.message,
|
|
105098
105453
|
action: message2.action,
|
|
105099
|
-
executionType,
|
|
105100
|
-
isUser
|
|
105454
|
+
executionType: message2.execution_type || "action",
|
|
105455
|
+
isUser,
|
|
105456
|
+
code: message2.code,
|
|
105457
|
+
stdout: message2.stdout,
|
|
105458
|
+
stderr: message2.stderr,
|
|
105459
|
+
logging: message2.logging,
|
|
105460
|
+
files: message2.files
|
|
105101
105461
|
}
|
|
105102
105462
|
);
|
|
105103
105463
|
}
|
|
105104
105464
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(MessageContainer, { isUser, children: [
|
|
105105
105465
|
/* @__PURE__ */ jsxRuntimeExports.jsx(MessageAvatar, { isUser }),
|
|
105106
|
-
isSecurityCheck ? /* @__PURE__ */ jsxRuntimeExports.jsx(SecurityCheckHighlight, { isUser, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(MessagePaper, { isUser, children: [
|
|
105466
|
+
isSecurityCheck ? /* @__PURE__ */ jsxRuntimeExports.jsx(SecurityCheckHighlight, { isUser, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(MessagePaper, { isUser, content: message2.message, children: [
|
|
105107
105467
|
message2.files && message2.files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2 }, children: message2.files.filter((file) => isImage(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105108
105468
|
ImageAttachment,
|
|
105109
105469
|
{
|
|
@@ -105160,7 +105520,7 @@ const MessageItem = reactExports.memo(
|
|
|
105160
105520
|
taskClassification: message2.task_classification || "",
|
|
105161
105521
|
isUser,
|
|
105162
105522
|
executionType: message2.execution_type,
|
|
105163
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(MessagePaper, { isUser, children: [
|
|
105523
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(MessagePaper, { isUser, content: message2.message, children: [
|
|
105164
105524
|
message2.files && message2.files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2 }, children: message2.files.filter((file) => isImage(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105165
105525
|
ImageAttachment,
|
|
105166
105526
|
{
|
|
@@ -105240,6 +105600,23 @@ const MessagesContainer = styled$1(Box)(({ theme }) => ({
|
|
|
105240
105600
|
transform: "translateZ(0)",
|
|
105241
105601
|
willChange: "scroll-position"
|
|
105242
105602
|
}));
|
|
105603
|
+
const CenteredMessagesContainer = styled$1(Box)(({ theme }) => ({
|
|
105604
|
+
width: "100%",
|
|
105605
|
+
maxWidth: "900px",
|
|
105606
|
+
margin: "0 auto",
|
|
105607
|
+
display: "flex",
|
|
105608
|
+
flexDirection: "column",
|
|
105609
|
+
gap: 16,
|
|
105610
|
+
[theme.breakpoints.down("sm")]: {
|
|
105611
|
+
maxWidth: "100%"
|
|
105612
|
+
},
|
|
105613
|
+
[theme.breakpoints.between("sm", "md")]: {
|
|
105614
|
+
maxWidth: "90%"
|
|
105615
|
+
},
|
|
105616
|
+
[theme.breakpoints.up("md")]: {
|
|
105617
|
+
maxWidth: "900px"
|
|
105618
|
+
}
|
|
105619
|
+
}));
|
|
105243
105620
|
const LoadingMoreIndicator = styled$1(Box)(({ theme }) => ({
|
|
105244
105621
|
display: "flex",
|
|
105245
105622
|
alignItems: "center",
|
|
@@ -105288,25 +105665,38 @@ const MessagesView = ({
|
|
|
105288
105665
|
isLoadingMessages && !messages.length ? /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingBox, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CircularProgress, {}) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
105289
105666
|
messages.length > 0 ? (
|
|
105290
105667
|
// Only render visible messages plus a buffer
|
|
105291
|
-
|
|
105292
|
-
|
|
105293
|
-
|
|
105294
|
-
|
|
105668
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(CenteredMessagesContainer, { children: [
|
|
105669
|
+
messages.map((message2) => /* @__PURE__ */ jsxRuntimeExports.jsx(MessageItem, { message: message2 }, message2.id)),
|
|
105670
|
+
isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105671
|
+
LoadingIndicator,
|
|
105672
|
+
{
|
|
105673
|
+
status: jobStatus,
|
|
105674
|
+
agentName,
|
|
105675
|
+
currentExecution,
|
|
105676
|
+
scrollToBottom
|
|
105677
|
+
}
|
|
105678
|
+
)
|
|
105679
|
+
] })
|
|
105680
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
105681
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(EmptyMessagesBox, { children: [
|
|
105682
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(EmptyMessagesIcon, { icon: faCommentDots }),
|
|
105683
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", children: "No messages yet. Start a conversation!" })
|
|
105684
|
+
] }),
|
|
105685
|
+
isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(CenteredMessagesContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105686
|
+
LoadingIndicator,
|
|
105687
|
+
{
|
|
105688
|
+
status: jobStatus,
|
|
105689
|
+
agentName,
|
|
105690
|
+
currentExecution,
|
|
105691
|
+
scrollToBottom
|
|
105692
|
+
}
|
|
105693
|
+
) })
|
|
105295
105694
|
] }),
|
|
105296
|
-
isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105297
|
-
LoadingIndicator,
|
|
105298
|
-
{
|
|
105299
|
-
status: jobStatus,
|
|
105300
|
-
agentName,
|
|
105301
|
-
currentExecution,
|
|
105302
|
-
scrollToBottom
|
|
105303
|
-
}
|
|
105304
|
-
),
|
|
105305
105695
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: messagesEndRef })
|
|
105306
105696
|
] })
|
|
105307
105697
|
] });
|
|
105308
105698
|
};
|
|
105309
|
-
|
|
105699
|
+
styled$1(Box)({
|
|
105310
105700
|
flexGrow: 1,
|
|
105311
105701
|
overflow: "auto",
|
|
105312
105702
|
padding: 24,
|
|
@@ -105319,7 +105709,7 @@ const RawInfoContainer = styled$1(Box)({
|
|
|
105319
105709
|
borderRadius: "4px"
|
|
105320
105710
|
}
|
|
105321
105711
|
});
|
|
105322
|
-
|
|
105712
|
+
styled$1(Box)({
|
|
105323
105713
|
padding: 16,
|
|
105324
105714
|
backgroundColor: "rgba(0, 0, 0, 0.3)",
|
|
105325
105715
|
borderRadius: 4,
|
|
@@ -105327,12 +105717,6 @@ const RawInfoContent = styled$1(Box)({
|
|
|
105327
105717
|
whiteSpace: "pre-wrap",
|
|
105328
105718
|
overflow: "auto"
|
|
105329
105719
|
});
|
|
105330
|
-
const RawInfoView = ({ content: content2 }) => {
|
|
105331
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(RawInfoContainer, { children: [
|
|
105332
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "h6", gutterBottom: true, sx: { color: "primary.main" }, children: "Raw Information" }),
|
|
105333
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(RawInfoContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", component: "pre", sx: { fontSize: "0.8rem" }, children: content2 }) })
|
|
105334
|
-
] });
|
|
105335
|
-
};
|
|
105336
105720
|
const ChatContainer = styled$1(Paper)(({ theme }) => ({
|
|
105337
105721
|
display: "flex",
|
|
105338
105722
|
flexDirection: "column",
|
|
@@ -105383,27 +105767,22 @@ const ChatContent = ({
|
|
|
105383
105767
|
agentId
|
|
105384
105768
|
}
|
|
105385
105769
|
),
|
|
105386
|
-
|
|
105387
|
-
|
|
105388
|
-
|
|
105389
|
-
|
|
105390
|
-
|
|
105391
|
-
|
|
105392
|
-
|
|
105393
|
-
|
|
105394
|
-
|
|
105395
|
-
|
|
105396
|
-
|
|
105397
|
-
|
|
105398
|
-
|
|
105399
|
-
|
|
105400
|
-
|
|
105401
|
-
|
|
105402
|
-
}
|
|
105403
|
-
)
|
|
105404
|
-
) : (
|
|
105405
|
-
/* Raw information tab */
|
|
105406
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(RawInfoView, { content: rawInfoContent })
|
|
105770
|
+
isDevelopmentMode(),
|
|
105771
|
+
/* Messages container */
|
|
105772
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
105773
|
+
MessagesView,
|
|
105774
|
+
{
|
|
105775
|
+
messages,
|
|
105776
|
+
isLoading,
|
|
105777
|
+
isLoadingMessages,
|
|
105778
|
+
isFetchingMore,
|
|
105779
|
+
jobStatus,
|
|
105780
|
+
agentName,
|
|
105781
|
+
currentExecution,
|
|
105782
|
+
messagesContainerRef,
|
|
105783
|
+
messagesEndRef,
|
|
105784
|
+
scrollToBottom
|
|
105785
|
+
}
|
|
105407
105786
|
),
|
|
105408
105787
|
/* @__PURE__ */ jsxRuntimeExports.jsx(StyledDivider, {}),
|
|
105409
105788
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -107762,7 +108141,7 @@ const EmptyStateContainer$3 = styled$1(Box)({
|
|
|
107762
108141
|
const AgentsList$1 = styled$1(List$1)(({ theme }) => ({
|
|
107763
108142
|
overflow: "auto",
|
|
107764
108143
|
flexGrow: 1,
|
|
107765
|
-
padding: "8px",
|
|
108144
|
+
padding: "8px 0px",
|
|
107766
108145
|
"&::-webkit-scrollbar": {
|
|
107767
108146
|
width: "8px"
|
|
107768
108147
|
},
|
|
@@ -107772,19 +108151,23 @@ const AgentsList$1 = styled$1(List$1)(({ theme }) => ({
|
|
|
107772
108151
|
}
|
|
107773
108152
|
}));
|
|
107774
108153
|
const AgentListItemButton$1 = styled$1(ListItemButton)(({ theme }) => ({
|
|
107775
|
-
margin: "0 8px",
|
|
108154
|
+
margin: "0 8px 8px",
|
|
107776
108155
|
borderRadius: 8,
|
|
107777
|
-
|
|
107778
|
-
|
|
108156
|
+
paddingRight: 12,
|
|
108157
|
+
paddingTop: 6,
|
|
108158
|
+
paddingBottom: 6,
|
|
108159
|
+
paddingLeft: 12,
|
|
108160
|
+
position: "relative",
|
|
108161
|
+
// Ensure proper positioning context
|
|
107779
108162
|
"&.Mui-selected": {
|
|
107780
|
-
backgroundColor: theme.palette.sidebar.itemActive,
|
|
108163
|
+
backgroundColor: alpha(theme.palette.sidebar.itemActive, 0.1),
|
|
107781
108164
|
color: theme.palette.sidebar.itemActiveText,
|
|
107782
108165
|
"&:hover": {
|
|
107783
|
-
backgroundColor: theme.palette.sidebar.itemActiveHover
|
|
108166
|
+
backgroundColor: alpha(theme.palette.sidebar.itemActiveHover, 0.15)
|
|
107784
108167
|
}
|
|
107785
108168
|
},
|
|
107786
108169
|
"&:hover": {
|
|
107787
|
-
backgroundColor: theme.palette.sidebar.itemHover
|
|
108170
|
+
backgroundColor: alpha(theme.palette.sidebar.itemHover, 0.1)
|
|
107788
108171
|
}
|
|
107789
108172
|
}));
|
|
107790
108173
|
const AgentAvatar$1 = styled$1(Avatar, {
|
|
@@ -107792,30 +108175,93 @@ const AgentAvatar$1 = styled$1(Avatar, {
|
|
|
107792
108175
|
})(({ theme, selected }) => ({
|
|
107793
108176
|
backgroundColor: selected ? theme.palette.sidebar.itemActive : theme.palette.icon.background,
|
|
107794
108177
|
color: selected ? theme.palette.sidebar.itemActiveText : theme.palette.icon.text,
|
|
107795
|
-
boxShadow: `0 2px 4px ${alpha(theme.palette.common.black, 0.15)}
|
|
108178
|
+
boxShadow: `0 2px 4px ${alpha(theme.palette.common.black, 0.15)}`,
|
|
108179
|
+
width: 42,
|
|
108180
|
+
height: 42
|
|
107796
108181
|
}));
|
|
107797
|
-
const
|
|
107798
|
-
display: "
|
|
107799
|
-
|
|
107800
|
-
|
|
107801
|
-
|
|
107802
|
-
|
|
108182
|
+
const MessageBubble = styled$1("div")({
|
|
108183
|
+
display: "flex",
|
|
108184
|
+
flexDirection: "column",
|
|
108185
|
+
width: "100%",
|
|
108186
|
+
overflow: "hidden",
|
|
108187
|
+
position: "relative",
|
|
108188
|
+
// Ensure the message bubble maintains its layout
|
|
108189
|
+
isolation: "isolate"
|
|
108190
|
+
// Create a new stacking context
|
|
107803
108191
|
});
|
|
107804
|
-
const
|
|
108192
|
+
const AgentNameContainer = styled$1(Box)({
|
|
108193
|
+
display: "flex",
|
|
108194
|
+
justifyContent: "space-between",
|
|
108195
|
+
alignItems: "center",
|
|
108196
|
+
width: "100%",
|
|
108197
|
+
position: "relative",
|
|
108198
|
+
// Ensure the container maintains its position
|
|
108199
|
+
overflow: "hidden"
|
|
108200
|
+
});
|
|
108201
|
+
const AgentName = styled$1(Typography)(() => ({
|
|
108202
|
+
fontWeight: 600,
|
|
108203
|
+
fontSize: "0.9rem",
|
|
108204
|
+
whiteSpace: "nowrap",
|
|
108205
|
+
overflow: "hidden",
|
|
108206
|
+
textOverflow: "ellipsis",
|
|
108207
|
+
marginBottom: 2,
|
|
108208
|
+
flex: 1
|
|
108209
|
+
}));
|
|
108210
|
+
const MessagePreview = styled$1("div")(({ theme }) => ({
|
|
108211
|
+
fontSize: "0.8rem",
|
|
108212
|
+
color: theme.palette.mode === "dark" ? "rgba(255, 255, 255, 0.7)" : "rgba(0, 0, 0, 0.6)",
|
|
108213
|
+
whiteSpace: "nowrap",
|
|
108214
|
+
overflow: "hidden",
|
|
108215
|
+
textOverflow: "ellipsis",
|
|
108216
|
+
width: "100%",
|
|
108217
|
+
minHeight: "18px"
|
|
108218
|
+
}));
|
|
108219
|
+
const TimeStampContainer = styled$1("div")(({ theme }) => ({
|
|
107805
108220
|
display: "flex",
|
|
107806
108221
|
alignItems: "center",
|
|
107807
108222
|
color: theme.palette.mode === "dark" ? "rgba(255, 255, 255, 0.5)" : "rgba(0, 0, 0, 0.5)",
|
|
107808
|
-
fontSize: "0.
|
|
108223
|
+
fontSize: "0.7rem",
|
|
108224
|
+
marginLeft: 8,
|
|
108225
|
+
flexShrink: 0,
|
|
108226
|
+
transition: "transform 0.2s ease",
|
|
108227
|
+
".MuiListItemButton-root:hover &": {
|
|
108228
|
+
transform: "translateX(-24px)"
|
|
108229
|
+
},
|
|
108230
|
+
// Ensure the timestamp doesn't get affected by menu clicks
|
|
108231
|
+
pointerEvents: "none"
|
|
107809
108232
|
}));
|
|
107810
108233
|
const TimeStampText = styled$1("span")({
|
|
107811
108234
|
cursor: "help"
|
|
107812
108235
|
});
|
|
107813
|
-
const
|
|
108236
|
+
const OptionsButtonContainer = styled$1(Box)({
|
|
108237
|
+
position: "absolute",
|
|
108238
|
+
right: -8,
|
|
108239
|
+
top: 0,
|
|
108240
|
+
opacity: 0,
|
|
108241
|
+
transform: "translateX(100%)",
|
|
108242
|
+
transition: "opacity 0.2s ease, transform 0.2s ease",
|
|
108243
|
+
".MuiListItemButton-root:hover &": {
|
|
108244
|
+
opacity: 1,
|
|
108245
|
+
transform: "translateX(0)",
|
|
108246
|
+
visibility: "visible"
|
|
108247
|
+
},
|
|
108248
|
+
zIndex: 2,
|
|
108249
|
+
// Ensure the container doesn't affect layout when clicked
|
|
108250
|
+
pointerEvents: "none",
|
|
108251
|
+
"& > *": {
|
|
108252
|
+
pointerEvents: "auto"
|
|
108253
|
+
// Allow clicks on children (the button itself)
|
|
108254
|
+
}
|
|
108255
|
+
});
|
|
108256
|
+
const NoMessagesContainer = styled$1("div")(({ theme }) => ({
|
|
107814
108257
|
display: "flex",
|
|
107815
108258
|
alignItems: "center",
|
|
107816
108259
|
color: theme.palette.mode === "dark" ? "rgba(255, 255, 255, 0.5)" : "rgba(0, 0, 0, 0.5)",
|
|
107817
|
-
fontSize: "0.
|
|
107818
|
-
fontStyle: "italic"
|
|
108260
|
+
fontSize: "0.8rem",
|
|
108261
|
+
fontStyle: "italic",
|
|
108262
|
+
whiteSpace: "nowrap",
|
|
108263
|
+
overflow: "hidden",
|
|
108264
|
+
textOverflow: "ellipsis"
|
|
107819
108265
|
}));
|
|
107820
108266
|
const ChatSidebar = ({
|
|
107821
108267
|
selectedConversation,
|
|
@@ -107904,8 +108350,22 @@ const ChatSidebar = ({
|
|
|
107904
108350
|
const formatDateTime = (dateTimeString) => {
|
|
107905
108351
|
if (!dateTimeString) return "";
|
|
107906
108352
|
try {
|
|
107907
|
-
const
|
|
107908
|
-
|
|
108353
|
+
const messageDate = new Date(dateTimeString);
|
|
108354
|
+
const now = /* @__PURE__ */ new Date();
|
|
108355
|
+
const yesterday = new Date(now);
|
|
108356
|
+
yesterday.setDate(now.getDate() - 1);
|
|
108357
|
+
if (messageDate.toDateString() === now.toDateString()) {
|
|
108358
|
+
return format(messageDate, "h:mm a");
|
|
108359
|
+
}
|
|
108360
|
+
if (messageDate.toDateString() === yesterday.toDateString()) {
|
|
108361
|
+
return "Yesterday";
|
|
108362
|
+
}
|
|
108363
|
+
const oneWeekAgo = new Date(now);
|
|
108364
|
+
oneWeekAgo.setDate(now.getDate() - 7);
|
|
108365
|
+
if (messageDate > oneWeekAgo) {
|
|
108366
|
+
return format(messageDate, "EEEE");
|
|
108367
|
+
}
|
|
108368
|
+
return format(messageDate, "yyyy-MM-dd");
|
|
107909
108369
|
} catch (error) {
|
|
107910
108370
|
return "";
|
|
107911
108371
|
}
|
|
@@ -107950,106 +108410,96 @@ const ChatSidebar = ({
|
|
|
107950
108410
|
),
|
|
107951
108411
|
children: "Failed to load agents. Please try again."
|
|
107952
108412
|
}
|
|
107953
|
-
) : sortedAgents.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyStateContainer$3, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.secondary", children: "No agents found" }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(AgentsList$1, { children: sortedAgents.map((agent) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
107954
|
-
|
|
108413
|
+
) : sortedAgents.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyStateContainer$3, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.secondary", children: "No agents found" }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(AgentsList$1, { children: sortedAgents.map((agent) => /* @__PURE__ */ jsxRuntimeExports.jsx(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
108414
|
+
AgentListItemButton$1,
|
|
107955
108415
|
{
|
|
107956
|
-
|
|
107957
|
-
|
|
107958
|
-
|
|
107959
|
-
{
|
|
107960
|
-
|
|
107961
|
-
|
|
107962
|
-
isAgentsPage: false,
|
|
107963
|
-
onViewAgentSettings: onNavigateToAgentSettings ? () => onNavigateToAgentSettings(agent.id) : void 0,
|
|
107964
|
-
onExportAgent: () => handleExportAgent(agent.id),
|
|
107965
|
-
onAgentDeleted: (deletedAgentId) => {
|
|
107966
|
-
if (selectedConversation === deletedAgentId) {
|
|
107967
|
-
onSelectConversation("");
|
|
107968
|
-
}
|
|
107969
|
-
refetch();
|
|
107970
|
-
},
|
|
107971
|
-
buttonSx: {
|
|
107972
|
-
mr: 0.5,
|
|
107973
|
-
width: 32,
|
|
107974
|
-
height: 32,
|
|
107975
|
-
borderRadius: "8px",
|
|
107976
|
-
display: "flex",
|
|
107977
|
-
justifyContent: "center",
|
|
107978
|
-
alignItems: "center",
|
|
107979
|
-
".MuiListItem-root:hover &": {
|
|
107980
|
-
opacity: 0.6
|
|
107981
|
-
},
|
|
107982
|
-
".MuiListItemButton-root.Mui-selected + .MuiListItemSecondaryAction-root &": {
|
|
107983
|
-
opacity: 0.6
|
|
107984
|
-
}
|
|
107985
|
-
}
|
|
107986
|
-
}
|
|
107987
|
-
),
|
|
107988
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
107989
|
-
AgentListItemButton$1,
|
|
107990
|
-
{
|
|
107991
|
-
selected: selectedConversation === agent.id,
|
|
107992
|
-
onClick: () => handleSelectConversation(agent.id),
|
|
107993
|
-
children: [
|
|
107994
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemAvatar, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AgentAvatar$1, { selected: selectedConversation === agent.id, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faRobot }) }) }),
|
|
108416
|
+
selected: selectedConversation === agent.id,
|
|
108417
|
+
onClick: () => handleSelectConversation(agent.id),
|
|
108418
|
+
children: [
|
|
108419
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemAvatar, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AgentAvatar$1, { selected: selectedConversation === agent.id, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faRobot }) }) }),
|
|
108420
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(MessageBubble, { children: [
|
|
108421
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(AgentNameContainer, { children: [
|
|
107995
108422
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
107996
|
-
|
|
108423
|
+
Tooltip,
|
|
107997
108424
|
{
|
|
107998
|
-
|
|
107999
|
-
|
|
108000
|
-
|
|
108001
|
-
|
|
108002
|
-
|
|
108003
|
-
|
|
108004
|
-
|
|
108005
|
-
|
|
108006
|
-
|
|
108007
|
-
|
|
108008
|
-
|
|
108009
|
-
|
|
108010
|
-
|
|
108011
|
-
|
|
108012
|
-
|
|
108013
|
-
|
|
108014
|
-
|
|
108015
|
-
|
|
108016
|
-
|
|
108017
|
-
|
|
108018
|
-
|
|
108019
|
-
|
|
108020
|
-
|
|
108021
|
-
|
|
108022
|
-
|
|
108023
|
-
|
|
108024
|
-
|
|
108025
|
-
|
|
108026
|
-
|
|
108425
|
+
enterDelay: 1200,
|
|
108426
|
+
enterNextDelay: 1200,
|
|
108427
|
+
title: agent.name,
|
|
108428
|
+
arrow: true,
|
|
108429
|
+
placement: "top-start",
|
|
108430
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(AgentName, { children: agent.name })
|
|
108431
|
+
}
|
|
108432
|
+
),
|
|
108433
|
+
agent.last_message_datetime && /* @__PURE__ */ jsxRuntimeExports.jsx(TimeStampContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108434
|
+
TimeStampText,
|
|
108435
|
+
{
|
|
108436
|
+
title: new Date(
|
|
108437
|
+
agent.last_message_datetime
|
|
108438
|
+
).toLocaleString(),
|
|
108439
|
+
children: formatDateTime(agent.last_message_datetime)
|
|
108440
|
+
}
|
|
108441
|
+
) }),
|
|
108442
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(OptionsButtonContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108443
|
+
Tooltip,
|
|
108444
|
+
{
|
|
108445
|
+
enterDelay: 1200,
|
|
108446
|
+
enterNextDelay: 1200,
|
|
108447
|
+
title: "Agent Options",
|
|
108448
|
+
arrow: true,
|
|
108449
|
+
placement: "top",
|
|
108450
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108451
|
+
AgentOptionsMenu,
|
|
108452
|
+
{
|
|
108453
|
+
agentId: agent.id,
|
|
108454
|
+
agentName: agent.name,
|
|
108455
|
+
isAgentsPage: false,
|
|
108456
|
+
onViewAgentSettings: onNavigateToAgentSettings ? () => onNavigateToAgentSettings(agent.id) : void 0,
|
|
108457
|
+
onExportAgent: () => handleExportAgent(agent.id),
|
|
108458
|
+
onAgentDeleted: (deletedAgentId) => {
|
|
108459
|
+
if (selectedConversation === deletedAgentId) {
|
|
108460
|
+
onSelectConversation("");
|
|
108027
108461
|
}
|
|
108028
|
-
|
|
108029
|
-
|
|
108030
|
-
|
|
108031
|
-
|
|
108032
|
-
|
|
108033
|
-
|
|
108034
|
-
|
|
108035
|
-
|
|
108036
|
-
|
|
108462
|
+
refetch();
|
|
108463
|
+
},
|
|
108464
|
+
buttonSx: {
|
|
108465
|
+
width: 24,
|
|
108466
|
+
height: 24,
|
|
108467
|
+
borderRadius: "4px",
|
|
108468
|
+
display: "flex",
|
|
108469
|
+
justifyContent: "center",
|
|
108470
|
+
alignItems: "center",
|
|
108471
|
+
opacity: 1
|
|
108037
108472
|
}
|
|
108038
|
-
|
|
108039
|
-
|
|
108040
|
-
] }) }),
|
|
108041
|
-
primaryTypographyProps: {
|
|
108042
|
-
fontWeight: 500,
|
|
108043
|
-
variant: "body1"
|
|
108044
|
-
}
|
|
108473
|
+
}
|
|
108474
|
+
) })
|
|
108045
108475
|
}
|
|
108046
|
-
)
|
|
108047
|
-
]
|
|
108048
|
-
|
|
108049
|
-
|
|
108050
|
-
|
|
108051
|
-
|
|
108052
|
-
|
|
108476
|
+
) })
|
|
108477
|
+
] }),
|
|
108478
|
+
agent.last_message ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108479
|
+
Tooltip,
|
|
108480
|
+
{
|
|
108481
|
+
title: truncateMessage(agent.last_message, 500),
|
|
108482
|
+
arrow: true,
|
|
108483
|
+
placement: "bottom-start",
|
|
108484
|
+
enterDelay: 1200,
|
|
108485
|
+
enterNextDelay: 1200,
|
|
108486
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(MessagePreview, { children: truncateMessage(agent.last_message, 40) })
|
|
108487
|
+
}
|
|
108488
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsxs(NoMessagesContainer, { children: [
|
|
108489
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108490
|
+
FontAwesomeIcon,
|
|
108491
|
+
{
|
|
108492
|
+
icon: faCommentSlash,
|
|
108493
|
+
size: "xs",
|
|
108494
|
+
style: { marginRight: "4px" }
|
|
108495
|
+
}
|
|
108496
|
+
),
|
|
108497
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "No messages yet" })
|
|
108498
|
+
] })
|
|
108499
|
+
] })
|
|
108500
|
+
]
|
|
108501
|
+
}
|
|
108502
|
+
) }, agent.id)) }),
|
|
108053
108503
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108054
108504
|
CreateAgentDialog,
|
|
108055
108505
|
{
|
|
@@ -108152,6 +108602,11 @@ const ChatPage = () => {
|
|
|
108152
108602
|
const conversationId = effectiveAgentId || void 0;
|
|
108153
108603
|
const selectedConversation = effectiveAgentId || void 0;
|
|
108154
108604
|
const [activeTab, setActiveTab] = reactExports.useState("chat");
|
|
108605
|
+
reactExports.useEffect(() => {
|
|
108606
|
+
if (activeTab !== "chat") {
|
|
108607
|
+
setActiveTab("chat");
|
|
108608
|
+
}
|
|
108609
|
+
}, [activeTab]);
|
|
108155
108610
|
const [isOptionsSidebarOpen, setIsOptionsSidebarOpen] = reactExports.useState(false);
|
|
108156
108611
|
const apiClient = reactExports.useMemo(
|
|
108157
108612
|
() => createLocalOperatorClient(apiConfig.baseUrl),
|
|
@@ -108379,7 +108834,6 @@ Store messages: ${JSON.stringify(getMessages(conversationId || ""), null, 2)}`;
|
|
|
108379
108834
|
getMessages
|
|
108380
108835
|
]);
|
|
108381
108836
|
const handleTabChange = reactExports.useCallback((newTab) => {
|
|
108382
|
-
setActiveTab(newTab);
|
|
108383
108837
|
}, []);
|
|
108384
108838
|
const renderContent = () => {
|
|
108385
108839
|
if (!conversationId) {
|
|
@@ -114904,7 +115358,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
114904
115358
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CssBaseline, {}),
|
|
114905
115359
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(HashRouter, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(App, {}) }) }),
|
|
114906
115360
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ThemedToastContainer, {}),
|
|
114907
|
-
|
|
115361
|
+
isDevelopmentMode()
|
|
114908
115362
|
] }) }) })
|
|
114909
115363
|
);
|
|
114910
115364
|
});
|