@loopstack/loopstack-studio 0.29.5 → 0.30.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/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/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 +4 -4
- 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 +1 -1
- 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 +134 -125
- 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 +116 -15
- package/dist/index.js +9 -8
- 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/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/package.json +2 -2
|
@@ -1,188 +1,189 @@
|
|
|
1
|
+
import { useDocumentConfigs } from "../../hooks/useConfig.js";
|
|
1
2
|
import CompletionMessagePaper_default from "../../components/messages/CompletionMessagePaper.js";
|
|
2
3
|
import { useRunWorkflow } from "../../hooks/useProcessor.js";
|
|
3
4
|
import { useOAuthPopup } from "./useOAuthPopup.js";
|
|
4
5
|
import { c } from "react/compiler-runtime";
|
|
5
6
|
import React, { useCallback, useEffect, useRef } from "react";
|
|
6
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
var OAuthPromptRenderer = (
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
!
|
|
15
|
-
workflowId:
|
|
8
|
+
var OAuthPromptRenderer = (f) => {
|
|
9
|
+
let p = c(47), { parentWorkflow: g, workflow: _, document: v, isActive: y } = f, b = v.content, x = useDocumentConfigs(), S;
|
|
10
|
+
p[0] !== v.documentName || p[1] !== x ? (S = x.get(v.documentName), p[0] = v.documentName, p[1] = x, p[2] = S) : S = p[2];
|
|
11
|
+
let C = (S?.ui?.widgets)?.[0]?.options?.transition, w = useRunWorkflow(), { result: T, open: E, reset: D } = useOAuthPopup(), O = useRef(!1), k;
|
|
12
|
+
p[3] === _.availableTransitions ? k = p[4] : (k = _.availableTransitions?.map(_temp) ?? [], p[3] = _.availableTransitions, p[4] = k);
|
|
13
|
+
let A = k, j;
|
|
14
|
+
p[5] !== A || p[6] !== g.id || p[7] !== w || p[8] !== C || p[9] !== _.id ? (j = (t, s) => {
|
|
15
|
+
!C || !A.includes(C) || w.mutate({
|
|
16
|
+
workflowId: g.id,
|
|
16
17
|
runWorkflowPayloadDto: { transition: {
|
|
17
|
-
id:
|
|
18
|
-
workflowId:
|
|
18
|
+
id: C,
|
|
19
|
+
workflowId: _.id,
|
|
19
20
|
payload: {
|
|
20
21
|
code: t,
|
|
21
|
-
state:
|
|
22
|
+
state: s
|
|
22
23
|
}
|
|
23
24
|
} }
|
|
24
25
|
});
|
|
25
|
-
},
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
authUrl:
|
|
36
|
-
state:
|
|
26
|
+
}, p[5] = A, p[6] = g.id, p[7] = w, p[8] = C, p[9] = _.id, p[10] = j) : j = p[10];
|
|
27
|
+
let M = j, N;
|
|
28
|
+
p[11] !== T.code || p[12] !== T.state || p[13] !== T.status || p[14] !== M ? (N = () => {
|
|
29
|
+
T.status === "success" && !O.current && (O.current = !0, M(T.code, T.state));
|
|
30
|
+
}, p[11] = T.code, p[12] = T.state, p[13] = T.status, p[14] = M, p[15] = N) : N = p[15];
|
|
31
|
+
let P;
|
|
32
|
+
p[16] !== T || p[17] !== M ? (P = [T, M], p[16] = T, p[17] = M, p[18] = P) : P = p[18], useEffect(N, P);
|
|
33
|
+
let F;
|
|
34
|
+
p[19] !== b.authUrl || p[20] !== b.state || p[21] !== E ? (F = () => {
|
|
35
|
+
O.current = !1, E({
|
|
36
|
+
authUrl: b.authUrl,
|
|
37
|
+
state: b.state
|
|
37
38
|
});
|
|
38
|
-
},
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
authUrl:
|
|
43
|
-
state:
|
|
39
|
+
}, p[19] = b.authUrl, p[20] = b.state, p[21] = E, p[22] = F) : F = p[22];
|
|
40
|
+
let I = F, L;
|
|
41
|
+
p[23] !== b.authUrl || p[24] !== b.state || p[25] !== E || p[26] !== D ? (L = () => {
|
|
42
|
+
D(), O.current = !1, E({
|
|
43
|
+
authUrl: b.authUrl,
|
|
44
|
+
state: b.state
|
|
44
45
|
});
|
|
45
|
-
},
|
|
46
|
-
let
|
|
47
|
-
if (
|
|
48
|
-
let
|
|
49
|
-
return
|
|
46
|
+
}, p[23] = b.authUrl, p[24] = b.state, p[25] = E, p[26] = D, p[27] = L) : L = p[27];
|
|
47
|
+
let R = L;
|
|
48
|
+
if (b.status === "success") {
|
|
49
|
+
let t;
|
|
50
|
+
return p[28] !== b.message || p[29] !== b.provider ? (t = /* @__PURE__ */ jsx(CompletionMessagePaper_default, { children: /* @__PURE__ */ jsx(StatusDisplay, {
|
|
50
51
|
status: "success",
|
|
51
|
-
provider:
|
|
52
|
-
message:
|
|
53
|
-
}) }),
|
|
52
|
+
provider: b.provider,
|
|
53
|
+
message: b.message
|
|
54
|
+
}) }), p[28] = b.message, p[29] = b.provider, p[30] = t) : t = p[30], t;
|
|
54
55
|
}
|
|
55
|
-
if (
|
|
56
|
-
let
|
|
57
|
-
|
|
56
|
+
if (b.status === "error") {
|
|
57
|
+
let t;
|
|
58
|
+
p[31] !== b.message || p[32] !== b.provider ? (t = /* @__PURE__ */ jsx(StatusDisplay, {
|
|
58
59
|
status: "error",
|
|
59
|
-
provider:
|
|
60
|
-
message:
|
|
61
|
-
}),
|
|
62
|
-
let
|
|
63
|
-
|
|
64
|
-
let
|
|
65
|
-
return
|
|
60
|
+
provider: b.provider,
|
|
61
|
+
message: b.message
|
|
62
|
+
}), p[31] = b.message, p[32] = b.provider, p[33] = t) : t = p[33];
|
|
63
|
+
let l;
|
|
64
|
+
p[34] !== R || p[35] !== y ? (l = y && /* @__PURE__ */ jsx(RetryButton, { onClick: R }), p[34] = R, p[35] = y, p[36] = l) : l = p[36];
|
|
65
|
+
let u;
|
|
66
|
+
return p[37] !== t || p[38] !== l ? (u = /* @__PURE__ */ jsxs(CompletionMessagePaper_default, { children: [t, l] }), p[37] = t, p[38] = l, p[39] = u) : u = p[39], u;
|
|
66
67
|
}
|
|
67
|
-
let
|
|
68
|
-
return
|
|
69
|
-
result:
|
|
70
|
-
provider:
|
|
71
|
-
isActive:
|
|
72
|
-
isSubmitting:
|
|
73
|
-
onSignIn:
|
|
74
|
-
onRetry:
|
|
75
|
-
}) }),
|
|
68
|
+
let z;
|
|
69
|
+
return p[40] !== b.provider || p[41] !== R || p[42] !== I || p[43] !== y || p[44] !== T || p[45] !== w.isPending ? (z = /* @__PURE__ */ jsx(CompletionMessagePaper_default, { children: /* @__PURE__ */ jsx(PopupResultView, {
|
|
70
|
+
result: T,
|
|
71
|
+
provider: b.provider,
|
|
72
|
+
isActive: y,
|
|
73
|
+
isSubmitting: w.isPending,
|
|
74
|
+
onSignIn: I,
|
|
75
|
+
onRetry: R
|
|
76
|
+
}) }), p[40] = b.provider, p[41] = R, p[42] = I, p[43] = y, p[44] = T, p[45] = w.isPending, p[46] = z) : z = p[46], z;
|
|
76
77
|
}, ProviderLabel = (t) => {
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
let
|
|
80
|
-
return
|
|
78
|
+
let s = c(4), { provider: l } = t, u;
|
|
79
|
+
s[0] === l ? u = s[1] : (u = l.charAt(0).toUpperCase(), s[0] = l, s[1] = u);
|
|
80
|
+
let f = u + l.slice(1), p;
|
|
81
|
+
return s[2] === f ? p = s[3] : (p = /* @__PURE__ */ jsx(Fragment$1, { children: f }), s[2] = f, s[3] = p), p;
|
|
81
82
|
}, StatusDisplay = (t) => {
|
|
82
|
-
let
|
|
83
|
-
return
|
|
83
|
+
let s = c(4), { status: l, provider: u, message: f } = t, p;
|
|
84
|
+
return s[0] !== f || s[1] !== u || s[2] !== l ? (p = /* @__PURE__ */ jsx("div", {
|
|
84
85
|
className: "flex items-center gap-3 py-1",
|
|
85
|
-
children:
|
|
86
|
+
children: l === "success" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
86
87
|
className: "flex h-6 w-6 items-center justify-center rounded-full bg-green-100 text-green-600 text-sm",
|
|
87
88
|
children: "✓"
|
|
88
89
|
}), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
|
|
89
90
|
className: "text-sm font-medium",
|
|
90
|
-
children: ["Connected to ", /* @__PURE__ */ jsx(ProviderLabel, { provider:
|
|
91
|
-
}),
|
|
91
|
+
children: ["Connected to ", /* @__PURE__ */ jsx(ProviderLabel, { provider: u })]
|
|
92
|
+
}), f && /* @__PURE__ */ jsx("div", {
|
|
92
93
|
className: "text-xs text-gray-500 mt-0.5",
|
|
93
|
-
children:
|
|
94
|
+
children: f
|
|
94
95
|
})] })] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
95
96
|
className: "flex h-6 w-6 items-center justify-center rounded-full bg-red-100 text-red-600 text-sm",
|
|
96
97
|
children: "✗"
|
|
97
98
|
}), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
|
|
98
99
|
className: "text-sm font-medium",
|
|
99
100
|
children: "Authentication failed"
|
|
100
|
-
}),
|
|
101
|
+
}), f && /* @__PURE__ */ jsx("div", {
|
|
101
102
|
className: "text-xs text-red-500 mt-0.5",
|
|
102
|
-
children:
|
|
103
|
+
children: f
|
|
103
104
|
})] })] })
|
|
104
|
-
}),
|
|
105
|
+
}), s[0] = f, s[1] = u, s[2] = l, s[3] = p) : p = s[3], p;
|
|
105
106
|
}, RetryButton = (t) => {
|
|
106
|
-
let
|
|
107
|
-
return
|
|
108
|
-
onClick:
|
|
107
|
+
let s = c(2), { onClick: l } = t, u;
|
|
108
|
+
return s[0] === l ? u = s[1] : (u = /* @__PURE__ */ jsx("button", {
|
|
109
|
+
onClick: l,
|
|
109
110
|
className: "mt-3 rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50",
|
|
110
111
|
children: "Try again"
|
|
111
|
-
}),
|
|
112
|
+
}), s[0] = l, s[1] = u), u;
|
|
112
113
|
}, PopupResultView = (t) => {
|
|
113
|
-
let
|
|
114
|
-
switch (
|
|
114
|
+
let s = c(47), { result: l, provider: u, isActive: f, isSubmitting: p, onSignIn: m, onRetry: h } = t;
|
|
115
|
+
switch (l.status) {
|
|
115
116
|
case "idle": {
|
|
116
117
|
let t;
|
|
117
|
-
|
|
118
|
+
s[0] === u ? t = s[1] : (t = /* @__PURE__ */ jsxs("div", {
|
|
118
119
|
className: "text-sm font-medium mb-1",
|
|
119
120
|
children: [
|
|
120
121
|
"Connect your ",
|
|
121
|
-
/* @__PURE__ */ jsx(ProviderLabel, { provider:
|
|
122
|
+
/* @__PURE__ */ jsx(ProviderLabel, { provider: u }),
|
|
122
123
|
" account"
|
|
123
124
|
]
|
|
124
|
-
}),
|
|
125
|
-
let
|
|
126
|
-
|
|
125
|
+
}), s[0] = u, s[1] = t);
|
|
126
|
+
let l;
|
|
127
|
+
s[2] === u ? l = s[3] : (l = /* @__PURE__ */ jsxs("div", {
|
|
127
128
|
className: "text-xs text-gray-500 mb-3",
|
|
128
129
|
children: [
|
|
129
130
|
"This workflow needs access to your ",
|
|
130
|
-
/* @__PURE__ */ jsx(ProviderLabel, { provider:
|
|
131
|
+
/* @__PURE__ */ jsx(ProviderLabel, { provider: u }),
|
|
131
132
|
" resources."
|
|
132
133
|
]
|
|
133
|
-
}),
|
|
134
|
-
let
|
|
135
|
-
|
|
136
|
-
onClick:
|
|
134
|
+
}), s[2] = u, s[3] = l);
|
|
135
|
+
let d;
|
|
136
|
+
s[4] !== f || s[5] !== m || s[6] !== u ? (d = f && /* @__PURE__ */ jsxs("button", {
|
|
137
|
+
onClick: m,
|
|
137
138
|
className: "rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50",
|
|
138
|
-
children: ["Sign in with ", /* @__PURE__ */ jsx(ProviderLabel, { provider:
|
|
139
|
-
}),
|
|
140
|
-
let
|
|
141
|
-
return
|
|
139
|
+
children: ["Sign in with ", /* @__PURE__ */ jsx(ProviderLabel, { provider: u })]
|
|
140
|
+
}), s[4] = f, s[5] = m, s[6] = u, s[7] = d) : d = s[7];
|
|
141
|
+
let p;
|
|
142
|
+
return s[8] !== t || s[9] !== l || s[10] !== d ? (p = /* @__PURE__ */ jsxs("div", {
|
|
142
143
|
className: "py-1",
|
|
143
144
|
children: [
|
|
144
145
|
t,
|
|
145
|
-
|
|
146
|
-
|
|
146
|
+
l,
|
|
147
|
+
d
|
|
147
148
|
]
|
|
148
|
-
}),
|
|
149
|
+
}), s[8] = t, s[9] = l, s[10] = d, s[11] = p) : p = s[11], p;
|
|
149
150
|
}
|
|
150
151
|
case "pending": {
|
|
151
|
-
let t,
|
|
152
|
-
|
|
152
|
+
let t, l;
|
|
153
|
+
s[12] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ jsxs("div", {
|
|
153
154
|
className: "flex items-center gap-3",
|
|
154
155
|
children: [/* @__PURE__ */ jsx("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-600" }), /* @__PURE__ */ jsx("div", {
|
|
155
156
|
className: "text-sm font-medium",
|
|
156
157
|
children: "Waiting for authentication..."
|
|
157
158
|
})]
|
|
158
|
-
}),
|
|
159
|
+
}), l = /* @__PURE__ */ jsx("div", {
|
|
159
160
|
className: "text-xs text-gray-500 mt-2",
|
|
160
161
|
children: "Complete the sign-in in the popup window."
|
|
161
|
-
}),
|
|
162
|
-
let
|
|
163
|
-
|
|
162
|
+
}), s[12] = t, s[13] = l) : (t = s[12], l = s[13]);
|
|
163
|
+
let u;
|
|
164
|
+
s[14] !== f || s[15] !== h ? (u = f && /* @__PURE__ */ jsx("div", {
|
|
164
165
|
className: "mt-3 flex gap-2",
|
|
165
166
|
children: /* @__PURE__ */ jsx("button", {
|
|
166
|
-
onClick:
|
|
167
|
+
onClick: h,
|
|
167
168
|
className: "rounded-md border border-gray-300 bg-white px-3 py-1.5 text-xs font-medium text-gray-600 hover:bg-gray-50",
|
|
168
169
|
children: "Retry"
|
|
169
170
|
})
|
|
170
|
-
}),
|
|
171
|
-
let
|
|
172
|
-
return
|
|
171
|
+
}), s[14] = f, s[15] = h, s[16] = u) : u = s[16];
|
|
172
|
+
let d;
|
|
173
|
+
return s[17] === u ? d = s[18] : (d = /* @__PURE__ */ jsxs("div", {
|
|
173
174
|
className: "py-1",
|
|
174
175
|
children: [
|
|
175
176
|
t,
|
|
176
|
-
|
|
177
|
-
|
|
177
|
+
l,
|
|
178
|
+
u
|
|
178
179
|
]
|
|
179
|
-
}),
|
|
180
|
+
}), s[17] = u, s[18] = d), d;
|
|
180
181
|
}
|
|
181
182
|
case "success": {
|
|
182
183
|
let t;
|
|
183
|
-
return
|
|
184
|
+
return s[19] !== p || s[20] !== u ? (t = /* @__PURE__ */ jsx("div", {
|
|
184
185
|
className: "py-1",
|
|
185
|
-
children:
|
|
186
|
+
children: p ? /* @__PURE__ */ jsxs("div", {
|
|
186
187
|
className: "flex items-center gap-3",
|
|
187
188
|
children: [/* @__PURE__ */ jsx("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-600" }), /* @__PURE__ */ jsx("div", {
|
|
188
189
|
className: "text-sm font-medium",
|
|
@@ -190,64 +191,58 @@ var OAuthPromptRenderer = (p) => {
|
|
|
190
191
|
})]
|
|
191
192
|
}) : /* @__PURE__ */ jsx(StatusDisplay, {
|
|
192
193
|
status: "success",
|
|
193
|
-
provider:
|
|
194
|
+
provider: u
|
|
194
195
|
})
|
|
195
|
-
}),
|
|
196
|
+
}), s[19] = p, s[20] = u, s[21] = t) : t = s[21], t;
|
|
196
197
|
}
|
|
197
198
|
case "error": {
|
|
198
199
|
let t;
|
|
199
|
-
|
|
200
|
+
s[22] !== u || s[23] !== l.error ? (t = /* @__PURE__ */ jsx(StatusDisplay, {
|
|
200
201
|
status: "error",
|
|
201
|
-
provider:
|
|
202
|
-
message:
|
|
203
|
-
}),
|
|
204
|
-
let
|
|
205
|
-
|
|
206
|
-
let
|
|
207
|
-
return
|
|
202
|
+
provider: u,
|
|
203
|
+
message: l.error
|
|
204
|
+
}), s[22] = u, s[23] = l.error, s[24] = t) : t = s[24];
|
|
205
|
+
let d;
|
|
206
|
+
s[25] !== f || s[26] !== h ? (d = f && /* @__PURE__ */ jsx(RetryButton, { onClick: h }), s[25] = f, s[26] = h, s[27] = d) : d = s[27];
|
|
207
|
+
let p;
|
|
208
|
+
return s[28] !== t || s[29] !== d ? (p = /* @__PURE__ */ jsxs("div", {
|
|
208
209
|
className: "py-1",
|
|
209
|
-
children: [t,
|
|
210
|
-
}),
|
|
210
|
+
children: [t, d]
|
|
211
|
+
}), s[28] = t, s[29] = d, s[30] = p) : p = s[30], p;
|
|
211
212
|
}
|
|
212
213
|
case "timeout": {
|
|
213
214
|
let t;
|
|
214
|
-
|
|
215
|
+
s[31] === u ? t = s[32] : (t = /* @__PURE__ */ jsx(StatusDisplay, {
|
|
215
216
|
status: "error",
|
|
216
|
-
provider:
|
|
217
|
+
provider: u,
|
|
217
218
|
message: "Authentication timed out."
|
|
218
|
-
}),
|
|
219
|
+
}), s[31] = u, s[32] = t);
|
|
220
|
+
let l;
|
|
221
|
+
s[33] !== f || s[34] !== h ? (l = f && /* @__PURE__ */ jsx(RetryButton, { onClick: h }), s[33] = f, s[34] = h, s[35] = l) : l = s[35];
|
|
219
222
|
let d;
|
|
220
|
-
|
|
221
|
-
let f;
|
|
222
|
-
return u[36] !== t || u[37] !== d ? (f = /* @__PURE__ */ jsxs("div", {
|
|
223
|
+
return s[36] !== t || s[37] !== l ? (d = /* @__PURE__ */ jsxs("div", {
|
|
223
224
|
className: "py-1",
|
|
224
|
-
children: [t,
|
|
225
|
-
}),
|
|
225
|
+
children: [t, l]
|
|
226
|
+
}), s[36] = t, s[37] = l, s[38] = d) : d = s[38], d;
|
|
226
227
|
}
|
|
227
228
|
case "blocked": {
|
|
228
229
|
let t;
|
|
229
|
-
|
|
230
|
+
s[39] === u ? t = s[40] : (t = /* @__PURE__ */ jsx(StatusDisplay, {
|
|
230
231
|
status: "error",
|
|
231
|
-
provider:
|
|
232
|
+
provider: u,
|
|
232
233
|
message: "Popup was blocked by the browser. Please allow popups for this site and try again."
|
|
233
|
-
}),
|
|
234
|
+
}), s[39] = u, s[40] = t);
|
|
235
|
+
let l;
|
|
236
|
+
s[41] !== f || s[42] !== h ? (l = f && /* @__PURE__ */ jsx(RetryButton, { onClick: h }), s[41] = f, s[42] = h, s[43] = l) : l = s[43];
|
|
234
237
|
let d;
|
|
235
|
-
|
|
236
|
-
let f;
|
|
237
|
-
return u[44] !== t || u[45] !== d ? (f = /* @__PURE__ */ jsxs("div", {
|
|
238
|
+
return s[44] !== t || s[45] !== l ? (d = /* @__PURE__ */ jsxs("div", {
|
|
238
239
|
className: "py-1",
|
|
239
|
-
children: [t,
|
|
240
|
-
}),
|
|
240
|
+
children: [t, l]
|
|
241
|
+
}), s[44] = t, s[45] = l, s[46] = d) : d = s[46], d;
|
|
241
242
|
}
|
|
242
243
|
}
|
|
243
244
|
}, OAuthPromptRenderer_default = OAuthPromptRenderer;
|
|
244
245
|
function _temp(t) {
|
|
245
|
-
return t.options?.transition;
|
|
246
|
-
}
|
|
247
|
-
function _temp2(t) {
|
|
248
|
-
return !!t;
|
|
249
|
-
}
|
|
250
|
-
function _temp3(t) {
|
|
251
246
|
return t.id;
|
|
252
247
|
}
|
|
253
248
|
export { OAuthPromptRenderer_default as default };
|
|
@@ -38,7 +38,7 @@ var statusColors = {
|
|
|
38
38
|
let j = A, M;
|
|
39
39
|
if (r[11] !== S.data?.data) {
|
|
40
40
|
let e = /* @__PURE__ */ new Set();
|
|
41
|
-
for (let t of S.data?.data ?? []) t.
|
|
41
|
+
for (let t of S.data?.data ?? []) t.workflowName && e.add(t.workflowName);
|
|
42
42
|
M = Array.from(e).sort(), r[11] = S.data?.data, r[12] = M;
|
|
43
43
|
} else M = r[12];
|
|
44
44
|
let N = M, P;
|
|
@@ -84,7 +84,7 @@ var statusColors = {
|
|
|
84
84
|
}, r[22] = O, r[23] = W);
|
|
85
85
|
let G, K, q, J;
|
|
86
86
|
r[24] === Symbol.for("react.memo_cache_sentinel") ? (G = {
|
|
87
|
-
id: "
|
|
87
|
+
id: "workflowName",
|
|
88
88
|
label: "Type",
|
|
89
89
|
minWidth: 100,
|
|
90
90
|
format: (e) => {
|
|
@@ -95,7 +95,7 @@ var statusColors = {
|
|
|
95
95
|
onClick: (e) => {
|
|
96
96
|
e.stopPropagation(), b((e) => ({
|
|
97
97
|
...e,
|
|
98
|
-
|
|
98
|
+
workflowName: t
|
|
99
99
|
}));
|
|
100
100
|
},
|
|
101
101
|
children: t
|
|
@@ -139,7 +139,7 @@ var statusColors = {
|
|
|
139
139
|
r[31] !== N || r[32] !== j ? (Q = {
|
|
140
140
|
status: Z,
|
|
141
141
|
workspaceId: j,
|
|
142
|
-
|
|
142
|
+
workflowName: N
|
|
143
143
|
}, r[31] = N, r[32] = j, r[33] = Q) : Q = r[33];
|
|
144
144
|
let $;
|
|
145
145
|
return r[34] !== S.isPending || r[35] !== y || r[36] !== L || r[37] !== F || r[38] !== z || r[39] !== h || r[40] !== p || r[41] !== l || r[42] !== d || r[43] !== _ || r[44] !== B || r[45] !== V || r[46] !== H || r[47] !== X || r[48] !== Q ? ($ = /* @__PURE__ */ jsx(ListView_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
|
]
|