@@ -341,7 +341,11 @@ describe('executeDeployCustomBlock', () => {
341341 publishCustomBlockMock . mockResolvedValue ( publishedBlock )
342342
343343 const result = await executeDeployCustomBlock (
344- { name : 'Enrich Lead' , iconUrl : 'files/icon.png' } ,
344+ {
345+ name : 'Enrich Lead' ,
346+ exposedOutputs : [ { blockId : 'b1' , path : 'content' , name : 'answer' } ] ,
347+ iconUrl : 'files/icon.png' ,
348+ } ,
345349 context
346350 )
347351
@@ -364,7 +368,11 @@ describe('executeDeployCustomBlock', () => {
364368 publishCustomBlockMock . mockResolvedValue ( publishedBlock )
365369
366370 const result = await executeDeployCustomBlock (
367- { name : 'Enrich Lead' , iconUrl : 'https://example.com/icon.png' } ,
371+ {
372+ name : 'Enrich Lead' ,
373+ exposedOutputs : [ { blockId : 'b1' , path : 'content' , name : 'answer' } ] ,
374+ iconUrl : 'https://example.com/icon.png' ,
375+ } ,
368376 context
369377 )
370378
@@ -379,7 +387,11 @@ describe('executeDeployCustomBlock', () => {
379387 listWorkspaceFilesMock . mockResolvedValue ( [ ] )
380388
381389 const result = await executeDeployCustomBlock (
382- { name : 'Enrich Lead' , iconUrl : 'files/missing.png' } ,
390+ {
391+ name : 'Enrich Lead' ,
392+ exposedOutputs : [ { blockId : 'b1' , path : 'content' , name : 'answer' } ] ,
393+ iconUrl : 'files/missing.png' ,
394+ } ,
383395 context
384396 )
385397
@@ -390,22 +402,34 @@ describe('executeDeployCustomBlock', () => {
390402
391403 it ( 'rejects non-https icon URL schemes on pass-through' , async ( ) => {
392404 const dataUri = await executeDeployCustomBlock (
393- { name : 'Enrich Lead' , iconUrl : 'data:image/svg+xml;base64,PHN2Zy8+' } ,
405+ {
406+ name : 'Enrich Lead' ,
407+ exposedOutputs : [ { blockId : 'b1' , path : 'content' , name : 'answer' } ] ,
408+ iconUrl : 'data:image/svg+xml;base64,PHN2Zy8+' ,
409+ } ,
394410 context
395411 )
396412 expect ( dataUri . success ) . toBe ( false )
397413 expect ( dataUri . error ) . toContain ( 'https' )
398414
399415 const plainHttp = await executeDeployCustomBlock (
400- { name : 'Enrich Lead' , iconUrl : 'http://example.com/icon.png' } ,
416+ {
417+ name : 'Enrich Lead' ,
418+ exposedOutputs : [ { blockId : 'b1' , path : 'content' , name : 'answer' } ] ,
419+ iconUrl : 'http://example.com/icon.png' ,
420+ } ,
401421 context
402422 )
403423 expect ( plainHttp . success ) . toBe ( false )
404424 expect ( publishCustomBlockMock ) . not . toHaveBeenCalled ( )
405425
406426 publishCustomBlockMock . mockResolvedValue ( publishedBlock )
407427 const servePath = await executeDeployCustomBlock (
408- { name : 'Enrich Lead' , iconUrl : '/api/files/serve/workspace-logos%2Ficon.png' } ,
428+ {
429+ name : 'Enrich Lead' ,
430+ exposedOutputs : [ { blockId : 'b1' , path : 'content' , name : 'answer' } ] ,
431+ iconUrl : '/api/files/serve/workspace-logos%2Ficon.png' ,
432+ } ,
409433 context
410434 )
411435 expect ( servePath . success ) . toBe ( true )
@@ -417,7 +441,11 @@ describe('executeDeployCustomBlock', () => {
417441 ] )
418442
419443 const result = await executeDeployCustomBlock (
420- { name : 'Enrich Lead' , iconUrl : 'files/notes.pdf' } ,
444+ {
445+ name : 'Enrich Lead' ,
446+ exposedOutputs : [ { blockId : 'b1' , path : 'content' , name : 'answer' } ] ,
447+ iconUrl : 'files/notes.pdf' ,
448+ } ,
421449 context
422450 )
423451
@@ -434,4 +462,12 @@ describe('executeDeployCustomBlock', () => {
434462 expect ( result . success ) . toBe ( false )
435463 expect ( result . error ) . toContain ( 'organization' )
436464 } )
465+
466+ it ( 'refuses to publish without curated outputs' , async ( ) => {
467+ const result = await executeDeployCustomBlock ( { name : 'Enrich Lead' } , context )
468+
469+ expect ( result . success ) . toBe ( false )
470+ expect ( result . error ) . toContain ( 'exposedOutputs is required' )
471+ expect ( publishCustomBlockMock ) . not . toHaveBeenCalled ( )
472+ } )
437473} )
0 commit comments