File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ export namespace Agent {
38
38
39
39
const state = App . state ( "agent" , async ( ) => {
40
40
const cfg = await Config . get ( )
41
+ const defaultTools = cfg . tools ?? { }
41
42
const defaultPermission : Info [ "permission" ] = {
42
43
edit : "allow" ,
43
44
bash : {
@@ -55,6 +56,7 @@ export namespace Agent {
55
56
tools : {
56
57
todoread : false ,
57
58
todowrite : false ,
59
+ ...defaultTools ,
58
60
} ,
59
61
options : { } ,
60
62
permission : agentPermission ,
@@ -63,7 +65,7 @@ export namespace Agent {
63
65
} ,
64
66
build : {
65
67
name : "build" ,
66
- tools : { } ,
68
+ tools : { ... defaultTools } ,
67
69
options : { } ,
68
70
permission : agentPermission ,
69
71
mode : "primary" ,
@@ -77,6 +79,7 @@ export namespace Agent {
77
79
write : false ,
78
80
edit : false ,
79
81
patch : false ,
82
+ ...defaultTools ,
80
83
} ,
81
84
mode : "primary" ,
82
85
builtIn : true ,
@@ -109,6 +112,10 @@ export namespace Agent {
109
112
...item . tools ,
110
113
...tools ,
111
114
}
115
+ item . tools = {
116
+ ...defaultTools ,
117
+ ...item . tools ,
118
+ }
112
119
if ( description ) item . description = description
113
120
if ( temperature != undefined ) item . temperature = temperature
114
121
if ( top_p != undefined ) item . topP = top_p
Original file line number Diff line number Diff line change @@ -384,6 +384,7 @@ export namespace Config {
384
384
webfetch : Permission . optional ( ) ,
385
385
} )
386
386
. optional ( ) ,
387
+ tools : z . record ( z . string ( ) , z . boolean ( ) ) . optional ( ) ,
387
388
experimental : z
388
389
. object ( {
389
390
hook : z
You can’t perform that action at this time.
0 commit comments