@datatechsolutions/ui 3.3.0 → 3.4.0

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.
Files changed (166) hide show
  1. package/dist/astrlabe/index.d.mts +22 -30
  2. package/dist/astrlabe/index.d.ts +22 -30
  3. package/dist/astrlabe/index.js +112 -112
  4. package/dist/astrlabe/index.mjs +5 -5
  5. package/dist/astrlabe/workflow-canvas.d.mts +6 -69
  6. package/dist/astrlabe/workflow-canvas.d.ts +6 -69
  7. package/dist/astrlabe/workflow-canvas.js +5 -5
  8. package/dist/astrlabe/workflow-canvas.mjs +4 -4
  9. package/dist/brand/index.d.mts +1 -15
  10. package/dist/brand/index.d.ts +1 -15
  11. package/dist/brand/index.js +0 -14
  12. package/dist/brand/index.js.map +1 -1
  13. package/dist/brand/index.mjs +0 -14
  14. package/dist/brand/index.mjs.map +1 -1
  15. package/dist/{chunk-FAGDZEKM.js → chunk-2OZZH2IO.js} +2 -2
  16. package/dist/chunk-2OZZH2IO.js.map +1 -0
  17. package/dist/{chunk-SYNVNTLJ.mjs → chunk-3AY5HIQ6.mjs} +2 -2
  18. package/dist/chunk-3AY5HIQ6.mjs.map +1 -0
  19. package/dist/{chunk-JSNRCYSO.js → chunk-45QAUEYT.js} +4 -4
  20. package/dist/{chunk-JSNRCYSO.js.map → chunk-45QAUEYT.js.map} +1 -1
  21. package/dist/{chunk-B67DP7MI.mjs → chunk-4GDWGWHY.mjs} +4 -4
  22. package/dist/{chunk-B67DP7MI.mjs.map → chunk-4GDWGWHY.mjs.map} +1 -1
  23. package/dist/{chunk-KR2X2WHJ.js → chunk-4ICEQJH4.js} +53 -53
  24. package/dist/{chunk-KR2X2WHJ.js.map → chunk-4ICEQJH4.js.map} +1 -1
  25. package/dist/{chunk-RXZNACMI.js → chunk-6MBWKOPF.js} +33 -33
  26. package/dist/{chunk-RXZNACMI.js.map → chunk-6MBWKOPF.js.map} +1 -1
  27. package/dist/{chunk-JN6IL6OH.mjs → chunk-AGGOHPMZ.mjs} +1054 -5229
  28. package/dist/chunk-AGGOHPMZ.mjs.map +1 -0
  29. package/dist/{chunk-5GDKCFM5.mjs → chunk-AL73YAV4.mjs} +3 -3
  30. package/dist/{chunk-5GDKCFM5.mjs.map → chunk-AL73YAV4.mjs.map} +1 -1
  31. package/dist/{chunk-ZJPNP2YW.mjs → chunk-BUDZNAKL.mjs} +2 -2
  32. package/dist/chunk-BUDZNAKL.mjs.map +1 -0
  33. package/dist/{chunk-OL73LBX5.mjs → chunk-BW67WFHT.mjs} +3 -4
  34. package/dist/chunk-BW67WFHT.mjs.map +1 -0
  35. package/dist/{chunk-W5OEBO6E.js → chunk-CF7GOUBQ.js} +13 -14
  36. package/dist/chunk-CF7GOUBQ.js.map +1 -0
  37. package/dist/{chunk-IRPS5UCS.mjs → chunk-CUWPLPVY.mjs} +3 -3
  38. package/dist/{chunk-IRPS5UCS.mjs.map → chunk-CUWPLPVY.mjs.map} +1 -1
  39. package/dist/{chunk-IJAKZHXX.js → chunk-ERCDMBRT.js} +683 -645
  40. package/dist/chunk-ERCDMBRT.js.map +1 -0
  41. package/dist/{chunk-I2NZGVBG.js → chunk-FSBR4RCK.js} +1101 -5313
  42. package/dist/chunk-FSBR4RCK.js.map +1 -0
  43. package/dist/{chunk-5RM6NGZ6.mjs → chunk-IDEM3DYF.mjs} +3 -3
  44. package/dist/{chunk-5RM6NGZ6.mjs.map → chunk-IDEM3DYF.mjs.map} +1 -1
  45. package/dist/{chunk-NJFRJ6YD.js → chunk-M7KSEUZR.js} +225 -384
  46. package/dist/chunk-M7KSEUZR.js.map +1 -0
  47. package/dist/{chunk-AOUUZ52N.js → chunk-MO5FBVV3.js} +85 -86
  48. package/dist/chunk-MO5FBVV3.js.map +1 -0
  49. package/dist/{chunk-BR2GAZKG.mjs → chunk-NAFWHJCM.mjs} +7 -7
  50. package/dist/{chunk-BR2GAZKG.mjs.map → chunk-NAFWHJCM.mjs.map} +1 -1
  51. package/dist/{chunk-3JJWPOK6.js → chunk-NCLZKVJK.js} +9 -10
  52. package/dist/chunk-NCLZKVJK.js.map +1 -0
  53. package/dist/{chunk-R4TQWXNG.mjs → chunk-NVQWHJQH.mjs} +6 -5
  54. package/dist/chunk-NVQWHJQH.mjs.map +1 -0
  55. package/dist/{chunk-ZL6C2ZAF.js → chunk-PGVZKMOA.js} +67 -67
  56. package/dist/{chunk-ZL6C2ZAF.js.map → chunk-PGVZKMOA.js.map} +1 -1
  57. package/dist/{chunk-UDDZTTLO.mjs → chunk-QBFE7ABE.mjs} +6 -7
  58. package/dist/chunk-QBFE7ABE.mjs.map +1 -0
  59. package/dist/{chunk-3ZUMJTDT.mjs → chunk-RFRXS4PC.mjs} +3 -4
  60. package/dist/{chunk-3JJWPOK6.js.map → chunk-RFRXS4PC.mjs.map} +1 -1
  61. package/dist/{chunk-ZV5EZXXO.mjs → chunk-RHRJXK5R.mjs} +3 -3
  62. package/dist/{chunk-ZV5EZXXO.mjs.map → chunk-RHRJXK5R.mjs.map} +1 -1
  63. package/dist/{chunk-MWPTSBAI.js → chunk-RLLP7VQJ.js} +26 -26
  64. package/dist/{chunk-MWPTSBAI.js.map → chunk-RLLP7VQJ.js.map} +1 -1
  65. package/dist/{chunk-GIQXB3BG.mjs → chunk-RLVOG5OQ.mjs} +3 -3
  66. package/dist/{chunk-GIQXB3BG.mjs.map → chunk-RLVOG5OQ.mjs.map} +1 -1
  67. package/dist/{chunk-2WXRRQM3.mjs → chunk-SEYUYGER.mjs} +553 -516
  68. package/dist/chunk-SEYUYGER.mjs.map +1 -0
  69. package/dist/{chunk-O6M3KDGT.mjs → chunk-SQ4KGLBZ.mjs} +4 -4
  70. package/dist/{chunk-O6M3KDGT.mjs.map → chunk-SQ4KGLBZ.mjs.map} +1 -1
  71. package/dist/{chunk-F54Q2YJY.js → chunk-SY4MUT5V.js} +7 -7
  72. package/dist/{chunk-F54Q2YJY.js.map → chunk-SY4MUT5V.js.map} +1 -1
  73. package/dist/{chunk-ZM5MVWIT.js → chunk-TUQLZ4QD.js} +5 -6
  74. package/dist/chunk-TUQLZ4QD.js.map +1 -0
  75. package/dist/{chunk-TVMLV675.js → chunk-UE2RDQIK.js} +98 -95
  76. package/dist/chunk-UE2RDQIK.js.map +1 -0
  77. package/dist/{chunk-HDCUWUNH.js → chunk-UJVDI66K.js} +28 -27
  78. package/dist/chunk-UJVDI66K.js.map +1 -0
  79. package/dist/{chunk-PCYL4MII.mjs → chunk-VV6SYMPM.mjs} +156 -314
  80. package/dist/chunk-VV6SYMPM.mjs.map +1 -0
  81. package/dist/{chunk-HZ4LOVHM.js → chunk-VY52Y5GC.js} +2 -2
  82. package/dist/chunk-VY52Y5GC.js.map +1 -0
  83. package/dist/{chunk-LEKZUS6N.mjs → chunk-X3GW7UPN.mjs} +4 -5
  84. package/dist/chunk-X3GW7UPN.mjs.map +1 -0
  85. package/dist/{chunk-OCELRSLO.js → chunk-Y2AYFG4E.js} +4 -4
  86. package/dist/{chunk-OCELRSLO.js.map → chunk-Y2AYFG4E.js.map} +1 -1
  87. package/dist/{chunk-TIJJHW2Z.js → chunk-YV7F7IXG.js} +36 -36
  88. package/dist/{chunk-TIJJHW2Z.js.map → chunk-YV7F7IXG.js.map} +1 -1
  89. package/dist/{chunk-MVBIAXVN.mjs → chunk-ZKSDDFHG.mjs} +14 -11
  90. package/dist/chunk-ZKSDDFHG.mjs.map +1 -0
  91. package/dist/{index-VI9gyJXl.d.mts → index-BNRGVAS5.d.mts} +9 -2
  92. package/dist/index-BoebbJ44.d.mts +49 -0
  93. package/dist/index-BoebbJ44.d.ts +49 -0
  94. package/dist/{index-CoB18TbG.d.ts → index-CnCY-b5V.d.ts} +9 -2
  95. package/dist/index.d.mts +399 -548
  96. package/dist/index.d.ts +399 -548
  97. package/dist/index.js +727 -887
  98. package/dist/index.mjs +3 -3
  99. package/dist/platform/admin/index.js +12 -12
  100. package/dist/platform/admin/index.mjs +6 -6
  101. package/dist/platform/agents-workspace.js +8 -8
  102. package/dist/platform/agents-workspace.mjs +7 -7
  103. package/dist/platform/app-shell.js +5 -5
  104. package/dist/platform/app-shell.mjs +4 -4
  105. package/dist/platform/auth/index.js +29 -29
  106. package/dist/platform/auth/index.mjs +6 -6
  107. package/dist/platform/billing/index.js +5 -5
  108. package/dist/platform/billing/index.mjs +4 -4
  109. package/dist/platform/impersonation/index.js +5 -5
  110. package/dist/platform/impersonation/index.mjs +4 -4
  111. package/dist/platform/index.d.mts +3 -39
  112. package/dist/platform/index.d.ts +3 -39
  113. package/dist/platform/index.js +95 -4805
  114. package/dist/platform/index.js.map +1 -1
  115. package/dist/platform/index.mjs +23 -4728
  116. package/dist/platform/index.mjs.map +1 -1
  117. package/dist/platform/pages/index.d.mts +4 -4
  118. package/dist/platform/pages/index.d.ts +4 -4
  119. package/dist/platform/pages/index.js +197 -197
  120. package/dist/platform/pages/index.mjs +9 -9
  121. package/dist/platform/rbac.d.mts +2 -1
  122. package/dist/platform/rbac.d.ts +2 -1
  123. package/dist/platform/rbac.js +2 -2
  124. package/dist/platform/rbac.mjs +1 -1
  125. package/dist/platform/settings/index.js +9 -9
  126. package/dist/platform/settings/index.mjs +8 -8
  127. package/dist/platform/utils/index.js +3 -3
  128. package/dist/platform/utils/index.js.map +1 -1
  129. package/dist/platform/utils/index.mjs +1 -1
  130. package/dist/platform/utils/index.mjs.map +1 -1
  131. package/dist/platform/workflow-api-client.d.mts +2 -2
  132. package/dist/platform/workflow-api-client.d.ts +2 -2
  133. package/dist/platform/workflow-api-client.js +62 -62
  134. package/dist/platform/workflow-api-client.mjs +2 -2
  135. package/dist/platform/workflow-canvas-shell.js +6 -6
  136. package/dist/platform/workflow-canvas-shell.mjs +5 -5
  137. package/dist/{workflow-api-client-DoYj7nHz.d.mts → workflow-api-client-CpFl3WcG.d.mts} +1 -1
  138. package/dist/{workflow-api-client-BKD8OfP_.d.ts → workflow-api-client-uLICOanv.d.ts} +1 -1
  139. package/dist/workflow-canvas--qaYKuMm.d.ts +113 -0
  140. package/dist/workflow-canvas-B80fmD_n.d.mts +113 -0
  141. package/package.json +15 -5
  142. package/src/styles/liquid-glass.css +283 -2
  143. package/dist/chunk-2WXRRQM3.mjs.map +0 -1
  144. package/dist/chunk-3ZUMJTDT.mjs.map +0 -1
  145. package/dist/chunk-AOUUZ52N.js.map +0 -1
  146. package/dist/chunk-FAGDZEKM.js.map +0 -1
  147. package/dist/chunk-HDCUWUNH.js.map +0 -1
  148. package/dist/chunk-HZ4LOVHM.js.map +0 -1
  149. package/dist/chunk-I2NZGVBG.js.map +0 -1
  150. package/dist/chunk-IJAKZHXX.js.map +0 -1
  151. package/dist/chunk-JN6IL6OH.mjs.map +0 -1
  152. package/dist/chunk-LEKZUS6N.mjs.map +0 -1
  153. package/dist/chunk-MVBIAXVN.mjs.map +0 -1
  154. package/dist/chunk-NJFRJ6YD.js.map +0 -1
  155. package/dist/chunk-OL73LBX5.mjs.map +0 -1
  156. package/dist/chunk-PCYL4MII.mjs.map +0 -1
  157. package/dist/chunk-R4TQWXNG.mjs.map +0 -1
  158. package/dist/chunk-SYNVNTLJ.mjs.map +0 -1
  159. package/dist/chunk-TVMLV675.js.map +0 -1
  160. package/dist/chunk-UDDZTTLO.mjs.map +0 -1
  161. package/dist/chunk-W5OEBO6E.js.map +0 -1
  162. package/dist/chunk-ZJPNP2YW.mjs.map +0 -1
  163. package/dist/chunk-ZM5MVWIT.js.map +0 -1
  164. package/src/brand/logos/kori-icon.svg +0 -45
  165. package/src/brand/logos/kori-logo-dark.svg +0 -40
  166. package/src/brand/logos/kori-logo.svg +0 -43
@@ -1,14 +1,100 @@
1
1
  "use client";
2
- import { NodeRunningIndicator, WorkflowHandle, NodeInteractiveCard, NodeCardHeader, NodeIconBubble, NodeCardMeta, NodeCardBadge, NodeCardDeleteAction, Workspace, useModalStore, CATEGORY_COLORS, CATEGORY_PILL_COLORS, ICON_MAP, WorkflowCanvas, EXPERIMENTAL_NODE_TYPES, getEntityIcon, getEntityGradient, useWorkflowStore, LOGIC_ICON_MAP, LOGIC_NODE_GRADIENTS, getFrameworkMeta, getCompatibleModels, isModelCompatibleWithFramework, FRAMEWORK_META, isFrameworkCompatibleWithProviders } from './chunk-PCYL4MII.mjs';
3
- import { Button, FormInput, FormSelect, GlassModal, FormTextarea, Badge, FormGrid, ToggleSwitch, Input, DynamicIslandConfirm } from './chunk-JN6IL6OH.mjs';
2
+ import { NodeRunningIndicator, WorkflowHandle, NodeCard, NodeCardHeader, NodeCardMeta, NodeCardBadge, NodeInteractiveCard, NodeIconBubble, NodeCardDeleteAction, Workspace, useModalStore, CATEGORY_COLORS, CATEGORY_PILL_COLORS, ICON_MAP, WorkflowCanvas, EXPERIMENTAL_NODE_TYPES, getEntityIcon, getEntityGradient, useWorkflowStore, LOGIC_ICON_MAP, LOGIC_NODE_GRADIENTS, getFrameworkMeta, getCompatibleModels, isModelCompatibleWithFramework, FRAMEWORK_META, isFrameworkCompatibleWithProviders } from './chunk-VV6SYMPM.mjs';
3
+ import { Button, FormInput, FormSelect, ToggleSwitch, HeroBlock, GlassModal, SectionCard, FormTextarea, Badge, FormGrid, Input, DynamicIslandConfirm } from './chunk-AGGOHPMZ.mjs';
4
4
  import { useTranslations } from './chunk-7VJ7CMMT.mjs';
5
5
  import { getAgentTier, createDefaultLogicNodeConfig } from './chunk-G7JQ4OCE.mjs';
6
6
  import { memo, useCallback, useMemo, useState, useEffect, useRef, Children } from 'react';
7
7
  import { Position } from '@xyflow/react';
8
- import { CloudArrowUpIcon, UserCircleIcon, Cog6ToothIcon, SparklesIcon, CommandLineIcon, KeyIcon, PlayCircleIcon, CpuChipIcon, ArrowPathRoundedSquareIcon, ArrowsPointingOutIcon, ArrowsPointingInIcon, BoltIcon, ClockIcon, CheckIcon, ArrowPathIcon, MinusCircleIcon, XCircleIcon, CheckCircleIcon, ExclamationTriangleIcon, AdjustmentsHorizontalIcon, CircleStackIcon, TrashIcon, PlusIcon, XMarkIcon, EyeIcon, PlayIcon, StopIcon, VariableIcon, ChevronDownIcon, ChevronRightIcon, ExclamationCircleIcon, ClipboardDocumentIcon, ArrowDownTrayIcon, ArrowUpTrayIcon } from '@heroicons/react/24/outline';
8
+ import { ExclamationTriangleIcon, KeyIcon, CloudArrowUpIcon, Cog6ToothIcon, SparklesIcon, WrenchScrewdriverIcon, CpuChipIcon, ArrowPathRoundedSquareIcon, ArrowsPointingOutIcon, ArrowsPointingInIcon, BoltIcon, ClockIcon, CheckIcon, ArrowPathIcon, MinusCircleIcon, XCircleIcon, CheckCircleIcon, AdjustmentsHorizontalIcon, CircleStackIcon, TrashIcon, PlusIcon, XMarkIcon, EyeIcon, PlayIcon, StopIcon, VariableIcon, ChevronDownIcon, ChevronRightIcon, ExclamationCircleIcon, ClipboardDocumentIcon, ArrowDownTrayIcon, ArrowUpTrayIcon, CommandLineIcon } from '@heroicons/react/24/outline';
9
9
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
10
10
  import { create } from 'zustand';
11
11
 
12
+ var SI = (slug, color) => `https://cdn.simpleicons.org/${slug}/${color}`;
13
+ var PROVIDER_LOGOS = {
14
+ aws_bedrock: "https://www.svgrepo.com/show/448266/aws.svg",
15
+ openai_api: "https://www.svgrepo.com/show/306500/openai.svg",
16
+ google_vertex: SI("googlegemini", "8E75B2"),
17
+ azure_openai: SI("microsoftazure", "0078D4"),
18
+ anthropic_api: SI("anthropic", "D4A27F"),
19
+ groq: SI("groq", "000000"),
20
+ mistral: SI("mistralai", "FF7000"),
21
+ huggingface: SI("huggingface", "FFD21E"),
22
+ ollama: SI("ollama", "FFFFFF")
23
+ };
24
+ var PROVIDER_TYPE_LABELS = {
25
+ aws_bedrock: "AWS Bedrock",
26
+ openai_api: "OpenAI API",
27
+ google_vertex: "Google Vertex AI",
28
+ azure_openai: "Azure OpenAI",
29
+ anthropic_api: "Anthropic API",
30
+ groq: "Groq Cloud",
31
+ mistral: "Mistral AI",
32
+ huggingface: "Hugging Face",
33
+ ollama: "Ollama (Local)",
34
+ custom: "Custom"
35
+ };
36
+ var ModelProviderFlowNode = memo(function ModelProviderFlowNode2({ id, data, selected }) {
37
+ const config = data.config;
38
+ const isCompact = data.displayMode === "compact";
39
+ if (!config) {
40
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
41
+ /* @__PURE__ */ jsx(NodeRunningIndicator, { nodeId: id }),
42
+ /* @__PURE__ */ jsx(WorkflowHandle, { type: "target", position: Position.Left, id: "left-in", colorClass: "!bg-gray-400 dark:!bg-gray-500" }),
43
+ /* @__PURE__ */ jsx(WorkflowHandle, { type: "target", position: Position.Top, id: "top-in", colorClass: "!bg-gray-400 dark:!bg-gray-500" }),
44
+ /* @__PURE__ */ jsx(NodeCard, { variant: "error", nodeType: "model_provider", width: "w-[280px]", children: /* @__PURE__ */ jsx(
45
+ NodeCardHeader,
46
+ {
47
+ icon: /* @__PURE__ */ jsx(ExclamationTriangleIcon, { className: "h-6 w-6 text-white" }),
48
+ title: data.label || "Model Provider",
49
+ description: "Not configured",
50
+ iconClassName: "flex h-11 w-11 items-center justify-center rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 shadow-lg"
51
+ }
52
+ ) }),
53
+ /* @__PURE__ */ jsx(WorkflowHandle, { type: "source", position: Position.Right, id: "right-out", colorClass: "!bg-slate-500" }),
54
+ /* @__PURE__ */ jsx(WorkflowHandle, { type: "source", position: Position.Bottom, id: "bottom-out", colorClass: "!bg-slate-500" })
55
+ ] });
56
+ }
57
+ const providerLabel = PROVIDER_TYPE_LABELS[config.providerType] ?? config.providerType;
58
+ const displayName = config.name || providerLabel;
59
+ const regionLabel = config.region ? config.region : void 0;
60
+ const isConfigured = !!(config.credentialRef || config.apiKeyRef);
61
+ const logo = PROVIDER_LOGOS[config.providerType];
62
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
63
+ /* @__PURE__ */ jsx(NodeRunningIndicator, { nodeId: id }),
64
+ /* @__PURE__ */ jsx(WorkflowHandle, { type: "target", position: Position.Left, id: "left-in", colorClass: "!bg-gray-400 dark:!bg-gray-500" }),
65
+ /* @__PURE__ */ jsx(WorkflowHandle, { type: "target", position: Position.Top, id: "top-in", colorClass: "!bg-gray-400 dark:!bg-gray-500" }),
66
+ /* @__PURE__ */ jsx(
67
+ "button",
68
+ {
69
+ type: "button",
70
+ onClick: () => data.onEdit?.(id),
71
+ className: "w-full text-left",
72
+ children: /* @__PURE__ */ jsxs(NodeCard, { compact: isCompact, selected, nodeType: "model_provider", width: "w-[280px]", children: [
73
+ /* @__PURE__ */ jsx(
74
+ NodeCardHeader,
75
+ {
76
+ icon: logo ? /* @__PURE__ */ jsx("img", { src: logo, alt: providerLabel, className: "h-6 w-6 object-contain", loading: "lazy" }) : /* @__PURE__ */ jsx(KeyIcon, { className: "h-6 w-6 text-white" }),
77
+ title: displayName,
78
+ description: providerLabel,
79
+ iconClassName: `flex h-11 w-11 items-center justify-center rounded-xl shadow-lg ${logo ? "bg-white/10 dark:bg-white/5 p-2" : "bg-gradient-to-br from-slate-600 to-slate-700 p-1.5"}`
80
+ }
81
+ ),
82
+ /* @__PURE__ */ jsx(NodeCardMeta, { compact: isCompact, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
83
+ /* @__PURE__ */ jsx(NodeCardBadge, { className: "rounded-full bg-slate-100 px-2 py-0.5 text-[10px] font-semibold text-slate-700 dark:bg-slate-500/20 dark:text-slate-300", children: providerLabel }),
84
+ regionLabel && /* @__PURE__ */ 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 }),
85
+ /* @__PURE__ */ 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" }),
86
+ config.modelFilter && config.modelFilter.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: [
87
+ config.modelFilter.length,
88
+ " models"
89
+ ] })
90
+ ] }) })
91
+ ] })
92
+ }
93
+ ),
94
+ /* @__PURE__ */ jsx(WorkflowHandle, { type: "source", position: Position.Right, id: "right-out", colorClass: "!bg-slate-500" }),
95
+ /* @__PURE__ */ jsx(WorkflowHandle, { type: "source", position: Position.Bottom, id: "bottom-out", colorClass: "!bg-slate-500" })
96
+ ] });
97
+ });
12
98
  var S3WriteFlowNode = memo(function S3WriteFlowNode2({ id, data, selected }) {
13
99
  const t = useTranslations("agents.workflow");
14
100
  const { config, label, onDelete, onEdit } = data;
@@ -296,94 +382,6 @@ function rowsToSchema(rows) {
296
382
  function defaultAgentOutputSchema() {
297
383
  return { type: "object", properties: {}, required: [] };
298
384
  }
299
- function StatusBadge({ status }) {
300
- const colorMap = {
301
- pending: "bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300",
302
- running: "bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300",
303
- success: "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300",
304
- error: "bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300"
305
- };
306
- return /* @__PURE__ */ jsx("span", { className: `inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-semibold ${colorMap[status] ?? colorMap.pending}`, children: status });
307
- }
308
- function formatDuration(ms) {
309
- if (ms < 1e3) return `${ms}ms`;
310
- return `${(ms / 1e3).toFixed(2)}s`;
311
- }
312
- function isRecord(value) {
313
- return typeof value === "object" && value !== null && !Array.isArray(value);
314
- }
315
- function OutputCard({ label, value }) {
316
- const displayValue = typeof value === "string" ? value : JSON.stringify(value, null, 2);
317
- const isLong = typeof displayValue === "string" && displayValue.length > 120;
318
- return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-white/20 bg-white/40 p-3 dark:border-white/10 dark:bg-white/5", children: [
319
- /* @__PURE__ */ jsx("p", { className: "mb-1 text-[10px] font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400", children: label }),
320
- isLong ? /* @__PURE__ */ jsx("pre", { className: "max-h-40 overflow-auto whitespace-pre-wrap text-xs text-gray-800 dark:text-gray-200", children: displayValue }) : /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-gray-900 dark:text-white", children: displayValue })
321
- ] });
322
- }
323
- function AgentProfileHeader({ agent, models, t, selectedModelId, setSelectedModelId, selectedFramework, temperature, setTemperature, elo, setElo, onChanged }) {
324
- const modelName = models.find((model) => model.id === selectedModelId)?.name ?? selectedModelId ?? "\u2014";
325
- const avatarUrl = agent.avatar;
326
- const frameworkMeta = getFrameworkMeta(selectedFramework);
327
- const tierInfo = getEloTier(elo);
328
- const difficultyConfig = {
329
- beginner: { color: "bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400", labelKey: "agentDrawer.tierBeginner" },
330
- intermediate: { color: "bg-pink-100 text-pink-700 dark:bg-pink-900/30 dark:text-pink-400", labelKey: "agentDrawer.tierIntermediate" },
331
- advanced: { color: "bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400", labelKey: "agentDrawer.tierAdvanced" },
332
- expert: { color: "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400", labelKey: "agentDrawer.tierExpert" }
333
- };
334
- const levelConfig = difficultyConfig[tierInfo.tierKey];
335
- return /* @__PURE__ */ jsxs("div", { className: "relative overflow-hidden bg-gradient-to-br from-indigo-500/20 via-purple-500/10 to-transparent px-6 pb-6 pt-4 dark:from-indigo-500/10 dark:via-purple-500/5", children: [
336
- levelConfig && /* @__PURE__ */ jsx("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ jsx("span", { className: `${levelConfig.color} rounded-full px-4 py-1.5 text-xs font-bold shadow-sm transition-colors`, children: t(levelConfig.labelKey) }) }),
337
- /* @__PURE__ */ jsx("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
338
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 rounded-full bg-gradient-to-br from-purple-500 to-blue-500 opacity-40 blur-lg" }),
339
- avatarUrl ? /* @__PURE__ */ jsx(
340
- "img",
341
- {
342
- src: avatarUrl,
343
- alt: agent.name,
344
- loading: "lazy",
345
- className: "relative h-20 w-20 rounded-full bg-white object-cover shadow-xl ring-4 ring-white dark:bg-gray-800 dark:ring-gray-800"
346
- }
347
- ) : /* @__PURE__ */ jsx("div", { className: "relative flex h-20 w-20 items-center justify-center rounded-full bg-gradient-to-br from-indigo-400 to-purple-500 shadow-xl ring-4 ring-white dark:ring-gray-800", children: /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-10 w-10 text-white" }) }),
348
- /* @__PURE__ */ jsx("div", { className: "absolute -bottom-1 -right-1 flex h-6 w-6 items-center justify-center rounded-full bg-indigo-500 ring-2 ring-white dark:ring-gray-900", children: /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-3.5 w-3.5 text-white" }) })
349
- ] }) }),
350
- /* @__PURE__ */ jsx("h3", { className: "mb-2 text-center text-lg font-bold text-gray-900 dark:text-white", children: agent.name }),
351
- agent.role && /* @__PURE__ */ jsx("div", { className: "mb-3 flex justify-center", children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 rounded-full bg-white/60 px-3 py-1.5 text-xs font-medium text-gray-600 ring-1 ring-gray-200/50 dark:bg-gray-800/60 dark:text-gray-400 dark:ring-gray-700/50", children: [
352
- /* @__PURE__ */ jsxs("svg", { className: "h-3 w-3", fill: "currentColor", viewBox: "0 0 20 20", children: [
353
- /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M6 6V5a3 3 0 013-3h2a3 3 0 013 3v1h2a2 2 0 012 2v3.57A22.952 22.952 0 0110 13a22.95 22.95 0 01-8-1.43V8a2 2 0 012-2h2zm2-1a1 1 0 011-1h2a1 1 0 011 1v1H8V5zm1 5a1 1 0 011-1h.01a1 1 0 110 2H10a1 1 0 01-1-1z", clipRule: "evenodd" }),
354
- /* @__PURE__ */ jsx("path", { d: "M2 13.692V16a2 2 0 002 2h12a2 2 0 002-2v-2.308A24.974 24.974 0 0110 15c-2.796 0-5.487-.46-8-1.308z" })
355
- ] }),
356
- agent.role
357
- ] }) }),
358
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2", children: [
359
- /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-1.5 rounded bg-white/50 px-2.5 py-1 text-[10px] text-gray-600 dark:bg-gray-800/50 dark:text-gray-400", children: [
360
- /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-3 w-3" }),
361
- /* @__PURE__ */ jsx("span", { className: "font-semibold", children: modelName })
362
- ] }),
363
- elo != null && /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-1 rounded bg-white/50 px-2 py-1 text-[10px] text-gray-600 dark:bg-gray-800/50 dark:text-gray-400", children: [
364
- /* @__PURE__ */ jsx("span", { className: "opacity-60", children: "ELO:" }),
365
- /* @__PURE__ */ jsx("span", { className: "font-bold tabular-nums", children: elo })
366
- ] })
367
- ] }),
368
- /* @__PURE__ */ jsx("div", { className: "mt-3 flex justify-center", children: /* @__PURE__ */ jsxs("span", { className: `inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-[10px] font-semibold ${frameworkMeta.badgeColor}`, children: [
369
- /* @__PURE__ */ jsx(frameworkMeta.IconComponent, { className: "h-3.5 w-3.5" }),
370
- frameworkMeta.label
371
- ] }) }),
372
- /* @__PURE__ */ jsx(AgentCapabilityCard, { elo, setElo, models, selectedModelId, setSelectedModelId, temperature, setTemperature, onChanged, t }),
373
- /* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-center justify-center gap-2 text-[10px] text-gray-400 dark:text-gray-500", children: [
374
- /* @__PURE__ */ jsxs("span", { children: [
375
- "v",
376
- agent.activePromptVersion
377
- ] }),
378
- /* @__PURE__ */ jsx("span", { children: "\xB7" }),
379
- /* @__PURE__ */ jsxs("span", { children: [
380
- agent.promptCount,
381
- " prompt",
382
- agent.promptCount === 1 ? "" : "s"
383
- ] })
384
- ] })
385
- ] });
386
- }
387
385
  var MODEL_FAMILIES = {
388
386
  anthropic: [
389
387
  { prefix: "anthropic.claude-haiku", maxTokens: 8192, contextWindow: "200K" },
@@ -410,8 +408,20 @@ function getProviderFromModelId(modelId) {
410
408
  if (modelId.startsWith("anthropic.")) return "anthropic";
411
409
  if (modelId.startsWith("amazon.")) return "amazon";
412
410
  if (modelId.startsWith("meta.")) return "meta";
411
+ if (modelId.startsWith("openai.")) return "openai";
412
+ if (modelId.startsWith("google.")) return "google";
413
413
  return "anthropic";
414
414
  }
415
+ function getModelFamily(modelId) {
416
+ return getProviderFromModelId(modelId);
417
+ }
418
+ function findCompatibleProviders(modelId, providers) {
419
+ const family = getModelFamily(modelId);
420
+ return providers.filter((p) => {
421
+ const families = p.servedFamilies ?? [p.provider];
422
+ return families.includes(family);
423
+ });
424
+ }
415
425
  function getEloTier(elo) {
416
426
  if (elo < 1200) return {
417
427
  tierKey: "beginner",
@@ -774,138 +784,6 @@ function PromptTab({
774
784
  ] })
775
785
  ] });
776
786
  }
777
- function ResultsTab({ agentId, t }) {
778
- const nodeResults = useWorkflowStore((state) => state.nodeResults);
779
- const agentResult = useMemo(() => {
780
- return nodeResults[agentId] ?? null;
781
- }, [nodeResults, agentId]);
782
- if (!agentResult) {
783
- return /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center justify-center px-4 py-12 text-center", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: t("agentDrawer.noResults") }) });
784
- }
785
- const outputs = isRecord(agentResult.data) ? agentResult.data : null;
786
- return /* @__PURE__ */ jsxs("div", { className: "space-y-4 p-4", children: [
787
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
788
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
789
- /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-gray-500 dark:text-gray-400", children: t("agentDrawer.status") }),
790
- /* @__PURE__ */ jsx(StatusBadge, { status: agentResult.status })
791
- ] }),
792
- agentResult.durationMs != null && /* @__PURE__ */ jsxs("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
793
- t("agentDrawer.duration"),
794
- ": ",
795
- formatDuration(agentResult.durationMs)
796
- ] })
797
- ] }),
798
- agentResult.error && /* @__PURE__ */ jsx("div", { className: "rounded-xl border border-red-200 bg-red-50 p-3 dark:border-red-900/30 dark:bg-red-900/10", children: /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-red-800 dark:text-red-300", children: agentResult.error }) }),
799
- outputs && Object.keys(outputs).length > 0 && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
800
- /* @__PURE__ */ jsx("h4", { className: "text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400", children: t("agentDrawer.outputVariables") }),
801
- Object.entries(outputs).map(([key, value]) => /* @__PURE__ */ jsx(OutputCard, { label: key, value }, key))
802
- ] })
803
- ] });
804
- }
805
- var SI = (slug, color) => `https://cdn.simpleicons.org/${slug}/${color}`;
806
- var PROVIDER_LOGOS = {
807
- anthropic: SI("anthropic", "D4A27F"),
808
- amazon: "https://www.svgrepo.com/show/448266/aws.svg",
809
- google: SI("googlegemini", "8E75B2"),
810
- openai: "https://www.svgrepo.com/show/306500/openai.svg",
811
- meta: SI("meta", "0668E1"),
812
- aws_bedrock: "https://www.svgrepo.com/show/448266/aws.svg",
813
- openai_api: "https://www.svgrepo.com/show/306500/openai.svg",
814
- google_vertex: SI("googlegemini", "8E75B2"),
815
- azure_openai: SI("microsoftazure", "0078D4"),
816
- anthropic_api: SI("anthropic", "D4A27F")
817
- };
818
- function ModelsTab({ modelProviders, selectedProviderId, onSelectProvider, models, selectedModelId, onSelectModel, agentFramework, t }) {
819
- if (modelProviders.length === 0) {
820
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center px-4 py-12 text-center", children: [
821
- /* @__PURE__ */ jsx(KeyIcon, { className: "mb-2 h-8 w-8 text-gray-400 dark:text-gray-500" }),
822
- /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: t("agentDrawer.noProvidersAvailable") }),
823
- /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-gray-400 dark:text-gray-500", children: t("agentDrawer.dragProviderHint") })
824
- ] });
825
- }
826
- const modelsByProvider = modelProviders.map((provider) => ({
827
- provider,
828
- models: models.filter((m) => {
829
- const modelProvider = m.id.split(".")[0];
830
- return provider.provider === modelProvider || provider.provider === "amazon" && modelProvider === "anthropic" || provider.provider === "amazon" && modelProvider === "amazon" || provider.provider === "amazon" && modelProvider === "meta";
831
- })
832
- }));
833
- return /* @__PURE__ */ jsxs("div", { className: "space-y-4 p-4", children: [
834
- /* @__PURE__ */ jsxs("div", { children: [
835
- /* @__PURE__ */ jsx("label", { className: "mb-2 block text-xs font-medium text-gray-500 dark:text-gray-400", children: t("agentDrawer.selectProvider") }),
836
- /* @__PURE__ */ jsx("div", { className: "space-y-1.5", children: modelProviders.map((provider) => {
837
- const isSelected = selectedProviderId === provider.id;
838
- const logo = PROVIDER_LOGOS[provider.provider];
839
- return /* @__PURE__ */ jsxs(
840
- "button",
841
- {
842
- type: "button",
843
- onClick: () => onSelectProvider(provider.id),
844
- 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"}`,
845
- children: [
846
- 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" }) }),
847
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
848
- /* @__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 }),
849
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-gray-400 dark:text-gray-500", children: [
850
- /* @__PURE__ */ jsxs("span", { children: [
851
- provider.modelCount,
852
- " models"
853
- ] }),
854
- provider.configured && /* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 rounded-full bg-green-500" })
855
- ] })
856
- ] }),
857
- /* @__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" }) })
858
- ]
859
- },
860
- provider.id
861
- );
862
- }) })
863
- ] }),
864
- selectedProviderId && (() => {
865
- const providerModels = modelsByProvider.find((p) => p.provider.id === selectedProviderId);
866
- if (!providerModels || providerModels.models.length === 0) return /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-400 dark:text-gray-500", children: t("agentDrawer.noModelsForProvider") });
867
- const compatibleModels = providerModels.models.filter(
868
- (m) => isModelCompatibleWithFramework(m.id, agentFramework)
869
- );
870
- const incompatibleModels = providerModels.models.filter(
871
- (m) => !isModelCompatibleWithFramework(m.id, agentFramework)
872
- );
873
- return /* @__PURE__ */ jsxs("div", { children: [
874
- /* @__PURE__ */ jsx("label", { className: "mb-2 block text-xs font-medium text-gray-500 dark:text-gray-400", children: t("agentDrawer.selectModel") }),
875
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
876
- compatibleModels.map((model) => {
877
- const isSelected = selectedModelId === model.id;
878
- const { IconComponent, color, providerLabel } = getModelIcon(model.id);
879
- return /* @__PURE__ */ jsxs(
880
- "button",
881
- {
882
- type: "button",
883
- onClick: () => onSelectModel(model.id),
884
- 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"}`,
885
- children: [
886
- /* @__PURE__ */ jsx(IconComponent, { className: `h-4 w-4 flex-shrink-0 ${isSelected ? color : "text-gray-400 dark:text-gray-500"}` }),
887
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
888
- /* @__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 }),
889
- /* @__PURE__ */ jsx("p", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: providerLabel })
890
- ] }),
891
- isSelected && /* @__PURE__ */ jsx(CheckIcon, { className: "h-3.5 w-3.5 shrink-0 text-indigo-500" })
892
- ]
893
- },
894
- model.id
895
- );
896
- }),
897
- incompatibleModels.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
898
- /* @__PURE__ */ jsx("div", { className: "mt-2 mb-1 text-[9px] font-medium text-gray-400 dark:text-gray-500", children: t("agentDrawer.incompatibleWithFramework") }),
899
- 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: [
900
- /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-4 w-4 text-gray-400" }),
901
- /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500", children: model.name })
902
- ] }, model.id))
903
- ] })
904
- ] })
905
- ] });
906
- })()
907
- ] });
908
- }
909
787
  function ToolsTab({ agentTools, enabledToolIds, onToggle, agentFramework, t }) {
910
788
  if (agentTools.length === 0) {
911
789
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center px-4 py-12 text-center", children: [
@@ -977,143 +855,176 @@ function ToolsTab({ agentTools, enabledToolIds, onToggle, agentFramework, t }) {
977
855
  })
978
856
  ] });
979
857
  }
980
- function AdvancedTab({
981
- displayName,
982
- setDisplayName,
983
- description,
984
- setDescription,
858
+ function EngineTab({
859
+ agent,
860
+ models,
861
+ t,
862
+ selectedModelId,
863
+ setSelectedModelId,
864
+ selectedFramework,
865
+ setSelectedFramework,
866
+ temperature,
867
+ setTemperature,
868
+ elo,
869
+ setElo,
985
870
  maxOutputTokens,
986
871
  setMaxOutputTokens,
987
872
  topP,
988
873
  setTopP,
989
874
  topK,
990
875
  setTopK,
991
- tags,
992
- setTags,
993
- status,
994
- setStatus,
995
- avatarUrl,
996
- setAvatarUrl,
997
- markDirty,
998
- t
876
+ modelProviders,
877
+ selectedProviderId,
878
+ onSelectProvider,
879
+ markDirty
999
880
  }) {
1000
- const wrap = "w-full rounded-lg border border-gray-200/50 bg-gray-50/50 px-3 py-2 text-sm text-gray-800 outline-none transition-colors focus:border-indigo-300/50 focus:ring-1 focus:ring-indigo-300/30 dark:border-white/10 dark:bg-white/5 dark:text-gray-200";
1001
- const labelCls = "mb-1 block text-xs font-medium text-gray-500 dark:text-gray-400";
1002
- const touch = () => markDirty();
1003
- return /* @__PURE__ */ jsxs("div", { className: "space-y-4 p-4", children: [
1004
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2", children: [
1005
- /* @__PURE__ */ jsxs("label", { children: [
1006
- /* @__PURE__ */ jsx("span", { className: labelCls, children: t("agentDrawer.displayName", { _: "Display name" }) }),
1007
- /* @__PURE__ */ jsx("input", { className: wrap, value: displayName, onChange: (e) => {
1008
- setDisplayName(e.target.value);
1009
- touch();
1010
- } })
881
+ const modelObj = models.find((m) => m.id === selectedModelId);
882
+ const modelName = modelObj?.name ?? selectedModelId ?? "\u2014";
883
+ const family = getModelFamily(selectedModelId);
884
+ const compatibleProviders = findCompatibleProviders(selectedModelId, modelProviders);
885
+ const configuredCompatible = compatibleProviders.filter((p) => p.configured);
886
+ const effectiveProvider = compatibleProviders.find((p) => p.id === selectedProviderId) ?? configuredCompatible[0] ?? compatibleProviders[0];
887
+ const frameworkMeta = getFrameworkMeta(selectedFramework);
888
+ const inputCard = "liquid-surface w-full rounded-lg px-3 py-1.5 text-sm text-gray-800 outline-none transition-colors focus:ring-1 focus:ring-indigo-300/40 dark:text-gray-200 dark:focus:ring-indigo-500/20";
889
+ return /* @__PURE__ */ jsx("div", { className: "p-5", children: /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-2xl border border-indigo-500/20 bg-gradient-to-b from-indigo-500/[0.04] via-violet-500/[0.03] to-purple-500/[0.04] dark:border-indigo-400/20 dark:from-indigo-500/[0.10] dark:via-violet-500/[0.06] dark:to-purple-500/[0.08]", children: [
890
+ /* @__PURE__ */ jsx("div", { className: "px-4 pb-3 pt-4", children: /* @__PURE__ */ jsx(
891
+ AgentCapabilityCard,
892
+ {
893
+ elo,
894
+ setElo,
895
+ models,
896
+ selectedModelId,
897
+ setSelectedModelId,
898
+ temperature,
899
+ setTemperature,
900
+ onChanged: markDirty,
901
+ t
902
+ }
903
+ ) }),
904
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-4 text-[9px] font-semibold uppercase tracking-wider text-indigo-500/70 dark:text-indigo-400/70", children: [
905
+ /* @__PURE__ */ jsx("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-indigo-500/30 to-transparent" }),
906
+ /* @__PURE__ */ jsxs("span", { children: [
907
+ "\u2193 ",
908
+ t("agentDrawer.derives", { _: "deriva" })
1011
909
  ] }),
1012
- /* @__PURE__ */ jsxs("label", { children: [
1013
- /* @__PURE__ */ jsx("span", { className: labelCls, children: t("agentDrawer.status", { _: "Status" }) }),
1014
- /* @__PURE__ */ jsxs("select", { className: wrap, value: status, onChange: (e) => {
1015
- setStatus(e.target.value);
1016
- touch();
1017
- }, children: [
1018
- /* @__PURE__ */ jsx("option", { value: "draft", children: "draft" }),
1019
- /* @__PURE__ */ jsx("option", { value: "active", children: "active" }),
1020
- /* @__PURE__ */ jsx("option", { value: "archived", children: "archived" })
1021
- ] })
1022
- ] })
1023
- ] }),
1024
- /* @__PURE__ */ jsxs("label", { className: "block", children: [
1025
- /* @__PURE__ */ jsx("span", { className: labelCls, children: t("agentDrawer.description", { _: "Description" }) }),
1026
- /* @__PURE__ */ jsx(
1027
- "textarea",
1028
- {
1029
- className: wrap,
1030
- rows: 3,
1031
- value: description,
1032
- onChange: (e) => {
1033
- setDescription(e.target.value);
1034
- touch();
1035
- },
1036
- placeholder: t("agentDrawer.descriptionPlaceholder", { _: "What this agent does, which tasks it's good at" })
1037
- }
1038
- )
910
+ /* @__PURE__ */ jsx("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-indigo-500/30 to-transparent" })
1039
911
  ] }),
1040
- /* @__PURE__ */ jsxs("label", { className: "block", children: [
1041
- /* @__PURE__ */ jsx("span", { className: labelCls, children: t("agentDrawer.avatarUrl", { _: "Avatar URL" }) }),
1042
- /* @__PURE__ */ jsx("input", { className: wrap, value: avatarUrl, onChange: (e) => {
1043
- setAvatarUrl(e.target.value);
1044
- touch();
1045
- }, placeholder: "https://\u2026" })
1046
- ] }),
1047
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-3", children: [
1048
- /* @__PURE__ */ jsxs("label", { children: [
1049
- /* @__PURE__ */ jsx("span", { className: labelCls, children: t("agentDrawer.maxOutputTokens", { _: "Max output tokens" }) }),
1050
- /* @__PURE__ */ jsx(
1051
- "input",
1052
- {
1053
- type: "number",
1054
- min: 1,
1055
- max: 32768,
1056
- className: wrap,
1057
- value: maxOutputTokens,
1058
- onChange: (e) => {
1059
- setMaxOutputTokens(Number(e.target.value) || 0);
1060
- touch();
1061
- }
1062
- }
1063
- )
912
+ /* @__PURE__ */ jsx("div", { className: "px-4 py-3", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
913
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
914
+ /* @__PURE__ */ jsx(CpuChipIcon, { className: "mt-0.5 h-5 w-5 text-indigo-500 dark:text-indigo-400" }),
915
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
916
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: modelName }),
917
+ compatibleProviders.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-[10px] text-amber-600 dark:text-amber-400", children: t("agentDrawer.noProviderForFamily", { _: "Nenhum provedor configurado serve a fam\xEDlia " + family }) }) : configuredCompatible.length > 1 ? /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center gap-1.5", children: [
918
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-gray-500 dark:text-gray-400", children: t("agentDrawer.servedVia", { _: "via" }) }),
919
+ /* @__PURE__ */ jsx(
920
+ "select",
921
+ {
922
+ value: effectiveProvider?.id ?? "",
923
+ onChange: (event) => {
924
+ onSelectProvider(event.target.value);
925
+ markDirty();
926
+ },
927
+ className: "liquid-surface rounded-md px-2 py-0.5 text-[10px] font-semibold text-gray-900 outline-none focus:ring-1 focus:ring-indigo-300/40 dark:text-white",
928
+ children: configuredCompatible.map((p) => /* @__PURE__ */ jsx("option", { value: p.id, children: p.name }, p.id))
929
+ }
930
+ ),
931
+ effectiveProvider && /* @__PURE__ */ jsxs("span", { className: `inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[9px] font-semibold ${effectiveProvider.configured ? "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400" : "bg-amber-500/10 text-amber-600 dark:text-amber-400"}`, children: [
932
+ /* @__PURE__ */ jsx("span", { className: `h-1 w-1 rounded-full ${effectiveProvider.configured ? "bg-emerald-500" : "bg-amber-500"}` }),
933
+ effectiveProvider.configured ? t("agentDrawer.configured", { _: "connected" }) : t("agentDrawer.setup", { _: "setup" })
934
+ ] })
935
+ ] }) : /* @__PURE__ */ jsxs("p", { className: "text-[10px] text-gray-500 dark:text-gray-400", children: [
936
+ t("agentDrawer.servedVia", { _: "via" }),
937
+ " ",
938
+ effectiveProvider?.name ?? family,
939
+ effectiveProvider && /* @__PURE__ */ jsxs("span", { className: `ml-2 inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[9px] font-semibold ${effectiveProvider.configured ? "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400" : "bg-amber-500/10 text-amber-600 dark:text-amber-400"}`, children: [
940
+ /* @__PURE__ */ jsx("span", { className: `h-1 w-1 rounded-full ${effectiveProvider.configured ? "bg-emerald-500" : "bg-amber-500"}` }),
941
+ effectiveProvider.configured ? t("agentDrawer.configured", { _: "connected" }) : t("agentDrawer.setup", { _: "setup" })
942
+ ] })
943
+ ] })
944
+ ] })
1064
945
  ] }),
1065
- /* @__PURE__ */ jsxs("label", { children: [
1066
- /* @__PURE__ */ jsx("span", { className: labelCls, children: t("agentDrawer.topP", { _: "Top-p" }) }),
1067
- /* @__PURE__ */ jsx(
1068
- "input",
1069
- {
1070
- type: "number",
1071
- step: 0.05,
1072
- min: 0,
1073
- max: 1,
1074
- className: wrap,
1075
- value: topP,
1076
- onChange: (e) => {
1077
- setTopP(Number(e.target.value) || 0);
1078
- touch();
1079
- }
1080
- }
1081
- )
946
+ /* @__PURE__ */ jsxs("span", { className: `inline-flex shrink-0 items-center gap-1.5 rounded-full px-3 py-1 text-[10px] font-semibold ${frameworkMeta.badgeColor}`, children: [
947
+ /* @__PURE__ */ jsx(frameworkMeta.IconComponent, { className: "h-3.5 w-3.5" }),
948
+ frameworkMeta.label
949
+ ] })
950
+ ] }) }),
951
+ /* @__PURE__ */ jsxs("details", { className: "group border-t border-indigo-500/15 bg-white/30 px-4 py-2.5 dark:border-indigo-400/15 dark:bg-white/[0.02]", children: [
952
+ /* @__PURE__ */ jsxs("summary", { className: "flex cursor-pointer items-center gap-2 text-[10px] font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400", children: [
953
+ /* @__PURE__ */ jsx(Cog6ToothIcon, { className: "h-3 w-3" }),
954
+ /* @__PURE__ */ jsx("span", { children: t("agentDrawer.overrideDerivation", { _: "Override \xB7 ajustes avan\xE7ados" }) }),
955
+ /* @__PURE__ */ jsx("span", { className: "ml-auto font-normal text-gray-400 group-open:hidden", children: "\u25BE" }),
956
+ /* @__PURE__ */ jsx("span", { className: "ml-auto hidden font-normal text-gray-400 group-open:inline", children: "\u25B4" })
1082
957
  ] }),
1083
- /* @__PURE__ */ jsxs("label", { children: [
1084
- /* @__PURE__ */ jsx("span", { className: labelCls, children: t("agentDrawer.topK", { _: "Top-k" }) }),
958
+ /* @__PURE__ */ jsx("p", { className: "mt-1 text-[10px] italic text-gray-400 dark:text-gray-500", children: t("agentDrawer.overrideHint", { _: "Mude framework, modelo manual ou tokens s\xF3 se a deriva\xE7\xE3o por ELO n\xE3o atender." }) }),
959
+ /* @__PURE__ */ jsxs("div", { className: "mt-3 space-y-4", children: [
1085
960
  /* @__PURE__ */ jsx(
1086
- "input",
961
+ ConfigTab,
1087
962
  {
1088
- type: "number",
1089
- min: 0,
1090
- max: 500,
1091
- className: wrap,
1092
- value: topK,
1093
- onChange: (e) => {
1094
- setTopK(Number(e.target.value) || 0);
1095
- touch();
1096
- }
963
+ models,
964
+ t,
965
+ selectedModelId,
966
+ setSelectedModelId,
967
+ selectedFramework,
968
+ setSelectedFramework,
969
+ markDirty,
970
+ connectedProviderTypes: modelProviders.map((p) => p.provider)
1097
971
  }
1098
- )
972
+ ),
973
+ /* @__PURE__ */ jsxs("div", { children: [
974
+ /* @__PURE__ */ jsx("p", { className: "mb-2 text-[10px] font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400", children: t("agentDrawer.generationParams", { _: "Par\xE2metros de gera\xE7\xE3o" }) }),
975
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-2", children: [
976
+ { key: "max", labelKey: "agentDrawer.maxOutputTokens", label: "Max output", value: maxOutputTokens, setter: setMaxOutputTokens, step: 1, min: 1, max: 32768 },
977
+ { key: "topP", labelKey: "agentDrawer.topP", label: "Top-p", value: topP, setter: setTopP, step: 0.05, min: 0, max: 1 },
978
+ { key: "topK", labelKey: "agentDrawer.topK", label: "Top-k", value: topK, setter: setTopK, step: 1, min: 0, max: 500 }
979
+ ].map((field) => /* @__PURE__ */ jsxs("div", { className: `${inputCard} flex flex-col items-center !py-2`, children: [
980
+ /* @__PURE__ */ jsx("span", { className: "text-[8px] font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400", children: t(field.labelKey, { _: field.label }) }),
981
+ /* @__PURE__ */ jsx(
982
+ "input",
983
+ {
984
+ type: "number",
985
+ step: field.step,
986
+ min: field.min,
987
+ max: field.max,
988
+ value: field.value,
989
+ onChange: (event) => {
990
+ field.setter(Number(event.target.value) || 0);
991
+ markDirty();
992
+ },
993
+ className: "w-full bg-transparent text-center text-sm font-semibold tabular-nums text-gray-900 outline-none dark:text-white"
994
+ }
995
+ )
996
+ ] }, field.key)) })
997
+ ] }),
998
+ modelProviders.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
999
+ /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
1000
+ /* @__PURE__ */ jsx("p", { className: "text-[10px] font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400", children: t("agentDrawer.providerCredentials", { _: "Credenciais do provedor" }) }),
1001
+ /* @__PURE__ */ jsx(
1002
+ "a",
1003
+ {
1004
+ href: "/settings/integrations",
1005
+ className: "text-[10px] font-medium text-indigo-600 hover:text-indigo-700 dark:text-indigo-400 dark:hover:text-indigo-300",
1006
+ children: t("agentDrawer.manageCredentials", { _: "Gerenciar \u2192" })
1007
+ }
1008
+ )
1009
+ ] }),
1010
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children: modelProviders.map((provider) => /* @__PURE__ */ jsxs(
1011
+ "div",
1012
+ {
1013
+ className: "flex items-center gap-2 rounded-lg border border-gray-200/50 bg-white/40 px-3 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",
1014
+ children: [
1015
+ /* @__PURE__ */ jsx(KeyIcon, { className: "h-3 w-3 shrink-0 text-gray-500 dark:text-gray-400" }),
1016
+ /* @__PURE__ */ jsx("span", { className: "text-[11px] font-semibold text-gray-900 dark:text-white", children: provider.name }),
1017
+ /* @__PURE__ */ jsx("span", { className: `shrink-0 rounded-full px-1.5 py-0.5 text-[8px] font-semibold uppercase ${provider.configured ? "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400" : "bg-amber-500/10 text-amber-600 dark:text-amber-400"}`, children: provider.configured ? t("agentDrawer.configured", { _: "connected" }) : t("agentDrawer.setup", { _: "setup" }) }),
1018
+ provider.apiKeyMasked && /* @__PURE__ */ jsx("span", { className: "ml-auto truncate font-mono text-[9px] text-gray-400 dark:text-gray-500", title: provider.credentialRef, children: provider.apiKeyMasked })
1019
+ ]
1020
+ },
1021
+ provider.id
1022
+ )) }),
1023
+ /* @__PURE__ */ jsx("p", { className: "mt-2 text-[10px] text-gray-400 dark:text-gray-500", children: selectedProviderId ? "" : t("agentDrawer.providerHint", { _: "Credenciais s\xE3o configuradas no n\xEDvel da conta. Aqui voc\xEA s\xF3 confere o que est\xE1 conectado." }) })
1024
+ ] })
1099
1025
  ] })
1100
- ] }),
1101
- /* @__PURE__ */ jsxs("label", { className: "block", children: [
1102
- /* @__PURE__ */ jsx("span", { className: labelCls, children: t("agentDrawer.tags", { _: "Tags (comma-separated)" }) }),
1103
- /* @__PURE__ */ jsx(
1104
- "input",
1105
- {
1106
- className: wrap,
1107
- value: tags,
1108
- onChange: (e) => {
1109
- setTags(e.target.value);
1110
- touch();
1111
- },
1112
- placeholder: "pricing, research, internal"
1113
- }
1114
- )
1115
1026
  ] })
1116
- ] });
1027
+ ] }) });
1117
1028
  }
1118
1029
  function AgentModal({ onSaved, onPersist }) {
1119
1030
  const t = useTranslations("agents.workflow");
@@ -1125,7 +1036,7 @@ function AgentModal({ onSaved, onPersist }) {
1125
1036
  const models = agentData?.models ?? [];
1126
1037
  const availableAgentTools = agentData?.agentTools ?? [];
1127
1038
  const isCreateMode = agentData?.isCreateMode ?? false;
1128
- const [activeTab, setActiveTab] = useState("profile");
1039
+ const [activeTab, setActiveTab] = useState("config");
1129
1040
  const [selectedModelId, setSelectedModelId] = useState("");
1130
1041
  const [selectedFramework, setSelectedFramework] = useState("custom");
1131
1042
  const [temperature, setTemperature] = useState(0.7);
@@ -1153,7 +1064,7 @@ function AgentModal({ onSaved, onPersist }) {
1153
1064
  setTemperature(agent.temperature ?? 0.7);
1154
1065
  setElo(Number(agent.elo ?? 1e3));
1155
1066
  setSaved(!isCreateMode);
1156
- setActiveTab("profile");
1067
+ setActiveTab("config");
1157
1068
  const agentToolIds = agent.agentToolIds;
1158
1069
  setEnabledToolIds(new Set(agentToolIds ?? availableAgentTools.filter((t2) => t2.enabled).map((t2) => t2.agentToolId)));
1159
1070
  setSelectedProviderId(agent.modelProviderId ?? "");
@@ -1226,7 +1137,6 @@ function AgentModal({ onSaved, onPersist }) {
1226
1137
  setPersisting(true);
1227
1138
  if (onPersist) await onPersist(payload);
1228
1139
  markSaved();
1229
- onSaved?.();
1230
1140
  } catch (error) {
1231
1141
  console.error("[AgentModal] onPersist failed", error);
1232
1142
  } finally {
@@ -1254,113 +1164,208 @@ function AgentModal({ onSaved, onPersist }) {
1254
1164
  onSaved,
1255
1165
  onPersist
1256
1166
  ]);
1167
+ useEffect(() => {
1168
+ if (!dirty || persisting) return;
1169
+ const handle = setTimeout(() => {
1170
+ void handleMarkSaved();
1171
+ }, 700);
1172
+ return () => clearTimeout(handle);
1173
+ }, [dirty, persisting, handleMarkSaved]);
1257
1174
  if (!agent) return null;
1258
- const sections = [
1259
- { id: "profile", label: t("agentDrawer.profileSection"), icon: UserCircleIcon, group: t("agentDrawer.agentGroup") },
1260
- { id: "framework", label: t("agentDrawer.frameworkSection"), icon: Cog6ToothIcon, group: t("agentDrawer.agentGroup") },
1261
- { id: "prompt", label: t("agentDrawer.promptSection"), icon: SparklesIcon, group: t("agentDrawer.agentGroup") },
1262
- { id: "tools", label: `${t("agentDrawer.toolsTab")}${enabledToolIds.size > 0 ? ` (${enabledToolIds.size})` : ""}`, icon: CommandLineIcon, group: t("agentDrawer.configGroup") },
1263
- { id: "models", label: `${t("agentDrawer.modelsTab")}${selectedProviderId ? " \u2713" : ""}`, icon: KeyIcon, group: t("agentDrawer.configGroup") },
1264
- { id: "advanced", label: t("agentDrawer.advancedTab", { _: "Advanced" }), icon: Cog6ToothIcon, group: t("agentDrawer.configGroup") },
1265
- { id: "results", label: t("agentDrawer.resultsTab"), icon: PlayCircleIcon, group: t("agentDrawer.executionGroup") }
1266
- ];
1175
+ const sections = [];
1267
1176
  const effectiveAvatarUrl = avatarUrl || agent.avatar;
1268
- const sidebarFooter = /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-4 py-3", children: [
1269
- /* @__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") }) }),
1177
+ const fieldCard = "liquid-surface w-full rounded-lg px-2.5 py-1.5 text-xs text-gray-800 outline-none transition-colors focus:ring-1 focus:ring-indigo-300/40 dark:text-gray-200 dark:focus:ring-indigo-500/20";
1178
+ const fieldLabel = "text-[9px] font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400";
1179
+ const avatarNode = effectiveAvatarUrl ? /* @__PURE__ */ jsx(
1180
+ "img",
1181
+ {
1182
+ src: effectiveAvatarUrl,
1183
+ alt: displayName || agent.name,
1184
+ className: "h-full w-full rounded-full bg-white object-cover ring-2 ring-white shadow-sm dark:bg-gray-800 dark:ring-gray-800",
1185
+ loading: "lazy"
1186
+ }
1187
+ ) : /* @__PURE__ */ jsx("span", { className: "flex h-full w-full items-center justify-center rounded-full bg-gradient-to-br from-indigo-400 to-purple-500 text-sm font-bold text-white ring-2 ring-white shadow-sm dark:ring-gray-800", children: (displayName || agent.name).charAt(0).toUpperCase() });
1188
+ const statusPill = /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
1189
+ /* @__PURE__ */ jsx("span", { className: `text-[9px] font-semibold ${status === "active" ? "text-emerald-600 dark:text-emerald-400" : "text-slate-500"}`, children: status === "active" ? t("agentDrawer.statusActive", { _: "Active" }) : t("agentDrawer.statusInactive", { _: "Inactive" }) }),
1270
1190
  /* @__PURE__ */ jsx(
1271
- "button",
1191
+ ToggleSwitch,
1272
1192
  {
1273
- type: "button",
1274
- onClick: () => {
1275
- void handleMarkSaved();
1193
+ size: "sm",
1194
+ color: "green",
1195
+ checked: status === "active",
1196
+ onChange: (checked) => {
1197
+ setStatus(checked ? "active" : "draft");
1198
+ markDirty();
1276
1199
  },
1277
- disabled: !dirty || persisting,
1278
- className: `rounded-lg px-3 py-1.5 text-xs font-semibold text-white shadow-sm transition-all ${dirty && !persisting ? "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"}`,
1279
- children: persisting ? "\u2026" : t("agentDrawer.save")
1200
+ label: t("agentDrawer.status", { _: "Status" })
1280
1201
  }
1281
1202
  )
1282
1203
  ] });
1283
- return /* @__PURE__ */ jsxs(
1204
+ const identityCard = /* @__PURE__ */ jsx("div", { className: "liquid-surface rounded-2xl p-3 ring-1 ring-slate-200/50 dark:ring-white/10", children: /* @__PURE__ */ jsx(
1205
+ HeroBlock,
1206
+ {
1207
+ icon: avatarNode,
1208
+ iconShape: "round",
1209
+ iconBackground: "none",
1210
+ iconSize: "lg",
1211
+ headingLevel: "h2",
1212
+ title: displayName,
1213
+ onTitleChange: (next) => {
1214
+ setDisplayName(next);
1215
+ markDirty();
1216
+ },
1217
+ titlePlaceholder: agent.name,
1218
+ subtitle: agent.role,
1219
+ rightContent: statusPill,
1220
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1221
+ /* @__PURE__ */ jsxs("label", { className: "flex flex-col gap-1", children: [
1222
+ /* @__PURE__ */ jsx("span", { className: fieldLabel, children: t("agentDrawer.description", { _: "Description" }) }),
1223
+ /* @__PURE__ */ jsx(
1224
+ "textarea",
1225
+ {
1226
+ rows: 2,
1227
+ value: description,
1228
+ onChange: (event) => {
1229
+ setDescription(event.target.value);
1230
+ markDirty();
1231
+ },
1232
+ placeholder: t("agentDrawer.descriptionPlaceholder", { _: "What this agent does, which tasks it's good at" }),
1233
+ className: `${fieldCard} resize-none`
1234
+ }
1235
+ )
1236
+ ] }),
1237
+ /* @__PURE__ */ jsxs("label", { className: "flex flex-col gap-1", children: [
1238
+ /* @__PURE__ */ jsx("span", { className: fieldLabel, children: t("agentDrawer.tags", { _: "Tags" }) }),
1239
+ /* @__PURE__ */ jsx(
1240
+ "input",
1241
+ {
1242
+ type: "text",
1243
+ value: tagsText,
1244
+ onChange: (event) => {
1245
+ setTagsText(event.target.value);
1246
+ markDirty();
1247
+ },
1248
+ placeholder: t("agentDrawer.tagsPlaceholder", { _: "pricing, research, internal" }),
1249
+ className: fieldCard
1250
+ }
1251
+ )
1252
+ ] })
1253
+ ] })
1254
+ }
1255
+ ) });
1256
+ const autosaveLabel = persisting ? t("agentDrawer.saving", { _: "Saving\u2026" }) : dirty ? t("agentDrawer.pendingAutosave", { _: "Saving in a moment\u2026" }) : t("agentDrawer.autoSaved", { _: "Auto-saved" });
1257
+ const autosaveColor = persisting ? "text-indigo-500 dark:text-indigo-400" : dirty ? "text-amber-500 dark:text-amber-400" : "text-emerald-500 dark:text-emerald-400";
1258
+ const sidebarFooter = /* @__PURE__ */ jsxs("div", { role: "status", "aria-live": "polite", className: "flex items-center gap-1.5 px-1 py-2 text-xs", children: [
1259
+ /* @__PURE__ */ jsx("span", { className: `relative inline-flex h-1.5 w-1.5 shrink-0 rounded-full ${persisting ? "bg-indigo-500" : dirty ? "bg-amber-500" : "bg-emerald-500"}`, children: persisting && /* @__PURE__ */ jsx(
1260
+ "span",
1261
+ {
1262
+ "aria-hidden": "true",
1263
+ className: "absolute inset-0 motion-safe:animate-ping rounded-full bg-indigo-500/60"
1264
+ }
1265
+ ) }),
1266
+ /* @__PURE__ */ jsx("span", { className: `font-medium ${autosaveColor}`, children: autosaveLabel })
1267
+ ] });
1268
+ return /* @__PURE__ */ jsx(
1284
1269
  GlassModal,
1285
1270
  {
1286
1271
  open,
1287
1272
  onClose: handleClose,
1288
1273
  title: agent.name,
1289
- subtitle: isCreateMode ? t("agentDrawer.createAgent") : t("agentDrawer.editAgent"),
1290
1274
  gradient: "from-indigo-500 to-purple-600",
1291
- icon: /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-5 w-5 text-white" }),
1275
+ icon: /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-5 w-5 text-slate-700 dark:text-white" }),
1292
1276
  label: isCreateMode ? t("agentDrawer.createAgent") : t("agentDrawer.editAgent"),
1293
1277
  sidebar: {
1294
1278
  sections,
1295
1279
  activeSectionId: activeTab,
1296
1280
  onSectionChange: (sectionId) => setActiveTab(sectionId),
1297
- identity: {
1298
- displayName: displayName || agent.name,
1299
- profileInitial: (displayName || agent.name).charAt(0).toUpperCase(),
1300
- avatarUrl: effectiveAvatarUrl,
1301
- role: agent.role
1302
- },
1281
+ identityCard,
1303
1282
  footer: sidebarFooter
1304
1283
  },
1305
- children: [
1306
- activeTab === "profile" && /* @__PURE__ */ jsx(AgentProfileHeader, { agent, models, t, selectedModelId, setSelectedModelId, selectedFramework, temperature, setTemperature, elo, setElo, onChanged: markDirty }),
1307
- activeTab === "framework" && /* @__PURE__ */ jsx(ConfigTab, { models, t, selectedModelId, setSelectedModelId, selectedFramework, setSelectedFramework: (fw) => setSelectedFramework(fw), markDirty, connectedProviderTypes: availableModelProviders.map((p) => p.provider) }),
1308
- activeTab === "prompt" && /* @__PURE__ */ jsx(
1309
- PromptTab,
1284
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
1285
+ /* @__PURE__ */ jsx(
1286
+ SectionCard,
1310
1287
  {
1311
- agent,
1312
- temperature,
1313
- setTemperature,
1314
- markDirty,
1315
- t,
1316
- promptText: systemPrompt,
1317
- setPromptText: setSystemPrompt,
1318
- outputSchema,
1319
- setOutputSchema
1288
+ variant: "glass",
1289
+ padded: false,
1290
+ collapsible: true,
1291
+ defaultOpen: true,
1292
+ header: {
1293
+ icon: /* @__PURE__ */ jsx(Cog6ToothIcon, { className: "h-5 w-5 text-slate-700 dark:text-white" }),
1294
+ title: t("agentDrawer.engineTab"),
1295
+ subtitle: t("agentDrawer.engineSubtitle", { _: "Como o agente roda \u2014 capacidade, modelo, credenciais" })
1296
+ },
1297
+ children: /* @__PURE__ */ jsx(
1298
+ EngineTab,
1299
+ {
1300
+ agent,
1301
+ models,
1302
+ t,
1303
+ selectedModelId,
1304
+ setSelectedModelId,
1305
+ selectedFramework,
1306
+ setSelectedFramework: (fw) => setSelectedFramework(fw),
1307
+ temperature,
1308
+ setTemperature,
1309
+ elo,
1310
+ setElo,
1311
+ maxOutputTokens,
1312
+ setMaxOutputTokens,
1313
+ topP,
1314
+ setTopP,
1315
+ topK,
1316
+ setTopK,
1317
+ modelProviders: availableModelProviders,
1318
+ selectedProviderId,
1319
+ onSelectProvider: handleSelectProvider,
1320
+ markDirty
1321
+ }
1322
+ )
1320
1323
  }
1321
1324
  ),
1322
- activeTab === "advanced" && /* @__PURE__ */ jsx(
1323
- AdvancedTab,
1325
+ /* @__PURE__ */ jsx(
1326
+ SectionCard,
1324
1327
  {
1325
- displayName,
1326
- setDisplayName,
1327
- description,
1328
- setDescription,
1329
- maxOutputTokens,
1330
- setMaxOutputTokens,
1331
- topP,
1332
- setTopP,
1333
- topK,
1334
- setTopK,
1335
- tags: tagsText,
1336
- setTags: setTagsText,
1337
- status,
1338
- setStatus,
1339
- avatarUrl,
1340
- setAvatarUrl: setAvatarUrlState,
1341
- markDirty,
1342
- t
1328
+ variant: "glass",
1329
+ padded: false,
1330
+ collapsible: true,
1331
+ defaultOpen: true,
1332
+ header: {
1333
+ icon: /* @__PURE__ */ jsx(SparklesIcon, { className: "h-5 w-5 text-slate-700 dark:text-white" }),
1334
+ title: t("agentDrawer.brainTab"),
1335
+ subtitle: t("agentDrawer.brainSubtitle", { _: "Como o agente pensa \u2014 prompt + criatividade" })
1336
+ },
1337
+ children: /* @__PURE__ */ jsx(
1338
+ PromptTab,
1339
+ {
1340
+ agent,
1341
+ temperature,
1342
+ setTemperature,
1343
+ markDirty,
1344
+ t,
1345
+ promptText: systemPrompt,
1346
+ setPromptText: setSystemPrompt,
1347
+ outputSchema,
1348
+ setOutputSchema
1349
+ }
1350
+ )
1343
1351
  }
1344
1352
  ),
1345
- activeTab === "tools" && /* @__PURE__ */ jsx(ToolsTab, { agentTools: availableAgentTools, enabledToolIds, onToggle: handleToggleTool, agentFramework: selectedFramework, t }),
1346
- activeTab === "models" && /* @__PURE__ */ jsx(
1347
- ModelsTab,
1353
+ /* @__PURE__ */ jsx(
1354
+ SectionCard,
1348
1355
  {
1349
- modelProviders: availableModelProviders,
1350
- selectedProviderId,
1351
- onSelectProvider: handleSelectProvider,
1352
- models,
1353
- selectedModelId,
1354
- onSelectModel: (modelId) => {
1355
- setSelectedModelId(modelId);
1356
- markDirty();
1356
+ variant: "glass",
1357
+ padded: false,
1358
+ collapsible: true,
1359
+ defaultOpen: true,
1360
+ header: {
1361
+ icon: /* @__PURE__ */ jsx(WrenchScrewdriverIcon, { className: "h-5 w-5 text-slate-700 dark:text-white" }),
1362
+ title: `${t("agentDrawer.toolsTab")}${enabledToolIds.size > 0 ? ` (${enabledToolIds.size})` : ""}`,
1363
+ subtitle: t("agentDrawer.toolsSubtitle", { _: "O que o agente pode invocar durante a execu\xE7\xE3o" })
1357
1364
  },
1358
- agentFramework: selectedFramework,
1359
- t
1365
+ children: /* @__PURE__ */ jsx(ToolsTab, { agentTools: availableAgentTools, enabledToolIds, onToggle: handleToggleTool, agentFramework: selectedFramework, t })
1360
1366
  }
1361
- ),
1362
- activeTab === "results" && /* @__PURE__ */ jsx(ResultsTab, { agentId: agent.agentId, t })
1363
- ]
1367
+ )
1368
+ ] })
1364
1369
  }
1365
1370
  );
1366
1371
  }
@@ -2116,7 +2121,7 @@ function ExecutionTimelinePanel({
2116
2121
  ] })
2117
2122
  ] }),
2118
2123
  /* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-center gap-3 text-xs text-slate-500 dark:text-slate-400", children: [
2119
- /* @__PURE__ */ jsx("span", { children: formatDuration2(entry.durationMs) }),
2124
+ /* @__PURE__ */ jsx("span", { children: formatDuration(entry.durationMs) }),
2120
2125
  /* @__PURE__ */ jsx("span", { children: "\xB7" }),
2121
2126
  /* @__PURE__ */ jsx("span", { children: formatTimestamp(entry.startedAt) })
2122
2127
  ] })
@@ -2153,7 +2158,7 @@ function NodeInspector({
2153
2158
  ] }),
2154
2159
  /* @__PURE__ */ jsxs("div", { children: [
2155
2160
  /* @__PURE__ */ jsx("dt", { className: "font-semibold", children: labels.duration }),
2156
- /* @__PURE__ */ jsx("dd", { className: "mt-0.5 text-slate-700 dark:text-slate-200", children: formatDuration2(entry.durationMs) })
2161
+ /* @__PURE__ */ jsx("dd", { className: "mt-0.5 text-slate-700 dark:text-slate-200", children: formatDuration(entry.durationMs) })
2157
2162
  ] }),
2158
2163
  /* @__PURE__ */ jsxs("div", { children: [
2159
2164
  /* @__PURE__ */ jsx("dt", { className: "font-semibold", children: labels.status }),
@@ -2207,7 +2212,7 @@ function hasMetrics(metrics) {
2207
2212
  metrics.model || metrics.tokensIn !== void 0 || metrics.tokensOut !== void 0 || metrics.costUsd !== void 0
2208
2213
  );
2209
2214
  }
2210
- function formatDuration2(ms) {
2215
+ function formatDuration(ms) {
2211
2216
  if (ms === null) return "\u2014";
2212
2217
  if (ms < 1e3) return `${ms}ms`;
2213
2218
  if (ms < 6e4) return `${(ms / 1e3).toFixed(1)}s`;
@@ -2907,7 +2912,7 @@ function getDatasourceLogo(entityId) {
2907
2912
  }
2908
2913
  return null;
2909
2914
  }
2910
- var PROVIDER_LOGOS2 = {
2915
+ var PROVIDER_LOGOS3 = {
2911
2916
  anthropic: "/logos/providers/anthropic.svg",
2912
2917
  amazon: "/logos/providers/aws.svg",
2913
2918
  google: "/logos/providers/google-gemini.svg",
@@ -3140,31 +3145,70 @@ function NodePalette({ agents, tools, agentTools = [], rules, entities = [], mod
3140
3145
  onAdd: onCreateAgent,
3141
3146
  addLabel: t("newAgent"),
3142
3147
  count: filteredAgents.length,
3143
- children: filteredAgents.length === 0 && filteredAgentTools.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: t("noAgents") }) : /* @__PURE__ */ jsx(Fragment, { children: filteredAgents.map((agent) => /* @__PURE__ */ jsxs(
3144
- "div",
3145
- {
3146
- draggable: true,
3147
- onDragStart: (event) => onDragStart(event, "agent", agent.agentId, agent.name),
3148
- className: "liquid-surface group flex items-center gap-2 rounded-lg px-3 py-2 transition-all cursor-grab hover:shadow-md active:cursor-grabbing",
3149
- children: [
3150
- /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
3151
- agent.avatar ? /* @__PURE__ */ jsx("img", { src: agent.avatar, alt: agent.name, className: "h-7 w-7 rounded-full bg-white shadow-sm ring-1 ring-gray-200/50 dark:bg-gray-800 dark:ring-white/10" }) : /* @__PURE__ */ jsx("div", { className: "flex h-7 w-7 items-center justify-center rounded-full bg-gradient-to-br from-indigo-400 to-purple-500 shadow-sm", children: /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-3.5 w-3.5 text-white" }) }),
3152
- /* @__PURE__ */ jsx("div", { className: "absolute -bottom-0.5 -right-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-indigo-500 ring-1.5 ring-white dark:ring-gray-900", children: /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-2 w-2 text-white" }) })
3153
- ] }),
3154
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
3155
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
3156
- /* @__PURE__ */ jsx("p", { className: "truncate text-xs font-medium text-gray-900 dark:text-white", children: agent.name }),
3157
- (() => {
3158
- const tier = getAgentTier(Number(agent.elo ?? 0));
3159
- return /* @__PURE__ */ jsx("span", { className: `shrink-0 rounded-full px-1.5 py-px text-[8px] font-bold ${tier.pillColor}`, children: t(`agentDrawer.tier${tier.key.charAt(0).toUpperCase()}${tier.key.slice(1)}`) });
3160
- })()
3148
+ children: filteredAgents.length === 0 && filteredAgentTools.length === 0 && filteredProviders.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: t("noAgents") }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3149
+ filteredAgents.map((agent) => /* @__PURE__ */ jsxs(
3150
+ "div",
3151
+ {
3152
+ draggable: true,
3153
+ onDragStart: (event) => onDragStart(event, "agent", agent.agentId, agent.name),
3154
+ className: "liquid-surface group flex items-center gap-2 rounded-lg px-3 py-2 transition-all cursor-grab hover:shadow-md active:cursor-grabbing",
3155
+ children: [
3156
+ /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
3157
+ agent.avatar ? /* @__PURE__ */ jsx("img", { src: agent.avatar, alt: agent.name, className: "h-7 w-7 rounded-full bg-white shadow-sm ring-1 ring-gray-200/50 dark:bg-gray-800 dark:ring-white/10" }) : /* @__PURE__ */ jsx("div", { className: "flex h-7 w-7 items-center justify-center rounded-full bg-gradient-to-br from-indigo-400 to-purple-500 shadow-sm", children: /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-3.5 w-3.5 text-white" }) }),
3158
+ /* @__PURE__ */ jsx("div", { className: "absolute -bottom-0.5 -right-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-indigo-500 ring-1.5 ring-white dark:ring-gray-900", children: /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-2 w-2 text-white" }) })
3161
3159
  ] }),
3162
- /* @__PURE__ */ jsx("p", { className: "truncate text-[10px] text-gray-400 dark:text-gray-500", children: agent.role ?? agent.agentId })
3163
- ] })
3164
- ]
3165
- },
3166
- agent.agentId
3167
- )) })
3160
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
3161
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
3162
+ /* @__PURE__ */ jsx("p", { className: "truncate text-xs font-medium text-gray-900 dark:text-white", children: agent.name }),
3163
+ (() => {
3164
+ const tier = getAgentTier(Number(agent.elo ?? 0));
3165
+ return /* @__PURE__ */ jsx("span", { className: `shrink-0 rounded-full px-1.5 py-px text-[8px] font-bold ${tier.pillColor}`, children: t(`agentDrawer.tier${tier.key.charAt(0).toUpperCase()}${tier.key.slice(1)}`) });
3166
+ })()
3167
+ ] }),
3168
+ /* @__PURE__ */ jsx("p", { className: "truncate text-[10px] text-gray-400 dark:text-gray-500", children: agent.role ?? agent.agentId })
3169
+ ] })
3170
+ ]
3171
+ },
3172
+ agent.agentId
3173
+ )),
3174
+ filteredProviders.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-2 border-t border-gray-200/40 pt-2 dark:border-white/5", children: [
3175
+ /* @__PURE__ */ jsx("p", { className: "mb-1.5 px-1 text-[9px] font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400", children: t("connectionsSection") }),
3176
+ filteredProviders.map((provider) => {
3177
+ const providerLogo = PROVIDER_LOGOS3[provider.provider];
3178
+ return /* @__PURE__ */ jsxs(
3179
+ "div",
3180
+ {
3181
+ draggable: true,
3182
+ onDragStart: (event) => {
3183
+ const defaultConfig = JSON.stringify({
3184
+ type: "model_provider",
3185
+ providerType: provider.provider === "amazon" ? "aws_bedrock" : provider.provider === "google" ? "google_vertex" : provider.provider === "meta" ? "custom" : `${provider.provider}_api`,
3186
+ name: provider.name,
3187
+ modelFilter: []
3188
+ });
3189
+ onDragStart(event, "model_provider", provider.id, provider.name, defaultConfig);
3190
+ },
3191
+ onClick: () => onConfigureProvider?.(provider.id),
3192
+ className: "liquid-surface group mb-1 flex items-center gap-2 rounded-lg px-3 py-2 transition-all cursor-grab hover:shadow-md active:cursor-grabbing",
3193
+ role: "button",
3194
+ tabIndex: 0,
3195
+ children: [
3196
+ providerLogo ? /* @__PURE__ */ jsx("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-white/10 p-1", children: /* @__PURE__ */ jsx("img", { src: providerLogo, alt: "", className: "h-4 w-4 object-contain", loading: "lazy" }) }) : /* @__PURE__ */ jsx("div", { className: "flex h-6 w-6 items-center justify-center rounded-md bg-gradient-to-br from-rose-400 to-pink-500 shadow-sm", children: /* @__PURE__ */ jsx(KeyIcon, { className: "h-3.5 w-3.5 text-white" }) }),
3197
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
3198
+ /* @__PURE__ */ jsx("p", { className: "truncate text-xs font-medium text-gray-900 dark:text-white", children: provider.name }),
3199
+ /* @__PURE__ */ jsxs("p", { className: "truncate text-[10px] text-gray-400 dark:text-gray-500", children: [
3200
+ provider.modelCount,
3201
+ " models"
3202
+ ] })
3203
+ ] }),
3204
+ provider.configured ? /* @__PURE__ */ jsx("span", { className: "rounded-full bg-green-100 px-1.5 py-0.5 text-[9px] font-medium text-green-600 dark:bg-green-500/10 dark:text-green-400", children: t("configured") }) : /* @__PURE__ */ jsx("span", { className: "rounded-full bg-amber-100 px-1.5 py-0.5 text-[9px] font-medium text-amber-600 dark:bg-amber-500/10 dark:text-amber-400", children: t("setup") })
3205
+ ]
3206
+ },
3207
+ provider.id
3208
+ );
3209
+ })
3210
+ ] })
3211
+ ] })
3168
3212
  }
3169
3213
  ),
3170
3214
  /* @__PURE__ */ jsx(
@@ -3305,49 +3349,6 @@ function NodePalette({ agents, tools, agentTools = [], rules, entities = [], mod
3305
3349
  })
3306
3350
  }
3307
3351
  ),
3308
- filteredProviders.length > 0 && /* @__PURE__ */ jsx(
3309
- CollapsibleSection,
3310
- {
3311
- title: t("connectionsSection"),
3312
- icon: /* @__PURE__ */ jsx(KeyIcon, { className: "h-3 w-3" }),
3313
- colorClass: "text-slate-600 dark:text-slate-400",
3314
- count: filteredProviders.length,
3315
- children: filteredProviders.map((provider) => {
3316
- const providerLogo = PROVIDER_LOGOS2[provider.provider];
3317
- return /* @__PURE__ */ jsxs(
3318
- "div",
3319
- {
3320
- draggable: true,
3321
- onDragStart: (event) => {
3322
- const defaultConfig = JSON.stringify({
3323
- type: "model_provider",
3324
- providerType: provider.provider === "amazon" ? "aws_bedrock" : provider.provider === "google" ? "google_vertex" : provider.provider === "meta" ? "custom" : `${provider.provider}_api`,
3325
- name: provider.name,
3326
- modelFilter: []
3327
- });
3328
- onDragStart(event, "model_provider", provider.id, provider.name, defaultConfig);
3329
- },
3330
- onClick: () => onConfigureProvider?.(provider.id),
3331
- className: "liquid-surface group flex items-center gap-2 rounded-lg px-3 py-2 transition-all cursor-grab hover:shadow-md active:cursor-grabbing",
3332
- role: "button",
3333
- tabIndex: 0,
3334
- children: [
3335
- providerLogo ? /* @__PURE__ */ jsx("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-white/10 p-1", children: /* @__PURE__ */ jsx("img", { src: providerLogo, alt: "", className: "h-4 w-4 object-contain", loading: "lazy" }) }) : /* @__PURE__ */ jsx("div", { className: "flex h-6 w-6 items-center justify-center rounded-md bg-gradient-to-br from-rose-400 to-pink-500 shadow-sm", children: /* @__PURE__ */ jsx(KeyIcon, { className: "h-3.5 w-3.5 text-white" }) }),
3336
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
3337
- /* @__PURE__ */ jsx("p", { className: "truncate text-xs font-medium text-gray-900 dark:text-white", children: provider.name }),
3338
- /* @__PURE__ */ jsxs("p", { className: "truncate text-[10px] text-gray-400 dark:text-gray-500", children: [
3339
- provider.modelCount,
3340
- " models"
3341
- ] })
3342
- ] }),
3343
- provider.configured ? /* @__PURE__ */ jsx("span", { className: "rounded-full bg-green-100 px-1.5 py-0.5 text-[9px] font-medium text-green-600 dark:bg-green-500/10 dark:text-green-400", children: t("configured") }) : /* @__PURE__ */ jsx("span", { className: "rounded-full bg-amber-100 px-1.5 py-0.5 text-[9px] font-medium text-amber-600 dark:bg-amber-500/10 dark:text-amber-400", children: t("setup") })
3344
- ]
3345
- },
3346
- provider.id
3347
- );
3348
- })
3349
- }
3350
- ),
3351
3352
  /* @__PURE__ */ jsxs(
3352
3353
  CollapsibleSection,
3353
3354
  {
@@ -3542,7 +3543,7 @@ function VersionHistoryPanel({
3542
3543
  )
3543
3544
  ] }),
3544
3545
  /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto", children: [
3545
- isLoading && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12", "data-testid": "version-history-loading", children: /* @__PURE__ */ jsx("div", { className: "h-6 w-6 animate-spin rounded-full border-2 border-blue-500 border-t-transparent" }) }),
3546
+ isLoading && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12", "data-testid": "version-history-loading", children: /* @__PURE__ */ jsx("div", { className: "h-6 w-6 animate-spin motion-reduce:animate-none rounded-full border-2 border-blue-500 border-t-transparent" }) }),
3546
3547
  loadError && /* @__PURE__ */ jsxs("div", { className: "px-4 py-8 text-center", "data-testid": "version-history-error", children: [
3547
3548
  /* @__PURE__ */ jsx("p", { className: "text-sm text-red-500 dark:text-red-400", children: loadError }),
3548
3549
  /* @__PURE__ */ jsx(
@@ -3655,7 +3656,7 @@ var STATUS_CONFIG = {
3655
3656
  label: "error"
3656
3657
  }
3657
3658
  };
3658
- function formatDuration3(durationMs) {
3659
+ function formatDuration2(durationMs) {
3659
3660
  if (durationMs < 1e3) {
3660
3661
  return `${durationMs}ms`;
3661
3662
  }
@@ -3685,10 +3686,24 @@ function RunPanel({ open, onClose, onRun, onStop }) {
3685
3686
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
3686
3687
  /* @__PURE__ */ jsx(PlayIcon, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" }),
3687
3688
  /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: translations("title") }),
3688
- isRunning && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-medium text-blue-700 dark:bg-blue-500/20 dark:text-blue-300", children: [
3689
- /* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500" }),
3690
- translations("executing")
3691
- ] })
3689
+ isRunning && /* @__PURE__ */ jsxs(
3690
+ "span",
3691
+ {
3692
+ role: "status",
3693
+ "aria-live": "polite",
3694
+ className: "flex items-center gap-1 rounded-full bg-blue-100 px-2 py-0.5 text-[11px] font-medium text-blue-800 dark:bg-blue-500/20 dark:text-blue-200",
3695
+ children: [
3696
+ /* @__PURE__ */ jsx(
3697
+ "span",
3698
+ {
3699
+ "aria-hidden": "true",
3700
+ className: "h-1.5 w-1.5 motion-safe:animate-pulse rounded-full bg-blue-500"
3701
+ }
3702
+ ),
3703
+ translations("executing")
3704
+ ]
3705
+ }
3706
+ )
3692
3707
  ] }),
3693
3708
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
3694
3709
  isRunning ? /* @__PURE__ */ jsxs(
@@ -3749,7 +3764,7 @@ function RunPanel({ open, onClose, onRun, onStop }) {
3749
3764
  ] }),
3750
3765
  result?.error && /* @__PURE__ */ jsx("p", { className: "mt-0.5 truncate text-xs text-red-500 dark:text-red-400", children: result.error })
3751
3766
  ] }),
3752
- result?.durationMs !== void 0 && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0 text-xs text-gray-500 dark:text-gray-400", children: formatDuration3(result.durationMs) })
3767
+ result?.durationMs !== void 0 && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0 text-xs text-gray-500 dark:text-gray-400", children: formatDuration2(result.durationMs) })
3753
3768
  ]
3754
3769
  },
3755
3770
  node.id
@@ -3763,7 +3778,7 @@ function SpinnerIcon({ className }) {
3763
3778
  return /* @__PURE__ */ jsxs(
3764
3779
  "svg",
3765
3780
  {
3766
- className: `animate-spin ${className ?? ""}`,
3781
+ className: `animate-spin motion-reduce:animate-none ${className ?? ""}`,
3767
3782
  viewBox: "0 0 24 24",
3768
3783
  fill: "none",
3769
3784
  stroke: "currentColor",
@@ -4173,13 +4188,13 @@ function RunInputDialog({
4173
4188
  var STATUS_STYLES = {
4174
4189
  completed: { icon: CheckCircleIcon, colorClass: "text-green-500" },
4175
4190
  failed: { icon: ExclamationCircleIcon, colorClass: "text-red-500" },
4176
- running: { icon: ArrowPathIcon, colorClass: "text-blue-500 animate-spin" },
4191
+ running: { icon: ArrowPathIcon, colorClass: "text-blue-500 animate-spin motion-reduce:animate-none" },
4177
4192
  pending: { icon: ClockIcon, colorClass: "text-gray-400" },
4178
4193
  success: { icon: CheckCircleIcon, colorClass: "text-green-500" },
4179
4194
  error: { icon: ExclamationCircleIcon, colorClass: "text-red-500" },
4180
4195
  skipped: { icon: ClockIcon, colorClass: "text-gray-400" }
4181
4196
  };
4182
- function formatDuration4(durationMs) {
4197
+ function formatDuration3(durationMs) {
4183
4198
  if (durationMs === null) return "\u2014";
4184
4199
  if (durationMs < 1e3) return `${durationMs}ms`;
4185
4200
  return `${(durationMs / 1e3).toFixed(1)}s`;
@@ -4230,7 +4245,7 @@ function PreviewPanel({ open, onClose, workflowId, loadRuns }) {
4230
4245
  /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
4231
4246
  isRunning && /* @__PURE__ */ jsxs("div", { className: "border-b border-gray-200/50 px-4 py-3 dark:border-gray-700/50", children: [
4232
4247
  /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center gap-2", children: [
4233
- /* @__PURE__ */ jsx(ArrowPathIcon, { className: "h-4 w-4 animate-spin text-blue-500" }),
4248
+ /* @__PURE__ */ jsx(ArrowPathIcon, { className: "h-4 w-4 animate-spin motion-reduce:animate-none text-blue-500" }),
4234
4249
  /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-blue-600 dark:text-blue-400", children: t("activeRun") })
4235
4250
  ] }),
4236
4251
  /* @__PURE__ */ jsx("div", { className: "max-h-60 space-y-1 overflow-y-auto", children: Object.entries(nodeResults).map(([nodeId, result]) => {
@@ -4241,7 +4256,7 @@ function PreviewPanel({ open, onClose, workflowId, loadRuns }) {
4241
4256
  /* @__PURE__ */ jsx(StatusIcon, { className: `h-3.5 w-3.5 ${statusStyle.colorClass}` }),
4242
4257
  /* @__PURE__ */ jsx("span", { className: "truncate text-gray-700 dark:text-gray-300", children: nodeId.slice(0, 8) })
4243
4258
  ] }),
4244
- result.durationMs !== void 0 && /* @__PURE__ */ jsx("span", { className: "text-gray-400", children: formatDuration4(result.durationMs) })
4259
+ result.durationMs !== void 0 && /* @__PURE__ */ jsx("span", { className: "text-gray-400", children: formatDuration3(result.durationMs) })
4245
4260
  ] }, nodeId);
4246
4261
  }) })
4247
4262
  ] }),
@@ -4257,7 +4272,7 @@ function PreviewPanel({ open, onClose, workflowId, loadRuns }) {
4257
4272
  ] }),
4258
4273
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
4259
4274
  /* @__PURE__ */ jsx("span", { className: "text-gray-500", children: t("duration") }),
4260
- /* @__PURE__ */ jsx("span", { className: "text-gray-700 dark:text-gray-300", children: formatDuration4(selectedNode.durationMs) })
4275
+ /* @__PURE__ */ jsx("span", { className: "text-gray-700 dark:text-gray-300", children: formatDuration3(selectedNode.durationMs) })
4261
4276
  ] }),
4262
4277
  selectedNode.error && /* @__PURE__ */ jsxs("div", { children: [
4263
4278
  /* @__PURE__ */ jsx("span", { className: "text-red-500", children: t("error") }),
@@ -4296,7 +4311,7 @@ function PreviewPanel({ open, onClose, workflowId, loadRuns }) {
4296
4311
  /* @__PURE__ */ jsx(StatusIcon, { className: `h-3.5 w-3.5 ${statusStyle.colorClass}` }),
4297
4312
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-gray-900 dark:text-white", children: formatTimestamp2(run.createdAt) })
4298
4313
  ] }),
4299
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-gray-400", children: formatDuration4(run.totalDurationMs) })
4314
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-gray-400", children: formatDuration3(run.totalDurationMs) })
4300
4315
  ] }),
4301
4316
  run.error && /* @__PURE__ */ jsx("p", { className: "mt-1 truncate text-[10px] text-red-500", children: run.error })
4302
4317
  ]
@@ -4320,7 +4335,7 @@ function PreviewPanel({ open, onClose, workflowId, loadRuns }) {
4320
4335
  /* @__PURE__ */ jsx(NodeStatusIcon, { className: `h-3 w-3 ${nodeStatusStyle.colorClass}` }),
4321
4336
  /* @__PURE__ */ jsx("span", { className: "text-gray-700 dark:text-gray-300", children: nodeResult.nodeType })
4322
4337
  ] }),
4323
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-gray-400", children: formatDuration4(nodeResult.durationMs) })
4338
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-gray-400", children: formatDuration3(nodeResult.durationMs) })
4324
4339
  ]
4325
4340
  },
4326
4341
  nodeResult.nodeId
@@ -4332,12 +4347,34 @@ function PreviewPanel({ open, onClose, workflowId, loadRuns }) {
4332
4347
  ] })
4333
4348
  ] });
4334
4349
  }
4335
- function SaveStatusBadge({ status }) {
4350
+ function SaveStatusBadge({ status, labels }) {
4351
+ const savingLabel = labels?.saving ?? "Salvando\u2026";
4352
+ const savedLabel = labels?.saved ?? "Salvo";
4336
4353
  if (status === "saving") {
4337
- return /* @__PURE__ */ jsx("span", { className: "animate-pulse text-[10px] text-gray-400 dark:text-gray-500", children: "\u2022" });
4354
+ return /* @__PURE__ */ jsxs("span", { role: "status", "aria-live": "polite", className: "inline-flex items-center", children: [
4355
+ /* @__PURE__ */ jsx(
4356
+ "span",
4357
+ {
4358
+ "aria-hidden": "true",
4359
+ className: "motion-safe:animate-pulse text-[11px] text-gray-500 dark:text-gray-400",
4360
+ children: "\u2022"
4361
+ }
4362
+ ),
4363
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: savingLabel })
4364
+ ] });
4338
4365
  }
4339
4366
  if (status === "saved") {
4340
- return /* @__PURE__ */ jsx("span", { className: "text-[10px] text-green-500/60 dark:text-green-400/50", children: "\u2713" });
4367
+ return /* @__PURE__ */ jsxs("span", { role: "status", "aria-live": "polite", className: "inline-flex items-center", children: [
4368
+ /* @__PURE__ */ jsx(
4369
+ "span",
4370
+ {
4371
+ "aria-hidden": "true",
4372
+ className: "text-[11px] text-emerald-600 dark:text-emerald-400",
4373
+ children: "\u2713"
4374
+ }
4375
+ ),
4376
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: savedLabel })
4377
+ ] });
4341
4378
  }
4342
4379
  return null;
4343
4380
  }
@@ -5007,6 +5044,6 @@ function useHelpLines() {
5007
5044
  };
5008
5045
  }
5009
5046
 
5010
- export { AgentModal, AmazonNovaIcon, AnthropicModelIcon, AutoSaveWorkspace, DslExportModal, DslImportModal, DynamicIslandConfirm2 as DynamicIslandConfirm, ExecutionTimelinePanel, MetaLlamaIcon, NodePalette, OutputSchemaBuilder, PipelineSettingsModal, PreviewPanel, RULE_STATUS_OPTIONS, RuleActionBuilder, RuleConditionBuilder, RuleForm, RunInputDialog, RunPanel, RunReplayModal, S3WriteFlowNode, SaveStatusBadge, SubworkflowModal, TIMEZONE_OPTIONS, VariableInspector, VersionHistoryPanel, WorkflowListBar, defaultAgentOutputSchema, defaultRuleAction, defaultRuleCondition, defaultRuleForm, getModelIcon, useCanRedo, useCanUndo, useCanvasShortcuts, useClipboard, useContextMenu, useEditingNodeId, useHasCopied, useHelpLines, useIsRunning, useNodeResults, useSelectedNodeCount, useSubworkflowStore, useUndoRedo };
5011
- //# sourceMappingURL=chunk-2WXRRQM3.mjs.map
5012
- //# sourceMappingURL=chunk-2WXRRQM3.mjs.map
5047
+ export { AgentModal, AmazonNovaIcon, AnthropicModelIcon, AutoSaveWorkspace, DslExportModal, DslImportModal, DynamicIslandConfirm2 as DynamicIslandConfirm, ExecutionTimelinePanel, MetaLlamaIcon, ModelProviderFlowNode, NodePalette, OutputSchemaBuilder, PipelineSettingsModal, PreviewPanel, RULE_STATUS_OPTIONS, RuleActionBuilder, RuleConditionBuilder, RuleForm, RunInputDialog, RunPanel, RunReplayModal, S3WriteFlowNode, SaveStatusBadge, SubworkflowModal, TIMEZONE_OPTIONS, VariableInspector, VersionHistoryPanel, WorkflowListBar, defaultAgentOutputSchema, defaultRuleAction, defaultRuleCondition, defaultRuleForm, getModelIcon, useCanRedo, useCanUndo, useCanvasShortcuts, useClipboard, useContextMenu, useEditingNodeId, useHasCopied, useHelpLines, useIsRunning, useNodeResults, useSelectedNodeCount, useSubworkflowStore, useUndoRedo };
5048
+ //# sourceMappingURL=chunk-SEYUYGER.mjs.map
5049
+ //# sourceMappingURL=chunk-SEYUYGER.mjs.map