@datatechsolutions/ui 2.11.16 → 2.11.18

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-4B47R7VI.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-4B47R7VI.mjs';
6
- import { 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 } 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';
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 { CpuChipIcon, ArrowPathRoundedSquareIcon, ArrowsPointingOutIcon, ArrowsPointingInIcon, BoltIcon, ClockIcon, CheckIcon, Cog6ToothIcon, AdjustmentsHorizontalIcon, CircleStackIcon, KeyIcon, TrashIcon, PlusIcon, XMarkIcon, EyeIcon, ArrowPathIcon, PlayIcon, StopIcon, XCircleIcon, CheckCircleIcon, VariableIcon, ChevronDownIcon, ChevronRightIcon, ExclamationCircleIcon, ClipboardDocumentIcon, ArrowDownTrayIcon, ArrowUpTrayIcon, ExclamationTriangleIcon, CommandLineIcon } from '@heroicons/react/24/outline';
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';
15
15
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
16
16
  import { create } from 'zustand';
17
17
 
@@ -560,7 +560,7 @@ var PROVIDER_LOGOS = {
560
560
  azure_openai: SI("microsoftazure", "0078D4"),
561
561
  anthropic_api: SI("anthropic", "D4A27F")
562
562
  };
563
- function ModelsTab({ modelProviders, selectedProviderId, onSelectProvider, t }) {
563
+ function ModelsTab({ modelProviders, selectedProviderId, onSelectProvider, models, selectedModelId, onSelectModel, agentFramework, t }) {
564
564
  if (modelProviders.length === 0) {
565
565
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center px-4 py-12 text-center", children: [
566
566
  /* @__PURE__ */ jsx(KeyIcon, { className: "mb-2 h-8 w-8 text-gray-400 dark:text-gray-500" }),
@@ -568,35 +568,87 @@ function ModelsTab({ modelProviders, selectedProviderId, onSelectProvider, t })
568
568
  /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-gray-400 dark:text-gray-500", children: t("agentDrawer.dragProviderHint") })
569
569
  ] });
570
570
  }
571
- return /* @__PURE__ */ jsxs("div", { className: "space-y-2 p-4", children: [
572
- /* @__PURE__ */ jsx("p", { className: "mb-3 text-xs text-gray-500 dark:text-gray-400", children: t("agentDrawer.modelsDescription") }),
573
- modelProviders.map((provider) => {
574
- const isSelected = selectedProviderId === provider.id;
575
- const logo = PROVIDER_LOGOS[provider.provider];
576
- return /* @__PURE__ */ jsxs(
577
- "button",
578
- {
579
- type: "button",
580
- onClick: () => onSelectProvider(provider.id),
581
- className: `flex w-full items-center gap-3 rounded-xl border px-4 py-3 text-left transition-all ${isSelected ? "border-rose-500/30 bg-rose-50/50 ring-1 ring-rose-500/20 dark:border-rose-400/20 dark:bg-rose-500/5" : "border-gray-200/50 bg-gray-50/30 hover:border-gray-300 dark:border-white/10 dark:bg-white/[0.02] dark:hover:border-white/20"}`,
582
- children: [
583
- logo ? /* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-white/10 p-1.5", children: /* @__PURE__ */ jsx("img", { src: logo, alt: "", className: "h-6 w-6 object-contain", loading: "lazy" }) }) : /* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-rose-500 to-pink-600", children: /* @__PURE__ */ jsx(KeyIcon, { className: "h-5 w-5 text-white" }) }),
584
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
585
- /* @__PURE__ */ jsx("p", { className: `text-sm font-medium ${isSelected ? "text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`, children: provider.name }),
586
- /* @__PURE__ */ jsxs("div", { className: "mt-0.5 flex items-center gap-2 text-[10px] text-gray-400 dark:text-gray-500", children: [
587
- /* @__PURE__ */ jsxs("span", { children: [
588
- provider.modelCount,
589
- " models"
590
- ] }),
591
- /* @__PURE__ */ jsx("span", { className: `rounded-full px-1.5 py-0.5 text-[9px] font-medium ${provider.configured ? "bg-green-100 text-green-600 dark:bg-green-500/10 dark:text-green-400" : "bg-amber-100 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400"}`, children: provider.configured ? t("agentDrawer.providerConfigured") : t("agentDrawer.providerSetup") })
592
- ] })
593
- ] }),
594
- /* @__PURE__ */ jsx("div", { className: `flex h-5 w-5 shrink-0 items-center justify-center rounded-full transition-all ${isSelected ? "bg-rose-500 text-white" : "border border-gray-300 dark:border-gray-600"}`, children: isSelected && /* @__PURE__ */ jsx(CheckIcon, { className: "h-3 w-3" }) })
595
- ]
596
- },
597
- provider.id
598
- );
571
+ const modelsByProvider = modelProviders.map((provider) => ({
572
+ provider,
573
+ models: models.filter((m) => {
574
+ const modelProvider = m.id.split(".")[0];
575
+ return provider.provider === modelProvider || provider.provider === "amazon" && modelProvider === "anthropic" || provider.provider === "amazon" && modelProvider === "amazon" || provider.provider === "amazon" && modelProvider === "meta";
599
576
  })
577
+ }));
578
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4 p-4", children: [
579
+ /* @__PURE__ */ jsxs("div", { children: [
580
+ /* @__PURE__ */ jsx("label", { className: "mb-2 block text-xs font-medium text-gray-500 dark:text-gray-400", children: t("agentDrawer.selectProvider") }),
581
+ /* @__PURE__ */ jsx("div", { className: "space-y-1.5", children: modelProviders.map((provider) => {
582
+ const isSelected = selectedProviderId === provider.id;
583
+ const logo = PROVIDER_LOGOS[provider.provider];
584
+ return /* @__PURE__ */ jsxs(
585
+ "button",
586
+ {
587
+ type: "button",
588
+ onClick: () => onSelectProvider(provider.id),
589
+ className: `flex w-full items-center gap-3 rounded-xl border px-3 py-2.5 text-left transition-all ${isSelected ? "border-indigo-500/30 bg-indigo-50/50 ring-1 ring-indigo-500/20 dark:border-indigo-400/20 dark:bg-indigo-500/5" : "border-gray-200/50 bg-gray-50/30 hover:border-gray-300 dark:border-white/10 dark:bg-white/[0.02] dark:hover:border-white/20"}`,
590
+ children: [
591
+ logo ? /* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-white/10 p-1", children: /* @__PURE__ */ jsx("img", { src: logo, alt: "", className: "h-5 w-5 object-contain", loading: "lazy" }) }) : /* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-slate-500 to-gray-600", children: /* @__PURE__ */ jsx(KeyIcon, { className: "h-4 w-4 text-white" }) }),
592
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
593
+ /* @__PURE__ */ jsx("p", { className: `text-xs font-medium ${isSelected ? "text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`, children: provider.name }),
594
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-gray-400 dark:text-gray-500", children: [
595
+ /* @__PURE__ */ jsxs("span", { children: [
596
+ provider.modelCount,
597
+ " models"
598
+ ] }),
599
+ provider.configured && /* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 rounded-full bg-green-500" })
600
+ ] })
601
+ ] }),
602
+ /* @__PURE__ */ jsx("div", { className: `flex h-4 w-4 shrink-0 items-center justify-center rounded-full transition-all ${isSelected ? "bg-indigo-500 text-white" : "border border-gray-300 dark:border-gray-600"}`, children: isSelected && /* @__PURE__ */ jsx(CheckIcon, { className: "h-2.5 w-2.5" }) })
603
+ ]
604
+ },
605
+ provider.id
606
+ );
607
+ }) })
608
+ ] }),
609
+ selectedProviderId && (() => {
610
+ const providerModels = modelsByProvider.find((p) => p.provider.id === selectedProviderId);
611
+ if (!providerModels || providerModels.models.length === 0) return /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-400 dark:text-gray-500", children: t("agentDrawer.noModelsForProvider") });
612
+ const compatibleModels = providerModels.models.filter(
613
+ (m) => isModelCompatibleWithFramework(m.id, agentFramework)
614
+ );
615
+ const incompatibleModels = providerModels.models.filter(
616
+ (m) => !isModelCompatibleWithFramework(m.id, agentFramework)
617
+ );
618
+ return /* @__PURE__ */ jsxs("div", { children: [
619
+ /* @__PURE__ */ jsx("label", { className: "mb-2 block text-xs font-medium text-gray-500 dark:text-gray-400", children: t("agentDrawer.selectModel") }),
620
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
621
+ compatibleModels.map((model) => {
622
+ const isSelected = selectedModelId === model.id;
623
+ const { IconComponent, color, providerLabel } = getModelIcon(model.id);
624
+ return /* @__PURE__ */ jsxs(
625
+ "button",
626
+ {
627
+ type: "button",
628
+ onClick: () => onSelectModel(model.id),
629
+ className: `flex w-full items-center gap-2.5 rounded-lg border px-3 py-2 text-left transition-all ${isSelected ? "border-indigo-500/50 bg-indigo-50/50 ring-1 ring-indigo-500/30 dark:border-indigo-400/40 dark:bg-indigo-500/10" : "border-gray-200/50 bg-gray-50/50 hover:border-gray-300 dark:border-white/10 dark:bg-white/5 dark:hover:border-white/20"}`,
630
+ children: [
631
+ /* @__PURE__ */ jsx(IconComponent, { className: `h-4 w-4 flex-shrink-0 ${isSelected ? color : "text-gray-400 dark:text-gray-500"}` }),
632
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
633
+ /* @__PURE__ */ jsx("p", { className: `text-xs font-semibold ${isSelected ? "text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-300"}`, children: model.name }),
634
+ /* @__PURE__ */ jsx("p", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: providerLabel })
635
+ ] }),
636
+ isSelected && /* @__PURE__ */ jsx(CheckIcon, { className: "h-3.5 w-3.5 shrink-0 text-indigo-500" })
637
+ ]
638
+ },
639
+ model.id
640
+ );
641
+ }),
642
+ incompatibleModels.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
643
+ /* @__PURE__ */ jsx("div", { className: "mt-2 mb-1 text-[9px] font-medium text-gray-400 dark:text-gray-500", children: t("agentDrawer.incompatibleWithFramework") }),
644
+ incompatibleModels.map((model) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5 rounded-lg border border-gray-200/30 px-3 py-2 opacity-40 dark:border-white/5", children: [
645
+ /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-4 w-4 text-gray-400" }),
646
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500", children: model.name })
647
+ ] }, model.id))
648
+ ] })
649
+ ] })
650
+ ] });
651
+ })()
600
652
  ] });
601
653
  }
602
654
  function ToolsTab({ agentTools, enabledToolIds, onToggle, agentFramework, t }) {
@@ -660,7 +712,7 @@ function AgentModal({ onSaved }) {
660
712
  const models = agentData?.models ?? [];
661
713
  const availableAgentTools = agentData?.agentTools ?? [];
662
714
  const isCreateMode = agentData?.isCreateMode ?? false;
663
- const [activeTab, setActiveTab] = useState("config");
715
+ const [activeTab, setActiveTab] = useState("profile");
664
716
  const [selectedModelId, setSelectedModelId] = useState("");
665
717
  const [selectedFramework, setSelectedFramework] = useState("custom");
666
718
  const [temperature, setTemperature] = useState(0.7);
@@ -677,7 +729,7 @@ function AgentModal({ onSaved }) {
677
729
  setTemperature(agent.temperature ?? 0.7);
678
730
  setElo(Number(agent.elo ?? 1e3));
679
731
  setSaved(!isCreateMode);
680
- setActiveTab("config");
732
+ setActiveTab("profile");
681
733
  const agentToolIds = agent.agentToolIds;
682
734
  setEnabledToolIds(new Set(agentToolIds ?? availableAgentTools.filter((t2) => t2.enabled).map((t2) => t2.agentToolId)));
683
735
  setSelectedProviderId(agent.modelProviderId ?? "");
@@ -706,64 +758,64 @@ function AgentModal({ onSaved }) {
706
758
  onSaved?.();
707
759
  }, [markSaved, onSaved]);
708
760
  if (!agent) return null;
709
- const tabList = ["config", "tools", "models", "results"];
710
- const tabs = /* @__PURE__ */ jsx("div", { className: "flex border-b border-white/20 dark:border-white/10", children: tabList.map((tab) => /* @__PURE__ */ jsxs(
711
- "button",
712
- {
713
- type: "button",
714
- onClick: () => setActiveTab(tab),
715
- className: `flex-1 px-4 py-2 text-xs font-medium transition-colors ${activeTab === tab ? "border-b-2 border-blue-500 text-blue-600 dark:text-blue-400" : "text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"}`,
716
- children: [
717
- t(tab === "config" ? "agentDrawer.configTab" : tab === "tools" ? "agentDrawer.toolsTab" : tab === "models" ? "agentDrawer.modelsTab" : "agentDrawer.resultsTab"),
718
- tab === "tools" && enabledToolIds.size > 0 && /* @__PURE__ */ jsx("span", { className: "ml-1 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-amber-500/20 px-1 text-[9px] font-bold text-amber-600 dark:text-amber-400", children: enabledToolIds.size }),
719
- tab === "models" && selectedProviderId && /* @__PURE__ */ jsx("span", { className: "ml-1 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-rose-500/20 px-1 text-[9px] font-bold text-rose-600 dark:text-rose-400", children: "1" })
720
- ]
721
- },
722
- tab
723
- )) });
724
- const footer = /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
725
- /* @__PURE__ */ jsx("div", { role: "status", "aria-live": "polite", className: "text-xs", children: dirty ? /* @__PURE__ */ jsx("span", { className: "text-amber-500 dark:text-amber-400", children: t("agentDrawer.unsavedChanges") }) : /* @__PURE__ */ jsx("span", { className: "text-emerald-500 dark:text-emerald-400", children: t("agentDrawer.saved") }) }),
726
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
727
- /* @__PURE__ */ jsx(
728
- "button",
729
- {
730
- type: "button",
731
- onClick: handleClose,
732
- className: "rounded-lg border border-gray-200/50 px-4 py-2 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100/50 dark:border-white/10 dark:text-gray-300 dark:hover:bg-white/5",
733
- children: t("agentDrawer.cancel")
734
- }
735
- ),
736
- /* @__PURE__ */ jsx(
737
- "button",
738
- {
739
- type: "button",
740
- onClick: handleMarkSaved,
741
- disabled: !dirty,
742
- className: `rounded-lg px-4 py-2 text-xs font-semibold text-white shadow-sm transition-all ${dirty ? "bg-gradient-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600" : "cursor-not-allowed bg-gray-300 dark:bg-gray-700"}`,
743
- children: t("agentDrawer.save")
744
- }
745
- )
746
- ] })
761
+ const sections = [
762
+ { id: "profile", label: t("agentDrawer.profileSection"), icon: UserCircleIcon, group: t("agentDrawer.agentGroup") },
763
+ { id: "framework", label: t("agentDrawer.frameworkSection"), icon: Cog6ToothIcon, group: t("agentDrawer.agentGroup") },
764
+ { id: "tools", label: `${t("agentDrawer.toolsTab")}${enabledToolIds.size > 0 ? ` (${enabledToolIds.size})` : ""}`, icon: CommandLineIcon, group: t("agentDrawer.configGroup") },
765
+ { id: "models", label: `${t("agentDrawer.modelsTab")}${selectedProviderId ? " \u2713" : ""}`, icon: KeyIcon, group: t("agentDrawer.configGroup") },
766
+ { id: "results", label: t("agentDrawer.resultsTab"), icon: PlayCircleIcon, group: t("agentDrawer.executionGroup") }
767
+ ];
768
+ const avatarUrl = agent.avatar;
769
+ const sidebarFooter = /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-4 py-3", children: [
770
+ /* @__PURE__ */ jsx("div", { role: "status", "aria-live": "polite", className: "flex-1 text-xs", children: dirty ? /* @__PURE__ */ jsx("span", { className: "text-amber-500 dark:text-amber-400", children: t("agentDrawer.unsavedChanges") }) : /* @__PURE__ */ jsx("span", { className: "text-emerald-500 dark:text-emerald-400", children: t("agentDrawer.saved") }) }),
771
+ /* @__PURE__ */ jsx(
772
+ "button",
773
+ {
774
+ type: "button",
775
+ onClick: handleMarkSaved,
776
+ disabled: !dirty,
777
+ className: `rounded-lg px-3 py-1.5 text-xs font-semibold text-white shadow-sm transition-all ${dirty ? "bg-gradient-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600" : "cursor-not-allowed bg-gray-300 dark:bg-gray-700"}`,
778
+ children: t("agentDrawer.save")
779
+ }
780
+ )
747
781
  ] });
748
782
  return /* @__PURE__ */ jsxs(
749
- GlassModalShell,
783
+ SettingsDialog,
750
784
  {
751
785
  open,
752
786
  onClose: handleClose,
753
787
  title: agent.name,
754
- subtitle: agent.role ?? "",
755
- gradient: "from-indigo-500 to-purple-600",
756
- icon: /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-6 w-6 text-white" }),
757
- label: isCreateMode ? t("agentDrawer.createAgent") : t("agentDrawer.editAgent"),
758
- headerActions: tabs,
759
- footer,
760
- maxWidth: "2xl",
761
- closeLabel: t("agentDrawer.close"),
788
+ subtitle: isCreateMode ? t("agentDrawer.createAgent") : t("agentDrawer.editAgent"),
789
+ sections,
790
+ activeSectionId: activeTab,
791
+ onSectionChange: (sectionId) => setActiveTab(sectionId),
792
+ identity: {
793
+ displayName: agent.name,
794
+ profileInitial: agent.name.charAt(0).toUpperCase(),
795
+ avatarUrl,
796
+ role: agent.role
797
+ },
798
+ sidebarFooter,
762
799
  children: [
763
- /* @__PURE__ */ jsx(AgentProfileHeader, { agent, models, t, selectedModelId, setSelectedModelId, selectedFramework, temperature, setTemperature, elo, setElo, onChanged: markDirty }),
764
- activeTab === "config" && /* @__PURE__ */ jsx(ConfigTab, { agent, models, t, selectedModelId, setSelectedModelId, selectedFramework, setSelectedFramework: (fw) => setSelectedFramework(fw), temperature, setTemperature, dirty, markDirty, markSaved: handleMarkSaved }),
800
+ 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 }),
765
802
  activeTab === "tools" && /* @__PURE__ */ jsx(ToolsTab, { agentTools: availableAgentTools, enabledToolIds, onToggle: handleToggleTool, agentFramework: selectedFramework, t }),
766
- activeTab === "models" && /* @__PURE__ */ jsx(ModelsTab, { modelProviders: availableModelProviders, selectedProviderId, onSelectProvider: handleSelectProvider, t }),
803
+ activeTab === "models" && /* @__PURE__ */ jsx(
804
+ ModelsTab,
805
+ {
806
+ modelProviders: availableModelProviders,
807
+ selectedProviderId,
808
+ onSelectProvider: handleSelectProvider,
809
+ models,
810
+ selectedModelId,
811
+ onSelectModel: (modelId) => {
812
+ setSelectedModelId(modelId);
813
+ markDirty();
814
+ },
815
+ agentFramework: selectedFramework,
816
+ t
817
+ }
818
+ ),
767
819
  activeTab === "results" && /* @__PURE__ */ jsx(ResultsTab, { agentId: agent.agentId, t })
768
820
  ]
769
821
  }