GraphFrame

export type GraphFrame = {
  frame: {
    objective: string;
    currentFocus: string;
    nextExpectedOutput: string;
    activeConstraints: string[];
    availableActions: string[];
  };
  graph: StateGraph;
};

StateGraph

export type StateGraph = {
  nodes: GraphNode[];
  edges: GraphEdge[];
};

GraphNode

export type GraphNode = {
  id: string;
  type: NodeType;
  text: string;
  data?: Record<string, unknown>;
  confidence?: number;
  status?: "active" | "resolved" | "rejected" | "stale";
  createdAt: string;
};

GraphOp

export type GraphOp =
  | { op: "add_node"; node: Omit<GraphNode, "createdAt"> }
  | { op: "add_edge"; from: string; to: string; type: EdgeType }
  | { op: "update_node"; id: string; patch: Partial<GraphNode> }
  | { op: "focus"; currentFocus: string }
  | { op: "call_tool"; tool: string; args: Record<string, unknown> }
  | { op: "final"; answer: string };