feat: 完成 Agent MCP 对接
- 增加 MCP 连接类型、环境检测接口和容器运行环境支持 - 将 Agent 编排改为绑定整体 MCP 并编译为 runtime McpSpec - 优化 MCP 工具展示、审批、草稿试运行和画布回显稳定性
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import type {AgentDraftState, AgentOption, AgentValidationIssue,} from '../types';
|
||||
import type {
|
||||
AgentDraftState,
|
||||
AgentOption,
|
||||
AgentValidationIssue,
|
||||
} from '../types';
|
||||
|
||||
import {computed} from 'vue';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import {Close} from '@element-plus/icons-vue';
|
||||
import {ElButton} from 'element-plus';
|
||||
import { Close } from '@element-plus/icons-vue';
|
||||
import { ElButton } from 'element-plus';
|
||||
|
||||
import AgentBaseForm from './AgentBaseForm.vue';
|
||||
import AgentKnowledgeForm from './AgentKnowledgeForm.vue';
|
||||
@@ -15,6 +19,7 @@ const props = defineProps<{
|
||||
categories: AgentOption[];
|
||||
issues: AgentValidationIssue[];
|
||||
knowledges: AgentOption[];
|
||||
mcps: AgentOption[];
|
||||
models: AgentOption[];
|
||||
pluginTools: AgentOption[];
|
||||
state: AgentDraftState;
|
||||
@@ -40,11 +45,18 @@ const selectedTool = computed(() => {
|
||||
return props.state.toolBindings.find((item) => item.localId === localId);
|
||||
});
|
||||
|
||||
const selectedToolKind = computed(() =>
|
||||
String(selectedTool.value?.toolType || '').toUpperCase() === 'WORKFLOW'
|
||||
? 'workflow'
|
||||
: 'plugin',
|
||||
);
|
||||
const selectedToolKind = computed(() => {
|
||||
const toolType = String(selectedTool.value?.toolType || '').toUpperCase();
|
||||
if (toolType === 'WORKFLOW') return 'workflow';
|
||||
if (toolType === 'MCP') return 'mcp';
|
||||
return 'plugin';
|
||||
});
|
||||
|
||||
const selectedToolOptions = computed(() => {
|
||||
if (selectedToolKind.value === 'workflow') return props.workflows;
|
||||
if (selectedToolKind.value === 'mcp') return props.mcps;
|
||||
return props.pluginTools;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -100,7 +112,7 @@ const selectedToolKind = computed(() =>
|
||||
v-else-if="selectedTool"
|
||||
:binding="selectedTool"
|
||||
:kind="selectedToolKind"
|
||||
:options="selectedToolKind === 'workflow' ? workflows : pluginTools"
|
||||
:options="selectedToolOptions"
|
||||
@change="emit('change')"
|
||||
@remove="emit('removeCapability')"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user