@loopstack/loopstack-studio 0.23.1 → 0.25.0

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 (147) hide show
  1. package/dist/api/config.js +3 -3
  2. package/dist/api/index.js +10 -12
  3. package/dist/api/processor.js +1 -1
  4. package/dist/api/secrets.js +16 -0
  5. package/dist/api/workflows.js +7 -1
  6. package/dist/components/dynamic-form/ArrayController.js +68 -64
  7. package/dist/components/dynamic-form/CodeContent.js +3 -3
  8. package/dist/components/dynamic-form/Form.js +46 -40
  9. package/dist/components/dynamic-form/FormElement.js +1 -1
  10. package/dist/components/dynamic-form/FormElementHeader.js +2 -2
  11. package/dist/components/dynamic-form/ObjectController.js +24 -21
  12. package/dist/components/dynamic-form/fields/BaseFieldWrapper.js +1 -1
  13. package/dist/components/dynamic-form/fields/CodeViewField.js +36 -36
  14. package/dist/components/dynamic-form/fields/InputField.js +20 -19
  15. package/dist/components/dynamic-form/fields/RadioField.js +18 -18
  16. package/dist/components/dynamic-form/fields/SelectField.js +19 -19
  17. package/dist/components/dynamic-form/fields/TextareaField.js +17 -17
  18. package/dist/components/feedback/LoadingCentered.js +1 -1
  19. package/dist/components/layout/MainLayout.js +18 -31
  20. package/dist/components/layout/StudioSidebar.js +169 -109
  21. package/dist/components/loopstack-elements/link.js +77 -76
  22. package/dist/components/loopstack-elements/tool.js +171 -0
  23. package/dist/components/page/PageBreadcrumbs.js +79 -32
  24. package/dist/components/ui-widgets/UiActions.js +10 -4
  25. package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +8 -6
  26. package/dist/components/ui-widgets/widgets/SubmitButton.js +8 -6
  27. package/dist/features/code-explorer/components/FileContentViewer.js +92 -100
  28. package/dist/features/dashboard/RunItem.js +1 -1
  29. package/dist/features/debug/components/ConfigFlowViewer.js +2 -2
  30. package/dist/features/debug/components/{PipelineDebugHeader.js → WorkflowDebugHeader.js} +5 -5
  31. package/dist/features/debug/components/{PipelineDebugLegend.js → WorkflowDebugLegend.js} +2 -2
  32. package/dist/features/debug/components/{PipelineFlowViewer.js → WorkflowFlowViewer.js} +9 -9
  33. package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +46 -0
  34. package/dist/features/debug/index.js +2 -2
  35. package/dist/features/debug/lib/flow-utils.js +142 -150
  36. package/dist/features/documents/DocumentRenderer.js +66 -30
  37. package/dist/features/documents/components/DocumentItem.js +2 -2
  38. package/dist/features/documents/components/DocumentList.js +18 -11
  39. package/dist/features/documents/document-details/DocumentDetails.js +4 -4
  40. package/dist/features/documents/renderers/AiMessage.js +12 -12
  41. package/dist/features/documents/renderers/ChoicesRenderer.js +92 -0
  42. package/dist/features/documents/renderers/ClaudeMessage.js +1 -1
  43. package/dist/features/documents/renderers/ConfirmPromptRenderer.js +56 -0
  44. package/dist/features/documents/renderers/DocumentFormRenderer.js +95 -65
  45. package/dist/features/documents/renderers/LinkMessageRenderer.js +8 -10
  46. package/dist/features/documents/renderers/SecretInputRenderer.js +87 -0
  47. package/dist/features/documents/renderers/TextPromptRenderer.js +57 -0
  48. package/dist/features/documents/renderers/useDocumentTransition.js +30 -0
  49. package/dist/features/oauth/OAuthPromptRenderer.js +20 -20
  50. package/dist/features/runs/Runs.js +8 -8
  51. package/dist/features/workbench/Workbench.js +35 -35
  52. package/dist/features/workbench/WorkflowItem.js +10 -9
  53. package/dist/features/workbench/WorkflowList.js +56 -73
  54. package/dist/features/workbench/components/NewRunDialog.js +18 -18
  55. package/dist/features/workbench/components/WorkbenchFilesPanel.js +33 -26
  56. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +13 -44
  57. package/dist/features/workbench/components/WorkbenchFlowPanel.js +27 -29
  58. package/dist/features/workbench/components/WorkbenchIconSidebar.js +17 -17
  59. package/dist/features/workbench/components/WorkbenchPreviewPanel.js +2 -2
  60. package/dist/features/workbench/components/WorkbenchSecretsPanel.js +182 -0
  61. package/dist/features/workbench/components/WorkbenchSettingsModal.js +16 -41
  62. package/dist/features/workbench/components/WorkflowForms.js +14 -13
  63. package/dist/features/workbench/components/WorkflowHistoryItem.js +60 -81
  64. package/dist/features/workbench/components/{PipelineHistoryList.js → WorkflowHistoryList.js} +5 -5
  65. package/dist/features/workbench/components/buttons/WorkflowButtons.js +56 -54
  66. package/dist/features/workbench/hooks/useWorkflowData.js +10 -10
  67. package/dist/features/workbench/hooks/useWorkflowListState.js +8 -45
  68. package/dist/features/workbench/index.js +2 -3
  69. package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +132 -117
  70. package/dist/features/workbench/providers/ScrollProvider.js +2 -2
  71. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +4 -4
  72. package/dist/features/workspaces/Workspaces.js +1 -1
  73. package/dist/features/workspaces/components/CreateWorkspace.js +12 -12
  74. package/dist/features/workspaces/components/ExecutionTimeline.js +22 -21
  75. package/dist/features/workspaces/components/{NewPipelineRunDialog.js → NewWorkflowRunDialog.js} +6 -6
  76. package/dist/features/workspaces/components/{PipelineForm.js → WorkflowRunForm.js} +31 -31
  77. package/dist/features/workspaces/components/WorkspaceHomePage.js +11 -11
  78. package/dist/features/workspaces/components/{pipeline-form → workflow-form}/ArgumentsView.js +1 -1
  79. package/dist/features/workspaces/components/{pipeline-form → workflow-form}/SelectionView.js +16 -16
  80. package/dist/hooks/index.js +3 -3
  81. package/dist/hooks/query-keys.js +34 -68
  82. package/dist/hooks/useConfig.js +5 -5
  83. package/dist/hooks/useProcessor.js +5 -5
  84. package/dist/hooks/useSecrets.js +69 -0
  85. package/dist/hooks/useWorkflows.js +155 -68
  86. package/dist/index.d.ts +158 -116
  87. package/dist/index.js +5 -5
  88. package/dist/packages/contracts/dist/enums/index.js +11 -12
  89. package/dist/packages/contracts/dist/enums/workflow-state.enum.js +1 -1
  90. package/dist/pages/DashboardPage.js +87 -35
  91. package/dist/pages/DebugWorkflowDetailsPage.js +8 -8
  92. package/dist/pages/DebugWorkflowsPage.js +10 -10
  93. package/dist/pages/EmbedWorkbenchPage.js +39 -45
  94. package/dist/pages/PreviewWorkbenchPage.js +130 -255
  95. package/dist/pages/RunsListPage.js +1 -1
  96. package/dist/pages/StudioLandingPage.js +13 -13
  97. package/dist/pages/WorkbenchPage.js +6 -6
  98. package/dist/pages/WorkflowDebugPage.js +114 -0
  99. package/dist/pages/WorkspacePage.js +4 -2
  100. package/dist/providers/InvalidationEventsProvider.js +19 -19
  101. package/dist/providers/SseProvider.js +0 -1
  102. package/dist/routing/LocalRouter.js +14 -17
  103. package/dist/types/ai.types.js +13 -0
  104. package/package.json +2 -3
  105. package/dist/api/namespaces.js +0 -7
  106. package/dist/api/pipelines.js +0 -13
  107. package/dist/components/ai-elements/tool.js +0 -158
  108. package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +0 -41
  109. package/dist/features/workbench/NavigationItems.js +0 -52
  110. package/dist/features/workbench/WorkbenchNavigation.js +0 -38
  111. package/dist/features/workbench/components/NavigationItem.js +0 -68
  112. package/dist/features/workbench/hooks/useIntersectionObserver.js +0 -44
  113. package/dist/hooks/useNamespaceTree.js +0 -27
  114. package/dist/hooks/useNamespaces.js +0 -25
  115. package/dist/hooks/usePipelines.js +0 -161
  116. package/dist/node_modules/@ai-sdk/provider/dist/index.js +0 -65
  117. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +0 -1008
  118. package/dist/node_modules/ai/dist/index.js +0 -1083
  119. package/dist/node_modules/zod/v3/ZodError.js +0 -79
  120. package/dist/node_modules/zod/v3/errors.js +0 -6
  121. package/dist/node_modules/zod/v3/helpers/errorUtil.js +0 -5
  122. package/dist/node_modules/zod/v3/helpers/parseUtil.js +0 -90
  123. package/dist/node_modules/zod/v3/helpers/util.js +0 -72
  124. package/dist/node_modules/zod/v3/locales/en.js +0 -58
  125. package/dist/node_modules/zod/v3/types.js +0 -2425
  126. package/dist/node_modules/zod/v4/classic/errors.js +0 -21
  127. package/dist/node_modules/zod/v4/classic/iso.js +0 -29
  128. package/dist/node_modules/zod/v4/classic/parse.js +0 -4
  129. package/dist/node_modules/zod/v4/classic/schemas.js +0 -392
  130. package/dist/node_modules/zod/v4/core/api.js +0 -532
  131. package/dist/node_modules/zod/v4/core/checks.js +0 -283
  132. package/dist/node_modules/zod/v4/core/core.js +0 -44
  133. package/dist/node_modules/zod/v4/core/doc.js +0 -21
  134. package/dist/node_modules/zod/v4/core/errors.js +0 -40
  135. package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -305
  136. package/dist/node_modules/zod/v4/core/parse.js +0 -66
  137. package/dist/node_modules/zod/v4/core/regexes.js +0 -28
  138. package/dist/node_modules/zod/v4/core/registries.js +0 -38
  139. package/dist/node_modules/zod/v4/core/schemas.js +0 -863
  140. package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -220
  141. package/dist/node_modules/zod/v4/core/util.js +0 -267
  142. package/dist/node_modules/zod/v4/core/versions.js +0 -6
  143. package/dist/packages/contracts/dist/enums/pipeline-state.js +0 -10
  144. package/dist/pages/PipelineDebugPage.js +0 -115
  145. /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/StateNode.js +0 -0
  146. /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/WorkflowTransitionEdge.js +0 -0
  147. /package/dist/features/workspaces/components/{pipeline-form → workflow-form}/HeaderSection.js +0 -0
@@ -6,7 +6,7 @@ import { c } from "react/compiler-runtime";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { Settings } from "lucide-react";
8
8
  var WorkbenchSettingsModal_default = (p) => {
9
- let m = c(24), { settings: h, onSettingsChange: g, open: _, onOpenChange: v } = p, y;
9
+ let m = c(15), { settings: h, onSettingsChange: g, open: _, onOpenChange: v } = p, y;
10
10
  m[0] !== g || m[1] !== h ? (y = (e, f) => {
11
11
  g({
12
12
  ...h,
@@ -40,50 +40,25 @@ var WorkbenchSettingsModal_default = (p) => {
40
40
  let w;
41
41
  m[6] === b ? w = m[7] : (w = (e) => b("enableDebugMode", e), m[6] = b, m[7] = w);
42
42
  let T;
43
- m[8] !== h.enableDebugMode || m[9] !== w ? (T = /* @__PURE__ */ jsxs("div", {
44
- className: "flex items-center justify-between space-x-2",
45
- children: [C, /* @__PURE__ */ jsx(Switch, {
46
- id: "debug-mode",
47
- checked: h.enableDebugMode,
48
- onCheckedChange: w
49
- })]
50
- }), m[8] = h.enableDebugMode, m[9] = w, m[10] = T) : T = m[10];
51
- let E;
52
- m[11] === Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ jsxs("div", {
53
- className: "flex-1",
54
- children: [/* @__PURE__ */ jsx(Label, {
55
- htmlFor: "message-history",
56
- className: "text-sm font-medium",
57
- children: "Full Message History"
58
- }), /* @__PURE__ */ jsx("p", {
59
- className: "text-muted-foreground text-sm",
60
- children: "Show all internal messages and prompts"
61
- })]
62
- }), m[11] = E) : E = m[11];
63
- let D;
64
- m[12] === b ? D = m[13] : (D = (e) => b("showFullMessageHistory", e), m[12] = b, m[13] = D);
65
- let O;
66
- m[14] !== h.showFullMessageHistory || m[15] !== D ? (O = /* @__PURE__ */ jsxs("div", {
67
- className: "flex items-center justify-between space-x-2",
68
- children: [E, /* @__PURE__ */ jsx(Switch, {
69
- id: "message-history",
70
- checked: h.showFullMessageHistory,
71
- onCheckedChange: D
72
- })]
73
- }), m[14] = h.showFullMessageHistory, m[15] = D, m[16] = O) : O = m[16];
74
- let k;
75
- m[17] !== T || m[18] !== O ? (k = /* @__PURE__ */ jsxs(DialogContent, {
43
+ m[8] !== h.enableDebugMode || m[9] !== w ? (T = /* @__PURE__ */ jsxs(DialogContent, {
76
44
  className: "sm:max-w-md",
77
- children: [S, /* @__PURE__ */ jsxs("div", {
45
+ children: [S, /* @__PURE__ */ jsx("div", {
78
46
  className: "flex flex-col gap-4 p-4",
79
- children: [T, O]
47
+ children: /* @__PURE__ */ jsxs("div", {
48
+ className: "flex items-center justify-between space-x-2",
49
+ children: [C, /* @__PURE__ */ jsx(Switch, {
50
+ id: "debug-mode",
51
+ checked: h.enableDebugMode,
52
+ onCheckedChange: w
53
+ })]
54
+ })
80
55
  })]
81
- }), m[17] = T, m[18] = O, m[19] = k) : k = m[19];
82
- let A;
83
- return m[20] !== v || m[21] !== _ || m[22] !== k ? (A = /* @__PURE__ */ jsxs(Dialog, {
56
+ }), m[8] = h.enableDebugMode, m[9] = w, m[10] = T) : T = m[10];
57
+ let E;
58
+ return m[11] !== v || m[12] !== _ || m[13] !== T ? (E = /* @__PURE__ */ jsxs(Dialog, {
84
59
  open: _,
85
60
  onOpenChange: v,
86
- children: [x, k]
87
- }), m[20] = v, m[21] = _, m[22] = k, m[23] = A) : A = m[23], A;
61
+ children: [x, T]
62
+ }), m[11] = v, m[12] = _, m[13] = T, m[14] = E) : E = m[14], E;
88
63
  };
89
64
  export { WorkbenchSettingsModal_default as default };
@@ -1,21 +1,22 @@
1
+ import { useWorkflowConfigByName } from "../../../hooks/useWorkflows.js";
1
2
  import { require_enums } from "../../../packages/contracts/dist/enums/index.js";
2
3
  import UiActions_default from "../../../components/ui-widgets/UiActions.js";
3
4
  import { c } from "react/compiler-runtime";
4
5
  import React from "react";
5
6
  import { jsx } from "react/jsx-runtime";
6
- var import_enums = require_enums(), WorkflowForms_default = (e) => {
7
- let o = c(8), { workflow: s, onSubmit: l } = e, u = s.ui?.actions;
8
- if (!u?.length) return null;
9
- let d;
10
- o[0] === s.availableTransitions ? d = o[1] : (d = s.availableTransitions?.map(_temp) ?? [], o[0] = s.availableTransitions, o[1] = d);
11
- let f = d, p = u, m = s.status === import_enums.WorkflowState.Completed, h;
12
- return o[2] !== f || o[3] !== l || o[4] !== p || o[5] !== m || o[6] !== s.place ? (h = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(UiActions_default, {
13
- actions: p,
14
- availableTransitions: f,
15
- currentPlace: s.place,
16
- disabled: m,
17
- onSubmit: l
18
- }) }), o[2] = f, o[3] = l, o[4] = p, o[5] = m, o[6] = s.place, o[7] = h) : h = o[7], h;
7
+ var import_enums = require_enums(), WorkflowForms_default = (o) => {
8
+ let s = c(8), { workflow: l, onSubmit: u } = o, d = useWorkflowConfigByName(l.className ?? void 0).data?.ui, f = d?.widgets ?? d?.actions;
9
+ if (!f?.length) return null;
10
+ let p;
11
+ s[0] === l.availableTransitions ? p = s[1] : (p = l.availableTransitions?.map(_temp) ?? [], s[0] = l.availableTransitions, s[1] = p);
12
+ let m = p, h = f, g = l.status === import_enums.WorkflowState.Completed, _;
13
+ return s[2] !== m || s[3] !== u || s[4] !== h || s[5] !== g || s[6] !== l.place ? (_ = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(UiActions_default, {
14
+ actions: h,
15
+ availableTransitions: m,
16
+ currentPlace: l.place,
17
+ disabled: g,
18
+ onSubmit: u
19
+ }) }), s[2] = m, s[3] = u, s[4] = h, s[5] = g, s[6] = l.place, s[7] = _) : _ = s[7], _;
19
20
  };
20
21
  function _temp(e) {
21
22
  return e.id;
@@ -1,17 +1,16 @@
1
+ import { useWorkflowCheckpoints } from "../../../hooks/useWorkflows.js";
1
2
  import { cn } from "../../../lib/utils.js";
2
3
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../components/ui/collapsible.js";
3
- import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/ui/tooltip.js";
4
- import { useWorkflow } from "../../../hooks/useWorkflows.js";
5
4
  import { c } from "react/compiler-runtime";
6
5
  import React from "react";
7
6
  import { jsx, jsxs } from "react/jsx-runtime";
8
- import { ChevronRight, Clock, Loader2, Play, Wrench } from "lucide-react";
7
+ import { ChevronRight, Clock, Loader2, Play } from "lucide-react";
9
8
  import { format } from "date-fns";
10
- var WorkflowHistoryItem_default = (_) => {
11
- let y = c(19), { workflowId: b, workflow: x } = _, S = useWorkflow(b), C = S.data?.history;
12
- if (S.isLoading) {
13
- let t;
14
- return y[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ jsx("li", {
9
+ var WorkflowHistoryItem_default = (m) => {
10
+ let h = c(19), { workflowId: g, workflow: _ } = m, v = useWorkflowCheckpoints(g), y = v.data;
11
+ if (v.isLoading) {
12
+ let e;
13
+ return h[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx("li", {
15
14
  className: "group/menu-item relative list-none",
16
15
  children: /* @__PURE__ */ jsxs("div", {
17
16
  className: "flex w-full items-center gap-2 rounded-md p-2 text-sm opacity-50",
@@ -20,130 +19,110 @@ var WorkflowHistoryItem_default = (_) => {
20
19
  children: "Loading..."
21
20
  })]
22
21
  })
23
- }), y[0] = t) : t = y[0], t;
22
+ }), h[0] = e) : e = h[0], e;
24
23
  }
25
- if (!C?.length) return null;
26
- let w;
27
- y[1] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(Play, { className: "text-primary h-3.5 w-3.5 fill-current" }), y[1] = w) : w = y[1];
28
- let T = x.title ?? x.blockName, E;
29
- y[2] === T ? E = y[3] : (E = /* @__PURE__ */ jsx("span", {
24
+ if (!y?.length) return null;
25
+ let b;
26
+ h[1] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ jsx(Play, { className: "text-primary h-3.5 w-3.5 fill-current" }), h[1] = b) : b = h[1];
27
+ let x = _.title ?? _.alias, S;
28
+ h[2] === x ? S = h[3] : (S = /* @__PURE__ */ jsx("span", {
30
29
  className: "truncate text-sm",
31
- children: T
32
- }), y[2] = T, y[3] = E);
33
- let D;
34
- y[4] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ jsx(ChevronRight, { className: "text-muted-foreground ml-auto h-3.5 w-3.5 transition-transform group-data-[state=open]/collapsible:rotate-90" }), y[4] = D) : D = y[4];
35
- let O;
36
- y[5] === E ? O = y[6] : (O = /* @__PURE__ */ jsx(CollapsibleTrigger, {
30
+ children: x
31
+ }), h[2] = x, h[3] = S);
32
+ let C;
33
+ h[4] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(ChevronRight, { className: "text-muted-foreground ml-auto h-3.5 w-3.5 transition-transform group-data-[state=open]/collapsible:rotate-90" }), h[4] = C) : C = h[4];
34
+ let w;
35
+ h[5] === S ? w = h[6] : (w = /* @__PURE__ */ jsx(CollapsibleTrigger, {
37
36
  asChild: !0,
38
37
  children: /* @__PURE__ */ jsxs("button", {
39
38
  className: "hover:bg-accent hover:text-accent-foreground group/trigger flex w-full items-center gap-2 rounded-md p-2 text-left text-sm font-medium",
40
39
  children: [
41
- w,
42
- E,
43
- D
40
+ b,
41
+ S,
42
+ C
44
43
  ]
45
44
  })
46
- }), y[5] = E, y[6] = O);
47
- let k;
48
- y[7] === Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ jsx("div", { className: "from-primary/60 via-primary/30 to-muted/20 absolute top-7 bottom-3 left-1.75 w-0.5 rounded-full bg-linear-to-b" }), y[7] = k) : k = y[7];
49
- let A;
50
- y[8] === Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ jsx("div", {
45
+ }), h[5] = S, h[6] = w);
46
+ let T;
47
+ h[7] === Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ jsx("div", { className: "from-primary/60 via-primary/30 to-muted/20 absolute top-7 bottom-3 left-1.75 w-0.5 rounded-full bg-linear-to-b" }), h[7] = T) : T = h[7];
48
+ let E;
49
+ h[8] === Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ jsx("div", {
51
50
  className: "relative z-10 flex shrink-0 items-center justify-center",
52
51
  children: /* @__PURE__ */ jsx("div", { className: "border-primary/60 bg-primary/20 flex h-4 w-4 items-center justify-center rounded-full border-2" })
53
- }), y[8] = A) : A = y[8];
54
- let j;
55
- y[9] === Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ jsxs("div", {
52
+ }), h[8] = E) : E = h[8];
53
+ let D;
54
+ h[9] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ jsxs("div", {
56
55
  className: "group/entry relative flex gap-3 py-1 pl-0",
57
- children: [A, /* @__PURE__ */ jsx("div", {
56
+ children: [E, /* @__PURE__ */ jsx("div", {
58
57
  className: "flex min-w-0 flex-1 items-center gap-1.5",
59
58
  children: /* @__PURE__ */ jsx("span", {
60
59
  className: "bg-muted text-foreground w-fit truncate rounded px-1.5 py-0.5 font-mono text-xs font-medium",
61
60
  children: "start"
62
61
  })
63
62
  })]
64
- }), y[9] = j) : j = y[9];
65
- let M;
66
- if (y[10] !== C) {
67
- let f;
68
- y[12] === C.length ? f = y[13] : (f = (f, p) => {
69
- console.log(f);
70
- let m = f.data?.transition, h = Object.keys(f.data?.tools ?? {}), g = p === C.length - 1, _ = f.data?.place ?? m?.to ?? "unknown", v = m?.id;
63
+ }), h[9] = D) : D = h[9];
64
+ let O;
65
+ if (h[10] !== y) {
66
+ let e;
67
+ h[12] === y.length ? e = h[13] : (e = (e, u) => {
68
+ let d = u === y.length - 1, f = e.place ?? "unknown", p = e.transitionId;
71
69
  return /* @__PURE__ */ jsxs("div", {
72
70
  className: "group/entry relative flex gap-3 py-1 pl-0",
73
71
  children: [/* @__PURE__ */ jsx("div", {
74
72
  className: "relative z-10 flex shrink-0 items-center justify-center",
75
73
  children: /* @__PURE__ */ jsx("div", {
76
- className: cn("flex h-4 w-4 items-center justify-center rounded-full border-2 transition-all", g ? "border-primary bg-primary shadow-primary/40 shadow-sm" : "border-muted-foreground/30 bg-background"),
77
- children: g && /* @__PURE__ */ jsx("div", { className: "bg-primary-foreground h-1.5 w-1.5 animate-pulse rounded-full" })
74
+ className: cn("flex h-4 w-4 items-center justify-center rounded-full border-2 transition-all", d ? "border-primary bg-primary shadow-primary/40 shadow-sm" : "border-muted-foreground/30 bg-background"),
75
+ children: d && /* @__PURE__ */ jsx("div", { className: "bg-primary-foreground h-1.5 w-1.5 animate-pulse rounded-full" })
78
76
  })
79
77
  }), /* @__PURE__ */ jsxs("div", {
80
78
  className: "flex min-w-0 flex-1 flex-col gap-0.5",
81
79
  children: [/* @__PURE__ */ jsxs("div", {
82
80
  className: "flex items-baseline gap-1.5",
83
81
  children: [/* @__PURE__ */ jsx("span", {
84
- className: cn("w-fit truncate rounded px-1.5 py-0.5 font-mono text-xs font-medium", g ? "bg-primary/15 text-primary" : "bg-muted/60 text-muted-foreground"),
85
- children: _
86
- }), v && /* @__PURE__ */ jsxs("span", {
82
+ className: cn("w-fit truncate rounded px-1.5 py-0.5 font-mono text-xs font-medium", d ? "bg-primary/15 text-primary" : "bg-muted/60 text-muted-foreground"),
83
+ children: f
84
+ }), p && /* @__PURE__ */ jsxs("span", {
87
85
  className: "text-muted-foreground truncate text-[10px] italic",
88
86
  children: [
89
87
  "(via ",
90
- v,
88
+ p,
91
89
  ")"
92
90
  ]
93
91
  })]
94
- }), /* @__PURE__ */ jsxs("div", {
92
+ }), /* @__PURE__ */ jsx("div", {
95
93
  className: "text-muted-foreground flex items-center gap-2 text-[10px]",
96
- children: [h.length > 0 && /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
97
- asChild: !0,
98
- children: /* @__PURE__ */ jsxs("div", {
99
- className: "flex cursor-default items-center gap-0.5",
100
- children: [/* @__PURE__ */ jsx(Wrench, { className: "h-3 w-3" }), /* @__PURE__ */ jsx("span", {
101
- className: "tabular-nums",
102
- children: h.length
103
- })]
104
- })
105
- }), /* @__PURE__ */ jsxs(TooltipContent, {
106
- side: "right",
107
- className: "max-w-48",
108
- children: [/* @__PURE__ */ jsx("p", {
109
- className: "text-xs font-medium",
110
- children: "Tools used:"
111
- }), /* @__PURE__ */ jsx("p", {
112
- className: "text-muted-foreground text-[11px]",
113
- children: h.join(", ")
114
- })]
115
- })] }), /* @__PURE__ */ jsxs("div", {
94
+ children: /* @__PURE__ */ jsxs("div", {
116
95
  className: "flex items-center gap-0.5",
117
96
  children: [/* @__PURE__ */ jsx(Clock, { className: "h-3 w-3" }), /* @__PURE__ */ jsx("span", {
118
97
  className: "tabular-nums",
119
- children: format(new Date(f.timestamp), "HH:mm:ss")
98
+ children: format(new Date(e.createdAt), "HH:mm:ss")
120
99
  })]
121
- })]
100
+ })
122
101
  })]
123
102
  })]
124
- }, f.version);
125
- }, y[12] = C.length, y[13] = f), M = C.map(f), y[10] = C, y[11] = M;
126
- } else M = y[11];
127
- let N;
128
- y[14] === M ? N = y[15] : (N = /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("ul", {
103
+ }, e.version);
104
+ }, h[12] = y.length, h[13] = e), O = y.map(e), h[10] = y, h[11] = O;
105
+ } else O = h[11];
106
+ let k;
107
+ h[14] === O ? k = h[15] : (k = /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("ul", {
129
108
  className: "ml-2 flex min-w-0 flex-col gap-1 pl-0",
130
109
  children: /* @__PURE__ */ jsxs("div", {
131
110
  className: "relative py-2",
132
111
  children: [
133
- k,
134
- j,
135
- M
112
+ T,
113
+ D,
114
+ O
136
115
  ]
137
116
  })
138
- }) }), y[14] = M, y[15] = N);
139
- let P;
140
- return y[16] !== N || y[17] !== O ? (P = /* @__PURE__ */ jsx(Collapsible, {
117
+ }) }), h[14] = O, h[15] = k);
118
+ let A;
119
+ return h[16] !== k || h[17] !== w ? (A = /* @__PURE__ */ jsx(Collapsible, {
141
120
  defaultOpen: !0,
142
121
  className: "group/collapsible",
143
122
  children: /* @__PURE__ */ jsxs("li", {
144
123
  className: "group/menu-item relative list-none",
145
- children: [O, N]
124
+ children: [w, k]
146
125
  })
147
- }), y[16] = N, y[17] = O, y[18] = P) : P = y[18], P;
126
+ }), h[16] = k, h[17] = w, h[18] = A) : A = h[18], A;
148
127
  };
149
128
  export { WorkflowHistoryItem_default as default };
@@ -1,18 +1,18 @@
1
- import { useFetchWorkflowsByPipeline } from "../../../hooks/useWorkflows.js";
1
+ import { useChildWorkflows } from "../../../hooks/useWorkflows.js";
2
2
  import WorkflowHistoryItem_default from "./WorkflowHistoryItem.js";
3
3
  import { c } from "react/compiler-runtime";
4
4
  import React, { useMemo } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Clock, Loader2 } from "lucide-react";
7
- var PipelineHistoryList_default = (s) => {
8
- let l = c(10), { pipeline: u } = s, d = useFetchWorkflowsByPipeline(u?.id ?? ""), f;
7
+ var WorkflowHistoryList_default = (s) => {
8
+ let l = c(10), { workflow: u } = s, d = useChildWorkflows(u?.id), f;
9
9
  l[0] === d.data ? f = l[1] : (f = d.data ?? [], l[0] = d.data, l[1] = f);
10
10
  let p = f;
11
11
  if (!u) {
12
12
  let e;
13
13
  return l[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx("div", {
14
14
  className: "text-muted-foreground flex items-center justify-center py-8 text-sm",
15
- children: "No pipeline selected"
15
+ children: "No workflow selected"
16
16
  }), l[2] = e) : e = l[2], e;
17
17
  }
18
18
  if (d.isLoading) {
@@ -53,4 +53,4 @@ function _temp(e) {
53
53
  workflow: e
54
54
  }, e.id);
55
55
  }
56
- export { PipelineHistoryList_default as default };
56
+ export { WorkflowHistoryList_default as default };
@@ -1,47 +1,49 @@
1
+ import { useStudio } from "../../../../providers/StudioProvider.js";
2
+ import { useCreateWorkflow, useWorkflow } from "../../../../hooks/useWorkflows.js";
1
3
  import { Button } from "../../../../components/ui/button.js";
2
4
  import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../../../../components/ui/alert-dialog.js";
3
5
  import { Tooltip, TooltipContent, TooltipTrigger } from "../../../../components/ui/tooltip.js";
4
- import { useRunPipeline } from "../../../../hooks/useProcessor.js";
5
- import { useDeleteWorkflow, useWorkflow } from "../../../../hooks/useWorkflows.js";
6
+ import { useRunWorkflow } from "../../../../hooks/useProcessor.js";
6
7
  import { c } from "react/compiler-runtime";
7
8
  import React from "react";
8
9
  import { jsx, jsxs } from "react/jsx-runtime";
9
10
  import { LockOpen, Repeat } from "lucide-react";
10
- var WorkflowButtons_default = (w) => {
11
- let T = c(34), { pipeline: E, workflowId: D } = w, O = useWorkflow(D).data, k = useDeleteWorkflow(), A = useRunPipeline(), j;
12
- T[0] !== E.id || T[1] !== A ? (j = () => {
13
- A.mutate({
14
- pipelineId: E.id,
15
- runPipelinePayloadDto: {},
16
- force: !1
17
- });
18
- }, T[0] = E.id, T[1] = A, T[2] = j) : j = T[2];
19
- let M = j, N;
20
- T[3] !== E.id || T[4] !== A || T[5] !== D ? (N = () => {
21
- A.mutate({
22
- pipelineId: E.id,
23
- runPipelinePayloadDto: { transition: {
11
+ var WorkflowButtons_default = (T) => {
12
+ let E = c(34), { workflow: D, workflowId: O } = T, { router: k } = useStudio(), A = useWorkflow(O).data, j = useCreateWorkflow(), M = useRunWorkflow(), N = j.isPending || M.isPending, P;
13
+ E[0] !== j || E[1] !== k || E[2] !== M || E[3] !== D.alias || E[4] !== D.args || E[5] !== D.workspaceId ? (P = () => {
14
+ j.mutate({ workflowCreateDto: {
15
+ alias: D.alias,
16
+ title: null,
17
+ workspaceId: D.workspaceId,
18
+ transition: null,
19
+ args: D.args ?? {}
20
+ } }, { onSuccess: (t) => {
21
+ M.mutate({
22
+ workflowId: t.id,
23
+ runWorkflowPayloadDto: {},
24
+ force: !0
25
+ }, { onSuccess: () => {
26
+ k.navigateToWorkflow(t.id);
27
+ } });
28
+ } });
29
+ }, E[0] = j, E[1] = k, E[2] = M, E[3] = D.alias, E[4] = D.args, E[5] = D.workspaceId, E[6] = P) : P = E[6];
30
+ let F = P, I;
31
+ E[7] !== M || E[8] !== D.id || E[9] !== O ? (I = () => {
32
+ M.mutate({
33
+ workflowId: D.id,
34
+ runWorkflowPayloadDto: { transition: {
24
35
  name: "unlock",
25
- workflowId: D
36
+ workflowId: O
26
37
  } },
27
38
  force: !1
28
39
  });
29
- }, T[3] = E.id, T[4] = A, T[5] = D, T[6] = N) : N = T[6];
30
- let P = N, F;
31
- T[7] !== k || T[8] !== M || T[9] !== O ? (F = () => {
32
- if (O) try {
33
- k.mutate(O), M();
34
- } catch (t) {
35
- let C = t;
36
- console.error("Mutation failed:", C);
37
- }
38
- }, T[7] = k, T[8] = M, T[9] = O, T[10] = F) : F = T[10];
39
- let I = F;
40
- if (!O) return null;
41
- let L;
42
- T[11] === k.isPending ? L = T[12] : (L = k.isPending ? /* @__PURE__ */ jsx("div", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(Repeat, { className: "h-3.5 w-3.5" }), T[11] = k.isPending, T[12] = L);
40
+ }, E[7] = M, E[8] = D.id, E[9] = O, E[10] = I) : I = E[10];
41
+ let L = I;
42
+ if (!A) return null;
43
43
  let R;
44
- T[13] !== k.isPending || T[14] !== L ? (R = /* @__PURE__ */ jsx(TooltipTrigger, {
44
+ E[11] === N ? R = E[12] : (R = N ? /* @__PURE__ */ jsx("div", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(Repeat, { className: "h-3.5 w-3.5" }), E[11] = N, E[12] = R);
45
+ let z;
46
+ E[13] !== N || E[14] !== R ? (z = /* @__PURE__ */ jsx(TooltipTrigger, {
45
47
  asChild: !0,
46
48
  children: /* @__PURE__ */ jsx(AlertDialogTrigger, {
47
49
  asChild: !0,
@@ -49,28 +51,28 @@ var WorkflowButtons_default = (w) => {
49
51
  variant: "ghost",
50
52
  size: "icon",
51
53
  className: "h-7 w-7",
52
- disabled: k.isPending,
53
- children: L
54
+ disabled: N,
55
+ children: R
54
56
  })
55
57
  })
56
- }), T[13] = k.isPending, T[14] = L, T[15] = R) : R = T[15];
57
- let z;
58
- T[16] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ jsx(TooltipContent, { children: "Repeat" }), T[16] = z) : z = T[16];
58
+ }), E[13] = N, E[14] = R, E[15] = z) : z = E[15];
59
59
  let B;
60
- T[17] === R ? B = T[18] : (B = /* @__PURE__ */ jsxs(Tooltip, { children: [R, z] }), T[17] = R, T[18] = B);
60
+ E[16] === Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ jsx(TooltipContent, { children: "Repeat" }), E[16] = B) : B = E[16];
61
61
  let V;
62
- T[19] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Repeat workflow" }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: "This will delete the current workflow run and re-trigger the pipeline." })] }), T[19] = V) : V = T[19];
62
+ E[17] === z ? V = E[18] : (V = /* @__PURE__ */ jsxs(Tooltip, { children: [z, B] }), E[17] = z, E[18] = V);
63
63
  let H;
64
- T[20] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ jsx(AlertDialogCancel, { children: "Cancel" }), T[20] = H) : H = T[20];
64
+ E[19] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Repeat workflow" }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: "This will create a new run with the same arguments and redirect you to it." })] }), E[19] = H) : H = E[19];
65
65
  let U;
66
- T[21] === I ? U = T[22] : (U = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [V, /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [H, /* @__PURE__ */ jsx(AlertDialogAction, {
67
- onClick: I,
68
- children: "Repeat"
69
- })] })] }), T[21] = I, T[22] = U);
66
+ E[20] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ jsx(AlertDialogCancel, { children: "Cancel" }), E[20] = U) : U = E[20];
70
67
  let W;
71
- T[23] !== U || T[24] !== B ? (W = /* @__PURE__ */ jsxs(AlertDialog, { children: [B, U] }), T[23] = U, T[24] = B, T[25] = W) : W = T[25];
68
+ E[21] === F ? W = E[22] : (W = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [H, /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [U, /* @__PURE__ */ jsx(AlertDialogAction, {
69
+ onClick: F,
70
+ children: "Repeat"
71
+ })] })] }), E[21] = F, E[22] = W);
72
72
  let G;
73
- T[26] !== P || T[27] !== A.isPending || T[28] !== O.availableTransitions || T[29] !== O.place ? (G = O.place === "end" && O.availableTransitions?.find(_temp2) && /* @__PURE__ */ jsxs(AlertDialog, { children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
73
+ E[23] !== V || E[24] !== W ? (G = /* @__PURE__ */ jsxs(AlertDialog, { children: [V, W] }), E[23] = V, E[24] = W, E[25] = G) : G = E[25];
74
+ let K;
75
+ E[26] !== A.availableTransitions || E[27] !== A.place || E[28] !== L || E[29] !== M.isPending ? (K = A.place === "end" && A.availableTransitions?.find(_temp2) && /* @__PURE__ */ jsxs(AlertDialog, { children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
74
76
  asChild: !0,
75
77
  children: /* @__PURE__ */ jsx(AlertDialogTrigger, {
76
78
  asChild: !0,
@@ -78,20 +80,20 @@ var WorkflowButtons_default = (w) => {
78
80
  variant: "ghost",
79
81
  size: "icon",
80
82
  className: "h-7 w-7",
81
- disabled: A.isPending,
82
- children: A.isPending ? /* @__PURE__ */ jsx("div", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(LockOpen, { className: "h-3.5 w-3.5" })
83
+ disabled: M.isPending,
84
+ children: M.isPending ? /* @__PURE__ */ jsx("div", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(LockOpen, { className: "h-3.5 w-3.5" })
83
85
  })
84
86
  })
85
87
  }), /* @__PURE__ */ jsx(TooltipContent, { children: "Unlock Step" })] }), /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Unlock workflow" }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: "Are you sure you want to unlock this workflow?" })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, { children: "Cancel" }), /* @__PURE__ */ jsx(AlertDialogAction, {
86
- onClick: P,
88
+ onClick: L,
87
89
  children: "Unlock"
88
- })] })] })] }), T[26] = P, T[27] = A.isPending, T[28] = O.availableTransitions, T[29] = O.place, T[30] = G) : G = T[30];
89
- let K;
90
- return T[31] !== W || T[32] !== G ? (K = /* @__PURE__ */ jsxs("div", {
90
+ })] })] })] }), E[26] = A.availableTransitions, E[27] = A.place, E[28] = L, E[29] = M.isPending, E[30] = K) : K = E[30];
91
+ let q;
92
+ return E[31] !== G || E[32] !== K ? (q = /* @__PURE__ */ jsxs("div", {
91
93
  className: "flex items-center",
92
94
  onClick: _temp,
93
- children: [W, G]
94
- }), T[31] = W, T[32] = G, T[33] = K) : K = T[33], K;
95
+ children: [G, K]
96
+ }), E[31] = G, E[32] = K, E[33] = q) : q = E[33], q;
95
97
  };
96
98
  function _temp(t) {
97
99
  return t.stopPropagation();
@@ -1,12 +1,12 @@
1
- import { useRunPipeline } from "../../../hooks/useProcessor.js";
1
+ import { useWorkflow } from "../../../hooks/useWorkflows.js";
2
+ import { useRunWorkflow } from "../../../hooks/useProcessor.js";
2
3
  import { require_enums } from "../../../packages/contracts/dist/enums/index.js";
3
4
  import { useFilterDocuments } from "../../../hooks/useDocuments.js";
4
- import { useWorkflow } from "../../../hooks/useWorkflows.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { useCallback, useMemo } from "react";
7
7
  var import_enums = require_enums();
8
- function useWorkflowData(r) {
9
- let o = c(22), { workflowId: s, showFullMessageHistory: l } = r, u = useWorkflow(s), d = useFilterDocuments(s), f = useRunPipeline(), p;
8
+ function useWorkflowData(i) {
9
+ let o = c(21), { workflowId: s, showFullMessageHistory: l } = i, u = useWorkflow(s), d = useFilterDocuments(s), f = useRunWorkflow(), p;
10
10
  o[0] !== u.data?.place || o[1] !== l ? (p = (e) => {
11
11
  let r = e.meta, i = e.ui, a = r?.hidden || i?.hidden || !!r?.hideAtPlaces?.includes(u.data?.place ?? "");
12
12
  return !l && e.tags?.includes("internal") && (a = !0), !a;
@@ -22,18 +22,18 @@ function useWorkflowData(r) {
22
22
  o[4] !== d.data || o[5] !== m ? (e = d.data.filter(m), o[4] = d.data, o[5] = m, o[6] = e) : e = o[6], h = e;
23
23
  }
24
24
  let g = h, _;
25
- o[7] !== u.data || o[8] !== f || o[9] !== s ? (_ = (e, r) => {
25
+ o[7] !== f || o[8] !== s ? (_ = (e, r) => {
26
26
  f.mutate({
27
- pipelineId: u.data.pipelineId,
28
- runPipelinePayloadDto: { transition: {
27
+ workflowId: s,
28
+ runWorkflowPayloadDto: { transition: {
29
29
  id: e,
30
30
  workflowId: s,
31
31
  payload: r
32
32
  } }
33
33
  });
34
- }, o[7] = u.data, o[8] = f, o[9] = s, o[10] = _) : _ = o[10];
34
+ }, o[7] = f, o[8] = s, o[9] = _) : _ = o[9];
35
35
  let v = _, y = f.isPending || u.data?.status === import_enums.WorkflowState.Running, b = u.data?.errorMessage, x;
36
- return o[11] !== g || o[12] !== d.error || o[13] !== d.isLoading || o[14] !== d.isSuccess || o[15] !== u.data || o[16] !== u.isLoading || o[17] !== u.isSuccess || o[18] !== v || o[19] !== y || o[20] !== b ? (x = {
36
+ return o[10] !== g || o[11] !== d.error || o[12] !== d.isLoading || o[13] !== d.isSuccess || o[14] !== u.data || o[15] !== u.isLoading || o[16] !== u.isSuccess || o[17] !== v || o[18] !== y || o[19] !== b ? (x = {
37
37
  workflow: u.data,
38
38
  workflowLoading: u.isLoading,
39
39
  workflowReady: u.isSuccess,
@@ -44,6 +44,6 @@ function useWorkflowData(r) {
44
44
  documentsError: d.error,
45
45
  isLoading: y,
46
46
  handleRun: v
47
- }, o[11] = g, o[12] = d.error, o[13] = d.isLoading, o[14] = d.isSuccess, o[15] = u.data, o[16] = u.isLoading, o[17] = u.isSuccess, o[18] = v, o[19] = y, o[20] = b, o[21] = x) : x = o[21], x;
47
+ }, o[10] = g, o[11] = d.error, o[12] = d.isLoading, o[13] = d.isSuccess, o[14] = u.data, o[15] = u.isLoading, o[16] = u.isSuccess, o[17] = v, o[18] = y, o[19] = b, o[20] = x) : x = o[20], x;
48
48
  }
49
49
  export { useWorkflowData };
@@ -1,50 +1,13 @@
1
- import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
2
1
  import { useScrollToBottom } from "./useAutoScrollBottom.js";
3
- import { useIntersectionObserver } from "./useIntersectionObserver.js";
4
2
  import { useScrollToListItem } from "./useScrollToListItem.js";
5
3
  import { c } from "react/compiler-runtime";
6
- import { useEffect, useState } from "react";
7
- function useWorkflowListState(s) {
8
- let l = c(19), u;
9
- l[0] === Symbol.for("react.memo_cache_sentinel") ? (u = {}, l[0] = u) : u = l[0];
10
- let [d, f] = useState(u), { activeId: p, observe: m } = useIntersectionObserver("0px 0px 0px 0px"), { listRef: h, scrollTo: g } = useScrollToListItem(), { canScrollDown: _, scrollToBottom: v } = useScrollToBottom(), { activeSectionId: y, setActiveSectionId: b } = useWorkbenchLayout(), x, S;
11
- l[1] !== p || l[2] !== y || l[3] !== b ? (x = () => {
12
- y !== p && (b(p), p && f((e) => ({
13
- ...e,
14
- [p]: !0
15
- })));
16
- }, S = [
17
- p,
18
- y,
19
- b
20
- ], l[1] = p, l[2] = y, l[3] = b, l[4] = x, l[5] = S) : (x = l[4], S = l[5]), useEffect(x, S);
21
- let C, w;
22
- l[6] !== p || l[7] !== s ? (C = () => {
23
- if (s && s.length > 0) {
24
- let e = s[s.length - 1], o = `section-${e.index}-${e.id}`;
25
- f({
26
- [o]: !0,
27
- ...p && p !== o ? { [p]: !0 } : {}
28
- });
29
- }
30
- }, w = [s, p], l[6] = p, l[7] = s, l[8] = C, l[9] = w) : (C = l[8], w = l[9]), useEffect(C, w);
31
- let T;
32
- l[10] === Symbol.for("react.memo_cache_sentinel") ? (T = (e) => {
33
- f((o) => ({
34
- ...o,
35
- [e]: !o[e]
36
- }));
37
- }, l[10] = T) : T = l[10];
38
- let E = T, D;
39
- return l[11] !== p || l[12] !== _ || l[13] !== d || l[14] !== h || l[15] !== m || l[16] !== g || l[17] !== v ? (D = {
40
- activeId: p,
41
- expandedSections: d,
42
- observe: m,
43
- listRef: h,
44
- scrollTo: g,
45
- canScrollDown: _,
46
- scrollToBottom: v,
47
- toggleSection: E
48
- }, l[11] = p, l[12] = _, l[13] = d, l[14] = h, l[15] = m, l[16] = g, l[17] = v, l[18] = D) : D = l[18], D;
4
+ function useWorkflowListState() {
5
+ let r = c(5), { listRef: i, scrollTo: a } = useScrollToListItem(), { canScrollDown: o, scrollToBottom: s } = useScrollToBottom(), l;
6
+ return r[0] !== o || r[1] !== i || r[2] !== a || r[3] !== s ? (l = {
7
+ listRef: i,
8
+ scrollTo: a,
9
+ canScrollDown: o,
10
+ scrollToBottom: s
11
+ }, r[0] = o, r[1] = i, r[2] = a, r[3] = s, r[4] = l) : l = r[4], l;
49
12
  }
50
13
  export { useWorkflowListState };