@datatechsolutions/ui 2.7.118 → 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.
@@ -1399,6 +1399,99 @@ var AgentFlowNode = memo(function AgentFlowNode2({ id, data, selected }) {
1399
1399
  /* @__PURE__ */ jsx(WorkflowHandle, { type: "source", position: Position.Right, id: "rule-out", style: { top: "75%" }, colorClass: "!bg-violet-500" })
1400
1400
  ] });
1401
1401
  });
1402
+ var CATEGORY_ICONS = {
1403
+ search: "from-sky-400 to-blue-500",
1404
+ code: "from-cyan-400 to-sky-500",
1405
+ file: "from-violet-400 to-purple-500",
1406
+ web: "from-orange-400 to-amber-500",
1407
+ math: "from-emerald-400 to-green-500",
1408
+ custom: "from-amber-400 to-orange-500"
1409
+ };
1410
+ var CATEGORY_PILL = {
1411
+ search: "bg-sky-100 text-sky-700 dark:bg-sky-500/20 dark:text-sky-300",
1412
+ code: "bg-cyan-100 text-cyan-700 dark:bg-cyan-500/20 dark:text-cyan-300",
1413
+ file: "bg-violet-100 text-violet-700 dark:bg-violet-500/20 dark:text-violet-300",
1414
+ web: "bg-orange-100 text-orange-700 dark:bg-orange-500/20 dark:text-orange-300",
1415
+ math: "bg-emerald-100 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-300",
1416
+ custom: "bg-amber-100 text-amber-700 dark:bg-amber-500/20 dark:text-amber-300"
1417
+ };
1418
+ var AgentToolFlowNode = memo(function AgentToolFlowNode2({ id, data, selected }) {
1419
+ const t = useTranslations("agents.workflow");
1420
+ const { agentTool, onRemoveFromCanvas } = data;
1421
+ const isCompact = data.displayMode === "compact";
1422
+ if (!agentTool?.name) {
1423
+ const label = data.label;
1424
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1425
+ /* @__PURE__ */ jsx(NodeRunningIndicator, { nodeId: id }),
1426
+ /* @__PURE__ */ jsx(WorkflowHandle, { type: "target", position: Position.Left, id: "left-in", colorClass: "!bg-amber-400" }),
1427
+ /* @__PURE__ */ jsx(NodeCard, { variant: "error", nodeType: "agent_tool", children: /* @__PURE__ */ jsx(
1428
+ NodeCardHeader,
1429
+ {
1430
+ icon: /* @__PURE__ */ jsx(ExclamationTriangleIcon, { className: "h-5 w-5 text-white" }),
1431
+ title: label || "Agent Tool",
1432
+ description: t("agentToolNotFound"),
1433
+ iconClassName: "flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 shadow-lg"
1434
+ }
1435
+ ) }),
1436
+ /* @__PURE__ */ jsx(WorkflowHandle, { type: "source", position: Position.Right, id: "right-out", colorClass: "!bg-amber-500" })
1437
+ ] });
1438
+ }
1439
+ const category = agentTool.category ?? "custom";
1440
+ const gradient = CATEGORY_ICONS[category] ?? CATEGORY_ICONS.custom;
1441
+ const pill = CATEGORY_PILL[category] ?? CATEGORY_PILL.custom;
1442
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1443
+ /* @__PURE__ */ jsx(NodeRunningIndicator, { nodeId: id }),
1444
+ /* @__PURE__ */ jsx(WorkflowHandle, { type: "target", position: Position.Left, id: "left-in", colorClass: "!bg-amber-400" }),
1445
+ /* @__PURE__ */ jsxs(NodeCard, { compact: isCompact, selected, nodeType: "agent_tool", width: "w-[280px]", children: [
1446
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
1447
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
1448
+ /* @__PURE__ */ jsx("div", { className: `flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br ${gradient} shadow-lg`, children: /* @__PURE__ */ jsx(CommandLineIcon, { className: "h-5 w-5 text-white" }) }),
1449
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
1450
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: agentTool.name }),
1451
+ !isCompact && agentTool.description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 truncate text-xs text-gray-500 dark:text-gray-400", children: agentTool.description })
1452
+ ] })
1453
+ ] }),
1454
+ data.onToggle && /* @__PURE__ */ jsx(
1455
+ "span",
1456
+ {
1457
+ role: "switch",
1458
+ "aria-checked": agentTool.enabled,
1459
+ 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"}`,
1460
+ onClick: (event) => {
1461
+ event.stopPropagation();
1462
+ data.onToggle(agentTool);
1463
+ },
1464
+ children: /* @__PURE__ */ 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"}` })
1465
+ }
1466
+ )
1467
+ ] }),
1468
+ /* @__PURE__ */ jsx(NodeCardMeta, { compact: isCompact, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
1469
+ /* @__PURE__ */ 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") }),
1470
+ /* @__PURE__ */ jsx(NodeCardBadge, { className: `rounded-full px-2 py-0.5 text-[10px] font-medium ${pill}`, children: category }),
1471
+ agentTool.parameters && agentTool.parameters.length > 0 && /* @__PURE__ */ 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: [
1472
+ agentTool.parameters.length,
1473
+ " params"
1474
+ ] }),
1475
+ onRemoveFromCanvas && /* @__PURE__ */ jsx(
1476
+ "span",
1477
+ {
1478
+ role: "button",
1479
+ tabIndex: 0,
1480
+ onClick: (event) => {
1481
+ event.stopPropagation();
1482
+ event.preventDefault();
1483
+ onRemoveFromCanvas(id);
1484
+ },
1485
+ 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",
1486
+ "aria-label": t("removeFromCanvas"),
1487
+ children: /* @__PURE__ */ jsx(TrashIcon, { className: "h-3.5 w-3.5 text-red-600 dark:text-red-400" })
1488
+ }
1489
+ )
1490
+ ] }) })
1491
+ ] }),
1492
+ /* @__PURE__ */ jsx(WorkflowHandle, { type: "source", position: Position.Right, id: "right-out", colorClass: "!bg-amber-500" })
1493
+ ] });
1494
+ });
1402
1495
  var ToolFlowNode = memo(function ToolFlowNode2({ id, data, selected }) {
1403
1496
  const t = useTranslations("admin.tools");
1404
1497
  const { tool, onRemoveFromCanvas } = data;
@@ -4955,6 +5048,7 @@ var MiniMap = dynamic(
4955
5048
  );
4956
5049
  var BUILT_IN_NODE_TYPES = {
4957
5050
  agent: AgentFlowNode,
5051
+ agent_tool: AgentToolFlowNode,
4958
5052
  tool: ToolFlowNode,
4959
5053
  rule: RuleFlowNode,
4960
5054
  entity: EntityFlowNode,
@@ -5024,6 +5118,7 @@ function WorkflowCanvasInner({
5024
5118
  agents,
5025
5119
  models,
5026
5120
  tools,
5121
+ agentTools = [],
5027
5122
  rules,
5028
5123
  entities = [],
5029
5124
  initialGraph,
@@ -5117,6 +5212,13 @@ function WorkflowCanvasInner({
5117
5212
  }
5118
5213
  return map;
5119
5214
  }, [allTools]);
5215
+ const agentToolMap = useMemo(() => {
5216
+ const map = /* @__PURE__ */ new Map();
5217
+ for (const at of agentTools) {
5218
+ map.set(at.agentToolId, at);
5219
+ }
5220
+ return map;
5221
+ }, [agentTools]);
5120
5222
  const ruleMap = useMemo(() => {
5121
5223
  const map = /* @__PURE__ */ new Map();
5122
5224
  for (const rule of allRules) {
@@ -6050,6 +6152,20 @@ function WorkflowCanvasInner({
6050
6152
  }
6051
6153
  };
6052
6154
  setNodes((currentNodes) => [...currentNodes, newNode]);
6155
+ } else if (nodeType === "agent_tool") {
6156
+ const agentTool = agentToolMap.get(entityId);
6157
+ if (!agentTool) return;
6158
+ const newNode = {
6159
+ id: newNodeId,
6160
+ type: "agent_tool",
6161
+ position,
6162
+ data: {
6163
+ agentTool,
6164
+ order: 0,
6165
+ onRemoveFromCanvas: handleRemoveNodeFromCanvas
6166
+ }
6167
+ };
6168
+ setNodes((currentNodes) => [...currentNodes, newNode]);
6053
6169
  } else if (nodeType === "rule") {
6054
6170
  const rule = ruleMap.get(entityId);
6055
6171
  if (!rule) return;
@@ -6644,6 +6760,6 @@ function Workspace({
6644
6760
  ) });
6645
6761
  }
6646
6762
 
6647
- export { AgentFlowNode, AnswerFlowNode, AnthropicIcon, CATEGORY_COLORS, CATEGORY_PILL_COLORS, CodeFlowNode, CrewAIIcon, DocumentExtractorFlowNode, EndFlowNode, EntityFlowNode, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, HttpRequestFlowNode, ICON_MAP, IfElseFlowNode, IterationFlowNode, IterationStartFlowNode, KnowledgeBaseFlowNode, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, ListOperatorFlowNode, LogicNodeDrawer, MINIMAP_NODE_COLORS, NodeCard, NodeCardBadge, NodeCardHeader, NodeCardMeta, NodeContextMenu, NodeRunningIndicator, NoteFlowNode, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, QuestionClassifierFlowNode, RuleFlowNode, SelectionContextMenu, StartFlowNode, StrandsIcon, TemplateTransformFlowNode, ToolFlowNode, VariableAggregatorFlowNode, VariableAssignerFlowNode, WorkflowBuilderProvider, WorkflowCanvas, WorkflowHandle, Workspace, WorkspaceDrawer, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, isModelCompatibleWithFramework, useDrawerStore, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore };
6648
- //# sourceMappingURL=chunk-4ESKCNPI.mjs.map
6649
- //# sourceMappingURL=chunk-4ESKCNPI.mjs.map
6763
+ export { AgentFlowNode, AgentToolFlowNode, AnswerFlowNode, AnthropicIcon, CATEGORY_COLORS, CATEGORY_PILL_COLORS, CodeFlowNode, CrewAIIcon, DocumentExtractorFlowNode, EndFlowNode, EntityFlowNode, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, HttpRequestFlowNode, ICON_MAP, IfElseFlowNode, IterationFlowNode, IterationStartFlowNode, KnowledgeBaseFlowNode, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, ListOperatorFlowNode, LogicNodeDrawer, MINIMAP_NODE_COLORS, NodeCard, NodeContextMenu, NoteFlowNode, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, QuestionClassifierFlowNode, RuleFlowNode, SelectionContextMenu, StartFlowNode, StrandsIcon, TemplateTransformFlowNode, ToolFlowNode, VariableAggregatorFlowNode, VariableAssignerFlowNode, WorkflowBuilderProvider, WorkflowCanvas, Workspace, WorkspaceDrawer, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, isModelCompatibleWithFramework, useDrawerStore, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore };
6764
+ //# sourceMappingURL=chunk-PAOGPMVC.mjs.map
6765
+ //# sourceMappingURL=chunk-PAOGPMVC.mjs.map