File tree Expand file tree Collapse file tree
agent-core-v2/src/kosong/provider/providers/pythinker Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,7 +77,10 @@ export class PythinkerFiles {
7777 }
7878 const filename = input . filename ?? guessFilename ( input . mimeType ) ;
7979 const bytes = input . data instanceof Uint8Array ? input . data : new Uint8Array ( input . data ) ;
80- const blob = new Blob ( [ bytes ] , { type : input . mimeType } ) ;
80+ // `BlobPart` requires a non-shared backing buffer under @types/node 26;
81+ // the assertion is safe because these bytes never come from a
82+ // SharedArrayBuffer.
83+ const blob = new Blob ( [ bytes as Uint8Array < ArrayBuffer > ] , { type : input . mimeType } ) ;
8184 file = new File ( [ blob ] , filename , { type : input . mimeType } ) ;
8285 }
8386
Original file line number Diff line number Diff line change @@ -114,7 +114,10 @@ export class PythinkerFiles {
114114 // `Blob` and `File` are available as globals in Node 20+. The cast via
115115 // `Uint8Array` satisfies `BlobPart` in both Node and DOM lib contexts.
116116 const bytes = input . data instanceof Uint8Array ? input . data : new Uint8Array ( input . data ) ;
117- const blob = new Blob ( [ bytes ] , { type : input . mimeType } ) ;
117+ // `BlobPart` requires a non-shared backing buffer under @types/node 26;
118+ // the assertion is safe because these bytes never come from a
119+ // SharedArrayBuffer.
120+ const blob = new Blob ( [ bytes as Uint8Array < ArrayBuffer > ] , { type : input . mimeType } ) ;
118121 file = new File ( [ blob ] , filename , { type : input . mimeType } ) ;
119122 }
120123
You can’t perform that action at this time.
0 commit comments