@datatechsolutions/ui 2.11.18 → 2.11.20

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.
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import '../chunk-JB6RNAD2.mjs';
3
3
  export { topologicalSortAgents, validateWorkflowGraph } from '../chunk-BLNXRUC4.mjs';
4
- import { Workspace, useModalStore, CATEGORY_COLORS, CATEGORY_PILL_COLORS, ICON_MAP, WorkflowCanvas, getEntityIcon, getEntityGradient, useWorkflowStore, LOGIC_ICON_MAP, LOGIC_NODE_GRADIENTS, getFrameworkMeta, getCompatibleModels, isModelCompatibleWithFramework, FRAMEWORK_META } from '../chunk-LIYKHVLG.mjs';
5
- export { AgentFlowNode, AgentToolFlowNode, AnswerFlowNode, AnthropicIcon, CodeFlowNode, CrewAIIcon, DocumentExtractorFlowNode, EndFlowNode, EntityFlowNode, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, HttpRequestFlowNode, IfElseFlowNode, IterationFlowNode, IterationStartFlowNode, KnowledgeBaseFlowNode, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, ListOperatorFlowNode, LogicNodeModal, MINIMAP_NODE_COLORS, ModelProviderFlowNode, NodeCard, NodeContextMenu, NoteFlowNode, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, QuestionClassifierFlowNode, RuleFlowNode, SelectionContextMenu, StartFlowNode, StrandsIcon, TemplateTransformFlowNode, ToolFlowNode, VariableAggregatorFlowNode, VariableAssignerFlowNode, WorkflowBuilderProvider, Workspace, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, isModelCompatibleWithFramework, useModalStore, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore } from '../chunk-LIYKHVLG.mjs';
6
- import { SettingsDialog, GlassModalShell, Button, FormInput, FormTextarea, GlassFormModal, Input, DynamicIslandConfirm } from '../chunk-46ZM5VJJ.mjs';
4
+ import { Workspace, useModalStore, CATEGORY_COLORS, CATEGORY_PILL_COLORS, ICON_MAP, WorkflowCanvas, getEntityIcon, getEntityGradient, useWorkflowStore, LOGIC_ICON_MAP, LOGIC_NODE_GRADIENTS, getFrameworkMeta, getCompatibleModels, isModelCompatibleWithFramework, FRAMEWORK_META, isFrameworkCompatibleWithProviders } from '../chunk-TZD35VFY.mjs';
5
+ export { AgentFlowNode, AgentToolFlowNode, AnswerFlowNode, AnthropicIcon, CodeFlowNode, CrewAIIcon, DocumentExtractorFlowNode, EndFlowNode, EntityFlowNode, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, HttpRequestFlowNode, IfElseFlowNode, IterationFlowNode, IterationStartFlowNode, KnowledgeBaseFlowNode, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, ListOperatorFlowNode, LogicNodeModal, MINIMAP_NODE_COLORS, ModelProviderFlowNode, NodeCard, NodeContextMenu, NoteFlowNode, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, QuestionClassifierFlowNode, RuleFlowNode, SelectionContextMenu, StartFlowNode, StrandsIcon, TemplateTransformFlowNode, ToolFlowNode, VariableAggregatorFlowNode, VariableAssignerFlowNode, WorkflowBuilderProvider, Workspace, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, isModelCompatibleWithFramework, useModalStore, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore } from '../chunk-TZD35VFY.mjs';
6
+ import { SettingsDialog, GlassModalShell, Button, FormInput, FormTextarea, GlassFormModal, Input, DynamicIslandConfirm } from '../chunk-N5VHGPE7.mjs';
7
7
  import '../chunk-QWG2FMUN.mjs';
8
8
  import '../chunk-D2JF6C3E.mjs';
9
9
  export { GraphNodeBadge, GraphNodeHeader, GraphNodeIconBubble, GraphNodeMeta } from '../chunk-OZNTQROP.mjs';
@@ -11,7 +11,7 @@ import { getAgentTier, createDefaultLogicNodeConfig } from '../chunk-TLPPVL3W.mj
11
11
  export { applyDagreLayout, createDefaultLogicNodeConfig, getAgentTier } from '../chunk-TLPPVL3W.mjs';
12
12
  import { useTranslations } from '../chunk-7VJ7CMMT.mjs';
13
13
  import { memo, useCallback, useState, useEffect, useMemo, useRef, Children } from 'react';
14
- import { UserCircleIcon, Cog6ToothIcon, CommandLineIcon, KeyIcon, PlayCircleIcon, ArrowPathRoundedSquareIcon, ArrowsPointingOutIcon, ArrowsPointingInIcon, BoltIcon, ClockIcon, CheckIcon, CpuChipIcon, AdjustmentsHorizontalIcon, CircleStackIcon, TrashIcon, PlusIcon, XMarkIcon, EyeIcon, ArrowPathIcon, PlayIcon, StopIcon, XCircleIcon, CheckCircleIcon, VariableIcon, ChevronDownIcon, ChevronRightIcon, ExclamationCircleIcon, ClipboardDocumentIcon, ArrowDownTrayIcon, ArrowUpTrayIcon, ExclamationTriangleIcon } from '@heroicons/react/24/outline';
14
+ import { UserCircleIcon, Cog6ToothIcon, SparklesIcon, CommandLineIcon, KeyIcon, PlayCircleIcon, ArrowPathRoundedSquareIcon, ArrowsPointingOutIcon, ArrowsPointingInIcon, BoltIcon, ClockIcon, CheckIcon, CpuChipIcon, AdjustmentsHorizontalIcon, CircleStackIcon, TrashIcon, PlusIcon, XMarkIcon, EyeIcon, ArrowPathIcon, PlayIcon, StopIcon, XCircleIcon, CheckCircleIcon, VariableIcon, ChevronDownIcon, ChevronRightIcon, ExclamationCircleIcon, ClipboardDocumentIcon, ArrowDownTrayIcon, ArrowUpTrayIcon, ExclamationTriangleIcon } from '@heroicons/react/24/outline';
15
15
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
16
16
  import { create } from 'zustand';
17
17
 
@@ -358,24 +358,9 @@ function AgentCapabilityCard({ elo, setElo, models, selectedModelId, setSelected
358
358
  ] })
359
359
  ] });
360
360
  }
361
- function ConfigTab({ agent, models, t, selectedModelId, setSelectedModelId, selectedFramework, setSelectedFramework, temperature, setTemperature, dirty, markDirty, markSaved }) {
362
- const [promptText, setPromptText] = useState(agent.systemPrompt ?? "");
363
- const handleTemperatureChange = useCallback((event) => {
364
- setTemperature(parseFloat(event.target.value));
365
- markDirty();
366
- }, []);
367
- const handlePromptChange = useCallback((event) => {
368
- setPromptText(event.target.value);
369
- markDirty();
370
- }, []);
371
- useCallback(() => {
372
- markSaved();
373
- }, [markSaved]);
374
- const temperaturePercent = temperature * 100;
375
- const isPrecise = temperature <= 0.3;
376
- const isBalanced = temperature > 0.3 && temperature <= 0.7;
377
- const isCreative = temperature > 0.7;
361
+ function ConfigTab({ models, t, selectedModelId, setSelectedModelId, selectedFramework, setSelectedFramework, markDirty, connectedProviderTypes }) {
378
362
  const frameworkKeys = Object.keys(FRAMEWORK_META);
363
+ const hasProviderConstraints = connectedProviderTypes.length > 0;
379
364
  const compatibleModels = getCompatibleModels(models, selectedFramework);
380
365
  const handleFrameworkChange = useCallback((newFramework) => {
381
366
  setSelectedFramework(newFramework);
@@ -394,12 +379,15 @@ function ConfigTab({ agent, models, t, selectedModelId, setSelectedModelId, sele
394
379
  const meta = FRAMEWORK_META[key];
395
380
  const isSelected = key === selectedFramework;
396
381
  const compatCount = getCompatibleModels(models, key).length;
382
+ const isCompatibleWithProviders = !hasProviderConstraints || isFrameworkCompatibleWithProviders(key, connectedProviderTypes);
397
383
  return /* @__PURE__ */ jsxs(
398
384
  "button",
399
385
  {
400
386
  type: "button",
401
387
  onClick: () => handleFrameworkChange(key),
402
- className: `inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-[10px] font-semibold transition-all ${isSelected ? `${meta.badgeColor} ring-1 ring-current/20` : "bg-gray-100 text-gray-500 hover:bg-gray-200 dark:bg-white/5 dark:text-gray-400 dark:hover:bg-white/10"}`,
388
+ disabled: !isCompatibleWithProviders,
389
+ className: `inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-[10px] font-semibold transition-all ${!isCompatibleWithProviders ? "cursor-not-allowed bg-gray-100 text-gray-400 opacity-40 dark:bg-white/5 dark:text-gray-500" : isSelected ? `${meta.badgeColor} ring-1 ring-current/20` : "bg-gray-100 text-gray-500 hover:bg-gray-200 dark:bg-white/5 dark:text-gray-400 dark:hover:bg-white/10"}`,
390
+ title: !isCompatibleWithProviders ? t("agentDrawer.frameworkIncompatible") : void 0,
403
391
  children: [
404
392
  /* @__PURE__ */ jsx(meta.IconComponent, { className: "h-3.5 w-3.5" }),
405
393
  meta.label,
@@ -446,7 +434,24 @@ function ConfigTab({ agent, models, t, selectedModelId, setSelectedModelId, sele
446
434
  model.id
447
435
  );
448
436
  }) })
449
- ] }),
437
+ ] })
438
+ ] });
439
+ }
440
+ function PromptTab({ agent, temperature, setTemperature, markDirty, t }) {
441
+ const [promptText, setPromptText] = useState(agent.systemPrompt ?? "");
442
+ const handleTemperatureChange = useCallback((event) => {
443
+ setTemperature(parseFloat(event.target.value));
444
+ markDirty();
445
+ }, []);
446
+ const handlePromptChange = useCallback((event) => {
447
+ setPromptText(event.target.value);
448
+ markDirty();
449
+ }, []);
450
+ const temperaturePercent = temperature * 100;
451
+ const isPrecise = temperature <= 0.3;
452
+ const isBalanced = temperature > 0.3 && temperature <= 0.7;
453
+ const isCreative = temperature > 0.7;
454
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-5 p-4", children: [
450
455
  /* @__PURE__ */ jsxs("div", { children: [
451
456
  /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
452
457
  /* @__PURE__ */ jsx("label", { className: "text-xs font-medium text-gray-500 dark:text-gray-400", children: t("agentDrawer.temperature") }),
@@ -457,10 +462,7 @@ function ConfigTab({ agent, models, t, selectedModelId, setSelectedModelId, sele
457
462
  "div",
458
463
  {
459
464
  className: "h-full rounded-full transition-all duration-300 ease-out",
460
- style: {
461
- width: `${temperaturePercent}%`,
462
- background: `linear-gradient(90deg, #3b82f6, #8b5cf6 50%, #ec4899)`
463
- }
465
+ style: { width: `${temperaturePercent}%`, background: "linear-gradient(90deg, #3b82f6, #8b5cf6 50%, #ec4899)" }
464
466
  }
465
467
  ) }),
466
468
  /* @__PURE__ */ jsx(
@@ -473,24 +475,12 @@ function ConfigTab({ agent, models, t, selectedModelId, setSelectedModelId, sele
473
475
  value: temperature,
474
476
  onChange: handleTemperatureChange,
475
477
  "aria-label": t("agentDrawer.temperature"),
476
- "aria-valuemin": 0,
477
- "aria-valuemax": 1,
478
478
  "aria-valuenow": temperature,
479
479
  "aria-valuetext": `${temperature.toFixed(2)} \u2014 ${isPrecise ? t("agentDrawer.precise") : isBalanced ? t("agentDrawer.balanced") : t("agentDrawer.creative")}`,
480
- className: "relative z-10 h-5 w-full cursor-pointer appearance-none bg-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:shadow-lg dark:[&::-webkit-slider-thumb]:border-gray-900",
481
- style: {
482
- // Thumb color based on temperature zone
483
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
484
- ["--thumb-color"]: isPrecise ? "#3b82f6" : isBalanced ? "#8b5cf6" : "#ec4899"
485
- }
480
+ className: "relative z-10 h-5 w-full cursor-pointer appearance-none bg-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:shadow-lg dark:[&::-webkit-slider-thumb]:border-gray-900"
486
481
  }
487
482
  ),
488
- /* @__PURE__ */ jsx("style", { children: `
489
- input[type="range"]::-webkit-slider-thumb {
490
- background: ${isPrecise ? "#3b82f6" : isBalanced ? "#8b5cf6" : "#ec4899"};
491
- box-shadow: 0 0 8px ${isPrecise ? "rgba(59,130,246,0.5)" : isBalanced ? "rgba(139,92,246,0.5)" : "rgba(236,72,153,0.5)"};
492
- }
493
- ` })
483
+ /* @__PURE__ */ jsx("style", { children: `input[type="range"]::-webkit-slider-thumb { background: ${isPrecise ? "#3b82f6" : isBalanced ? "#8b5cf6" : "#ec4899"}; box-shadow: 0 0 8px ${isPrecise ? "rgba(59,130,246,0.5)" : isBalanced ? "rgba(139,92,246,0.5)" : "rgba(236,72,153,0.5)"}; }` })
494
484
  ] }),
495
485
  /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center justify-between", children: [
496
486
  /* @__PURE__ */ jsx("span", { className: `text-[10px] font-medium transition-colors ${isPrecise ? "text-blue-500" : "text-gray-400 dark:text-gray-500"}`, children: t("agentDrawer.precise") }),
@@ -511,7 +501,7 @@ function ConfigTab({ agent, models, t, selectedModelId, setSelectedModelId, sele
511
501
  {
512
502
  value: promptText,
513
503
  onChange: handlePromptChange,
514
- rows: 8,
504
+ rows: 12,
515
505
  className: "w-full resize-y rounded-lg border border-gray-200/50 bg-gray-50/50 px-3 py-2.5 font-mono text-xs leading-relaxed text-gray-700 outline-none transition-colors placeholder:text-gray-400 focus:border-indigo-300/50 focus:ring-1 focus:ring-indigo-300/30 dark:border-white/10 dark:bg-white/5 dark:text-gray-300 dark:placeholder:text-gray-500 dark:focus:border-indigo-500/30 dark:focus:ring-indigo-500/20",
516
506
  placeholder: t("agentDrawer.systemPromptPlaceholder")
517
507
  }
@@ -761,6 +751,7 @@ function AgentModal({ onSaved }) {
761
751
  const sections = [
762
752
  { id: "profile", label: t("agentDrawer.profileSection"), icon: UserCircleIcon, group: t("agentDrawer.agentGroup") },
763
753
  { id: "framework", label: t("agentDrawer.frameworkSection"), icon: Cog6ToothIcon, group: t("agentDrawer.agentGroup") },
754
+ { id: "prompt", label: t("agentDrawer.promptSection"), icon: SparklesIcon, group: t("agentDrawer.agentGroup") },
764
755
  { id: "tools", label: `${t("agentDrawer.toolsTab")}${enabledToolIds.size > 0 ? ` (${enabledToolIds.size})` : ""}`, icon: CommandLineIcon, group: t("agentDrawer.configGroup") },
765
756
  { id: "models", label: `${t("agentDrawer.modelsTab")}${selectedProviderId ? " \u2713" : ""}`, icon: KeyIcon, group: t("agentDrawer.configGroup") },
766
757
  { id: "results", label: t("agentDrawer.resultsTab"), icon: PlayCircleIcon, group: t("agentDrawer.executionGroup") }
@@ -798,7 +789,8 @@ function AgentModal({ onSaved }) {
798
789
  sidebarFooter,
799
790
  children: [
800
791
  activeTab === "profile" && /* @__PURE__ */ jsx(AgentProfileHeader, { agent, models, t, selectedModelId, setSelectedModelId, selectedFramework, temperature, setTemperature, elo, setElo, onChanged: markDirty }),
801
- activeTab === "framework" && /* @__PURE__ */ jsx(ConfigTab, { agent, models, t, selectedModelId, setSelectedModelId, selectedFramework, setSelectedFramework: (fw) => setSelectedFramework(fw), temperature, setTemperature, dirty, markDirty, markSaved: handleMarkSaved }),
792
+ activeTab === "framework" && /* @__PURE__ */ jsx(ConfigTab, { models, t, selectedModelId, setSelectedModelId, selectedFramework, setSelectedFramework: (fw) => setSelectedFramework(fw), markDirty, connectedProviderTypes: availableModelProviders.map((p) => p.provider) }),
793
+ activeTab === "prompt" && /* @__PURE__ */ jsx(PromptTab, { agent, temperature, setTemperature, markDirty, t }),
802
794
  activeTab === "tools" && /* @__PURE__ */ jsx(ToolsTab, { agentTools: availableAgentTools, enabledToolIds, onToggle: handleToggleTool, agentFramework: selectedFramework, t }),
803
795
  activeTab === "models" && /* @__PURE__ */ jsx(
804
796
  ModelsTab,
@@ -1628,9 +1620,9 @@ function NodePalette({ agents, tools, agentTools = [], rules, entities = [], mod
1628
1620
  filteredProviders.length > 0 && /* @__PURE__ */ jsx(
1629
1621
  CollapsibleSection,
1630
1622
  {
1631
- title: t("modelProvidersSection"),
1623
+ title: t("connectionsSection"),
1632
1624
  icon: /* @__PURE__ */ jsx(KeyIcon, { className: "h-3 w-3" }),
1633
- colorClass: "text-rose-600 dark:text-rose-400",
1625
+ colorClass: "text-slate-600 dark:text-slate-400",
1634
1626
  count: filteredProviders.length,
1635
1627
  children: filteredProviders.map((provider) => {
1636
1628
  const providerLogo = PROVIDER_LOGOS2[provider.provider];