@@ -54,10 +54,6 @@ pub use wrapper_types::{
5454 tool_settings_schema,
5555} ;
5656
57- use super :: chat:: tools:: execute:: ExecuteCommand ;
58- use super :: chat:: tools:: fs_read:: FsRead ;
59- use super :: chat:: tools:: fs_write:: FsWrite ;
60- use super :: chat:: tools:: use_aws:: UseAws ;
6157use super :: chat:: tools:: {
6258 DEFAULT_APPROVE ,
6359 NATIVE_TOOLS ,
@@ -217,8 +213,8 @@ impl Agent {
217213
218214 self . path = Some ( path. to_path_buf ( ) ) ;
219215
220- let mut stderr = std:: io:: stderr ( ) ;
221216 if let ( true , Some ( legacy_mcp_config) ) = ( self . use_legacy_mcp_json , legacy_mcp_config) {
217+ let mut stderr = std:: io:: stderr ( ) ;
222218 for ( name, legacy_server) in & legacy_mcp_config. mcp_servers {
223219 if mcp_servers. mcp_servers . contains_key ( name) {
224220 let _ = queue ! (
@@ -242,58 +238,6 @@ impl Agent {
242238 }
243239 }
244240
245- stderr. flush ( ) ?;
246-
247- Ok ( ( ) )
248- }
249-
250- pub fn validate_tool_settings ( & self , output : & mut impl Write ) -> Result < ( ) , AgentConfigError > {
251- let execute_name = if cfg ! ( windows) { "execute_cmd" } else { "execute_bash" } ;
252- for allowed_tool in & self . allowed_tools {
253- if let Some ( settings) = self . tools_settings . get ( allowed_tool. as_str ( ) ) {
254- // currently we only have four native tools that offers tool settings
255- match allowed_tool. as_str ( ) {
256- "fs_read" => {
257- if let Some ( overridden_settings) = FsRead :: allowable_field_to_be_overridden ( settings) {
258- queue_permission_override_warning (
259- allowed_tool. as_str ( ) ,
260- overridden_settings. as_str ( ) ,
261- output,
262- ) ?;
263- }
264- } ,
265- "fs_write" => {
266- if let Some ( overridden_settings) = FsWrite :: allowable_field_to_be_overridden ( settings) {
267- queue_permission_override_warning (
268- allowed_tool. as_str ( ) ,
269- overridden_settings. as_str ( ) ,
270- output,
271- ) ?;
272- }
273- } ,
274- "use_aws" => {
275- if let Some ( overridden_settings) = UseAws :: allowable_field_to_be_overridden ( settings) {
276- queue_permission_override_warning (
277- allowed_tool. as_str ( ) ,
278- overridden_settings. as_str ( ) ,
279- output,
280- ) ?;
281- }
282- } ,
283- name if name == execute_name => {
284- if let Some ( overridden_settings) = ExecuteCommand :: allowable_field_to_be_overridden ( settings) {
285- queue_permission_override_warning (
286- allowed_tool. as_str ( ) ,
287- overridden_settings. as_str ( ) ,
288- output,
289- ) ?;
290- }
291- } ,
292- _ => { } ,
293- }
294- }
295- }
296-
297241 Ok ( ( ) )
298242 }
299243
@@ -912,28 +856,6 @@ async fn load_legacy_mcp_config(os: &Os) -> eyre::Result<Option<McpServerConfig>
912856 } )
913857}
914858
915- pub fn queue_permission_override_warning (
916- tool_name : & str ,
917- overridden_settings : & str ,
918- output : & mut impl Write ,
919- ) -> Result < ( ) , std:: io:: Error > {
920- Ok ( queue ! (
921- output,
922- style:: SetForegroundColor ( Color :: Yellow ) ,
923- style:: Print ( "WARN: " ) ,
924- style:: ResetColor ,
925- style:: Print ( "You have trusted " ) ,
926- style:: SetForegroundColor ( Color :: Green ) ,
927- style:: Print ( tool_name) ,
928- style:: ResetColor ,
929- style:: Print ( " tool, which overrides the toolsSettings: " ) ,
930- style:: SetForegroundColor ( Color :: Cyan ) ,
931- style:: Print ( overridden_settings) ,
932- style:: ResetColor ,
933- style:: Print ( "\n " ) ,
934- ) ?)
935- }
936-
937859fn default_schema ( ) -> String {
938860 "https://raw.githubusercontent.com/aws/amazon-q-developer-cli/refs/heads/main/schemas/agent-v1.json" . into ( )
939861}
0 commit comments