@loopstack/loopstack-studio 0.24.0 → 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.
- package/dist/api/config.js +3 -3
- package/dist/api/index.js +9 -13
- package/dist/api/processor.js +1 -1
- package/dist/api/workflows.js +7 -1
- package/dist/components/dynamic-form/CodeContent.js +3 -3
- package/dist/components/dynamic-form/fields/CodeViewField.js +36 -36
- package/dist/components/feedback/LoadingCentered.js +1 -1
- package/dist/components/layout/StudioSidebar.js +2 -2
- package/dist/components/loopstack-elements/link.js +77 -76
- package/dist/components/loopstack-elements/tool.js +171 -0
- package/dist/components/ui-widgets/UiActions.js +10 -4
- package/dist/components/ui-widgets/UiWidget.js +27 -36
- package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +8 -6
- package/dist/components/ui-widgets/widgets/SubmitButton.js +8 -6
- package/dist/features/code-explorer/components/FileContentViewer.js +87 -112
- package/dist/features/dashboard/RunItem.js +1 -1
- package/dist/features/debug/components/ConfigFlowViewer.js +2 -2
- package/dist/features/debug/components/{PipelineDebugHeader.js → WorkflowDebugHeader.js} +5 -5
- package/dist/features/debug/components/{PipelineDebugLegend.js → WorkflowDebugLegend.js} +2 -2
- package/dist/features/debug/components/{PipelineFlowViewer.js → WorkflowFlowViewer.js} +9 -9
- package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +46 -0
- package/dist/features/debug/index.js +2 -2
- package/dist/features/debug/lib/flow-utils.js +142 -150
- package/dist/features/documents/DocumentRenderer.js +66 -30
- package/dist/features/documents/components/DocumentItem.js +2 -2
- package/dist/features/documents/components/DocumentList.js +15 -12
- package/dist/features/documents/document-details/DocumentDetails.js +4 -4
- package/dist/features/documents/renderers/AiMessage.js +1 -1
- package/dist/features/documents/renderers/ChoicesRenderer.js +92 -0
- package/dist/features/documents/renderers/ClaudeMessage.js +1 -1
- package/dist/features/documents/renderers/ConfirmPromptRenderer.js +56 -0
- package/dist/features/documents/renderers/DocumentFormRenderer.js +95 -71
- package/dist/features/documents/renderers/LinkMessageRenderer.js +8 -10
- package/dist/features/documents/renderers/SecretInputRenderer.js +87 -0
- package/dist/features/documents/renderers/TextPromptRenderer.js +57 -0
- package/dist/features/documents/renderers/useDocumentTransition.js +30 -0
- package/dist/features/oauth/OAuthPromptRenderer.js +20 -20
- package/dist/features/runs/Runs.js +8 -8
- package/dist/features/workbench/Workbench.js +35 -35
- package/dist/features/workbench/WorkflowItem.js +10 -9
- package/dist/features/workbench/WorkflowList.js +56 -73
- package/dist/features/workbench/components/NewRunDialog.js +18 -18
- package/dist/features/workbench/components/WorkbenchFilesPanel.js +1 -1
- package/dist/features/workbench/components/WorkbenchFloatingPanel.js +33 -72
- package/dist/features/workbench/components/WorkbenchFlowPanel.js +27 -29
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +30 -42
- package/dist/features/workbench/components/WorkbenchPreviewPanel.js +2 -2
- package/dist/features/workbench/components/WorkbenchSecretsPanel.js +1 -1
- package/dist/features/workbench/components/WorkbenchSettingsModal.js +16 -41
- package/dist/features/workbench/components/WorkflowForms.js +14 -13
- package/dist/features/workbench/components/WorkflowHistoryItem.js +60 -81
- package/dist/features/workbench/components/{PipelineHistoryList.js → WorkflowHistoryList.js} +5 -5
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +56 -54
- package/dist/features/workbench/hooks/useWorkflowData.js +10 -10
- package/dist/features/workbench/hooks/useWorkflowListState.js +8 -45
- package/dist/features/workbench/index.js +2 -3
- package/dist/features/workbench/providers/ScrollProvider.js +2 -2
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +4 -4
- package/dist/features/workspaces/Workspaces.js +1 -1
- package/dist/features/workspaces/components/CreateWorkspace.js +12 -12
- package/dist/features/workspaces/components/ExecutionTimeline.js +22 -21
- package/dist/features/workspaces/components/{NewPipelineRunDialog.js → NewWorkflowRunDialog.js} +6 -6
- package/dist/features/workspaces/components/{PipelineForm.js → WorkflowRunForm.js} +31 -31
- package/dist/features/workspaces/components/WorkspaceHomePage.js +11 -11
- package/dist/features/workspaces/components/{pipeline-form → workflow-form}/ArgumentsView.js +1 -1
- package/dist/features/workspaces/components/{pipeline-form → workflow-form}/SelectionView.js +16 -16
- package/dist/hooks/index.js +3 -3
- package/dist/hooks/query-keys.js +31 -72
- package/dist/hooks/useConfig.js +5 -5
- package/dist/hooks/useProcessor.js +5 -5
- package/dist/hooks/useWorkflows.js +155 -68
- package/dist/index.d.ts +127 -128
- package/dist/index.js +5 -5
- package/dist/packages/contracts/dist/enums/index.js +11 -12
- package/dist/packages/contracts/dist/enums/workflow-state.enum.js +1 -1
- package/dist/pages/DebugWorkflowDetailsPage.js +8 -8
- package/dist/pages/DebugWorkflowsPage.js +10 -10
- package/dist/pages/EmbedWorkbenchPage.js +42 -52
- package/dist/pages/PreviewWorkbenchPage.js +130 -255
- package/dist/pages/RunsListPage.js +1 -1
- package/dist/pages/StudioLandingPage.js +13 -13
- package/dist/pages/WorkbenchPage.js +6 -6
- package/dist/pages/WorkflowDebugPage.js +114 -0
- package/dist/pages/WorkspacePage.js +4 -2
- package/dist/providers/InvalidationEventsProvider.js +19 -19
- package/dist/providers/SseProvider.js +0 -1
- package/dist/routing/LocalRouter.js +14 -17
- package/package.json +2 -2
- package/dist/api/namespaces.js +0 -7
- package/dist/api/pipelines.js +0 -13
- package/dist/components/ai-elements/tool.js +0 -158
- package/dist/components/ui-widgets/widgets/SecretInput.js +0 -42
- package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +0 -41
- package/dist/features/workbench/NavigationItems.js +0 -52
- package/dist/features/workbench/WorkbenchNavigation.js +0 -38
- package/dist/features/workbench/components/NavigationItem.js +0 -68
- package/dist/features/workbench/hooks/useIntersectionObserver.js +0 -44
- package/dist/hooks/useNamespaceTree.js +0 -27
- package/dist/hooks/useNamespaces.js +0 -25
- package/dist/hooks/usePipelines.js +0 -161
- package/dist/packages/contracts/dist/enums/pipeline-state.js +0 -10
- package/dist/pages/PipelineDebugPage.js +0 -115
- /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/StateNode.js +0 -0
- /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/WorkflowTransitionEdge.js +0 -0
- /package/dist/features/workspaces/components/{pipeline-form → workflow-form}/HeaderSection.js +0 -0
|
@@ -13,18 +13,18 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import { Loader2, Star } from "lucide-react";
|
|
14
14
|
import { DialogTitle } from "@radix-ui/react-dialog";
|
|
15
15
|
var CreateWorkspace_default = (ye) => {
|
|
16
|
-
let a = c(87), { types: o, workspace: s, onSuccess: l } = ye, u = useCreateWorkspace(), d = useUpdateWorkspace(), [f, be] = useState(o[0]?.
|
|
16
|
+
let a = c(87), { types: o, workspace: s, onSuccess: l } = ye, u = useCreateWorkspace(), d = useUpdateWorkspace(), [f, be] = useState(o[0]?.className ?? ""), [p, xe] = useState(s?.isFavourite ?? !1), m;
|
|
17
17
|
a[0] === Symbol.for("react.memo_cache_sentinel") ? (m = {}, a[0] = m) : m = a[0];
|
|
18
18
|
let [h, g] = useState(m), _;
|
|
19
|
-
a[1] === o[0]?.
|
|
20
|
-
be(o[0]?.
|
|
21
|
-
}, a[1] = o[0]?.
|
|
19
|
+
a[1] === o[0]?.className ? _ = a[2] : (_ = () => {
|
|
20
|
+
be(o[0]?.className ?? "");
|
|
21
|
+
}, a[1] = o[0]?.className, a[2] = _);
|
|
22
22
|
let v;
|
|
23
23
|
a[3] === o ? v = a[4] : (v = [o], a[3] = o, a[4] = v), useEffect(_, v);
|
|
24
24
|
let y;
|
|
25
25
|
if (a[5] !== o || a[6] !== f) {
|
|
26
26
|
let e;
|
|
27
|
-
a[8] === f ? e = a[9] : (e = (e) => e.
|
|
27
|
+
a[8] === f ? e = a[9] : (e = (e) => e.className === f, a[8] = f, a[9] = e), y = o.find(e), a[5] = o, a[6] = f, a[7] = y;
|
|
28
28
|
} else y = a[7];
|
|
29
29
|
let Se = y, b;
|
|
30
30
|
a[10] === Se?.environments ? b = a[11] : (b = Se?.environments ?? [], a[10] = Se?.environments, a[11] = b);
|
|
@@ -109,7 +109,7 @@ var CreateWorkspace_default = (ye) => {
|
|
|
109
109
|
let t = new FormData(e.currentTarget).get("name");
|
|
110
110
|
f && u.mutate({ workspaceCreateDto: {
|
|
111
111
|
title: t || void 0,
|
|
112
|
-
|
|
112
|
+
className: f,
|
|
113
113
|
isFavourite: p || void 0,
|
|
114
114
|
environments: P()
|
|
115
115
|
} }, { onSuccess: () => {
|
|
@@ -164,14 +164,14 @@ var CreateWorkspace_default = (ye) => {
|
|
|
164
164
|
a[59] !== o || a[60] !== s || a[61] !== f ? (q = !s && o.length > 1 && /* @__PURE__ */ jsxs("div", {
|
|
165
165
|
className: "space-y-2",
|
|
166
166
|
children: [/* @__PURE__ */ jsx(Label, {
|
|
167
|
-
htmlFor: "
|
|
167
|
+
htmlFor: "className",
|
|
168
168
|
children: "Type"
|
|
169
169
|
}), /* @__PURE__ */ jsxs(Select, {
|
|
170
|
-
name: "
|
|
170
|
+
name: "className",
|
|
171
171
|
value: f,
|
|
172
172
|
onValueChange: Ce,
|
|
173
173
|
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
174
|
-
id: "
|
|
174
|
+
id: "className",
|
|
175
175
|
className: "w-full",
|
|
176
176
|
children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select a type" })
|
|
177
177
|
}), /* @__PURE__ */ jsx(SelectContent, { children: o.map(_temp3) })]
|
|
@@ -227,8 +227,8 @@ function _temp2(e) {
|
|
|
227
227
|
}
|
|
228
228
|
function _temp3(e) {
|
|
229
229
|
return /* @__PURE__ */ jsx(SelectItem, {
|
|
230
|
-
value: e.
|
|
231
|
-
children: e.title ?? e.
|
|
232
|
-
}, e.
|
|
230
|
+
value: e.className,
|
|
231
|
+
children: e.title ?? e.className
|
|
232
|
+
}, e.className);
|
|
233
233
|
}
|
|
234
234
|
export { CreateWorkspace_default as default };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { useStudio } from "../../../providers/StudioProvider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { useBatchDeleteWorkflows, useChildWorkflows, useFilterWorkflows } from "../../../hooks/useWorkflows.js";
|
|
3
3
|
import { Badge } from "../../../components/ui/badge.js";
|
|
4
4
|
import CustomListView_default from "../../../components/lists/CustomListView.js";
|
|
5
5
|
import ErrorSnackbar_default from "../../../components/feedback/ErrorSnackbar.js";
|
|
6
6
|
import { require_enums } from "../../../packages/contracts/dist/enums/index.js";
|
|
7
|
-
import
|
|
7
|
+
import NewWorkflowRunDialog_default from "./NewWorkflowRunDialog.js";
|
|
8
8
|
import { c } from "react/compiler-runtime";
|
|
9
9
|
import React, { useEffect, useState } from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { useQueryClient } from "@tanstack/react-query";
|
|
12
12
|
import { ChevronDown, ChevronRight, Loader2 } from "lucide-react";
|
|
13
13
|
import { format, formatDistanceToNow, isToday, isYesterday, parseISO } from "date-fns";
|
|
14
|
-
var import_enums = require_enums(),
|
|
15
|
-
let n = c(15), { parentId: i, formatUpdatedTime: a,
|
|
14
|
+
var import_enums = require_enums(), ChildWorkflowList = (e) => {
|
|
15
|
+
let n = c(15), { parentId: i, formatUpdatedTime: a, getWorkflowStateColor: o, onChildClick: s } = e, { data: l, isPending: u } = useChildWorkflows(i, !0);
|
|
16
16
|
if (u) {
|
|
17
17
|
let e;
|
|
18
18
|
return n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx("div", {
|
|
@@ -21,7 +21,7 @@ var import_enums = require_enums(), ChildPipelineList = (e) => {
|
|
|
21
21
|
}), n[0] = e) : e = n[0], e;
|
|
22
22
|
}
|
|
23
23
|
let d;
|
|
24
|
-
n[1] === l
|
|
24
|
+
n[1] === l ? d = n[2] : (d = l ?? [], n[1] = l, n[2] = d);
|
|
25
25
|
let f = d;
|
|
26
26
|
if (f.length === 0) {
|
|
27
27
|
let e;
|
|
@@ -50,7 +50,7 @@ var import_enums = require_enums(), ChildPipelineList = (e) => {
|
|
|
50
50
|
}),
|
|
51
51
|
/* @__PURE__ */ jsx("p", {
|
|
52
52
|
className: "text-xs text-gray-500",
|
|
53
|
-
children: e.
|
|
53
|
+
children: e.alias
|
|
54
54
|
}),
|
|
55
55
|
/* @__PURE__ */ jsx("p", {
|
|
56
56
|
className: "text-xs text-gray-400",
|
|
@@ -80,14 +80,14 @@ var import_enums = require_enums(), ChildPipelineList = (e) => {
|
|
|
80
80
|
}, s[1] = E) : E = s[1];
|
|
81
81
|
let D = E, O, k;
|
|
82
82
|
s[2] === g ? (O = s[3], k = s[4]) : (O = () => {
|
|
83
|
-
g.invalidateQueries({ queryKey: ["
|
|
83
|
+
g.invalidateQueries({ queryKey: ["workflows"] });
|
|
84
84
|
}, k = [g], s[2] = g, s[3] = O, s[4] = k), useEffect(O, k);
|
|
85
85
|
let A = _temp, j;
|
|
86
86
|
s[5] === u.id ? j = s[6] : (j = {
|
|
87
87
|
workspaceId: u.id,
|
|
88
88
|
parentId: null
|
|
89
89
|
}, s[5] = u.id, s[6] = j);
|
|
90
|
-
let M =
|
|
90
|
+
let M = useFilterWorkflows(void 0, j, "createdAt", "DESC", _, y), N = useBatchDeleteWorkflows(), P;
|
|
91
91
|
s[7] === N ? P = s[8] : (P = (e) => {
|
|
92
92
|
N.mutate(e);
|
|
93
93
|
}, s[7] = N, s[8] = P);
|
|
@@ -101,7 +101,7 @@ var import_enums = require_enums(), ChildPipelineList = (e) => {
|
|
|
101
101
|
}, s[10] = R) : R = s[10];
|
|
102
102
|
let z = R, B;
|
|
103
103
|
s[11] === h ? B = s[12] : (B = (e) => {
|
|
104
|
-
h.
|
|
104
|
+
h.navigateToWorkflow(e);
|
|
105
105
|
}, s[11] = h, s[12] = B);
|
|
106
106
|
let V = B, H = _temp2, U;
|
|
107
107
|
s[13] === M.data?.data ? U = s[14] : (U = M.data?.data ?? [], s[13] = M.data?.data, s[14] = U);
|
|
@@ -120,7 +120,7 @@ var import_enums = require_enums(), ChildPipelineList = (e) => {
|
|
|
120
120
|
}),
|
|
121
121
|
/* @__PURE__ */ jsx("p", {
|
|
122
122
|
className: "mt-1 text-sm text-gray-500",
|
|
123
|
-
children: e.
|
|
123
|
+
children: e.alias
|
|
124
124
|
}),
|
|
125
125
|
e.hasChildren > 0 && /* @__PURE__ */ jsxs("button", {
|
|
126
126
|
onClick: (n) => D(e.id, n),
|
|
@@ -143,10 +143,10 @@ var import_enums = require_enums(), ChildPipelineList = (e) => {
|
|
|
143
143
|
children: A(e.updatedAt)
|
|
144
144
|
})]
|
|
145
145
|
})]
|
|
146
|
-
}), e.hasChildren > 0 && w.has(e.id) && /* @__PURE__ */ jsx(
|
|
146
|
+
}), e.hasChildren > 0 && w.has(e.id) && /* @__PURE__ */ jsx(ChildWorkflowList, {
|
|
147
147
|
parentId: e.id,
|
|
148
148
|
formatUpdatedTime: A,
|
|
149
|
-
|
|
149
|
+
getWorkflowStateColor: H,
|
|
150
150
|
onChildClick: V
|
|
151
151
|
})] }), s[15] = w, s[16] = V, s[17] = K) : K = s[17];
|
|
152
152
|
let q = K, J;
|
|
@@ -157,7 +157,7 @@ var import_enums = require_enums(), ChildPipelineList = (e) => {
|
|
|
157
157
|
children: /* @__PURE__ */ jsx(Loader2, { className: "h-8 w-8 animate-spin" })
|
|
158
158
|
}) : "", s[20] = M.isPending, s[21] = Y);
|
|
159
159
|
let X = M.error ?? null, Z;
|
|
160
|
-
s[22] !== M.isPending || s[23] !== F || s[24] !== V || s[25] !== _ || s[26] !==
|
|
160
|
+
s[22] !== M.isPending || s[23] !== F || s[24] !== V || s[25] !== _ || s[26] !== q || s[27] !== y || s[28] !== X || s[29] !== G || s[30] !== W ? (Z = /* @__PURE__ */ jsx(CustomListView_default, {
|
|
161
161
|
loading: M.isPending,
|
|
162
162
|
error: X,
|
|
163
163
|
items: W,
|
|
@@ -172,9 +172,9 @@ var import_enums = require_enums(), ChildPipelineList = (e) => {
|
|
|
172
172
|
batchDelete: F,
|
|
173
173
|
itemRenderer: q,
|
|
174
174
|
newButtonLabel: "Run"
|
|
175
|
-
}), s[22] = M.isPending, s[23] = F, s[24] = V, s[25] = _, s[26] =
|
|
175
|
+
}), s[22] = M.isPending, s[23] = F, s[24] = V, s[25] = _, s[26] = q, s[27] = y, s[28] = X, s[29] = G, s[30] = W, s[31] = Z) : Z = s[31];
|
|
176
176
|
let Q;
|
|
177
|
-
s[32] !== x || s[33] !== u ? (Q = /* @__PURE__ */ jsx(
|
|
177
|
+
s[32] !== x || s[33] !== u ? (Q = /* @__PURE__ */ jsx(NewWorkflowRunDialog_default, {
|
|
178
178
|
isOpen: x,
|
|
179
179
|
onOpenChange: S,
|
|
180
180
|
workspace: u,
|
|
@@ -194,12 +194,13 @@ function _temp(e) {
|
|
|
194
194
|
}
|
|
195
195
|
function _temp2(e) {
|
|
196
196
|
switch (e) {
|
|
197
|
-
case import_enums.
|
|
198
|
-
case import_enums.
|
|
199
|
-
case import_enums.
|
|
200
|
-
case import_enums.
|
|
201
|
-
case import_enums.
|
|
202
|
-
case import_enums.
|
|
197
|
+
case import_enums.WorkflowState.Completed: return "bg-green-600";
|
|
198
|
+
case import_enums.WorkflowState.Paused: return "bg-yellow-600";
|
|
199
|
+
case import_enums.WorkflowState.Failed: return "bg-red-600";
|
|
200
|
+
case import_enums.WorkflowState.Canceled:
|
|
201
|
+
case import_enums.WorkflowState.Pending:
|
|
202
|
+
case import_enums.WorkflowState.Running:
|
|
203
|
+
default: return "bg-black";
|
|
203
204
|
}
|
|
204
205
|
}
|
|
205
206
|
export { ExecutionTimeline_default as default };
|
package/dist/features/workspaces/components/{NewPipelineRunDialog.js → NewWorkflowRunDialog.js}
RENAMED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { Dialog, DialogContent, DialogTitle } from "../../../components/ui/dialog.js";
|
|
2
|
-
import
|
|
2
|
+
import WorkflowRunForm_default from "./WorkflowRunForm.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
var
|
|
5
|
+
var NewWorkflowRunDialog_default = (s) => {
|
|
6
6
|
let l = c(11), { isOpen: u, onOpenChange: d, workspace: f, onSuccess: p } = s, m;
|
|
7
7
|
l[0] !== d || l[1] !== p ? (m = () => {
|
|
8
8
|
p(), d(!1);
|
|
9
9
|
}, l[0] = d, l[1] = p, l[2] = m) : m = l[2];
|
|
10
10
|
let h = m, g;
|
|
11
|
-
l[3] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx(DialogTitle, { children: "Run
|
|
11
|
+
l[3] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx(DialogTitle, { children: "Run Workflow" }), l[3] = g) : g = l[3];
|
|
12
12
|
let _;
|
|
13
13
|
l[4] !== h || l[5] !== f ? (_ = /* @__PURE__ */ jsxs(DialogContent, {
|
|
14
14
|
className: "max-h-[80vh] min-h-[300px] !max-w-2xl",
|
|
15
15
|
children: [g, /* @__PURE__ */ jsx("div", {
|
|
16
16
|
className: "mt-4 overflow-y-auto",
|
|
17
|
-
children: /* @__PURE__ */ jsx(
|
|
18
|
-
title: "Run
|
|
17
|
+
children: /* @__PURE__ */ jsx(WorkflowRunForm_default, {
|
|
18
|
+
title: "Run Workflow",
|
|
19
19
|
workspace: f,
|
|
20
20
|
onSuccess: h
|
|
21
21
|
})
|
|
@@ -28,4 +28,4 @@ var NewPipelineRunDialog_default = (s) => {
|
|
|
28
28
|
children: _
|
|
29
29
|
}), l[7] = u, l[8] = d, l[9] = _, l[10] = v) : v = l[10], v;
|
|
30
30
|
};
|
|
31
|
-
export {
|
|
31
|
+
export { NewWorkflowRunDialog_default as default };
|
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
import { useStudio } from "../../../providers/StudioProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useWorkflowConfig } from "../../../hooks/useConfig.js";
|
|
3
|
+
import { useCreateWorkflow } from "../../../hooks/useWorkflows.js";
|
|
4
4
|
import ErrorSnackbar_default from "../../../components/feedback/ErrorSnackbar.js";
|
|
5
|
-
import {
|
|
6
|
-
import ArgumentsView_default from "./
|
|
7
|
-
import SelectionView_default from "./
|
|
5
|
+
import { useRunWorkflow } from "../../../hooks/useProcessor.js";
|
|
6
|
+
import ArgumentsView_default from "./workflow-form/ArgumentsView.js";
|
|
7
|
+
import SelectionView_default from "./workflow-form/SelectionView.js";
|
|
8
8
|
import { c } from "react/compiler-runtime";
|
|
9
9
|
import { useEffect, useMemo, useState } from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Loader2 } from "lucide-react";
|
|
12
|
-
var
|
|
13
|
-
let u = c(63), { title: d, workspace: f } = l, { router: p } = useStudio(), m =
|
|
12
|
+
var WorkflowRunForm_default = (l) => {
|
|
13
|
+
let u = c(63), { title: d, workspace: f } = l, { router: p } = useStudio(), m = useCreateWorkflow(), h = useRunWorkflow(), g = useWorkflowConfig(f.className), [_, v] = useState("selection"), y;
|
|
14
14
|
u[0] === Symbol.for("react.memo_cache_sentinel") ? (y = {
|
|
15
15
|
name: "",
|
|
16
|
-
|
|
16
|
+
alias: "",
|
|
17
17
|
properties: {}
|
|
18
18
|
}, u[0] = y) : y = u[0];
|
|
19
19
|
let [b, x] = useState(y), S;
|
|
20
20
|
u[1] === Symbol.for("react.memo_cache_sentinel") ? (S = {
|
|
21
21
|
name: "",
|
|
22
|
-
|
|
22
|
+
alias: ""
|
|
23
23
|
}, u[1] = S) : S = u[1];
|
|
24
24
|
let [C, w] = useState(S), T;
|
|
25
25
|
bb0: {
|
|
26
|
-
if (!b.
|
|
26
|
+
if (!b.alias || !g.data) {
|
|
27
27
|
T = void 0;
|
|
28
28
|
break bb0;
|
|
29
29
|
}
|
|
30
30
|
let e;
|
|
31
|
-
if (u[2] !== g.data || u[3] !== b.
|
|
31
|
+
if (u[2] !== g.data || u[3] !== b.alias) {
|
|
32
32
|
let o;
|
|
33
|
-
u[5] === b.
|
|
33
|
+
u[5] === b.alias ? o = u[6] : (o = (e) => e.alias === b.alias, u[5] = b.alias, u[6] = o), e = g.data.find(o), u[2] = g.data, u[3] = b.alias, u[4] = e;
|
|
34
34
|
} else e = u[4];
|
|
35
35
|
T = e;
|
|
36
36
|
}
|
|
37
37
|
let E = T, D = !!E?.schema, O = m.isPending || h.isPending, k, A;
|
|
38
|
-
u[7] !== g.data || u[8] !== b.
|
|
39
|
-
!b.
|
|
38
|
+
u[7] !== g.data || u[8] !== b.alias ? (k = () => {
|
|
39
|
+
!b.alias && g.data?.[0]?.alias && x((e) => ({
|
|
40
40
|
...e,
|
|
41
|
-
|
|
41
|
+
alias: g.data[0].alias
|
|
42
42
|
}));
|
|
43
|
-
}, A = [g.data, b.
|
|
43
|
+
}, A = [g.data, b.alias], u[7] = g.data, u[8] = b.alias, u[9] = k, u[10] = A) : (k = u[9], A = u[10]), useEffect(k, A);
|
|
44
44
|
let j;
|
|
45
|
-
u[11] === b.
|
|
45
|
+
u[11] === b.alias ? j = u[12] : (j = () => b.alias ? !0 : (w({
|
|
46
46
|
name: "",
|
|
47
|
-
|
|
48
|
-
}), !1), u[11] = b.
|
|
47
|
+
alias: "Please select an automation type"
|
|
48
|
+
}), !1), u[11] = b.alias, u[12] = j);
|
|
49
49
|
let M = j, N;
|
|
50
50
|
u[13] === p ? N = u[14] : (N = (e) => {
|
|
51
|
-
p.
|
|
51
|
+
p.navigateToWorkflow(e);
|
|
52
52
|
}, u[13] = p, u[14] = N);
|
|
53
53
|
let P = N, F;
|
|
54
|
-
u[15] !== m || u[16] !== b.
|
|
55
|
-
m.mutate({
|
|
56
|
-
|
|
54
|
+
u[15] !== m || u[16] !== b.alias || u[17] !== b.name || u[18] !== P || u[19] !== h || u[20] !== f.id ? (F = (e, o) => {
|
|
55
|
+
m.mutate({ workflowCreateDto: {
|
|
56
|
+
alias: b.alias,
|
|
57
57
|
title: b.name || null,
|
|
58
58
|
workspaceId: f.id,
|
|
59
59
|
transition: e ?? null,
|
|
60
60
|
args: o
|
|
61
61
|
} }, { onSuccess: (e) => {
|
|
62
62
|
h.mutate({
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
workflowId: e.id,
|
|
64
|
+
runWorkflowPayloadDto: {},
|
|
65
65
|
force: !0
|
|
66
66
|
}, { onSuccess: () => P(e.id) });
|
|
67
67
|
} });
|
|
68
|
-
}, u[15] = m, u[16] = b.
|
|
68
|
+
}, u[15] = m, u[16] = b.alias, u[17] = b.name, u[18] = P, u[19] = h, u[20] = f.id, u[21] = F) : F = u[21];
|
|
69
69
|
let I = F, L;
|
|
70
70
|
u[22] !== I || u[23] !== D || u[24] !== M ? (L = () => {
|
|
71
71
|
M() && (D ? v("arguments") : I());
|
|
@@ -110,7 +110,7 @@ var PipelineForm_default = (l) => {
|
|
|
110
110
|
className: "w-full shrink-0 px-1",
|
|
111
111
|
children: /* @__PURE__ */ jsx(SelectionView_default, {
|
|
112
112
|
title: d,
|
|
113
|
-
|
|
113
|
+
workflowTypes: g.data,
|
|
114
114
|
formData: b,
|
|
115
115
|
errors: C,
|
|
116
116
|
isLoading: O,
|
|
@@ -119,7 +119,7 @@ var PipelineForm_default = (l) => {
|
|
|
119
119
|
})
|
|
120
120
|
}), u[40] = C, u[41] = g.data, u[42] = b, u[43] = W, u[44] = R, u[45] = O, u[46] = d, u[47] = X) : X = u[47];
|
|
121
121
|
let Z;
|
|
122
|
-
u[48] !== b.
|
|
122
|
+
u[48] !== b.alias || u[49] !== H || u[50] !== D || u[51] !== O || u[52] !== E ? (Z = /* @__PURE__ */ jsx("div", {
|
|
123
123
|
className: "w-full shrink-0 px-1",
|
|
124
124
|
children: /* @__PURE__ */ jsx(ArgumentsView_default, {
|
|
125
125
|
config: E,
|
|
@@ -127,8 +127,8 @@ var PipelineForm_default = (l) => {
|
|
|
127
127
|
isLoading: O,
|
|
128
128
|
onBack: B,
|
|
129
129
|
onSubmit: H
|
|
130
|
-
}, b.
|
|
131
|
-
}), u[48] = b.
|
|
130
|
+
}, b.alias)
|
|
131
|
+
}), u[48] = b.alias, u[49] = H, u[50] = D, u[51] = O, u[52] = E, u[53] = Z) : Z = u[53];
|
|
132
132
|
let Q;
|
|
133
133
|
u[54] !== Y || u[55] !== X || u[56] !== Z ? (Q = /* @__PURE__ */ jsx("div", {
|
|
134
134
|
className: "relative overflow-hidden",
|
|
@@ -149,4 +149,4 @@ var PipelineForm_default = (l) => {
|
|
|
149
149
|
]
|
|
150
150
|
}), u[58] = G, u[59] = K, u[60] = q, u[61] = Q, u[62] = $) : $ = u[62], $;
|
|
151
151
|
};
|
|
152
|
-
export {
|
|
152
|
+
export { WorkflowRunForm_default as default };
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { useStudio } from "../../../providers/StudioProvider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { useCreateWorkflow } from "../../../hooks/useWorkflows.js";
|
|
3
3
|
import { Button } from "../../../components/ui/button.js";
|
|
4
4
|
import ErrorSnackbar_default from "../../../components/feedback/ErrorSnackbar.js";
|
|
5
5
|
import Form_default from "../../../components/dynamic-form/Form.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useRunWorkflow } from "../../../hooks/useProcessor.js";
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { Loader2, Play } from "lucide-react";
|
|
10
10
|
import { useForm } from "react-hook-form";
|
|
11
11
|
var WorkspaceHomePage_default = (p) => {
|
|
12
|
-
let m = c(39), { workspace: h, action: g } = p, { router: _ } = useStudio(), v =
|
|
12
|
+
let m = c(39), { workspace: h, action: g } = p, { router: _ } = useStudio(), v = useCreateWorkflow(), y = useRunWorkflow(), b;
|
|
13
13
|
m[0] === g.options ? b = m[1] : (b = g.options ?? {}, m[0] = g.options, m[1] = b);
|
|
14
|
-
let x = b, S = x.workflow, C = x.title, w = x.subtitle, T = x.schema, E = x.
|
|
14
|
+
let x = b, S = x.workflow, C = x.title, w = x.subtitle, T = x.schema, E = x.workflowUi, D;
|
|
15
15
|
m[2] === Symbol.for("react.memo_cache_sentinel") ? (D = {
|
|
16
16
|
defaultValues: {},
|
|
17
17
|
mode: "onChange"
|
|
18
18
|
}, m[2] = D) : D = m[2];
|
|
19
19
|
let O = useForm(D), k = v.isPending || y.isPending, A = !!T, j;
|
|
20
20
|
m[3] !== v || m[4] !== A || m[5] !== _ || m[6] !== y || m[7] !== S || m[8] !== h ? (j = (t) => {
|
|
21
|
-
v.mutate({
|
|
22
|
-
|
|
21
|
+
v.mutate({ workflowCreateDto: {
|
|
22
|
+
alias: S,
|
|
23
23
|
title: null,
|
|
24
24
|
workspaceId: h.id,
|
|
25
25
|
transition: null,
|
|
26
26
|
args: A ? t : void 0
|
|
27
27
|
} }, { onSuccess: (t) => {
|
|
28
28
|
y.mutate({
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
workflowId: t.id,
|
|
30
|
+
runWorkflowPayloadDto: {},
|
|
31
31
|
force: !0
|
|
32
32
|
}, { onSuccess: () => {
|
|
33
|
-
_.
|
|
33
|
+
_.navigateToWorkflow(t.id);
|
|
34
34
|
} });
|
|
35
35
|
} });
|
|
36
36
|
}, m[3] = v, m[4] = A, m[5] = _, m[6] = y, m[7] = S, m[8] = h, m[9] = j) : j = m[9];
|
|
@@ -53,7 +53,7 @@ var WorkspaceHomePage_default = (p) => {
|
|
|
53
53
|
children: w
|
|
54
54
|
}), m[19] = w, m[20] = R);
|
|
55
55
|
let z;
|
|
56
|
-
m[21] !== O || m[22] !== A || m[23] !==
|
|
56
|
+
m[21] !== O || m[22] !== A || m[23] !== T || m[24] !== E ? (z = A ? /* @__PURE__ */ jsx("div", {
|
|
57
57
|
className: "mb-6 w-full",
|
|
58
58
|
children: /* @__PURE__ */ jsx(Form_default, {
|
|
59
59
|
form: O,
|
|
@@ -62,7 +62,7 @@ var WorkspaceHomePage_default = (p) => {
|
|
|
62
62
|
disabled: !1,
|
|
63
63
|
viewOnly: !1
|
|
64
64
|
})
|
|
65
|
-
}) : null, m[21] = O, m[22] = A, m[23] =
|
|
65
|
+
}) : null, m[21] = O, m[22] = A, m[23] = T, m[24] = E, m[25] = z) : z = m[25];
|
|
66
66
|
let B;
|
|
67
67
|
m[26] === k ? B = m[27] : (B = k ? /* @__PURE__ */ jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Play, { className: "mr-2 h-4 w-4" }), m[26] = k, m[27] = B);
|
|
68
68
|
let V;
|
package/dist/features/workspaces/components/{pipeline-form → workflow-form}/ArgumentsView.js
RENAMED
|
@@ -21,7 +21,7 @@ var ArgumentsView_default = (u) => {
|
|
|
21
21
|
}, d[3] = v, d[4] = b, d[5] = x) : x = d[5];
|
|
22
22
|
let S = x, C;
|
|
23
23
|
d[6] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(Zap, { className: "h-5 w-5" }), d[6] = C) : C = d[6];
|
|
24
|
-
let w = f?.title || f?.
|
|
24
|
+
let w = f?.title || f?.alias || "", T = f?.description, E;
|
|
25
25
|
d[7] !== h || d[8] !== w || d[9] !== T ? (E = /* @__PURE__ */ jsx(HeaderSection_default, {
|
|
26
26
|
icon: C,
|
|
27
27
|
title: w,
|
package/dist/features/workspaces/components/{pipeline-form → workflow-form}/SelectionView.js
RENAMED
|
@@ -5,10 +5,10 @@ import { c } from "react/compiler-runtime";
|
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Loader2, Play } from "lucide-react";
|
|
7
7
|
var SelectionView_default = (p) => {
|
|
8
|
-
let m = c(46), { title: h,
|
|
9
|
-
if (m[0] !== _.
|
|
8
|
+
let m = c(46), { title: h, workflowTypes: g, formData: _, errors: v, isLoading: y, onInputChange: b, onNext: x } = p, S;
|
|
9
|
+
if (m[0] !== _.alias || m[1] !== g) {
|
|
10
10
|
let e;
|
|
11
|
-
m[3] === _.
|
|
11
|
+
m[3] === _.alias ? e = m[4] : (e = (e) => e.alias === _.alias, m[3] = _.alias, m[4] = e), S = g.find(e), m[0] = _.alias, m[1] = g, m[2] = S;
|
|
12
12
|
} else S = m[2];
|
|
13
13
|
let C = S, w;
|
|
14
14
|
m[5] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(Play, { className: "h-5 w-5" }), m[5] = w) : w = m[5];
|
|
@@ -24,9 +24,9 @@ var SelectionView_default = (p) => {
|
|
|
24
24
|
className: "text-foreground block text-sm font-medium",
|
|
25
25
|
children: "Automation Type"
|
|
26
26
|
}), m[8] = E) : E = m[8];
|
|
27
|
-
let D = _.
|
|
28
|
-
m[9] === b ? O = m[10] : (O = (e) => b("
|
|
29
|
-
let k = `flex-1 ${v.
|
|
27
|
+
let D = _.alias, O;
|
|
28
|
+
m[9] === b ? O = m[10] : (O = (e) => b("alias", e), m[9] = b, m[10] = O);
|
|
29
|
+
let k = `flex-1 ${v.alias ? "border-red-500 focus:ring-red-500" : ""}`, A;
|
|
30
30
|
m[11] === Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select an automation..." }), m[11] = A) : A = m[11];
|
|
31
31
|
let j;
|
|
32
32
|
m[12] === k ? j = m[13] : (j = /* @__PURE__ */ jsx(SelectTrigger, {
|
|
@@ -39,13 +39,13 @@ var SelectionView_default = (p) => {
|
|
|
39
39
|
let N;
|
|
40
40
|
m[16] === M ? N = m[17] : (N = /* @__PURE__ */ jsx(SelectContent, { children: M }), m[16] = M, m[17] = N);
|
|
41
41
|
let P;
|
|
42
|
-
m[18] !== _.
|
|
42
|
+
m[18] !== _.alias || m[19] !== y || m[20] !== N || m[21] !== O || m[22] !== j ? (P = /* @__PURE__ */ jsxs(Select, {
|
|
43
43
|
value: D,
|
|
44
44
|
onValueChange: O,
|
|
45
45
|
disabled: y,
|
|
46
46
|
children: [j, N]
|
|
47
|
-
}), m[18] = _.
|
|
48
|
-
let F = y || !_.
|
|
47
|
+
}), m[18] = _.alias, m[19] = y, m[20] = N, m[21] = O, m[22] = j, m[23] = P) : P = m[23];
|
|
48
|
+
let F = y || !_.alias, I;
|
|
49
49
|
m[24] === y ? I = m[25] : (I = y ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Play, { className: "h-4 w-4" }), m[24] = y, m[25] = I);
|
|
50
50
|
let L;
|
|
51
51
|
m[26] !== x || m[27] !== F || m[28] !== I ? (L = /* @__PURE__ */ jsx(Button, {
|
|
@@ -61,10 +61,10 @@ var SelectionView_default = (p) => {
|
|
|
61
61
|
children: [P, L]
|
|
62
62
|
}), m[30] = P, m[31] = L, m[32] = R) : R = m[32];
|
|
63
63
|
let z;
|
|
64
|
-
m[33] === v.
|
|
64
|
+
m[33] === v.alias ? z = m[34] : (z = v.alias && /* @__PURE__ */ jsx("p", {
|
|
65
65
|
className: "mt-1 flex items-center gap-1 text-sm text-red-500",
|
|
66
|
-
children: v.
|
|
67
|
-
}), m[33] = v.
|
|
66
|
+
children: v.alias
|
|
67
|
+
}), m[33] = v.alias, m[34] = z);
|
|
68
68
|
let B;
|
|
69
69
|
m[35] !== R || m[36] !== z ? (B = /* @__PURE__ */ jsxs("div", {
|
|
70
70
|
className: "space-y-2",
|
|
@@ -79,7 +79,7 @@ var SelectionView_default = (p) => {
|
|
|
79
79
|
className: "bg-muted/50 border-border mt-4 rounded-lg border p-4",
|
|
80
80
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
81
81
|
className: "text-foreground mb-1 text-sm font-medium",
|
|
82
|
-
children: C.title || C.
|
|
82
|
+
children: C.title || C.alias
|
|
83
83
|
}), C.description && /* @__PURE__ */ jsx("p", {
|
|
84
84
|
className: "text-muted-foreground text-sm leading-relaxed",
|
|
85
85
|
children: C.description
|
|
@@ -98,8 +98,8 @@ var SelectionView_default = (p) => {
|
|
|
98
98
|
};
|
|
99
99
|
function _temp(e) {
|
|
100
100
|
return /* @__PURE__ */ jsx(SelectItem, {
|
|
101
|
-
value: e.
|
|
102
|
-
children: e.title ?? e.
|
|
103
|
-
}, e.
|
|
101
|
+
value: e.alias,
|
|
102
|
+
children: e.title ?? e.alias
|
|
103
|
+
}, e.alias);
|
|
104
104
|
}
|
|
105
105
|
export { SelectionView_default as default };
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getAvailableEnvironmentsCacheKey, getChildWorkflowsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getHealthCacheKey, getMeCacheKey, getSecretsCacheKey, getWorkflowCacheKey, getWorkflowConfigCacheKey, getWorkflowSourceCacheKey, getWorkflowTypesCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspaceTypesCacheKey, getWorkspacesCacheKey } from "./query-keys.js";
|
|
2
2
|
import { useApiClient } from "./useApi.js";
|
|
3
3
|
import { useIsMobile } from "./use-mobile.js";
|
|
4
|
-
import { useAvailableEnvironments,
|
|
5
|
-
import {
|
|
4
|
+
import { useAvailableEnvironments, useWorkflowConfig, useWorkspaceConfig } from "./useConfig.js";
|
|
5
|
+
import { useBatchDeleteWorkflows, useChildWorkflows, useCreateWorkflow, useDeleteWorkflow, useFilterWorkflows, useUpdateWorkflow, useWorkflow, useWorkflowCheckpoints, useWorkflowConfigByName, useWorkflowSource } from "./useWorkflows.js";
|
|
6
6
|
import { useBatchDeleteWorkspaces, useCreateWorkspace, useDeleteWorkspace, useFilterWorkspaces, useSetFavouriteWorkspace, useUpdateWorkspace, useWorkspace } from "./useWorkspaces.js";
|