@@ -6,6 +6,7 @@ import { AfterToolCallEvent } from '../../hooks/events.js'
66import { TextBlock , JsonBlock , ToolResultBlock , Message } from '../../types/messages.js'
77import type { ToolResultContent } from '../../types/messages.js'
88import { ImageBlock , VideoBlock , DocumentBlock } from '../../types/media.js'
9+ import type { ImageFormat , VideoFormat , DocumentFormat } from '../../types/media.js'
910import { tool } from '../../tools/tool-factory.js'
1011import { z } from 'zod'
1112import { logger } from '../../logging/logger.js'
@@ -55,21 +56,21 @@ function decodeStoredContent(content: Uint8Array, contentType: string, reference
5556 if ( contentType . startsWith ( 'image/' ) ) {
5657 const format = contentType . split ( '/' ) . pop ( ) !
5758 return new ImageBlock ( {
58- format : format as import ( '../../types/media.js' ) . ImageFormat ,
59+ format : format as ImageFormat ,
5960 source : { bytes : content } ,
6061 } ) as unknown as JSONValue
6162 }
6263 if ( contentType . startsWith ( 'video/' ) ) {
6364 const format = contentType . split ( '/' ) . pop ( ) !
6465 return new VideoBlock ( {
65- format : format as import ( '../../types/media.js' ) . VideoFormat ,
66+ format : format as VideoFormat ,
6667 source : { bytes : content } ,
6768 } ) as unknown as JSONValue
6869 }
6970 if ( contentType . startsWith ( 'application/' ) ) {
7071 const format = contentType . split ( '/' ) . pop ( ) !
7172 return new DocumentBlock ( {
72- format : format as import ( '../../types/media.js' ) . DocumentFormat ,
73+ format : format as DocumentFormat ,
7374 name : reference ,
7475 source : { bytes : content } ,
7576 } ) as unknown as JSONValue
@@ -190,7 +191,7 @@ export class ContextOffloader implements Plugin {
190191 }
191192 return { ref : '' , contentType, description : `${ label } , 0 bytes` }
192193 }
193- logger . warn ( `Unsupported content block type encountered during offloading, skipping` )
194+ logger . warn ( 'unsupported content block type encountered during offloading, skipping' )
194195 return { ref : '' , contentType : 'unknown' , description : 'unknown block type' }
195196 }
196197
0 commit comments