Trim heavy workflow node bundles

This commit is contained in:
2026-06-10 09:34:13 +08:00
parent d5d520415b
commit 113d23823d
4 changed files with 0 additions and 215 deletions
@@ -33,11 +33,6 @@ const components: Record<string, any> = {
template: defineAsyncComponent(() => import('../panels/TemplatePanel.vue')),
parallel: defineAsyncComponent(() => import('../panels/ParallelPanel.vue')),
merge: defineAsyncComponent(() => import('../panels/MergePanel.vue')),
db_insert: defineAsyncComponent(() => import('../panels/DbInsertPanel.vue')),
db_update: defineAsyncComponent(() => import('../panels/DbUpdatePanel.vue')),
db_query: defineAsyncComponent(() => import('../panels/DbQueryPanel.vue')),
db_delete: defineAsyncComponent(() => import('../panels/DbDeletePanel.vue')),
db_sql: defineAsyncComponent(() => import('../panels/DbSqlPanel.vue')),
// 对话流节点
question: defineAsyncComponent(() => import('../panels/QuestionPanel.vue')),
choice: defineAsyncComponent(() => import('../panels/ChoicePanel.vue')),
@@ -46,12 +41,6 @@ const components: Record<string, any> = {
// 意图识别节点
intent: defineAsyncComponent(() => import('../panels/IntentPanel.vue')),
// Snowflake Cortex 节点
snowflake_cortex_llm: defineAsyncComponent(
() => import('../panels/SnowflakeCortexLLMPanel.vue'),
),
snowflake_cortex_analyst: defineAsyncComponent(
() => import('../panels/SnowflakeCortexAnalystPanel.vue'),
),
// 循环节点
loop: defineAsyncComponent(() => import('../panels/LoopPanel.vue')),
// 表单节点
@@ -62,9 +51,6 @@ const components: Record<string, any> = {
subflow: defineAsyncComponent(() => import('../panels/SubflowPanel.vue')),
// 表单数据节点
// Text-to-SQL 节点
text_to_sql: defineAsyncComponent(
() => import('../panels/TextToSqlPanel.vue'),
),
// 知识库节点
knowledge_retrieval: defineAsyncComponent(
() => import('../panels/KnowledgeRetrievalPanel.vue'),
@@ -21,7 +21,6 @@ import {
MessageSquareText,
Play,
Search,
Snowflake,
Square,
} from '@vben/icons';
import { $t } from '@vben/locales';
@@ -47,19 +46,12 @@ const icons: any = {
code: Code,
template: LayoutTemplate,
end: Square,
db_query: Database,
db_insert: Database,
db_update: Database,
db_delete: Database,
db_sql: Database,
// 对话流节点
question: HelpCircle,
choice: ListChecks,
message: MessageSquareText,
confirm: CircleHelp,
// Snowflake Cortex 节点
snowflake_cortex_llm: Snowflake,
snowflake_cortex_analyst: Snowflake,
// 循环节点
loop: Play,
// 合并节点
@@ -24,9 +24,6 @@ import {
Code,
Combine,
CornerDownLeft,
Database,
DatabaseBackup,
DatabaseZap,
Fullscreen,
GitBranch,
GitFork,
@@ -35,7 +32,6 @@ import {
LayoutTemplate,
ListChecks,
Map,
MessageSquareMore,
MessageSquareText,
Minus,
Play,
@@ -44,7 +40,6 @@ import {
RefreshCw,
Search,
Send,
Snowflake,
Square,
Trash2,
Undo2,
@@ -89,11 +84,6 @@ const ChoiceNode = defineAsyncComponent(() => import('./nodes/ChoiceNode.vue'));
const CodeNode = defineAsyncComponent(() => import('./nodes/CodeNode.vue'));
const ConditionNode = defineAsyncComponent(() => import('./nodes/ConditionNode.vue'));
const ConfirmNode = defineAsyncComponent(() => import('./nodes/ConfirmNode.vue'));
const DbDeleteNode = defineAsyncComponent(() => import('./nodes/DbDeleteNode.vue'));
const DbInsertNode = defineAsyncComponent(() => import('./nodes/DbInsertNode.vue'));
const DbQueryNode = defineAsyncComponent(() => import('./nodes/DbQueryNode.vue'));
const DbSqlNode = defineAsyncComponent(() => import('./nodes/DbSqlNode.vue'));
const DbUpdateNode = defineAsyncComponent(() => import('./nodes/DbUpdateNode.vue'));
const EndNode = defineAsyncComponent(() => import('./nodes/EndNode.vue'));
const HttpNode = defineAsyncComponent(() => import('./nodes/HttpNode.vue'));
const IntentNode = defineAsyncComponent(() => import('./nodes/IntentNode.vue'));
@@ -104,12 +94,9 @@ const MergeNode = defineAsyncComponent(() => import('./nodes/MergeNode.vue'));
const MessageNode = defineAsyncComponent(() => import('./nodes/MessageNode.vue'));
const ParallelNode = defineAsyncComponent(() => import('./nodes/ParallelNode.vue'));
const QuestionNode = defineAsyncComponent(() => import('./nodes/QuestionNode.vue'));
const SnowflakeCortexAnalystNode = defineAsyncComponent(() => import('./nodes/SnowflakeCortexAnalystNode.vue'));
const SnowflakeCortexLLMNode = defineAsyncComponent(() => import('./nodes/SnowflakeCortexLLMNode.vue'));
const StartNode = defineAsyncComponent(() => import('./nodes/StartNode.vue'));
const SubflowNode = defineAsyncComponent(() => import('./nodes/SubflowNode.vue'));
const TemplateNode = defineAsyncComponent(() => import('./nodes/TemplateNode.vue'));
const TextToSqlNode = defineAsyncComponent(() => import('./nodes/TextToSqlNode.vue'));
const appContextStore = useAppContextStore();
@@ -146,11 +133,6 @@ const nodeTypes = {
template: markRaw(TemplateNode),
parallel: markRaw(ParallelNode),
merge: markRaw(MergeNode),
db_insert: markRaw(DbInsertNode),
db_update: markRaw(DbUpdateNode),
db_query: markRaw(DbQueryNode),
db_delete: markRaw(DbDeleteNode),
db_sql: markRaw(DbSqlNode),
// 对话流节点
question: markRaw(QuestionNode),
choice: markRaw(ChoiceNode),
@@ -159,8 +141,6 @@ const nodeTypes = {
// 意图识别节点
intent: markRaw(IntentNode),
// Snowflake Cortex 节点
snowflake_cortex_llm: markRaw(SnowflakeCortexLLMNode),
snowflake_cortex_analyst: markRaw(SnowflakeCortexAnalystNode),
// 循环节点
loop: markRaw(LoopNode),
// 表单节点
@@ -171,7 +151,6 @@ const nodeTypes = {
subflow: markRaw(SubflowNode),
// 表单数据节点
// Text-to-SQL 节点
text_to_sql: markRaw(TextToSqlNode),
// 知识库节点
knowledge_retrieval: markRaw(KnowledgeRetrievalNode),
};
@@ -376,47 +355,6 @@ const nodeCategories = computed(() => [
},
],
},
{
name: $t('ai-platform.workflow.editor.categories.database'),
nodes: [
{
type: 'text_to_sql',
label: getNodeLabel('text_to_sql'),
icon: 'DatabaseZap',
color: 'cyan',
},
{
type: 'db_insert',
label: getNodeLabel('db_insert'),
icon: 'DatabaseZap',
color: 'green',
},
{
type: 'db_update',
label: getNodeLabel('db_update'),
icon: 'DatabaseBackup',
color: 'green',
},
{
type: 'db_query',
label: getNodeLabel('db_query'),
icon: 'Search',
color: 'green',
},
{
type: 'db_delete',
label: getNodeLabel('db_delete'),
icon: 'Trash2',
color: 'green',
},
{
type: 'db_sql',
label: getNodeLabel('db_sql'),
icon: 'Database',
color: 'green',
},
],
},
{
name: $t('ai-platform.workflow.editor.categories.flowControl'),
nodes: [
@@ -464,23 +402,6 @@ const nodeCategories = computed(() => [
},
],
},
{
name: 'Snowflake',
nodes: [
{
type: 'snowflake_cortex_llm',
label: getNodeLabel('snowflake_cortex_llm'),
icon: 'Snowflake',
color: 'cyan',
},
{
type: 'snowflake_cortex_analyst',
label: getNodeLabel('snowflake_cortex_analyst'),
icon: 'MessageSquareMore',
color: 'cyan',
},
],
},
{
name: $t('ai-platform.workflow.editor.categories.knowledge'),
nodes: [
@@ -505,11 +426,8 @@ const iconComponents: Record<string, any> = {
GitFork,
Combine,
Square,
DatabaseZap,
DatabaseBackup,
Search,
Trash2,
Database,
// 对话交互节点图标
MessageSquareText,
HelpCircle,
@@ -518,8 +436,6 @@ const iconComponents: Record<string, any> = {
// 意图识别节点图标
Brain,
// Snowflake Cortex 节点图标
Snowflake,
MessageSquareMore,
// 循环节点图标
RefreshCw,
CornerDownLeft,
@@ -1569,99 +1485,6 @@ const validateWorkflow = (): ValidationError[] => {
}
}
const dbCrudTypes = ['db_query', 'db_insert', 'db_update', 'db_delete'];
if (dbCrudTypes.includes(node.type || '')) {
if (!node.data?.table) {
errors.push({
nodeId: node.id,
nodeLabel,
message: $t('ai-platform.workflow.editor.validation.dbNoTable'),
severity: 'error',
});
}
if (!node.data?.db_config?.dbName) {
errors.push({
nodeId: node.id,
nodeLabel,
message: $t('ai-platform.workflow.editor.validation.dbNoConnection'),
severity: 'error',
});
}
if (
['db_insert', 'db_update', 'db_delete'].includes(node.type || '') &&
node.data?.db_config?.dbName === 'default'
) {
errors.push({
nodeId: node.id,
nodeLabel,
message: $t(
'ai-platform.workflow.editor.validation.dbDefaultWriteWarning',
),
severity: 'warning',
});
}
}
if (node.type === 'db_sql') {
if (!node.data?.sql) {
errors.push({
nodeId: node.id,
nodeLabel,
message: $t('ai-platform.workflow.editor.validation.dbSqlNoStatement'),
severity: 'error',
});
}
if (!node.data?.db_config?.dbName) {
errors.push({
nodeId: node.id,
nodeLabel,
message: $t('ai-platform.workflow.editor.validation.dbNoConnection'),
severity: 'error',
});
}
if (
node.data?.sql_type === 'execute' &&
node.data?.db_config?.dbName === 'default'
) {
errors.push({
nodeId: node.id,
nodeLabel,
message: $t(
'ai-platform.workflow.editor.validation.dbDefaultWriteWarning',
),
severity: 'warning',
});
}
}
if (node.type === 'text_to_sql') {
if (!node.data?.model_id) {
errors.push({
nodeId: node.id,
nodeLabel,
message: $t('ai-platform.workflow.editor.validation.textToSqlNoModel'),
severity: 'error',
});
}
if (!node.data?.db_config?.dbName) {
errors.push({
nodeId: node.id,
nodeLabel,
message: $t('ai-platform.workflow.editor.validation.dbNoConnection'),
severity: 'error',
});
}
if (!node.data?.user_question) {
errors.push({
nodeId: node.id,
nodeLabel,
message: $t(
'ai-platform.workflow.editor.validation.textToSqlNoQuestion',
),
severity: 'error',
});
}
}
});
return errors;
@@ -6,11 +6,6 @@ const ChoiceNode = defineAsyncComponent(() => import('../editor/nodes/ChoiceNode
const CodeNode = defineAsyncComponent(() => import('../editor/nodes/CodeNode.vue'));
const ConditionNode = defineAsyncComponent(() => import('../editor/nodes/ConditionNode.vue'));
const ConfirmNode = defineAsyncComponent(() => import('../editor/nodes/ConfirmNode.vue'));
const DbDeleteNode = defineAsyncComponent(() => import('../editor/nodes/DbDeleteNode.vue'));
const DbInsertNode = defineAsyncComponent(() => import('../editor/nodes/DbInsertNode.vue'));
const DbQueryNode = defineAsyncComponent(() => import('../editor/nodes/DbQueryNode.vue'));
const DbSqlNode = defineAsyncComponent(() => import('../editor/nodes/DbSqlNode.vue'));
const DbUpdateNode = defineAsyncComponent(() => import('../editor/nodes/DbUpdateNode.vue'));
const EndNode = defineAsyncComponent(() => import('../editor/nodes/EndNode.vue'));
const HttpNode = defineAsyncComponent(() => import('../editor/nodes/HttpNode.vue'));
const IntentNode = defineAsyncComponent(() => import('../editor/nodes/IntentNode.vue'));
@@ -21,12 +16,9 @@ const MergeNode = defineAsyncComponent(() => import('../editor/nodes/MergeNode.v
const MessageNode = defineAsyncComponent(() => import('../editor/nodes/MessageNode.vue'));
const ParallelNode = defineAsyncComponent(() => import('../editor/nodes/ParallelNode.vue'));
const QuestionNode = defineAsyncComponent(() => import('../editor/nodes/QuestionNode.vue'));
const SnowflakeCortexAnalystNode = defineAsyncComponent(() => import('../editor/nodes/SnowflakeCortexAnalystNode.vue'));
const SnowflakeCortexLLMNode = defineAsyncComponent(() => import('../editor/nodes/SnowflakeCortexLLMNode.vue'));
const StartNode = defineAsyncComponent(() => import('../editor/nodes/StartNode.vue'));
const SubflowNode = defineAsyncComponent(() => import('../editor/nodes/SubflowNode.vue'));
const TemplateNode = defineAsyncComponent(() => import('../editor/nodes/TemplateNode.vue'));
const TextToSqlNode = defineAsyncComponent(() => import('../editor/nodes/TextToSqlNode.vue'));
export const workflowNodeTypes = {
start: markRaw(StartNode),
@@ -38,21 +30,13 @@ export const workflowNodeTypes = {
template: markRaw(TemplateNode),
parallel: markRaw(ParallelNode),
merge: markRaw(MergeNode),
db_insert: markRaw(DbInsertNode),
db_update: markRaw(DbUpdateNode),
db_query: markRaw(DbQueryNode),
db_delete: markRaw(DbDeleteNode),
db_sql: markRaw(DbSqlNode),
question: markRaw(QuestionNode),
choice: markRaw(ChoiceNode),
message: markRaw(MessageNode),
confirm: markRaw(ConfirmNode),
intent: markRaw(IntentNode),
snowflake_cortex_llm: markRaw(SnowflakeCortexLLMNode),
snowflake_cortex_analyst: markRaw(SnowflakeCortexAnalystNode),
loop: markRaw(LoopNode),
subflow: markRaw(SubflowNode),
text_to_sql: markRaw(TextToSqlNode),
knowledge_retrieval: markRaw(KnowledgeRetrievalNode),
};