@datatechsolutions/ui 2.11.13 → 2.11.15

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.
@@ -340,6 +340,7 @@ var LOGIC_NODE_GRADIENTS = {
340
340
  note: "from-yellow-400 to-amber-500",
341
341
  entity: "from-blue-400 to-cyan-500",
342
342
  datasource: "from-cyan-500 to-blue-600",
343
+ model_provider: "from-rose-500 to-pink-600",
343
344
  group: "from-slate-400 to-gray-500"
344
345
  };
345
346
  var LOGIC_NODE_BADGE_COLORS = {
@@ -362,6 +363,7 @@ var LOGIC_NODE_BADGE_COLORS = {
362
363
  note: "bg-yellow-100 text-yellow-700 dark:bg-yellow-500/20 dark:text-yellow-300",
363
364
  entity: "bg-blue-100 text-blue-700 dark:bg-blue-500/20 dark:text-blue-300",
364
365
  datasource: "bg-cyan-100 text-cyan-700 dark:bg-cyan-500/20 dark:text-cyan-300",
366
+ model_provider: "bg-rose-100 text-rose-700 dark:bg-rose-500/20 dark:text-rose-300",
365
367
  group: "bg-slate-100 text-slate-700 dark:bg-slate-500/20 dark:text-slate-300"
366
368
  };
367
369
  var LOGIC_NODE_BADGE_SOFT_COLORS = {
@@ -384,6 +386,7 @@ var LOGIC_NODE_BADGE_SOFT_COLORS = {
384
386
  note: "bg-yellow-50 text-yellow-600 dark:bg-yellow-500/20 dark:text-yellow-400",
385
387
  entity: "bg-blue-50 text-blue-600 dark:bg-blue-500/20 dark:text-blue-400",
386
388
  datasource: "bg-cyan-50 text-cyan-600 dark:bg-cyan-500/20 dark:text-cyan-400",
389
+ model_provider: "bg-rose-50 text-rose-600 dark:bg-rose-500/20 dark:text-rose-400",
387
390
  group: "bg-slate-50 text-slate-600 dark:bg-slate-500/20 dark:text-slate-400"
388
391
  };
389
392
  var LOGIC_ICON_MAP = {
@@ -406,6 +409,7 @@ var LOGIC_ICON_MAP = {
406
409
  note: outline.PencilSquareIcon,
407
410
  entity: outline.CircleStackIcon,
408
411
  datasource: outline.ServerStackIcon,
412
+ model_provider: outline.KeyIcon,
409
413
  group: outline.RectangleGroupIcon
410
414
  };
411
415
  var NODE_SELECTED_CLASS = "node-card-selected";
@@ -433,7 +437,8 @@ var NODE_BORDER_COLORS = {
433
437
  document_extractor: "border-rose-300/50 dark:border-rose-600/50",
434
438
  list_operator: "border-lime-300/50 dark:border-lime-600/50",
435
439
  note: "border-gray-200/50 dark:border-gray-700/50",
436
- datasource: "border-cyan-300/50 dark:border-cyan-600/50"
440
+ datasource: "border-cyan-300/50 dark:border-cyan-600/50",
441
+ model_provider: "border-rose-300/50 dark:border-rose-600/50"
437
442
  };
438
443
  function getNodeStateClass(selected, nodeType, customBorder) {
439
444
  if (selected) return NODE_SELECTED_CLASS;
@@ -464,6 +469,7 @@ var MINIMAP_NODE_COLORS = {
464
469
  note: "#eab308",
465
470
  entity: "#3b82f6",
466
471
  datasource: "#06b6d4",
472
+ model_provider: "#f43f5e",
467
473
  group: "#64748b"
468
474
  };
469
475
  var LOGIC_NODE_HANDLE_COLORS = {
@@ -486,6 +492,7 @@ var LOGIC_NODE_HANDLE_COLORS = {
486
492
  note: "!bg-yellow-500",
487
493
  entity: "!bg-blue-500",
488
494
  datasource: "!bg-cyan-500",
495
+ model_provider: "!bg-rose-500",
489
496
  group: "!bg-slate-500"
490
497
  };
491
498
  var INSERTABLE_NODES = [
@@ -2760,6 +2767,75 @@ var DatasourceFlowNode = react.memo(function DatasourceFlowNode2({ id, data, sel
2760
2767
  /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "source", position: react$1.Position.Right, id: "right-out", colorClass: "!bg-cyan-400" })
2761
2768
  ] });
2762
2769
  });
2770
+ var PROVIDER_TYPE_LABELS = {
2771
+ aws_bedrock: "AWS Bedrock",
2772
+ openai_api: "OpenAI API",
2773
+ google_vertex: "Google Vertex AI",
2774
+ azure_openai: "Azure OpenAI",
2775
+ anthropic_api: "Anthropic API",
2776
+ custom: "Custom"
2777
+ };
2778
+ var ModelProviderFlowNode = react.memo(function ModelProviderFlowNode2({ id, data, selected }) {
2779
+ const config = data.config;
2780
+ const isCompact = data.displayMode === "compact";
2781
+ if (!config) {
2782
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2783
+ /* @__PURE__ */ jsxRuntime.jsx(NodeRunningIndicator, { nodeId: id }),
2784
+ /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "target", position: react$1.Position.Left, id: "left-in", colorClass: "!bg-gray-400 dark:!bg-gray-500" }),
2785
+ /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "target", position: react$1.Position.Top, id: "top-in", colorClass: "!bg-gray-400 dark:!bg-gray-500" }),
2786
+ /* @__PURE__ */ jsxRuntime.jsx(NodeCard, { variant: "error", nodeType: "model_provider", width: "w-[280px]", children: /* @__PURE__ */ jsxRuntime.jsx(
2787
+ NodeCardHeader,
2788
+ {
2789
+ icon: /* @__PURE__ */ jsxRuntime.jsx(outline.ExclamationTriangleIcon, { className: "h-6 w-6 text-white" }),
2790
+ title: data.label || "Model Provider",
2791
+ description: "Not configured",
2792
+ iconClassName: "flex h-11 w-11 items-center justify-center rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 shadow-lg"
2793
+ }
2794
+ ) }),
2795
+ /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "source", position: react$1.Position.Right, id: "right-out", colorClass: "!bg-rose-500" }),
2796
+ /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "source", position: react$1.Position.Bottom, id: "bottom-out", colorClass: "!bg-rose-500" })
2797
+ ] });
2798
+ }
2799
+ const providerLabel = PROVIDER_TYPE_LABELS[config.providerType] ?? config.providerType;
2800
+ const displayName = config.name || providerLabel;
2801
+ const regionLabel = config.region ? config.region : void 0;
2802
+ const isConfigured = !!(config.credentialRef || config.apiKeyRef);
2803
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2804
+ /* @__PURE__ */ jsxRuntime.jsx(NodeRunningIndicator, { nodeId: id }),
2805
+ /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "target", position: react$1.Position.Left, id: "left-in", colorClass: "!bg-gray-400 dark:!bg-gray-500" }),
2806
+ /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "target", position: react$1.Position.Top, id: "top-in", colorClass: "!bg-gray-400 dark:!bg-gray-500" }),
2807
+ /* @__PURE__ */ jsxRuntime.jsx(
2808
+ "button",
2809
+ {
2810
+ type: "button",
2811
+ onClick: () => data.onEdit?.(id),
2812
+ className: "w-full text-left",
2813
+ children: /* @__PURE__ */ jsxRuntime.jsxs(NodeCard, { compact: isCompact, selected, nodeType: "model_provider", width: "w-[280px]", children: [
2814
+ /* @__PURE__ */ jsxRuntime.jsx(
2815
+ NodeCardHeader,
2816
+ {
2817
+ icon: /* @__PURE__ */ jsxRuntime.jsx(outline.KeyIcon, { className: "h-6 w-6 text-white" }),
2818
+ title: displayName,
2819
+ description: providerLabel,
2820
+ iconClassName: "flex h-11 w-11 items-center justify-center rounded-xl bg-gradient-to-br from-rose-500 to-pink-600 shadow-lg"
2821
+ }
2822
+ ),
2823
+ /* @__PURE__ */ jsxRuntime.jsx(NodeCardMeta, { compact: isCompact, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
2824
+ /* @__PURE__ */ jsxRuntime.jsx(NodeCardBadge, { className: "rounded-full bg-rose-100 px-2 py-0.5 text-[10px] font-semibold text-rose-700 dark:bg-rose-500/20 dark:text-rose-300", children: providerLabel }),
2825
+ regionLabel && /* @__PURE__ */ jsxRuntime.jsx(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: regionLabel }),
2826
+ /* @__PURE__ */ jsxRuntime.jsx(NodeCardBadge, { className: `rounded-full px-2 py-0.5 text-[10px] font-medium ${isConfigured ? "bg-green-100 text-green-700 dark:bg-green-500/20 dark:text-green-300" : "bg-amber-100 text-amber-700 dark:bg-amber-500/20 dark:text-amber-300"}`, children: isConfigured ? "Configured" : "Setup needed" }),
2827
+ config.modelFilter && config.modelFilter.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: [
2828
+ config.modelFilter.length,
2829
+ " models"
2830
+ ] })
2831
+ ] }) })
2832
+ ] })
2833
+ }
2834
+ ),
2835
+ /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "source", position: react$1.Position.Right, id: "right-out", colorClass: "!bg-rose-500" }),
2836
+ /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "source", position: react$1.Position.Bottom, id: "bottom-out", colorClass: "!bg-rose-500" })
2837
+ ] });
2838
+ });
2763
2839
  var GROUP_COLORS = {
2764
2840
  indigo: {
2765
2841
  border: "border-indigo-300/50 dark:border-indigo-600/50",
@@ -4953,6 +5029,135 @@ function GroupNodeConfigForm({ config, onSave, onCancel }) {
4953
5029
  )
4954
5030
  ] });
4955
5031
  }
5032
+ var PROVIDER_TYPES = [
5033
+ { value: "aws_bedrock", label: "AWS Bedrock" },
5034
+ { value: "openai_api", label: "OpenAI API" },
5035
+ { value: "google_vertex", label: "Google Vertex AI" },
5036
+ { value: "azure_openai", label: "Azure OpenAI" },
5037
+ { value: "anthropic_api", label: "Anthropic API" },
5038
+ { value: "custom", label: "Custom" }
5039
+ ];
5040
+ var REGION_OPTIONS = {
5041
+ aws_bedrock: [
5042
+ { value: "us-east-1", label: "US East (N. Virginia)" },
5043
+ { value: "us-west-2", label: "US West (Oregon)" },
5044
+ { value: "eu-west-1", label: "Europe (Ireland)" },
5045
+ { value: "eu-central-1", label: "Europe (Frankfurt)" },
5046
+ { value: "ap-northeast-1", label: "Asia Pacific (Tokyo)" },
5047
+ { value: "ap-southeast-1", label: "Asia Pacific (Singapore)" },
5048
+ { value: "sa-east-1", label: "South America (S\xE3o Paulo)" }
5049
+ ],
5050
+ google_vertex: [
5051
+ { value: "us-central1", label: "US Central (Iowa)" },
5052
+ { value: "us-east4", label: "US East (Virginia)" },
5053
+ { value: "europe-west4", label: "Europe West (Netherlands)" },
5054
+ { value: "asia-northeast1", label: "Asia NE (Tokyo)" }
5055
+ ],
5056
+ azure_openai: [
5057
+ { value: "eastus", label: "East US" },
5058
+ { value: "westeurope", label: "West Europe" },
5059
+ { value: "swedencentral", label: "Sweden Central" },
5060
+ { value: "japaneast", label: "Japan East" }
5061
+ ]
5062
+ };
5063
+ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
5064
+ const t = chunkYXN2K77G_js.useTranslations("agents.workflow.modelProviderNodeConfig");
5065
+ const [providerType, setProviderType] = react.useState(config.providerType);
5066
+ const [name, setName] = react.useState(config.name ?? "");
5067
+ const [region, setRegion] = react.useState(config.region ?? "");
5068
+ const [endpoint, setEndpoint] = react.useState(config.endpoint ?? "");
5069
+ const [credentialRef, setCredentialRef] = react.useState(config.credentialRef ?? "");
5070
+ const [apiKeyRef, setApiKeyRef] = react.useState(config.apiKeyRef ?? "");
5071
+ const regions = REGION_OPTIONS[providerType] ?? [];
5072
+ const showRegion = regions.length > 0;
5073
+ const showEndpoint = providerType === "custom" || providerType === "azure_openai";
5074
+ const showApiKey = providerType === "openai_api" || providerType === "anthropic_api" || providerType === "custom";
5075
+ const showCredentialRef = providerType === "aws_bedrock" || providerType === "google_vertex";
5076
+ const handleSave = () => {
5077
+ onSave({
5078
+ ...config,
5079
+ providerType,
5080
+ name: name.trim() || void 0,
5081
+ region: region || void 0,
5082
+ endpoint: endpoint.trim() || void 0,
5083
+ credentialRef: credentialRef.trim() || void 0,
5084
+ apiKeyRef: apiKeyRef.trim() || void 0
5085
+ });
5086
+ };
5087
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
5088
+ /* @__PURE__ */ jsxRuntime.jsx(
5089
+ chunk4XID6LOC_js.FormInput,
5090
+ {
5091
+ type: "text",
5092
+ label: t("nameLabel"),
5093
+ value: name,
5094
+ onValueChange: setName,
5095
+ placeholder: t("namePlaceholder")
5096
+ }
5097
+ ),
5098
+ /* @__PURE__ */ jsxRuntime.jsx(
5099
+ chunk4XID6LOC_js.FormSelect,
5100
+ {
5101
+ label: t("providerTypeLabel"),
5102
+ value: providerType,
5103
+ onValueChange: (value) => {
5104
+ setProviderType(value);
5105
+ setRegion("");
5106
+ },
5107
+ options: PROVIDER_TYPES.map((pt) => ({ value: pt.value, label: pt.label }))
5108
+ }
5109
+ ),
5110
+ showRegion && /* @__PURE__ */ jsxRuntime.jsx(
5111
+ chunk4XID6LOC_js.FormSelect,
5112
+ {
5113
+ label: t("regionLabel"),
5114
+ value: region,
5115
+ onValueChange: setRegion,
5116
+ options: [{ value: "", label: t("selectRegion") }, ...regions]
5117
+ }
5118
+ ),
5119
+ showEndpoint && /* @__PURE__ */ jsxRuntime.jsx(
5120
+ chunk4XID6LOC_js.FormInput,
5121
+ {
5122
+ type: "text",
5123
+ label: t("endpointLabel"),
5124
+ value: endpoint,
5125
+ onValueChange: setEndpoint,
5126
+ placeholder: t("endpointPlaceholder")
5127
+ }
5128
+ ),
5129
+ showApiKey && /* @__PURE__ */ jsxRuntime.jsx(
5130
+ chunk4XID6LOC_js.FormInput,
5131
+ {
5132
+ type: "password",
5133
+ label: t("apiKeyLabel"),
5134
+ value: apiKeyRef,
5135
+ onValueChange: setApiKeyRef,
5136
+ placeholder: t("apiKeyPlaceholder")
5137
+ }
5138
+ ),
5139
+ showCredentialRef && /* @__PURE__ */ jsxRuntime.jsx(
5140
+ chunk4XID6LOC_js.FormInput,
5141
+ {
5142
+ type: "text",
5143
+ label: t("credentialRefLabel"),
5144
+ value: credentialRef,
5145
+ onValueChange: setCredentialRef,
5146
+ placeholder: t("credentialRefPlaceholder")
5147
+ }
5148
+ ),
5149
+ /* @__PURE__ */ jsxRuntime.jsx(
5150
+ ConfigFormActions,
5151
+ {
5152
+ cancelLabel: t("cancel"),
5153
+ saveLabel: t("save"),
5154
+ onCancel,
5155
+ onSave: handleSave,
5156
+ saveDisabled: !providerType
5157
+ }
5158
+ )
5159
+ ] });
5160
+ }
4956
5161
  var NODE_TITLE_KEYS = {
4957
5162
  start: "startNodeConfig",
4958
5163
  end: "endNodeConfig",
@@ -4972,7 +5177,8 @@ var NODE_TITLE_KEYS = {
4972
5177
  iteration_start: "iterationStartNodeConfig",
4973
5178
  entity: "entityNodeConfig",
4974
5179
  datasource: "datasourceNodeConfig",
4975
- group: "groupNodeConfig"
5180
+ group: "groupNodeConfig",
5181
+ model_provider: "modelProviderNodeConfig"
4976
5182
  };
4977
5183
  function LogicNodeModal({ onSave, entities = [], datasources = [], onLoadTables, onLoadSchema }) {
4978
5184
  const t = chunkYXN2K77G_js.useTranslations("agents.workflow");
@@ -5043,6 +5249,8 @@ function LogicNodeModal({ onSave, entities = [], datasources = [], onLoadTables,
5043
5249
  return /* @__PURE__ */ jsxRuntime.jsx(EntityNodeConfigForm, { config, entities, onSave: handleSave, onCancel: closeModal });
5044
5250
  case "group":
5045
5251
  return /* @__PURE__ */ jsxRuntime.jsx(GroupNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5252
+ case "model_provider":
5253
+ return /* @__PURE__ */ jsxRuntime.jsx(ModelProviderNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5046
5254
  default:
5047
5255
  return null;
5048
5256
  }
@@ -5413,6 +5621,7 @@ var BUILT_IN_NODE_TYPES = {
5413
5621
  iteration_start: IterationStartFlowNode,
5414
5622
  note: NoteFlowNode,
5415
5623
  datasource: DatasourceFlowNode,
5624
+ model_provider: ModelProviderFlowNode,
5416
5625
  group: GroupFlowNode
5417
5626
  };
5418
5627
  var ALL_LOGIC_NODE_TYPES = [
@@ -5438,6 +5647,7 @@ var ALL_LOGIC_NODE_TYPES = [
5438
5647
  "rule",
5439
5648
  "entity",
5440
5649
  "datasource",
5650
+ "model_provider",
5441
5651
  "group"
5442
5652
  ];
5443
5653
  function isLogicNodeType(nodeType) {
@@ -5631,9 +5841,11 @@ function WorkflowCanvasInner({
5631
5841
  agent,
5632
5842
  order: agent.order ?? 0,
5633
5843
  selected: selectedAgentId === savedNode.id,
5844
+ agentTools: agentTools.map((at) => ({ id: at.agentToolId, name: at.name, category: at.category, enabled: at.enabled })),
5845
+ providerName: models.find((m) => m.id === agent.modelId)?.provider,
5634
5846
  onSelect: () => {
5635
5847
  setSelectedAgentId(agent.agentId);
5636
- openAgentModalAction(agent, models);
5848
+ openAgentModalAction(agent, models, false, agentTools);
5637
5849
  },
5638
5850
  onRemoveFromCanvas: handleRemoveNodeFromCanvas
5639
5851
  }
@@ -5984,7 +6196,7 @@ function WorkflowCanvasInner({
5984
6196
  const agent = targetNode.data?.agent;
5985
6197
  if (agent) {
5986
6198
  setSelectedAgentId(agent.agentId ?? agent.id ?? null);
5987
- openAgentModalAction(agent, models);
6199
+ openAgentModalAction(agent, models, false, agentTools);
5988
6200
  }
5989
6201
  } else if (targetNode.type === "tool") {
5990
6202
  const tool = targetNode.data?.tool;
@@ -6475,7 +6687,7 @@ function WorkflowCanvasInner({
6475
6687
  selected: false,
6476
6688
  onSelect: () => {
6477
6689
  setSelectedAgentId(agent.agentId);
6478
- openAgentModalAction(agent, models);
6690
+ openAgentModalAction(agent, models, false, agentTools);
6479
6691
  },
6480
6692
  onRemoveFromCanvas: handleRemoveNodeFromCanvas
6481
6693
  }
@@ -7123,6 +7335,7 @@ exports.LangChainIcon = LangChainIcon;
7123
7335
  exports.ListOperatorFlowNode = ListOperatorFlowNode;
7124
7336
  exports.LogicNodeModal = LogicNodeModal;
7125
7337
  exports.MINIMAP_NODE_COLORS = MINIMAP_NODE_COLORS;
7338
+ exports.ModelProviderFlowNode = ModelProviderFlowNode;
7126
7339
  exports.NodeCard = NodeCard;
7127
7340
  exports.NodeContextMenu = NodeContextMenu;
7128
7341
  exports.NoteFlowNode = NoteFlowNode;
@@ -7154,5 +7367,5 @@ exports.useModalStore = useModalStore;
7154
7367
  exports.useWorkflowBuilderClient = useWorkflowBuilderClient;
7155
7368
  exports.useWorkflowBuilderClientOptional = useWorkflowBuilderClientOptional;
7156
7369
  exports.useWorkflowStore = useWorkflowStore;
7157
- //# sourceMappingURL=chunk-RUH6YJXW.js.map
7158
- //# sourceMappingURL=chunk-RUH6YJXW.js.map
7370
+ //# sourceMappingURL=chunk-WB5CWGXD.js.map
7371
+ //# sourceMappingURL=chunk-WB5CWGXD.js.map