@@ -16,6 +16,32 @@ import {
1616} from '../utils/graphTransform' ;
1717import { BOUNDARY_NODE_TYPES , isBoundaryNodeType } from '../types' ;
1818
19+ // Built-in definitions for boundary node types
20+ // These ensure graphInput/graphOutput/graphProp nodes render their ports
21+ const BOUNDARY_NODE_DEFINITIONS : NodeDefinition [ ] = [
22+ {
23+ context : 'core' ,
24+ category : 'graph' ,
25+ type : BOUNDARY_NODE_TYPES . input , // 'graphInput'
26+ inputs : [ ] ,
27+ outputs : [ { name : 'value' , type : 'any' } ] ,
28+ } ,
29+ {
30+ context : 'core' ,
31+ category : 'graph' ,
32+ type : BOUNDARY_NODE_TYPES . output , // 'graphOutput'
33+ inputs : [ { name : 'value' , type : 'any' } ] ,
34+ outputs : [ { name : 'value' , type : 'any' } ] ,
35+ } ,
36+ {
37+ context : 'core' ,
38+ category : 'graph' ,
39+ type : BOUNDARY_NODE_TYPES . prop , // 'graphProp'
40+ inputs : [ ] ,
41+ outputs : [ { name : 'value' , type : 'any' } ] ,
42+ } ,
43+ ] ;
44+
1945// Re-export getEdgeId for backward compatibility
2046export { getEdgeId } from '../utils/graphTransform' ;
2147
@@ -234,6 +260,7 @@ function graphReducer(state: GraphEditorState, action: GraphAction): GraphEditor
234260 ...state ,
235261 graph : migratedGraph ,
236262 definitions : new Map ( [
263+ ...BOUNDARY_NODE_DEFINITIONS . map ( d => [ d . type , d ] as [ string , NodeDefinition ] ) ,
237264 ...state . definitions ,
238265 ...( migratedGraph . definitions || [ ] ) . map ( d => [ d . type , d ] as [ string , NodeDefinition ] )
239266 ] )
@@ -950,6 +977,7 @@ export function GraphProvider({ children, initialGraph, externalDefinitions, onS
950977 ...initialState ,
951978 graph : migratedInitialGraph ,
952979 definitions : new Map ( [
980+ ...BOUNDARY_NODE_DEFINITIONS . map ( d => [ d . type , d ] as [ string , NodeDefinition ] ) ,
953981 ...( migratedInitialGraph . definitions || [ ] ) . map ( d => [ d . type , d ] as [ string , NodeDefinition ] ) ,
954982 ...( externalDefinitions || [ ] ) . map ( d => [ d . type , d ] as [ string , NodeDefinition ] )
955983 ] )
0 commit comments