@loopstack/loopstack-studio 0.29.4 → 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/Form.js +31 -51
- 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,93 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import "../../../providers/StudioProvider.js";
|
|
2
|
+
import "../../../hooks/useWorkflows.js";
|
|
3
|
+
import "../../../components/ui/button.js";
|
|
4
|
+
import "../../../components/feedback/ErrorSnackbar.js";
|
|
5
|
+
import "../../../hooks/useProcessor.js";
|
|
6
|
+
import "../../../components/dynamic-form/Form.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
|
-
var WorkspaceHomePage_default = (p) => {
|
|
12
|
-
let m = c(39), { workspace: h, action: g } = p, { router: _ } = useStudio(), v = useCreateWorkflow(), y = useRunWorkflow(), b;
|
|
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.workflowUi, D;
|
|
15
|
-
m[2] === Symbol.for("react.memo_cache_sentinel") ? (D = {
|
|
16
|
-
defaultValues: {},
|
|
17
|
-
mode: "onChange"
|
|
18
|
-
}, m[2] = D) : D = m[2];
|
|
19
|
-
let O = useForm(D), k = v.isPending || y.isPending, A = !!T, j;
|
|
20
|
-
m[3] !== v || m[4] !== A || m[5] !== _ || m[6] !== y || m[7] !== S || m[8] !== h ? (j = (t) => {
|
|
21
|
-
v.mutate({ workflowCreateDto: {
|
|
22
|
-
alias: S,
|
|
23
|
-
title: null,
|
|
24
|
-
workspaceId: h.id,
|
|
25
|
-
transition: null,
|
|
26
|
-
args: A ? t : void 0
|
|
27
|
-
} }, { onSuccess: (t) => {
|
|
28
|
-
y.mutate({
|
|
29
|
-
workflowId: t.id,
|
|
30
|
-
runWorkflowPayloadDto: {},
|
|
31
|
-
force: !0
|
|
32
|
-
}, { onSuccess: () => {
|
|
33
|
-
_.navigateToWorkflow(t.id);
|
|
34
|
-
} });
|
|
35
|
-
} });
|
|
36
|
-
}, m[3] = v, m[4] = A, m[5] = _, m[6] = y, m[7] = S, m[8] = h, m[9] = j) : j = m[9];
|
|
37
|
-
let M = j, N;
|
|
38
|
-
m[10] !== O || m[11] !== M ? (N = () => {
|
|
39
|
-
O.handleSubmit(M)();
|
|
40
|
-
}, m[10] = O, m[11] = M, m[12] = N) : N = m[12];
|
|
41
|
-
let P = N, F;
|
|
42
|
-
m[13] === v.error ? F = m[14] : (F = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: v.error }), m[13] = v.error, m[14] = F);
|
|
43
|
-
let I;
|
|
44
|
-
m[15] === y.error ? I = m[16] : (I = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: y.error }), m[15] = y.error, m[16] = I);
|
|
45
|
-
let L;
|
|
46
|
-
m[17] === C ? L = m[18] : (L = C && /* @__PURE__ */ jsx("h2", {
|
|
47
|
-
className: "mb-2 text-center text-3xl font-bold tracking-tight",
|
|
48
|
-
children: C
|
|
49
|
-
}), m[17] = C, m[18] = L);
|
|
50
|
-
let R;
|
|
51
|
-
m[19] === w ? R = m[20] : (R = w && /* @__PURE__ */ jsx("p", {
|
|
52
|
-
className: "text-muted-foreground mb-8 text-center text-sm",
|
|
53
|
-
children: w
|
|
54
|
-
}), m[19] = w, m[20] = R);
|
|
55
|
-
let z;
|
|
56
|
-
m[21] !== O || m[22] !== A || m[23] !== T || m[24] !== E ? (z = A ? /* @__PURE__ */ jsx("div", {
|
|
57
|
-
className: "mb-6 w-full",
|
|
58
|
-
children: /* @__PURE__ */ jsx(Form_default, {
|
|
59
|
-
form: O,
|
|
60
|
-
schema: T,
|
|
61
|
-
ui: E,
|
|
62
|
-
disabled: !1,
|
|
63
|
-
viewOnly: !1
|
|
64
|
-
})
|
|
65
|
-
}) : null, m[21] = O, m[22] = A, m[23] = T, m[24] = E, m[25] = z) : z = m[25];
|
|
66
|
-
let B;
|
|
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
|
-
let V;
|
|
69
|
-
m[28] !== k || m[29] !== P || m[30] !== B ? (V = /* @__PURE__ */ jsx("div", {
|
|
70
|
-
className: "flex w-full justify-end",
|
|
71
|
-
children: /* @__PURE__ */ jsxs(Button, {
|
|
72
|
-
variant: "default",
|
|
73
|
-
disabled: k,
|
|
74
|
-
onClick: P,
|
|
75
|
-
size: "lg",
|
|
76
|
-
className: "font-medium",
|
|
77
|
-
children: [B, "Run"]
|
|
78
|
-
})
|
|
79
|
-
}), m[28] = k, m[29] = P, m[30] = B, m[31] = V) : V = m[31];
|
|
80
|
-
let H;
|
|
81
|
-
return m[32] !== V || m[33] !== F || m[34] !== I || m[35] !== L || m[36] !== R || m[37] !== z ? (H = /* @__PURE__ */ jsxs("div", {
|
|
82
|
-
className: "mx-auto flex min-h-[80vh] max-w-2xl flex-col items-center justify-center",
|
|
83
|
-
children: [
|
|
84
|
-
F,
|
|
85
|
-
I,
|
|
86
|
-
L,
|
|
87
|
-
R,
|
|
88
|
-
z,
|
|
89
|
-
V
|
|
90
|
-
]
|
|
91
|
-
}), m[32] = V, m[33] = F, m[34] = I, m[35] = L, m[36] = R, m[37] = z, m[38] = H) : H = m[38], H;
|
|
92
|
-
};
|
|
93
|
-
export { WorkspaceHomePage_default as default };
|
|
@@ -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?.workflowName || "", 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,
|
|
@@ -6,9 +6,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { Loader2, Play } from "lucide-react";
|
|
7
7
|
var SelectionView_default = (p) => {
|
|
8
8
|
let m = c(46), { title: h, workflowTypes: g, formData: _, errors: v, isLoading: y, onInputChange: b, onNext: x } = p, S;
|
|
9
|
-
if (m[0] !== _.
|
|
9
|
+
if (m[0] !== _.workflowName || m[1] !== g) {
|
|
10
10
|
let e;
|
|
11
|
-
m[3] === _.
|
|
11
|
+
m[3] === _.workflowName ? e = m[4] : (e = (e) => e.workflowName === _.workflowName, m[3] = _.workflowName, m[4] = e), S = g.find(e), m[0] = _.workflowName, 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 = _.workflowName, O;
|
|
28
|
+
m[9] === b ? O = m[10] : (O = (e) => b("workflowName", e), m[9] = b, m[10] = O);
|
|
29
|
+
let k = `flex-1 ${v.workflowName ? "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] !== _.workflowName || 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] = _.workflowName, m[19] = y, m[20] = N, m[21] = O, m[22] = j, m[23] = P) : P = m[23];
|
|
48
|
+
let F = y || !_.workflowName, 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.workflowName ? z = m[34] : (z = v.workflowName && /* @__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.workflowName
|
|
67
|
+
}), m[33] = v.workflowName, 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.workflowName
|
|
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.workflowName,
|
|
102
|
+
children: e.title ?? e.workflowName
|
|
103
|
+
}, e.workflowName);
|
|
104
104
|
}
|
|
105
105
|
export { SelectionView_default as default };
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { getAppTypesCacheKey, getAvailableEnvironmentsCacheKey, getChildWorkflowsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getGitLogCacheKey, getGitRemoteCacheKey, getGitStatusCacheKey, getHealthCacheKey, getMeCacheKey, getSecretsCacheKey, getWorkflowCacheKey, getWorkflowConfigCacheKey, getWorkflowSourceCacheKey, getWorkflowTypesCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspacesCacheKey } from "./query-keys.js";
|
|
1
|
+
import { getAppTypesCacheKey, getAvailableEnvironmentsCacheKey, getChildWorkflowsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getGitLogCacheKey, getGitRemoteCacheKey, getGitStatusCacheKey, getHealthCacheKey, getMeCacheKey, getSecretsCacheKey, getStudioAppsCacheKey, getToolConfigCacheKey, getToolConfigsCacheKey, getWorkflowCacheKey, getWorkflowConfigCacheKey, getWorkflowSourceCacheKey, getWorkflowTypesCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspacesCacheKey } from "./query-keys.js";
|
|
2
2
|
import { useApiClient } from "./useApi.js";
|
|
3
3
|
import { useIsMobile } from "./use-mobile.js";
|
|
4
|
-
import {
|
|
4
|
+
import { useAppsConfig, useAvailableEnvironments, useDocumentConfigs } from "./useConfig.js";
|
|
5
|
+
import { useReplaceEnvironments, useResetEnvironment, useWorkspaceEnvironments } from "./useEnvironments.js";
|
|
5
6
|
import { useBatchDeleteWorkflows, useChildWorkflows, useCreateWorkflow, useDeleteWorkflow, useFilterWorkflows, useUpdateWorkflow, useWorkflow, useWorkflowCheckpoints, useWorkflowConfigByName, useWorkflowSource } from "./useWorkflows.js";
|
|
6
7
|
import { useBatchDeleteWorkspaces, useCreateWorkspace, useDeleteWorkspace, useFilterWorkspaces, useSetFavouriteWorkspace, useUpdateWorkspace, useWorkspace } from "./useWorkspaces.js";
|
package/dist/hooks/query-keys.js
CHANGED
|
@@ -7,13 +7,16 @@ function getHealthCacheKey(e) {
|
|
|
7
7
|
function getAppTypesCacheKey(e) {
|
|
8
8
|
return ["app-types", e];
|
|
9
9
|
}
|
|
10
|
-
function getWorkflowTypesCacheKey(e,
|
|
10
|
+
function getWorkflowTypesCacheKey(e, S) {
|
|
11
11
|
return [
|
|
12
12
|
"workflowTypes",
|
|
13
13
|
e,
|
|
14
|
-
|
|
14
|
+
S
|
|
15
15
|
];
|
|
16
16
|
}
|
|
17
|
+
function getStudioAppsCacheKey(e) {
|
|
18
|
+
return ["studio-apps", e];
|
|
19
|
+
}
|
|
17
20
|
function getAvailableEnvironmentsCacheKey(e) {
|
|
18
21
|
return ["available-environments", e];
|
|
19
22
|
}
|
|
@@ -24,102 +27,112 @@ function getDashboardStatsCacheKey(e) {
|
|
|
24
27
|
e
|
|
25
28
|
];
|
|
26
29
|
}
|
|
27
|
-
function getWorkflowCacheKey(e,
|
|
30
|
+
function getWorkflowCacheKey(e, S) {
|
|
28
31
|
return [
|
|
29
32
|
"workflow",
|
|
30
33
|
e,
|
|
31
|
-
|
|
34
|
+
S
|
|
32
35
|
];
|
|
33
36
|
}
|
|
34
37
|
function getWorkflowsCacheKey(e) {
|
|
35
38
|
return ["workflows", e];
|
|
36
39
|
}
|
|
37
|
-
function getChildWorkflowsCacheKey(e,
|
|
40
|
+
function getChildWorkflowsCacheKey(e, S) {
|
|
38
41
|
return [
|
|
39
42
|
"childWorkflows",
|
|
40
43
|
e,
|
|
41
|
-
|
|
44
|
+
S
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
function getToolConfigsCacheKey(e) {
|
|
48
|
+
return ["toolConfigs", e];
|
|
49
|
+
}
|
|
50
|
+
function getToolConfigCacheKey(e, S) {
|
|
51
|
+
return [
|
|
52
|
+
"toolConfig",
|
|
53
|
+
e,
|
|
54
|
+
S
|
|
42
55
|
];
|
|
43
56
|
}
|
|
44
|
-
function getWorkflowConfigCacheKey(e,
|
|
57
|
+
function getWorkflowConfigCacheKey(e, S) {
|
|
45
58
|
return [
|
|
46
59
|
"workflowConfig",
|
|
47
60
|
e,
|
|
48
|
-
|
|
61
|
+
S
|
|
49
62
|
];
|
|
50
63
|
}
|
|
51
|
-
function getWorkflowSourceCacheKey(e,
|
|
64
|
+
function getWorkflowSourceCacheKey(e, S) {
|
|
52
65
|
return [
|
|
53
66
|
"workflowSource",
|
|
54
67
|
e,
|
|
55
|
-
|
|
68
|
+
S
|
|
56
69
|
];
|
|
57
70
|
}
|
|
58
|
-
function getWorkspaceCacheKey(e,
|
|
71
|
+
function getWorkspaceCacheKey(e, S) {
|
|
59
72
|
return [
|
|
60
73
|
"workspace",
|
|
61
74
|
e,
|
|
62
|
-
|
|
75
|
+
S
|
|
63
76
|
];
|
|
64
77
|
}
|
|
65
78
|
function getWorkspacesCacheKey(e) {
|
|
66
79
|
return ["workspaces", e];
|
|
67
80
|
}
|
|
68
|
-
function getDocumentCacheKey(e,
|
|
81
|
+
function getDocumentCacheKey(e, S) {
|
|
69
82
|
return [
|
|
70
83
|
"document",
|
|
71
84
|
e,
|
|
72
|
-
|
|
85
|
+
S
|
|
73
86
|
];
|
|
74
87
|
}
|
|
75
|
-
function getDocumentsCacheKey(e,
|
|
88
|
+
function getDocumentsCacheKey(e, S) {
|
|
76
89
|
return [
|
|
77
90
|
"documents",
|
|
78
91
|
e,
|
|
79
|
-
|
|
92
|
+
S
|
|
80
93
|
];
|
|
81
94
|
}
|
|
82
|
-
function getSecretsCacheKey(e,
|
|
95
|
+
function getSecretsCacheKey(e, S) {
|
|
83
96
|
return [
|
|
84
97
|
"secrets",
|
|
85
98
|
e,
|
|
86
|
-
|
|
99
|
+
S
|
|
87
100
|
];
|
|
88
101
|
}
|
|
89
|
-
function getGitStatusCacheKey(e,
|
|
102
|
+
function getGitStatusCacheKey(e, S) {
|
|
90
103
|
return [
|
|
91
104
|
"gitStatus",
|
|
92
105
|
e,
|
|
93
|
-
|
|
106
|
+
S
|
|
94
107
|
];
|
|
95
108
|
}
|
|
96
|
-
function getGitLogCacheKey(e,
|
|
109
|
+
function getGitLogCacheKey(e, S) {
|
|
97
110
|
return [
|
|
98
111
|
"gitLog",
|
|
99
112
|
e,
|
|
100
|
-
|
|
113
|
+
S
|
|
101
114
|
];
|
|
102
115
|
}
|
|
103
|
-
function getGitRemoteCacheKey(e,
|
|
116
|
+
function getGitRemoteCacheKey(e, S) {
|
|
104
117
|
return [
|
|
105
118
|
"gitRemote",
|
|
106
119
|
e,
|
|
107
|
-
|
|
120
|
+
S
|
|
108
121
|
];
|
|
109
122
|
}
|
|
110
|
-
function getFileTreeCacheKey(e,
|
|
123
|
+
function getFileTreeCacheKey(e, S) {
|
|
111
124
|
return [
|
|
112
125
|
"fileTree",
|
|
113
126
|
e,
|
|
114
|
-
|
|
127
|
+
S
|
|
115
128
|
];
|
|
116
129
|
}
|
|
117
|
-
function getFileContentCacheKey(e,
|
|
130
|
+
function getFileContentCacheKey(e, S, C) {
|
|
118
131
|
return [
|
|
119
132
|
"fileContent",
|
|
120
133
|
e,
|
|
121
|
-
|
|
122
|
-
|
|
134
|
+
S,
|
|
135
|
+
C
|
|
123
136
|
];
|
|
124
137
|
}
|
|
125
|
-
export { getAppTypesCacheKey, getAvailableEnvironmentsCacheKey, getChildWorkflowsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getGitLogCacheKey, getGitRemoteCacheKey, getGitStatusCacheKey, getHealthCacheKey, getMeCacheKey, getSecretsCacheKey, getWorkflowCacheKey, getWorkflowConfigCacheKey, getWorkflowSourceCacheKey, getWorkflowTypesCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspacesCacheKey };
|
|
138
|
+
export { getAppTypesCacheKey, getAvailableEnvironmentsCacheKey, getChildWorkflowsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getGitLogCacheKey, getGitRemoteCacheKey, getGitStatusCacheKey, getHealthCacheKey, getMeCacheKey, getSecretsCacheKey, getStudioAppsCacheKey, getToolConfigCacheKey, getToolConfigsCacheKey, getWorkflowCacheKey, getWorkflowConfigCacheKey, getWorkflowSourceCacheKey, getWorkflowTypesCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspacesCacheKey };
|
package/dist/hooks/useConfig.js
CHANGED
|
@@ -1,40 +1,46 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getAvailableEnvironmentsCacheKey, getStudioAppsCacheKey } from "./query-keys.js";
|
|
2
2
|
import { useApiClient } from "./useApi.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { useMemo } from "react";
|
|
4
5
|
import { useQuery } from "@tanstack/react-query";
|
|
5
|
-
function
|
|
6
|
-
let
|
|
7
|
-
|
|
6
|
+
function useAppsConfig() {
|
|
7
|
+
let e = c(7), { envKey: a, api: o } = useApiClient(), s;
|
|
8
|
+
e[0] === a ? s = e[1] : (s = getStudioAppsCacheKey(a), e[0] = a, e[1] = s);
|
|
8
9
|
let l;
|
|
9
|
-
|
|
10
|
+
e[2] === o ? l = e[3] : (l = () => o.config.getApps(), e[2] = o, e[3] = l);
|
|
10
11
|
let u;
|
|
11
|
-
return
|
|
12
|
+
return e[4] !== s || e[5] !== l ? (u = {
|
|
12
13
|
queryKey: s,
|
|
13
14
|
queryFn: l
|
|
14
|
-
},
|
|
15
|
+
}, e[4] = s, e[5] = l, e[6] = u) : u = e[6], useQuery(u);
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
let i = c(10), { envKey: o, api: s } = useApiClient(), l;
|
|
18
|
-
i[0] !== e || i[1] !== o ? (l = getWorkflowTypesCacheKey(o, e), i[0] = e, i[1] = o, i[2] = l) : l = i[2];
|
|
19
|
-
let u;
|
|
20
|
-
i[3] !== s || i[4] !== e ? (u = () => s.config.getWorkflowTypesByApp({ appBlockName: e }), i[3] = s, i[4] = e, i[5] = u) : u = i[5];
|
|
21
|
-
let d = !!e, f;
|
|
22
|
-
return i[6] !== l || i[7] !== u || i[8] !== d ? (f = {
|
|
23
|
-
queryKey: l,
|
|
24
|
-
queryFn: u,
|
|
25
|
-
enabled: d
|
|
26
|
-
}, i[6] = l, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
|
|
27
|
-
}
|
|
28
|
-
function useAvailableEnvironments(e) {
|
|
17
|
+
function useAvailableEnvironments(n) {
|
|
29
18
|
let a = c(8), { envKey: o, api: s } = useApiClient(), l;
|
|
30
19
|
a[0] === o ? l = a[1] : (l = getAvailableEnvironmentsCacheKey(o), a[0] = o, a[1] = l);
|
|
31
20
|
let u;
|
|
32
21
|
a[2] === s ? u = a[3] : (u = () => s.config.getAvailableEnvironments(), a[2] = s, a[3] = u);
|
|
33
|
-
let d =
|
|
22
|
+
let d = n?.enabled ?? !0, f;
|
|
34
23
|
return a[4] !== l || a[5] !== u || a[6] !== d ? (f = {
|
|
35
24
|
queryKey: l,
|
|
36
25
|
queryFn: u,
|
|
37
26
|
enabled: d
|
|
38
27
|
}, a[4] = l, a[5] = u, a[6] = d, a[7] = f) : f = a[7], useQuery(f);
|
|
39
28
|
}
|
|
40
|
-
|
|
29
|
+
function useDocumentConfigs() {
|
|
30
|
+
let e = c(2), { data: n } = useAppsConfig(), r;
|
|
31
|
+
if (e[0] !== n) {
|
|
32
|
+
bb0: {
|
|
33
|
+
let e = /* @__PURE__ */ new Map();
|
|
34
|
+
if (!n?.length) {
|
|
35
|
+
r = e;
|
|
36
|
+
break bb0;
|
|
37
|
+
}
|
|
38
|
+
let i = n[0].documents ?? [];
|
|
39
|
+
for (let n of i) e.set(n.documentName, n);
|
|
40
|
+
r = e;
|
|
41
|
+
}
|
|
42
|
+
e[0] = n, e[1] = r;
|
|
43
|
+
} else r = e[1];
|
|
44
|
+
return r;
|
|
45
|
+
}
|
|
46
|
+
export { useAppsConfig, useAvailableEnvironments, useDocumentConfigs };
|
|
@@ -1,8 +1,33 @@
|
|
|
1
1
|
import { useApiClient } from "./useApi.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { useMutation } from "@tanstack/react-query";
|
|
3
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
function useWorkspaceEnvironments(n) {
|
|
5
|
+
let i = c(9), { api: a } = useApiClient(), o;
|
|
6
|
+
i[0] === n ? o = i[1] : (o = ["workspace-environments", n], i[0] = n, i[1] = o);
|
|
7
|
+
let s;
|
|
8
|
+
i[2] !== a || i[3] !== n ? (s = () => a.environments.getByWorkspace(n), i[2] = a, i[3] = n, i[4] = s) : s = i[4];
|
|
9
|
+
let l = !!n, u;
|
|
10
|
+
return i[5] !== o || i[6] !== s || i[7] !== l ? (u = {
|
|
11
|
+
queryKey: o,
|
|
12
|
+
queryFn: s,
|
|
13
|
+
enabled: l
|
|
14
|
+
}, i[5] = o, i[6] = s, i[7] = l, i[8] = u) : u = i[8], useQuery(u);
|
|
15
|
+
}
|
|
16
|
+
function useReplaceEnvironments() {
|
|
17
|
+
let r = c(7), { api: a } = useApiClient(), o = useQueryClient(), s;
|
|
18
|
+
r[0] === a ? s = r[1] : (s = (e) => a.environments.replaceEnvironments(e.workspaceId, e.environments), r[0] = a, r[1] = s);
|
|
19
|
+
let l;
|
|
20
|
+
r[2] === o ? l = r[3] : (l = (e, t) => {
|
|
21
|
+
o.invalidateQueries({ queryKey: ["workspace-environments", t.workspaceId] });
|
|
22
|
+
}, r[2] = o, r[3] = l);
|
|
23
|
+
let u;
|
|
24
|
+
return r[4] !== s || r[5] !== l ? (u = {
|
|
25
|
+
mutationFn: s,
|
|
26
|
+
onSuccess: l
|
|
27
|
+
}, r[4] = s, r[5] = l, r[6] = u) : u = r[6], useMutation(u);
|
|
28
|
+
}
|
|
4
29
|
function useResetEnvironment() {
|
|
5
30
|
let r = c(2), { api: i } = useApiClient(), a;
|
|
6
31
|
return r[0] === i ? a = r[1] : (a = { mutationFn: (e) => i.environments.resetEnvironment(e) }, r[0] = i, r[1] = a), useMutation(a);
|
|
7
32
|
}
|
|
8
|
-
export { useResetEnvironment };
|
|
33
|
+
export { useReplaceEnvironments, useResetEnvironment, useWorkspaceEnvironments };
|
|
@@ -15,4 +15,17 @@ function useRunWorkflow() {
|
|
|
15
15
|
onSuccess: d
|
|
16
16
|
}, a[5] = u, a[6] = d, a[7] = f) : f = a[7], useMutation(f);
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
function useStartWorkflow() {
|
|
19
|
+
let a = c(8), { envKey: o, api: s } = useApiClient(), l = useQueryClient(), u;
|
|
20
|
+
a[0] === s ? u = a[1] : (u = (e) => s.processor.startWorkflow(e), a[0] = s, a[1] = u);
|
|
21
|
+
let d;
|
|
22
|
+
a[2] !== o || a[3] !== l ? (d = () => {
|
|
23
|
+
l.invalidateQueries({ queryKey: getWorkflowsCacheKey(o) });
|
|
24
|
+
}, a[2] = o, a[3] = l, a[4] = d) : d = a[4];
|
|
25
|
+
let f;
|
|
26
|
+
return a[5] !== u || a[6] !== d ? (f = {
|
|
27
|
+
mutationFn: u,
|
|
28
|
+
onSuccess: d
|
|
29
|
+
}, a[5] = u, a[6] = d, a[7] = f) : f = a[7], useMutation(f);
|
|
30
|
+
}
|
|
31
|
+
export { useRunWorkflow, useStartWorkflow };
|
|
@@ -136,9 +136,9 @@ function _temp(e) {
|
|
|
136
136
|
}
|
|
137
137
|
function useWorkflowConfigByName(e) {
|
|
138
138
|
let r = c(10), { envKey: a, api: o } = useApiClient(), s;
|
|
139
|
-
r[0] !==
|
|
139
|
+
r[0] !== a || r[1] !== e ? (s = getWorkflowConfigCacheKey(a, e), r[0] = a, r[1] = e, r[2] = s) : s = r[2];
|
|
140
140
|
let u;
|
|
141
|
-
r[3] !==
|
|
141
|
+
r[3] !== o || r[4] !== e ? (u = () => o.config.getWorkflowConfig({ workflowName: e }), r[3] = o, r[4] = e, r[5] = u) : u = r[5];
|
|
142
142
|
let d = !!e, f;
|
|
143
143
|
return r[6] !== s || r[7] !== u || r[8] !== d ? (f = {
|
|
144
144
|
queryKey: s,
|
|
@@ -148,9 +148,9 @@ function useWorkflowConfigByName(e) {
|
|
|
148
148
|
}
|
|
149
149
|
function useWorkflowSource(e) {
|
|
150
150
|
let r = c(10), { envKey: i, api: o } = useApiClient(), s;
|
|
151
|
-
r[0] !==
|
|
151
|
+
r[0] !== i || r[1] !== e ? (s = getWorkflowSourceCacheKey(i, e), r[0] = i, r[1] = e, r[2] = s) : s = r[2];
|
|
152
152
|
let u;
|
|
153
|
-
r[3] !==
|
|
153
|
+
r[3] !== o || r[4] !== e ? (u = () => o.config.getWorkflowSource({ workflowName: e }), r[3] = o, r[4] = e, r[5] = u) : u = r[5];
|
|
154
154
|
let d = !!e, f;
|
|
155
155
|
return r[6] !== s || r[7] !== u || r[8] !== d ? (f = {
|
|
156
156
|
queryKey: s,
|