File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -734,13 +734,7 @@ export namespace Config {
734734 // Convert legacy tools config to permissions
735735 const permission : Permission = { }
736736 for ( const [ tool , enabled ] of Object . entries ( agent . tools ?? { } ) ) {
737- const action = enabled ? "allow" : "deny"
738- // write, edit, patch, multiedit all map to edit permission
739- if ( tool === "write" || tool === "edit" || tool === "patch" || tool === "multiedit" ) {
740- permission . edit = action
741- } else {
742- permission [ tool ] = action
743- }
737+ permission [ tool ] = enabled ? "allow" : "deny"
744738 }
745739 Object . assign ( permission , agent . permission )
746740
Original file line number Diff line number Diff line change @@ -237,14 +237,10 @@ export namespace PermissionNext {
237237 return match ?? { action : "ask" , permission, pattern : "*" }
238238 }
239239
240- const EDIT_TOOLS = [ "edit" , "write" , "patch" , "multiedit" ]
241-
242240 export function disabled ( tools : string [ ] , ruleset : Ruleset ) : Set < string > {
243241 const result = new Set < string > ( )
244242 for ( const tool of tools ) {
245- const permission = EDIT_TOOLS . includes ( tool ) ? "edit" : tool
246-
247- const rule = ruleset . findLast ( ( r ) => Wildcard . match ( permission , r . permission ) )
243+ const rule = ruleset . findLast ( ( r ) => Wildcard . match ( tool , r . permission ) )
248244 if ( ! rule ) continue
249245 if ( rule . pattern === "*" && rule . action === "deny" ) result . add ( tool )
250246 }
You can’t perform that action at this time.
0 commit comments