// src/flow/IFlowPlan.ts

import type { FlowContext } from './FlowContext';
import type { AnyStage } from './FlowTypes';

export interface IFlowPlan<TIn = unknown, TOut = unknown> {
  id: string;
  context: FlowContext;
  stages: AnyStage[];
  inputType?: string;
  outputType?: string;
}


/**
 * Shallow clone of a IFlowPlan; useful if you want to mutate stages
 * without affecting the original.
 */
export function cloneFlowPlan<TIn, TOut>(
  plan: IFlowPlan<TIn, TOut>
): IFlowPlan<TIn, TOut> {
  return {
    ...plan,
    stages: [...plan.stages],
    context: plan.context,
  };
}
