@@ -8,9 +8,18 @@ import { resolveToolDisplay } from './store-utils'
88import { ClientToolCallState } from './tool-call-state'
99
1010const gmailBlock = { type : 'gmail_v2' , name : 'Gmail' , icon : ( ) => null }
11+ const customBlock = {
12+ type : 'custom_block_invoice_parser' ,
13+ name : 'Invoice Parser' ,
14+ icon : ( ) => null ,
15+ }
1116
1217vi . mock ( '@/blocks/registry' , ( ) => ( {
13- getBlock : vi . fn ( ( type : string ) => ( type === 'gmail_v2' ? gmailBlock : undefined ) ) ,
18+ getBlock : vi . fn ( ( type : string ) => {
19+ if ( type === 'gmail_v2' ) return gmailBlock
20+ if ( type === 'custom_block_invoice_parser' ) return customBlock
21+ return undefined
22+ } ) ,
1423 getLatestBlock : vi . fn ( ( baseType : string ) => ( baseType === 'gmail' ? gmailBlock : undefined ) ) ,
1524} ) )
1625
@@ -180,7 +189,7 @@ describe('resolveToolDisplay', () => {
180189 ) . toBe ( 'Read style details for deck.pptx' )
181190 } )
182191
183- it ( 'shows the block display name for block and integration schema reads' , ( ) => {
192+ it ( 'shows the block display name for block, integration, and custom-block reads' , ( ) => {
184193 expect (
185194 resolveToolDisplay ( ReadTool . id , ClientToolCallState . success , {
186195 path : 'components/blocks/gmail_v2.json' ,
@@ -198,6 +207,12 @@ describe('resolveToolDisplay', () => {
198207 path : 'components/blocks/unknown_block.json' ,
199208 } ) ?. text
200209 ) . toBe ( 'Read Unknown block' )
210+
211+ expect (
212+ resolveToolDisplay ( ReadTool . id , ClientToolCallState . success , {
213+ path : 'organization/custom-blocks/custom_block_invoice_parser.json' ,
214+ } ) ?. text
215+ ) . toBe ( 'Read Invoice Parser' )
201216 } )
202217
203218 it ( 'humanizes internal VFS resource identifiers' , ( ) => {
0 commit comments