mod pipeline;
use crate::io::NodeGraphInteractionState;
use crate::rules::{ConnectPlan, Diagnostic};
use jellyflow_core::core::{EdgeKind, Graph, PortId};
use jellyflow_core::interaction::NodeGraphConnectionMode;
use jellyflow_core::types::{DefaultTypeCompatibility, TypeDesc};
pub(crate) use pipeline::apply_transaction_with_profile_in_place;
pub use pipeline::{
ApplyPipelineError, apply_connect_plan_with_profile, apply_transaction_with_profile,
};
pub trait GraphProfile {
fn type_of_port(&mut self, graph: &Graph, port: PortId) -> Option<TypeDesc>;
fn plan_connect(
&mut self,
graph: &Graph,
a: PortId,
b: PortId,
mode: NodeGraphConnectionMode,
) -> ConnectPlan {
let mut compat = DefaultTypeCompatibility::default();
crate::rules::plan_connect_typed_with_mode_and_policy(
graph,
a,
b,
mode,
&NodeGraphInteractionState::default(),
|graph, port| self.type_of_port(graph, port),
&mut compat,
)
}
fn validate_graph(&mut self, graph: &Graph) -> Vec<Diagnostic>;
fn allow_cycles(&self, _edge_kind: EdgeKind) -> bool {
true
}
fn concretize_bound(&self) -> usize {
8
}
fn concretize(&mut self, _graph: &Graph) -> Vec<jellyflow_core::ops::GraphOp> {
Vec::new()
}
}