@@ -14,8 +14,6 @@ import {
1414 WrenchScrewdriverIcon ,
1515} from '@heroicons/react/24/outline' ;
1616import { OpenInNewTab } from '../utils/common' ;
17- import { AVAILABLE_TOOLS } from '../utils/tool_calling/register_tools' ;
18- import { AgentTool } from '../utils/tool_calling/agent_tool' ;
1917
2018type SettKey = keyof typeof CONFIG_DEFAULT ;
2119
@@ -180,24 +178,21 @@ const SETTING_SECTIONS: SettingSection[] = [
180178 </ >
181179 ) ,
182180 fields : [
183- ...Array . from ( AVAILABLE_TOOLS . values ( ) ) . map (
184- ( tool : AgentTool ) =>
185- ( {
186- type : SettingInputType . CHECKBOX ,
187- label : (
188- < >
189- < span className = "font-semibold" > { tool . name || tool . id } </ span >
190- { tool . toolDescription && (
191- < small className = "text-xs block mt-1 opacity-70" >
192- < strong > Agent tool description: </ strong >
193- { tool . toolDescription }
194- </ small >
195- ) }
196- </ >
197- ) ,
198- key : `tool_${ tool . id } _enabled` as SettKey ,
199- } ) as SettingFieldInput
200- ) ,
181+ {
182+ type : SettingInputType . CHECKBOX ,
183+ label : (
184+ < >
185+ < span className = "font-semibold" > JavaScript Interpreter</ span >
186+ < small className = "text-xs block mt-1 opacity-70" >
187+ < strong > Agent tool description: </ strong >
188+ Executes JavaScript code in a sandboxed iframe. The code should be
189+ self-contained valid javascript. Only console.log(variable) and
190+ final result are included in response content.
191+ </ small >
192+ </ >
193+ ) ,
194+ key : 'toolJsReplEnabled' ,
195+ } ,
201196 ] ,
202197 } ,
203198 {
@@ -559,13 +554,11 @@ function SettingsModalCheckbox({
559554 value,
560555 onChange,
561556 label,
562- disabled,
563557} : {
564558 configKey : SettKey ;
565559 value : boolean ;
566560 onChange : ( value : boolean ) => void ;
567- label : React . ReactElement | string ;
568- disabled ?: boolean ;
561+ label : string ;
569562} ) {
570563 return (
571564 < div className = "flex flex-row items-center mb-2" >
@@ -574,7 +567,6 @@ function SettingsModalCheckbox({
574567 className = "toggle"
575568 checked = { value }
576569 onChange = { ( e ) => onChange ( e . target . checked ) }
577- disabled = { disabled }
578570 />
579571 < span className = "ml-4" > { label || configKey } </ span >
580572 </ div >
0 commit comments