@@ -16,7 +16,7 @@ import {
1616 Switch ,
1717 Typography ,
1818} from '@mui/material' ;
19- import React , { useEffect , useState } from 'react' ;
19+ import React , { useEffect , useState } from 'react' ;
2020import tools from '../../ai/mcp/electron-client' ;
2121import { AVAILABLE_TOOLS } from '../../langchain/tools/registry' ;
2222
@@ -69,10 +69,8 @@ export const ToolsDialog: React.FC<ToolsDialogProps> = ({
6969 } ;
7070
7171 const handleToggleTool = ( toolName : string ) => {
72- setLocalEnabledTools ( prev =>
73- prev . includes ( toolName )
74- ? prev . filter ( name => name !== toolName )
75- : [ ...prev , toolName ]
72+ setLocalEnabledTools ( prev =>
73+ prev . includes ( toolName ) ? prev . filter ( name => name !== toolName ) : [ ...prev , toolName ]
7674 ) ;
7775 } ;
7876
@@ -106,7 +104,7 @@ export const ToolsDialog: React.FC<ToolsDialogProps> = ({
106104 External Model Context Protocol tools (always enabled)
107105 </ Typography >
108106 </ Box >
109-
107+
110108 { loadingMcpTools ? (
111109 < Box sx = { { display : 'flex' , justifyContent : 'center' , my : 3 } } >
112110 < CircularProgress size = { 24 } />
@@ -119,29 +117,24 @@ export const ToolsDialog: React.FC<ToolsDialogProps> = ({
119117 { mcpTools . length > 0 ? (
120118 mcpTools . map ( ( tool , index ) => (
121119 < ListItem key = { `mcp-${ index } ` } >
122- < Box sx = { {
123- display : 'flex' ,
124- alignItems : 'center' ,
125- minWidth : 40 ,
126- justifyContent : 'center'
127- } } >
128- < Icon
129- icon = { getToolIcon ( tool . name , 'mcp' ) }
130- style = { { fontSize : 20 , marginRight : 8 } }
120+ < Box
121+ sx = { {
122+ display : 'flex' ,
123+ alignItems : 'center' ,
124+ minWidth : 40 ,
125+ justifyContent : 'center' ,
126+ } }
127+ >
128+ < Icon
129+ icon = { getToolIcon ( tool . name , 'mcp' ) }
130+ style = { { fontSize : 20 , marginRight : 8 } }
131131 />
132132 </ Box >
133133 < ListItemText
134134 primary = {
135135 < Box sx = { { display : 'flex' , alignItems : 'center' , gap : 1 } } >
136- < Typography variant = "body1" >
137- { tool . name }
138- </ Typography >
139- < Chip
140- label = "MCP"
141- size = "small"
142- color = "info"
143- variant = "outlined"
144- />
136+ < Typography variant = "body1" > { tool . name } </ Typography >
137+ < Chip label = "MCP" size = "small" color = "info" variant = "outlined" />
145138 </ Box >
146139 }
147140 secondary = { tool . description || 'External MCP tool' }
@@ -195,7 +188,7 @@ export const ToolsDialog: React.FC<ToolsDialogProps> = ({
195188 </ Typography >
196189 ) }
197190 </ Box >
198-
191+
199192 < List >
200193 { tools . map ( ToolClass => {
201194 const tempTool = new ToolClass ( ) ;
@@ -205,10 +198,7 @@ export const ToolsDialog: React.FC<ToolsDialogProps> = ({
205198 return (
206199 < ListItem key = { toolName } divider >
207200 < Box sx = { { display : 'flex' , alignItems : 'center' , mr : 2 } } >
208- < Icon
209- icon = { getToolIcon ( toolName ) }
210- style = { { fontSize : 20 , marginRight : 8 } }
211- />
201+ < Icon icon = { getToolIcon ( toolName ) } style = { { fontSize : 20 , marginRight : 8 } } />
212202 </ Box >
213203 < ListItemText
214204 primary = {
@@ -217,11 +207,7 @@ export const ToolsDialog: React.FC<ToolsDialogProps> = ({
217207 { tempTool . config . displayName || toolName }
218208 </ Typography >
219209 { tempTool . config . category && (
220- < Chip
221- label = { tempTool . config . category }
222- size = "small"
223- variant = "outlined"
224- />
210+ < Chip label = { tempTool . config . category } size = "small" variant = "outlined" />
225211 ) }
226212 </ Box >
227213 }
@@ -243,67 +229,57 @@ export const ToolsDialog: React.FC<ToolsDialogProps> = ({
243229 ) ;
244230
245231 return (
246- < Dialog
247- open = { open }
232+ < Dialog
233+ open = { open }
248234 onClose = { handleCancel }
249235 maxWidth = "md"
250236 fullWidth
251237 PaperProps = { {
252- sx : { height : '80vh' }
238+ sx : { height : '80vh' } ,
253239 } }
254240 >
255241 < DialogTitle >
256242 < Box sx = { { display : 'flex' , alignItems : 'center' , gap : 1 } } >
257243 < Icon icon = "mdi:tools" style = { { fontSize : 24 } } />
258- < Typography variant = "h6" >
259- Manage Tools
260- </ Typography >
261- < Chip
262- label = { `${ localEnabledTools . length } enabled` }
263- size = "small"
264- color = "primary"
265- />
244+ < Typography variant = "h6" > Manage Tools</ Typography >
245+ < Chip label = { `${ localEnabledTools . length } enabled` } size = "small" color = "primary" />
266246 </ Box >
267247 </ DialogTitle >
268-
248+
269249 < DialogContent >
270250 < Typography variant = "body2" color = "text.secondary" sx = { { mb : 3 } } >
271- Enable or disable tools that the AI can use. Changes will take effect immediately and will be saved to your settings.
251+ Enable or disable tools that the AI can use. Changes will take effect immediately and will
252+ be saved to your settings.
272253 </ Typography >
273254
274255 { /* Kubernetes Tools */ }
275256 { kubernetesTools . length > 0 && (
276257 < >
277258 { renderToolList (
278- kubernetesTools ,
279- " Kubernetes Tools" ,
280- " Tools for interacting with Kubernetes clusters"
259+ kubernetesTools ,
260+ ' Kubernetes Tools' ,
261+ ' Tools for interacting with Kubernetes clusters'
281262 ) }
282263 < Divider sx = { { my : 3 } } />
283264 </ >
284265 ) }
285266
286267 { /* Other Tools */ }
287- { otherTools . length > 0 && (
268+ { otherTools . length > 0 &&
288269 renderToolList (
289- otherTools ,
290- "System Tools" ,
291- "General purpose tools for various operations"
292- )
293- ) }
270+ otherTools ,
271+ 'System Tools' ,
272+ 'General purpose tools for various operations'
273+ ) }
294274
295275 { /* MCP Tools */ }
296276 { renderMcpToolList ( ) }
297-
298- { ( kubernetesTools . length > 0 || otherTools . length > 0 ) && (
299- < Divider sx = { { my : 3 } } />
300- ) }
277+
278+ { ( kubernetesTools . length > 0 || otherTools . length > 0 ) && < Divider sx = { { my : 3 } } /> }
301279 </ DialogContent >
302280
303281 < DialogActions >
304- < Button onClick = { handleCancel } >
305- Cancel
306- </ Button >
282+ < Button onClick = { handleCancel } > Cancel</ Button >
307283 < Button onClick = { handleSave } variant = "contained" >
308284 Save Changes
309285 </ Button >
@@ -312,4 +288,4 @@ export const ToolsDialog: React.FC<ToolsDialogProps> = ({
312288 ) ;
313289} ;
314290
315- export default ToolsDialog ;
291+ export default ToolsDialog ;
0 commit comments