local-operator-ui 0.5.1 → 0.5.2
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/out/main/index.jsc +0 -0
- package/out/preload/index.jsc +0 -0
- package/out/renderer/assets/{index-B87fKloA.js → index-BJAGPaLC.js} +1 -1
- package/out/renderer/assets/{index-CfuGYyUa.js → index-DTD3Qh6P.js} +1 -1
- package/out/renderer/assets/{index-CzJMsYKD.js → index-jZN-YHoh.js} +211 -206
- package/out/renderer/index.html +1 -1
- package/package.json +1 -1
package/out/main/index.jsc
CHANGED
|
Binary file
|
package/out/preload/index.jsc
CHANGED
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as LRParser, E as ExternalTokenizer, a as LocalTokenGroup, s as styleTags, C as ContextTracker, t as tags, b as LRLanguage, c as snippetCompletion, d as LanguageSupport, i as ifNotIn, e as completeFromList, f as indentNodeProp, g as foldNodeProp, h as continuedIndent, j as delimitedIndent, k as flatIndent, l as foldInside, m as syntaxTree, N as NodeWeakMap, I as IterMode } from "./index-
|
|
1
|
+
import { L as LRParser, E as ExternalTokenizer, a as LocalTokenGroup, s as styleTags, C as ContextTracker, t as tags, b as LRLanguage, c as snippetCompletion, d as LanguageSupport, i as ifNotIn, e as completeFromList, f as indentNodeProp, g as foldNodeProp, h as continuedIndent, j as delimitedIndent, k as flatIndent, l as foldInside, m as syntaxTree, N as NodeWeakMap, I as IterMode } from "./index-jZN-YHoh.js";
|
|
2
2
|
import "./fonts-ChEL5asK.js";
|
|
3
3
|
const insertedSemi = 177, space$1 = 179, identifier = 184, String = 12, closeParen$1 = 13, Number = 17, Rune = 20, closeBrace$1 = 25, closeBracket = 53, IncDecOp = 95, _return = 142, _break = 144, _continue = 145, fallthrough = 148;
|
|
4
4
|
const newline = 10, carriageReturn = 13, space = 32, tab = 9, slash = 47, closeParen = 41, closeBrace = 125;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as LRParser, E as ExternalTokenizer, s as styleTags, C as ContextTracker, t as tags, b as LRLanguage, d as LanguageSupport, p as parseMixed, f as indentNodeProp, g as foldNodeProp, j as delimitedIndent, l as foldInside } from "./index-
|
|
1
|
+
import { L as LRParser, E as ExternalTokenizer, s as styleTags, C as ContextTracker, t as tags, b as LRLanguage, d as LanguageSupport, p as parseMixed, f as indentNodeProp, g as foldNodeProp, j as delimitedIndent, l as foldInside } from "./index-jZN-YHoh.js";
|
|
2
2
|
import "./fonts-ChEL5asK.js";
|
|
3
3
|
const blockEnd = 63, eof = 64, DirectiveEnd = 1, DocEnd = 2, sequenceStartMark = 3, sequenceContinueMark = 4, explicitMapStartMark = 5, explicitMapContinueMark = 6, flowMapMark = 7, mapStartMark = 65, mapContinueMark = 66, Literal = 8, QuotedLiteral = 9, Anchor = 10, Alias = 11, Tag = 12, BlockLiteralContent = 13, BracketL = 19, FlowSequence = 20, Colon = 29, BraceL = 33, FlowMapping = 34, BlockLiteralHeader = 47;
|
|
4
4
|
const type_Top = 0, type_Seq = 1, type_Map = 2, type_Flow = 3, type_Lit = 4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BJAGPaLC.js","./fonts-ChEL5asK.js","./fonts-B9KBGB-g.css","./index-DTD3Qh6P.js","./pug-By0kVCfm.js","./javascript-C3MnDRiU.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import { c as createStyled, r as resolveProps, u as useTheme, a as reactExports, b as clsx, d as useForkRef, e as extendSxProp, j as jsxRuntimeExports, h as handleBreakpoints, f as resolveBreakpointValues, g as createUnarySpacing, i as deepmerge, m as mergeBreakpointsInOrder, k as composeClasses, l as generateUtilityClass, n as createTheme$1, o as getValue, R as React, p as getDefaultExportFromCjs, q as requireReactDom, s as React$1, t as generateUtilityClasses, v as useDefaultProps, w as styled$1, x as capitalize, y as memoTheme, _ as _inheritsLoose, z as _objectWithoutPropertiesLoose$i, T as TransitionGroupContext, A as duration, B as useTheme$1, C as useTimeout, D as useId, E as ButtonBase, F as alpha$1, G as createSimplePaletteValueFilter, H as CircularProgress, P as Paper, I as darken, J as lighten, K as useEventCallback, L as useEnhancedEffect, M as useRtl, N as globalCss, O as formatMuiErrorMessage, Q as rootShouldForwardProp, S as Typography, U as getPath$2, V as isFocusVisible, W as typographyClasses, X as slotShouldForwardProp, Y as css$1, Z as keyframes, $ as clamp, a0 as emphasize, a1 as Timeout, a2 as Button, a3 as Box, a4 as FontAwesomeIcon, a5 as faExclamationTriangle, a6 as faEllipsisVertical, a7 as faComment, a8 as faGear, a9 as faFileExport, aa as faBroom, ab as faTrash, ac as DEFAULT_THEME, ad as faChevronLeft, ae as faChevronRight, af as faRobot, ag as faCheck, ah as faTimes, ai as faEraser, aj as faPen, ak as faFileImport, al as faUpload, am as faPlus, an as faSearch, ao as requireReact, ap as LinearProgress, aq as faComments, ar as faInfoCircle, as as faServer, at as faStar, au as faTag, av as faIdCard, aw as faCalendarAlt, ax as faCodeBranch, ay as faShieldAlt, az as faArrowLeft, aA as faClock, aB as faHome, aC as faDownload, aD as faFileAlt, aE as faDesktop, aF as faImage, aG as faMusic, aH as faVideo, aI as faLaptop, aJ as faUsers, aK as faDatabase, aL as faBoxOpen, aM as faBook, aN as faHdd, aO as faBox, aP as faArchive, aQ as faNetworkWired, aR as faFolder, aS as faFolderOpen, aT as faFolderTree, aU as faChevronDown, aV as faTools, aW as _extends$u, aX as faSliders, aY as faArrowDown, aZ as faPaperclip, a_ as faStop, a$ as faPaperPlane, b0 as faChevronUp, b1 as faQuestion, b2 as faFile, b3 as faExclamationCircle, b4 as faLightbulb, b5 as faCode, b6 as faCommentDots, b7 as faEdit, b8 as faPencilAlt, b9 as faUser, ba as faCopy, bb as isDevelopmentMode, bc as faCommentSlash, bd as faArrowRight, be as faMagicWandSparkles, bf as faBrain, bg as faWandMagicSparkles, bh as faExternalLinkAlt, bi as faKey, bj as radientTheme, bk as faGlobe, bl as commonjsGlobal, bm as PropTypes, bn as faLock, bo as faSignOut, bp as faAdjust, bq as faSave, br as themes, 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 faEnvelope, bB as faHistory, bC as faListAlt, bD as faCreditCard, bE as faPlusCircle, bF as faChartLine, bG as faShield, bH as library$1, bI as icons$1, bJ as CssBaseline, bK as ThemeProvider$1, bL as getTheme, bM as ReactDOM$1, bN as ErrorBoundary } from "./fonts-ChEL5asK.js";
|
|
3
3
|
const styled = createStyled();
|
|
4
4
|
function getThemeProps(params) {
|
|
@@ -27066,15 +27066,23 @@ const AgentsApi = {
|
|
|
27066
27066
|
* @param page - Page number (default: 1)
|
|
27067
27067
|
* @param perPage - Number of agents per page (default: 10)
|
|
27068
27068
|
* @param name - Optional name query to search agents by name
|
|
27069
|
+
* @param sort - Optional field to sort by (e.g., 'name', 'created_date', 'last_message_datetime')
|
|
27070
|
+
* @param direction - Optional sort direction ('asc' or 'desc')
|
|
27069
27071
|
* @returns Promise resolving to the agents list response
|
|
27070
27072
|
*/
|
|
27071
|
-
async listAgents(baseUrl, page = 1, perPage = 10, name2) {
|
|
27073
|
+
async listAgents(baseUrl, page = 1, perPage = 10, name2, sort, direction) {
|
|
27072
27074
|
const url = new URL(`${baseUrl}/v1/agents`);
|
|
27073
27075
|
url.searchParams.append("page", page.toString());
|
|
27074
27076
|
url.searchParams.append("per_page", perPage.toString());
|
|
27075
27077
|
if (name2) {
|
|
27076
27078
|
url.searchParams.append("name", name2);
|
|
27077
27079
|
}
|
|
27080
|
+
if (sort) {
|
|
27081
|
+
url.searchParams.append("sort", sort);
|
|
27082
|
+
}
|
|
27083
|
+
if (direction) {
|
|
27084
|
+
url.searchParams.append("direction", direction);
|
|
27085
|
+
}
|
|
27078
27086
|
const response = await fetch(url.toString(), {
|
|
27079
27087
|
method: "GET",
|
|
27080
27088
|
headers: {
|
|
@@ -33132,7 +33140,7 @@ const useConnectivityGate = () => {
|
|
|
33132
33140
|
};
|
|
33133
33141
|
};
|
|
33134
33142
|
const agentsQueryKey = ["agents"];
|
|
33135
|
-
const useAgents = (page = 1, perPage = 50, refetchInterval = 0, name2) => {
|
|
33143
|
+
const useAgents = (page = 1, perPage = 50, refetchInterval = 0, name2, sort, direction) => {
|
|
33136
33144
|
const { shouldEnableQuery, getConnectivityError } = useConnectivityGate();
|
|
33137
33145
|
const connectivityError = getConnectivityError();
|
|
33138
33146
|
reactExports.useEffect(() => {
|
|
@@ -33143,15 +33151,21 @@ const useAgents = (page = 1, perPage = 50, refetchInterval = 0, name2) => {
|
|
|
33143
33151
|
return useQuery({
|
|
33144
33152
|
// Only enable the query if server is online (bypass internet check)
|
|
33145
33153
|
enabled: shouldEnableQuery({ bypassInternetCheck: true }),
|
|
33146
|
-
queryKey: [...agentsQueryKey, page, perPage, name2],
|
|
33154
|
+
queryKey: [...agentsQueryKey, page, perPage, name2, sort, direction],
|
|
33147
33155
|
queryFn: async () => {
|
|
33148
33156
|
try {
|
|
33149
33157
|
const client = createLocalOperatorClient(apiConfig.baseUrl);
|
|
33150
|
-
const response = await client.agents.listAgents(
|
|
33151
|
-
|
|
33158
|
+
const response = await client.agents.listAgents(
|
|
33159
|
+
page,
|
|
33160
|
+
perPage,
|
|
33161
|
+
name2,
|
|
33162
|
+
sort,
|
|
33163
|
+
direction
|
|
33164
|
+
);
|
|
33165
|
+
if (response.status >= 400 || !response.result) {
|
|
33152
33166
|
throw new Error(response.message || "Failed to fetch agents");
|
|
33153
33167
|
}
|
|
33154
|
-
return response.result
|
|
33168
|
+
return response.result;
|
|
33155
33169
|
} catch (error) {
|
|
33156
33170
|
const errorMessage = error instanceof Error ? error.message : "An unknown error occurred while fetching agents";
|
|
33157
33171
|
showErrorToast(errorMessage);
|
|
@@ -35684,7 +35698,9 @@ const useMessageInput = ({
|
|
|
35684
35698
|
setHistoryIndex(null);
|
|
35685
35699
|
draftMessageRef.current = "";
|
|
35686
35700
|
if (scrollToBottom) {
|
|
35687
|
-
|
|
35701
|
+
setTimeout(() => {
|
|
35702
|
+
scrollToBottom();
|
|
35703
|
+
}, 150);
|
|
35688
35704
|
}
|
|
35689
35705
|
}, [inputValue, onSubmit, scrollToBottom]);
|
|
35690
35706
|
const getCursorPosition = reactExports.useCallback(() => {
|
|
@@ -37354,7 +37370,7 @@ const useStreamingMessage = ({
|
|
|
37354
37370
|
};
|
|
37355
37371
|
doRefetch();
|
|
37356
37372
|
}
|
|
37357
|
-
},
|
|
37373
|
+
}, 500);
|
|
37358
37374
|
}
|
|
37359
37375
|
} else {
|
|
37360
37376
|
updateStreamingMessage(messageId, messageData);
|
|
@@ -37583,24 +37599,12 @@ const useStreamingMessage = ({
|
|
|
37583
37599
|
if (onComplete) {
|
|
37584
37600
|
onComplete(message2);
|
|
37585
37601
|
}
|
|
37586
|
-
if (refetchOnComplete) {
|
|
37587
|
-
const timer = setTimeout(() => {
|
|
37588
|
-
if (mountedRef.current) {
|
|
37589
|
-
refetchMessage().catch((error2) => {
|
|
37590
|
-
const errorMessage = error2 instanceof Error ? error2.message : String(error2);
|
|
37591
|
-
console.error(`Error auto-refetching message: ${errorMessage}`);
|
|
37592
|
-
});
|
|
37593
|
-
}
|
|
37594
|
-
}, 500);
|
|
37595
|
-
return () => clearTimeout(timer);
|
|
37596
|
-
}
|
|
37597
37602
|
if (!keepAlive) {
|
|
37598
37603
|
safeDisconnect();
|
|
37599
37604
|
}
|
|
37600
37605
|
} else if (!isComplete) {
|
|
37601
37606
|
isCompletePrevRef.current = false;
|
|
37602
37607
|
}
|
|
37603
|
-
return void 0;
|
|
37604
37608
|
}, [
|
|
37605
37609
|
isComplete,
|
|
37606
37610
|
message2,
|
|
@@ -37608,9 +37612,7 @@ const useStreamingMessage = ({
|
|
|
37608
37612
|
keepAlive,
|
|
37609
37613
|
safeDisconnect,
|
|
37610
37614
|
messageId,
|
|
37611
|
-
completeStreamingMessage
|
|
37612
|
-
refetchMessage,
|
|
37613
|
-
refetchOnComplete
|
|
37615
|
+
completeStreamingMessage
|
|
37614
37616
|
]);
|
|
37615
37617
|
return {
|
|
37616
37618
|
message: message2,
|
|
@@ -56079,7 +56081,13 @@ const ModelSelect = ({
|
|
|
56079
56081
|
},
|
|
56080
56082
|
getOptionLabel: (option2) => option2.name,
|
|
56081
56083
|
isOptionEqualToValue: (option2, value2) => option2.id === value2.id,
|
|
56082
|
-
groupBy: (option2) =>
|
|
56084
|
+
groupBy: (option2) => {
|
|
56085
|
+
const modelOption = option2;
|
|
56086
|
+
if (hostingId === "radient" && modelOption.id === "auto") {
|
|
56087
|
+
return "radient";
|
|
56088
|
+
}
|
|
56089
|
+
return getProviderFromId(modelOption.id);
|
|
56090
|
+
},
|
|
56083
56091
|
renderOption: (props2, option2) => {
|
|
56084
56092
|
const { key, ...rest } = props2;
|
|
56085
56093
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(OptionContainer, { children: [
|
|
@@ -56747,32 +56755,21 @@ const AgentsList$1 = styled$1(List$1)(({ theme: theme2 }) => ({
|
|
|
56747
56755
|
}));
|
|
56748
56756
|
const AgentListItemButton$1 = styled$1(ListItemButton)(({ theme: theme2 }) => ({
|
|
56749
56757
|
margin: "0 8px 8px",
|
|
56750
|
-
// Match chat sidebar margin
|
|
56751
56758
|
borderRadius: 8,
|
|
56752
|
-
// marginBottom: 4, // Removed, handled by margin bottom
|
|
56753
|
-
// marginBottom: 4, // Removed, handled by margin bottom
|
|
56754
56759
|
paddingRight: 12,
|
|
56755
|
-
// Match chat sidebar padding (now that secondaryAction is removed)
|
|
56756
56760
|
paddingTop: 6,
|
|
56757
|
-
// Match chat sidebar padding
|
|
56758
56761
|
paddingBottom: 6,
|
|
56759
|
-
// Match chat sidebar padding
|
|
56760
56762
|
paddingLeft: 12,
|
|
56761
|
-
// Match chat sidebar padding
|
|
56762
56763
|
position: "relative",
|
|
56763
|
-
// Add relative positioning like chat sidebar
|
|
56764
56764
|
"&.Mui-selected": {
|
|
56765
56765
|
backgroundColor: alpha$1(theme2.palette.sidebar.itemActive, 0.1),
|
|
56766
|
-
// Match chat sidebar alpha
|
|
56767
56766
|
color: theme2.palette.sidebar.itemActiveText,
|
|
56768
56767
|
"&:hover": {
|
|
56769
56768
|
backgroundColor: alpha$1(theme2.palette.sidebar.itemActiveHover, 0.15)
|
|
56770
|
-
// Match chat sidebar alpha
|
|
56771
56769
|
}
|
|
56772
56770
|
},
|
|
56773
56771
|
"&:hover": {
|
|
56774
56772
|
backgroundColor: alpha$1(theme2.palette.sidebar.itemHover, 0.1)
|
|
56775
|
-
// Match chat sidebar alpha
|
|
56776
56773
|
}
|
|
56777
56774
|
}));
|
|
56778
56775
|
const AgentAvatar$2 = styled$1(Avatar, {
|
|
@@ -56782,15 +56779,11 @@ const AgentAvatar$2 = styled$1(Avatar, {
|
|
|
56782
56779
|
color: selected ? theme2.palette.sidebar.itemActiveText : theme2.palette.icon.text,
|
|
56783
56780
|
boxShadow: `0 2px 4px ${alpha$1(theme2.palette.common.black, 0.15)}`,
|
|
56784
56781
|
width: 42,
|
|
56785
|
-
// Match chat sidebar avatar size
|
|
56786
56782
|
height: 42
|
|
56787
|
-
// Match chat sidebar avatar size
|
|
56788
56783
|
}));
|
|
56789
56784
|
const AgentName$1 = styled$1(Typography)(() => ({
|
|
56790
56785
|
fontWeight: 600,
|
|
56791
|
-
// Match chat sidebar
|
|
56792
56786
|
fontSize: "0.9rem",
|
|
56793
|
-
// Match chat sidebar
|
|
56794
56787
|
whiteSpace: "nowrap",
|
|
56795
56788
|
overflow: "hidden",
|
|
56796
56789
|
textOverflow: "ellipsis",
|
|
@@ -56798,50 +56791,37 @@ const AgentName$1 = styled$1(Typography)(() => ({
|
|
|
56798
56791
|
}));
|
|
56799
56792
|
const DescriptionText = styled$1("div")(({ theme: theme2 }) => ({
|
|
56800
56793
|
fontSize: "0.8rem",
|
|
56801
|
-
// Match chat sidebar message preview
|
|
56802
56794
|
color: theme2.palette.mode === "dark" ? "rgba(255, 255, 255, 0.7)" : "rgba(0, 0, 0, 0.6)",
|
|
56803
|
-
// Match chat sidebar message preview
|
|
56804
56795
|
whiteSpace: "nowrap",
|
|
56805
56796
|
overflow: "hidden",
|
|
56806
56797
|
textOverflow: "ellipsis",
|
|
56807
56798
|
width: "100%",
|
|
56808
56799
|
minHeight: "18px"
|
|
56809
|
-
// Match chat sidebar message preview
|
|
56810
56800
|
}));
|
|
56811
56801
|
const CreationDateText = styled$1("div")(({ theme: theme2 }) => ({
|
|
56812
56802
|
display: "flex",
|
|
56813
56803
|
alignItems: "center",
|
|
56814
56804
|
fontSize: "0.7rem",
|
|
56815
|
-
// Match chat sidebar timestamp
|
|
56816
56805
|
color: theme2.palette.mode === "dark" ? "rgba(255, 255, 255, 0.5)" : "rgba(0, 0, 0, 0.5)",
|
|
56817
|
-
// Match chat sidebar timestamp
|
|
56818
56806
|
marginTop: 2,
|
|
56819
|
-
// Add small margin like chat sidebar name/preview spacing
|
|
56820
56807
|
gap: 4
|
|
56821
56808
|
}));
|
|
56822
56809
|
const OptionsButtonContainer$1 = styled$1(Box)({
|
|
56823
56810
|
position: "absolute",
|
|
56824
56811
|
right: -8,
|
|
56825
|
-
// Position relative to the container it will be placed in
|
|
56826
56812
|
top: "50%",
|
|
56827
|
-
// Center vertically
|
|
56828
56813
|
transform: "translateY(-50%) translateX(100%)",
|
|
56829
|
-
// Center vertically and position off-screen horizontally
|
|
56830
56814
|
opacity: 0,
|
|
56831
56815
|
transition: "opacity 0.2s ease, transform 0.2s ease",
|
|
56832
|
-
// Target hover on the parent ListItemButton to trigger the effect
|
|
56833
56816
|
".MuiListItemButton-root:hover &": {
|
|
56834
56817
|
opacity: 1,
|
|
56835
56818
|
transform: "translateY(-50%) translateX(0)",
|
|
56836
|
-
// Center vertically and slide in horizontally on hover
|
|
56837
56819
|
visibility: "visible"
|
|
56838
56820
|
},
|
|
56839
56821
|
zIndex: 2,
|
|
56840
56822
|
pointerEvents: "none",
|
|
56841
|
-
// Container doesn't block clicks
|
|
56842
56823
|
"& > *": {
|
|
56843
56824
|
pointerEvents: "auto"
|
|
56844
|
-
// Button inside is clickable
|
|
56845
56825
|
}
|
|
56846
56826
|
});
|
|
56847
56827
|
const formatDate = (dateString) => {
|
|
@@ -56864,22 +56844,28 @@ const AgentsSidebar = ({
|
|
|
56864
56844
|
const perPage = 50;
|
|
56865
56845
|
const exportAgentMutation = useExportAgent();
|
|
56866
56846
|
const { page, setPage } = usePaginationParams();
|
|
56867
|
-
const [stableAgents, setStableAgents] = reactExports.useState([]);
|
|
56868
|
-
const prevFetchingRef = reactExports.useRef(false);
|
|
56869
56847
|
const {
|
|
56870
|
-
data:
|
|
56848
|
+
data: agentListResult,
|
|
56871
56849
|
isLoading,
|
|
56872
56850
|
isError,
|
|
56873
|
-
refetch
|
|
56874
|
-
|
|
56875
|
-
|
|
56876
|
-
|
|
56877
|
-
|
|
56878
|
-
|
|
56851
|
+
refetch
|
|
56852
|
+
} = useAgents(page, perPage, 0, searchQuery, "created_date", "desc");
|
|
56853
|
+
const agents = agentListResult?.agents || [];
|
|
56854
|
+
const totalAgents = agentListResult?.total || 0;
|
|
56855
|
+
const { data: selectedAgentDetails } = useAgent(
|
|
56856
|
+
// Only fetch if selectedAgentId exists and is not found in the current agents list
|
|
56857
|
+
selectedAgentId && !agents.find((a2) => a2.id === selectedAgentId) ? selectedAgentId : void 0
|
|
56858
|
+
);
|
|
56859
|
+
const combinedAgents = reactExports.useMemo(() => {
|
|
56860
|
+
const combined = [...agents];
|
|
56861
|
+
if (selectedAgentDetails && !combined.find((a2) => a2.id === selectedAgentDetails.id)) {
|
|
56862
|
+
combined.push(selectedAgentDetails);
|
|
56879
56863
|
}
|
|
56880
|
-
|
|
56881
|
-
|
|
56882
|
-
|
|
56864
|
+
combined.sort((a2, b2) => {
|
|
56865
|
+
return new Date(b2.created_date).getTime() - new Date(a2.created_date).getTime();
|
|
56866
|
+
});
|
|
56867
|
+
return combined;
|
|
56868
|
+
}, [agents, selectedAgentDetails]);
|
|
56883
56869
|
const handlePageChange = reactExports.useCallback(
|
|
56884
56870
|
(_event, value) => {
|
|
56885
56871
|
setPage(value);
|
|
@@ -56908,7 +56894,7 @@ const AgentsSidebar = ({
|
|
|
56908
56894
|
async (agentId) => {
|
|
56909
56895
|
try {
|
|
56910
56896
|
const blob = await exportAgentMutation.mutateAsync(agentId);
|
|
56911
|
-
const agent =
|
|
56897
|
+
const agent = combinedAgents.find((a22) => a22.id === agentId);
|
|
56912
56898
|
const agentName = agent ? agent.name.replace(/\s+/g, "-").toLowerCase() : agentId;
|
|
56913
56899
|
const url = URL.createObjectURL(blob);
|
|
56914
56900
|
const a2 = document.createElement("a");
|
|
@@ -56922,41 +56908,48 @@ const AgentsSidebar = ({
|
|
|
56922
56908
|
console.error("Failed to export agent:", error);
|
|
56923
56909
|
}
|
|
56924
56910
|
},
|
|
56925
|
-
[
|
|
56911
|
+
[combinedAgents, exportAgentMutation]
|
|
56912
|
+
// Use combinedAgents
|
|
56926
56913
|
);
|
|
56927
56914
|
const handleAgentCreated = reactExports.useCallback(
|
|
56928
56915
|
(agentId) => {
|
|
56929
56916
|
const fetchAndSelectAgent = async () => {
|
|
56930
56917
|
try {
|
|
56931
56918
|
const result = await refetch();
|
|
56932
|
-
const
|
|
56933
|
-
const createdAgent =
|
|
56919
|
+
const updatedAgentList = result.data?.agents || [];
|
|
56920
|
+
const createdAgent = updatedAgentList.find(
|
|
56934
56921
|
(agent) => agent.id === agentId
|
|
56935
56922
|
);
|
|
56936
|
-
if (createdAgent
|
|
56923
|
+
if (createdAgent) {
|
|
56937
56924
|
onSelectAgent(createdAgent);
|
|
56938
56925
|
} else {
|
|
56939
|
-
|
|
56940
|
-
|
|
56941
|
-
|
|
56942
|
-
|
|
56943
|
-
|
|
56944
|
-
|
|
56926
|
+
try {
|
|
56927
|
+
const { data: newAgentDetails } = await refetch();
|
|
56928
|
+
const foundAgent = (newAgentDetails?.agents || []).find(
|
|
56929
|
+
(a2) => a2.id === agentId
|
|
56930
|
+
);
|
|
56931
|
+
if (foundAgent) {
|
|
56932
|
+
onSelectAgent(foundAgent);
|
|
56933
|
+
} else {
|
|
56934
|
+
console.warn(
|
|
56935
|
+
"Newly created agent not found immediately after refetch."
|
|
56936
|
+
);
|
|
56945
56937
|
}
|
|
56946
|
-
})
|
|
56947
|
-
|
|
56948
|
-
|
|
56949
|
-
|
|
56938
|
+
} catch (fetchError) {
|
|
56939
|
+
console.error(
|
|
56940
|
+
"Error fetching newly created agent details:",
|
|
56941
|
+
fetchError
|
|
56942
|
+
);
|
|
56950
56943
|
}
|
|
56951
56944
|
}
|
|
56952
56945
|
} catch (error) {
|
|
56953
|
-
console.error("Error
|
|
56954
|
-
refetch();
|
|
56946
|
+
console.error("Error refetching agents list:", error);
|
|
56955
56947
|
}
|
|
56956
56948
|
};
|
|
56957
56949
|
fetchAndSelectAgent();
|
|
56958
56950
|
},
|
|
56959
56951
|
[onSelectAgent, refetch]
|
|
56952
|
+
// Keep dependencies
|
|
56960
56953
|
);
|
|
56961
56954
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(SidebarContainer$4, { elevation: 0, children: [
|
|
56962
56955
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -56986,101 +56979,96 @@ const AgentsSidebar = ({
|
|
|
56986
56979
|
),
|
|
56987
56980
|
children: "Failed to load agents. Please try again."
|
|
56988
56981
|
}
|
|
56989
|
-
) :
|
|
56982
|
+
) : combinedAgents.length === 0 && !isLoading ? (
|
|
56983
|
+
// Check combinedAgents and isLoading
|
|
56984
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(EmptyStateContainer$3, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.secondary", children: searchQuery ? "No agents match your search" : "No agents found" }) })
|
|
56985
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(AgentsList$1, { children: combinedAgents.map((agent) => /* @__PURE__ */ jsxRuntimeExports.jsx(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
56990
56986
|
AgentListItemButton$1,
|
|
56991
56987
|
{
|
|
56992
|
-
selected: selectedAgentId === agent.id,
|
|
56988
|
+
selected: selectedAgentId === agent.id || selectedAgentDetails?.id === agent.id,
|
|
56993
56989
|
onClick: () => handleSelectAgent(agent),
|
|
56994
56990
|
children: [
|
|
56995
56991
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemAvatar, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AgentAvatar$2, { selected: selectedAgentId === agent.id, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faRobot }) }) }),
|
|
56996
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
56997
|
-
|
|
56992
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemText, { disableTypography: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
56993
|
+
Box,
|
|
56998
56994
|
{
|
|
56999
|
-
|
|
57000
|
-
|
|
57001
|
-
|
|
57002
|
-
|
|
57003
|
-
|
|
57004
|
-
|
|
57005
|
-
|
|
57006
|
-
|
|
57007
|
-
|
|
57008
|
-
|
|
57009
|
-
|
|
57010
|
-
|
|
57011
|
-
|
|
57012
|
-
|
|
57013
|
-
|
|
57014
|
-
|
|
57015
|
-
|
|
57016
|
-
|
|
57017
|
-
|
|
57018
|
-
|
|
57019
|
-
|
|
57020
|
-
|
|
57021
|
-
|
|
57022
|
-
|
|
57023
|
-
|
|
57024
|
-
|
|
57025
|
-
|
|
57026
|
-
|
|
57027
|
-
|
|
57028
|
-
|
|
57029
|
-
|
|
57030
|
-
)
|
|
57031
|
-
|
|
57032
|
-
|
|
57033
|
-
|
|
57034
|
-
|
|
57035
|
-
|
|
57036
|
-
|
|
57037
|
-
|
|
57038
|
-
|
|
57039
|
-
|
|
57040
|
-
|
|
57041
|
-
|
|
57042
|
-
|
|
57043
|
-
|
|
57044
|
-
|
|
57045
|
-
|
|
57046
|
-
|
|
56995
|
+
sx: {
|
|
56996
|
+
position: "relative",
|
|
56997
|
+
width: "100%",
|
|
56998
|
+
overflow: "hidden"
|
|
56999
|
+
},
|
|
57000
|
+
children: [
|
|
57001
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57002
|
+
Tooltip$1,
|
|
57003
|
+
{
|
|
57004
|
+
enterDelay: 1200,
|
|
57005
|
+
enterNextDelay: 1200,
|
|
57006
|
+
title: agent.name,
|
|
57007
|
+
arrow: true,
|
|
57008
|
+
placement: "top-start",
|
|
57009
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(AgentName$1, { children: agent.name })
|
|
57010
|
+
}
|
|
57011
|
+
),
|
|
57012
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57013
|
+
Tooltip$1,
|
|
57014
|
+
{
|
|
57015
|
+
title: agent.description || "No description",
|
|
57016
|
+
arrow: true,
|
|
57017
|
+
placement: "bottom-start",
|
|
57018
|
+
enterDelay: 1200,
|
|
57019
|
+
enterNextDelay: 1200,
|
|
57020
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(DescriptionText, { children: agent.description || "No description" })
|
|
57021
|
+
}
|
|
57022
|
+
),
|
|
57023
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57024
|
+
Tooltip$1,
|
|
57025
|
+
{
|
|
57026
|
+
title: `Created: ${formatDate(agent.created_date)}`,
|
|
57027
|
+
arrow: true,
|
|
57028
|
+
placement: "bottom-start",
|
|
57029
|
+
enterDelay: 1200,
|
|
57030
|
+
enterNextDelay: 1200,
|
|
57031
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(CreationDateText, { children: [
|
|
57032
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faClock, size: "xs" }),
|
|
57033
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: formatDate(agent.created_date) })
|
|
57034
|
+
] })
|
|
57035
|
+
}
|
|
57036
|
+
),
|
|
57037
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(OptionsButtonContainer$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57038
|
+
Tooltip$1,
|
|
57039
|
+
{
|
|
57040
|
+
enterDelay: 1200,
|
|
57041
|
+
enterNextDelay: 1200,
|
|
57042
|
+
title: "Agent Options",
|
|
57043
|
+
arrow: true,
|
|
57044
|
+
placement: "top",
|
|
57045
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57046
|
+
AgentOptionsMenu,
|
|
57047
57047
|
{
|
|
57048
|
-
|
|
57049
|
-
|
|
57050
|
-
|
|
57051
|
-
|
|
57052
|
-
|
|
57053
|
-
|
|
57054
|
-
|
|
57055
|
-
|
|
57056
|
-
|
|
57057
|
-
|
|
57058
|
-
|
|
57059
|
-
|
|
57060
|
-
|
|
57061
|
-
|
|
57062
|
-
|
|
57063
|
-
|
|
57064
|
-
|
|
57065
|
-
// Match chat sidebar options button style
|
|
57066
|
-
width: 24,
|
|
57067
|
-
height: 24,
|
|
57068
|
-
borderRadius: "4px",
|
|
57069
|
-
display: "flex",
|
|
57070
|
-
justifyContent: "center",
|
|
57071
|
-
alignItems: "center",
|
|
57072
|
-
opacity: 1
|
|
57073
|
-
// Opacity controlled by container
|
|
57074
|
-
}
|
|
57075
|
-
}
|
|
57076
|
-
) })
|
|
57048
|
+
agentId: agent.id,
|
|
57049
|
+
agentName: agent.name,
|
|
57050
|
+
isAgentsPage: true,
|
|
57051
|
+
onAgentDeleted: (deletedAgentId) => {
|
|
57052
|
+
refetch();
|
|
57053
|
+
},
|
|
57054
|
+
onChatWithAgent: () => navigate(`/chat/${agent.id}`),
|
|
57055
|
+
onExportAgent: () => handleExportAgent(agent.id),
|
|
57056
|
+
buttonSx: {
|
|
57057
|
+
width: 24,
|
|
57058
|
+
height: 24,
|
|
57059
|
+
borderRadius: "4px",
|
|
57060
|
+
display: "flex",
|
|
57061
|
+
justifyContent: "center",
|
|
57062
|
+
alignItems: "center",
|
|
57063
|
+
opacity: 1
|
|
57064
|
+
}
|
|
57077
57065
|
}
|
|
57078
57066
|
) })
|
|
57079
|
-
|
|
57080
|
-
}
|
|
57081
|
-
|
|
57067
|
+
}
|
|
57068
|
+
) })
|
|
57069
|
+
]
|
|
57082
57070
|
}
|
|
57083
|
-
)
|
|
57071
|
+
) })
|
|
57084
57072
|
]
|
|
57085
57073
|
}
|
|
57086
57074
|
) }, agent.id)) }),
|
|
@@ -57100,11 +57088,11 @@ const AgentsSidebar = ({
|
|
|
57100
57088
|
onAgentImported: handleAgentCreated
|
|
57101
57089
|
}
|
|
57102
57090
|
),
|
|
57103
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57091
|
+
totalAgents > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57104
57092
|
CompactPagination,
|
|
57105
57093
|
{
|
|
57106
57094
|
page,
|
|
57107
|
-
count: Math.max(1, Math.ceil(
|
|
57095
|
+
count: Math.max(1, Math.ceil(totalAgents / perPage)),
|
|
57108
57096
|
onChange: (newPage) => handlePageChange({}, newPage)
|
|
57109
57097
|
}
|
|
57110
57098
|
)
|
|
@@ -57151,7 +57139,8 @@ const AgentsPage = () => {
|
|
|
57151
57139
|
const prevAgentIdRef = reactExports.useRef(agentId);
|
|
57152
57140
|
const exportAgentMutation = useExportAgent();
|
|
57153
57141
|
const { setLastAgentsPageAgentId, getLastAgentId, clearLastAgentId } = useAgentSelectionStore();
|
|
57154
|
-
const { data:
|
|
57142
|
+
const { data: agentListResult } = useAgents();
|
|
57143
|
+
const agents = agentListResult?.agents || [];
|
|
57155
57144
|
const effectiveAgentId = agentId || getLastAgentId("agents");
|
|
57156
57145
|
const [selectedAgent, setSelectedAgent] = reactExports.useState(null);
|
|
57157
57146
|
const { data: initialAgent, refetch: refetchAgent } = useAgent(
|
|
@@ -57168,7 +57157,7 @@ const AgentsPage = () => {
|
|
|
57168
57157
|
}, 0);
|
|
57169
57158
|
}
|
|
57170
57159
|
}
|
|
57171
|
-
}, [effectiveAgentId, agents]);
|
|
57160
|
+
}, [effectiveAgentId, agents, clearLastAgentId, clearAgentId]);
|
|
57172
57161
|
reactExports.useEffect(() => {
|
|
57173
57162
|
if (agentId) {
|
|
57174
57163
|
setLastAgentsPageAgentId(agentId);
|
|
@@ -57855,12 +57844,15 @@ const DirectoryIndicator = ({
|
|
|
57855
57844
|
)
|
|
57856
57845
|
] }) });
|
|
57857
57846
|
};
|
|
57858
|
-
const UtilitiesContainer = styled$1(Box)(
|
|
57859
|
-
|
|
57860
|
-
|
|
57861
|
-
|
|
57862
|
-
|
|
57863
|
-
|
|
57847
|
+
const UtilitiesContainer = styled$1(Box)(
|
|
57848
|
+
({ theme: theme2, expanded }) => ({
|
|
57849
|
+
padding: theme2.spacing(1, 3),
|
|
57850
|
+
backgroundColor: alpha$1(theme2.palette.background.paper, 0.4),
|
|
57851
|
+
borderTop: `1px solid ${alpha$1(theme2.palette.divider, 0.1)}`,
|
|
57852
|
+
// Apply minHeight only when collapsed to allow expansion
|
|
57853
|
+
minHeight: expanded ? "auto" : 52
|
|
57854
|
+
})
|
|
57855
|
+
);
|
|
57864
57856
|
const UtilitiesHeader = styled$1(Box)(({ theme: theme2 }) => ({
|
|
57865
57857
|
display: "flex",
|
|
57866
57858
|
alignItems: "center",
|
|
@@ -57888,7 +57880,7 @@ const ChatUtilities = ({
|
|
|
57888
57880
|
setExpanded(!expanded);
|
|
57889
57881
|
};
|
|
57890
57882
|
if (!agentId) return null;
|
|
57891
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(UtilitiesContainer, { children: [
|
|
57883
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(UtilitiesContainer, { expanded, children: [
|
|
57892
57884
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(UtilitiesHeader, { onClick: toggleExpanded, children: [
|
|
57893
57885
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57894
57886
|
IconButton,
|
|
@@ -76428,7 +76420,7 @@ const languages = [
|
|
|
76428
76420
|
name: "Go",
|
|
76429
76421
|
extensions: ["go"],
|
|
76430
76422
|
load() {
|
|
76431
|
-
return __vitePreload(() => import("./index-
|
|
76423
|
+
return __vitePreload(() => import("./index-BJAGPaLC.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url).then((m2) => m2.go());
|
|
76432
76424
|
}
|
|
76433
76425
|
}),
|
|
76434
76426
|
/* @__PURE__ */ LanguageDescription.of({
|
|
@@ -76605,7 +76597,7 @@ const languages = [
|
|
|
76605
76597
|
alias: ["yml"],
|
|
76606
76598
|
extensions: ["yaml", "yml"],
|
|
76607
76599
|
load() {
|
|
76608
|
-
return __vitePreload(() => import("./index-
|
|
76600
|
+
return __vitePreload(() => import("./index-DTD3Qh6P.js"), true ? __vite__mapDeps([3,1,2]) : void 0, import.meta.url).then((m2) => m2.yaml());
|
|
76609
76601
|
}
|
|
76610
76602
|
}),
|
|
76611
76603
|
// Legacy modes ported from CodeMirror 5
|
|
@@ -178232,7 +178224,6 @@ const AgentListItemButton = styled$1(ListItemButton)(({ theme: theme2 }) => ({
|
|
|
178232
178224
|
paddingBottom: 6,
|
|
178233
178225
|
paddingLeft: 12,
|
|
178234
178226
|
position: "relative",
|
|
178235
|
-
// Ensure proper positioning context
|
|
178236
178227
|
"&.Mui-selected": {
|
|
178237
178228
|
backgroundColor: alpha$1(theme2.palette.sidebar.itemActive, 0.1),
|
|
178238
178229
|
color: theme2.palette.sidebar.itemActiveText,
|
|
@@ -178259,9 +178250,7 @@ const MessageBubble = styled$1("div")({
|
|
|
178259
178250
|
width: "100%",
|
|
178260
178251
|
overflow: "hidden",
|
|
178261
178252
|
position: "relative",
|
|
178262
|
-
// Ensure the message bubble maintains its layout
|
|
178263
178253
|
isolation: "isolate"
|
|
178264
|
-
// Create a new stacking context
|
|
178265
178254
|
});
|
|
178266
178255
|
const AgentNameContainer = styled$1(Box)({
|
|
178267
178256
|
display: "flex",
|
|
@@ -178269,7 +178258,6 @@ const AgentNameContainer = styled$1(Box)({
|
|
|
178269
178258
|
alignItems: "center",
|
|
178270
178259
|
width: "100%",
|
|
178271
178260
|
position: "relative",
|
|
178272
|
-
// Ensure the container maintains its position
|
|
178273
178261
|
overflow: "hidden"
|
|
178274
178262
|
});
|
|
178275
178263
|
const AgentName = styled$1(Typography)(() => ({
|
|
@@ -178320,11 +178308,9 @@ const OptionsButtonContainer = styled$1(Box)({
|
|
|
178320
178308
|
visibility: "visible"
|
|
178321
178309
|
},
|
|
178322
178310
|
zIndex: 2,
|
|
178323
|
-
// Ensure the container doesn't affect layout when clicked
|
|
178324
178311
|
pointerEvents: "none",
|
|
178325
178312
|
"& > *": {
|
|
178326
178313
|
pointerEvents: "auto"
|
|
178327
|
-
// Allow clicks on children (the button itself)
|
|
178328
178314
|
}
|
|
178329
178315
|
});
|
|
178330
178316
|
const NoMessagesContainer = styled$1("div")(({ theme: theme2 }) => ({
|
|
@@ -178350,11 +178336,32 @@ const ChatSidebar = ({
|
|
|
178350
178336
|
const clearConversationMutation = useClearAgentConversation();
|
|
178351
178337
|
const { page, setPage } = usePaginationParams();
|
|
178352
178338
|
const {
|
|
178353
|
-
data:
|
|
178339
|
+
data: agentListResult,
|
|
178340
|
+
// Rename data to agentListResult
|
|
178354
178341
|
isLoading,
|
|
178355
178342
|
isError,
|
|
178356
178343
|
refetch
|
|
178357
|
-
} = useAgents(
|
|
178344
|
+
} = useAgents(
|
|
178345
|
+
page,
|
|
178346
|
+
perPage,
|
|
178347
|
+
5e3,
|
|
178348
|
+
searchQuery,
|
|
178349
|
+
"last_message_datetime",
|
|
178350
|
+
"desc"
|
|
178351
|
+
);
|
|
178352
|
+
const agents = agentListResult?.agents || [];
|
|
178353
|
+
const totalAgents = agentListResult?.total || 0;
|
|
178354
|
+
const { data: selectedAgentDetails } = useAgent(
|
|
178355
|
+
// Only fetch if selectedConversation exists and is not found in the current agents list
|
|
178356
|
+
selectedConversation && !agents.find((a2) => a2.id === selectedConversation) ? selectedConversation : void 0
|
|
178357
|
+
);
|
|
178358
|
+
const combinedAgents = reactExports.useMemo(() => {
|
|
178359
|
+
const combined = [...agents];
|
|
178360
|
+
if (selectedAgentDetails && !combined.find((a2) => a2.id === selectedAgentDetails.id)) {
|
|
178361
|
+
combined.push(selectedAgentDetails);
|
|
178362
|
+
}
|
|
178363
|
+
return combined;
|
|
178364
|
+
}, [agents, selectedAgentDetails]);
|
|
178358
178365
|
const handlePageChange = reactExports.useCallback(
|
|
178359
178366
|
(_event, value) => {
|
|
178360
178367
|
setPage(value);
|
|
@@ -178383,7 +178390,7 @@ const ChatSidebar = ({
|
|
|
178383
178390
|
async (agentId) => {
|
|
178384
178391
|
try {
|
|
178385
178392
|
const blob = await exportAgentMutation.mutateAsync(agentId);
|
|
178386
|
-
const agent =
|
|
178393
|
+
const agent = combinedAgents.find((a22) => a22.id === agentId);
|
|
178387
178394
|
const agentName = agent ? agent.name.replace(/\s+/g, "-").toLowerCase() : agentId;
|
|
178388
178395
|
const url = URL.createObjectURL(blob);
|
|
178389
178396
|
const a2 = document.createElement("a");
|
|
@@ -178397,15 +178404,16 @@ const ChatSidebar = ({
|
|
|
178397
178404
|
console.error("Failed to export agent:", error);
|
|
178398
178405
|
}
|
|
178399
178406
|
},
|
|
178400
|
-
[
|
|
178407
|
+
[combinedAgents, exportAgentMutation]
|
|
178408
|
+
// Use combinedAgents
|
|
178401
178409
|
);
|
|
178402
178410
|
const handleAgentCreated = reactExports.useCallback(
|
|
178403
178411
|
(agentId) => {
|
|
178404
178412
|
const fetchAndSelectAgent = async () => {
|
|
178405
178413
|
try {
|
|
178406
178414
|
const result = await refetch();
|
|
178407
|
-
const
|
|
178408
|
-
const createdAgent =
|
|
178415
|
+
const updatedAgentList = result.data?.agents || [];
|
|
178416
|
+
const createdAgent = updatedAgentList.find(
|
|
178409
178417
|
(agent) => agent.id === agentId
|
|
178410
178418
|
);
|
|
178411
178419
|
if (createdAgent) {
|
|
@@ -178426,14 +178434,6 @@ const ChatSidebar = ({
|
|
|
178426
178434
|
if (!message2) return "";
|
|
178427
178435
|
return message2.length > maxLength ? `${message2.substring(0, maxLength)}...` : message2;
|
|
178428
178436
|
};
|
|
178429
|
-
const sortedAgents = [...agents].sort((a2, b2) => {
|
|
178430
|
-
if (a2.last_message_datetime && b2.last_message_datetime) {
|
|
178431
|
-
return new Date(b2.last_message_datetime).getTime() - new Date(a2.last_message_datetime).getTime();
|
|
178432
|
-
}
|
|
178433
|
-
if (a2.last_message_datetime) return -1;
|
|
178434
|
-
if (b2.last_message_datetime) return 1;
|
|
178435
|
-
return 0;
|
|
178436
|
-
});
|
|
178437
178437
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(SidebarContainer$2, { elevation: 0, children: [
|
|
178438
178438
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
178439
178439
|
SidebarHeader$2,
|
|
@@ -178462,10 +178462,13 @@ const ChatSidebar = ({
|
|
|
178462
178462
|
),
|
|
178463
178463
|
children: "Failed to load agents. Please try again."
|
|
178464
178464
|
}
|
|
178465
|
-
) :
|
|
178465
|
+
) : combinedAgents.length === 0 && !isLoading ? (
|
|
178466
|
+
// Check combinedAgents and isLoading
|
|
178467
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(EmptyStateContainer$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", color: "text.secondary", children: searchQuery ? "No agents match your search" : "No agents found" }) })
|
|
178468
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(AgentsList, { children: combinedAgents.map((agent) => /* @__PURE__ */ jsxRuntimeExports.jsx(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
178466
178469
|
AgentListItemButton,
|
|
178467
178470
|
{
|
|
178468
|
-
selected: selectedConversation === agent.id,
|
|
178471
|
+
selected: selectedConversation === agent.id || selectedAgentDetails?.id === agent.id,
|
|
178469
178472
|
onClick: () => handleSelectConversation(agent.id),
|
|
178470
178473
|
children: [
|
|
178471
178474
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemAvatar, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AgentAvatar, { selected: selectedConversation === agent.id, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faRobot }) }) }),
|
|
@@ -178571,11 +178574,11 @@ const ChatSidebar = ({
|
|
|
178571
178574
|
onAgentImported: handleAgentCreated
|
|
178572
178575
|
}
|
|
178573
178576
|
),
|
|
178574
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
178577
|
+
totalAgents > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
178575
178578
|
CompactPagination,
|
|
178576
178579
|
{
|
|
178577
178580
|
page,
|
|
178578
|
-
count: Math.max(1, Math.ceil(
|
|
178581
|
+
count: Math.max(1, Math.ceil(totalAgents / perPage)),
|
|
178579
178582
|
onChange: (newPage) => handlePageChange({}, newPage)
|
|
178580
178583
|
}
|
|
178581
178584
|
)
|
|
@@ -178700,8 +178703,10 @@ const ChatPage = () => {
|
|
|
178700
178703
|
);
|
|
178701
178704
|
const messagesEndRef = reactExports.useRef(null);
|
|
178702
178705
|
reactExports.useEffect(() => {
|
|
178703
|
-
if (effectiveAgentId && agents.length > 0) {
|
|
178704
|
-
const agentExists = agents.some(
|
|
178706
|
+
if (effectiveAgentId && agents && "agents" in agents && agents.agents.length > 0) {
|
|
178707
|
+
const agentExists = agents.agents.some(
|
|
178708
|
+
(agent) => agent.id === effectiveAgentId
|
|
178709
|
+
);
|
|
178705
178710
|
if (!agentExists) {
|
|
178706
178711
|
setTimeout(() => {
|
|
178707
178712
|
clearLastAgentId("chat");
|
package/out/renderer/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<meta http-equiv="Content-Security-Policy"
|
|
10
10
|
content="default-src 'self'; connect-src 'self' http://localhost:1111 http://127.0.0.1:1111 ws://localhost:1111 ws://127.0.0.1:1111 http://localhost:8080 http://127.0.0.1:8080 https://api.radienthq.com https://us.i.posthog.com https://login.microsoftonline.com https://accounts.google.com; script-src 'self' https://us-assets.i.posthog.com https://accounts.google.com https://login.microsoftonline.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: http://localhost:1111 http://127.0.0.1:1111; media-src 'self' http://localhost:1111 http://127.0.0.1:1111; font-src 'self'; frame-src 'self' https://accounts.google.com https://login.microsoftonline.com" />
|
|
11
11
|
<meta http-equiv="Cross-Origin-Opener-Policy" content="same-origin-allow-popups" />
|
|
12
|
-
<script type="module" crossorigin src="./assets/index-
|
|
12
|
+
<script type="module" crossorigin src="./assets/index-jZN-YHoh.js"></script>
|
|
13
13
|
<link rel="modulepreload" crossorigin href="./assets/fonts-ChEL5asK.js">
|
|
14
14
|
<link rel="stylesheet" crossorigin href="./assets/fonts-B9KBGB-g.css">
|
|
15
15
|
<link rel="stylesheet" crossorigin href="./assets/index-0vP6mKPB.css">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "local-operator-ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"productName": "Local Operator",
|
|
5
5
|
"description": "User interface for AI agent assistants that run Python code safely on your device through an intuitive chat interface. Supports local and cloud LLM models with built-in security features.",
|
|
6
6
|
"main": "./out/main/index.js",
|