@datatechsolutions/ui 2.7.110 → 2.7.112

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.
@@ -284,71 +284,6 @@ var useWorkflowStore = zustand.create((set, get) => ({
284
284
  });
285
285
  }
286
286
  }));
287
- var useAgentDrawerStore = zustand.create((set) => ({
288
- // State
289
- agent: null,
290
- models: [],
291
- open: false,
292
- isCreateMode: false,
293
- activeTab: "config",
294
- selectedModelId: "",
295
- selectedFramework: "",
296
- temperature: 0,
297
- elo: 0,
298
- dirty: false,
299
- // Actions
300
- openDrawer: (agent, models, isCreateMode = false) => set({
301
- agent,
302
- models,
303
- open: true,
304
- isCreateMode,
305
- activeTab: "config",
306
- selectedModelId: agent.modelId ?? "",
307
- selectedFramework: String(agent.framework ?? ""),
308
- temperature: agent.temperature ?? 0,
309
- elo: Number(agent.elo ?? 0),
310
- dirty: isCreateMode
311
- }),
312
- closeDrawer: () => set({
313
- agent: null,
314
- models: [],
315
- open: false,
316
- isCreateMode: false,
317
- activeTab: "config",
318
- selectedModelId: "",
319
- selectedFramework: "",
320
- temperature: 0,
321
- elo: 0,
322
- dirty: false
323
- }),
324
- setActiveTab: (activeTab) => set({ activeTab, dirty: true }),
325
- setSelectedModelId: (selectedModelId) => set({ selectedModelId, dirty: true }),
326
- setSelectedFramework: (selectedFramework) => set({ selectedFramework, dirty: true }),
327
- setTemperature: (temperature) => set({ temperature, dirty: true }),
328
- setElo: (elo) => set({ elo, dirty: true }),
329
- markDirty: () => set({ dirty: true }),
330
- markSaved: () => set({ dirty: false })
331
- }));
332
- var useLogicNodeDrawerStore = zustand.create((set) => ({
333
- // State
334
- nodeId: null,
335
- nodeLabel: "",
336
- config: null,
337
- open: false,
338
- // Actions
339
- openDrawer: (nodeId, nodeLabel, config) => set({
340
- nodeId,
341
- nodeLabel,
342
- config,
343
- open: true
344
- }),
345
- closeDrawer: () => set({
346
- nodeId: null,
347
- nodeLabel: "",
348
- config: null,
349
- open: false
350
- })
351
- }));
352
287
  var GRAPH_ACTIVE_EDGE_COLOR = "#14b8a6";
353
288
  var GRAPH_TRUE_EDGE_COLOR = "#22c55e";
354
289
  var GRAPH_FALSE_EDGE_COLOR = "#ef4444";
@@ -8226,8 +8161,7 @@ var NODE_TITLE_KEYS = {
8226
8161
  entity: "entityNodeConfig",
8227
8162
  group: "groupNodeConfig"
8228
8163
  };
8229
- function LogicNodeDrawer({ onSave, entities = [] }) {
8230
- const { nodeId, nodeLabel, config, open, closeDrawer: onClose } = useLogicNodeDrawerStore();
8164
+ function LogicNodeDrawer({ nodeId, nodeLabel, config, open, onClose, onSave, entities = [] }) {
8231
8165
  const t = nextIntl.useTranslations("agents.workflow");
8232
8166
  if (!config || !nodeId) return null;
8233
8167
  const entityMasterId = config.type === "entity" ? config.entityMasterId : void 0;
@@ -8720,27 +8654,16 @@ function WorkflowCanvasInner({
8720
8654
  const sortedAgents = React8.useMemo(() => [...agents].sort((agentA, agentB) => (agentA.order ?? 0) - (agentB.order ?? 0)), [agents]);
8721
8655
  const [selectedAgentId, setSelectedAgentId] = React8.useState(null);
8722
8656
  const [drawerOpen, setDrawerOpen] = React8.useState(false);
8723
- const openAgentDrawerRaw = useAgentDrawerStore((s) => s.openDrawer);
8724
- const closeAgentDrawer = useAgentDrawerStore((s) => s.closeDrawer);
8725
- const closeLogicNodeDrawerAction = useLogicNodeDrawerStore((s) => s.closeDrawer);
8726
8657
  const closeAllDrawers = React8.useCallback(() => {
8727
- closeAgentDrawer();
8728
- closeLogicNodeDrawerAction();
8729
8658
  setEditingLogicNodeId(null);
8730
8659
  setDrawerOpen(false);
8731
8660
  setSelectedAgentId(null);
8732
- }, [closeAgentDrawer, closeLogicNodeDrawerAction]);
8733
- const openAgentDrawer = React8.useCallback((agent, agentModels, isCreate = false) => {
8734
- closeLogicNodeDrawerAction();
8661
+ }, []);
8662
+ const openAgentDrawer = React8.useCallback((agent, _agentModels, _isCreate = false) => {
8735
8663
  setEditingLogicNodeId(null);
8736
8664
  setDrawerOpen(true);
8737
- openAgentDrawerRaw(agent, agentModels, isCreate);
8738
- }, [closeLogicNodeDrawerAction, openAgentDrawerRaw]);
8739
- React8.useEffect(() => {
8740
- if (isCreatingAgent) {
8741
- openAgentDrawer({ agentId: "", name: "", order: 0, enabled: true, temperature: 0.7, maxTokens: 4096 }, models, true);
8742
- }
8743
- }, [isCreatingAgent]);
8665
+ setSelectedAgentId(agent.agentId);
8666
+ }, []);
8744
8667
  const graphChangeTimerRef = React8.useRef(null);
8745
8668
  const insertNodeOnEdgeRef = React8.useRef(() => {
8746
8669
  });
@@ -8776,8 +8699,6 @@ function WorkflowCanvasInner({
8776
8699
  const layoutDirection = useWorkflowStore((s) => s.layoutDirection);
8777
8700
  const setLayoutDirection = useWorkflowStore((s) => s.setLayoutDirection);
8778
8701
  const [editingLogicNodeId, setEditingLogicNodeId] = React8.useState(null);
8779
- const openLogicNodeDrawer = useLogicNodeDrawerStore((s) => s.openDrawer);
8780
- useLogicNodeDrawerStore((s) => s.closeDrawer);
8781
8702
  const handleEditLogicNode = React8.useCallback((nodeId) => {
8782
8703
  closeAllDrawers();
8783
8704
  setEditingLogicNodeId(nodeId);
@@ -10015,11 +9936,6 @@ function WorkflowCanvasInner({
10015
9936
  const label = nodeData.label ?? "";
10016
9937
  return { nodeId: editingLogicNodeId, config, label };
10017
9938
  }, [editingLogicNodeId, nodes]);
10018
- React8.useEffect(() => {
10019
- if (editingLogicNode) {
10020
- openLogicNodeDrawer(editingLogicNode.nodeId, editingLogicNode.label, editingLogicNode.config);
10021
- }
10022
- }, [editingLogicNode]);
10023
9939
  const handleSaveLogicNodeConfig = React8.useCallback((nodeId, updatedConfig) => {
10024
9940
  storeTakeSnapshot();
10025
9941
  setNodes(