feat: add MCP tool integration
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
import type { Edge } from "@xyflow/react";
|
||||
import {
|
||||
Braces,
|
||||
CircleCheck,
|
||||
CircleX,
|
||||
GitBranch,
|
||||
MessageSquareText,
|
||||
Plus,
|
||||
@@ -92,6 +94,24 @@ export function EdgeSettingsPanel({
|
||||
publish({ nextRules });
|
||||
};
|
||||
|
||||
const applyActionResultPreset = (status: "ok" | "error") => {
|
||||
const nextRules: ExpressionRule[] = [
|
||||
{
|
||||
variable: "system__last_action_status",
|
||||
operator: "eq",
|
||||
value: status,
|
||||
},
|
||||
];
|
||||
setMode("expression");
|
||||
setCombinator("and");
|
||||
setRules(nextRules);
|
||||
publish({
|
||||
nextMode: "expression",
|
||||
nextCombinator: "and",
|
||||
nextRules,
|
||||
});
|
||||
};
|
||||
|
||||
const parseValue = (value: string): unknown => {
|
||||
if (value === "true") return true;
|
||||
if (value === "false") return false;
|
||||
@@ -139,6 +159,35 @@ export function EdgeSettingsPanel({
|
||||
Agent 不能只有默认路径;请改为条件路径,或删除连接以持续对话。
|
||||
</span>
|
||||
)}
|
||||
{sourceType === "action" && (
|
||||
<div className="rounded-xl border border-hairline bg-canvas-soft p-3">
|
||||
<div className="mb-2 text-xs text-muted-foreground">
|
||||
Action 常用结果条件
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="gap-1.5"
|
||||
onClick={() => applyActionResultPreset("ok")}
|
||||
>
|
||||
<CircleCheck size={14} />
|
||||
执行成功
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="gap-1.5"
|
||||
onClick={() => applyActionResultPreset("error")}
|
||||
>
|
||||
<CircleX size={14} />
|
||||
执行失败
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{mode !== "always" && (
|
||||
<label className="block">
|
||||
<div className="mb-1.5 text-sm font-medium text-foreground">
|
||||
|
||||
Reference in New Issue
Block a user