@@ -26,31 +26,6 @@ import (
26
26
)
27
27
28
28
var tools = map [string ]types.Tool {
29
- "sys.workspace.ls" : {
30
- Parameters : types.Parameters {
31
- Description : "Lists the contents of a directory relative to the current workspace" ,
32
- Arguments : types .ObjectSchema (
33
- "dir" , "The directory to list" ),
34
- },
35
- BuiltinFunc : SysWorkspaceLs ,
36
- },
37
- "sys.workspace.write" : {
38
- Parameters : types.Parameters {
39
- Description : "Write the contents to a file relative to the current workspace" ,
40
- Arguments : types .ObjectSchema (
41
- "filename" , "The name of the file to write to" ,
42
- "content" , "The content to write" ),
43
- },
44
- BuiltinFunc : SysWorkspaceWrite ,
45
- },
46
- "sys.workspace.read" : {
47
- Parameters : types.Parameters {
48
- Description : "Reads the contents of a file relative to the current workspace" ,
49
- Arguments : types .ObjectSchema (
50
- "filename" , "The name of the file to read" ),
51
- },
52
- BuiltinFunc : SysWorkspaceRead ,
53
- },
54
29
"sys.ls" : {
55
30
Parameters : types.Parameters {
56
31
Description : "Lists the contents of a directory" ,
@@ -332,14 +307,6 @@ func getWorkspaceDir(envs []string) (string, error) {
332
307
return "" , fmt .Errorf ("no workspace directory found in env" )
333
308
}
334
309
335
- func SysWorkspaceLs (_ context.Context , env []string , input string ) (string , error ) {
336
- dir , err := getWorkspaceDir (env )
337
- if err != nil {
338
- return "" , err
339
- }
340
- return sysLs (dir , input )
341
- }
342
-
343
310
func SysLs (_ context.Context , _ []string , input string ) (string , error ) {
344
311
return sysLs ("" , input )
345
312
}
@@ -380,20 +347,7 @@ func sysLs(base, input string) (string, error) {
380
347
return strings .Join (result , "\n " ), nil
381
348
}
382
349
383
- func SysWorkspaceRead (ctx context.Context , env []string , input string ) (string , error ) {
384
- dir , err := getWorkspaceDir (env )
385
- if err != nil {
386
- return "" , err
387
- }
388
-
389
- return sysRead (ctx , dir , env , input )
390
- }
391
-
392
- func SysRead (ctx context.Context , env []string , input string ) (string , error ) {
393
- return sysRead (ctx , "" , env , input )
394
- }
395
-
396
- func sysRead (ctx context.Context , base string , env []string , input string ) (string , error ) {
350
+ func SysRead (_ context.Context , _ []string , input string ) (string , error ) {
397
351
var params struct {
398
352
Filename string `json:"filename,omitempty"`
399
353
}
@@ -402,9 +356,6 @@ func sysRead(ctx context.Context, base string, env []string, input string) (stri
402
356
}
403
357
404
358
file := params .Filename
405
- if base != "" {
406
- file = filepath .Join (base , file )
407
- }
408
359
409
360
// Lock the file to prevent concurrent writes from other tool calls.
410
361
locker .RLock (file )
@@ -424,19 +375,7 @@ func sysRead(ctx context.Context, base string, env []string, input string) (stri
424
375
return string (data ), nil
425
376
}
426
377
427
- func SysWorkspaceWrite (ctx context.Context , env []string , input string ) (string , error ) {
428
- dir , err := getWorkspaceDir (env )
429
- if err != nil {
430
- return "" , err
431
- }
432
- return sysWrite (ctx , dir , env , input )
433
- }
434
-
435
- func SysWrite (ctx context.Context , env []string , input string ) (string , error ) {
436
- return sysWrite (ctx , "" , env , input )
437
- }
438
-
439
- func sysWrite (ctx context.Context , base string , env []string , input string ) (string , error ) {
378
+ func SysWrite (ctx context.Context , _ []string , input string ) (string , error ) {
440
379
var params struct {
441
380
Filename string `json:"filename,omitempty"`
442
381
Content string `json:"content,omitempty"`
@@ -446,9 +385,6 @@ func sysWrite(ctx context.Context, base string, env []string, input string) (str
446
385
}
447
386
448
387
file := params .Filename
449
- if base != "" {
450
- file = filepath .Join (base , file )
451
- }
452
388
453
389
// Lock the file to prevent concurrent writes from other tool calls.
454
390
locker .Lock (file )
0 commit comments