@datatechsolutions/ui 2.11.11 → 2.11.13
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/index.d.mts +7 -3
- package/dist/astrlabe/index.d.ts +7 -3
- package/dist/astrlabe/index.js +178 -128
- package/dist/astrlabe/index.js.map +1 -1
- package/dist/astrlabe/index.mjs +81 -31
- package/dist/astrlabe/index.mjs.map +1 -1
- package/dist/astrlabe/workflow-canvas.d.mts +1 -1
- package/dist/astrlabe/workflow-canvas.d.ts +1 -1
- package/dist/astrlabe/workflow-canvas.js +2 -2
- package/dist/astrlabe/workflow-canvas.mjs +1 -1
- package/dist/{chunk-VWKBMTTC.mjs → chunk-B64PWT4B.mjs} +15 -4
- package/dist/chunk-B64PWT4B.mjs.map +1 -0
- package/dist/{chunk-LFWRE3A3.js → chunk-RUH6YJXW.js} +15 -4
- package/dist/chunk-RUH6YJXW.js.map +1 -0
- package/dist/{workflow-canvas-DSm0iyof.d.ts → workflow-canvas-BUpiBzxZ.d.ts} +11 -1
- package/dist/{workflow-canvas-CJwGehdk.d.mts → workflow-canvas-CooSZh-g.d.mts} +11 -1
- package/package.json +1 -1
- package/dist/chunk-LFWRE3A3.js.map +0 -1
- package/dist/chunk-VWKBMTTC.mjs.map +0 -1
package/dist/astrlabe/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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, useWorkflowStore, LOGIC_ICON_MAP, LOGIC_NODE_GRADIENTS, getFrameworkMeta, getCompatibleModels, isModelCompatibleWithFramework, FRAMEWORK_META
|
|
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, 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-
|
|
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-B64PWT4B.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, 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-B64PWT4B.mjs';
|
|
6
6
|
import { GlassModalShell, Button, FormInput, FormTextarea, GlassFormModal, Input, DynamicIslandConfirm } from '../chunk-46ZM5VJJ.mjs';
|
|
7
7
|
import '../chunk-QWG2FMUN.mjs';
|
|
8
8
|
import '../chunk-D2JF6C3E.mjs';
|
|
@@ -547,6 +547,37 @@ function ResultsTab({ agentId, t }) {
|
|
|
547
547
|
] })
|
|
548
548
|
] });
|
|
549
549
|
}
|
|
550
|
+
function ToolsTab({ agentTools, enabledToolIds, onToggle, t }) {
|
|
551
|
+
if (agentTools.length === 0) {
|
|
552
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center px-4 py-12 text-center", children: [
|
|
553
|
+
/* @__PURE__ */ jsx(CommandLineIcon, { className: "mb-2 h-8 w-8 text-gray-400 dark:text-gray-500" }),
|
|
554
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: t("agentDrawer.noToolsAvailable") })
|
|
555
|
+
] });
|
|
556
|
+
}
|
|
557
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-2 p-4", children: [
|
|
558
|
+
/* @__PURE__ */ jsx("p", { className: "mb-3 text-xs text-gray-500 dark:text-gray-400", children: t("agentDrawer.toolsDescription") }),
|
|
559
|
+
agentTools.map((tool) => {
|
|
560
|
+
const isEnabled = enabledToolIds.has(tool.agentToolId);
|
|
561
|
+
return /* @__PURE__ */ jsxs(
|
|
562
|
+
"button",
|
|
563
|
+
{
|
|
564
|
+
type: "button",
|
|
565
|
+
onClick: () => onToggle(tool.agentToolId),
|
|
566
|
+
className: `flex w-full items-center gap-3 rounded-xl border px-4 py-3 text-left transition-all ${isEnabled ? "border-amber-500/30 bg-amber-50/50 dark:border-amber-400/20 dark:bg-amber-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"}`,
|
|
567
|
+
children: [
|
|
568
|
+
/* @__PURE__ */ jsx("div", { className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg ${isEnabled ? "bg-gradient-to-br from-amber-400 to-orange-500" : "bg-gray-200 dark:bg-gray-700"}`, children: /* @__PURE__ */ jsx(CommandLineIcon, { className: `h-4 w-4 ${isEnabled ? "text-white" : "text-gray-500 dark:text-gray-400"}` }) }),
|
|
569
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
570
|
+
/* @__PURE__ */ jsx("p", { className: `text-sm font-medium ${isEnabled ? "text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`, children: tool.name }),
|
|
571
|
+
tool.description && /* @__PURE__ */ jsx("p", { className: "truncate text-[10px] text-gray-400 dark:text-gray-500", children: tool.description })
|
|
572
|
+
] }),
|
|
573
|
+
/* @__PURE__ */ jsx("div", { className: `flex h-5 w-5 shrink-0 items-center justify-center rounded-full transition-all ${isEnabled ? "bg-amber-500 text-white" : "border border-gray-300 dark:border-gray-600"}`, children: isEnabled && /* @__PURE__ */ jsx(CheckIcon, { className: "h-3 w-3" }) })
|
|
574
|
+
]
|
|
575
|
+
},
|
|
576
|
+
tool.agentToolId
|
|
577
|
+
);
|
|
578
|
+
})
|
|
579
|
+
] });
|
|
580
|
+
}
|
|
550
581
|
function AgentModal({ onSaved }) {
|
|
551
582
|
const t = useTranslations("agents.workflow");
|
|
552
583
|
const activeModal = useModalStore((s) => s.activeModal);
|
|
@@ -555,6 +586,7 @@ function AgentModal({ onSaved }) {
|
|
|
555
586
|
const open = activeModal === "agent";
|
|
556
587
|
const agent = agentData?.agent ?? null;
|
|
557
588
|
const models = agentData?.models ?? [];
|
|
589
|
+
const availableAgentTools = agentData?.agentTools ?? [];
|
|
558
590
|
const isCreateMode = agentData?.isCreateMode ?? false;
|
|
559
591
|
const [activeTab, setActiveTab] = useState("config");
|
|
560
592
|
const [selectedModelId, setSelectedModelId] = useState("");
|
|
@@ -562,6 +594,7 @@ function AgentModal({ onSaved }) {
|
|
|
562
594
|
const [temperature, setTemperature] = useState(0.7);
|
|
563
595
|
const [elo, setElo] = useState(1e3);
|
|
564
596
|
const [saved, setSaved] = useState(true);
|
|
597
|
+
const [enabledToolIds, setEnabledToolIds] = useState(/* @__PURE__ */ new Set());
|
|
565
598
|
const agentId = agent?.agentId ?? agent?.id ?? "";
|
|
566
599
|
useEffect(() => {
|
|
567
600
|
if (!agent) return;
|
|
@@ -571,6 +604,8 @@ function AgentModal({ onSaved }) {
|
|
|
571
604
|
setElo(Number(agent.elo ?? 1e3));
|
|
572
605
|
setSaved(!isCreateMode);
|
|
573
606
|
setActiveTab("config");
|
|
607
|
+
const agentToolIds = agent.agentToolIds;
|
|
608
|
+
setEnabledToolIds(new Set(agentToolIds ?? availableAgentTools.filter((t2) => t2.enabled).map((t2) => t2.agentToolId)));
|
|
574
609
|
}, [agentId]);
|
|
575
610
|
const dirty = !saved;
|
|
576
611
|
const markDirty = useCallback(() => setSaved(false), []);
|
|
@@ -578,18 +613,31 @@ function AgentModal({ onSaved }) {
|
|
|
578
613
|
const handleClose = useCallback(() => {
|
|
579
614
|
closeModal();
|
|
580
615
|
}, [closeModal]);
|
|
616
|
+
const handleToggleTool = useCallback((toolId) => {
|
|
617
|
+
setEnabledToolIds((previous) => {
|
|
618
|
+
const next = new Set(previous);
|
|
619
|
+
if (next.has(toolId)) next.delete(toolId);
|
|
620
|
+
else next.add(toolId);
|
|
621
|
+
return next;
|
|
622
|
+
});
|
|
623
|
+
markDirty();
|
|
624
|
+
}, [markDirty]);
|
|
581
625
|
const handleMarkSaved = useCallback(() => {
|
|
582
626
|
markSaved();
|
|
583
627
|
onSaved?.();
|
|
584
628
|
}, [markSaved, onSaved]);
|
|
585
629
|
if (!agent) return null;
|
|
586
|
-
const
|
|
630
|
+
const tabList = ["config", "tools", "results"];
|
|
631
|
+
const tabs = /* @__PURE__ */ jsx("div", { className: "flex border-b border-white/20 dark:border-white/10", children: tabList.map((tab) => /* @__PURE__ */ jsxs(
|
|
587
632
|
"button",
|
|
588
633
|
{
|
|
589
634
|
type: "button",
|
|
590
635
|
onClick: () => setActiveTab(tab),
|
|
591
636
|
className: `flex-1 px-4 py-2 text-xs font-medium transition-colors ${activeTab === tab ? "border-b-2 border-blue-500 text-blue-600 dark:text-blue-400" : "text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"}`,
|
|
592
|
-
children:
|
|
637
|
+
children: [
|
|
638
|
+
t(tab === "config" ? "agentDrawer.configTab" : tab === "tools" ? "agentDrawer.toolsTab" : "agentDrawer.resultsTab"),
|
|
639
|
+
tab === "tools" && enabledToolIds.size > 0 && /* @__PURE__ */ jsx("span", { className: "ml-1 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-amber-500/20 px-1 text-[9px] font-bold text-amber-600 dark:text-amber-400", children: enabledToolIds.size })
|
|
640
|
+
]
|
|
593
641
|
},
|
|
594
642
|
tab
|
|
595
643
|
)) });
|
|
@@ -633,7 +681,9 @@ function AgentModal({ onSaved }) {
|
|
|
633
681
|
closeLabel: t("agentDrawer.close"),
|
|
634
682
|
children: [
|
|
635
683
|
/* @__PURE__ */ jsx(AgentProfileHeader, { agent, models, t, selectedModelId, setSelectedModelId, selectedFramework, temperature, setTemperature, elo, setElo, onChanged: markDirty }),
|
|
636
|
-
activeTab === "config"
|
|
684
|
+
activeTab === "config" && /* @__PURE__ */ jsx(ConfigTab, { agent, models, t, selectedModelId, setSelectedModelId, selectedFramework, setSelectedFramework: (fw) => setSelectedFramework(fw), temperature, setTemperature, dirty, markDirty, markSaved: handleMarkSaved }),
|
|
685
|
+
activeTab === "tools" && /* @__PURE__ */ jsx(ToolsTab, { agentTools: availableAgentTools, enabledToolIds, onToggle: handleToggleTool, t }),
|
|
686
|
+
activeTab === "results" && /* @__PURE__ */ jsx(ResultsTab, { agentId: agent.agentId, t })
|
|
637
687
|
]
|
|
638
688
|
}
|
|
639
689
|
);
|
|
@@ -1073,30 +1123,31 @@ function PipelineSettingsModal({ onSave }) {
|
|
|
1073
1123
|
}
|
|
1074
1124
|
);
|
|
1075
1125
|
}
|
|
1076
|
-
var
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1126
|
+
var SI = (slug, color) => `https://cdn.simpleicons.org/${slug}/${color}`;
|
|
1127
|
+
var DATASOURCE_LOGOS = {
|
|
1128
|
+
bigquery: "https://www.svgrepo.com/show/375546/bigquery.svg",
|
|
1129
|
+
postgres: "https://www.svgrepo.com/show/354200/postgresql.svg",
|
|
1130
|
+
snowflake: "https://www.svgrepo.com/show/354381/snowflake-icon.svg",
|
|
1131
|
+
mongodb: "https://www.svgrepo.com/show/373845/mongo.svg",
|
|
1132
|
+
redis: "https://www.svgrepo.com/show/354272/redis.svg",
|
|
1133
|
+
mysql: "https://www.svgrepo.com/show/373848/mysql.svg",
|
|
1134
|
+
clickhouse: SI("clickhouse", "FFCC01"),
|
|
1135
|
+
elasticsearch: "https://www.svgrepo.com/show/353735/elasticsearch.svg",
|
|
1136
|
+
duckdb: SI("duckdb", "FFF000")
|
|
1086
1137
|
};
|
|
1087
|
-
function
|
|
1138
|
+
function getDatasourceLogo(entityId) {
|
|
1088
1139
|
const lower = entityId.toLowerCase();
|
|
1089
|
-
for (const [key,
|
|
1090
|
-
if (lower.includes(key)) return
|
|
1140
|
+
for (const [key, url] of Object.entries(DATASOURCE_LOGOS)) {
|
|
1141
|
+
if (lower.includes(key)) return url;
|
|
1091
1142
|
}
|
|
1092
|
-
return
|
|
1143
|
+
return null;
|
|
1093
1144
|
}
|
|
1094
|
-
var
|
|
1095
|
-
anthropic: "
|
|
1096
|
-
amazon: "
|
|
1097
|
-
google: "
|
|
1098
|
-
openai: "
|
|
1099
|
-
meta: "
|
|
1145
|
+
var PROVIDER_LOGOS = {
|
|
1146
|
+
anthropic: SI("anthropic", "D4A27F"),
|
|
1147
|
+
amazon: "https://www.svgrepo.com/show/448266/aws.svg",
|
|
1148
|
+
google: SI("googlegemini", "8E75B2"),
|
|
1149
|
+
openai: "https://www.svgrepo.com/show/306500/openai.svg",
|
|
1150
|
+
meta: SI("meta", "0668E1")
|
|
1100
1151
|
};
|
|
1101
1152
|
function onDragStart(event, nodeType, entityId, label, config) {
|
|
1102
1153
|
event.dataTransfer.setData("nodeType", nodeType);
|
|
@@ -1438,8 +1489,9 @@ function NodePalette({ agents, tools, agentTools = [], rules, entities = [], mod
|
|
|
1438
1489
|
outputVariable: `${entity.label.replace(/\s+/g, "")}Data`,
|
|
1439
1490
|
limit: entity.defaultLimit
|
|
1440
1491
|
});
|
|
1492
|
+
const dsLogo = getDatasourceLogo(entity.id);
|
|
1441
1493
|
const EntityIcon = getEntityIcon(entity.id);
|
|
1442
|
-
const entityGradient =
|
|
1494
|
+
const entityGradient = getEntityGradient(entity.id);
|
|
1443
1495
|
return /* @__PURE__ */ jsxs(
|
|
1444
1496
|
"div",
|
|
1445
1497
|
{
|
|
@@ -1447,7 +1499,7 @@ function NodePalette({ agents, tools, agentTools = [], rules, entities = [], mod
|
|
|
1447
1499
|
onDragStart: (event) => onDragStart(event, "entity", entity.id, entity.label, defaultConfig),
|
|
1448
1500
|
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",
|
|
1449
1501
|
children: [
|
|
1450
|
-
/* @__PURE__ */ jsx("div", { className: `flex h-6 w-6 items-center justify-center rounded-md bg-gradient-to-br ${entityGradient} shadow-sm`, children: /* @__PURE__ */ jsx(EntityIcon, { className: "h-3.5 w-3.5 text-white" }) }),
|
|
1502
|
+
dsLogo ? /* @__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: dsLogo, 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 ${entityGradient} shadow-sm`, children: /* @__PURE__ */ jsx(EntityIcon, { className: "h-3.5 w-3.5 text-white" }) }),
|
|
1451
1503
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1452
1504
|
/* @__PURE__ */ jsx("p", { className: "truncate text-xs font-medium text-gray-900 dark:text-white", children: entity.label }),
|
|
1453
1505
|
/* @__PURE__ */ jsxs("p", { className: "truncate text-[10px] text-gray-400 dark:text-gray-500", children: [
|
|
@@ -1471,9 +1523,7 @@ function NodePalette({ agents, tools, agentTools = [], rules, entities = [], mod
|
|
|
1471
1523
|
colorClass: "text-rose-600 dark:text-rose-400",
|
|
1472
1524
|
count: filteredProviders.length,
|
|
1473
1525
|
children: filteredProviders.map((provider) => {
|
|
1474
|
-
const
|
|
1475
|
-
const ProviderIcon = providerIcon.IconComponent;
|
|
1476
|
-
const providerGradient = PROVIDER_GRADIENTS[provider.provider] ?? "from-rose-400 to-pink-500";
|
|
1526
|
+
const providerLogo = PROVIDER_LOGOS[provider.provider];
|
|
1477
1527
|
return /* @__PURE__ */ jsxs(
|
|
1478
1528
|
"div",
|
|
1479
1529
|
{
|
|
@@ -1482,7 +1532,7 @@ function NodePalette({ agents, tools, agentTools = [], rules, entities = [], mod
|
|
|
1482
1532
|
role: "button",
|
|
1483
1533
|
tabIndex: 0,
|
|
1484
1534
|
children: [
|
|
1485
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
1535
|
+
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" }) }),
|
|
1486
1536
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1487
1537
|
/* @__PURE__ */ jsx("p", { className: "truncate text-xs font-medium text-gray-900 dark:text-white", children: provider.name }),
|
|
1488
1538
|
/* @__PURE__ */ jsxs("p", { className: "truncate text-[10px] text-gray-400 dark:text-gray-500", children: [
|