@datatechsolutions/ui 2.7.119 → 2.7.120

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1405,6 +1405,99 @@ var AgentFlowNode = react.memo(function AgentFlowNode2({ id, data, selected }) {
1405
1405
  /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "source", position: react$1.Position.Right, id: "rule-out", style: { top: "75%" }, colorClass: "!bg-violet-500" })
1406
1406
  ] });
1407
1407
  });
1408
+ var CATEGORY_ICONS = {
1409
+ search: "from-sky-400 to-blue-500",
1410
+ code: "from-cyan-400 to-sky-500",
1411
+ file: "from-violet-400 to-purple-500",
1412
+ web: "from-orange-400 to-amber-500",
1413
+ math: "from-emerald-400 to-green-500",
1414
+ custom: "from-amber-400 to-orange-500"
1415
+ };
1416
+ var CATEGORY_PILL = {
1417
+ search: "bg-sky-100 text-sky-700 dark:bg-sky-500/20 dark:text-sky-300",
1418
+ code: "bg-cyan-100 text-cyan-700 dark:bg-cyan-500/20 dark:text-cyan-300",
1419
+ file: "bg-violet-100 text-violet-700 dark:bg-violet-500/20 dark:text-violet-300",
1420
+ web: "bg-orange-100 text-orange-700 dark:bg-orange-500/20 dark:text-orange-300",
1421
+ math: "bg-emerald-100 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-300",
1422
+ custom: "bg-amber-100 text-amber-700 dark:bg-amber-500/20 dark:text-amber-300"
1423
+ };
1424
+ var AgentToolFlowNode = react.memo(function AgentToolFlowNode2({ id, data, selected }) {
1425
+ const t = nextIntl.useTranslations("agents.workflow");
1426
+ const { agentTool, onRemoveFromCanvas } = data;
1427
+ const isCompact = data.displayMode === "compact";
1428
+ if (!agentTool?.name) {
1429
+ const label = data.label;
1430
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1431
+ /* @__PURE__ */ jsxRuntime.jsx(NodeRunningIndicator, { nodeId: id }),
1432
+ /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "target", position: react$1.Position.Left, id: "left-in", colorClass: "!bg-amber-400" }),
1433
+ /* @__PURE__ */ jsxRuntime.jsx(NodeCard, { variant: "error", nodeType: "agent_tool", children: /* @__PURE__ */ jsxRuntime.jsx(
1434
+ NodeCardHeader,
1435
+ {
1436
+ icon: /* @__PURE__ */ jsxRuntime.jsx(outline.ExclamationTriangleIcon, { className: "h-5 w-5 text-white" }),
1437
+ title: label || "Agent Tool",
1438
+ description: t("agentToolNotFound"),
1439
+ iconClassName: "flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 shadow-lg"
1440
+ }
1441
+ ) }),
1442
+ /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "source", position: react$1.Position.Right, id: "right-out", colorClass: "!bg-amber-500" })
1443
+ ] });
1444
+ }
1445
+ const category = agentTool.category ?? "custom";
1446
+ const gradient = CATEGORY_ICONS[category] ?? CATEGORY_ICONS.custom;
1447
+ const pill = CATEGORY_PILL[category] ?? CATEGORY_PILL.custom;
1448
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1449
+ /* @__PURE__ */ jsxRuntime.jsx(NodeRunningIndicator, { nodeId: id }),
1450
+ /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "target", position: react$1.Position.Left, id: "left-in", colorClass: "!bg-amber-400" }),
1451
+ /* @__PURE__ */ jsxRuntime.jsxs(NodeCard, { compact: isCompact, selected, nodeType: "agent_tool", width: "w-[280px]", children: [
1452
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between", children: [
1453
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
1454
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br ${gradient} shadow-lg`, children: /* @__PURE__ */ jsxRuntime.jsx(outline.CommandLineIcon, { className: "h-5 w-5 text-white" }) }),
1455
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
1456
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: agentTool.name }),
1457
+ !isCompact && agentTool.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 truncate text-xs text-gray-500 dark:text-gray-400", children: agentTool.description })
1458
+ ] })
1459
+ ] }),
1460
+ data.onToggle && /* @__PURE__ */ jsxRuntime.jsx(
1461
+ "span",
1462
+ {
1463
+ role: "switch",
1464
+ "aria-checked": agentTool.enabled,
1465
+ className: `nodrag nopan relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer items-center rounded-full border border-white/50 px-0.5 shadow-[inset_0_1px_0_rgba(255,255,255,0.5)] transition duration-200 dark:border-white/15 ${agentTool.enabled ? "bg-amber-500/90" : "bg-slate-300/80 dark:bg-slate-700/80"}`,
1466
+ onClick: (event) => {
1467
+ event.stopPropagation();
1468
+ data.onToggle(agentTool);
1469
+ },
1470
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: `pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow transition duration-200 ${agentTool.enabled ? "translate-x-4" : "translate-x-0"}` })
1471
+ }
1472
+ )
1473
+ ] }),
1474
+ /* @__PURE__ */ jsxRuntime.jsx(NodeCardMeta, { compact: isCompact, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
1475
+ /* @__PURE__ */ jsxRuntime.jsx(NodeCardBadge, { className: "rounded-full bg-amber-100 px-2 py-0.5 text-[10px] font-semibold text-amber-700 dark:bg-amber-500/20 dark:text-amber-300", children: t("agentToolNode") }),
1476
+ /* @__PURE__ */ jsxRuntime.jsx(NodeCardBadge, { className: `rounded-full px-2 py-0.5 text-[10px] font-medium ${pill}`, children: category }),
1477
+ agentTool.parameters && agentTool.parameters.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(NodeCardBadge, { className: "rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-medium text-gray-600 dark:bg-white/10 dark:text-gray-300", children: [
1478
+ agentTool.parameters.length,
1479
+ " params"
1480
+ ] }),
1481
+ onRemoveFromCanvas && /* @__PURE__ */ jsxRuntime.jsx(
1482
+ "span",
1483
+ {
1484
+ role: "button",
1485
+ tabIndex: 0,
1486
+ onClick: (event) => {
1487
+ event.stopPropagation();
1488
+ event.preventDefault();
1489
+ onRemoveFromCanvas(id);
1490
+ },
1491
+ className: "nodrag nopan ml-auto cursor-pointer rounded-lg p-1 opacity-0 transition hover:bg-red-50 group-hover:opacity-100 dark:hover:bg-red-900/20",
1492
+ "aria-label": t("removeFromCanvas"),
1493
+ children: /* @__PURE__ */ jsxRuntime.jsx(outline.TrashIcon, { className: "h-3.5 w-3.5 text-red-600 dark:text-red-400" })
1494
+ }
1495
+ )
1496
+ ] }) })
1497
+ ] }),
1498
+ /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "source", position: react$1.Position.Right, id: "right-out", colorClass: "!bg-amber-500" })
1499
+ ] });
1500
+ });
1408
1501
  var ToolFlowNode = react.memo(function ToolFlowNode2({ id, data, selected }) {
1409
1502
  const t = nextIntl.useTranslations("admin.tools");
1410
1503
  const { tool, onRemoveFromCanvas } = data;
@@ -4961,6 +5054,7 @@ var MiniMap = dynamic__default.default(
4961
5054
  );
4962
5055
  var BUILT_IN_NODE_TYPES = {
4963
5056
  agent: AgentFlowNode,
5057
+ agent_tool: AgentToolFlowNode,
4964
5058
  tool: ToolFlowNode,
4965
5059
  rule: RuleFlowNode,
4966
5060
  entity: EntityFlowNode,
@@ -6673,6 +6767,7 @@ function Workspace({
6673
6767
  }
6674
6768
 
6675
6769
  exports.AgentFlowNode = AgentFlowNode;
6770
+ exports.AgentToolFlowNode = AgentToolFlowNode;
6676
6771
  exports.AnswerFlowNode = AnswerFlowNode;
6677
6772
  exports.AnthropicIcon = AnthropicIcon;
6678
6773
  exports.CATEGORY_COLORS = CATEGORY_COLORS;
@@ -6700,11 +6795,7 @@ exports.ListOperatorFlowNode = ListOperatorFlowNode;
6700
6795
  exports.LogicNodeDrawer = LogicNodeDrawer;
6701
6796
  exports.MINIMAP_NODE_COLORS = MINIMAP_NODE_COLORS;
6702
6797
  exports.NodeCard = NodeCard;
6703
- exports.NodeCardBadge = NodeCardBadge;
6704
- exports.NodeCardHeader = NodeCardHeader;
6705
- exports.NodeCardMeta = NodeCardMeta;
6706
6798
  exports.NodeContextMenu = NodeContextMenu;
6707
- exports.NodeRunningIndicator = NodeRunningIndicator;
6708
6799
  exports.NoteFlowNode = NoteFlowNode;
6709
6800
  exports.OpenAIIcon = OpenAIIcon;
6710
6801
  exports.PanelContextMenu = PanelContextMenu;
@@ -6720,7 +6811,6 @@ exports.VariableAggregatorFlowNode = VariableAggregatorFlowNode;
6720
6811
  exports.VariableAssignerFlowNode = VariableAssignerFlowNode;
6721
6812
  exports.WorkflowBuilderProvider = WorkflowBuilderProvider;
6722
6813
  exports.WorkflowCanvas = WorkflowCanvas;
6723
- exports.WorkflowHandle = WorkflowHandle;
6724
6814
  exports.Workspace = Workspace;
6725
6815
  exports.WorkspaceDrawer = WorkspaceDrawer;
6726
6816
  exports.getCompatibleModels = getCompatibleModels;
@@ -6736,5 +6826,5 @@ exports.useDrawerStore = useDrawerStore;
6736
6826
  exports.useWorkflowBuilderClient = useWorkflowBuilderClient;
6737
6827
  exports.useWorkflowBuilderClientOptional = useWorkflowBuilderClientOptional;
6738
6828
  exports.useWorkflowStore = useWorkflowStore;
6739
- //# sourceMappingURL=chunk-DOO5ICHD.js.map
6740
- //# sourceMappingURL=chunk-DOO5ICHD.js.map
6829
+ //# sourceMappingURL=chunk-6XPZOAE7.js.map
6830
+ //# sourceMappingURL=chunk-6XPZOAE7.js.map