@@ -162,6 +162,7 @@ pub enum ToolsSubcommand {
162162 Untrust { tool_name : String } ,
163163 TrustAll ,
164164 Reset ,
165+ ResetSingle { tool_name : String } ,
165166 Help ,
166167}
167168
@@ -171,7 +172,8 @@ impl ToolsSubcommand {
171172 <em>trust <<tool name>></em> <black!>Trust a specific tool for the session</black!>
172173 <em>untrust <<tool name>></em> <black!>Revert a tool to per-request confirmation</black!>
173174 <em>trustall</em> <black!>Trust all tools (equivalent to deprecated /acceptall)</black!>
174- <em>reset</em> <black!>Reset all tools to default permission levels</black!>" } ;
175+ <em>reset</em> <black!>Reset all tools to default permission levels</black!>
176+ <em>reset <<tool name>></em> <black!>Reset a single tool to default permission level</black!>" } ;
175177 const BASE_COMMAND : & str = color_print:: cstr! { "<cyan!>Usage: /tools [SUBCOMMAND]</cyan!>
176178
177179<cyan!>Description</cyan!>
@@ -538,8 +540,18 @@ impl Command {
538540 "trustall" => Self :: Tools {
539541 subcommand : Some ( ToolsSubcommand :: TrustAll ) ,
540542 } ,
541- "reset" => Self :: Tools {
542- subcommand : Some ( ToolsSubcommand :: Reset ) ,
543+ "reset" => {
544+ let tool_name = parts. get ( 2 ) ;
545+ match tool_name {
546+ Some ( tool_name) => Self :: Tools {
547+ subcommand : Some ( ToolsSubcommand :: ResetSingle {
548+ tool_name : ( * tool_name) . to_string ( ) ,
549+ } ) ,
550+ } ,
551+ None => Self :: Tools {
552+ subcommand : Some ( ToolsSubcommand :: Reset ) ,
553+ } ,
554+ }
543555 } ,
544556 "help" => Self :: Tools {
545557 subcommand : Some ( ToolsSubcommand :: Help ) ,
0 commit comments