@loopstack/loopstack-studio 0.34.0 → 0.35.1
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/app/EnvironmentEmbedRoot.js +18 -24
- package/dist/components/layout/StudioSidebar.js +34 -34
- package/dist/events/api-client-events.js +13 -1
- package/dist/events/index.js +1 -0
- package/dist/features/code-explorer/components/FileTabsBarBase.js +1 -1
- package/dist/features/code-explorer/index.js +0 -3
- package/dist/features/dashboard/AppLauncher.js +1 -1
- package/dist/features/debug/components/WorkflowFlowViewer.js +2 -1
- package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +2 -1
- package/dist/features/documents/components/DocumentList.js +1 -1
- package/dist/features/documents/document-details/DocumentDetails.js +0 -5
- package/dist/features/documents/renderers/DocumentFormRenderer.js +13 -12
- package/dist/features/documents/renderers/LinkMessageRenderer.js +2 -1
- package/dist/features/documents/renderers/useDocumentTransition.js +3 -2
- package/dist/features/feature-registry/FeatureRegistryProvider.js +2 -1
- package/dist/features/file-explorer/components/FileTabsBar.js +1 -1
- package/dist/features/file-explorer/components/FileTree.js +1 -1
- package/dist/features/file-explorer/hooks/useFileExplorer.js +36 -31
- package/dist/features/file-explorer/providers/FileExplorerProvider.js +94 -92
- package/dist/features/git/components/WorkbenchGitPanel.js +6 -9
- package/dist/features/git/hooks/useGit.js +55 -57
- package/dist/features/health/LocalHealthCheck.js +46 -47
- package/dist/features/oauth/OAuthPromptRenderer.js +6 -5
- package/dist/features/runs/Runs.js +3 -2
- package/dist/features/secrets/renderers/SecretInputRenderer.js +3 -2
- package/dist/features/workbench/WorkflowItem.js +5 -8
- package/dist/features/workbench/components/NewRunDialog.js +172 -170
- package/dist/features/workbench/components/PreviewEmptyState.js +1 -1
- package/dist/features/workbench/components/WorkbenchRunsPanel.js +2 -1
- package/dist/features/workbench/components/WorkflowForms.js +1 -1
- package/dist/features/workbench/components/WorkflowHistoryItem.js +2 -1
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +8 -14
- package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +65 -132
- package/dist/features/workbench/hooks/useWorkflowData.js +8 -6
- package/dist/features/workspaces/Workspaces.js +4 -2
- package/dist/features/workspaces/components/CreateWorkspace.js +7 -5
- package/dist/features/workspaces/components/ExecutionTimeline.js +69 -65
- package/dist/features/workspaces/components/WorkflowRunForm.js +6 -4
- package/dist/features/workspaces/components/WorkspaceHomePage.js +1 -1
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/useAuth.js +14 -53
- package/dist/hooks/useConfig.js +13 -37
- package/dist/hooks/useDocuments.js +5 -30
- package/dist/hooks/useEnvironments.js +34 -24
- package/dist/hooks/useProcessor.js +2 -31
- package/dist/hooks/useSecrets.js +78 -24
- package/dist/hooks/useWorkflows.js +43 -172
- package/dist/hooks/useWorkspaces.js +24 -130
- package/dist/index.d.ts +130 -488
- package/dist/index.js +10 -12
- package/dist/packages/client/dist/client.js +35 -0
- package/dist/packages/client/dist/http.js +47 -0
- package/dist/packages/client/dist/index.js +15 -0
- package/dist/packages/client/dist/queries/query-keys.js +94 -0
- package/dist/packages/client/dist/queries/query-options.js +97 -0
- package/dist/packages/client/dist/resources/auth.js +10 -0
- package/dist/packages/client/dist/resources/config.js +11 -0
- package/dist/packages/client/dist/resources/dashboard.js +4 -0
- package/dist/packages/client/dist/resources/documents.js +7 -0
- package/dist/packages/client/dist/resources/processor.js +7 -0
- package/dist/packages/client/dist/resources/workflows.js +13 -0
- package/dist/packages/client/dist/resources/workspaces.js +12 -0
- package/dist/packages/client/dist/stream/invalidations.js +20 -0
- package/dist/packages/client/dist/stream/llm-reducer.js +65 -0
- package/dist/packages/client/dist/stream/sse-parser.js +40 -0
- package/dist/packages/client/dist/stream/stream.js +147 -0
- package/dist/packages/contracts/dist/events/client-message-base.schema.js +6 -0
- package/dist/packages/contracts/dist/events/client-message.schema.js +24 -0
- package/dist/packages/contracts/dist/events/index.js +6 -0
- package/dist/packages/contracts/dist/events/llm-events.schema.js +44 -0
- package/dist/packages/contracts/dist/events/stream-events.schema.js +4 -0
- package/dist/packages/contracts/dist/events/workflow-events.schema.js +20 -0
- package/dist/packages/contracts/dist/events/workspace-events.schema.js +5 -0
- package/dist/packages/contracts/dist/types/types/ui-message.type.js +39 -0
- package/dist/packages/react/dist/hooks/mutations.js +175 -0
- package/dist/packages/react/dist/hooks/queries.js +139 -0
- package/dist/packages/react/dist/hooks/use-live-invalidation.js +39 -0
- package/dist/packages/react/dist/hooks/use-llm-stream.js +18 -0
- package/dist/packages/react/dist/index.js +5 -0
- package/dist/packages/react/dist/provider.js +15 -0
- package/dist/pages/DashboardPage.js +2 -1
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -1
- package/dist/pages/DebugWorkflowsPage.js +2 -1
- package/dist/pages/EmbedWorkbenchPage.js +5 -4
- package/dist/pages/PreviewWorkbenchPage.js +60 -59
- package/dist/pages/StudioLandingPage.js +1 -1
- package/dist/pages/WorkbenchPage.js +3 -2
- package/dist/pages/WorkflowDebugPage.js +3 -2
- package/dist/pages/WorkspacePage.js +3 -2
- package/dist/pages/WorkspaceRunsPage.js +2 -1
- package/dist/providers/LoopstackClientProvider.js +35 -0
- package/dist/services/createApiClient.js +9 -3
- package/dist/services/index.js +0 -1
- package/dist/services/reporting-fetch.js +13 -0
- package/package.json +4 -3
- package/dist/api/auth.js +0 -10
- package/dist/api/client.js +0 -13
- package/dist/api/config.js +0 -11
- package/dist/api/dashboard.js +0 -4
- package/dist/api/documents.js +0 -7
- package/dist/api/environments.js +0 -8
- package/dist/api/index.js +0 -31
- package/dist/api/processor.js +0 -7
- package/dist/api/secrets.js +0 -16
- package/dist/api/workflows.js +0 -15
- package/dist/api/workspaces.js +0 -12
- package/dist/events/sse-client-events.js +0 -15
- package/dist/features/code-explorer/CodeExplorer.js +0 -6
- package/dist/features/code-explorer/components/CodeExplorerTree.js +0 -6
- package/dist/features/code-explorer/components/FileTabsBar.js +0 -4
- package/dist/features/code-explorer/providers/CodeExplorerProvider.js +0 -5
- package/dist/features/file-explorer/api/files.js +0 -12
- package/dist/features/git/api/git.js +0 -9
- package/dist/hooks/query-keys.js +0 -145
- package/dist/hooks/useApi.js +0 -15
- package/dist/hooks/useFiles.js +0 -3
- package/dist/node_modules/lodash/_Symbol.js +0 -7
- package/dist/node_modules/lodash/_baseGetTag.js +0 -13
- package/dist/node_modules/lodash/_baseTrim.js +0 -11
- package/dist/node_modules/lodash/_freeGlobal.js +0 -6
- package/dist/node_modules/lodash/_getRawTag.js +0 -17
- package/dist/node_modules/lodash/_objectToString.js +0 -10
- package/dist/node_modules/lodash/_root.js +0 -8
- package/dist/node_modules/lodash/_trimmedEndIndex.js +0 -11
- package/dist/node_modules/lodash/debounce.js +0 -53
- package/dist/node_modules/lodash/isObject.js +0 -10
- package/dist/node_modules/lodash/isObjectLike.js +0 -9
- package/dist/node_modules/lodash/isSymbol.js +0 -12
- package/dist/node_modules/lodash/now.js +0 -10
- package/dist/node_modules/lodash/toNumber.js +0 -22
- package/dist/providers/InvalidationEventsProvider.js +0 -43
- package/dist/providers/SseProvider.js +0 -37
- package/dist/services/eventEmitter.js +0 -12
|
@@ -1,105 +1,107 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLoopstackClient } from "../../../packages/react/dist/provider.js";
|
|
2
|
+
import "../../../packages/react/dist/index.js";
|
|
3
|
+
import { fileTreeKey, useFileContent, useFileTree } from "../hooks/useFileExplorer.js";
|
|
2
4
|
import { c } from "react/compiler-runtime";
|
|
3
5
|
import { createContext, useCallback, useContext, useMemo, useState } from "react";
|
|
4
6
|
import { jsx } from "react/jsx-runtime";
|
|
5
7
|
import { useQueryClient } from "@tanstack/react-query";
|
|
6
8
|
var FileExplorerContext = createContext(null);
|
|
7
|
-
function FileExplorerProvider(
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
let [
|
|
11
|
-
|
|
12
|
-
let [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
let
|
|
16
|
-
return
|
|
9
|
+
function FileExplorerProvider(u) {
|
|
10
|
+
let d = c(37), { variant: f, workspaceId: p, enabled: m, children: h } = u, g = m === void 0 ? !0 : m, _ = useLoopstackClient(), v = useQueryClient(), y;
|
|
11
|
+
d[0] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ new Set(), d[0] = y) : y = d[0];
|
|
12
|
+
let [b, x] = useState(y), S;
|
|
13
|
+
d[1] === Symbol.for("react.memo_cache_sentinel") ? (S = [], d[1] = S) : S = d[1];
|
|
14
|
+
let [C, w] = useState(S), [T, E] = useState(null), D = useFileTree(f, p, g), O = useFileContent(f, p, T?.type === "file" ? T.path : void 0, g), k;
|
|
15
|
+
d[2] === Symbol.for("react.memo_cache_sentinel") ? (k = (e) => {
|
|
16
|
+
x((o) => {
|
|
17
|
+
let s = new Set(o);
|
|
18
|
+
return s.has(e) ? s.delete(e) : s.add(e), s;
|
|
17
19
|
});
|
|
18
|
-
},
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
e.type === "file" && (
|
|
22
|
-
},
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
let
|
|
27
|
-
if (
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
} else
|
|
31
|
-
return
|
|
20
|
+
}, d[2] = k) : k = d[2];
|
|
21
|
+
let A = k, j;
|
|
22
|
+
d[3] === Symbol.for("react.memo_cache_sentinel") ? (j = (e) => {
|
|
23
|
+
e.type === "file" && (E(e), w((o) => o.some((o) => o.path === e.path) ? o : [...o, e]));
|
|
24
|
+
}, d[3] = j) : j = d[3];
|
|
25
|
+
let M = j, N;
|
|
26
|
+
d[4] === T?.path ? N = d[5] : (N = (e) => {
|
|
27
|
+
w((o) => {
|
|
28
|
+
let s = o.filter((o) => o.path !== e.path);
|
|
29
|
+
if (T?.path === e.path) if (s.length > 0) {
|
|
30
|
+
let l = o.findIndex((o) => o.path === e.path);
|
|
31
|
+
E(s[Math.max(0, l - 1)]);
|
|
32
|
+
} else E(null);
|
|
33
|
+
return s;
|
|
32
34
|
});
|
|
33
|
-
},
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
let
|
|
38
|
-
if (
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
} else
|
|
42
|
-
return
|
|
35
|
+
}, d[4] = T?.path, d[5] = N);
|
|
36
|
+
let P = N, F;
|
|
37
|
+
d[6] === T ? F = d[7] : (F = () => {
|
|
38
|
+
T && w((e) => {
|
|
39
|
+
let o = e.filter((e) => e.path !== T.path);
|
|
40
|
+
if (o.length > 0) {
|
|
41
|
+
let s = e.findIndex((e) => e.path === T.path);
|
|
42
|
+
E(o[Math.max(0, s - 1)]);
|
|
43
|
+
} else E(null);
|
|
44
|
+
return o;
|
|
43
45
|
});
|
|
44
|
-
},
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
let
|
|
57
|
-
if (
|
|
58
|
-
let
|
|
59
|
-
return
|
|
46
|
+
}, d[6] = T, d[7] = F);
|
|
47
|
+
let I = F, L;
|
|
48
|
+
d[8] === Symbol.for("react.memo_cache_sentinel") ? (L = () => {
|
|
49
|
+
w([]), E(null);
|
|
50
|
+
}, d[8] = L) : L = d[8];
|
|
51
|
+
let R = L, z;
|
|
52
|
+
d[9] === Symbol.for("react.memo_cache_sentinel") ? (z = (e) => {
|
|
53
|
+
w([e]), E(e);
|
|
54
|
+
}, d[9] = z) : z = d[9];
|
|
55
|
+
let B = z, V;
|
|
56
|
+
d[10] === T ? V = d[11] : (V = (e) => {
|
|
57
|
+
w((o) => {
|
|
58
|
+
let s = o.findIndex((o) => o.path === e.path);
|
|
59
|
+
if (s <= 0) return o;
|
|
60
|
+
let l = o.slice(s);
|
|
61
|
+
return T && o.findIndex((e) => e.path === T.path) < s && E(e), l;
|
|
60
62
|
});
|
|
61
|
-
},
|
|
62
|
-
let
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
let
|
|
66
|
-
if (
|
|
67
|
-
let
|
|
68
|
-
return
|
|
63
|
+
}, d[10] = T, d[11] = V);
|
|
64
|
+
let H = V, U;
|
|
65
|
+
d[12] === T ? U = d[13] : (U = (e) => {
|
|
66
|
+
w((o) => {
|
|
67
|
+
let s = o.findIndex((o) => o.path === e.path);
|
|
68
|
+
if (s < 0 || s >= o.length - 1) return o;
|
|
69
|
+
let l = o.slice(0, s + 1);
|
|
70
|
+
return T && o.findIndex((e) => e.path === T.path) > s && E(e), l;
|
|
69
71
|
});
|
|
70
|
-
},
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
let
|
|
76
|
-
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
nodes:
|
|
80
|
-
isTreeLoading:
|
|
81
|
-
treeError:
|
|
82
|
-
isFetchingTree:
|
|
83
|
-
openFiles:
|
|
84
|
-
selectedFile:
|
|
85
|
-
fileContent:
|
|
86
|
-
isContentLoading:
|
|
87
|
-
expandedFolders:
|
|
88
|
-
toggleFolder:
|
|
89
|
-
selectFile:
|
|
90
|
-
closeFile:
|
|
91
|
-
closeAll:
|
|
92
|
-
closeOthers:
|
|
93
|
-
closeToLeft:
|
|
94
|
-
closeToRight:
|
|
95
|
-
clearSelection:
|
|
96
|
-
refreshTree:
|
|
97
|
-
},
|
|
98
|
-
let
|
|
99
|
-
return
|
|
100
|
-
value:
|
|
101
|
-
children:
|
|
102
|
-
}),
|
|
72
|
+
}, d[12] = T, d[13] = U);
|
|
73
|
+
let W = U, G;
|
|
74
|
+
d[14] !== _.envKey || d[15] !== v ? (G = () => {
|
|
75
|
+
v.invalidateQueries({ queryKey: fileTreeKey(_.envKey) });
|
|
76
|
+
}, d[14] = _.envKey, d[15] = v, d[16] = G) : G = d[16];
|
|
77
|
+
let K = G, q;
|
|
78
|
+
d[17] === D.data ? q = d[18] : (q = D.data ?? [], d[17] = D.data, d[18] = q);
|
|
79
|
+
let J = D.isLoading && !D.data, Y = O.data?.content ?? null, X = O.isLoading && !!T, Z;
|
|
80
|
+
d[19] !== I || d[20] !== P || d[21] !== H || d[22] !== W || d[23] !== b || d[24] !== C || d[25] !== K || d[26] !== T || d[27] !== q || d[28] !== J || d[29] !== Y || d[30] !== X || d[31] !== D.error || d[32] !== D.isFetching ? (Z = {
|
|
81
|
+
nodes: q,
|
|
82
|
+
isTreeLoading: J,
|
|
83
|
+
treeError: D.error,
|
|
84
|
+
isFetchingTree: D.isFetching,
|
|
85
|
+
openFiles: C,
|
|
86
|
+
selectedFile: T,
|
|
87
|
+
fileContent: Y,
|
|
88
|
+
isContentLoading: X,
|
|
89
|
+
expandedFolders: b,
|
|
90
|
+
toggleFolder: A,
|
|
91
|
+
selectFile: M,
|
|
92
|
+
closeFile: P,
|
|
93
|
+
closeAll: R,
|
|
94
|
+
closeOthers: B,
|
|
95
|
+
closeToLeft: H,
|
|
96
|
+
closeToRight: W,
|
|
97
|
+
clearSelection: I,
|
|
98
|
+
refreshTree: K
|
|
99
|
+
}, d[19] = I, d[20] = P, d[21] = H, d[22] = W, d[23] = b, d[24] = C, d[25] = K, d[26] = T, d[27] = q, d[28] = J, d[29] = Y, d[30] = X, d[31] = D.error, d[32] = D.isFetching, d[33] = Z) : Z = d[33];
|
|
100
|
+
let Q = Z, $;
|
|
101
|
+
return d[34] !== h || d[35] !== Q ? ($ = /* @__PURE__ */ jsx(FileExplorerContext.Provider, {
|
|
102
|
+
value: Q,
|
|
103
|
+
children: h
|
|
104
|
+
}), d[34] = h, d[35] = Q, d[36] = $) : $ = d[36], $;
|
|
103
105
|
}
|
|
104
106
|
function useFileExplorer() {
|
|
105
107
|
let e = useContext(FileExplorerContext);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { useCreateWorkflow, useRunWorkflow } from "../../../packages/react/dist/hooks/mutations.js";
|
|
2
|
+
import "../../../hooks/useWorkflows.js";
|
|
1
3
|
import { useStudio } from "../../../providers/StudioProvider.js";
|
|
2
|
-
import
|
|
3
|
-
import { useRunWorkflow } from "../../../hooks/useProcessor.js";
|
|
4
|
+
import "../../../hooks/useProcessor.js";
|
|
4
5
|
import { useWorkbenchLayout } from "../../workbench/providers/WorkbenchLayoutProvider.js";
|
|
5
6
|
import { SidebarPanel } from "../../workbench/components/SidebarPanel.js";
|
|
6
7
|
import "../../workbench/index.js";
|
|
@@ -16,18 +17,14 @@ function WorkbenchGitPanel(y) {
|
|
|
16
17
|
useGitInvalidation(x);
|
|
17
18
|
let j = useCreateWorkflow(), M = useRunWorkflow(), N = useRemoveGitRemote(), P = j.isPending || M.isPending, F;
|
|
18
19
|
b[0] !== j || b[1] !== T || b[2] !== M || b[3] !== x ? (F = () => {
|
|
19
|
-
x && j.mutate({
|
|
20
|
+
x && j.mutate({
|
|
20
21
|
workflowName: "connectGitHub",
|
|
21
22
|
title: null,
|
|
22
23
|
workspaceId: x,
|
|
23
24
|
transition: null,
|
|
24
25
|
args: {}
|
|
25
|
-
}
|
|
26
|
-
M.mutate({
|
|
27
|
-
workflowId: t.id,
|
|
28
|
-
runWorkflowPayloadDto: {},
|
|
29
|
-
force: !0
|
|
30
|
-
}, { onSuccess: () => {
|
|
26
|
+
}, { onSuccess: (t) => {
|
|
27
|
+
M.mutate({ workflowId: t.id }, { onSuccess: () => {
|
|
31
28
|
T.navigateToWorkflow(t.id);
|
|
32
29
|
} });
|
|
33
30
|
} });
|
|
@@ -1,78 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "../../../
|
|
4
|
-
import
|
|
1
|
+
import { useLoopstackClient } from "../../../packages/react/dist/provider.js";
|
|
2
|
+
import { queryKeys } from "../../../packages/client/dist/queries/query-keys.js";
|
|
3
|
+
import "../../../packages/client/dist/index.js";
|
|
4
|
+
import "../../../packages/react/dist/index.js";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
6
|
import { useEffect } from "react";
|
|
7
7
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
var gitPath = (e) => `/api/v1/workspaces/${e}/git`;
|
|
9
|
+
function useGitStatus(r) {
|
|
10
|
+
let i = c(10), o = useLoopstackClient(), l;
|
|
11
|
+
i[0] !== o.envKey || i[1] !== r ? (l = queryKeys.gitStatus(o.envKey, r), i[0] = o.envKey, i[1] = r, i[2] = l) : l = i[2];
|
|
12
|
+
let u;
|
|
13
|
+
i[3] !== o.http || i[4] !== r ? (u = () => o.http.get(`${gitPath(r)}/status`), i[3] = o.http, i[4] = r, i[5] = u) : u = i[5];
|
|
14
|
+
let d = !!r, f;
|
|
15
|
+
return i[6] !== l || i[7] !== u || i[8] !== d ? (f = {
|
|
15
16
|
queryKey: l,
|
|
16
|
-
queryFn:
|
|
17
|
-
enabled:
|
|
17
|
+
queryFn: u,
|
|
18
|
+
enabled: d,
|
|
18
19
|
staleTime: 3e4,
|
|
19
20
|
retry: !1
|
|
20
|
-
}, i[6] = l, i[7] =
|
|
21
|
+
}, i[6] = l, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
|
|
21
22
|
}
|
|
22
|
-
function useGitLog(
|
|
23
|
-
let o = c(11),
|
|
24
|
-
o[0] !==
|
|
25
|
-
let
|
|
26
|
-
o[3] !==
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
queryKey: f,
|
|
33
|
-
queryFn: p,
|
|
34
|
-
enabled: m,
|
|
23
|
+
function useGitLog(r, i) {
|
|
24
|
+
let o = c(11), l = i === void 0 ? 50 : i, u = useLoopstackClient(), d;
|
|
25
|
+
o[0] !== u.envKey || o[1] !== r ? (d = queryKeys.gitLog(u.envKey, r), o[0] = u.envKey, o[1] = r, o[2] = d) : d = o[2];
|
|
26
|
+
let f;
|
|
27
|
+
o[3] !== u.http || o[4] !== l || o[5] !== r ? (f = () => u.http.get(`${gitPath(r)}/log`, { limit: l }), o[3] = u.http, o[4] = l, o[5] = r, o[6] = f) : f = o[6];
|
|
28
|
+
let p = !!r, m;
|
|
29
|
+
return o[7] !== d || o[8] !== f || o[9] !== p ? (m = {
|
|
30
|
+
queryKey: d,
|
|
31
|
+
queryFn: f,
|
|
32
|
+
enabled: p,
|
|
35
33
|
staleTime: 3e4,
|
|
36
34
|
retry: !1
|
|
37
|
-
}, o[7] =
|
|
35
|
+
}, o[7] = d, o[8] = f, o[9] = p, o[10] = m) : m = o[10], useQuery(m);
|
|
38
36
|
}
|
|
39
|
-
function useGitRemote(
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
let
|
|
45
|
-
return
|
|
37
|
+
function useGitRemote(r) {
|
|
38
|
+
let i = c(10), o = useLoopstackClient(), l;
|
|
39
|
+
i[0] !== o.envKey || i[1] !== r ? (l = queryKeys.gitRemote(o.envKey, r), i[0] = o.envKey, i[1] = r, i[2] = l) : l = i[2];
|
|
40
|
+
let u;
|
|
41
|
+
i[3] !== o.http || i[4] !== r ? (u = () => o.http.get(`${gitPath(r)}/remote`), i[3] = o.http, i[4] = r, i[5] = u) : u = i[5];
|
|
42
|
+
let d = !!r, f;
|
|
43
|
+
return i[6] !== l || i[7] !== u || i[8] !== d ? (f = {
|
|
46
44
|
queryKey: l,
|
|
47
|
-
queryFn:
|
|
48
|
-
enabled:
|
|
45
|
+
queryFn: u,
|
|
46
|
+
enabled: d,
|
|
49
47
|
staleTime: 6e4,
|
|
50
48
|
retry: !1
|
|
51
|
-
},
|
|
49
|
+
}, i[6] = l, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
|
|
52
50
|
}
|
|
53
|
-
function useGitInvalidation(
|
|
54
|
-
let
|
|
55
|
-
|
|
56
|
-
if (
|
|
57
|
-
|
|
51
|
+
function useGitInvalidation(i) {
|
|
52
|
+
let a = c(5), s = useLoopstackClient(), l = useQueryClient(), u, d;
|
|
53
|
+
a[0] !== s || a[1] !== l || a[2] !== i ? (u = () => {
|
|
54
|
+
if (i) return s.stream.on("git.updated", (e) => {
|
|
55
|
+
e.workspaceId === i && (l.invalidateQueries({ queryKey: queryKeys.gitStatus(s.envKey, i) }), l.invalidateQueries({ queryKey: queryKeys.gitLog(s.envKey, i) }), l.invalidateQueries({ queryKey: queryKeys.gitRemote(s.envKey, i) }));
|
|
58
56
|
});
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
],
|
|
57
|
+
}, d = [
|
|
58
|
+
s,
|
|
59
|
+
i,
|
|
60
|
+
l
|
|
61
|
+
], a[0] = s, a[1] = l, a[2] = i, a[3] = u, a[4] = d) : (u = a[3], d = a[4]), useEffect(u, d);
|
|
64
62
|
}
|
|
65
63
|
function useRemoveGitRemote() {
|
|
66
|
-
let
|
|
67
|
-
|
|
64
|
+
let r = c(8), a = useLoopstackClient(), l = useQueryClient(), u;
|
|
65
|
+
r[0] === a ? u = r[1] : (u = (e) => a.http.delete(`${gitPath(e.workspaceId)}/remote`), r[0] = a, r[1] = u);
|
|
66
|
+
let d;
|
|
67
|
+
r[2] !== a || r[3] !== l ? (d = (e, n) => {
|
|
68
|
+
l.invalidateQueries({ queryKey: queryKeys.gitRemote(a.envKey, n.workspaceId) });
|
|
69
|
+
}, r[2] = a, r[3] = l, r[4] = d) : d = r[4];
|
|
68
70
|
let f;
|
|
69
|
-
|
|
70
|
-
s.invalidateQueries({ queryKey: getGitRemoteCacheKey(a, o.workspaceId) });
|
|
71
|
-
}, e[2] = a, e[3] = s, e[4] = f) : f = e[4];
|
|
72
|
-
let p;
|
|
73
|
-
return e[5] !== u || e[6] !== f ? (p = {
|
|
71
|
+
return r[5] !== u || r[6] !== d ? (f = {
|
|
74
72
|
mutationFn: u,
|
|
75
|
-
onSuccess:
|
|
76
|
-
},
|
|
73
|
+
onSuccess: d
|
|
74
|
+
}, r[5] = u, r[6] = d, r[7] = f) : f = r[7], useMutation(f);
|
|
77
75
|
}
|
|
78
76
|
export { useGitInvalidation, useGitLog, useGitRemote, useGitStatus, useRemoveGitRemote };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "../../
|
|
1
|
+
import { useHubLogin, useRefreshSession } from "../../packages/react/dist/hooks/mutations.js";
|
|
2
|
+
import { ApiClientEvents, apiClientEvents } from "../../events/api-client-events.js";
|
|
3
|
+
import "../../events/index.js";
|
|
4
4
|
import { useStudio } from "../../providers/StudioProvider.js";
|
|
5
|
-
import { useGetHealthInfo
|
|
5
|
+
import { useGetHealthInfo } from "../../hooks/useAuth.js";
|
|
6
6
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { useQueryClient } from "@tanstack/react-query";
|
|
9
8
|
import { RefreshCw, X } from "lucide-react";
|
|
10
9
|
const Escalation = {
|
|
11
10
|
None: 0,
|
|
@@ -15,58 +14,58 @@ const Escalation = {
|
|
|
15
14
|
Connection: 4
|
|
16
15
|
};
|
|
17
16
|
var LocalHealthCheck_default = () => {
|
|
18
|
-
let { environment:
|
|
17
|
+
let { environment: h } = useStudio(), [g, _] = useState(Escalation.None), v = useHubLogin(), y = useRefreshSession(), b = useGetHealthInfo(!1), x = useRef(y);
|
|
18
|
+
x.current = y;
|
|
19
|
+
let S = useRef(v);
|
|
20
|
+
S.current = v;
|
|
21
|
+
let C = useRef(b);
|
|
19
22
|
C.current = b;
|
|
20
|
-
let w =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
T.current.refetch();
|
|
26
|
-
}, []), D = useCallback(() => {
|
|
27
|
-
C.current.mutate();
|
|
28
|
-
}, []), O = useCallback(async () => {
|
|
23
|
+
let w = useCallback(() => {
|
|
24
|
+
C.current.refetch();
|
|
25
|
+
}, []), T = useCallback(() => {
|
|
26
|
+
x.current.mutate();
|
|
27
|
+
}, []), E = useCallback(async () => {
|
|
29
28
|
try {
|
|
30
29
|
let e = "local";
|
|
31
|
-
|
|
30
|
+
h.getIdToken && (e = await h.getIdToken()), S.current.mutate({ idToken: e });
|
|
32
31
|
} catch {
|
|
33
|
-
|
|
32
|
+
_(Escalation.Debug);
|
|
34
33
|
}
|
|
35
|
-
}, [
|
|
34
|
+
}, [h]);
|
|
36
35
|
useEffect(() => {
|
|
37
|
-
if (
|
|
38
|
-
let e = setInterval(
|
|
36
|
+
if (g !== Escalation.Connection) return;
|
|
37
|
+
let e = setInterval(w, 5e3);
|
|
39
38
|
return () => clearInterval(e);
|
|
40
|
-
}, [
|
|
41
|
-
|
|
42
|
-
}, [x.data, S]), useEffect(() => {
|
|
43
|
-
b.error && v(Escalation.Login);
|
|
44
|
-
}, [b.error]), useEffect(() => {
|
|
45
|
-
b.data?.status === 200 && v(Escalation.None);
|
|
39
|
+
}, [g, w]), useEffect(() => {
|
|
40
|
+
b.data && _(Escalation.None);
|
|
46
41
|
}, [b.data]), useEffect(() => {
|
|
47
|
-
y.error &&
|
|
42
|
+
y.error && _(Escalation.Login);
|
|
48
43
|
}, [y.error]), useEffect(() => {
|
|
49
|
-
y.
|
|
50
|
-
}, [y.
|
|
51
|
-
|
|
44
|
+
y.isSuccess && _(Escalation.None);
|
|
45
|
+
}, [y.isSuccess]), useEffect(() => {
|
|
46
|
+
v.error && _(Escalation.Debug);
|
|
47
|
+
}, [v.error]), useEffect(() => {
|
|
48
|
+
v.isSuccess && _(Escalation.None);
|
|
49
|
+
}, [v.isSuccess]), useEffect(() => {
|
|
50
|
+
g === Escalation.Refresh ? T() : g === Escalation.Login && E();
|
|
52
51
|
}, [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
g,
|
|
53
|
+
T,
|
|
54
|
+
E
|
|
56
55
|
]), useEffect(() => {
|
|
57
|
-
let
|
|
58
|
-
|
|
59
|
-
}),
|
|
60
|
-
|
|
56
|
+
let e = apiClientEvents.on(ApiClientEvents.UNAUTHORIZED, () => {
|
|
57
|
+
_(Escalation.Refresh);
|
|
58
|
+
}), m = apiClientEvents.on(ApiClientEvents.ERR_NETWORK, () => {
|
|
59
|
+
_(Escalation.Connection);
|
|
61
60
|
});
|
|
62
61
|
return () => {
|
|
63
|
-
|
|
62
|
+
e(), m();
|
|
64
63
|
};
|
|
65
64
|
}, []);
|
|
66
|
-
let [
|
|
65
|
+
let [D, O] = useState(!1), k = g >= Escalation.Debug && !D;
|
|
67
66
|
return useEffect(() => {
|
|
68
|
-
|
|
69
|
-
}, [
|
|
67
|
+
g < Escalation.Debug && O(!1);
|
|
68
|
+
}, [g]), k ? /* @__PURE__ */ jsx("div", {
|
|
70
69
|
className: "bg-destructive/10 border-destructive/30 fixed inset-x-0 bottom-0 z-50 border-t px-4 py-3",
|
|
71
70
|
children: /* @__PURE__ */ jsxs("div", {
|
|
72
71
|
className: "flex items-center justify-between",
|
|
@@ -81,9 +80,9 @@ var LocalHealthCheck_default = () => {
|
|
|
81
80
|
"Please make sure the environment",
|
|
82
81
|
" ",
|
|
83
82
|
/* @__PURE__ */ jsxs("strong", { children: [
|
|
84
|
-
|
|
83
|
+
h.name,
|
|
85
84
|
" (",
|
|
86
|
-
|
|
85
|
+
h.id,
|
|
87
86
|
")"
|
|
88
87
|
] }),
|
|
89
88
|
" ",
|
|
@@ -92,12 +91,12 @@ var LocalHealthCheck_default = () => {
|
|
|
92
91
|
})] })]
|
|
93
92
|
}), /* @__PURE__ */ jsxs("div", {
|
|
94
93
|
className: "flex items-center gap-2",
|
|
95
|
-
children: [
|
|
96
|
-
onClick:
|
|
94
|
+
children: [g === Escalation.Connection && /* @__PURE__ */ jsxs("button", {
|
|
95
|
+
onClick: w,
|
|
97
96
|
className: "bg-primary flex items-center gap-2 rounded-md px-3 py-1.5 text-sm text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",
|
|
98
|
-
children: [/* @__PURE__ */ jsx(RefreshCw, { className: `h-3 w-3 ${
|
|
97
|
+
children: [/* @__PURE__ */ jsx(RefreshCw, { className: `h-3 w-3 ${b.isLoading ? "animate-spin" : ""}` }), "Retry"]
|
|
99
98
|
}), /* @__PURE__ */ jsx("button", {
|
|
100
|
-
onClick: () =>
|
|
99
|
+
onClick: () => O(!0),
|
|
101
100
|
className: "text-muted-foreground hover:text-foreground rounded-xs p-1 transition-colors",
|
|
102
101
|
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
103
102
|
})]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { useRunWorkflow } from "../../packages/react/dist/hooks/mutations.js";
|
|
1
2
|
import { useDocumentConfigs } from "../../hooks/useConfig.js";
|
|
2
3
|
import CompletionMessagePaper_default from "../../components/messages/CompletionMessagePaper.js";
|
|
3
|
-
import
|
|
4
|
+
import "../../hooks/useProcessor.js";
|
|
4
5
|
import { useOAuthPopup } from "./useOAuthPopup.js";
|
|
5
6
|
import { c } from "react/compiler-runtime";
|
|
6
7
|
import React, { useCallback, useEffect, useRef } from "react";
|
|
@@ -14,7 +15,7 @@ var OAuthPromptRenderer = (f) => {
|
|
|
14
15
|
p[5] !== A || p[6] !== g.id || p[7] !== w || p[8] !== C || p[9] !== _.id ? (j = (t, s) => {
|
|
15
16
|
!C || !A.includes(C) || w.mutate({
|
|
16
17
|
workflowId: g.id,
|
|
17
|
-
|
|
18
|
+
payload: { transition: {
|
|
18
19
|
id: C,
|
|
19
20
|
workflowId: _.id,
|
|
20
21
|
payload: {
|
|
@@ -60,10 +61,10 @@ var OAuthPromptRenderer = (f) => {
|
|
|
60
61
|
provider: b.provider,
|
|
61
62
|
message: b.message
|
|
62
63
|
}), p[31] = b.message, p[32] = b.provider, p[33] = t) : t = p[33];
|
|
63
|
-
let
|
|
64
|
-
p[34] !== R || p[35] !== y ? (
|
|
64
|
+
let s;
|
|
65
|
+
p[34] !== R || p[35] !== y ? (s = y && /* @__PURE__ */ jsx(RetryButton, { onClick: R }), p[34] = R, p[35] = y, p[36] = s) : s = p[36];
|
|
65
66
|
let u;
|
|
66
|
-
return p[37] !== t || p[38] !==
|
|
67
|
+
return p[37] !== t || p[38] !== s ? (u = /* @__PURE__ */ jsxs(CompletionMessagePaper_default, { children: [t, s] }), p[37] = t, p[38] = s, p[39] = u) : u = p[39], u;
|
|
67
68
|
}
|
|
68
69
|
let z;
|
|
69
70
|
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, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useBatchDeleteWorkflows,
|
|
1
|
+
import { useDeleteWorkflow } from "../../packages/react/dist/hooks/mutations.js";
|
|
2
|
+
import { useBatchDeleteWorkflows, useFilterWorkflows } from "../../hooks/useWorkflows.js";
|
|
3
3
|
import { useFilterWorkspaces } from "../../hooks/useWorkspaces.js";
|
|
4
|
+
import { useStudio } from "../../providers/StudioProvider.js";
|
|
4
5
|
import { Badge } from "../../components/ui/badge.js";
|
|
5
6
|
import ListView_default from "../../components/lists/ListView.js";
|
|
6
7
|
import { useDebounce } from "../../hooks/useDebounce.js";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { useRunWorkflow } from "../../../packages/react/dist/hooks/mutations.js";
|
|
1
2
|
import { useDocumentConfigs } from "../../../hooks/useConfig.js";
|
|
2
3
|
import { Button } from "../../../components/ui/button.js";
|
|
3
4
|
import { Input } from "../../../components/ui/input.js";
|
|
4
5
|
import { Label } from "../../../components/ui/label.js";
|
|
5
6
|
import CompletionMessagePaper_default from "../../../components/messages/CompletionMessagePaper.js";
|
|
6
|
-
import
|
|
7
|
+
import "../../../hooks/useProcessor.js";
|
|
7
8
|
import { useWorkbenchLayout } from "../../workbench/providers/WorkbenchLayoutProvider.js";
|
|
8
9
|
import "../../workbench/index.js";
|
|
9
10
|
import { useUpsertSecret } from "../../../hooks/useSecrets.js";
|
|
@@ -30,7 +31,7 @@ var SecretInputRenderer_default = ({ parentWorkflow: m, workflow: h, document: g
|
|
|
30
31
|
}
|
|
31
32
|
C.mutate({
|
|
32
33
|
workflowId: m.id,
|
|
33
|
-
|
|
34
|
+
payload: { transition: {
|
|
34
35
|
id: b,
|
|
35
36
|
workflowId: h.id,
|
|
36
37
|
payload: { keys: e }
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { WorkflowState } from "../../packages/contracts/dist/enums/workflow-state.enum.js";
|
|
2
|
+
import "../../packages/contracts/dist/enums/index.js";
|
|
3
|
+
import { useRunWorkflow } from "../../packages/react/dist/hooks/mutations.js";
|
|
1
4
|
import { cn } from "../../lib/utils.js";
|
|
2
5
|
import { Button } from "../../components/ui/button.js";
|
|
3
6
|
import LoadingCentered_default from "../../components/feedback/LoadingCentered.js";
|
|
4
7
|
import ErrorSnackbar_default from "../../components/feedback/ErrorSnackbar.js";
|
|
5
|
-
import
|
|
6
|
-
import "../../packages/contracts/dist/enums/index.js";
|
|
7
|
-
import { useRunWorkflow } from "../../hooks/useProcessor.js";
|
|
8
|
+
import "../../hooks/useProcessor.js";
|
|
8
9
|
import DocumentList_default from "../documents/components/DocumentList.js";
|
|
9
10
|
import "../documents/index.js";
|
|
10
11
|
import WorkflowForms_default from "./components/WorkflowForms.js";
|
|
@@ -37,11 +38,7 @@ var WorkflowItem_default = (h) => {
|
|
|
37
38
|
g[16] === E?.availableTransitions ? R = g[17] : (R = E?.availableTransitions?.some(_temp), g[16] = E?.availableTransitions, g[17] = R);
|
|
38
39
|
let z = R, B = E?.hasError && E.status === WorkflowState.Waiting, V = E?.hasError && !B && z !== !1, H;
|
|
39
40
|
g[18] !== w || g[19] !== v ? (H = () => {
|
|
40
|
-
w.mutate({
|
|
41
|
-
workflowId: v,
|
|
42
|
-
runWorkflowPayloadDto: {},
|
|
43
|
-
force: !0
|
|
44
|
-
});
|
|
41
|
+
w.mutate({ workflowId: v });
|
|
45
42
|
}, g[18] = w, g[19] = v, g[20] = H) : H = g[20];
|
|
46
43
|
let U = H, W = x ? "p-0" : "p-4", G;
|
|
47
44
|
g[21] === W ? G = g[22] : (G = cn("flex flex-col", W), g[21] = W, g[22] = G);
|