@datatechsolutions/ui 2.11.9 → 2.11.11
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 +11 -2
- package/dist/astrlabe/index.d.ts +11 -2
- package/dist/astrlabe/index.js +116 -53
- package/dist/astrlabe/index.js.map +1 -1
- package/dist/astrlabe/index.mjs +118 -55
- package/dist/astrlabe/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/astrlabe/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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,
|
|
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, getEntityGradient } from '../chunk-VWKBMTTC.mjs';
|
|
5
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-VWKBMTTC.mjs';
|
|
6
6
|
import { GlassModalShell, Button, FormInput, FormTextarea, GlassFormModal, Input, DynamicIslandConfirm } from '../chunk-46ZM5VJJ.mjs';
|
|
7
7
|
import '../chunk-QWG2FMUN.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 { CpuChipIcon, ArrowPathRoundedSquareIcon, ArrowsPointingOutIcon, ArrowsPointingInIcon, BoltIcon, ClockIcon, CheckIcon, Cog6ToothIcon, CommandLineIcon, AdjustmentsHorizontalIcon, CircleStackIcon,
|
|
14
|
+
import { CpuChipIcon, ArrowPathRoundedSquareIcon, ArrowsPointingOutIcon, ArrowsPointingInIcon, BoltIcon, ClockIcon, CheckIcon, Cog6ToothIcon, CommandLineIcon, PlusIcon, AdjustmentsHorizontalIcon, CircleStackIcon, KeyIcon, TrashIcon, 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
|
|
|
@@ -1073,6 +1073,31 @@ function PipelineSettingsModal({ onSave }) {
|
|
|
1073
1073
|
}
|
|
1074
1074
|
);
|
|
1075
1075
|
}
|
|
1076
|
+
var DATASOURCE_GRADIENTS = {
|
|
1077
|
+
bigquery: "from-blue-500 to-indigo-600",
|
|
1078
|
+
postgres: "from-sky-500 to-blue-600",
|
|
1079
|
+
snowflake: "from-cyan-400 to-blue-500",
|
|
1080
|
+
mongodb: "from-green-500 to-emerald-600",
|
|
1081
|
+
redis: "from-red-500 to-rose-600",
|
|
1082
|
+
mysql: "from-blue-600 to-indigo-700",
|
|
1083
|
+
clickhouse: "from-amber-500 to-yellow-600",
|
|
1084
|
+
elasticsearch: "from-teal-500 to-cyan-600",
|
|
1085
|
+
duckdb: "from-yellow-500 to-amber-600"
|
|
1086
|
+
};
|
|
1087
|
+
function getDatasourceGradient(entityId) {
|
|
1088
|
+
const lower = entityId.toLowerCase();
|
|
1089
|
+
for (const [key, gradient] of Object.entries(DATASOURCE_GRADIENTS)) {
|
|
1090
|
+
if (lower.includes(key)) return gradient;
|
|
1091
|
+
}
|
|
1092
|
+
return getEntityGradient(entityId);
|
|
1093
|
+
}
|
|
1094
|
+
var PROVIDER_GRADIENTS = {
|
|
1095
|
+
anthropic: "from-amber-500 to-orange-600",
|
|
1096
|
+
amazon: "from-orange-500 to-amber-600",
|
|
1097
|
+
google: "from-blue-500 to-cyan-600",
|
|
1098
|
+
openai: "from-emerald-500 to-teal-600",
|
|
1099
|
+
meta: "from-blue-600 to-indigo-700"
|
|
1100
|
+
};
|
|
1076
1101
|
function onDragStart(event, nodeType, entityId, label, config) {
|
|
1077
1102
|
event.dataTransfer.setData("nodeType", nodeType);
|
|
1078
1103
|
event.dataTransfer.setData("entityId", entityId);
|
|
@@ -1189,7 +1214,7 @@ function LogicNodeItemCard({ item, translationFunction }) {
|
|
|
1189
1214
|
}
|
|
1190
1215
|
);
|
|
1191
1216
|
}
|
|
1192
|
-
function NodePalette({ agents, tools, agentTools = [], rules, entities = [], onCreateAgent, onCreateTool, onCreateAgentTool, onCreateRule, onCreateDatasource }) {
|
|
1217
|
+
function NodePalette({ agents, tools, agentTools = [], rules, entities = [], modelProviders = [], onCreateAgent, onCreateTool, onCreateAgentTool, onCreateRule, onCreateDatasource, onConfigureProvider }) {
|
|
1193
1218
|
const t = useTranslations("agents.workflow");
|
|
1194
1219
|
const [searchQuery, setSearchQuery] = useState("");
|
|
1195
1220
|
const normalizedQuery = searchQuery.toLowerCase().trim();
|
|
@@ -1217,6 +1242,12 @@ function NodePalette({ agents, tools, agentTools = [], rules, entities = [], onC
|
|
|
1217
1242
|
) : rules,
|
|
1218
1243
|
[rules, normalizedQuery]
|
|
1219
1244
|
);
|
|
1245
|
+
const filteredProviders = useMemo(
|
|
1246
|
+
() => normalizedQuery ? modelProviders.filter(
|
|
1247
|
+
(provider) => provider.name.toLowerCase().includes(normalizedQuery) || provider.provider.toLowerCase().includes(normalizedQuery)
|
|
1248
|
+
) : modelProviders,
|
|
1249
|
+
[modelProviders, normalizedQuery]
|
|
1250
|
+
);
|
|
1220
1251
|
const entityTypes = useMemo(
|
|
1221
1252
|
() => entities.map((entity) => ({
|
|
1222
1253
|
id: entity.id,
|
|
@@ -1281,58 +1312,55 @@ function NodePalette({ agents, tools, agentTools = [], rules, entities = [], onC
|
|
|
1281
1312
|
colorClass: "text-indigo-600 dark:text-indigo-400",
|
|
1282
1313
|
onAdd: onCreateAgent,
|
|
1283
1314
|
addLabel: t("newAgent"),
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
/* @__PURE__ */
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
1297
|
-
/* @__PURE__ */ jsx("p", { className: "truncate text-xs font-medium text-gray-900 dark:text-white", children: agent.name }),
|
|
1298
|
-
(() => {
|
|
1299
|
-
const tier = getAgentTier(Number(agent.elo ?? 0));
|
|
1300
|
-
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)}`) });
|
|
1301
|
-
})()
|
|
1315
|
+
count: filteredAgents.length + filteredAgentTools.length,
|
|
1316
|
+
children: filteredAgents.length === 0 && filteredAgentTools.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: t("noAgents") }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1317
|
+
filteredAgents.map((agent) => /* @__PURE__ */ jsxs(
|
|
1318
|
+
"div",
|
|
1319
|
+
{
|
|
1320
|
+
draggable: true,
|
|
1321
|
+
onDragStart: (event) => onDragStart(event, "agent", agent.agentId, agent.name),
|
|
1322
|
+
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",
|
|
1323
|
+
children: [
|
|
1324
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
|
|
1325
|
+
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" }) }),
|
|
1326
|
+
/* @__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" }) })
|
|
1302
1327
|
] }),
|
|
1303
|
-
/* @__PURE__ */
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1328
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1329
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
1330
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-xs font-medium text-gray-900 dark:text-white", children: agent.name }),
|
|
1331
|
+
(() => {
|
|
1332
|
+
const tier = getAgentTier(Number(agent.elo ?? 0));
|
|
1333
|
+
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)}`) });
|
|
1334
|
+
})()
|
|
1335
|
+
] }),
|
|
1336
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-[10px] text-gray-400 dark:text-gray-500", children: agent.role ?? agent.agentId })
|
|
1337
|
+
] })
|
|
1338
|
+
]
|
|
1339
|
+
},
|
|
1340
|
+
agent.agentId
|
|
1341
|
+
)),
|
|
1342
|
+
filteredAgentTools.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1343
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-2 mb-1 flex items-center gap-1.5 px-1", children: [
|
|
1344
|
+
/* @__PURE__ */ jsx(CommandLineIcon, { className: "h-2.5 w-2.5 text-amber-500 dark:text-amber-400" }),
|
|
1345
|
+
/* @__PURE__ */ jsx("span", { className: "text-[9px] font-semibold uppercase tracking-wider text-amber-600 dark:text-amber-400", children: t("agentToolsSection") }),
|
|
1346
|
+
onCreateAgentTool && /* @__PURE__ */ jsx("button", { type: "button", onClick: onCreateAgentTool, className: "ml-auto text-[9px] font-medium text-amber-500 hover:text-amber-600 dark:text-amber-400", children: /* @__PURE__ */ jsx(PlusIcon, { className: "h-3 w-3" }) })
|
|
1347
|
+
] }),
|
|
1348
|
+
filteredAgentTools.map((agentTool) => /* @__PURE__ */ jsxs(
|
|
1349
|
+
"div",
|
|
1350
|
+
{
|
|
1351
|
+
draggable: true,
|
|
1352
|
+
onDragStart: (event) => onDragStart(event, "agent_tool", agentTool.agentToolId, agentTool.name),
|
|
1353
|
+
className: "liquid-surface group flex items-center gap-2 rounded-lg px-3 py-1.5 transition-all cursor-grab hover:shadow-md active:cursor-grabbing",
|
|
1354
|
+
children: [
|
|
1355
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-md bg-gradient-to-br from-amber-400 to-orange-500 shadow-sm", children: /* @__PURE__ */ jsx(CommandLineIcon, { className: "h-3 w-3 text-white" }) }),
|
|
1356
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx("p", { className: "truncate text-[11px] font-medium text-gray-900 dark:text-white", children: agentTool.name }) }),
|
|
1357
|
+
!agentTool.enabled && /* @__PURE__ */ jsx("span", { className: "rounded-full bg-gray-100 px-1.5 py-0.5 text-[8px] font-medium text-gray-500 dark:bg-white/10 dark:text-gray-400", children: "off" })
|
|
1358
|
+
]
|
|
1359
|
+
},
|
|
1360
|
+
agentTool.agentToolId
|
|
1361
|
+
))
|
|
1362
|
+
] })
|
|
1363
|
+
] })
|
|
1336
1364
|
}
|
|
1337
1365
|
),
|
|
1338
1366
|
/* @__PURE__ */ jsx(
|
|
@@ -1411,7 +1439,7 @@ function NodePalette({ agents, tools, agentTools = [], rules, entities = [], onC
|
|
|
1411
1439
|
limit: entity.defaultLimit
|
|
1412
1440
|
});
|
|
1413
1441
|
const EntityIcon = getEntityIcon(entity.id);
|
|
1414
|
-
const entityGradient =
|
|
1442
|
+
const entityGradient = getDatasourceGradient(entity.id);
|
|
1415
1443
|
return /* @__PURE__ */ jsxs(
|
|
1416
1444
|
"div",
|
|
1417
1445
|
{
|
|
@@ -1435,6 +1463,41 @@ function NodePalette({ agents, tools, agentTools = [], rules, entities = [], onC
|
|
|
1435
1463
|
})
|
|
1436
1464
|
}
|
|
1437
1465
|
),
|
|
1466
|
+
filteredProviders.length > 0 && /* @__PURE__ */ jsx(
|
|
1467
|
+
CollapsibleSection,
|
|
1468
|
+
{
|
|
1469
|
+
title: t("modelProvidersSection"),
|
|
1470
|
+
icon: /* @__PURE__ */ jsx(KeyIcon, { className: "h-3 w-3" }),
|
|
1471
|
+
colorClass: "text-rose-600 dark:text-rose-400",
|
|
1472
|
+
count: filteredProviders.length,
|
|
1473
|
+
children: filteredProviders.map((provider) => {
|
|
1474
|
+
const providerIcon = getModelIcon(`${provider.provider}.placeholder`);
|
|
1475
|
+
const ProviderIcon = providerIcon.IconComponent;
|
|
1476
|
+
const providerGradient = PROVIDER_GRADIENTS[provider.provider] ?? "from-rose-400 to-pink-500";
|
|
1477
|
+
return /* @__PURE__ */ jsxs(
|
|
1478
|
+
"div",
|
|
1479
|
+
{
|
|
1480
|
+
className: "liquid-surface group flex items-center gap-2 rounded-lg px-3 py-2 transition-all cursor-pointer hover:shadow-md",
|
|
1481
|
+
onClick: () => onConfigureProvider?.(provider.id),
|
|
1482
|
+
role: "button",
|
|
1483
|
+
tabIndex: 0,
|
|
1484
|
+
children: [
|
|
1485
|
+
/* @__PURE__ */ jsx("div", { className: `flex h-6 w-6 items-center justify-center rounded-md bg-gradient-to-br ${providerGradient} shadow-sm`, children: /* @__PURE__ */ jsx(ProviderIcon, { className: "h-3.5 w-3.5 text-white" }) }),
|
|
1486
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1487
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-xs font-medium text-gray-900 dark:text-white", children: provider.name }),
|
|
1488
|
+
/* @__PURE__ */ jsxs("p", { className: "truncate text-[10px] text-gray-400 dark:text-gray-500", children: [
|
|
1489
|
+
provider.modelCount,
|
|
1490
|
+
" models"
|
|
1491
|
+
] })
|
|
1492
|
+
] }),
|
|
1493
|
+
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") })
|
|
1494
|
+
]
|
|
1495
|
+
},
|
|
1496
|
+
provider.id
|
|
1497
|
+
);
|
|
1498
|
+
})
|
|
1499
|
+
}
|
|
1500
|
+
),
|
|
1438
1501
|
/* @__PURE__ */ jsxs(
|
|
1439
1502
|
CollapsibleSection,
|
|
1440
1503
|
{
|