@loopstack/loopstack-studio 0.29.5 → 0.31.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/_virtual/rolldown_runtime.js +3 -1
- package/dist/api/config.js +5 -4
- package/dist/api/environments.js +5 -1
- package/dist/api/processor.js +4 -1
- package/dist/app/EnvironmentEmbedRoot.js +22 -30
- package/dist/components/ai-elements/code-block.js +4 -4
- package/dist/components/dynamic-form/CodeContent.js +1 -1
- package/dist/components/dynamic-form/FormBody.js +1 -1
- package/dist/components/layout/StudioSidebar.js +116 -131
- package/dist/components/lists/ListView.js +46 -46
- package/dist/components/motion/FadeIn.js +72 -0
- package/dist/components/motion/StreamingText.js +49 -0
- package/dist/components/ui/accordion.js +2 -2
- package/dist/components/ui-widgets/UiWidget.js +11 -10
- package/dist/components/ui-widgets/widgets/AiPromptInput.js +31 -28
- package/dist/events/sse-client-events.js +7 -1
- package/dist/features/code-explorer/components/FileContentViewer.js +2 -2
- package/dist/features/dashboard/AppLauncher.js +84 -0
- package/dist/features/debug/components/WorkflowFlowViewer.js +49 -51
- package/dist/features/documents/DocumentRenderer.js +18 -17
- package/dist/features/documents/components/DocumentItem.js +42 -20
- package/dist/features/documents/components/DocumentList.js +34 -36
- package/dist/features/documents/components/DocumentMetadataPills.js +102 -49
- package/dist/features/documents/document-details/DocumentDetails.js +577 -377
- package/dist/features/documents/document-details/PromptDetails.js +118 -130
- package/dist/features/documents/document-details/document-debug-utils.js +100 -0
- package/dist/features/documents/renderers/ChoicesRenderer.js +41 -38
- package/dist/features/documents/renderers/ConfirmPromptRenderer.js +31 -28
- package/dist/features/documents/renderers/DocumentFormRenderer.js +62 -70
- package/dist/features/documents/renderers/LlmMessage.js +52 -47
- package/dist/features/documents/renderers/TextPromptRenderer.js +32 -29
- package/dist/features/documents/renderers/useDocumentTransition.js +4 -4
- package/dist/features/feature-registry/FeatureRegistryProvider.js +32 -10
- package/dist/features/feature-registry/available-features.js +12 -0
- package/dist/features/feature-registry/index.js +2 -1
- package/dist/features/file-explorer/components/FileExplorerPanel.js +55 -51
- package/dist/features/git/components/GitBranchBadge.js +31 -0
- package/dist/features/git/components/GitCommitList.js +46 -0
- package/dist/features/git/components/GitRemoteStatus.js +84 -0
- package/dist/features/git/components/WorkbenchGitPanel.js +81 -0
- package/dist/features/git/git-feature.js +12 -0
- package/dist/features/git/hooks/useGit.js +78 -0
- package/dist/features/git/index.js +1 -0
- package/dist/features/oauth/OAuthPromptRenderer.js +137 -142
- package/dist/features/runs/Runs.js +73 -73
- package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
- package/dist/features/secrets/renderers/SecretInputRenderer.js +30 -29
- package/dist/features/workbench/Workbench.js +25 -33
- package/dist/features/workbench/WorkflowItem.js +9 -9
- package/dist/features/workbench/WorkflowList.js +61 -62
- package/dist/features/workbench/components/NewRunDialog.js +237 -209
- package/dist/features/workbench/components/RecentRunItem.js +3 -3
- package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +8 -8
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +74 -109
- package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
- package/dist/features/workbench/components/WorkflowForms.js +11 -10
- package/dist/features/workbench/components/WorkflowHistoryItem.js +16 -36
- package/dist/features/workbench/components/WorkflowHistoryList.js +19 -17
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +3 -3
- package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +159 -0
- package/dist/features/workbench/hooks/useWorkflowData.js +58 -31
- package/dist/features/workbench/index.js +2 -2
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +53 -53
- package/dist/features/workspaces/Workspaces.js +166 -136
- package/dist/features/workspaces/components/CreateWorkspace.js +115 -107
- package/dist/features/workspaces/components/ExecutionTimeline.js +2 -2
- package/dist/features/workspaces/components/WorkflowRunForm.js +127 -104
- package/dist/features/workspaces/components/WorkspaceHomePage.js +6 -89
- package/dist/features/workspaces/components/workflow-form/ArgumentsView.js +1 -1
- package/dist/features/workspaces/components/workflow-form/SelectionView.js +15 -15
- package/dist/hooks/index.js +3 -2
- package/dist/hooks/query-keys.js +43 -30
- package/dist/hooks/useConfig.js +28 -22
- package/dist/hooks/useEnvironments.js +27 -2
- package/dist/hooks/useProcessor.js +14 -1
- package/dist/hooks/useWorkflows.js +4 -4
- package/dist/index.d.ts +119 -18
- package/dist/index.js +10 -9
- package/dist/node_modules/d3/src/index.js +13 -13
- package/dist/node_modules/d3-scale/src/continuous.js +16 -16
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-3BPJPVTR.js +43 -43
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-GPEHLZMM.js +270 -270
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAUBKEIU.js +90 -90
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-3OPIFGDE.js +458 -458
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55IACEB6.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5ZQYHXKU.js +37 -37
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-727SXJPM.js +208 -208
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-KSCS5N6A.js +145 -145
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ND2GUHAM.js +7 -7
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-O5CBEL6O.js +41 -41
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-WU5MYG2G.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-S5V4N54A.js +6 -6
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +30 -30
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-OG6HWLK6.js +82 -82
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-TEJ5UH35.js +65 -65
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-I6XJVG4X.js +227 -227
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-6RSMTGT7.js +104 -104
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-PVQCEYII.js +104 -104
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-JHISSGLW.js +49 -49
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-W4KKPZXB.js +101 -101
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-5OEKKPKP.js +20 -20
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-3UESZ5HK.js +354 -354
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-AJRCARHV.js +53 -53
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-PNZ67QCA.js +113 -113
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-CIIHVFJN.js +90 -90
- package/dist/node_modules/mermaid/dist/mermaid.core.js +156 -156
- package/dist/node_modules/motion/dist/es/react.js +9 -2
- package/dist/pages/DashboardPage.js +20 -74
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
- package/dist/pages/DebugWorkflowsPage.js +76 -106
- package/dist/pages/EmbedWorkbenchPage.js +1 -1
- package/dist/pages/PreviewWorkbenchPage.js +6 -6
- package/dist/pages/WorkbenchPage.js +43 -47
- package/dist/pages/WorkflowDebugPage.js +6 -12
- package/dist/pages/WorkspacePage.js +40 -66
- package/dist/pages/WorkspaceRunsPage.js +24 -31
- package/dist/routing/LocalRouter.js +1 -1
- package/package.json +2 -2
- package/dist/features/dashboard/Dashboard.js +0 -125
- package/dist/features/dashboard/RunItem.js +0 -78
- package/dist/features/dashboard/RunList.js +0 -32
- package/dist/hooks/useDashboard.js +0 -16
|
@@ -2,12 +2,11 @@ import { useStudio } from "../../providers/StudioProvider.js";
|
|
|
2
2
|
import { useBatchDeleteWorkflows, useDeleteWorkflow, useFilterWorkflows } from "../../hooks/useWorkflows.js";
|
|
3
3
|
import { useFilterWorkspaces } from "../../hooks/useWorkspaces.js";
|
|
4
4
|
import { Badge } from "../../components/ui/badge.js";
|
|
5
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../components/ui/tooltip.js";
|
|
6
5
|
import ListView_default from "../../components/lists/ListView.js";
|
|
7
6
|
import { useDebounce } from "../../hooks/useDebounce.js";
|
|
8
7
|
import { c } from "react/compiler-runtime";
|
|
9
8
|
import { useMemo, useState } from "react";
|
|
10
|
-
import { jsx
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
10
|
var statusColors = {
|
|
12
11
|
completed: "bg-green-50 text-green-900 border-green-200",
|
|
13
12
|
failed: "bg-destructive/10 text-destructive border-destructive/20",
|
|
@@ -15,55 +14,58 @@ var statusColors = {
|
|
|
15
14
|
running: "bg-blue-50 text-blue-900 border-blue-200",
|
|
16
15
|
paused: "bg-yellow-50 text-yellow-900 border-yellow-200",
|
|
17
16
|
pending: "bg-muted text-muted-foreground border-border"
|
|
18
|
-
}, Runs_default = (
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
-
|
|
17
|
+
}, Runs_default = (de) => {
|
|
18
|
+
let i = c(52), { defaultFilters: a } = de, o;
|
|
19
|
+
i[0] === a ? o = i[1] : (o = a === void 0 ? {} : a, i[0] = a, i[1] = o);
|
|
20
|
+
let s = o, { router: l } = useStudio(), [u, d] = useState(0), [f, p] = useState(10), [m, h] = useState("createdAt"), [g, _] = useState("DESC"), [v, fe] = useState(), [y, b] = useState(s), pe = useDebounce(v, 500), x;
|
|
21
|
+
i[2] === y ? x = i[3] : (x = {
|
|
23
22
|
...y,
|
|
24
23
|
parentId: null
|
|
25
|
-
},
|
|
26
|
-
let S = useFilterWorkflows(
|
|
27
|
-
|
|
24
|
+
}, i[2] = y, i[3] = x);
|
|
25
|
+
let S = useFilterWorkflows(pe, x, m, g, u, f), C;
|
|
26
|
+
i[4] === Symbol.for("react.memo_cache_sentinel") ? (C = {}, i[4] = C) : C = i[4];
|
|
28
27
|
let w = useFilterWorkspaces(void 0, C, "title", "ASC", 0, 100), T = useDeleteWorkflow(), E = useBatchDeleteWorkflows(), D;
|
|
29
|
-
if (
|
|
28
|
+
if (i[5] !== w.data?.data) {
|
|
30
29
|
D = /* @__PURE__ */ new Map();
|
|
31
|
-
for (let e of w.data?.data ?? []) D.set(e.id,
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
for (let e of w.data?.data ?? []) D.set(e.id, {
|
|
31
|
+
title: e.title,
|
|
32
|
+
appName: e.appName
|
|
33
|
+
});
|
|
34
|
+
i[5] = w.data?.data, i[6] = D;
|
|
35
|
+
} else D = i[6];
|
|
34
36
|
let O = D, k;
|
|
35
|
-
|
|
37
|
+
i[7] === w.data?.data ? k = i[8] : (k = w.data?.data ?? [], i[7] = w.data?.data, i[8] = k);
|
|
36
38
|
let A;
|
|
37
|
-
|
|
39
|
+
i[9] === k ? A = i[10] : (A = k.map(_temp), i[9] = k, i[10] = A);
|
|
38
40
|
let j = A, M;
|
|
39
|
-
if (
|
|
41
|
+
if (i[11] !== S.data?.data) {
|
|
40
42
|
let e = /* @__PURE__ */ new Set();
|
|
41
|
-
for (let t of S.data?.data ?? []) t.
|
|
42
|
-
M = Array.from(e).sort(),
|
|
43
|
-
} else M =
|
|
43
|
+
for (let t of S.data?.data ?? []) t.workflowName && e.add(t.workflowName);
|
|
44
|
+
M = Array.from(e).sort(), i[11] = S.data?.data, i[12] = M;
|
|
45
|
+
} else M = i[12];
|
|
44
46
|
let N = M, P;
|
|
45
|
-
|
|
47
|
+
i[13] === T ? P = i[14] : (P = (e) => {
|
|
46
48
|
T.mutate(e);
|
|
47
|
-
},
|
|
49
|
+
}, i[13] = T, i[14] = P);
|
|
48
50
|
let F = P, I;
|
|
49
|
-
|
|
51
|
+
i[15] === E ? I = i[16] : (I = (e) => {
|
|
50
52
|
E.mutate(e);
|
|
51
|
-
},
|
|
53
|
+
}, i[15] = E, i[16] = I);
|
|
52
54
|
let L = I, R;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
55
|
+
i[17] === l ? R = i[18] : (R = (e) => {
|
|
56
|
+
l.navigateToWorkflow(e);
|
|
57
|
+
}, i[17] = l, i[18] = R);
|
|
56
58
|
let z = R, B = S.error ?? null, V;
|
|
57
|
-
|
|
59
|
+
i[19] === S.data?.data ? V = i[20] : (V = S.data?.data ?? [], i[19] = S.data?.data, i[20] = V);
|
|
58
60
|
let H = S.data?.total ?? 0, U;
|
|
59
|
-
|
|
61
|
+
i[21] === Symbol.for("react.memo_cache_sentinel") ? (U = {
|
|
60
62
|
id: "run",
|
|
61
63
|
label: "Run",
|
|
62
64
|
minWidth: 60,
|
|
63
65
|
format: _temp2
|
|
64
|
-
},
|
|
66
|
+
}, i[21] = U) : U = i[21];
|
|
65
67
|
let W;
|
|
66
|
-
|
|
68
|
+
i[22] === O ? W = i[23] : (W = {
|
|
67
69
|
id: "workspaceId",
|
|
68
70
|
label: "Workspace",
|
|
69
71
|
minWidth: 120,
|
|
@@ -78,14 +80,24 @@ var statusColors = {
|
|
|
78
80
|
workspaceId: t
|
|
79
81
|
}));
|
|
80
82
|
},
|
|
81
|
-
children: O.get(t) ?? t.slice(0, 8)
|
|
83
|
+
children: O.get(t)?.title ?? t.slice(0, 8)
|
|
82
84
|
});
|
|
83
85
|
}
|
|
84
|
-
},
|
|
85
|
-
let G
|
|
86
|
-
|
|
87
|
-
id: "
|
|
88
|
-
label: "
|
|
86
|
+
}, i[22] = O, i[23] = W);
|
|
87
|
+
let G;
|
|
88
|
+
i[24] === O ? G = i[25] : (G = {
|
|
89
|
+
id: "appName",
|
|
90
|
+
label: "App",
|
|
91
|
+
minWidth: 100,
|
|
92
|
+
format: (e, t) => {
|
|
93
|
+
let n = t.workspaceId, r = O.get(n);
|
|
94
|
+
return r ? r.appName : "—";
|
|
95
|
+
}
|
|
96
|
+
}, i[24] = O, i[25] = G);
|
|
97
|
+
let K, q, J;
|
|
98
|
+
i[26] === Symbol.for("react.memo_cache_sentinel") ? (K = {
|
|
99
|
+
id: "workflowName",
|
|
100
|
+
label: "Workflow",
|
|
89
101
|
minWidth: 100,
|
|
90
102
|
format: (e) => {
|
|
91
103
|
let t = e;
|
|
@@ -95,77 +107,72 @@ var statusColors = {
|
|
|
95
107
|
onClick: (e) => {
|
|
96
108
|
e.stopPropagation(), b((e) => ({
|
|
97
109
|
...e,
|
|
98
|
-
|
|
110
|
+
workflowName: t
|
|
99
111
|
}));
|
|
100
112
|
},
|
|
101
113
|
children: t
|
|
102
114
|
});
|
|
103
115
|
}
|
|
104
|
-
}, K = {
|
|
105
|
-
id: "title",
|
|
106
|
-
label: "Title",
|
|
107
|
-
minWidth: 150,
|
|
108
|
-
format: _temp3
|
|
109
116
|
}, q = {
|
|
110
117
|
id: "status",
|
|
111
118
|
label: "Status",
|
|
112
119
|
minWidth: 100,
|
|
113
|
-
format:
|
|
120
|
+
format: _temp3
|
|
114
121
|
}, J = {
|
|
115
122
|
id: "createdAt",
|
|
116
123
|
label: "Date Created",
|
|
117
124
|
minWidth: 100,
|
|
118
|
-
format:
|
|
119
|
-
},
|
|
125
|
+
format: _temp4
|
|
126
|
+
}, i[26] = K, i[27] = q, i[28] = J) : (K = i[26], q = i[27], J = i[28]);
|
|
120
127
|
let Y;
|
|
121
|
-
|
|
128
|
+
i[29] !== W || i[30] !== G ? (Y = [
|
|
122
129
|
U,
|
|
123
130
|
W,
|
|
124
131
|
G,
|
|
125
132
|
K,
|
|
126
133
|
q,
|
|
127
134
|
J
|
|
128
|
-
],
|
|
135
|
+
], i[29] = W, i[30] = G, i[31] = Y) : Y = i[31];
|
|
129
136
|
let X = Y, Z;
|
|
130
|
-
|
|
137
|
+
i[32] === Symbol.for("react.memo_cache_sentinel") ? (Z = [
|
|
131
138
|
"pending",
|
|
132
139
|
"running",
|
|
133
140
|
"paused",
|
|
134
141
|
"completed",
|
|
135
142
|
"failed",
|
|
136
143
|
"canceled"
|
|
137
|
-
],
|
|
144
|
+
], i[32] = Z) : Z = i[32];
|
|
138
145
|
let Q;
|
|
139
|
-
|
|
146
|
+
i[33] !== N || i[34] !== j ? (Q = {
|
|
140
147
|
status: Z,
|
|
141
148
|
workspaceId: j,
|
|
142
|
-
|
|
143
|
-
},
|
|
149
|
+
workflowName: N
|
|
150
|
+
}, i[33] = N, i[34] = j, i[35] = Q) : Q = i[35];
|
|
144
151
|
let $;
|
|
145
|
-
return
|
|
152
|
+
return i[36] !== S.isPending || i[37] !== y || i[38] !== L || i[39] !== F || i[40] !== z || i[41] !== g || i[42] !== m || i[43] !== u || i[44] !== f || i[45] !== v || i[46] !== B || i[47] !== V || i[48] !== H || i[49] !== X || i[50] !== Q ? ($ = /* @__PURE__ */ jsx(ListView_default, {
|
|
146
153
|
loading: S.isPending,
|
|
147
154
|
error: B,
|
|
148
155
|
items: V,
|
|
149
156
|
totalItems: H,
|
|
150
|
-
setPage:
|
|
151
|
-
setRowsPerPage:
|
|
152
|
-
setOrderBy:
|
|
153
|
-
setOrder:
|
|
154
|
-
setSearchTerm:
|
|
157
|
+
setPage: d,
|
|
158
|
+
setRowsPerPage: p,
|
|
159
|
+
setOrderBy: h,
|
|
160
|
+
setOrder: _,
|
|
161
|
+
setSearchTerm: fe,
|
|
155
162
|
setFilters: b,
|
|
156
|
-
orderBy:
|
|
157
|
-
order:
|
|
158
|
-
searchTerm:
|
|
163
|
+
orderBy: m,
|
|
164
|
+
order: g,
|
|
165
|
+
searchTerm: v,
|
|
159
166
|
filters: y,
|
|
160
|
-
page:
|
|
161
|
-
rowsPerPage:
|
|
167
|
+
page: u,
|
|
168
|
+
rowsPerPage: f,
|
|
162
169
|
deleteItem: F,
|
|
163
170
|
onClick: z,
|
|
164
171
|
enableBatchActions: !0,
|
|
165
172
|
batchDelete: L,
|
|
166
173
|
columns: X,
|
|
167
174
|
filterConfig: Q
|
|
168
|
-
}),
|
|
175
|
+
}), i[36] = S.isPending, i[37] = y, i[38] = L, i[39] = F, i[40] = z, i[41] = g, i[42] = m, i[43] = u, i[44] = f, i[45] = v, i[46] = B, i[47] = V, i[48] = H, i[49] = X, i[50] = Q, i[51] = $) : $ = i[51], $;
|
|
169
176
|
};
|
|
170
177
|
function _temp(e) {
|
|
171
178
|
return {
|
|
@@ -178,20 +185,13 @@ function _temp2(e) {
|
|
|
178
185
|
return t == null ? "—" : `#${t}`;
|
|
179
186
|
}
|
|
180
187
|
function _temp3(e) {
|
|
181
|
-
let t = e;
|
|
182
|
-
return t ? /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
183
|
-
asChild: !0,
|
|
184
|
-
children: /* @__PURE__ */ jsx("span", { children: t.length > 40 ? t.slice(0, 40) + "..." : t })
|
|
185
|
-
}), t.length > 40 && /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: t }) })] }) }) : "—";
|
|
186
|
-
}
|
|
187
|
-
function _temp4(e) {
|
|
188
188
|
let t = e;
|
|
189
189
|
return /* @__PURE__ */ jsx(Badge, {
|
|
190
190
|
className: `rounded-full border px-2 py-1 text-xs whitespace-nowrap ${statusColors[t] || "bg-muted text-muted-foreground border-border"}`,
|
|
191
191
|
children: t
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function _temp4(e) {
|
|
195
195
|
return new Date(e).toLocaleString();
|
|
196
196
|
}
|
|
197
197
|
export { Runs_default as default };
|
|
@@ -2,8 +2,8 @@ import { Button } from "../../../components/ui/button.js";
|
|
|
2
2
|
import { Input } from "../../../components/ui/input.js";
|
|
3
3
|
import { Label } from "../../../components/ui/label.js";
|
|
4
4
|
import { useWorkbenchLayout } from "../../workbench/providers/WorkbenchLayoutProvider.js";
|
|
5
|
-
import { SidebarPanel } from "../../workbench/components/SidebarPanel.js";
|
|
6
5
|
import "../../workbench/index.js";
|
|
6
|
+
import { SidebarPanel } from "../../workbench/components/SidebarPanel.js";
|
|
7
7
|
import { useCreateSecret, useDeleteSecret, useUpdateSecret, useWorkspaceSecrets } from "../../../hooks/useSecrets.js";
|
|
8
8
|
import { c } from "react/compiler-runtime";
|
|
9
9
|
import { useState } from "react";
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
+
import { useDocumentConfigs } from "../../../hooks/useConfig.js";
|
|
1
2
|
import { Button } from "../../../components/ui/button.js";
|
|
2
3
|
import { Input } from "../../../components/ui/input.js";
|
|
3
4
|
import { Label } from "../../../components/ui/label.js";
|
|
4
5
|
import CompletionMessagePaper_default from "../../../components/messages/CompletionMessagePaper.js";
|
|
5
|
-
import { useWorkbenchLayout } from "../../workbench/providers/WorkbenchLayoutProvider.js";
|
|
6
6
|
import { useRunWorkflow } from "../../../hooks/useProcessor.js";
|
|
7
|
+
import { useWorkbenchLayout } from "../../workbench/providers/WorkbenchLayoutProvider.js";
|
|
7
8
|
import "../../workbench/index.js";
|
|
8
9
|
import { useUpsertSecret } from "../../../hooks/useSecrets.js";
|
|
9
10
|
import React, { useState } from "react";
|
|
10
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
12
|
import { Info, KeyRound, Loader2 } from "lucide-react";
|
|
12
|
-
var SecretInputRenderer_default = ({ parentWorkflow:
|
|
13
|
-
let
|
|
13
|
+
var SecretInputRenderer_default = ({ parentWorkflow: m, workflow: h, document: g, isActive: _ }) => {
|
|
14
|
+
let v = g.content.variables ?? [], y = (useDocumentConfigs().get(g.documentName)?.ui?.widgets)?.[0]?.options, b = y?.transition, x = y?.label ?? "Save & Continue", { workspaceId: S } = useWorkbenchLayout(), C = useRunWorkflow(), w = useUpsertSecret(), T = h.availableTransitions?.map((e) => e.id) ?? [], [E, D] = useState(() => {
|
|
14
15
|
let e = {};
|
|
15
|
-
for (let
|
|
16
|
+
for (let f of v) e[f.key] = f.value ?? "";
|
|
16
17
|
return e;
|
|
17
|
-
}), [
|
|
18
|
-
if (!(!
|
|
19
|
-
|
|
18
|
+
}), [O, k] = useState(!1), A = !!b && T.includes(b), j = !_ || !A, M = async () => {
|
|
19
|
+
if (!(!S || !b)) {
|
|
20
|
+
k(!0);
|
|
20
21
|
try {
|
|
21
22
|
let e = [];
|
|
22
|
-
for (let
|
|
23
|
-
let
|
|
24
|
-
!
|
|
25
|
-
workspaceId:
|
|
26
|
-
key:
|
|
27
|
-
value:
|
|
28
|
-
}), e.push(
|
|
23
|
+
for (let f of v) {
|
|
24
|
+
let p = E[f.key]?.trim();
|
|
25
|
+
!f.key.trim() || !p || (await w.mutateAsync({
|
|
26
|
+
workspaceId: S,
|
|
27
|
+
key: f.key,
|
|
28
|
+
value: p
|
|
29
|
+
}), e.push(f.key));
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
workflowId:
|
|
31
|
+
C.mutate({
|
|
32
|
+
workflowId: m.id,
|
|
32
33
|
runWorkflowPayloadDto: { transition: {
|
|
33
|
-
id:
|
|
34
|
-
workflowId:
|
|
34
|
+
id: b,
|
|
35
|
+
workflowId: h.id,
|
|
35
36
|
payload: { keys: e }
|
|
36
37
|
} }
|
|
37
38
|
});
|
|
38
39
|
} finally {
|
|
39
|
-
|
|
40
|
+
k(!1);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
return /* @__PURE__ */ jsx(CompletionMessagePaper_default, {
|
|
44
45
|
role: "document",
|
|
45
46
|
fullWidth: !0,
|
|
46
|
-
timestamp: new Date(
|
|
47
|
+
timestamp: new Date(g.createdAt),
|
|
47
48
|
children: /* @__PURE__ */ jsxs("div", {
|
|
48
49
|
className: "flex flex-col gap-4 p-1",
|
|
49
50
|
children: [
|
|
@@ -51,7 +52,7 @@ var SecretInputRenderer_default = ({ parentWorkflow: p, workflow: m, document: h
|
|
|
51
52
|
className: "text-sm font-medium",
|
|
52
53
|
children: "Secrets"
|
|
53
54
|
}),
|
|
54
|
-
|
|
55
|
+
v.map((e) => /* @__PURE__ */ jsxs("div", {
|
|
55
56
|
className: "flex flex-col gap-1.5",
|
|
56
57
|
children: [/* @__PURE__ */ jsx(Label, {
|
|
57
58
|
className: "text-muted-foreground text-xs",
|
|
@@ -59,12 +60,12 @@ var SecretInputRenderer_default = ({ parentWorkflow: p, workflow: m, document: h
|
|
|
59
60
|
}), /* @__PURE__ */ jsx(Input, {
|
|
60
61
|
type: "password",
|
|
61
62
|
placeholder: "Enter value...",
|
|
62
|
-
value:
|
|
63
|
-
onChange: (
|
|
64
|
-
...
|
|
65
|
-
[e.key]:
|
|
63
|
+
value: E[e.key] ?? "",
|
|
64
|
+
onChange: (f) => D((p) => ({
|
|
65
|
+
...p,
|
|
66
|
+
[e.key]: f.target.value
|
|
66
67
|
})),
|
|
67
|
-
disabled:
|
|
68
|
+
disabled: j
|
|
68
69
|
})]
|
|
69
70
|
}, e.key)),
|
|
70
71
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -74,10 +75,10 @@ var SecretInputRenderer_default = ({ parentWorkflow: p, workflow: m, document: h
|
|
|
74
75
|
/* @__PURE__ */ jsx("div", {
|
|
75
76
|
className: "flex justify-end",
|
|
76
77
|
children: /* @__PURE__ */ jsxs(Button, {
|
|
77
|
-
onClick: () => void
|
|
78
|
-
disabled:
|
|
78
|
+
onClick: () => void M(),
|
|
79
|
+
disabled: j || O,
|
|
79
80
|
className: "w-48",
|
|
80
|
-
children: [
|
|
81
|
+
children: [O ? /* @__PURE__ */ jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(KeyRound, { className: "mr-2 h-4 w-4" }), x]
|
|
81
82
|
})
|
|
82
83
|
})
|
|
83
84
|
]
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { useWorkspace } from "../../hooks/useWorkspaces.js";
|
|
2
1
|
import PageBreadcrumbs_default from "../../components/page/PageBreadcrumbs.js";
|
|
3
|
-
import { WorkbenchLayoutProvider } from "./providers/WorkbenchLayoutProvider.js";
|
|
4
|
-
import { WorkbenchSidebarShell } from "./components/WorkbenchSidebarShell.js";
|
|
5
2
|
import WorkflowList_default from "./WorkflowList.js";
|
|
6
3
|
import { ScrollProvider } from "./providers/ScrollProvider.js";
|
|
4
|
+
import { WorkbenchLayoutProvider } from "./providers/WorkbenchLayoutProvider.js";
|
|
5
|
+
import { WorkbenchSidebarShell } from "./components/WorkbenchSidebarShell.js";
|
|
7
6
|
import { c } from "react/compiler-runtime";
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
function WorkbenchContent(
|
|
10
|
-
let
|
|
11
|
-
|
|
8
|
+
function WorkbenchContent(a) {
|
|
9
|
+
let o = c(7), { workflow: l, breadcrumbData: u } = a, d;
|
|
10
|
+
o[0] === u ? d = o[1] : (d = /* @__PURE__ */ jsx("div", {
|
|
12
11
|
className: "border-b flex h-12 shrink-0 items-center",
|
|
13
12
|
children: u ? /* @__PURE__ */ jsx(PageBreadcrumbs_default, { breadcrumbData: u }) : /* @__PURE__ */ jsx("span", {
|
|
14
13
|
className: "px-3 text-sm font-medium",
|
|
15
14
|
children: "Workflows"
|
|
16
15
|
})
|
|
17
|
-
}),
|
|
16
|
+
}), o[0] = u, o[1] = d);
|
|
18
17
|
let f;
|
|
19
|
-
|
|
18
|
+
o[2] === l ? f = o[3] : (f = /* @__PURE__ */ jsx(ScrollProvider, { children: /* @__PURE__ */ jsx("div", {
|
|
20
19
|
className: "flex-1 overflow-auto",
|
|
21
|
-
children: /* @__PURE__ */ jsx(WorkflowList_default, { workflow:
|
|
22
|
-
}) }),
|
|
20
|
+
children: /* @__PURE__ */ jsx(WorkflowList_default, { workflow: l })
|
|
21
|
+
}) }), o[2] = l, o[3] = f);
|
|
23
22
|
let p;
|
|
24
|
-
return
|
|
23
|
+
return o[4] !== d || o[5] !== f ? (p = /* @__PURE__ */ jsx("div", {
|
|
25
24
|
className: "flex h-full flex-col",
|
|
26
25
|
children: /* @__PURE__ */ jsx("div", {
|
|
27
26
|
className: "flex flex-1 gap-4 overflow-hidden md:flex-row flex-col",
|
|
@@ -30,28 +29,21 @@ function WorkbenchContent(e) {
|
|
|
30
29
|
children: [d, f]
|
|
31
30
|
})
|
|
32
31
|
})
|
|
33
|
-
}),
|
|
32
|
+
}), o[4] = d, o[5] = f, o[6] = p) : p = o[6], p;
|
|
34
33
|
}
|
|
35
|
-
function Workbench(
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
workflow: s,
|
|
50
|
-
workspaceConfig: _,
|
|
51
|
-
getPreviewUrl: d,
|
|
52
|
-
getEnvironmentPreviewUrl: f,
|
|
53
|
-
environments: v,
|
|
54
|
-
children: y
|
|
55
|
-
}), o[5] = f, o[6] = d, o[7] = v, o[8] = y, o[9] = s, o[10] = _, o[11] = m, o[12] = b) : b = o[12], b;
|
|
34
|
+
function Workbench(e) {
|
|
35
|
+
let r = c(9), { workflow: i, breadcrumbData: s, getPreviewUrl: u, getEnvironmentPreviewUrl: d } = e, f = i?.workspaceId, p;
|
|
36
|
+
r[0] !== s || r[1] !== i ? (p = /* @__PURE__ */ jsx(WorkbenchSidebarShell, { children: /* @__PURE__ */ jsx(WorkbenchContent, {
|
|
37
|
+
workflow: i,
|
|
38
|
+
breadcrumbData: s
|
|
39
|
+
}) }), r[0] = s, r[1] = i, r[2] = p) : p = r[2];
|
|
40
|
+
let m;
|
|
41
|
+
return r[3] !== d || r[4] !== u || r[5] !== p || r[6] !== i || r[7] !== f ? (m = /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
|
|
42
|
+
workspaceId: f,
|
|
43
|
+
workflow: i,
|
|
44
|
+
getPreviewUrl: u,
|
|
45
|
+
getEnvironmentPreviewUrl: d,
|
|
46
|
+
children: p
|
|
47
|
+
}), r[3] = d, r[4] = u, r[5] = p, r[6] = i, r[7] = f, r[8] = m) : m = r[8], m;
|
|
56
48
|
}
|
|
57
49
|
export { Workbench as default };
|
|
@@ -50,18 +50,17 @@ var WorkflowItem_default = (h) => {
|
|
|
50
50
|
let J;
|
|
51
51
|
g[25] === N ? J = g[26] : (J = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: N }), g[25] = N, g[26] = J);
|
|
52
52
|
let Y;
|
|
53
|
-
g[27] !== E || g[28] !== A || g[29] !==
|
|
53
|
+
g[27] !== E || g[28] !== A || g[29] !== y || g[30] !== b || g[31] !== _ || g[32] !== O ? (Y = O && E && /* @__PURE__ */ jsx(DocumentList_default, {
|
|
54
54
|
workflow: _,
|
|
55
55
|
childWorkflow: E,
|
|
56
56
|
documents: A,
|
|
57
57
|
scrollTo: y,
|
|
58
|
-
settings: b
|
|
59
|
-
|
|
60
|
-
}), g[27] = E, g[28] = A, g[29] = P, g[30] = y, g[31] = b, g[32] = _, g[33] = O, g[34] = Y) : Y = g[34];
|
|
58
|
+
settings: b
|
|
59
|
+
}), g[27] = E, g[28] = A, g[29] = y, g[30] = b, g[31] = _, g[32] = O, g[33] = Y) : Y = g[33];
|
|
61
60
|
let X;
|
|
62
|
-
g[
|
|
61
|
+
g[34] === P ? X = g[35] : (X = /* @__PURE__ */ jsx(LoadingCentered_default, { loading: P }), g[34] = P, g[35] = X);
|
|
63
62
|
let Z;
|
|
64
|
-
g[
|
|
63
|
+
g[36] !== V || g[37] !== E?.hasError || g[38] !== U || g[39] !== w.isPending || g[40] !== k ? (Z = k && E?.hasError && /* @__PURE__ */ jsxs("div", {
|
|
65
64
|
className: "mt-3 flex items-center gap-2 px-1",
|
|
66
65
|
children: [
|
|
67
66
|
/* @__PURE__ */ jsx(AlertCircle, { className: "text-destructive h-4 w-4 shrink-0" }),
|
|
@@ -77,16 +76,17 @@ var WorkflowItem_default = (h) => {
|
|
|
77
76
|
children: [w.isPending ? /* @__PURE__ */ jsx("div", { className: "mr-1 h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(RefreshCw, { className: "mr-1 h-3.5 w-3.5" }), "Retry"]
|
|
78
77
|
})
|
|
79
78
|
]
|
|
80
|
-
}), g[
|
|
79
|
+
}), g[36] = V, g[37] = E?.hasError, g[38] = U, g[39] = w.isPending, g[40] = k, g[41] = Z) : Z = g[41];
|
|
81
80
|
let Q;
|
|
82
|
-
g[
|
|
81
|
+
g[42] !== E || g[43] !== F || g[44] !== P || g[45] !== _ ? (Q = !!E && /* @__PURE__ */ jsx("div", {
|
|
83
82
|
className: "mt-6",
|
|
84
83
|
children: /* @__PURE__ */ jsx(WorkflowForms_default, {
|
|
85
84
|
workflow: E,
|
|
86
85
|
parentWorkflow: _,
|
|
86
|
+
isLoading: P,
|
|
87
87
|
onSubmit: F
|
|
88
88
|
})
|
|
89
|
-
}), g[
|
|
89
|
+
}), g[42] = E, g[43] = F, g[44] = P, g[45] = _, g[46] = Q) : Q = g[46];
|
|
90
90
|
let $;
|
|
91
91
|
return g[47] !== J || g[48] !== Y || g[49] !== X || g[50] !== Z || g[51] !== Q || g[52] !== G || g[53] !== q ? ($ = /* @__PURE__ */ jsxs("div", {
|
|
92
92
|
className: G,
|