1- pub mod execute_bash ;
1+ pub mod execute_shell_commands ;
22pub mod fs_read;
33pub mod fs_write;
44pub mod gh_issue;
@@ -15,7 +15,7 @@ use aws_smithy_types::{
1515 Document ,
1616 Number as SmithyNumber ,
1717} ;
18- use execute_bash :: ExecuteBash ;
18+ use execute_shell_commands :: ExecuteShellCommands ;
1919use eyre:: Result ;
2020use fig_api_client:: model:: {
2121 ToolResult ,
@@ -38,7 +38,7 @@ pub const MAX_TOOL_RESPONSE_SIZE: usize = 800000;
3838pub enum Tool {
3939 FsRead ( FsRead ) ,
4040 FsWrite ( FsWrite ) ,
41- ExecuteBash ( ExecuteBash ) ,
41+ ExecuteShellCommands ( ExecuteShellCommands ) ,
4242 UseAws ( UseAws ) ,
4343 GhIssue ( GhIssue ) ,
4444}
@@ -49,7 +49,7 @@ impl Tool {
4949 match self {
5050 Tool :: FsRead ( _) => "Read from filesystem" ,
5151 Tool :: FsWrite ( _) => "Write to filesystem" ,
52- Tool :: ExecuteBash ( _) => "Execute shell command" ,
52+ Tool :: ExecuteShellCommands ( _) => "Execute shell command" ,
5353 Tool :: UseAws ( _) => "Use AWS CLI" ,
5454 Tool :: GhIssue ( _) => "Prepare GitHub issue" ,
5555 }
@@ -60,7 +60,9 @@ impl Tool {
6060 match self {
6161 Tool :: FsRead ( _) => "Reading from filesystem" ,
6262 Tool :: FsWrite ( _) => "Writing to filesystem" ,
63- Tool :: ExecuteBash ( execute_bash) => return format ! ( "Executing `{}`" , execute_bash. command) ,
63+ Tool :: ExecuteShellCommands ( execute_shell_commands) => {
64+ return format ! ( "Executing `{}`" , execute_shell_commands. command) ;
65+ } ,
6466 Tool :: UseAws ( _) => "Using AWS CLI" ,
6567 Tool :: GhIssue ( _) => "Preparing GitHub issue" ,
6668 }
@@ -72,7 +74,7 @@ impl Tool {
7274 match self {
7375 Tool :: FsRead ( _) => false ,
7476 Tool :: FsWrite ( _) => true ,
75- Tool :: ExecuteBash ( execute_bash ) => execute_bash . requires_acceptance ( ) ,
77+ Tool :: ExecuteShellCommands ( execute_shell_commands ) => execute_shell_commands . requires_acceptance ( ) ,
7678 Tool :: UseAws ( use_aws) => use_aws. requires_acceptance ( ) ,
7779 Tool :: GhIssue ( _) => false ,
7880 }
@@ -83,7 +85,7 @@ impl Tool {
8385 match self {
8486 Tool :: FsRead ( fs_read) => fs_read. invoke ( context, updates) . await ,
8587 Tool :: FsWrite ( fs_write) => fs_write. invoke ( context, updates) . await ,
86- Tool :: ExecuteBash ( execute_bash ) => execute_bash . invoke ( updates) . await ,
88+ Tool :: ExecuteShellCommands ( execute_shell_commands ) => execute_shell_commands . invoke ( updates) . await ,
8789 Tool :: UseAws ( use_aws) => use_aws. invoke ( context, updates) . await ,
8890 Tool :: GhIssue ( gh_issue) => gh_issue. invoke ( updates) . await ,
8991 }
@@ -94,7 +96,7 @@ impl Tool {
9496 match self {
9597 Tool :: FsRead ( fs_read) => fs_read. queue_description ( ctx, updates) . await ,
9698 Tool :: FsWrite ( fs_write) => fs_write. queue_description ( ctx, updates) ,
97- Tool :: ExecuteBash ( execute_bash ) => execute_bash . queue_description ( updates) ,
99+ Tool :: ExecuteShellCommands ( execute_shell_commands ) => execute_shell_commands . queue_description ( updates) ,
98100 Tool :: UseAws ( use_aws) => use_aws. queue_description ( updates) ,
99101 Tool :: GhIssue ( gh_issue) => gh_issue. queue_description ( updates) ,
100102 }
@@ -105,7 +107,7 @@ impl Tool {
105107 match self {
106108 Tool :: FsRead ( fs_read) => fs_read. validate ( ctx) . await ,
107109 Tool :: FsWrite ( fs_write) => fs_write. validate ( ctx) . await ,
108- Tool :: ExecuteBash ( execute_bash ) => execute_bash . validate ( ctx) . await ,
110+ Tool :: ExecuteShellCommands ( execute_shell_commands ) => execute_shell_commands . validate ( ctx) . await ,
109111 Tool :: UseAws ( use_aws) => use_aws. validate ( ctx) . await ,
110112 Tool :: GhIssue ( gh_issue) => gh_issue. validate ( ctx) . await ,
111113 }
@@ -127,7 +129,9 @@ impl TryFrom<ToolUse> for Tool {
127129 Ok ( match value. name . as_str ( ) {
128130 "fs_read" => Self :: FsRead ( serde_json:: from_value :: < FsRead > ( value. args ) . map_err ( map_err) ?) ,
129131 "fs_write" => Self :: FsWrite ( serde_json:: from_value :: < FsWrite > ( value. args ) . map_err ( map_err) ?) ,
130- "execute_bash" => Self :: ExecuteBash ( serde_json:: from_value :: < ExecuteBash > ( value. args ) . map_err ( map_err) ?) ,
132+ "execute_shell_commands" => {
133+ Self :: ExecuteShellCommands ( serde_json:: from_value :: < ExecuteShellCommands > ( value. args ) . map_err ( map_err) ?)
134+ } ,
131135 "use_aws" => Self :: UseAws ( serde_json:: from_value :: < UseAws > ( value. args ) . map_err ( map_err) ?) ,
132136 "report_issue" => Self :: GhIssue ( serde_json:: from_value :: < GhIssue > ( value. args ) . map_err ( map_err) ?) ,
133137 unknown => {
0 commit comments