@datatechsolutions/ui 3.7.5 → 3.8.1

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 (91) hide show
  1. package/dist/astrlabe/index.js +108 -108
  2. package/dist/astrlabe/index.mjs +4 -4
  3. package/dist/astrlabe/workflow-canvas.js +4 -4
  4. package/dist/astrlabe/workflow-canvas.mjs +3 -3
  5. package/dist/{chunk-GAN7AKZ2.mjs → chunk-32DHEVOH.mjs} +3 -3
  6. package/dist/{chunk-GAN7AKZ2.mjs.map → chunk-32DHEVOH.mjs.map} +1 -1
  7. package/dist/{chunk-IYDGO7RW.js → chunk-3H5CFLVK.js} +135 -135
  8. package/dist/{chunk-IYDGO7RW.js.map → chunk-3H5CFLVK.js.map} +1 -1
  9. package/dist/{chunk-QL2JYRBN.js → chunk-3X3IYDG6.js} +68 -68
  10. package/dist/{chunk-QL2JYRBN.js.map → chunk-3X3IYDG6.js.map} +1 -1
  11. package/dist/{chunk-N5365CGD.mjs → chunk-57E4TCB2.mjs} +3 -3
  12. package/dist/{chunk-N5365CGD.mjs.map → chunk-57E4TCB2.mjs.map} +1 -1
  13. package/dist/{chunk-4HP7XS5I.mjs → chunk-5W6LMDXV.mjs} +4 -4
  14. package/dist/{chunk-4HP7XS5I.mjs.map → chunk-5W6LMDXV.mjs.map} +1 -1
  15. package/dist/{chunk-EIZM2EQA.mjs → chunk-5YVOLHSW.mjs} +4 -4
  16. package/dist/{chunk-EIZM2EQA.mjs.map → chunk-5YVOLHSW.mjs.map} +1 -1
  17. package/dist/{chunk-KZSL7AXW.mjs → chunk-74BU2EBZ.mjs} +6 -6
  18. package/dist/{chunk-KZSL7AXW.mjs.map → chunk-74BU2EBZ.mjs.map} +1 -1
  19. package/dist/{chunk-7WIWDSF6.js → chunk-7JZFNKJD.js} +36 -36
  20. package/dist/{chunk-7WIWDSF6.js.map → chunk-7JZFNKJD.js.map} +1 -1
  21. package/dist/{chunk-DCBRGVD3.mjs → chunk-A4A3SQTV.mjs} +3 -3
  22. package/dist/{chunk-DCBRGVD3.mjs.map → chunk-A4A3SQTV.mjs.map} +1 -1
  23. package/dist/{chunk-JUDQX6MP.mjs → chunk-CZZOCKEA.mjs} +3 -3
  24. package/dist/{chunk-JUDQX6MP.mjs.map → chunk-CZZOCKEA.mjs.map} +1 -1
  25. package/dist/{chunk-DWIBK7GV.js → chunk-E57RZXOR.js} +25 -25
  26. package/dist/{chunk-DWIBK7GV.js.map → chunk-E57RZXOR.js.map} +1 -1
  27. package/dist/{chunk-Z3BMHKKH.mjs → chunk-E6C7MFHJ.mjs} +3 -3
  28. package/dist/{chunk-Z3BMHKKH.mjs.map → chunk-E6C7MFHJ.mjs.map} +1 -1
  29. package/dist/{chunk-P7GVXI7Y.mjs → chunk-EWYAM4WJ.mjs} +3 -3
  30. package/dist/{chunk-P7GVXI7Y.mjs.map → chunk-EWYAM4WJ.mjs.map} +1 -1
  31. package/dist/{chunk-Y2FR242F.js → chunk-F35GFICG.js} +13 -13
  32. package/dist/{chunk-Y2FR242F.js.map → chunk-F35GFICG.js.map} +1 -1
  33. package/dist/{chunk-BEUPW5WS.js → chunk-FKUIVS6I.js} +28 -28
  34. package/dist/{chunk-BEUPW5WS.js.map → chunk-FKUIVS6I.js.map} +1 -1
  35. package/dist/{chunk-GD6FHRHV.js → chunk-FNA66TT4.js} +3 -3
  36. package/dist/{chunk-GD6FHRHV.js.map → chunk-FNA66TT4.js.map} +1 -1
  37. package/dist/{chunk-RBB5YGWH.js → chunk-H37VDL7Y.js} +4 -4
  38. package/dist/{chunk-RBB5YGWH.js.map → chunk-H37VDL7Y.js.map} +1 -1
  39. package/dist/{chunk-KI4UPW4Z.js → chunk-HBOORO52.js} +4 -4
  40. package/dist/{chunk-KI4UPW4Z.js.map → chunk-HBOORO52.js.map} +1 -1
  41. package/dist/{chunk-MGZTZELL.mjs → chunk-KKXI7CPF.mjs} +3 -3
  42. package/dist/{chunk-MGZTZELL.mjs.map → chunk-KKXI7CPF.mjs.map} +1 -1
  43. package/dist/{chunk-IKH5IRDK.mjs → chunk-PCUINUIC.mjs} +3 -3
  44. package/dist/{chunk-IKH5IRDK.mjs.map → chunk-PCUINUIC.mjs.map} +1 -1
  45. package/dist/{chunk-CTCO2YI5.mjs → chunk-PYNXIDG3.mjs} +3 -3
  46. package/dist/{chunk-CTCO2YI5.mjs.map → chunk-PYNXIDG3.mjs.map} +1 -1
  47. package/dist/{chunk-MFAVWJWE.js → chunk-Q4QORAMH.js} +10 -10
  48. package/dist/{chunk-MFAVWJWE.js.map → chunk-Q4QORAMH.js.map} +1 -1
  49. package/dist/{chunk-ZF7RJNPD.js → chunk-Q7HRCCFT.js} +45 -45
  50. package/dist/{chunk-ZF7RJNPD.js.map → chunk-Q7HRCCFT.js.map} +1 -1
  51. package/dist/{chunk-R2RPRRB4.js → chunk-RCHTRG7R.js} +55 -55
  52. package/dist/{chunk-R2RPRRB4.js.map → chunk-RCHTRG7R.js.map} +1 -1
  53. package/dist/{chunk-FIB2CFJK.js → chunk-TCP45Q4B.js} +9 -9
  54. package/dist/{chunk-FIB2CFJK.js.map → chunk-TCP45Q4B.js.map} +1 -1
  55. package/dist/{chunk-SUU7XPRX.js → chunk-TJPPZU77.js} +34 -34
  56. package/dist/{chunk-SUU7XPRX.js.map → chunk-TJPPZU77.js.map} +1 -1
  57. package/dist/{chunk-XT76DMP5.js → chunk-VPFVW7ZF.js} +35 -35
  58. package/dist/{chunk-XT76DMP5.js.map → chunk-VPFVW7ZF.js.map} +1 -1
  59. package/dist/{chunk-IKHWYYZC.mjs → chunk-VS6PTRQ7.mjs} +3 -3
  60. package/dist/{chunk-IKHWYYZC.mjs.map → chunk-VS6PTRQ7.mjs.map} +1 -1
  61. package/dist/{chunk-YNHQ36UU.mjs → chunk-WDBVIU7W.mjs} +3 -3
  62. package/dist/{chunk-YNHQ36UU.mjs.map → chunk-WDBVIU7W.mjs.map} +1 -1
  63. package/dist/{chunk-MRLEINJN.mjs → chunk-ZP37M2QK.mjs} +7 -7
  64. package/dist/{chunk-MRLEINJN.mjs.map → chunk-ZP37M2QK.mjs.map} +1 -1
  65. package/dist/index.js +665 -665
  66. package/dist/index.mjs +2 -2
  67. package/dist/platform/admin/index.js +10 -10
  68. package/dist/platform/admin/index.mjs +4 -4
  69. package/dist/platform/agents-workspace.js +7 -7
  70. package/dist/platform/agents-workspace.mjs +6 -6
  71. package/dist/platform/app-shell.js +4 -4
  72. package/dist/platform/app-shell.mjs +3 -3
  73. package/dist/platform/auth/index.js +22 -22
  74. package/dist/platform/auth/index.mjs +4 -4
  75. package/dist/platform/billing/index.js +4 -4
  76. package/dist/platform/billing/index.mjs +3 -3
  77. package/dist/platform/impersonation/index.js +4 -4
  78. package/dist/platform/impersonation/index.mjs +3 -3
  79. package/dist/platform/index.js +78 -78
  80. package/dist/platform/index.mjs +18 -18
  81. package/dist/platform/pages/index.d.mts +36 -0
  82. package/dist/platform/pages/index.d.ts +36 -0
  83. package/dist/platform/pages/index.js +613 -277
  84. package/dist/platform/pages/index.js.map +1 -1
  85. package/dist/platform/pages/index.mjs +382 -46
  86. package/dist/platform/pages/index.mjs.map +1 -1
  87. package/dist/platform/settings/index.js +7 -7
  88. package/dist/platform/settings/index.mjs +6 -6
  89. package/dist/platform/workflow-canvas-shell.js +5 -5
  90. package/dist/platform/workflow-canvas-shell.mjs +4 -4
  91. package/package.json +1 -1
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import { adaptWorkflowGraphToUi, formatDurationMs } from '../../chunk-UQXVCVAN.mjs';
3
- import { WorkflowWorkspace } from '../../chunk-4HP7XS5I.mjs';
4
- export { RolesPageView, UsersPageView } from '../../chunk-4HP7XS5I.mjs';
5
- import { DatasourceModal, findCategory, DIALECT_CATEGORIES } from '../../chunk-DCBRGVD3.mjs';
6
- export { DIALECT_CATEGORIES, DatasourceFormModal, DatasourceModal, findCategory, findDialect } from '../../chunk-DCBRGVD3.mjs';
7
- import { defaultRuleForm, RuleForm, ExecutionTimelinePanel } from '../../chunk-EIZM2EQA.mjs';
3
+ import { WorkflowWorkspace } from '../../chunk-5W6LMDXV.mjs';
4
+ export { RolesPageView, UsersPageView } from '../../chunk-5W6LMDXV.mjs';
5
+ import { DatasourceModal, findCategory, DIALECT_CATEGORIES } from '../../chunk-A4A3SQTV.mjs';
6
+ export { DIALECT_CATEGORIES, DatasourceFormModal, DatasourceModal, findCategory, findDialect } from '../../chunk-A4A3SQTV.mjs';
7
+ import { defaultRuleForm, RuleForm, ExecutionTimelinePanel } from '../../chunk-5YVOLHSW.mjs';
8
8
  import '../../chunk-JB6RNAD2.mjs';
9
9
  import '../../chunk-LEXBTVGM.mjs';
10
- import '../../chunk-N5365CGD.mjs';
11
- import { HeroSection, PageLoadingState, PageEmptyState, SearchBar, EntityCard, ManagementPageLayout, CreateActionButton, GlassModal, FormGrid, FormSelect, FormInput, FormTextarea, SectionHeader, Text, Form, FormActionsRow, Table, TableHead, TableRow, TableHeader, TableBody, TableCell, InlineForm, CopyableId, ListCard, ListCardItem, Avatar, SectionCard, Tabs, TabsList, TabsTrigger, TabsContent } from '../../chunk-Z3BMHKKH.mjs';
10
+ import '../../chunk-57E4TCB2.mjs';
11
+ import { HeroSection, PageLoadingState, PageEmptyState, SearchBar, EntityCard, ManagementPageLayout, CreateActionButton, GlassModal, FormGrid, FormSelect, FormInput, FormTextarea, SectionHeader, Text, Form, FormActionsRow, Table, TableHead, TableRow, TableHeader, TableBody, TableCell, InlineForm, CopyableId, ListCard, ListCardItem, Avatar, SectionCard, Tabs, TabsList, TabsTrigger, TabsContent } from '../../chunk-E6C7MFHJ.mjs';
12
+ import '../../chunk-7VJ7CMMT.mjs';
12
13
  import '../../chunk-RHRJXK5R.mjs';
13
14
  import '../../chunk-3AY5HIQ6.mjs';
14
- import '../../chunk-7VJ7CMMT.mjs';
15
15
  import '../../chunk-PLTLRL2V.mjs';
16
16
  import { Badge, Button } from '../../chunk-WR55H7DH.mjs';
17
17
  import '../../chunk-D2JF6C3E.mjs';
@@ -2342,6 +2342,7 @@ function AgentsWorkspacePageView({
2342
2342
  {
2343
2343
  labels,
2344
2344
  models,
2345
+ connections,
2345
2346
  onClose: () => setCreateOpen(false),
2346
2347
  onSubmit: async (input) => {
2347
2348
  await onCreateAgent(input);
@@ -2770,30 +2771,152 @@ function ModelTab({
2770
2771
  );
2771
2772
  }
2772
2773
  var AGENT_PRESETS = [
2773
- { id: "sales", emoji: "\u{1F4BC}", name: "Sales Specialist", role: "Lead qualification & CRM", systemPrompt: "You are a sales assistant. Help qualify leads, manage CRM entries, and schedule follow-ups. Always be professional and proactive.", temperature: 0.7, maxTokens: 2048, accent: "from-emerald-500 to-teal-600" },
2774
- { id: "support", emoji: "\u{1F3A7}", name: "Customer Support", role: "Ticket resolution & escalation", systemPrompt: "You are a customer support agent. Resolve tickets, answer questions, and escalate complex issues. Prioritize customer satisfaction.", temperature: 0.3, maxTokens: 2048, accent: "from-sky-500 to-indigo-600" },
2775
- { id: "finance", emoji: "\u{1F4CA}", name: "Financial Analyst", role: "Revenue, margins, reports", systemPrompt: "You are a financial analyst. Analyze revenue, calculate margins, generate performance reports, and identify trends. Use data-driven insights for recommendations.", temperature: 0.4, maxTokens: 4096, accent: "from-amber-500 to-orange-600" },
2776
- { id: "security", emoji: "\u{1F6E1}\uFE0F", name: "Security Analyst", role: "Threat monitoring & compliance", systemPrompt: "You are a security analyst. Monitor for threats, audit data access, ensure compliance with privacy regulations, and manage incident response.", temperature: 0.3, maxTokens: 2048, accent: "from-rose-500 to-red-600" },
2777
- { id: "data", emoji: "\u{1F52C}", name: "Data Analyst", role: "Pattern detection & cleaning", systemPrompt: "You are a data analyst. Process raw data inputs, identify patterns, clean datasets, and prepare structured analysis for downstream agents.", temperature: 0.5, maxTokens: 4096, accent: "from-violet-500 to-purple-600" },
2774
+ { id: "sales", emoji: "\u{1F4BC}", name: "Sales Specialist", role: "Lead qualification & CRM", systemPrompt: "You are a sales assistant. Help qualify leads, manage CRM entries, and schedule follow-ups. Always be professional and proactive.", temperature: 0.7, maxTokens: 2048, accent: "from-emerald-500 to-teal-600", framework: "anthropic" },
2775
+ { id: "support", emoji: "\u{1F3A7}", name: "Customer Support", role: "Ticket resolution & escalation", systemPrompt: "You are a customer support agent. Resolve tickets, answer questions, and escalate complex issues. Prioritize customer satisfaction.", temperature: 0.3, maxTokens: 2048, accent: "from-sky-500 to-indigo-600", framework: "crewai" },
2776
+ { id: "finance", emoji: "\u{1F4CA}", name: "Financial Analyst", role: "Revenue, margins, reports", systemPrompt: "You are a financial analyst. Analyze revenue, calculate margins, generate performance reports, and identify trends. Use data-driven insights for recommendations.", temperature: 0.4, maxTokens: 4096, accent: "from-amber-500 to-orange-600", framework: "langchain" },
2777
+ { id: "security", emoji: "\u{1F6E1}\uFE0F", name: "Security Analyst", role: "Threat monitoring & compliance", systemPrompt: "You are a security analyst. Monitor for threats, audit data access, ensure compliance with privacy regulations, and manage incident response.", temperature: 0.3, maxTokens: 2048, accent: "from-rose-500 to-red-600", framework: "anthropic" },
2778
+ { id: "data", emoji: "\u{1F52C}", name: "Data Analyst", role: "Pattern detection & cleaning", systemPrompt: "You are a data analyst. Process raw data inputs, identify patterns, clean datasets, and prepare structured analysis for downstream agents.", temperature: 0.5, maxTokens: 4096, accent: "from-violet-500 to-purple-600", framework: "google-adk" },
2778
2779
  { id: "custom", emoji: "\u2728", name: "", role: "", systemPrompt: "", temperature: 0.2, maxTokens: 2048, accent: "from-slate-500 to-slate-700" }
2779
2780
  ];
2781
+ var DIFFICULTY_OPTIONS = [
2782
+ { id: "beginner", emoji: "\u{1F331}", accent: "from-emerald-500 to-teal-600" },
2783
+ { id: "intermediate", emoji: "\u26A1", accent: "from-sky-500 to-indigo-600" },
2784
+ { id: "advanced", emoji: "\u{1F680}", accent: "from-amber-500 to-orange-600" },
2785
+ { id: "expert", emoji: "\u{1F9E0}", accent: "from-rose-500 to-purple-600" }
2786
+ ];
2780
2787
  var EMOJI_PALETTE = ["\u{1F4BC}", "\u{1F3A7}", "\u{1F4CA}", "\u{1F6E1}\uFE0F", "\u{1F52C}", "\u2728", "\u{1F916}", "\u26A1", "\u{1F3AF}", "\u{1F680}", "\u{1F9E0}", "\u{1F9BE}", "\u{1F4E1}", "\u{1F52E}", "\u{1F310}", "\u{1F5C2}\uFE0F"];
2788
+ function RangeSliderField({
2789
+ sliderId,
2790
+ label,
2791
+ value,
2792
+ onChange,
2793
+ min,
2794
+ max,
2795
+ step,
2796
+ zones,
2797
+ trackGradient,
2798
+ formatValue,
2799
+ ariaLabel
2800
+ }) {
2801
+ const percent = (value - min) / (max - min) * 100;
2802
+ const activeZone = zones?.find((z) => value <= z.max) ?? zones?.[zones.length - 1];
2803
+ const thumbColor = activeZone?.thumbColor ?? "#6366f1";
2804
+ const glow = hexToGlow(thumbColor);
2805
+ const displayValue = formatValue ? formatValue(value) : value.toString();
2806
+ const ariaText = activeZone ? `${displayValue} \u2014 ${activeZone.label}` : displayValue;
2807
+ return /* @__PURE__ */ jsxs("div", { children: [
2808
+ /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
2809
+ /* @__PURE__ */ jsx("label", { htmlFor: sliderId, className: "text-xs font-medium text-gray-500 dark:text-gray-400", children: label }),
2810
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-bold tabular-nums text-gray-900 dark:text-white", children: displayValue })
2811
+ ] }),
2812
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2813
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 top-1/2 h-2 -translate-y-1/2 overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700", children: /* @__PURE__ */ jsx(
2814
+ "div",
2815
+ {
2816
+ className: "h-full rounded-full transition-all duration-300 ease-out motion-reduce:transition-none",
2817
+ style: {
2818
+ width: `${Math.max(0, Math.min(100, percent))}%`,
2819
+ background: trackGradient ?? `linear-gradient(90deg, ${thumbColor}, ${thumbColor})`
2820
+ }
2821
+ }
2822
+ ) }),
2823
+ /* @__PURE__ */ jsx(
2824
+ "input",
2825
+ {
2826
+ id: sliderId,
2827
+ "data-slider-id": sliderId,
2828
+ type: "range",
2829
+ min,
2830
+ max,
2831
+ step,
2832
+ value,
2833
+ onChange: (e) => onChange(parseFloat(e.target.value)),
2834
+ "aria-label": ariaLabel ?? label,
2835
+ "aria-valuemin": min,
2836
+ "aria-valuemax": max,
2837
+ "aria-valuenow": value,
2838
+ "aria-valuetext": ariaText,
2839
+ className: "relative z-10 h-5 w-full cursor-pointer appearance-none bg-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:shadow-lg dark:[&::-webkit-slider-thumb]:border-gray-900"
2840
+ }
2841
+ ),
2842
+ /* @__PURE__ */ jsx("style", { children: `[data-slider-id="${sliderId}"]::-webkit-slider-thumb { background: ${thumbColor}; box-shadow: 0 0 8px ${glow}; } [data-slider-id="${sliderId}"]::-moz-range-thumb { background: ${thumbColor}; border: 2px solid white; box-shadow: 0 0 8px ${glow}; }` })
2843
+ ] }),
2844
+ zones && zones.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-1 flex items-center justify-between", children: zones.map((z) => {
2845
+ const isActive = z.label === activeZone?.label;
2846
+ return /* @__PURE__ */ jsx(
2847
+ "span",
2848
+ {
2849
+ className: `text-[10px] font-medium transition-colors motion-reduce:transition-none ${isActive ? z.color : "text-gray-400 dark:text-gray-500"}`,
2850
+ children: z.label
2851
+ },
2852
+ z.label
2853
+ );
2854
+ }) })
2855
+ ] });
2856
+ }
2857
+ function hexToGlow(hex) {
2858
+ const m = /^#?([0-9a-f]{6})$/i.exec(hex);
2859
+ if (!m) return "rgba(99,102,241,0.5)";
2860
+ const int = parseInt(m[1], 16);
2861
+ const r = int >> 16 & 255;
2862
+ const g = int >> 8 & 255;
2863
+ const b = int & 255;
2864
+ return `rgba(${r},${g},${b},0.5)`;
2865
+ }
2781
2866
  function CreateAgentDialog({
2782
2867
  labels,
2783
2868
  models,
2869
+ connections,
2784
2870
  onClose,
2785
2871
  onSubmit
2786
2872
  }) {
2787
- const modelOptions = models.map((m) => ({ value: m.id, label: `${m.name} (${m.provider})` }));
2788
2873
  const [presetId, setPresetId] = useState("custom");
2789
2874
  const [emoji, setEmoji] = useState("\u2728");
2790
2875
  const [name, setName] = useState("");
2791
2876
  const [role, setRole] = useState("");
2877
+ const [description, setDescription] = useState("");
2792
2878
  const [systemPrompt, setSystemPrompt] = useState("");
2879
+ const [userPrompt, setUserPrompt] = useState("");
2793
2880
  const [temperature, setTemperature] = useState(0.2);
2794
2881
  const [maxTokens, setMaxTokens] = useState(2048);
2795
- const [modelId, setModelId] = useState(modelOptions[0]?.value ?? "");
2882
+ const [topP, setTopP] = useState(1);
2883
+ const [topK, setTopK] = useState(0);
2884
+ const [connectionId, setConnectionId] = useState("");
2885
+ const [framework, setFramework] = useState("");
2886
+ const [difficulty, setDifficulty] = useState("intermediate");
2887
+ const [tagsInput, setTagsInput] = useState("");
2888
+ const [outputSchema, setOutputSchema] = useState("");
2889
+ const [modelId, setModelId] = useState(models[0]?.id ?? "");
2796
2890
  const activePreset = AGENT_PRESETS.find((p) => p.id === presetId) ?? AGENT_PRESETS[AGENT_PRESETS.length - 1];
2891
+ const matchingModels = useMemo(() => {
2892
+ if (!connectionId) return models;
2893
+ const conn = connections.find((c) => c.id === connectionId);
2894
+ const slug = conn?.providerSlug;
2895
+ if (!slug) return models;
2896
+ const matches = models.filter(
2897
+ (m) => (m.provider ?? "") === slug || String(m.provider ?? "").startsWith(slug)
2898
+ );
2899
+ return matches.length > 0 ? matches : models;
2900
+ }, [models, connections, connectionId]);
2901
+ const modelOptions = matchingModels.map((m) => ({ value: m.id, label: `${m.name} (${m.provider})` }));
2902
+ const connectionOptions = useMemo(() => {
2903
+ const inline = { value: "", label: labels.connectionInline ?? "Inline model (no connection)" };
2904
+ return [
2905
+ inline,
2906
+ ...connections.map((c) => ({
2907
+ value: c.id,
2908
+ label: `${c.name}${c.providerSlug ? " \xB7 " + c.providerSlug : ""}`
2909
+ }))
2910
+ ];
2911
+ }, [connections, labels.connectionInline]);
2912
+ const frameworkOptions = useMemo(() => [
2913
+ { value: "", label: labels.connectionInline ?? "\u2014" },
2914
+ { value: "anthropic", label: labels.frameworkAnthropic ?? "Anthropic" },
2915
+ { value: "langchain", label: labels.frameworkLangChain ?? "LangChain" },
2916
+ { value: "crewai", label: labels.frameworkCrewAI ?? "CrewAI" },
2917
+ { value: "google-adk", label: labels.frameworkGoogleADK ?? "Google ADK" },
2918
+ { value: "openai", label: labels.frameworkOpenAI ?? "OpenAI" }
2919
+ ], [labels]);
2797
2920
  function applyPreset(preset) {
2798
2921
  setPresetId(preset.id);
2799
2922
  setEmoji(preset.emoji);
@@ -2803,6 +2926,7 @@ function CreateAgentDialog({
2803
2926
  setSystemPrompt(preset.systemPrompt);
2804
2927
  setTemperature(preset.temperature);
2805
2928
  setMaxTokens(preset.maxTokens);
2929
+ if (preset.framework) setFramework(preset.framework);
2806
2930
  }
2807
2931
  }
2808
2932
  return /* @__PURE__ */ jsx(
@@ -2826,12 +2950,24 @@ function CreateAgentDialog({
2826
2950
  submitLabel: labels.save,
2827
2951
  onSubmit: async (event) => {
2828
2952
  event.preventDefault();
2953
+ const parsedTags = tagsInput.split(",").map((t) => t.trim()).filter((t) => t.length > 0);
2829
2954
  await onSubmit({
2830
2955
  name: name.trim() || activePreset.name || "Untitled Agent",
2956
+ role: role.trim() || void 0,
2957
+ description: description.trim() || void 0,
2958
+ avatar: emoji,
2831
2959
  modelId,
2960
+ connectionId: connectionId || void 0,
2961
+ framework: framework || void 0,
2832
2962
  systemPrompt,
2963
+ userPrompt: userPrompt.trim() || void 0,
2833
2964
  maxTokens,
2834
- temperature
2965
+ temperature,
2966
+ topP,
2967
+ topK,
2968
+ difficulty: difficulty || void 0,
2969
+ tags: parsedTags.length > 0 ? parsedTags : void 0,
2970
+ outputSchema: outputSchema.trim() || void 0
2835
2971
  });
2836
2972
  },
2837
2973
  children: /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
@@ -2921,7 +3057,17 @@ function CreateAgentDialog({
2921
3057
  placeholder: labels.rolePlaceholder
2922
3058
  }
2923
3059
  )
2924
- ] })
3060
+ ] }),
3061
+ /* @__PURE__ */ jsx(
3062
+ FormTextarea,
3063
+ {
3064
+ label: labels.descriptionLabel ?? labels.description,
3065
+ value: description,
3066
+ onValueChange: setDescription,
3067
+ rows: 2,
3068
+ placeholder: labels.descriptionPlaceholder ?? "A short summary of what this agent does."
3069
+ }
3070
+ )
2925
3071
  ] })
2926
3072
  }
2927
3073
  ),
@@ -2930,21 +3076,30 @@ function CreateAgentDialog({
2930
3076
  {
2931
3077
  variant: "glass",
2932
3078
  header: {
2933
- title: labels.behaviorSection ?? "Behavior",
2934
- subtitle: labels.behaviorSubtitle ?? "System prompt shapes how the agent thinks"
3079
+ title: labels.modelSection ?? "Model and connection",
3080
+ subtitle: labels.connectionPickPrompt ?? "Pick the provider connection or use an inline model"
2935
3081
  },
2936
3082
  children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
2937
- /* @__PURE__ */ jsx(
2938
- FormTextarea,
2939
- {
2940
- label: labels.promptSystemPrompt ?? "System prompt",
2941
- value: systemPrompt,
2942
- onValueChange: setSystemPrompt,
2943
- rows: 5,
2944
- placeholder: labels.promptPlaceholder ?? "You are a helpful assistant\u2026"
2945
- }
2946
- ),
2947
3083
  /* @__PURE__ */ jsxs(FormGrid, { children: [
3084
+ /* @__PURE__ */ jsx(
3085
+ FormSelect,
3086
+ {
3087
+ label: labels.connectionLabel ?? labels.connection,
3088
+ value: connectionId,
3089
+ onValueChange: setConnectionId,
3090
+ options: connectionOptions,
3091
+ icon: /* @__PURE__ */ jsx(LinkIcon, { className: "h-4 w-4" })
3092
+ }
3093
+ ),
3094
+ /* @__PURE__ */ jsx(
3095
+ FormSelect,
3096
+ {
3097
+ label: labels.frameworkLabel ?? "Framework",
3098
+ value: framework,
3099
+ onValueChange: setFramework,
3100
+ options: frameworkOptions
3101
+ }
3102
+ ),
2948
3103
  /* @__PURE__ */ jsx(
2949
3104
  FormSelect,
2950
3105
  {
@@ -2953,31 +3108,212 @@ function CreateAgentDialog({
2953
3108
  onValueChange: setModelId,
2954
3109
  options: modelOptions.length > 0 ? modelOptions : [{ value: "", label: labels.modelEmpty }]
2955
3110
  }
2956
- ),
3111
+ )
3112
+ ] }),
3113
+ /* @__PURE__ */ jsx(
3114
+ FormTextarea,
3115
+ {
3116
+ label: labels.outputSchemaLabel ?? "Output schema (JSON)",
3117
+ value: outputSchema,
3118
+ onValueChange: setOutputSchema,
3119
+ rows: 4,
3120
+ placeholder: labels.outputSchemaPlaceholder ?? '{\n "type": "object",\n "properties": { "summary": { "type": "string" } }\n}'
3121
+ }
3122
+ )
3123
+ ] })
3124
+ }
3125
+ ),
3126
+ /* @__PURE__ */ jsx(
3127
+ SectionCard,
3128
+ {
3129
+ variant: "glass",
3130
+ header: {
3131
+ title: labels.behaviorSection ?? "Behavior",
3132
+ subtitle: labels.behaviorSubtitle ?? "System prompt shapes how the agent thinks"
3133
+ },
3134
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
3135
+ /* @__PURE__ */ jsxs("div", { children: [
3136
+ /* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center justify-between", children: [
3137
+ /* @__PURE__ */ jsx("label", { htmlFor: "create-agent-system-prompt", className: "text-xs font-medium text-gray-500 dark:text-gray-400", children: labels.promptSystemPrompt ?? "System prompt" }),
3138
+ /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: [
3139
+ systemPrompt.length,
3140
+ " chars"
3141
+ ] })
3142
+ ] }),
2957
3143
  /* @__PURE__ */ jsx(
2958
- FormInput,
3144
+ "textarea",
2959
3145
  {
2960
- label: labels.maxTokens,
2961
- type: "number",
2962
- value: String(maxTokens),
2963
- onValueChange: (v) => setMaxTokens(Number(v) || 0),
2964
- min: 1,
2965
- max: 32e3
3146
+ id: "create-agent-system-prompt",
3147
+ value: systemPrompt,
3148
+ onChange: (e) => setSystemPrompt(e.target.value),
3149
+ rows: 8,
3150
+ className: "w-full resize-y rounded-lg border border-gray-200/50 bg-gray-50/50 px-3 py-2.5 font-mono text-xs leading-relaxed text-gray-700 outline-none transition-colors placeholder:text-gray-400 focus:border-indigo-300/50 focus:ring-1 focus:ring-indigo-300/30 motion-reduce:transition-none dark:border-white/10 dark:bg-white/5 dark:text-gray-300 dark:placeholder:text-gray-500 dark:focus:border-indigo-500/30 dark:focus:ring-indigo-500/20",
3151
+ placeholder: labels.promptPlaceholder ?? "You are a helpful assistant\u2026"
2966
3152
  }
2967
- ),
3153
+ )
3154
+ ] }),
3155
+ /* @__PURE__ */ jsxs("div", { children: [
3156
+ /* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center justify-between", children: [
3157
+ /* @__PURE__ */ jsx("label", { htmlFor: "create-agent-user-prompt", className: "text-xs font-medium text-gray-500 dark:text-gray-400", children: labels.userPromptLabel ?? "User prompt template" }),
3158
+ /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: [
3159
+ userPrompt.length,
3160
+ " chars"
3161
+ ] })
3162
+ ] }),
2968
3163
  /* @__PURE__ */ jsx(
2969
- FormInput,
3164
+ "textarea",
3165
+ {
3166
+ id: "create-agent-user-prompt",
3167
+ value: userPrompt,
3168
+ onChange: (e) => setUserPrompt(e.target.value),
3169
+ rows: 5,
3170
+ className: "w-full resize-y rounded-lg border border-gray-200/50 bg-gray-50/50 px-3 py-2.5 font-mono text-xs leading-relaxed text-gray-700 outline-none transition-colors placeholder:text-gray-400 focus:border-indigo-300/50 focus:ring-1 focus:ring-indigo-300/30 motion-reduce:transition-none dark:border-white/10 dark:bg-white/5 dark:text-gray-300 dark:placeholder:text-gray-500 dark:focus:border-indigo-500/30 dark:focus:ring-indigo-500/20",
3171
+ placeholder: labels.userPromptPlaceholder ?? "Analyze {{ nodeId.path }} and produce a summary."
3172
+ }
3173
+ )
3174
+ ] }),
3175
+ /* @__PURE__ */ jsx(
3176
+ RangeSliderField,
3177
+ {
3178
+ sliderId: "create-agent-temperature",
3179
+ label: labels.temperature,
3180
+ value: temperature,
3181
+ onChange: setTemperature,
3182
+ min: 0,
3183
+ max: 1,
3184
+ step: 0.05,
3185
+ trackGradient: "linear-gradient(90deg, #3b82f6, #8b5cf6 50%, #ec4899)",
3186
+ formatValue: (v) => v.toFixed(2),
3187
+ zones: [
3188
+ { label: "Precise", max: 0.3, color: "text-blue-500", thumbColor: "#3b82f6" },
3189
+ { label: "Balanced", max: 0.7, color: "text-purple-500", thumbColor: "#8b5cf6" },
3190
+ { label: "Creative", max: 1, color: "text-pink-500", thumbColor: "#ec4899" }
3191
+ ]
3192
+ }
3193
+ ),
3194
+ /* @__PURE__ */ jsx(
3195
+ RangeSliderField,
3196
+ {
3197
+ sliderId: "create-agent-top-p",
3198
+ label: labels.topPLabel ?? "Top-P",
3199
+ value: topP,
3200
+ onChange: setTopP,
3201
+ min: 0,
3202
+ max: 1,
3203
+ step: 0.05,
3204
+ trackGradient: "linear-gradient(90deg, #6366f1, #8b5cf6)",
3205
+ formatValue: (v) => v.toFixed(2),
3206
+ zones: [
3207
+ { label: "Top-P", max: 1, color: "text-violet-500", thumbColor: "#8b5cf6" }
3208
+ ]
3209
+ }
3210
+ ),
3211
+ /* @__PURE__ */ jsx(
3212
+ RangeSliderField,
3213
+ {
3214
+ sliderId: "create-agent-top-k",
3215
+ label: labels.topKLabel ?? "Top-K",
3216
+ value: topK,
3217
+ onChange: (v) => setTopK(Math.max(0, Math.floor(v))),
3218
+ min: 0,
3219
+ max: 500,
3220
+ step: 1,
3221
+ trackGradient: "linear-gradient(90deg, #10b981, #14b8a6)",
3222
+ formatValue: (v) => v.toString(),
3223
+ zones: [
3224
+ { label: "Top-K", max: 500, color: "text-emerald-500", thumbColor: "#10b981" }
3225
+ ]
3226
+ }
3227
+ ),
3228
+ /* @__PURE__ */ jsxs("div", { children: [
3229
+ /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
3230
+ /* @__PURE__ */ jsx("label", { htmlFor: "create-agent-max-tokens", className: "text-xs font-medium text-gray-500 dark:text-gray-400", children: labels.maxTokens }),
3231
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-bold tabular-nums text-gray-900 dark:text-white", children: maxTokens.toLocaleString() })
3232
+ ] }),
3233
+ /* @__PURE__ */ jsx(
3234
+ "input",
2970
3235
  {
2971
- label: `${labels.temperature} (${temperature.toFixed(2)})`,
3236
+ id: "create-agent-max-tokens",
2972
3237
  type: "number",
2973
- value: String(temperature),
2974
- onValueChange: (v) => setTemperature(Number(v) || 0),
2975
- step: 0.1,
2976
- min: 0,
2977
- max: 2
3238
+ value: maxTokens,
3239
+ onChange: (e) => setMaxTokens(Math.max(1, Math.floor(Number(e.target.value) || 0))),
3240
+ min: 1,
3241
+ max: 32e3,
3242
+ step: 1,
3243
+ className: "w-full rounded-lg border border-gray-200/50 bg-gray-50/50 px-3 py-2.5 text-sm tabular-nums text-gray-700 outline-none transition-colors focus:border-indigo-300/50 focus:ring-1 focus:ring-indigo-300/30 motion-reduce:transition-none dark:border-white/10 dark:bg-white/5 dark:text-gray-300 dark:focus:border-indigo-500/30 dark:focus:ring-indigo-500/20"
2978
3244
  }
2979
3245
  )
2980
- ] })
3246
+ ] }),
3247
+ /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-lg border border-gray-200/30 dark:border-white/10", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-px bg-gray-200/30 dark:bg-white/10", children: [
3248
+ /* @__PURE__ */ jsxs("div", { className: "bg-white/60 px-3 py-2 dark:bg-gray-900/60", children: [
3249
+ /* @__PURE__ */ jsx("p", { className: "text-[9px] uppercase tracking-wider text-gray-400 dark:text-gray-500", children: labels.model }),
3250
+ /* @__PURE__ */ jsx("p", { className: "truncate text-xs font-semibold text-gray-900 dark:text-white", children: matchingModels.find((m) => m.id === modelId)?.name ?? labels.modelEmpty })
3251
+ ] }),
3252
+ /* @__PURE__ */ jsxs("div", { className: "bg-white/60 px-3 py-2 dark:bg-gray-900/60", children: [
3253
+ /* @__PURE__ */ jsx("p", { className: "text-[9px] uppercase tracking-wider text-gray-400 dark:text-gray-500", children: labels.maxTokens }),
3254
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-gray-900 dark:text-white", children: maxTokens.toLocaleString() })
3255
+ ] }),
3256
+ /* @__PURE__ */ jsxs("div", { className: "bg-white/60 px-3 py-2 dark:bg-gray-900/60", children: [
3257
+ /* @__PURE__ */ jsx("p", { className: "text-[9px] uppercase tracking-wider text-gray-400 dark:text-gray-500", children: labels.temperature }),
3258
+ /* @__PURE__ */ jsxs("p", { className: `text-xs font-semibold ${temperature <= 0.3 ? "text-blue-500" : temperature <= 0.7 ? "text-purple-500" : "text-pink-500"}`, children: [
3259
+ temperature.toFixed(2),
3260
+ " \xB7 ",
3261
+ temperature <= 0.3 ? "Precise" : temperature <= 0.7 ? "Balanced" : "Creative"
3262
+ ] })
3263
+ ] })
3264
+ ] }) })
3265
+ ] })
3266
+ }
3267
+ ),
3268
+ /* @__PURE__ */ jsx(
3269
+ SectionCard,
3270
+ {
3271
+ variant: "glass",
3272
+ header: {
3273
+ title: labels.metadataSection ?? "Metadata",
3274
+ subtitle: labels.metadataSubtitle ?? "Difficulty tier and free-form tags"
3275
+ },
3276
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
3277
+ /* @__PURE__ */ jsxs("div", { children: [
3278
+ /* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.difficultyLabel ?? "Difficulty" }),
3279
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-4", children: DIFFICULTY_OPTIONS.map((opt) => {
3280
+ const selected = difficulty === opt.id;
3281
+ const label = opt.id === "beginner" ? labels.difficultyBeginner ?? "Beginner" : opt.id === "intermediate" ? labels.difficultyIntermediate ?? "Intermediate" : opt.id === "advanced" ? labels.difficultyAdvanced ?? "Advanced" : labels.difficultyExpert ?? "Expert";
3282
+ return /* @__PURE__ */ jsxs(
3283
+ "button",
3284
+ {
3285
+ type: "button",
3286
+ onClick: () => setDifficulty(opt.id),
3287
+ "aria-pressed": selected,
3288
+ className: [
3289
+ "liquid-surface flex items-center gap-2 rounded-xl px-3 py-2 text-left transition-all",
3290
+ selected ? "ring-2 ring-indigo-500/70 ring-offset-1 ring-offset-transparent" : "hover:border-indigo-400/40 focus-visible:ring-2 focus-visible:ring-indigo-500/70 focus-visible:ring-offset-1"
3291
+ ].join(" "),
3292
+ children: [
3293
+ /* @__PURE__ */ jsx(
3294
+ "span",
3295
+ {
3296
+ "aria-hidden": "true",
3297
+ className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br ${opt.accent} text-base shadow-sm`,
3298
+ children: opt.emoji
3299
+ }
3300
+ ),
3301
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-slate-900 dark:text-white", children: label })
3302
+ ]
3303
+ },
3304
+ opt.id
3305
+ );
3306
+ }) })
3307
+ ] }),
3308
+ /* @__PURE__ */ jsx(
3309
+ FormInput,
3310
+ {
3311
+ label: labels.tagsLabel ?? "Tags",
3312
+ value: tagsInput,
3313
+ onValueChange: setTagsInput,
3314
+ placeholder: labels.tagsPlaceholder ?? "comma, separated, tags"
3315
+ }
3316
+ )
2981
3317
  ] })
2982
3318
  }
2983
3319
  )