88 "fmt"
99 "io"
1010 "io/fs"
11- "os"
1211 "path"
1312 "path/filepath"
1413 "strconv"
@@ -19,6 +18,7 @@ import (
1918 "github.com/getkin/kin-openapi/openapi2"
2019 "github.com/getkin/kin-openapi/openapi2conv"
2120 "github.com/getkin/kin-openapi/openapi3"
21+ "github.com/gptscript-ai/gptscript/internal"
2222 "github.com/gptscript-ai/gptscript/pkg/assemble"
2323 "github.com/gptscript-ai/gptscript/pkg/builtin"
2424 "github.com/gptscript-ai/gptscript/pkg/cache"
@@ -61,7 +61,7 @@ func (s *source) String() string {
6161}
6262
6363func openFile (path string ) (io.ReadCloser , bool , error ) {
64- f , err := os .Open (path )
64+ f , err := internal . FS .Open (path )
6565 if errors .Is (err , fs .ErrNotExist ) {
6666 return nil , false , nil
6767 } else if err != nil {
@@ -74,10 +74,10 @@ func loadLocal(base *source, name string) (*source, bool, error) {
7474 // We want to keep all strings in / format, and only convert to platform specific when reading
7575 filePath := path .Join (base .Path , name )
7676
77- if s , err := os .Stat (filepath .Clean (filePath )); err == nil && s .IsDir () {
77+ if s , err := fs .Stat (internal . FS , filepath .Clean (filePath )); err == nil && s .IsDir () {
7878 for _ , def := range types .DefaultFiles {
7979 toolPath := path .Join (filePath , def )
80- if s , err := os .Stat (filepath .Clean (toolPath )); err == nil && ! s .IsDir () {
80+ if s , err := fs .Stat (internal . FS , filepath .Clean (toolPath )); err == nil && ! s .IsDir () {
8181 filePath = toolPath
8282 break
8383 }
0 commit comments