feat: add MCP tool integration

This commit is contained in:
Xin Wang
2026-07-18 00:00:06 +08:00
parent bdf3d3dd9c
commit e39bb48ba8
21 changed files with 1641 additions and 62 deletions

View File

@@ -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">