@datatechsolutions/ui 2.11.17 → 2.11.19
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.
- package/dist/astrlabe/contracts.d.mts +1 -1
- package/dist/astrlabe/contracts.d.ts +1 -1
- package/dist/astrlabe/index.js +260 -220
- package/dist/astrlabe/index.js.map +1 -1
- package/dist/astrlabe/index.mjs +162 -122
- package/dist/astrlabe/index.mjs.map +1 -1
- package/dist/astrlabe/workflow-canvas.js +2 -2
- package/dist/astrlabe/workflow-canvas.mjs +1 -1
- package/dist/{chunk-PNN6KWXQ.js → chunk-4X7ITYP2.js} +113 -16
- package/dist/chunk-4X7ITYP2.js.map +1 -0
- package/dist/{chunk-57OBMWRA.mjs → chunk-LIYKHVLG.mjs} +113 -16
- package/dist/chunk-LIYKHVLG.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-57OBMWRA.mjs.map +0 -1
- package/dist/chunk-PNN6KWXQ.js.map +0 -1
package/dist/astrlabe/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import '../chunk-JB6RNAD2.mjs';
|
|
3
3
|
export { topologicalSortAgents, validateWorkflowGraph } from '../chunk-BLNXRUC4.mjs';
|
|
4
|
-
import { Workspace, useModalStore, CATEGORY_COLORS, CATEGORY_PILL_COLORS, ICON_MAP, WorkflowCanvas, getEntityIcon, getEntityGradient, useWorkflowStore, LOGIC_ICON_MAP, LOGIC_NODE_GRADIENTS, getFrameworkMeta, getCompatibleModels, isModelCompatibleWithFramework, FRAMEWORK_META } from '../chunk-
|
|
5
|
-
export { AgentFlowNode, AgentToolFlowNode, AnswerFlowNode, AnthropicIcon, CodeFlowNode, CrewAIIcon, DocumentExtractorFlowNode, EndFlowNode, EntityFlowNode, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, HttpRequestFlowNode, IfElseFlowNode, IterationFlowNode, IterationStartFlowNode, KnowledgeBaseFlowNode, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, ListOperatorFlowNode, LogicNodeModal, MINIMAP_NODE_COLORS, ModelProviderFlowNode, NodeCard, NodeContextMenu, NoteFlowNode, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, QuestionClassifierFlowNode, RuleFlowNode, SelectionContextMenu, StartFlowNode, StrandsIcon, TemplateTransformFlowNode, ToolFlowNode, VariableAggregatorFlowNode, VariableAssignerFlowNode, WorkflowBuilderProvider, Workspace, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, isModelCompatibleWithFramework, useModalStore, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore } from '../chunk-
|
|
6
|
-
import { GlassModalShell, Button, FormInput, FormTextarea, GlassFormModal, Input, DynamicIslandConfirm } from '../chunk-46ZM5VJJ.mjs';
|
|
4
|
+
import { Workspace, useModalStore, CATEGORY_COLORS, CATEGORY_PILL_COLORS, ICON_MAP, WorkflowCanvas, getEntityIcon, getEntityGradient, useWorkflowStore, LOGIC_ICON_MAP, LOGIC_NODE_GRADIENTS, getFrameworkMeta, getCompatibleModels, isModelCompatibleWithFramework, FRAMEWORK_META } from '../chunk-LIYKHVLG.mjs';
|
|
5
|
+
export { AgentFlowNode, AgentToolFlowNode, AnswerFlowNode, AnthropicIcon, CodeFlowNode, CrewAIIcon, DocumentExtractorFlowNode, EndFlowNode, EntityFlowNode, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, HttpRequestFlowNode, IfElseFlowNode, IterationFlowNode, IterationStartFlowNode, KnowledgeBaseFlowNode, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, ListOperatorFlowNode, LogicNodeModal, MINIMAP_NODE_COLORS, ModelProviderFlowNode, NodeCard, NodeContextMenu, NoteFlowNode, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, QuestionClassifierFlowNode, RuleFlowNode, SelectionContextMenu, StartFlowNode, StrandsIcon, TemplateTransformFlowNode, ToolFlowNode, VariableAggregatorFlowNode, VariableAssignerFlowNode, WorkflowBuilderProvider, Workspace, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, isModelCompatibleWithFramework, useModalStore, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore } from '../chunk-LIYKHVLG.mjs';
|
|
6
|
+
import { SettingsDialog, GlassModalShell, Button, FormInput, FormTextarea, GlassFormModal, Input, DynamicIslandConfirm } from '../chunk-46ZM5VJJ.mjs';
|
|
7
7
|
import '../chunk-QWG2FMUN.mjs';
|
|
8
8
|
import '../chunk-D2JF6C3E.mjs';
|
|
9
9
|
export { GraphNodeBadge, GraphNodeHeader, GraphNodeIconBubble, GraphNodeMeta } from '../chunk-OZNTQROP.mjs';
|
|
@@ -11,7 +11,7 @@ import { getAgentTier, createDefaultLogicNodeConfig } from '../chunk-TLPPVL3W.mj
|
|
|
11
11
|
export { applyDagreLayout, createDefaultLogicNodeConfig, getAgentTier } from '../chunk-TLPPVL3W.mjs';
|
|
12
12
|
import { useTranslations } from '../chunk-7VJ7CMMT.mjs';
|
|
13
13
|
import { memo, useCallback, useState, useEffect, useMemo, useRef, Children } from 'react';
|
|
14
|
-
import {
|
|
14
|
+
import { UserCircleIcon, Cog6ToothIcon, SparklesIcon, CommandLineIcon, KeyIcon, PlayCircleIcon, ArrowPathRoundedSquareIcon, ArrowsPointingOutIcon, ArrowsPointingInIcon, BoltIcon, ClockIcon, CheckIcon, CpuChipIcon, AdjustmentsHorizontalIcon, CircleStackIcon, TrashIcon, PlusIcon, XMarkIcon, EyeIcon, ArrowPathIcon, PlayIcon, StopIcon, XCircleIcon, CheckCircleIcon, VariableIcon, ChevronDownIcon, ChevronRightIcon, ExclamationCircleIcon, ClipboardDocumentIcon, ArrowDownTrayIcon, ArrowUpTrayIcon, ExclamationTriangleIcon } from '@heroicons/react/24/outline';
|
|
15
15
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
16
16
|
import { create } from 'zustand';
|
|
17
17
|
|
|
@@ -358,23 +358,7 @@ function AgentCapabilityCard({ elo, setElo, models, selectedModelId, setSelected
|
|
|
358
358
|
] })
|
|
359
359
|
] });
|
|
360
360
|
}
|
|
361
|
-
function ConfigTab({
|
|
362
|
-
const [promptText, setPromptText] = useState(agent.systemPrompt ?? "");
|
|
363
|
-
const handleTemperatureChange = useCallback((event) => {
|
|
364
|
-
setTemperature(parseFloat(event.target.value));
|
|
365
|
-
markDirty();
|
|
366
|
-
}, []);
|
|
367
|
-
const handlePromptChange = useCallback((event) => {
|
|
368
|
-
setPromptText(event.target.value);
|
|
369
|
-
markDirty();
|
|
370
|
-
}, []);
|
|
371
|
-
useCallback(() => {
|
|
372
|
-
markSaved();
|
|
373
|
-
}, [markSaved]);
|
|
374
|
-
const temperaturePercent = temperature * 100;
|
|
375
|
-
const isPrecise = temperature <= 0.3;
|
|
376
|
-
const isBalanced = temperature > 0.3 && temperature <= 0.7;
|
|
377
|
-
const isCreative = temperature > 0.7;
|
|
361
|
+
function ConfigTab({ models, t, selectedModelId, setSelectedModelId, selectedFramework, setSelectedFramework, markDirty }) {
|
|
378
362
|
const frameworkKeys = Object.keys(FRAMEWORK_META);
|
|
379
363
|
const compatibleModels = getCompatibleModels(models, selectedFramework);
|
|
380
364
|
const handleFrameworkChange = useCallback((newFramework) => {
|
|
@@ -446,7 +430,24 @@ function ConfigTab({ agent, models, t, selectedModelId, setSelectedModelId, sele
|
|
|
446
430
|
model.id
|
|
447
431
|
);
|
|
448
432
|
}) })
|
|
449
|
-
] })
|
|
433
|
+
] })
|
|
434
|
+
] });
|
|
435
|
+
}
|
|
436
|
+
function PromptTab({ agent, temperature, setTemperature, markDirty, t }) {
|
|
437
|
+
const [promptText, setPromptText] = useState(agent.systemPrompt ?? "");
|
|
438
|
+
const handleTemperatureChange = useCallback((event) => {
|
|
439
|
+
setTemperature(parseFloat(event.target.value));
|
|
440
|
+
markDirty();
|
|
441
|
+
}, []);
|
|
442
|
+
const handlePromptChange = useCallback((event) => {
|
|
443
|
+
setPromptText(event.target.value);
|
|
444
|
+
markDirty();
|
|
445
|
+
}, []);
|
|
446
|
+
const temperaturePercent = temperature * 100;
|
|
447
|
+
const isPrecise = temperature <= 0.3;
|
|
448
|
+
const isBalanced = temperature > 0.3 && temperature <= 0.7;
|
|
449
|
+
const isCreative = temperature > 0.7;
|
|
450
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-5 p-4", children: [
|
|
450
451
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
451
452
|
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
452
453
|
/* @__PURE__ */ jsx("label", { className: "text-xs font-medium text-gray-500 dark:text-gray-400", children: t("agentDrawer.temperature") }),
|
|
@@ -457,10 +458,7 @@ function ConfigTab({ agent, models, t, selectedModelId, setSelectedModelId, sele
|
|
|
457
458
|
"div",
|
|
458
459
|
{
|
|
459
460
|
className: "h-full rounded-full transition-all duration-300 ease-out",
|
|
460
|
-
style: {
|
|
461
|
-
width: `${temperaturePercent}%`,
|
|
462
|
-
background: `linear-gradient(90deg, #3b82f6, #8b5cf6 50%, #ec4899)`
|
|
463
|
-
}
|
|
461
|
+
style: { width: `${temperaturePercent}%`, background: "linear-gradient(90deg, #3b82f6, #8b5cf6 50%, #ec4899)" }
|
|
464
462
|
}
|
|
465
463
|
) }),
|
|
466
464
|
/* @__PURE__ */ jsx(
|
|
@@ -473,24 +471,12 @@ function ConfigTab({ agent, models, t, selectedModelId, setSelectedModelId, sele
|
|
|
473
471
|
value: temperature,
|
|
474
472
|
onChange: handleTemperatureChange,
|
|
475
473
|
"aria-label": t("agentDrawer.temperature"),
|
|
476
|
-
"aria-valuemin": 0,
|
|
477
|
-
"aria-valuemax": 1,
|
|
478
474
|
"aria-valuenow": temperature,
|
|
479
475
|
"aria-valuetext": `${temperature.toFixed(2)} \u2014 ${isPrecise ? t("agentDrawer.precise") : isBalanced ? t("agentDrawer.balanced") : t("agentDrawer.creative")}`,
|
|
480
|
-
className: "relative z-10 h-5 w-full cursor-pointer appearance-none bg-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:shadow-lg dark:[&::-webkit-slider-thumb]:border-gray-900"
|
|
481
|
-
style: {
|
|
482
|
-
// Thumb color based on temperature zone
|
|
483
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
484
|
-
["--thumb-color"]: isPrecise ? "#3b82f6" : isBalanced ? "#8b5cf6" : "#ec4899"
|
|
485
|
-
}
|
|
476
|
+
className: "relative z-10 h-5 w-full cursor-pointer appearance-none bg-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:shadow-lg dark:[&::-webkit-slider-thumb]:border-gray-900"
|
|
486
477
|
}
|
|
487
478
|
),
|
|
488
|
-
/* @__PURE__ */ jsx("style", { children: `
|
|
489
|
-
input[type="range"]::-webkit-slider-thumb {
|
|
490
|
-
background: ${isPrecise ? "#3b82f6" : isBalanced ? "#8b5cf6" : "#ec4899"};
|
|
491
|
-
box-shadow: 0 0 8px ${isPrecise ? "rgba(59,130,246,0.5)" : isBalanced ? "rgba(139,92,246,0.5)" : "rgba(236,72,153,0.5)"};
|
|
492
|
-
}
|
|
493
|
-
` })
|
|
479
|
+
/* @__PURE__ */ jsx("style", { children: `input[type="range"]::-webkit-slider-thumb { background: ${isPrecise ? "#3b82f6" : isBalanced ? "#8b5cf6" : "#ec4899"}; box-shadow: 0 0 8px ${isPrecise ? "rgba(59,130,246,0.5)" : isBalanced ? "rgba(139,92,246,0.5)" : "rgba(236,72,153,0.5)"}; }` })
|
|
494
480
|
] }),
|
|
495
481
|
/* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center justify-between", children: [
|
|
496
482
|
/* @__PURE__ */ jsx("span", { className: `text-[10px] font-medium transition-colors ${isPrecise ? "text-blue-500" : "text-gray-400 dark:text-gray-500"}`, children: t("agentDrawer.precise") }),
|
|
@@ -511,7 +497,7 @@ function ConfigTab({ agent, models, t, selectedModelId, setSelectedModelId, sele
|
|
|
511
497
|
{
|
|
512
498
|
value: promptText,
|
|
513
499
|
onChange: handlePromptChange,
|
|
514
|
-
rows:
|
|
500
|
+
rows: 12,
|
|
515
501
|
className: "w-full resize-y rounded-lg border border-gray-200/50 bg-gray-50/50 px-3 py-2.5 font-mono text-xs leading-relaxed text-gray-700 outline-none transition-colors placeholder:text-gray-400 focus:border-indigo-300/50 focus:ring-1 focus:ring-indigo-300/30 dark:border-white/10 dark:bg-white/5 dark:text-gray-300 dark:placeholder:text-gray-500 dark:focus:border-indigo-500/30 dark:focus:ring-indigo-500/20",
|
|
516
502
|
placeholder: t("agentDrawer.systemPromptPlaceholder")
|
|
517
503
|
}
|
|
@@ -560,7 +546,7 @@ var PROVIDER_LOGOS = {
|
|
|
560
546
|
azure_openai: SI("microsoftazure", "0078D4"),
|
|
561
547
|
anthropic_api: SI("anthropic", "D4A27F")
|
|
562
548
|
};
|
|
563
|
-
function ModelsTab({ modelProviders, selectedProviderId, onSelectProvider, t }) {
|
|
549
|
+
function ModelsTab({ modelProviders, selectedProviderId, onSelectProvider, models, selectedModelId, onSelectModel, agentFramework, t }) {
|
|
564
550
|
if (modelProviders.length === 0) {
|
|
565
551
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center px-4 py-12 text-center", children: [
|
|
566
552
|
/* @__PURE__ */ jsx(KeyIcon, { className: "mb-2 h-8 w-8 text-gray-400 dark:text-gray-500" }),
|
|
@@ -568,35 +554,87 @@ function ModelsTab({ modelProviders, selectedProviderId, onSelectProvider, t })
|
|
|
568
554
|
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-gray-400 dark:text-gray-500", children: t("agentDrawer.dragProviderHint") })
|
|
569
555
|
] });
|
|
570
556
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
return /* @__PURE__ */ jsxs(
|
|
577
|
-
"button",
|
|
578
|
-
{
|
|
579
|
-
type: "button",
|
|
580
|
-
onClick: () => onSelectProvider(provider.id),
|
|
581
|
-
className: `flex w-full items-center gap-3 rounded-xl border px-4 py-3 text-left transition-all ${isSelected ? "border-rose-500/30 bg-rose-50/50 ring-1 ring-rose-500/20 dark:border-rose-400/20 dark:bg-rose-500/5" : "border-gray-200/50 bg-gray-50/30 hover:border-gray-300 dark:border-white/10 dark:bg-white/[0.02] dark:hover:border-white/20"}`,
|
|
582
|
-
children: [
|
|
583
|
-
logo ? /* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-white/10 p-1.5", children: /* @__PURE__ */ jsx("img", { src: logo, alt: "", className: "h-6 w-6 object-contain", loading: "lazy" }) }) : /* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-rose-500 to-pink-600", children: /* @__PURE__ */ jsx(KeyIcon, { className: "h-5 w-5 text-white" }) }),
|
|
584
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
585
|
-
/* @__PURE__ */ jsx("p", { className: `text-sm font-medium ${isSelected ? "text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`, children: provider.name }),
|
|
586
|
-
/* @__PURE__ */ jsxs("div", { className: "mt-0.5 flex items-center gap-2 text-[10px] text-gray-400 dark:text-gray-500", children: [
|
|
587
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
588
|
-
provider.modelCount,
|
|
589
|
-
" models"
|
|
590
|
-
] }),
|
|
591
|
-
/* @__PURE__ */ jsx("span", { className: `rounded-full px-1.5 py-0.5 text-[9px] font-medium ${provider.configured ? "bg-green-100 text-green-600 dark:bg-green-500/10 dark:text-green-400" : "bg-amber-100 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400"}`, children: provider.configured ? t("agentDrawer.providerConfigured") : t("agentDrawer.providerSetup") })
|
|
592
|
-
] })
|
|
593
|
-
] }),
|
|
594
|
-
/* @__PURE__ */ jsx("div", { className: `flex h-5 w-5 shrink-0 items-center justify-center rounded-full transition-all ${isSelected ? "bg-rose-500 text-white" : "border border-gray-300 dark:border-gray-600"}`, children: isSelected && /* @__PURE__ */ jsx(CheckIcon, { className: "h-3 w-3" }) })
|
|
595
|
-
]
|
|
596
|
-
},
|
|
597
|
-
provider.id
|
|
598
|
-
);
|
|
557
|
+
const modelsByProvider = modelProviders.map((provider) => ({
|
|
558
|
+
provider,
|
|
559
|
+
models: models.filter((m) => {
|
|
560
|
+
const modelProvider = m.id.split(".")[0];
|
|
561
|
+
return provider.provider === modelProvider || provider.provider === "amazon" && modelProvider === "anthropic" || provider.provider === "amazon" && modelProvider === "amazon" || provider.provider === "amazon" && modelProvider === "meta";
|
|
599
562
|
})
|
|
563
|
+
}));
|
|
564
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4 p-4", children: [
|
|
565
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
566
|
+
/* @__PURE__ */ jsx("label", { className: "mb-2 block text-xs font-medium text-gray-500 dark:text-gray-400", children: t("agentDrawer.selectProvider") }),
|
|
567
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-1.5", children: modelProviders.map((provider) => {
|
|
568
|
+
const isSelected = selectedProviderId === provider.id;
|
|
569
|
+
const logo = PROVIDER_LOGOS[provider.provider];
|
|
570
|
+
return /* @__PURE__ */ jsxs(
|
|
571
|
+
"button",
|
|
572
|
+
{
|
|
573
|
+
type: "button",
|
|
574
|
+
onClick: () => onSelectProvider(provider.id),
|
|
575
|
+
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"}`,
|
|
576
|
+
children: [
|
|
577
|
+
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" }) }),
|
|
578
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
579
|
+
/* @__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 }),
|
|
580
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-gray-400 dark:text-gray-500", children: [
|
|
581
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
582
|
+
provider.modelCount,
|
|
583
|
+
" models"
|
|
584
|
+
] }),
|
|
585
|
+
provider.configured && /* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 rounded-full bg-green-500" })
|
|
586
|
+
] })
|
|
587
|
+
] }),
|
|
588
|
+
/* @__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" }) })
|
|
589
|
+
]
|
|
590
|
+
},
|
|
591
|
+
provider.id
|
|
592
|
+
);
|
|
593
|
+
}) })
|
|
594
|
+
] }),
|
|
595
|
+
selectedProviderId && (() => {
|
|
596
|
+
const providerModels = modelsByProvider.find((p) => p.provider.id === selectedProviderId);
|
|
597
|
+
if (!providerModels || providerModels.models.length === 0) return /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-400 dark:text-gray-500", children: t("agentDrawer.noModelsForProvider") });
|
|
598
|
+
const compatibleModels = providerModels.models.filter(
|
|
599
|
+
(m) => isModelCompatibleWithFramework(m.id, agentFramework)
|
|
600
|
+
);
|
|
601
|
+
const incompatibleModels = providerModels.models.filter(
|
|
602
|
+
(m) => !isModelCompatibleWithFramework(m.id, agentFramework)
|
|
603
|
+
);
|
|
604
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
605
|
+
/* @__PURE__ */ jsx("label", { className: "mb-2 block text-xs font-medium text-gray-500 dark:text-gray-400", children: t("agentDrawer.selectModel") }),
|
|
606
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
607
|
+
compatibleModels.map((model) => {
|
|
608
|
+
const isSelected = selectedModelId === model.id;
|
|
609
|
+
const { IconComponent, color, providerLabel } = getModelIcon(model.id);
|
|
610
|
+
return /* @__PURE__ */ jsxs(
|
|
611
|
+
"button",
|
|
612
|
+
{
|
|
613
|
+
type: "button",
|
|
614
|
+
onClick: () => onSelectModel(model.id),
|
|
615
|
+
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"}`,
|
|
616
|
+
children: [
|
|
617
|
+
/* @__PURE__ */ jsx(IconComponent, { className: `h-4 w-4 flex-shrink-0 ${isSelected ? color : "text-gray-400 dark:text-gray-500"}` }),
|
|
618
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
619
|
+
/* @__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 }),
|
|
620
|
+
/* @__PURE__ */ jsx("p", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: providerLabel })
|
|
621
|
+
] }),
|
|
622
|
+
isSelected && /* @__PURE__ */ jsx(CheckIcon, { className: "h-3.5 w-3.5 shrink-0 text-indigo-500" })
|
|
623
|
+
]
|
|
624
|
+
},
|
|
625
|
+
model.id
|
|
626
|
+
);
|
|
627
|
+
}),
|
|
628
|
+
incompatibleModels.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
629
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2 mb-1 text-[9px] font-medium text-gray-400 dark:text-gray-500", children: t("agentDrawer.incompatibleWithFramework") }),
|
|
630
|
+
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: [
|
|
631
|
+
/* @__PURE__ */ jsx(CpuChipIcon, { className: "h-4 w-4 text-gray-400" }),
|
|
632
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500", children: model.name })
|
|
633
|
+
] }, model.id))
|
|
634
|
+
] })
|
|
635
|
+
] })
|
|
636
|
+
] });
|
|
637
|
+
})()
|
|
600
638
|
] });
|
|
601
639
|
}
|
|
602
640
|
function ToolsTab({ agentTools, enabledToolIds, onToggle, agentFramework, t }) {
|
|
@@ -660,7 +698,7 @@ function AgentModal({ onSaved }) {
|
|
|
660
698
|
const models = agentData?.models ?? [];
|
|
661
699
|
const availableAgentTools = agentData?.agentTools ?? [];
|
|
662
700
|
const isCreateMode = agentData?.isCreateMode ?? false;
|
|
663
|
-
const [activeTab, setActiveTab] = useState("
|
|
701
|
+
const [activeTab, setActiveTab] = useState("profile");
|
|
664
702
|
const [selectedModelId, setSelectedModelId] = useState("");
|
|
665
703
|
const [selectedFramework, setSelectedFramework] = useState("custom");
|
|
666
704
|
const [temperature, setTemperature] = useState(0.7);
|
|
@@ -677,7 +715,7 @@ function AgentModal({ onSaved }) {
|
|
|
677
715
|
setTemperature(agent.temperature ?? 0.7);
|
|
678
716
|
setElo(Number(agent.elo ?? 1e3));
|
|
679
717
|
setSaved(!isCreateMode);
|
|
680
|
-
setActiveTab("
|
|
718
|
+
setActiveTab("profile");
|
|
681
719
|
const agentToolIds = agent.agentToolIds;
|
|
682
720
|
setEnabledToolIds(new Set(agentToolIds ?? availableAgentTools.filter((t2) => t2.enabled).map((t2) => t2.agentToolId)));
|
|
683
721
|
setSelectedProviderId(agent.modelProviderId ?? "");
|
|
@@ -706,64 +744,66 @@ function AgentModal({ onSaved }) {
|
|
|
706
744
|
onSaved?.();
|
|
707
745
|
}, [markSaved, onSaved]);
|
|
708
746
|
if (!agent) return null;
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
"
|
|
712
|
-
{
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
type: "button",
|
|
731
|
-
onClick: handleClose,
|
|
732
|
-
className: "rounded-lg border border-gray-200/50 px-4 py-2 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100/50 dark:border-white/10 dark:text-gray-300 dark:hover:bg-white/5",
|
|
733
|
-
children: t("agentDrawer.cancel")
|
|
734
|
-
}
|
|
735
|
-
),
|
|
736
|
-
/* @__PURE__ */ jsx(
|
|
737
|
-
"button",
|
|
738
|
-
{
|
|
739
|
-
type: "button",
|
|
740
|
-
onClick: handleMarkSaved,
|
|
741
|
-
disabled: !dirty,
|
|
742
|
-
className: `rounded-lg px-4 py-2 text-xs font-semibold text-white shadow-sm transition-all ${dirty ? "bg-gradient-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600" : "cursor-not-allowed bg-gray-300 dark:bg-gray-700"}`,
|
|
743
|
-
children: t("agentDrawer.save")
|
|
744
|
-
}
|
|
745
|
-
)
|
|
746
|
-
] })
|
|
747
|
+
const sections = [
|
|
748
|
+
{ id: "profile", label: t("agentDrawer.profileSection"), icon: UserCircleIcon, group: t("agentDrawer.agentGroup") },
|
|
749
|
+
{ id: "framework", label: t("agentDrawer.frameworkSection"), icon: Cog6ToothIcon, group: t("agentDrawer.agentGroup") },
|
|
750
|
+
{ id: "prompt", label: t("agentDrawer.promptSection"), icon: SparklesIcon, group: t("agentDrawer.agentGroup") },
|
|
751
|
+
{ id: "tools", label: `${t("agentDrawer.toolsTab")}${enabledToolIds.size > 0 ? ` (${enabledToolIds.size})` : ""}`, icon: CommandLineIcon, group: t("agentDrawer.configGroup") },
|
|
752
|
+
{ id: "models", label: `${t("agentDrawer.modelsTab")}${selectedProviderId ? " \u2713" : ""}`, icon: KeyIcon, group: t("agentDrawer.configGroup") },
|
|
753
|
+
{ id: "results", label: t("agentDrawer.resultsTab"), icon: PlayCircleIcon, group: t("agentDrawer.executionGroup") }
|
|
754
|
+
];
|
|
755
|
+
const avatarUrl = agent.avatar;
|
|
756
|
+
const sidebarFooter = /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-4 py-3", children: [
|
|
757
|
+
/* @__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") }) }),
|
|
758
|
+
/* @__PURE__ */ jsx(
|
|
759
|
+
"button",
|
|
760
|
+
{
|
|
761
|
+
type: "button",
|
|
762
|
+
onClick: handleMarkSaved,
|
|
763
|
+
disabled: !dirty,
|
|
764
|
+
className: `rounded-lg px-3 py-1.5 text-xs font-semibold text-white shadow-sm transition-all ${dirty ? "bg-gradient-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600" : "cursor-not-allowed bg-gray-300 dark:bg-gray-700"}`,
|
|
765
|
+
children: t("agentDrawer.save")
|
|
766
|
+
}
|
|
767
|
+
)
|
|
747
768
|
] });
|
|
748
769
|
return /* @__PURE__ */ jsxs(
|
|
749
|
-
|
|
770
|
+
SettingsDialog,
|
|
750
771
|
{
|
|
751
772
|
open,
|
|
752
773
|
onClose: handleClose,
|
|
753
774
|
title: agent.name,
|
|
754
|
-
subtitle:
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
775
|
+
subtitle: isCreateMode ? t("agentDrawer.createAgent") : t("agentDrawer.editAgent"),
|
|
776
|
+
sections,
|
|
777
|
+
activeSectionId: activeTab,
|
|
778
|
+
onSectionChange: (sectionId) => setActiveTab(sectionId),
|
|
779
|
+
identity: {
|
|
780
|
+
displayName: agent.name,
|
|
781
|
+
profileInitial: agent.name.charAt(0).toUpperCase(),
|
|
782
|
+
avatarUrl,
|
|
783
|
+
role: agent.role
|
|
784
|
+
},
|
|
785
|
+
sidebarFooter,
|
|
762
786
|
children: [
|
|
763
|
-
/* @__PURE__ */ jsx(AgentProfileHeader, { agent, models, t, selectedModelId, setSelectedModelId, selectedFramework, temperature, setTemperature, elo, setElo, onChanged: markDirty }),
|
|
764
|
-
activeTab === "
|
|
787
|
+
activeTab === "profile" && /* @__PURE__ */ jsx(AgentProfileHeader, { agent, models, t, selectedModelId, setSelectedModelId, selectedFramework, temperature, setTemperature, elo, setElo, onChanged: markDirty }),
|
|
788
|
+
activeTab === "framework" && /* @__PURE__ */ jsx(ConfigTab, { models, t, selectedModelId, setSelectedModelId, selectedFramework, setSelectedFramework: (fw) => setSelectedFramework(fw), markDirty }),
|
|
789
|
+
activeTab === "prompt" && /* @__PURE__ */ jsx(PromptTab, { agent, temperature, setTemperature, markDirty, t }),
|
|
765
790
|
activeTab === "tools" && /* @__PURE__ */ jsx(ToolsTab, { agentTools: availableAgentTools, enabledToolIds, onToggle: handleToggleTool, agentFramework: selectedFramework, t }),
|
|
766
|
-
activeTab === "models" && /* @__PURE__ */ jsx(
|
|
791
|
+
activeTab === "models" && /* @__PURE__ */ jsx(
|
|
792
|
+
ModelsTab,
|
|
793
|
+
{
|
|
794
|
+
modelProviders: availableModelProviders,
|
|
795
|
+
selectedProviderId,
|
|
796
|
+
onSelectProvider: handleSelectProvider,
|
|
797
|
+
models,
|
|
798
|
+
selectedModelId,
|
|
799
|
+
onSelectModel: (modelId) => {
|
|
800
|
+
setSelectedModelId(modelId);
|
|
801
|
+
markDirty();
|
|
802
|
+
},
|
|
803
|
+
agentFramework: selectedFramework,
|
|
804
|
+
t
|
|
805
|
+
}
|
|
806
|
+
),
|
|
767
807
|
activeTab === "results" && /* @__PURE__ */ jsx(ResultsTab, { agentId: agent.agentId, t })
|
|
768
808
|
]
|
|
769
809
|
}
|