@@ -225,15 +225,15 @@ func readTool(ctx context.Context, cache *cache.Client, prg *types.Program, base
225
225
// Probably a better way to come up with an ID
226
226
tool .ID = tool .Source .Location + ":" + tool .Name
227
227
228
- if i != 0 && tool .Parameters . Name == "" {
228
+ if i != 0 && tool .Name == "" {
229
229
return nil , parser .NewErrLine (tool .Source .Location , tool .Source .LineNo , fmt .Errorf ("only the first tool in a file can have no name" ))
230
230
}
231
231
232
- if i != 0 && tool .Parameters . GlobalModelName != "" {
232
+ if i != 0 && tool .GlobalModelName != "" {
233
233
return nil , parser .NewErrLine (tool .Source .Location , tool .Source .LineNo , fmt .Errorf ("only the first tool in a file can have global model name" ))
234
234
}
235
235
236
- if i != 0 && len (tool .Parameters . GlobalTools ) > 0 {
236
+ if i != 0 && len (tool .GlobalTools ) > 0 {
237
237
return nil , parser .NewErrLine (tool .Source .Location , tool .Source .LineNo , fmt .Errorf ("only the first tool in a file can have global tools" ))
238
238
}
239
239
@@ -245,8 +245,8 @@ func readTool(ctx context.Context, cache *cache.Client, prg *types.Program, base
245
245
targetTools = append (targetTools , tool )
246
246
}
247
247
248
- if targetToolName != "" && tool .Parameters . Name != "" {
249
- if strings .EqualFold (tool .Parameters . Name , targetToolName ) {
248
+ if targetToolName != "" && tool .Name != "" {
249
+ if strings .EqualFold (tool .Name , targetToolName ) {
250
250
targetTools = append (targetTools , tool )
251
251
} else if strings .Contains (targetToolName , "*" ) {
252
252
var patterns []string
@@ -257,7 +257,7 @@ func readTool(ctx context.Context, cache *cache.Client, prg *types.Program, base
257
257
}
258
258
259
259
for _ , pattern := range patterns {
260
- match , err := filepath .Match (strings .ToLower (pattern ), strings .ToLower (tool .Parameters . Name ))
260
+ match , err := filepath .Match (strings .ToLower (pattern ), strings .ToLower (tool .Name ))
261
261
if err != nil {
262
262
return nil , parser .NewErrLine (tool .Source .Location , tool .Source .LineNo , err )
263
263
}
@@ -270,13 +270,13 @@ func readTool(ctx context.Context, cache *cache.Client, prg *types.Program, base
270
270
}
271
271
}
272
272
273
- if existing , ok := localTools [strings .ToLower (tool .Parameters . Name )]; ok {
273
+ if existing , ok := localTools [strings .ToLower (tool .Name )]; ok {
274
274
return nil , parser .NewErrLine (tool .Source .Location , tool .Source .LineNo ,
275
- fmt .Errorf ("duplicate tool name [%s] in %s found at lines %d and %d" , tool .Parameters . Name , tool .Source .Location ,
275
+ fmt .Errorf ("duplicate tool name [%s] in %s found at lines %d and %d" , tool .Name , tool .Source .Location ,
276
276
tool .Source .LineNo , existing .Source .LineNo ))
277
277
}
278
278
279
- localTools [strings .ToLower (tool .Parameters . Name )] = tool
279
+ localTools [strings .ToLower (tool .Name )] = tool
280
280
}
281
281
282
282
return linkAll (ctx , cache , prg , base , targetTools , localTools , defaultModel )
@@ -285,7 +285,7 @@ func readTool(ctx context.Context, cache *cache.Client, prg *types.Program, base
285
285
func linkAll (ctx context.Context , cache * cache.Client , prg * types.Program , base * source , tools []types.Tool , localTools types.ToolSet , defaultModel string ) (result []types.Tool , _ error ) {
286
286
localToolsMapping := make (map [string ]string , len (tools ))
287
287
for _ , localTool := range localTools {
288
- localToolsMapping [strings .ToLower (localTool .Parameters . Name )] = localTool .ID
288
+ localToolsMapping [strings .ToLower (localTool .Name )] = localTool .ID
289
289
}
290
290
291
291
for _ , tool := range tools {
@@ -314,7 +314,7 @@ func link(ctx context.Context, cache *cache.Client, prg *types.Program, base *so
314
314
// The below is done in two loops so that local names stay as the tool names
315
315
// and don't get mangled by external references
316
316
317
- for _ , targetToolName := range tool .Parameters . ToolRefNames () {
317
+ for _ , targetToolName := range tool .ToolRefNames () {
318
318
noArgs , _ := types .SplitArg (targetToolName )
319
319
localTool , ok := localTools [strings .ToLower (noArgs )]
320
320
if ok {
0 commit comments