Type bag for GraphNode that accepts schema types. All fields are optional - unspecified fields use defaults.
This enables separate input/output schemas for nodes, which is useful when a node receives a subset of state fields and returns different fields.
interface GraphNodeTypesconst node: GraphNode<{
InputSchema: typeof NodeInputSchema;
OutputSchema: typeof NodeOutputSchema;
ContextSchema: typeof ContextSchema;
Nodes: "agent" | "tool";
}> = (state, runtime) => {
return { answer: `Response to: ${state.query}` };
};Schema for runtime context (uses ExtractStateType)
Schema for router state (uses ExtractStateType)
Union of valid node names that can be routed to
Schema for node output/update (uses ExtractUpdateType)