@datatechsolutions/ui 3.3.0 → 3.5.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 (212) hide show
  1. package/dist/astrlabe/index.js +113 -113
  2. package/dist/astrlabe/index.mjs +6 -6
  3. package/dist/astrlabe/workflow-canvas.js +6 -6
  4. package/dist/astrlabe/workflow-canvas.mjs +5 -5
  5. package/dist/brand/index.js +0 -14
  6. package/dist/brand/index.js.map +1 -1
  7. package/dist/brand/index.mjs +0 -14
  8. package/dist/brand/index.mjs.map +1 -1
  9. package/dist/{chunk-2WXRRQM3.mjs → chunk-2MJAHST4.mjs} +554 -516
  10. package/dist/chunk-2MJAHST4.mjs.map +1 -0
  11. package/dist/{chunk-FAGDZEKM.js → chunk-2OZZH2IO.js} +2 -2
  12. package/dist/chunk-2OZZH2IO.js.map +1 -0
  13. package/dist/{chunk-SYNVNTLJ.mjs → chunk-3AY5HIQ6.mjs} +2 -2
  14. package/dist/chunk-3AY5HIQ6.mjs.map +1 -0
  15. package/dist/{chunk-O6M3KDGT.mjs → chunk-3OLYSMI5.mjs} +41 -7
  16. package/dist/chunk-3OLYSMI5.mjs.map +1 -0
  17. package/dist/{chunk-GIQXB3BG.mjs → chunk-4PFU6A2B.mjs} +3 -3
  18. package/dist/{chunk-GIQXB3BG.mjs.map → chunk-4PFU6A2B.mjs.map} +1 -1
  19. package/dist/{chunk-3ZUMJTDT.mjs → chunk-5BEVTOZV.mjs} +4 -5
  20. package/dist/{chunk-3JJWPOK6.js.map → chunk-5BEVTOZV.mjs.map} +1 -1
  21. package/dist/{chunk-3JJWPOK6.js → chunk-5I7F7KZ6.js} +10 -11
  22. package/dist/chunk-5I7F7KZ6.js.map +1 -0
  23. package/dist/{chunk-BR2GAZKG.mjs → chunk-6V3DUBOZ.mjs} +7 -7
  24. package/dist/{chunk-BR2GAZKG.mjs.map → chunk-6V3DUBOZ.mjs.map} +1 -1
  25. package/dist/{chunk-5GDKCFM5.mjs → chunk-6W7VTZG6.mjs} +3 -3
  26. package/dist/{chunk-5GDKCFM5.mjs.map → chunk-6W7VTZG6.mjs.map} +1 -1
  27. package/dist/{chunk-IJAKZHXX.js → chunk-74MHWEDC.js} +684 -645
  28. package/dist/chunk-74MHWEDC.js.map +1 -0
  29. package/dist/{chunk-IRPS5UCS.mjs → chunk-7CEZB3ZD.mjs} +3 -3
  30. package/dist/{chunk-IRPS5UCS.mjs.map → chunk-7CEZB3ZD.mjs.map} +1 -1
  31. package/dist/{chunk-UDDZTTLO.mjs → chunk-7UHV6A4C.mjs} +6 -7
  32. package/dist/chunk-7UHV6A4C.mjs.map +1 -0
  33. package/dist/{chunk-ZM5MVWIT.js → chunk-A7FI4K7Z.js} +5 -6
  34. package/dist/chunk-A7FI4K7Z.js.map +1 -0
  35. package/dist/{chunk-MWPTSBAI.js → chunk-AVM53A3Y.js} +63 -29
  36. package/dist/chunk-AVM53A3Y.js.map +1 -0
  37. package/dist/{chunk-I2NZGVBG.js → chunk-AWDH6WNA.js} +1214 -5396
  38. package/dist/chunk-AWDH6WNA.js.map +1 -0
  39. package/dist/{chunk-ZJPNP2YW.mjs → chunk-BUDZNAKL.mjs} +2 -2
  40. package/dist/chunk-BUDZNAKL.mjs.map +1 -0
  41. package/dist/{chunk-OCELRSLO.js → chunk-BVXATTTA.js} +4 -4
  42. package/dist/{chunk-OCELRSLO.js.map → chunk-BVXATTTA.js.map} +1 -1
  43. package/dist/{chunk-W5OEBO6E.js → chunk-C4NRF2G2.js} +13 -14
  44. package/dist/chunk-C4NRF2G2.js.map +1 -0
  45. package/dist/{chunk-JSNRCYSO.js → chunk-CY2MBKVG.js} +4 -4
  46. package/dist/{chunk-JSNRCYSO.js.map → chunk-CY2MBKVG.js.map} +1 -1
  47. package/dist/{chunk-ZL6C2ZAF.js → chunk-FK3WDELF.js} +67 -67
  48. package/dist/{chunk-ZL6C2ZAF.js.map → chunk-FK3WDELF.js.map} +1 -1
  49. package/dist/{chunk-MVBIAXVN.mjs → chunk-IOEQ2GET.mjs} +14 -11
  50. package/dist/chunk-IOEQ2GET.mjs.map +1 -0
  51. package/dist/{chunk-AOUUZ52N.js → chunk-NCDBNGIB.js} +85 -86
  52. package/dist/chunk-NCDBNGIB.js.map +1 -0
  53. package/dist/{chunk-B67DP7MI.mjs → chunk-NJ5RVWLA.mjs} +4 -4
  54. package/dist/{chunk-B67DP7MI.mjs.map → chunk-NJ5RVWLA.mjs.map} +1 -1
  55. package/dist/{chunk-HDCUWUNH.js → chunk-NKXQYFS7.js} +28 -27
  56. package/dist/chunk-NKXQYFS7.js.map +1 -0
  57. package/dist/{chunk-JN6IL6OH.mjs → chunk-NOHHZ6FM.mjs} +1171 -5316
  58. package/dist/chunk-NOHHZ6FM.mjs.map +1 -0
  59. package/dist/{chunk-PCYL4MII.mjs → chunk-OASC7NYV.mjs} +156 -314
  60. package/dist/chunk-OASC7NYV.mjs.map +1 -0
  61. package/dist/{chunk-RXZNACMI.js → chunk-P43PX75J.js} +33 -33
  62. package/dist/{chunk-RXZNACMI.js.map → chunk-P43PX75J.js.map} +1 -1
  63. package/dist/{chunk-OL73LBX5.mjs → chunk-QLFSJ6HK.mjs} +3 -4
  64. package/dist/chunk-QLFSJ6HK.mjs.map +1 -0
  65. package/dist/{chunk-LEKZUS6N.mjs → chunk-QPSHM2JQ.mjs} +4 -5
  66. package/dist/chunk-QPSHM2JQ.mjs.map +1 -0
  67. package/dist/{chunk-NJFRJ6YD.js → chunk-QSMPKL27.js} +225 -384
  68. package/dist/chunk-QSMPKL27.js.map +1 -0
  69. package/dist/{chunk-ZV5EZXXO.mjs → chunk-RHRJXK5R.mjs} +3 -3
  70. package/dist/{chunk-ZV5EZXXO.mjs.map → chunk-RHRJXK5R.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-5RM6NGZ6.mjs → chunk-UHMAKUON.mjs} +3 -3
  74. package/dist/{chunk-5RM6NGZ6.mjs.map → chunk-UHMAKUON.mjs.map} +1 -1
  75. package/dist/{chunk-TIJJHW2Z.js → chunk-V5VBYOF5.js} +36 -36
  76. package/dist/{chunk-TIJJHW2Z.js.map → chunk-V5VBYOF5.js.map} +1 -1
  77. package/dist/{chunk-KR2X2WHJ.js → chunk-VMGNQFRO.js} +53 -53
  78. package/dist/{chunk-KR2X2WHJ.js.map → chunk-VMGNQFRO.js.map} +1 -1
  79. package/dist/{chunk-HZ4LOVHM.js → chunk-VY52Y5GC.js} +2 -2
  80. package/dist/chunk-VY52Y5GC.js.map +1 -0
  81. package/dist/{chunk-TVMLV675.js → chunk-Z7VY5M4T.js} +98 -95
  82. package/dist/chunk-Z7VY5M4T.js.map +1 -0
  83. package/dist/{chunk-R4TQWXNG.mjs → chunk-ZM2Q2SMC.mjs} +6 -5
  84. package/dist/chunk-ZM2Q2SMC.mjs.map +1 -0
  85. package/dist/index.js +744 -904
  86. package/dist/index.mjs +4 -4
  87. package/dist/platform/admin/index.js +13 -13
  88. package/dist/platform/admin/index.mjs +7 -7
  89. package/dist/platform/agents-workspace.js +9 -9
  90. package/dist/platform/agents-workspace.mjs +8 -8
  91. package/dist/platform/app-shell.js +6 -6
  92. package/dist/platform/app-shell.mjs +5 -5
  93. package/dist/platform/auth/index.js +30 -30
  94. package/dist/platform/auth/index.mjs +7 -7
  95. package/dist/platform/billing/index.js +6 -6
  96. package/dist/platform/billing/index.mjs +5 -5
  97. package/dist/platform/impersonation/index.js +6 -6
  98. package/dist/platform/impersonation/index.mjs +5 -5
  99. package/dist/platform/index.js +102 -4812
  100. package/dist/platform/index.js.map +1 -1
  101. package/dist/platform/index.mjs +24 -4729
  102. package/dist/platform/index.mjs.map +1 -1
  103. package/dist/platform/pages/index.js +320 -204
  104. package/dist/platform/pages/index.js.map +1 -1
  105. package/dist/platform/pages/index.mjs +146 -30
  106. package/dist/platform/pages/index.mjs.map +1 -1
  107. package/dist/platform/rbac.js +2 -2
  108. package/dist/platform/rbac.mjs +1 -1
  109. package/dist/platform/settings/index.js +10 -10
  110. package/dist/platform/settings/index.mjs +9 -9
  111. package/dist/platform/utils/index.js +3 -3
  112. package/dist/platform/utils/index.js.map +1 -1
  113. package/dist/platform/utils/index.mjs +1 -1
  114. package/dist/platform/utils/index.mjs.map +1 -1
  115. package/dist/platform/workflow-api-client.js +62 -62
  116. package/dist/platform/workflow-api-client.mjs +2 -2
  117. package/dist/platform/workflow-canvas-shell.js +7 -7
  118. package/dist/platform/workflow-canvas-shell.mjs +6 -6
  119. package/package.json +15 -5
  120. package/src/styles/liquid-glass.css +283 -2
  121. package/dist/astrlabe/contracts.d.mts +0 -517
  122. package/dist/astrlabe/contracts.d.ts +0 -517
  123. package/dist/astrlabe/graph-node.d.mts +0 -28
  124. package/dist/astrlabe/graph-node.d.ts +0 -28
  125. package/dist/astrlabe/index.d.mts +0 -751
  126. package/dist/astrlabe/index.d.ts +0 -751
  127. package/dist/astrlabe/utils.d.mts +0 -60
  128. package/dist/astrlabe/utils.d.ts +0 -60
  129. package/dist/astrlabe/workflow-canvas.d.mts +0 -69
  130. package/dist/astrlabe/workflow-canvas.d.ts +0 -69
  131. package/dist/astrlabe/workflow-preview-canvas.d.mts +0 -10
  132. package/dist/astrlabe/workflow-preview-canvas.d.ts +0 -10
  133. package/dist/billing-panel-DsHhhJqG.d.mts +0 -18
  134. package/dist/billing-panel-DsHhhJqG.d.ts +0 -18
  135. package/dist/brand/index.d.mts +0 -85
  136. package/dist/brand/index.d.ts +0 -85
  137. package/dist/chunk-2WXRRQM3.mjs.map +0 -1
  138. package/dist/chunk-3ZUMJTDT.mjs.map +0 -1
  139. package/dist/chunk-AOUUZ52N.js.map +0 -1
  140. package/dist/chunk-FAGDZEKM.js.map +0 -1
  141. package/dist/chunk-HDCUWUNH.js.map +0 -1
  142. package/dist/chunk-HZ4LOVHM.js.map +0 -1
  143. package/dist/chunk-I2NZGVBG.js.map +0 -1
  144. package/dist/chunk-IJAKZHXX.js.map +0 -1
  145. package/dist/chunk-JN6IL6OH.mjs.map +0 -1
  146. package/dist/chunk-LEKZUS6N.mjs.map +0 -1
  147. package/dist/chunk-MVBIAXVN.mjs.map +0 -1
  148. package/dist/chunk-MWPTSBAI.js.map +0 -1
  149. package/dist/chunk-NJFRJ6YD.js.map +0 -1
  150. package/dist/chunk-O6M3KDGT.mjs.map +0 -1
  151. package/dist/chunk-OL73LBX5.mjs.map +0 -1
  152. package/dist/chunk-PCYL4MII.mjs.map +0 -1
  153. package/dist/chunk-R4TQWXNG.mjs.map +0 -1
  154. package/dist/chunk-SYNVNTLJ.mjs.map +0 -1
  155. package/dist/chunk-TVMLV675.js.map +0 -1
  156. package/dist/chunk-UDDZTTLO.mjs.map +0 -1
  157. package/dist/chunk-W5OEBO6E.js.map +0 -1
  158. package/dist/chunk-ZJPNP2YW.mjs.map +0 -1
  159. package/dist/chunk-ZM5MVWIT.js.map +0 -1
  160. package/dist/dynamic-island-confirm-BKsZkAEP.d.mts +0 -17
  161. package/dist/dynamic-island-confirm-BKsZkAEP.d.ts +0 -17
  162. package/dist/index-CoB18TbG.d.ts +0 -215
  163. package/dist/index-VI9gyJXl.d.mts +0 -215
  164. package/dist/index.d.mts +0 -5412
  165. package/dist/index.d.ts +0 -5412
  166. package/dist/layout-engine-YZcVr20M.d.mts +0 -19
  167. package/dist/layout-engine-YZcVr20M.d.ts +0 -19
  168. package/dist/lib/i18n-context.d.mts +0 -36
  169. package/dist/lib/i18n-context.d.ts +0 -36
  170. package/dist/lib/router-context.d.mts +0 -35
  171. package/dist/lib/router-context.d.ts +0 -35
  172. package/dist/navigation-BiWVffAN.d.mts +0 -49
  173. package/dist/navigation-BiWVffAN.d.ts +0 -49
  174. package/dist/platform/admin/index.d.mts +0 -17
  175. package/dist/platform/admin/index.d.ts +0 -17
  176. package/dist/platform/agents-workspace.d.mts +0 -19
  177. package/dist/platform/agents-workspace.d.ts +0 -19
  178. package/dist/platform/app-shell.d.mts +0 -58
  179. package/dist/platform/app-shell.d.ts +0 -58
  180. package/dist/platform/auth/index.d.mts +0 -73
  181. package/dist/platform/auth/index.d.ts +0 -73
  182. package/dist/platform/billing/index.d.mts +0 -29
  183. package/dist/platform/billing/index.d.ts +0 -29
  184. package/dist/platform/impersonation/index.d.mts +0 -19
  185. package/dist/platform/impersonation/index.d.ts +0 -19
  186. package/dist/platform/index.d.mts +0 -224
  187. package/dist/platform/index.d.ts +0 -224
  188. package/dist/platform/pages/index.d.mts +0 -432
  189. package/dist/platform/pages/index.d.ts +0 -432
  190. package/dist/platform/rbac.d.mts +0 -41
  191. package/dist/platform/rbac.d.ts +0 -41
  192. package/dist/platform/settings/index.d.mts +0 -31
  193. package/dist/platform/settings/index.d.ts +0 -31
  194. package/dist/platform/telemetry/index.d.mts +0 -51
  195. package/dist/platform/telemetry/index.d.ts +0 -51
  196. package/dist/platform/utils/index.d.mts +0 -32
  197. package/dist/platform/utils/index.d.ts +0 -32
  198. package/dist/platform/windsock-admin-client.d.mts +0 -57
  199. package/dist/platform/windsock-admin-client.d.ts +0 -57
  200. package/dist/platform/workflow-api-client.d.mts +0 -6
  201. package/dist/platform/workflow-api-client.d.ts +0 -6
  202. package/dist/platform/workflow-canvas-shell.d.mts +0 -18
  203. package/dist/platform/workflow-canvas-shell.d.ts +0 -18
  204. package/dist/rule-form-BYJzyork.d.mts +0 -128
  205. package/dist/rule-form-BYJzyork.d.ts +0 -128
  206. package/dist/workflow-api-client-BKD8OfP_.d.ts +0 -468
  207. package/dist/workflow-api-client-DoYj7nHz.d.mts +0 -468
  208. package/dist/workflow-store-o17I6L6A.d.ts +0 -79
  209. package/dist/workflow-store-ppVHdMZi.d.mts +0 -79
  210. package/src/brand/logos/kori-icon.svg +0 -45
  211. package/src/brand/logos/kori-logo-dark.svg +0 -40
  212. 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-OASC7NYV.mjs';
3
+ import { Button, FormInput, FormSelect, Avatar, ToggleSwitch, HeroBlock, GlassModal, SectionCard, FormTextarea, Badge, FormGrid, Input, DynamicIslandConfirm } from './chunk-NOHHZ6FM.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,209 @@ 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 avatarInitial = (displayName || agent.name).charAt(0).toUpperCase();
1180
+ const avatarNode = /* @__PURE__ */ jsx(
1181
+ Avatar,
1182
+ {
1183
+ src: effectiveAvatarUrl || void 0,
1184
+ alt: displayName || agent.name,
1185
+ initials: effectiveAvatarUrl ? void 0 : avatarInitial,
1186
+ tone: effectiveAvatarUrl ? void 0 : "indigo",
1187
+ className: "size-12"
1188
+ }
1189
+ );
1190
+ const statusPill = /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
1191
+ /* @__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
1192
  /* @__PURE__ */ jsx(
1271
- "button",
1193
+ ToggleSwitch,
1272
1194
  {
1273
- type: "button",
1274
- onClick: () => {
1275
- void handleMarkSaved();
1195
+ size: "sm",
1196
+ color: "green",
1197
+ checked: status === "active",
1198
+ onChange: (checked) => {
1199
+ setStatus(checked ? "active" : "draft");
1200
+ markDirty();
1276
1201
  },
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")
1202
+ label: t("agentDrawer.status", { _: "Status" })
1280
1203
  }
1281
1204
  )
1282
1205
  ] });
1283
- return /* @__PURE__ */ jsxs(
1206
+ 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(
1207
+ HeroBlock,
1208
+ {
1209
+ icon: avatarNode,
1210
+ iconBackground: "none",
1211
+ iconSize: "lg",
1212
+ headingLevel: "h2",
1213
+ title: displayName,
1214
+ onTitleChange: (next) => {
1215
+ setDisplayName(next);
1216
+ markDirty();
1217
+ },
1218
+ titlePlaceholder: agent.name,
1219
+ subtitle: agent.role,
1220
+ rightContent: statusPill,
1221
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1222
+ /* @__PURE__ */ jsxs("label", { className: "flex flex-col gap-1", children: [
1223
+ /* @__PURE__ */ jsx("span", { className: fieldLabel, children: t("agentDrawer.description", { _: "Description" }) }),
1224
+ /* @__PURE__ */ jsx(
1225
+ "textarea",
1226
+ {
1227
+ rows: 2,
1228
+ value: description,
1229
+ onChange: (event) => {
1230
+ setDescription(event.target.value);
1231
+ markDirty();
1232
+ },
1233
+ placeholder: t("agentDrawer.descriptionPlaceholder", { _: "What this agent does, which tasks it's good at" }),
1234
+ className: `${fieldCard} resize-none`
1235
+ }
1236
+ )
1237
+ ] }),
1238
+ /* @__PURE__ */ jsxs("label", { className: "flex flex-col gap-1", children: [
1239
+ /* @__PURE__ */ jsx("span", { className: fieldLabel, children: t("agentDrawer.tags", { _: "Tags" }) }),
1240
+ /* @__PURE__ */ jsx(
1241
+ "input",
1242
+ {
1243
+ type: "text",
1244
+ value: tagsText,
1245
+ onChange: (event) => {
1246
+ setTagsText(event.target.value);
1247
+ markDirty();
1248
+ },
1249
+ placeholder: t("agentDrawer.tagsPlaceholder", { _: "pricing, research, internal" }),
1250
+ className: fieldCard
1251
+ }
1252
+ )
1253
+ ] })
1254
+ ] })
1255
+ }
1256
+ ) });
1257
+ const autosaveLabel = persisting ? t("agentDrawer.saving", { _: "Saving\u2026" }) : dirty ? t("agentDrawer.pendingAutosave", { _: "Saving in a moment\u2026" }) : t("agentDrawer.autoSaved", { _: "Auto-saved" });
1258
+ 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";
1259
+ const sidebarFooter = /* @__PURE__ */ jsxs("div", { role: "status", "aria-live": "polite", className: "flex items-center gap-1.5 px-1 py-2 text-xs", children: [
1260
+ /* @__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(
1261
+ "span",
1262
+ {
1263
+ "aria-hidden": "true",
1264
+ className: "absolute inset-0 motion-safe:animate-ping rounded-full bg-indigo-500/60"
1265
+ }
1266
+ ) }),
1267
+ /* @__PURE__ */ jsx("span", { className: `font-medium ${autosaveColor}`, children: autosaveLabel })
1268
+ ] });
1269
+ return /* @__PURE__ */ jsx(
1284
1270
  GlassModal,
1285
1271
  {
1286
1272
  open,
1287
1273
  onClose: handleClose,
1288
1274
  title: agent.name,
1289
- subtitle: isCreateMode ? t("agentDrawer.createAgent") : t("agentDrawer.editAgent"),
1290
1275
  gradient: "from-indigo-500 to-purple-600",
1291
- icon: /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-5 w-5 text-white" }),
1276
+ icon: /* @__PURE__ */ jsx(CpuChipIcon, { className: "h-5 w-5 text-slate-700 dark:text-white" }),
1292
1277
  label: isCreateMode ? t("agentDrawer.createAgent") : t("agentDrawer.editAgent"),
1293
1278
  sidebar: {
1294
1279
  sections,
1295
1280
  activeSectionId: activeTab,
1296
1281
  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
- },
1282
+ identityCard,
1303
1283
  footer: sidebarFooter
1304
1284
  },
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,
1285
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
1286
+ /* @__PURE__ */ jsx(
1287
+ SectionCard,
1310
1288
  {
1311
- agent,
1312
- temperature,
1313
- setTemperature,
1314
- markDirty,
1315
- t,
1316
- promptText: systemPrompt,
1317
- setPromptText: setSystemPrompt,
1318
- outputSchema,
1319
- setOutputSchema
1289
+ variant: "glass",
1290
+ padded: false,
1291
+ collapsible: true,
1292
+ defaultOpen: true,
1293
+ header: {
1294
+ icon: /* @__PURE__ */ jsx(Cog6ToothIcon, { className: "h-5 w-5 text-slate-700 dark:text-white" }),
1295
+ title: t("agentDrawer.engineTab"),
1296
+ subtitle: t("agentDrawer.engineSubtitle", { _: "Como o agente roda \u2014 capacidade, modelo, credenciais" })
1297
+ },
1298
+ children: /* @__PURE__ */ jsx(
1299
+ EngineTab,
1300
+ {
1301
+ agent,
1302
+ models,
1303
+ t,
1304
+ selectedModelId,
1305
+ setSelectedModelId,
1306
+ selectedFramework,
1307
+ setSelectedFramework: (fw) => setSelectedFramework(fw),
1308
+ temperature,
1309
+ setTemperature,
1310
+ elo,
1311
+ setElo,
1312
+ maxOutputTokens,
1313
+ setMaxOutputTokens,
1314
+ topP,
1315
+ setTopP,
1316
+ topK,
1317
+ setTopK,
1318
+ modelProviders: availableModelProviders,
1319
+ selectedProviderId,
1320
+ onSelectProvider: handleSelectProvider,
1321
+ markDirty
1322
+ }
1323
+ )
1320
1324
  }
1321
1325
  ),
1322
- activeTab === "advanced" && /* @__PURE__ */ jsx(
1323
- AdvancedTab,
1326
+ /* @__PURE__ */ jsx(
1327
+ SectionCard,
1324
1328
  {
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
1329
+ variant: "glass",
1330
+ padded: false,
1331
+ collapsible: true,
1332
+ defaultOpen: true,
1333
+ header: {
1334
+ icon: /* @__PURE__ */ jsx(SparklesIcon, { className: "h-5 w-5 text-slate-700 dark:text-white" }),
1335
+ title: t("agentDrawer.brainTab"),
1336
+ subtitle: t("agentDrawer.brainSubtitle", { _: "Como o agente pensa \u2014 prompt + criatividade" })
1337
+ },
1338
+ children: /* @__PURE__ */ jsx(
1339
+ PromptTab,
1340
+ {
1341
+ agent,
1342
+ temperature,
1343
+ setTemperature,
1344
+ markDirty,
1345
+ t,
1346
+ promptText: systemPrompt,
1347
+ setPromptText: setSystemPrompt,
1348
+ outputSchema,
1349
+ setOutputSchema
1350
+ }
1351
+ )
1343
1352
  }
1344
1353
  ),
1345
- activeTab === "tools" && /* @__PURE__ */ jsx(ToolsTab, { agentTools: availableAgentTools, enabledToolIds, onToggle: handleToggleTool, agentFramework: selectedFramework, t }),
1346
- activeTab === "models" && /* @__PURE__ */ jsx(
1347
- ModelsTab,
1354
+ /* @__PURE__ */ jsx(
1355
+ SectionCard,
1348
1356
  {
1349
- modelProviders: availableModelProviders,
1350
- selectedProviderId,
1351
- onSelectProvider: handleSelectProvider,
1352
- models,
1353
- selectedModelId,
1354
- onSelectModel: (modelId) => {
1355
- setSelectedModelId(modelId);
1356
- markDirty();
1357
+ variant: "glass",
1358
+ padded: false,
1359
+ collapsible: true,
1360
+ defaultOpen: true,
1361
+ header: {
1362
+ icon: /* @__PURE__ */ jsx(WrenchScrewdriverIcon, { className: "h-5 w-5 text-slate-700 dark:text-white" }),
1363
+ title: `${t("agentDrawer.toolsTab")}${enabledToolIds.size > 0 ? ` (${enabledToolIds.size})` : ""}`,
1364
+ subtitle: t("agentDrawer.toolsSubtitle", { _: "O que o agente pode invocar durante a execu\xE7\xE3o" })
1357
1365
  },
1358
- agentFramework: selectedFramework,
1359
- t
1366
+ children: /* @__PURE__ */ jsx(ToolsTab, { agentTools: availableAgentTools, enabledToolIds, onToggle: handleToggleTool, agentFramework: selectedFramework, t })
1360
1367
  }
1361
- ),
1362
- activeTab === "results" && /* @__PURE__ */ jsx(ResultsTab, { agentId: agent.agentId, t })
1363
- ]
1368
+ )
1369
+ ] })
1364
1370
  }
1365
1371
  );
1366
1372
  }
@@ -2116,7 +2122,7 @@ function ExecutionTimelinePanel({
2116
2122
  ] })
2117
2123
  ] }),
2118
2124
  /* @__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) }),
2125
+ /* @__PURE__ */ jsx("span", { children: formatDuration(entry.durationMs) }),
2120
2126
  /* @__PURE__ */ jsx("span", { children: "\xB7" }),
2121
2127
  /* @__PURE__ */ jsx("span", { children: formatTimestamp(entry.startedAt) })
2122
2128
  ] })
@@ -2153,7 +2159,7 @@ function NodeInspector({
2153
2159
  ] }),
2154
2160
  /* @__PURE__ */ jsxs("div", { children: [
2155
2161
  /* @__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) })
2162
+ /* @__PURE__ */ jsx("dd", { className: "mt-0.5 text-slate-700 dark:text-slate-200", children: formatDuration(entry.durationMs) })
2157
2163
  ] }),
2158
2164
  /* @__PURE__ */ jsxs("div", { children: [
2159
2165
  /* @__PURE__ */ jsx("dt", { className: "font-semibold", children: labels.status }),
@@ -2207,7 +2213,7 @@ function hasMetrics(metrics) {
2207
2213
  metrics.model || metrics.tokensIn !== void 0 || metrics.tokensOut !== void 0 || metrics.costUsd !== void 0
2208
2214
  );
2209
2215
  }
2210
- function formatDuration2(ms) {
2216
+ function formatDuration(ms) {
2211
2217
  if (ms === null) return "\u2014";
2212
2218
  if (ms < 1e3) return `${ms}ms`;
2213
2219
  if (ms < 6e4) return `${(ms / 1e3).toFixed(1)}s`;
@@ -2907,7 +2913,7 @@ function getDatasourceLogo(entityId) {
2907
2913
  }
2908
2914
  return null;
2909
2915
  }
2910
- var PROVIDER_LOGOS2 = {
2916
+ var PROVIDER_LOGOS3 = {
2911
2917
  anthropic: "/logos/providers/anthropic.svg",
2912
2918
  amazon: "/logos/providers/aws.svg",
2913
2919
  google: "/logos/providers/google-gemini.svg",
@@ -3140,31 +3146,70 @@ function NodePalette({ agents, tools, agentTools = [], rules, entities = [], mod
3140
3146
  onAdd: onCreateAgent,
3141
3147
  addLabel: t("newAgent"),
3142
3148
  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
- })()
3149
+ 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: [
3150
+ filteredAgents.map((agent) => /* @__PURE__ */ jsxs(
3151
+ "div",
3152
+ {
3153
+ draggable: true,
3154
+ onDragStart: (event) => onDragStart(event, "agent", agent.agentId, agent.name),
3155
+ 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",
3156
+ children: [
3157
+ /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
3158
+ 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" }) }),
3159
+ /* @__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
3160
  ] }),
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
- )) })
3161
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
3162
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
3163
+ /* @__PURE__ */ jsx("p", { className: "truncate text-xs font-medium text-gray-900 dark:text-white", children: agent.name }),
3164
+ (() => {
3165
+ const tier = getAgentTier(Number(agent.elo ?? 0));
3166
+ 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)}`) });
3167
+ })()
3168
+ ] }),
3169
+ /* @__PURE__ */ jsx("p", { className: "truncate text-[10px] text-gray-400 dark:text-gray-500", children: agent.role ?? agent.agentId })
3170
+ ] })
3171
+ ]
3172
+ },
3173
+ agent.agentId
3174
+ )),
3175
+ filteredProviders.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-2 border-t border-gray-200/40 pt-2 dark:border-white/5", children: [
3176
+ /* @__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") }),
3177
+ filteredProviders.map((provider) => {
3178
+ const providerLogo = PROVIDER_LOGOS3[provider.provider];
3179
+ return /* @__PURE__ */ jsxs(
3180
+ "div",
3181
+ {
3182
+ draggable: true,
3183
+ onDragStart: (event) => {
3184
+ const defaultConfig = JSON.stringify({
3185
+ type: "model_provider",
3186
+ providerType: provider.provider === "amazon" ? "aws_bedrock" : provider.provider === "google" ? "google_vertex" : provider.provider === "meta" ? "custom" : `${provider.provider}_api`,
3187
+ name: provider.name,
3188
+ modelFilter: []
3189
+ });
3190
+ onDragStart(event, "model_provider", provider.id, provider.name, defaultConfig);
3191
+ },
3192
+ onClick: () => onConfigureProvider?.(provider.id),
3193
+ 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",
3194
+ role: "button",
3195
+ tabIndex: 0,
3196
+ children: [
3197
+ 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" }) }),
3198
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
3199
+ /* @__PURE__ */ jsx("p", { className: "truncate text-xs font-medium text-gray-900 dark:text-white", children: provider.name }),
3200
+ /* @__PURE__ */ jsxs("p", { className: "truncate text-[10px] text-gray-400 dark:text-gray-500", children: [
3201
+ provider.modelCount,
3202
+ " models"
3203
+ ] })
3204
+ ] }),
3205
+ 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") })
3206
+ ]
3207
+ },
3208
+ provider.id
3209
+ );
3210
+ })
3211
+ ] })
3212
+ ] })
3168
3213
  }
3169
3214
  ),
3170
3215
  /* @__PURE__ */ jsx(
@@ -3305,49 +3350,6 @@ function NodePalette({ agents, tools, agentTools = [], rules, entities = [], mod
3305
3350
  })
3306
3351
  }
3307
3352
  ),
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
3353
  /* @__PURE__ */ jsxs(
3352
3354
  CollapsibleSection,
3353
3355
  {
@@ -3542,7 +3544,7 @@ function VersionHistoryPanel({
3542
3544
  )
3543
3545
  ] }),
3544
3546
  /* @__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" }) }),
3547
+ 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
3548
  loadError && /* @__PURE__ */ jsxs("div", { className: "px-4 py-8 text-center", "data-testid": "version-history-error", children: [
3547
3549
  /* @__PURE__ */ jsx("p", { className: "text-sm text-red-500 dark:text-red-400", children: loadError }),
3548
3550
  /* @__PURE__ */ jsx(
@@ -3655,7 +3657,7 @@ var STATUS_CONFIG = {
3655
3657
  label: "error"
3656
3658
  }
3657
3659
  };
3658
- function formatDuration3(durationMs) {
3660
+ function formatDuration2(durationMs) {
3659
3661
  if (durationMs < 1e3) {
3660
3662
  return `${durationMs}ms`;
3661
3663
  }
@@ -3685,10 +3687,24 @@ function RunPanel({ open, onClose, onRun, onStop }) {
3685
3687
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
3686
3688
  /* @__PURE__ */ jsx(PlayIcon, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" }),
3687
3689
  /* @__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
- ] })
3690
+ isRunning && /* @__PURE__ */ jsxs(
3691
+ "span",
3692
+ {
3693
+ role: "status",
3694
+ "aria-live": "polite",
3695
+ 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",
3696
+ children: [
3697
+ /* @__PURE__ */ jsx(
3698
+ "span",
3699
+ {
3700
+ "aria-hidden": "true",
3701
+ className: "h-1.5 w-1.5 motion-safe:animate-pulse rounded-full bg-blue-500"
3702
+ }
3703
+ ),
3704
+ translations("executing")
3705
+ ]
3706
+ }
3707
+ )
3692
3708
  ] }),
3693
3709
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
3694
3710
  isRunning ? /* @__PURE__ */ jsxs(
@@ -3749,7 +3765,7 @@ function RunPanel({ open, onClose, onRun, onStop }) {
3749
3765
  ] }),
3750
3766
  result?.error && /* @__PURE__ */ jsx("p", { className: "mt-0.5 truncate text-xs text-red-500 dark:text-red-400", children: result.error })
3751
3767
  ] }),
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) })
3768
+ 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
3769
  ]
3754
3770
  },
3755
3771
  node.id
@@ -3763,7 +3779,7 @@ function SpinnerIcon({ className }) {
3763
3779
  return /* @__PURE__ */ jsxs(
3764
3780
  "svg",
3765
3781
  {
3766
- className: `animate-spin ${className ?? ""}`,
3782
+ className: `animate-spin motion-reduce:animate-none ${className ?? ""}`,
3767
3783
  viewBox: "0 0 24 24",
3768
3784
  fill: "none",
3769
3785
  stroke: "currentColor",
@@ -4173,13 +4189,13 @@ function RunInputDialog({
4173
4189
  var STATUS_STYLES = {
4174
4190
  completed: { icon: CheckCircleIcon, colorClass: "text-green-500" },
4175
4191
  failed: { icon: ExclamationCircleIcon, colorClass: "text-red-500" },
4176
- running: { icon: ArrowPathIcon, colorClass: "text-blue-500 animate-spin" },
4192
+ running: { icon: ArrowPathIcon, colorClass: "text-blue-500 animate-spin motion-reduce:animate-none" },
4177
4193
  pending: { icon: ClockIcon, colorClass: "text-gray-400" },
4178
4194
  success: { icon: CheckCircleIcon, colorClass: "text-green-500" },
4179
4195
  error: { icon: ExclamationCircleIcon, colorClass: "text-red-500" },
4180
4196
  skipped: { icon: ClockIcon, colorClass: "text-gray-400" }
4181
4197
  };
4182
- function formatDuration4(durationMs) {
4198
+ function formatDuration3(durationMs) {
4183
4199
  if (durationMs === null) return "\u2014";
4184
4200
  if (durationMs < 1e3) return `${durationMs}ms`;
4185
4201
  return `${(durationMs / 1e3).toFixed(1)}s`;
@@ -4230,7 +4246,7 @@ function PreviewPanel({ open, onClose, workflowId, loadRuns }) {
4230
4246
  /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
4231
4247
  isRunning && /* @__PURE__ */ jsxs("div", { className: "border-b border-gray-200/50 px-4 py-3 dark:border-gray-700/50", children: [
4232
4248
  /* @__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" }),
4249
+ /* @__PURE__ */ jsx(ArrowPathIcon, { className: "h-4 w-4 animate-spin motion-reduce:animate-none text-blue-500" }),
4234
4250
  /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-blue-600 dark:text-blue-400", children: t("activeRun") })
4235
4251
  ] }),
4236
4252
  /* @__PURE__ */ jsx("div", { className: "max-h-60 space-y-1 overflow-y-auto", children: Object.entries(nodeResults).map(([nodeId, result]) => {
@@ -4241,7 +4257,7 @@ function PreviewPanel({ open, onClose, workflowId, loadRuns }) {
4241
4257
  /* @__PURE__ */ jsx(StatusIcon, { className: `h-3.5 w-3.5 ${statusStyle.colorClass}` }),
4242
4258
  /* @__PURE__ */ jsx("span", { className: "truncate text-gray-700 dark:text-gray-300", children: nodeId.slice(0, 8) })
4243
4259
  ] }),
4244
- result.durationMs !== void 0 && /* @__PURE__ */ jsx("span", { className: "text-gray-400", children: formatDuration4(result.durationMs) })
4260
+ result.durationMs !== void 0 && /* @__PURE__ */ jsx("span", { className: "text-gray-400", children: formatDuration3(result.durationMs) })
4245
4261
  ] }, nodeId);
4246
4262
  }) })
4247
4263
  ] }),
@@ -4257,7 +4273,7 @@ function PreviewPanel({ open, onClose, workflowId, loadRuns }) {
4257
4273
  ] }),
4258
4274
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
4259
4275
  /* @__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) })
4276
+ /* @__PURE__ */ jsx("span", { className: "text-gray-700 dark:text-gray-300", children: formatDuration3(selectedNode.durationMs) })
4261
4277
  ] }),
4262
4278
  selectedNode.error && /* @__PURE__ */ jsxs("div", { children: [
4263
4279
  /* @__PURE__ */ jsx("span", { className: "text-red-500", children: t("error") }),
@@ -4296,7 +4312,7 @@ function PreviewPanel({ open, onClose, workflowId, loadRuns }) {
4296
4312
  /* @__PURE__ */ jsx(StatusIcon, { className: `h-3.5 w-3.5 ${statusStyle.colorClass}` }),
4297
4313
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-gray-900 dark:text-white", children: formatTimestamp2(run.createdAt) })
4298
4314
  ] }),
4299
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-gray-400", children: formatDuration4(run.totalDurationMs) })
4315
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-gray-400", children: formatDuration3(run.totalDurationMs) })
4300
4316
  ] }),
4301
4317
  run.error && /* @__PURE__ */ jsx("p", { className: "mt-1 truncate text-[10px] text-red-500", children: run.error })
4302
4318
  ]
@@ -4320,7 +4336,7 @@ function PreviewPanel({ open, onClose, workflowId, loadRuns }) {
4320
4336
  /* @__PURE__ */ jsx(NodeStatusIcon, { className: `h-3 w-3 ${nodeStatusStyle.colorClass}` }),
4321
4337
  /* @__PURE__ */ jsx("span", { className: "text-gray-700 dark:text-gray-300", children: nodeResult.nodeType })
4322
4338
  ] }),
4323
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-gray-400", children: formatDuration4(nodeResult.durationMs) })
4339
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-gray-400", children: formatDuration3(nodeResult.durationMs) })
4324
4340
  ]
4325
4341
  },
4326
4342
  nodeResult.nodeId
@@ -4332,12 +4348,34 @@ function PreviewPanel({ open, onClose, workflowId, loadRuns }) {
4332
4348
  ] })
4333
4349
  ] });
4334
4350
  }
4335
- function SaveStatusBadge({ status }) {
4351
+ function SaveStatusBadge({ status, labels }) {
4352
+ const savingLabel = labels?.saving ?? "Salvando\u2026";
4353
+ const savedLabel = labels?.saved ?? "Salvo";
4336
4354
  if (status === "saving") {
4337
- return /* @__PURE__ */ jsx("span", { className: "animate-pulse text-[10px] text-gray-400 dark:text-gray-500", children: "\u2022" });
4355
+ return /* @__PURE__ */ jsxs("span", { role: "status", "aria-live": "polite", className: "inline-flex items-center", children: [
4356
+ /* @__PURE__ */ jsx(
4357
+ "span",
4358
+ {
4359
+ "aria-hidden": "true",
4360
+ className: "motion-safe:animate-pulse text-[11px] text-gray-500 dark:text-gray-400",
4361
+ children: "\u2022"
4362
+ }
4363
+ ),
4364
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: savingLabel })
4365
+ ] });
4338
4366
  }
4339
4367
  if (status === "saved") {
4340
- return /* @__PURE__ */ jsx("span", { className: "text-[10px] text-green-500/60 dark:text-green-400/50", children: "\u2713" });
4368
+ return /* @__PURE__ */ jsxs("span", { role: "status", "aria-live": "polite", className: "inline-flex items-center", children: [
4369
+ /* @__PURE__ */ jsx(
4370
+ "span",
4371
+ {
4372
+ "aria-hidden": "true",
4373
+ className: "text-[11px] text-emerald-600 dark:text-emerald-400",
4374
+ children: "\u2713"
4375
+ }
4376
+ ),
4377
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: savedLabel })
4378
+ ] });
4341
4379
  }
4342
4380
  return null;
4343
4381
  }
@@ -5007,6 +5045,6 @@ function useHelpLines() {
5007
5045
  };
5008
5046
  }
5009
5047
 
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
5048
+ 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 };
5049
+ //# sourceMappingURL=chunk-2MJAHST4.mjs.map
5050
+ //# sourceMappingURL=chunk-2MJAHST4.mjs.map