File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -525,6 +525,7 @@ export namespace Session {
525525 abort : new AbortController ( ) . signal ,
526526 agent : input . agent ! ,
527527 messageID : userMsg . id ,
528+ extra : { bypassCwdCheck : true } ,
528529 metadata : async ( ) => { } ,
529530 } ) ,
530531 )
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export const ReadTool = Tool.define("read", {
2424 filepath = path . join ( process . cwd ( ) , filepath )
2525 }
2626 const app = App . info ( )
27- if ( ! Filesystem . contains ( app . path . cwd , filepath ) ) {
27+ if ( ! ctx . extra ?. [ "bypassCwdCheck" ] && ! Filesystem . contains ( app . path . cwd , filepath ) ) {
2828 throw new Error ( `File ${ filepath } is not in the current working directory` )
2929 }
3030
@@ -98,8 +98,6 @@ function isImageFile(filePath: string): string | false {
9898 return "GIF"
9999 case ".bmp" :
100100 return "BMP"
101- case ".svg" :
102- return "SVG"
103101 case ".webp" :
104102 return "WebP"
105103 default :
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export namespace Tool {
1010 agent : string
1111 callID ?: string
1212 abort : AbortSignal
13+ extra ?: { [ key : string ] : any }
1314 metadata ( input : { title ?: string ; metadata ?: M } ) : void
1415 }
1516 export interface Info < Parameters extends StandardSchemaV1 = StandardSchemaV1 , M extends Metadata = Metadata > {
You can’t perform that action at this time.
0 commit comments