@datatechsolutions/ui 2.11.2 → 2.11.3

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 (47) hide show
  1. package/dist/astrlabe/contracts.d.mts +293 -0
  2. package/dist/astrlabe/contracts.d.ts +293 -0
  3. package/dist/astrlabe/graph-node.d.mts +28 -0
  4. package/dist/astrlabe/graph-node.d.ts +28 -0
  5. package/dist/astrlabe/index.d.mts +707 -0
  6. package/dist/astrlabe/index.d.ts +707 -0
  7. package/dist/astrlabe/index.js +146 -146
  8. package/dist/astrlabe/index.js.map +1 -1
  9. package/dist/astrlabe/index.mjs +30 -30
  10. package/dist/astrlabe/index.mjs.map +1 -1
  11. package/dist/astrlabe/utils.d.mts +71 -0
  12. package/dist/astrlabe/utils.d.ts +71 -0
  13. package/dist/astrlabe/utils.js +4 -4
  14. package/dist/astrlabe/utils.mjs +1 -1
  15. package/dist/astrlabe/workflow-canvas.d.mts +5 -0
  16. package/dist/astrlabe/workflow-canvas.d.ts +5 -0
  17. package/dist/astrlabe/workflow-canvas.js +6 -6
  18. package/dist/astrlabe/workflow-canvas.mjs +5 -5
  19. package/dist/astrlabe/workflow-preview-canvas.d.mts +10 -0
  20. package/dist/astrlabe/workflow-preview-canvas.d.ts +10 -0
  21. package/dist/{chunk-ZEYHIEHE.mjs → chunk-LJSJMBLO.mjs} +81 -71
  22. package/dist/chunk-LJSJMBLO.mjs.map +1 -0
  23. package/dist/{chunk-NMXHJMGI.js → chunk-PBKTXX4Y.js} +3 -3
  24. package/dist/{chunk-NMXHJMGI.js.map → chunk-PBKTXX4Y.js.map} +1 -1
  25. package/dist/{chunk-DFR6CMJH.js → chunk-PWBWP5FJ.js} +2 -2
  26. package/dist/{chunk-DFR6CMJH.js.map → chunk-PWBWP5FJ.js.map} +1 -1
  27. package/dist/{chunk-AM2TTPYM.mjs → chunk-TLPPVL3W.mjs} +2 -2
  28. package/dist/{chunk-AM2TTPYM.mjs.map → chunk-TLPPVL3W.mjs.map} +1 -1
  29. package/dist/{chunk-4TZNBT5V.js → chunk-XAQME7DD.js} +138 -128
  30. package/dist/chunk-XAQME7DD.js.map +1 -0
  31. package/dist/{chunk-VB45EBH5.mjs → chunk-XO7IYJSF.mjs} +3 -3
  32. package/dist/{chunk-VB45EBH5.mjs.map → chunk-XO7IYJSF.mjs.map} +1 -1
  33. package/dist/dynamic-island-confirm-Cbxh-sta.d.mts +52 -0
  34. package/dist/dynamic-island-confirm-Cbxh-sta.d.ts +52 -0
  35. package/dist/index.d.mts +4771 -0
  36. package/dist/index.d.ts +4771 -0
  37. package/dist/index.js +727 -727
  38. package/dist/index.mjs +2 -2
  39. package/dist/lib/i18n-context.d.mts +36 -0
  40. package/dist/lib/i18n-context.d.ts +36 -0
  41. package/dist/lib/router-context.d.mts +35 -0
  42. package/dist/lib/router-context.d.ts +35 -0
  43. package/dist/workflow-canvas-CJwGehdk.d.mts +241 -0
  44. package/dist/workflow-canvas-DSm0iyof.d.ts +241 -0
  45. package/package.json +2 -1
  46. package/dist/chunk-4TZNBT5V.js.map +0 -1
  47. package/dist/chunk-ZEYHIEHE.mjs.map +0 -1
@@ -0,0 +1,71 @@
1
+ import { WorkflowNodeType, LogicNodeConfig, WorkflowGraph } from './contracts.mjs';
2
+ import { Node, Edge } from '@xyflow/react';
3
+
4
+ /**
5
+ * Layout Engine
6
+ * =============
7
+ * Auto-layout for workflow graphs using @dagrejs/dagre.
8
+ * Pure utility — no React dependencies.
9
+ */
10
+
11
+ /** Layout direction: free means no auto-layout is applied. */
12
+ type LayoutDirection = 'free' | 'LR' | 'TB';
13
+ /**
14
+ * Apply dagre layout to the given nodes and edges.
15
+ * Returns a new array of nodes with updated positions.
16
+ * Group child nodes (parentId set) and note nodes are excluded from layout.
17
+ */
18
+ declare function applyDagreLayout(nodes: Node[], edges: Edge[], direction: Exclude<LayoutDirection, 'free'>): Node[];
19
+
20
+ /**
21
+ * Logic Node Default Configs
22
+ * ==========================
23
+ * Factory function to create default configs for each logic node type.
24
+ */
25
+
26
+ declare function createDefaultLogicNodeConfig(nodeType: WorkflowNodeType): LogicNodeConfig | null;
27
+
28
+ /**
29
+ * Workflow Validator
30
+ * =================
31
+ * Validates the workflow graph before publishing.
32
+ * Ensures the graph forms a valid DAG with proper node connections.
33
+ */
34
+
35
+ type ValidationResult = {
36
+ valid: boolean;
37
+ errors: string[];
38
+ };
39
+ /**
40
+ * Validate a workflow graph for publishing.
41
+ * Checks:
42
+ * - At least one agent node exists
43
+ * - All edges have valid source/target nodes
44
+ * - No orphan nodes (every node has at least one connection, except note nodes)
45
+ * - Tool nodes connect to agent nodes only
46
+ * - Agent chain forms a valid DAG (no cycles)
47
+ * - Rule nodes have incoming edges from agents
48
+ * - Logic node constraints (start/end uniqueness, config validation)
49
+ * - New node type validations (answer, question_classifier, parameter_extractor, etc.)
50
+ */
51
+ declare function validateWorkflowGraph(graph: WorkflowGraph): ValidationResult;
52
+ /**
53
+ * Topologically sort agent nodes from the graph edges.
54
+ * Returns agent entityIds in execution order.
55
+ * Logic nodes are skipped — only agent entityIds are returned.
56
+ */
57
+ declare function topologicalSortAgents(graph: WorkflowGraph): string[];
58
+
59
+ /**
60
+ * Agent ELO Tier
61
+ * ==============
62
+ * Derives difficulty tier from agent ELO rating.
63
+ * Used in node palette, agent flow node, and agent modal.
64
+ */
65
+ type AgentTier = {
66
+ key: 'beginner' | 'intermediate' | 'advanced' | 'expert';
67
+ pillColor: string;
68
+ };
69
+ declare function getAgentTier(elo: number | undefined): AgentTier;
70
+
71
+ export { type AgentTier, type LayoutDirection, applyDagreLayout, createDefaultLogicNodeConfig, getAgentTier, topologicalSortAgents, validateWorkflowGraph };
@@ -0,0 +1,71 @@
1
+ import { WorkflowNodeType, LogicNodeConfig, WorkflowGraph } from './contracts.js';
2
+ import { Node, Edge } from '@xyflow/react';
3
+
4
+ /**
5
+ * Layout Engine
6
+ * =============
7
+ * Auto-layout for workflow graphs using @dagrejs/dagre.
8
+ * Pure utility — no React dependencies.
9
+ */
10
+
11
+ /** Layout direction: free means no auto-layout is applied. */
12
+ type LayoutDirection = 'free' | 'LR' | 'TB';
13
+ /**
14
+ * Apply dagre layout to the given nodes and edges.
15
+ * Returns a new array of nodes with updated positions.
16
+ * Group child nodes (parentId set) and note nodes are excluded from layout.
17
+ */
18
+ declare function applyDagreLayout(nodes: Node[], edges: Edge[], direction: Exclude<LayoutDirection, 'free'>): Node[];
19
+
20
+ /**
21
+ * Logic Node Default Configs
22
+ * ==========================
23
+ * Factory function to create default configs for each logic node type.
24
+ */
25
+
26
+ declare function createDefaultLogicNodeConfig(nodeType: WorkflowNodeType): LogicNodeConfig | null;
27
+
28
+ /**
29
+ * Workflow Validator
30
+ * =================
31
+ * Validates the workflow graph before publishing.
32
+ * Ensures the graph forms a valid DAG with proper node connections.
33
+ */
34
+
35
+ type ValidationResult = {
36
+ valid: boolean;
37
+ errors: string[];
38
+ };
39
+ /**
40
+ * Validate a workflow graph for publishing.
41
+ * Checks:
42
+ * - At least one agent node exists
43
+ * - All edges have valid source/target nodes
44
+ * - No orphan nodes (every node has at least one connection, except note nodes)
45
+ * - Tool nodes connect to agent nodes only
46
+ * - Agent chain forms a valid DAG (no cycles)
47
+ * - Rule nodes have incoming edges from agents
48
+ * - Logic node constraints (start/end uniqueness, config validation)
49
+ * - New node type validations (answer, question_classifier, parameter_extractor, etc.)
50
+ */
51
+ declare function validateWorkflowGraph(graph: WorkflowGraph): ValidationResult;
52
+ /**
53
+ * Topologically sort agent nodes from the graph edges.
54
+ * Returns agent entityIds in execution order.
55
+ * Logic nodes are skipped — only agent entityIds are returned.
56
+ */
57
+ declare function topologicalSortAgents(graph: WorkflowGraph): string[];
58
+
59
+ /**
60
+ * Agent ELO Tier
61
+ * ==============
62
+ * Derives difficulty tier from agent ELO rating.
63
+ * Used in node palette, agent flow node, and agent modal.
64
+ */
65
+ type AgentTier = {
66
+ key: 'beginner' | 'intermediate' | 'advanced' | 'expert';
67
+ pillColor: string;
68
+ };
69
+ declare function getAgentTier(elo: number | undefined): AgentTier;
70
+
71
+ export { type AgentTier, type LayoutDirection, applyDagreLayout, createDefaultLogicNodeConfig, getAgentTier, topologicalSortAgents, validateWorkflowGraph };
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  var chunk3GE3MBUZ_js = require('../chunk-3GE3MBUZ.js');
5
- var chunkDFR6CMJH_js = require('../chunk-DFR6CMJH.js');
5
+ var chunkPWBWP5FJ_js = require('../chunk-PWBWP5FJ.js');
6
6
 
7
7
 
8
8
 
@@ -16,15 +16,15 @@ Object.defineProperty(exports, "validateWorkflowGraph", {
16
16
  });
17
17
  Object.defineProperty(exports, "applyDagreLayout", {
18
18
  enumerable: true,
19
- get: function () { return chunkDFR6CMJH_js.applyDagreLayout; }
19
+ get: function () { return chunkPWBWP5FJ_js.applyDagreLayout; }
20
20
  });
21
21
  Object.defineProperty(exports, "createDefaultLogicNodeConfig", {
22
22
  enumerable: true,
23
- get: function () { return chunkDFR6CMJH_js.createDefaultLogicNodeConfig; }
23
+ get: function () { return chunkPWBWP5FJ_js.createDefaultLogicNodeConfig; }
24
24
  });
25
25
  Object.defineProperty(exports, "getAgentTier", {
26
26
  enumerable: true,
27
- get: function () { return chunkDFR6CMJH_js.getAgentTier; }
27
+ get: function () { return chunkPWBWP5FJ_js.getAgentTier; }
28
28
  });
29
29
  //# sourceMappingURL=utils.js.map
30
30
  //# sourceMappingURL=utils.js.map
@@ -1,5 +1,5 @@
1
1
  "use client";
2
2
  export { topologicalSortAgents, validateWorkflowGraph } from '../chunk-BLNXRUC4.mjs';
3
- export { applyDagreLayout, createDefaultLogicNodeConfig, getAgentTier } from '../chunk-AM2TTPYM.mjs';
3
+ export { applyDagreLayout, createDefaultLogicNodeConfig, getAgentTier } from '../chunk-TLPPVL3W.mjs';
4
4
  //# sourceMappingURL=utils.mjs.map
5
5
  //# sourceMappingURL=utils.mjs.map
@@ -0,0 +1,5 @@
1
+ import 'react/jsx-runtime';
2
+ import 'react';
3
+ export { i as Workspace, h as WorkspaceProps } from '../workflow-canvas-CJwGehdk.mjs';
4
+ import '@xyflow/react';
5
+ import './contracts.mjs';
@@ -0,0 +1,5 @@
1
+ import 'react/jsx-runtime';
2
+ import 'react';
3
+ export { i as Workspace, h as WorkspaceProps } from '../workflow-canvas-DSm0iyof.js';
4
+ import '@xyflow/react';
5
+ import './contracts.js';
@@ -1,19 +1,19 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunk4TZNBT5V_js = require('../chunk-4TZNBT5V.js');
5
- require('../chunk-NMXHJMGI.js');
6
- require('../chunk-UZ3CMNUJ.js');
7
- require('../chunk-YXN2K77G.js');
4
+ var chunkXAQME7DD_js = require('../chunk-XAQME7DD.js');
5
+ require('../chunk-PBKTXX4Y.js');
8
6
  require('../chunk-S7KHTUHA.js');
7
+ require('../chunk-UZ3CMNUJ.js');
9
8
  require('../chunk-P4YYEM4B.js');
10
- require('../chunk-DFR6CMJH.js');
9
+ require('../chunk-PWBWP5FJ.js');
10
+ require('../chunk-YXN2K77G.js');
11
11
 
12
12
 
13
13
 
14
14
  Object.defineProperty(exports, "Workspace", {
15
15
  enumerable: true,
16
- get: function () { return chunk4TZNBT5V_js.Workspace; }
16
+ get: function () { return chunkXAQME7DD_js.Workspace; }
17
17
  });
18
18
  //# sourceMappingURL=workflow-canvas.js.map
19
19
  //# sourceMappingURL=workflow-canvas.js.map
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- export { Workspace } from '../chunk-ZEYHIEHE.mjs';
3
- import '../chunk-VB45EBH5.mjs';
4
- import '../chunk-D2JF6C3E.mjs';
5
- import '../chunk-7VJ7CMMT.mjs';
2
+ export { Workspace } from '../chunk-LJSJMBLO.mjs';
3
+ import '../chunk-XO7IYJSF.mjs';
6
4
  import '../chunk-QWG2FMUN.mjs';
5
+ import '../chunk-D2JF6C3E.mjs';
7
6
  import '../chunk-OZNTQROP.mjs';
8
- import '../chunk-AM2TTPYM.mjs';
7
+ import '../chunk-TLPPVL3W.mjs';
8
+ import '../chunk-7VJ7CMMT.mjs';
9
9
  //# sourceMappingURL=workflow-canvas.mjs.map
10
10
  //# sourceMappingURL=workflow-canvas.mjs.map
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { WorkflowGraph } from './contracts.mjs';
3
+
4
+ type WorkflowPreviewCanvasProps = {
5
+ graph: WorkflowGraph;
6
+ className?: string;
7
+ };
8
+ declare function WorkflowPreviewCanvas({ graph, className }: WorkflowPreviewCanvasProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { WorkflowPreviewCanvas, type WorkflowPreviewCanvasProps };
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { WorkflowGraph } from './contracts.js';
3
+
4
+ type WorkflowPreviewCanvasProps = {
5
+ graph: WorkflowGraph;
6
+ className?: string;
7
+ };
8
+ declare function WorkflowPreviewCanvas({ graph, className }: WorkflowPreviewCanvasProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { WorkflowPreviewCanvas, type WorkflowPreviewCanvasProps };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { EntityDrawer, ContextMenu, FormInput, FormTextarea, FormSelect, Button, Card, CardContent, IconButton, Input } from './chunk-VB45EBH5.mjs';
3
- import { useTranslations, I18nProvider, createI18nFromMessages } from './chunk-7VJ7CMMT.mjs';
2
+ import { GlassModalShell, ContextMenu, FormInput, FormTextarea, FormSelect, Button, Card, CardContent, IconButton, Input } from './chunk-XO7IYJSF.mjs';
4
3
  import { GraphNodeHeader, GraphNodeMeta, GraphNodeBadge, GraphNodeIconBubble } from './chunk-OZNTQROP.mjs';
5
- import { getAgentTier, createDefaultLogicNodeConfig, applyDagreLayout } from './chunk-AM2TTPYM.mjs';
4
+ import { getAgentTier, createDefaultLogicNodeConfig, applyDagreLayout } from './chunk-TLPPVL3W.mjs';
5
+ import { useTranslations, I18nProvider, createI18nFromMessages } from './chunk-7VJ7CMMT.mjs';
6
6
  import { memo, useState, useRef, useCallback, useEffect, lazy, createContext, useMemo, useContext } from 'react';
7
7
  import { Position, NodeResizer, MarkerType, useReactFlow, getBezierPath, BaseEdge, EdgeLabelRenderer, Handle, ReactFlowProvider, useNodesState, useEdgesState, addEdge, BackgroundVariant } from '@xyflow/react';
8
8
  import '@xyflow/react/dist/style.css';
@@ -208,42 +208,42 @@ var useWorkflowStore = create((set, get) => ({
208
208
  });
209
209
  }
210
210
  }));
211
- var useDrawerStore = create((set) => ({
212
- activeDrawer: null,
211
+ var useModalStore = create((set) => ({
212
+ activeModal: null,
213
213
  agentData: null,
214
214
  subworkflowData: null,
215
215
  logicNodeData: null,
216
216
  pipelineSettingsData: null,
217
- openAgentDrawer: (agent, models, isCreateMode = false) => set({
218
- activeDrawer: "agent",
217
+ openAgentModal: (agent, models, isCreateMode = false) => set({
218
+ activeModal: "agent",
219
219
  agentData: { agent, models, isCreateMode },
220
220
  subworkflowData: null,
221
221
  logicNodeData: null,
222
222
  pipelineSettingsData: null
223
223
  }),
224
- openSubworkflowDrawer: (tool) => set({
225
- activeDrawer: "subworkflow",
224
+ openSubworkflowModal: (tool) => set({
225
+ activeModal: "subworkflow",
226
226
  subworkflowData: { tool },
227
227
  agentData: null,
228
228
  logicNodeData: null,
229
229
  pipelineSettingsData: null
230
230
  }),
231
- openLogicNodeDrawer: (nodeId, nodeLabel, config) => set({
232
- activeDrawer: "logic-node",
231
+ openLogicNodeModal: (nodeId, nodeLabel, config) => set({
232
+ activeModal: "logic-node",
233
233
  logicNodeData: { nodeId, nodeLabel, config },
234
234
  agentData: null,
235
235
  subworkflowData: null,
236
236
  pipelineSettingsData: null
237
237
  }),
238
- openPipelineSettingsDrawer: (name, description) => set({
239
- activeDrawer: "pipeline-settings",
238
+ openPipelineSettingsModal: (name, description) => set({
239
+ activeModal: "pipeline-settings",
240
240
  pipelineSettingsData: { name, description },
241
241
  agentData: null,
242
242
  subworkflowData: null,
243
243
  logicNodeData: null
244
244
  }),
245
- closeDrawer: () => set({
246
- activeDrawer: null,
245
+ closeModal: () => set({
246
+ activeModal: null,
247
247
  agentData: null,
248
248
  subworkflowData: null,
249
249
  logicNodeData: null,
@@ -2888,19 +2888,27 @@ var GroupFlowNode = memo(function GroupFlowNode2({ id, data, selected }) {
2888
2888
  /* @__PURE__ */ jsx(WorkflowHandle, { type: "source", position: Position.Right, id: "right-out", colorClass: "!bg-slate-500" })
2889
2889
  ] });
2890
2890
  });
2891
- function WorkspaceDrawer({
2891
+ var LEGACY_WIDTH_MAP = {
2892
+ "max-w-xl": "xl",
2893
+ "max-w-2xl": "2xl",
2894
+ "max-w-4xl": "4xl",
2895
+ "max-w-6xl": "6xl",
2896
+ "max-w-full": "full"
2897
+ };
2898
+ function WorkspaceModal({
2892
2899
  open,
2893
2900
  onClose,
2894
2901
  title,
2895
2902
  subtitle,
2896
2903
  icon,
2897
2904
  gradient = "from-gray-400 to-gray-500",
2898
- maxWidth = "max-w-2xl",
2905
+ maxWidth = "2xl",
2899
2906
  tabs,
2900
2907
  children
2901
2908
  }) {
2902
- return /* @__PURE__ */ jsx(
2903
- EntityDrawer,
2909
+ const resolvedSize = LEGACY_WIDTH_MAP[maxWidth] ?? maxWidth;
2910
+ return /* @__PURE__ */ jsxs(
2911
+ GlassModalShell,
2904
2912
  {
2905
2913
  open,
2906
2914
  onClose,
@@ -2908,9 +2916,11 @@ function WorkspaceDrawer({
2908
2916
  subtitle,
2909
2917
  icon,
2910
2918
  gradient,
2911
- maxWidth,
2912
- tabs,
2913
- children
2919
+ maxWidth: resolvedSize,
2920
+ children: [
2921
+ tabs,
2922
+ children
2923
+ ]
2914
2924
  }
2915
2925
  );
2916
2926
  }
@@ -5043,12 +5053,12 @@ var NODE_TITLE_KEYS = {
5043
5053
  datasource: "datasourceNodeConfig",
5044
5054
  group: "groupNodeConfig"
5045
5055
  };
5046
- function LogicNodeDrawer({ onSave, entities = [], datasources = [], onLoadTables, onLoadSchema }) {
5056
+ function LogicNodeModal({ onSave, entities = [], datasources = [], onLoadTables, onLoadSchema }) {
5047
5057
  const t = useTranslations("agents.workflow");
5048
- const activeDrawer = useDrawerStore((s) => s.activeDrawer);
5049
- const logicNodeData = useDrawerStore((s) => s.logicNodeData);
5050
- const closeDrawer = useDrawerStore((s) => s.closeDrawer);
5051
- const open = activeDrawer === "logic-node";
5058
+ const activeModal = useModalStore((s) => s.activeModal);
5059
+ const logicNodeData = useModalStore((s) => s.logicNodeData);
5060
+ const closeModal = useModalStore((s) => s.closeModal);
5061
+ const open = activeModal === "logic-node";
5052
5062
  const nodeId = logicNodeData?.nodeId ?? null;
5053
5063
  const nodeLabel = logicNodeData?.nodeLabel ?? "";
5054
5064
  const config = logicNodeData?.config ?? null;
@@ -5064,37 +5074,37 @@ function LogicNodeDrawer({ onSave, entities = [], datasources = [], onLoadTables
5064
5074
  const renderForm = () => {
5065
5075
  switch (config.type) {
5066
5076
  case "start":
5067
- return /* @__PURE__ */ jsx(StartNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5077
+ return /* @__PURE__ */ jsx(StartNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5068
5078
  case "end":
5069
- return /* @__PURE__ */ jsx(EndNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5079
+ return /* @__PURE__ */ jsx(EndNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5070
5080
  case "if_else":
5071
- return /* @__PURE__ */ jsx(IfElseNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5081
+ return /* @__PURE__ */ jsx(IfElseNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5072
5082
  case "code":
5073
- return /* @__PURE__ */ jsx(CodeNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5083
+ return /* @__PURE__ */ jsx(CodeNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5074
5084
  case "http_request":
5075
- return /* @__PURE__ */ jsx(HttpRequestNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5085
+ return /* @__PURE__ */ jsx(HttpRequestNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5076
5086
  case "template_transform":
5077
- return /* @__PURE__ */ jsx(TemplateTransformNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5087
+ return /* @__PURE__ */ jsx(TemplateTransformNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5078
5088
  case "iteration":
5079
- return /* @__PURE__ */ jsx(IterationNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5089
+ return /* @__PURE__ */ jsx(IterationNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5080
5090
  case "knowledge_base":
5081
- return /* @__PURE__ */ jsx(KnowledgeBaseNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5091
+ return /* @__PURE__ */ jsx(KnowledgeBaseNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5082
5092
  case "answer":
5083
- return /* @__PURE__ */ jsx(AnswerNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5093
+ return /* @__PURE__ */ jsx(AnswerNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5084
5094
  case "question_classifier":
5085
- return /* @__PURE__ */ jsx(QuestionClassifierNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5095
+ return /* @__PURE__ */ jsx(QuestionClassifierNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5086
5096
  case "parameter_extractor":
5087
- return /* @__PURE__ */ jsx(ParameterExtractorNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5097
+ return /* @__PURE__ */ jsx(ParameterExtractorNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5088
5098
  case "variable_assigner":
5089
- return /* @__PURE__ */ jsx(VariableAssignerNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5099
+ return /* @__PURE__ */ jsx(VariableAssignerNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5090
5100
  case "variable_aggregator":
5091
- return /* @__PURE__ */ jsx(VariableAggregatorNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5101
+ return /* @__PURE__ */ jsx(VariableAggregatorNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5092
5102
  case "document_extractor":
5093
- return /* @__PURE__ */ jsx(DocumentExtractorNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5103
+ return /* @__PURE__ */ jsx(DocumentExtractorNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5094
5104
  case "list_operator":
5095
- return /* @__PURE__ */ jsx(ListOperatorNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5105
+ return /* @__PURE__ */ jsx(ListOperatorNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5096
5106
  case "iteration_start":
5097
- return /* @__PURE__ */ jsx(IterationStartNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5107
+ return /* @__PURE__ */ jsx(IterationStartNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5098
5108
  case "datasource":
5099
5109
  return /* @__PURE__ */ jsx(
5100
5110
  DatasourceNodeConfigForm,
@@ -5102,25 +5112,25 @@ function LogicNodeDrawer({ onSave, entities = [], datasources = [], onLoadTables
5102
5112
  nodeId,
5103
5113
  config,
5104
5114
  onSave: handleSave,
5105
- onCancel: closeDrawer,
5115
+ onCancel: closeModal,
5106
5116
  datasources,
5107
5117
  onLoadTables: onLoadTables ?? (async () => []),
5108
5118
  onLoadSchema: onLoadSchema ?? (async () => [])
5109
5119
  }
5110
5120
  );
5111
5121
  case "entity":
5112
- return /* @__PURE__ */ jsx(EntityNodeConfigForm, { config, entities, onSave: handleSave, onCancel: closeDrawer });
5122
+ return /* @__PURE__ */ jsx(EntityNodeConfigForm, { config, entities, onSave: handleSave, onCancel: closeModal });
5113
5123
  case "group":
5114
- return /* @__PURE__ */ jsx(GroupNodeConfigForm, { config, onSave: handleSave, onCancel: closeDrawer });
5124
+ return /* @__PURE__ */ jsx(GroupNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
5115
5125
  default:
5116
5126
  return null;
5117
5127
  }
5118
5128
  };
5119
5129
  return /* @__PURE__ */ jsx(
5120
- WorkspaceDrawer,
5130
+ WorkspaceModal,
5121
5131
  {
5122
5132
  open,
5123
- onClose: closeDrawer,
5133
+ onClose: closeModal,
5124
5134
  title,
5125
5135
  subtitle: nodeLabel,
5126
5136
  icon: IconComponent ? /* @__PURE__ */ jsx(IconComponent, { className: "h-5 w-5 text-white" }) : void 0,
@@ -5543,21 +5553,21 @@ function WorkflowCanvasInner({
5543
5553
  onAgentSaved,
5544
5554
  isCreatingAgent = false,
5545
5555
  nodeTypes: externalNodeTypes,
5546
- renderAgentDrawer,
5547
- renderLogicNodeDrawer: _renderLogicNodeDrawer
5556
+ renderAgentModal,
5557
+ renderLogicNodeModal: _renderLogicNodeModal
5548
5558
  }) {
5549
5559
  const { screenToFlowPosition, getNode, toObject, fitView, zoomIn, zoomOut, zoomTo } = useReactFlow();
5550
5560
  const tWorkflow = useTranslations("agents.workflow");
5551
5561
  const sortedAgents = useMemo(() => [...agents].sort((agentA, agentB) => (agentA.order ?? 0) - (agentB.order ?? 0)), [agents]);
5552
5562
  const [selectedAgentId, setSelectedAgentId] = useState(null);
5553
- const openAgentDrawerAction = useDrawerStore((s) => s.openAgentDrawer);
5554
- const openLogicNodeDrawerAction = useDrawerStore((s) => s.openLogicNodeDrawer);
5555
- const closeDrawerAction = useDrawerStore((s) => s.closeDrawer);
5556
- const activeDrawer = useDrawerStore((s) => s.activeDrawer);
5557
- const drawerOpen = activeDrawer === "agent";
5563
+ const openAgentModalAction = useModalStore((s) => s.openAgentModal);
5564
+ const openLogicNodeModalAction = useModalStore((s) => s.openLogicNodeModal);
5565
+ const closeModalAction = useModalStore((s) => s.closeModal);
5566
+ const activeModal = useModalStore((s) => s.activeModal);
5567
+ const modalOpen = activeModal === "agent";
5558
5568
  useEffect(() => {
5559
5569
  if (isCreatingAgent) {
5560
- openAgentDrawerAction(
5570
+ openAgentModalAction(
5561
5571
  { agentId: "", name: "", order: 0, enabled: true, temperature: 0.7, maxTokens: 4096 },
5562
5572
  models,
5563
5573
  true
@@ -5606,10 +5616,10 @@ function WorkflowCanvasInner({
5606
5616
  const nodeData = node.data;
5607
5617
  const config = nodeData.config;
5608
5618
  if (config) {
5609
- openLogicNodeDrawerAction(nodeId, nodeData.label ?? "", config);
5619
+ openLogicNodeModalAction(nodeId, nodeData.label ?? "", config);
5610
5620
  }
5611
5621
  }
5612
- }, [getNode, openLogicNodeDrawerAction]);
5622
+ }, [getNode, openLogicNodeModalAction]);
5613
5623
  const agentMap = useMemo(() => {
5614
5624
  const map = /* @__PURE__ */ new Map();
5615
5625
  for (const agent of agents) {
@@ -5700,7 +5710,7 @@ function WorkflowCanvasInner({
5700
5710
  selected: selectedAgentId === savedNode.id,
5701
5711
  onSelect: () => {
5702
5712
  setSelectedAgentId(agent.agentId);
5703
- openAgentDrawerAction(agent, models);
5713
+ openAgentModalAction(agent, models);
5704
5714
  },
5705
5715
  onRemoveFromCanvas: handleRemoveNodeFromCanvas
5706
5716
  }
@@ -6051,7 +6061,7 @@ function WorkflowCanvasInner({
6051
6061
  const agent = targetNode.data?.agent;
6052
6062
  if (agent) {
6053
6063
  setSelectedAgentId(agent.agentId ?? agent.id ?? null);
6054
- openAgentDrawerAction(agent, models);
6064
+ openAgentModalAction(agent, models);
6055
6065
  }
6056
6066
  } else if (targetNode.type === "tool") {
6057
6067
  const tool = targetNode.data?.tool;
@@ -6061,7 +6071,7 @@ function WorkflowCanvasInner({
6061
6071
  } else {
6062
6072
  handleEditLogicNode(nodeId);
6063
6073
  }
6064
- }, [nodes, setSelectedAgentId, openAgentDrawerAction, models, onEditTool, onEditRule, handleEditLogicNode]);
6074
+ }, [nodes, setSelectedAgentId, openAgentModalAction, models, onEditTool, onEditRule, handleEditLogicNode]);
6065
6075
  const DUPLICATE_OFFSET = 40;
6066
6076
  const contextMenuDuplicateNode = useCallback((nodeId) => {
6067
6077
  storeTakeSnapshot();
@@ -6542,7 +6552,7 @@ function WorkflowCanvasInner({
6542
6552
  selected: false,
6543
6553
  onSelect: () => {
6544
6554
  setSelectedAgentId(agent.agentId);
6545
- openAgentDrawerAction(agent, models);
6555
+ openAgentModalAction(agent, models);
6546
6556
  },
6547
6557
  onRemoveFromCanvas: handleRemoveNodeFromCanvas
6548
6558
  }
@@ -6998,29 +7008,29 @@ function WorkflowCanvasInner({
6998
7008
  }
6999
7009
  )
7000
7010
  ] }),
7001
- renderAgentDrawer?.({
7011
+ renderAgentModal?.({
7002
7012
  agent: selectedAgent,
7003
7013
  models,
7004
- open: drawerOpen || isCreatingAgent,
7014
+ open: modalOpen || isCreatingAgent,
7005
7015
  isCreateMode: isCreatingAgent,
7006
7016
  onClose: () => {
7007
- closeDrawerAction();
7017
+ closeModalAction();
7008
7018
  setSelectedAgentId(null);
7009
7019
  if (isCreatingAgent) onCancelCreateAgent?.();
7010
7020
  },
7011
7021
  onSaved: () => {
7012
- closeDrawerAction();
7022
+ closeModalAction();
7013
7023
  setSelectedAgentId(null);
7014
7024
  if (isCreatingAgent) onCancelCreateAgent?.();
7015
7025
  onAgentSaved?.();
7016
7026
  }
7017
7027
  }),
7018
7028
  /* @__PURE__ */ jsx(
7019
- LogicNodeDrawer,
7029
+ LogicNodeModal,
7020
7030
  {
7021
7031
  onSave: (nodeId, config) => {
7022
7032
  handleSaveLogicNodeConfig(nodeId, config);
7023
- closeDrawerAction();
7033
+ closeModalAction();
7024
7034
  setEditingLogicNodeId(null);
7025
7035
  },
7026
7036
  entities: allEntities
@@ -7162,6 +7172,6 @@ function Workspace({
7162
7172
  ) }) });
7163
7173
  }
7164
7174
 
7165
- export { AgentFlowNode, AgentToolFlowNode, AnswerFlowNode, AnthropicIcon, CATEGORY_COLORS, CATEGORY_PILL_COLORS, CodeFlowNode, CrewAIIcon, DocumentExtractorFlowNode, EndFlowNode, EntityFlowNode, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, HttpRequestFlowNode, ICON_MAP, IfElseFlowNode, IterationFlowNode, IterationStartFlowNode, KnowledgeBaseFlowNode, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, ListOperatorFlowNode, LogicNodeDrawer, MINIMAP_NODE_COLORS, NodeCard, NodeContextMenu, NoteFlowNode, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, QuestionClassifierFlowNode, RuleFlowNode, SelectionContextMenu, StartFlowNode, StrandsIcon, TemplateTransformFlowNode, ToolFlowNode, VariableAggregatorFlowNode, VariableAssignerFlowNode, WorkflowBuilderProvider, WorkflowCanvas, Workspace, WorkspaceDrawer, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, isModelCompatibleWithFramework, useDrawerStore, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore };
7166
- //# sourceMappingURL=chunk-ZEYHIEHE.mjs.map
7167
- //# sourceMappingURL=chunk-ZEYHIEHE.mjs.map
7175
+ export { AgentFlowNode, AgentToolFlowNode, AnswerFlowNode, AnthropicIcon, CATEGORY_COLORS, CATEGORY_PILL_COLORS, CodeFlowNode, CrewAIIcon, DocumentExtractorFlowNode, EndFlowNode, EntityFlowNode, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, HttpRequestFlowNode, ICON_MAP, 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, WorkflowCanvas, Workspace, WorkspaceModal, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, isModelCompatibleWithFramework, useModalStore, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore };
7176
+ //# sourceMappingURL=chunk-LJSJMBLO.mjs.map
7177
+ //# sourceMappingURL=chunk-LJSJMBLO.mjs.map