Feat: Click the edit tool button of the agent form to open the corresponding form #3221 (#9071)

### What problem does this PR solve?

Feat: Click the edit tool button of the agent form to open the
corresponding form #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-07-28 16:48:59 +08:00
committed by GitHub
parent 381f9df941
commit 35b1a5b7e0
6 changed files with 72 additions and 23 deletions

View File

@ -85,6 +85,8 @@ export type RFState = {
setClickedToolId: (id?: string) => void;
findUpstreamNodeById: (id?: string | null) => RAGFlowNodeType | undefined;
deleteCategorizeCaseEdges: (source: string, sourceHandle: string) => void; // Deleting a condition of a classification operator will delete the related edge
findAgentToolNodeById: (id: string | null) => string | undefined;
selectNodeIds: (nodeIds: string[]) => void;
};
// this is our useStore hook that we can use in our components to get parts of the store and call actions
@ -518,6 +520,22 @@ const useGraphStore = create<RFState>()(
),
);
},
findAgentToolNodeById: (id) => {
const { edges } = get();
return edges.find(
(edge) =>
edge.source === id && edge.sourceHandle === NodeHandleId.Tool,
)?.target;
},
selectNodeIds: (nodeIds) => {
const { nodes, setNodes } = get();
setNodes(
nodes.map((node) => ({
...node,
selected: nodeIds.includes(node.id),
})),
);
},
})),
{ name: 'graph', trace: true },
),