refactor: unify node types into a single PromptTemplate model

- Removed individual node components (SlashCommandNode, FileOperationNode, etc.) and replaced them with a unified PromptTemplateNode.
- Updated flow types and interfaces to reflect the new single node type system.
- Refactored flow execution logic to handle the new unified model, simplifying node execution and context handling.
- Adjusted UI components to support the new PromptTemplateNode, including instruction display and context references.
- Cleaned up legacy code related to removed node types and ensured compatibility with the new structure.
This commit is contained in:
catlog22
2026-02-04 22:22:27 +08:00
parent 113c14970f
commit 4ee165119b
17 changed files with 647 additions and 2017 deletions

View File

@@ -10,7 +10,6 @@ import type {
Flow,
FlowNode,
FlowEdge,
FlowNodeType,
NodeData,
FlowEdgeData,
} from '../types/flow';
@@ -234,13 +233,13 @@ export const useFlowStore = create<FlowStore>()(
// ========== Node Operations ==========
addNode: (type: FlowNodeType, position: { x: number; y: number }): string => {
const config = nodeConfigs[type];
addNode: (position: { x: number; y: number }): string => {
const config = nodeConfigs['prompt-template'];
const id = generateId('node');
const newNode: FlowNode = {
id,
type,
type: 'prompt-template',
position,
data: { ...config.defaultData },
};