@loopstack/loopstack-studio 0.23.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.js +12 -10
- package/dist/api/secrets.js +16 -0
- package/dist/components/dynamic-form/ArrayController.js +68 -64
- package/dist/components/dynamic-form/Form.js +56 -27
- package/dist/components/dynamic-form/FormElement.js +1 -1
- package/dist/components/dynamic-form/FormElementHeader.js +2 -2
- package/dist/components/dynamic-form/InputController.js +3 -1
- package/dist/components/dynamic-form/ObjectController.js +24 -21
- package/dist/components/dynamic-form/fields/BaseFieldWrapper.js +1 -1
- package/dist/components/dynamic-form/fields/InputField.js +20 -19
- package/dist/components/dynamic-form/fields/MarkdownViewField.js +20 -0
- package/dist/components/dynamic-form/fields/RadioField.js +18 -18
- package/dist/components/dynamic-form/fields/SelectField.js +19 -19
- package/dist/components/dynamic-form/fields/TextareaField.js +17 -17
- package/dist/components/layout/MainLayout.js +18 -31
- package/dist/components/layout/StudioSidebar.js +168 -108
- package/dist/components/page/PageBreadcrumbs.js +79 -32
- package/dist/components/ui-widgets/UiWidget.js +36 -27
- package/dist/components/ui-widgets/widgets/SecretInput.js +42 -0
- package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +80 -4
- package/dist/features/code-explorer/components/FileContentViewer.js +47 -30
- package/dist/features/code-explorer/components/FileTabsBar.js +3 -190
- package/dist/features/code-explorer/components/FileTabsBarBase.js +190 -0
- package/dist/features/code-explorer/index.js +2 -2
- package/dist/features/code-explorer/providers/CodeExplorerProvider.js +2 -162
- package/dist/features/code-explorer/utils/fileIcons.js +7 -4
- package/dist/features/debug/components/PipelineFlowViewer.js +46 -45
- package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +19 -19
- package/dist/features/documents/DocumentRenderer.js +20 -15
- package/dist/features/documents/components/DocumentList.js +5 -1
- package/dist/features/documents/renderers/AiMessage.js +11 -11
- package/dist/features/documents/renderers/ClaudeMessage.js +96 -0
- package/dist/features/documents/renderers/DocumentFormRenderer.js +17 -11
- package/dist/features/workbench/Workbench.js +64 -80
- package/dist/features/workbench/WorkflowItem.js +5 -5
- package/dist/features/workbench/components/RemoteFileTabsBar.js +18 -0
- package/dist/features/workbench/components/RemoteFileTree.js +90 -0
- package/dist/features/workbench/components/WorkbenchFilesPanel.js +67 -0
- package/dist/features/workbench/components/WorkbenchFloatingPanel.js +57 -49
- package/dist/features/workbench/components/WorkbenchFlowPanel.js +2 -2
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +48 -28
- package/dist/features/workbench/components/WorkbenchSecretsPanel.js +182 -0
- package/dist/features/workbench/hooks/useWorkflowData.js +4 -4
- package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +160 -0
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +46 -43
- package/dist/features/workspaces/components/PipelineForm.js +1 -1
- package/dist/features/workspaces/components/WorkspaceHomePage.js +93 -0
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/query-keys.js +41 -34
- package/dist/hooks/useFiles.js +1 -43
- package/dist/hooks/useSecrets.js +69 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +3 -2
- package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
- package/dist/pages/DashboardPage.js +87 -35
- package/dist/pages/EmbedWorkbenchPage.js +43 -39
- package/dist/pages/PipelineDebugPage.js +1 -1
- package/dist/pages/PreviewWorkbenchPage.js +167 -70
- package/dist/pages/WorkspacePage.js +102 -50
- package/dist/pages/WorkspaceRunsPage.js +71 -0
- package/dist/routing/LocalRouter.js +6 -0
- package/dist/types/ai.types.js +13 -0
- package/package.json +2 -3
- package/dist/node_modules/@ai-sdk/provider/dist/index.js +0 -65
- package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +0 -1008
- package/dist/node_modules/ai/dist/index.js +0 -1083
- package/dist/node_modules/zod/v3/ZodError.js +0 -79
- package/dist/node_modules/zod/v3/errors.js +0 -6
- package/dist/node_modules/zod/v3/helpers/errorUtil.js +0 -5
- package/dist/node_modules/zod/v3/helpers/parseUtil.js +0 -90
- package/dist/node_modules/zod/v3/helpers/util.js +0 -72
- package/dist/node_modules/zod/v3/locales/en.js +0 -58
- package/dist/node_modules/zod/v3/types.js +0 -2425
- package/dist/node_modules/zod/v4/classic/errors.js +0 -21
- package/dist/node_modules/zod/v4/classic/iso.js +0 -29
- package/dist/node_modules/zod/v4/classic/parse.js +0 -4
- package/dist/node_modules/zod/v4/classic/schemas.js +0 -392
- package/dist/node_modules/zod/v4/core/api.js +0 -532
- package/dist/node_modules/zod/v4/core/checks.js +0 -283
- package/dist/node_modules/zod/v4/core/core.js +0 -44
- package/dist/node_modules/zod/v4/core/doc.js +0 -21
- package/dist/node_modules/zod/v4/core/errors.js +0 -40
- package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -305
- package/dist/node_modules/zod/v4/core/parse.js +0 -66
- package/dist/node_modules/zod/v4/core/regexes.js +0 -28
- package/dist/node_modules/zod/v4/core/registries.js +0 -38
- package/dist/node_modules/zod/v4/core/schemas.js +0 -863
- package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -220
- package/dist/node_modules/zod/v4/core/util.js +0 -267
- package/dist/node_modules/zod/v4/core/versions.js +0 -6
|
@@ -1,58 +1,110 @@
|
|
|
1
1
|
import { useStudio } from "../providers/StudioProvider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Button } from "../components/ui/button.js";
|
|
3
|
+
import { Alert, AlertDescription, AlertTitle } from "../components/ui/alert.js";
|
|
3
4
|
import MainLayout_default from "../components/layout/MainLayout.js";
|
|
4
5
|
import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
|
|
5
6
|
import Dashboard from "../features/dashboard/Dashboard.js";
|
|
6
7
|
import { useDashboardStats } from "../hooks/useDashboard.js";
|
|
7
8
|
import { c } from "react/compiler-runtime";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { Home } from "lucide-react";
|
|
10
|
+
import { Home, TriangleAlert } from "lucide-react";
|
|
10
11
|
function DashboardPage() {
|
|
11
|
-
let
|
|
12
|
-
if (
|
|
12
|
+
let h = c(38), { environment: g } = useStudio(), { data: _, isLoading: v, error: y, refetch: b, isRefetching: x } = useDashboardStats();
|
|
13
|
+
if (v) {
|
|
13
14
|
let e;
|
|
14
|
-
return
|
|
15
|
+
return h[0] === v ? e = h[1] : (e = /* @__PURE__ */ jsx(LoadingCentered_default, { loading: v }), h[0] = v, h[1] = e), e;
|
|
15
16
|
}
|
|
16
|
-
if (
|
|
17
|
+
if (y) {
|
|
17
18
|
let e;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
h[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), h[2] = e) : e = h[2];
|
|
20
|
+
let d;
|
|
21
|
+
h[3] === g.name ? d = h[4] : (d = {
|
|
22
|
+
label: g.name,
|
|
23
|
+
href: "#",
|
|
24
|
+
icon: e
|
|
25
|
+
}, h[3] = g.name, h[4] = d);
|
|
26
|
+
let f;
|
|
27
|
+
h[5] === Symbol.for("react.memo_cache_sentinel") ? (f = {
|
|
28
|
+
label: "Dashboard",
|
|
29
|
+
current: !0
|
|
30
|
+
}, h[5] = f) : f = h[5];
|
|
31
|
+
let p;
|
|
32
|
+
h[6] === d ? p = h[7] : (p = [d, f], h[6] = d, h[7] = p);
|
|
33
|
+
let m = p, _;
|
|
34
|
+
h[8] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx("h1", {
|
|
35
|
+
className: "mb-4 text-3xl font-bold tracking-tight",
|
|
36
|
+
children: "Dashboard"
|
|
37
|
+
}), h[8] = _) : _ = h[8];
|
|
38
|
+
let v, S;
|
|
39
|
+
h[9] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ jsx(TriangleAlert, {}), S = /* @__PURE__ */ jsx(AlertTitle, { children: "Dashboard konnte nicht geladen werden" }), h[9] = v, h[10] = S) : (v = h[9], S = h[10]);
|
|
40
|
+
let C;
|
|
41
|
+
h[11] === y.message ? C = h[12] : (C = /* @__PURE__ */ jsxs("p", {
|
|
42
|
+
className: "wrap-break-word",
|
|
43
|
+
children: ["Bitte versuch’s nochmal. ", y.message]
|
|
44
|
+
}), h[11] = y.message, h[12] = C);
|
|
45
|
+
let w;
|
|
46
|
+
h[13] === b ? w = h[14] : (w = () => void b(), h[13] = b, h[14] = w);
|
|
47
|
+
let T = x ? "Lade neu…" : "Neu versuchen", E;
|
|
48
|
+
h[15] !== x || h[16] !== w || h[17] !== T ? (E = /* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: "mt-3 flex flex-wrap gap-2",
|
|
50
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
51
|
+
variant: "destructive",
|
|
52
|
+
onClick: w,
|
|
53
|
+
disabled: x,
|
|
54
|
+
children: T
|
|
55
|
+
})
|
|
56
|
+
}), h[15] = x, h[16] = w, h[17] = T, h[18] = E) : E = h[18];
|
|
57
|
+
let D;
|
|
58
|
+
h[19] !== E || h[20] !== C ? (D = /* @__PURE__ */ jsx("div", {
|
|
59
|
+
className: "mx-auto w-full max-w-2xl",
|
|
60
|
+
children: /* @__PURE__ */ jsxs(Alert, {
|
|
61
|
+
variant: "destructive",
|
|
62
|
+
children: [
|
|
63
|
+
v,
|
|
64
|
+
S,
|
|
65
|
+
/* @__PURE__ */ jsxs(AlertDescription, { children: [C, E] })
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
}), h[19] = E, h[20] = C, h[21] = D) : D = h[21];
|
|
69
|
+
let O;
|
|
70
|
+
return h[22] !== m || h[23] !== D ? (O = /* @__PURE__ */ jsxs(MainLayout_default, {
|
|
71
|
+
breadcrumbsData: m,
|
|
72
|
+
children: [_, D]
|
|
73
|
+
}), h[22] = m, h[23] = D, h[24] = O) : O = h[24], O;
|
|
22
74
|
}
|
|
23
|
-
if (!
|
|
75
|
+
if (!_) {
|
|
24
76
|
let e;
|
|
25
|
-
return
|
|
77
|
+
return h[25] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx("div", {
|
|
26
78
|
className: "p-4",
|
|
27
79
|
children: "No data available"
|
|
28
|
-
}),
|
|
80
|
+
}), h[25] = e) : e = h[25], e;
|
|
29
81
|
}
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
label:
|
|
82
|
+
let S;
|
|
83
|
+
h[26] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), h[26] = S) : S = h[26];
|
|
84
|
+
let C;
|
|
85
|
+
h[27] === g.name ? C = h[28] : (C = {
|
|
86
|
+
label: g.name,
|
|
35
87
|
href: "#",
|
|
36
|
-
icon:
|
|
37
|
-
},
|
|
38
|
-
let
|
|
39
|
-
|
|
88
|
+
icon: S
|
|
89
|
+
}, h[27] = g.name, h[28] = C);
|
|
90
|
+
let w;
|
|
91
|
+
h[29] === Symbol.for("react.memo_cache_sentinel") ? (w = {
|
|
40
92
|
label: "Dashboard",
|
|
41
93
|
current: !0
|
|
42
|
-
},
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
let
|
|
46
|
-
|
|
94
|
+
}, h[29] = w) : w = h[29];
|
|
95
|
+
let T;
|
|
96
|
+
h[30] === C ? T = h[31] : (T = [C, w], h[30] = C, h[31] = T);
|
|
97
|
+
let E = T, D;
|
|
98
|
+
h[32] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ jsx("h1", {
|
|
47
99
|
className: "mb-4 text-3xl font-bold tracking-tight",
|
|
48
100
|
children: "Dashboard"
|
|
49
|
-
}),
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
let
|
|
53
|
-
return
|
|
54
|
-
breadcrumbsData:
|
|
55
|
-
children: [
|
|
56
|
-
}),
|
|
101
|
+
}), h[32] = D) : D = h[32];
|
|
102
|
+
let O;
|
|
103
|
+
h[33] === _ ? O = h[34] : (O = /* @__PURE__ */ jsx(Dashboard, { dashboardStats: _ }), h[33] = _, h[34] = O);
|
|
104
|
+
let k;
|
|
105
|
+
return h[35] !== E || h[36] !== O ? (k = /* @__PURE__ */ jsxs(MainLayout_default, {
|
|
106
|
+
breadcrumbsData: E,
|
|
107
|
+
children: [D, O]
|
|
108
|
+
}), h[35] = E, h[36] = O, h[37] = k) : k = h[37], k;
|
|
57
109
|
}
|
|
58
110
|
export { DashboardPage as default };
|
|
@@ -4,6 +4,7 @@ import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
|
|
|
4
4
|
import { require_enums } from "../packages/contracts/dist/enums/index.js";
|
|
5
5
|
import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
|
|
6
6
|
import WorkflowItem_default from "../features/workbench/WorkflowItem.js";
|
|
7
|
+
import { WorkbenchLayoutProvider } from "../features/workbench/providers/WorkbenchLayoutProvider.js";
|
|
7
8
|
import "../features/workbench/index.js";
|
|
8
9
|
import { requireParam } from "../lib/requireParam.js";
|
|
9
10
|
import { c } from "react/compiler-runtime";
|
|
@@ -12,61 +13,64 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
12
13
|
import { useParams } from "react-router-dom";
|
|
13
14
|
var import_enums = require_enums(), EMBED_MESSAGE_TYPE = "loopstack:embed:workflow-completed", EMBED_RESIZE_MESSAGE_TYPE = "loopstack:embed:resize";
|
|
14
15
|
function EmbedWorkbenchPage() {
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
!
|
|
16
|
+
let v = c(24), y = useParams(), b;
|
|
17
|
+
v[0] === y ? b = v[1] : (b = requireParam(y, "pipelineId"), v[0] = y, v[1] = b);
|
|
18
|
+
let x = b, S = useRef(null), C = usePipeline(x), w = useFetchWorkflowsByPipeline(x), T = useRef(!1), E, D;
|
|
19
|
+
v[2] !== w.data || v[3] !== x ? (E = () => {
|
|
20
|
+
!w.data || T.current || w.data.length > 0 && w.data.every(_temp) && window.parent !== window && (T.current = !0, window.parent.postMessage({
|
|
20
21
|
type: EMBED_MESSAGE_TYPE,
|
|
21
|
-
pipelineId:
|
|
22
|
+
pipelineId: x
|
|
22
23
|
}, window.location.origin));
|
|
23
|
-
},
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
if (window.parent === window || !
|
|
24
|
+
}, D = [w.data, x], v[2] = w.data, v[3] = x, v[4] = E, v[5] = D) : (E = v[4], D = v[5]), useEffect(E, D);
|
|
25
|
+
let O, k;
|
|
26
|
+
v[6] === x ? (O = v[7], k = v[8]) : (O = () => {
|
|
27
|
+
if (window.parent === window || !S.current) return;
|
|
27
28
|
let t = new ResizeObserver(() => {
|
|
28
|
-
if (!
|
|
29
|
+
if (!S.current) return;
|
|
29
30
|
let t = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
|
|
30
31
|
window.parent.postMessage({
|
|
31
32
|
type: EMBED_RESIZE_MESSAGE_TYPE,
|
|
32
|
-
pipelineId:
|
|
33
|
+
pipelineId: x,
|
|
33
34
|
height: t
|
|
34
35
|
}, window.location.origin);
|
|
35
36
|
});
|
|
36
|
-
return t.observe(
|
|
37
|
-
},
|
|
38
|
-
let
|
|
39
|
-
|
|
37
|
+
return t.observe(S.current), () => t.disconnect();
|
|
38
|
+
}, k = [x], v[6] = x, v[7] = O, v[8] = k), useEffect(O, k);
|
|
39
|
+
let A = _temp2, j;
|
|
40
|
+
v[9] === Symbol.for("react.memo_cache_sentinel") ? (j = {
|
|
40
41
|
enableDebugMode: !1,
|
|
41
42
|
showFullMessageHistory: !1
|
|
42
|
-
},
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
pipeline:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
children: F
|
|
59
|
-
}), _[17] = P, _[18] = F, _[19] = I) : I = _[19];
|
|
43
|
+
}, v[9] = j) : j = v[9];
|
|
44
|
+
let M = j, N;
|
|
45
|
+
v[10] === C.error ? N = v[11] : (N = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: C.error }), v[10] = C.error, v[11] = N);
|
|
46
|
+
let P;
|
|
47
|
+
v[12] === w.error ? P = v[13] : (P = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: w.error }), v[12] = w.error, v[13] = P);
|
|
48
|
+
let F = C.isLoading || w.isLoading, I;
|
|
49
|
+
v[14] !== C.data || v[15] !== w.data ? (I = C.data && w.data ? /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
|
|
50
|
+
pipeline: C.data,
|
|
51
|
+
children: w.data.map((t) => /* @__PURE__ */ jsx(WorkflowItem_default, {
|
|
52
|
+
pipeline: C.data,
|
|
53
|
+
workflowId: t.id,
|
|
54
|
+
scrollTo: A,
|
|
55
|
+
settings: M,
|
|
56
|
+
embed: !0
|
|
57
|
+
}, t.id))
|
|
58
|
+
}) : null, v[14] = C.data, v[15] = w.data, v[16] = I) : I = v[16];
|
|
60
59
|
let L;
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
v[17] !== F || v[18] !== I ? (L = /* @__PURE__ */ jsx(LoadingCentered_default, {
|
|
61
|
+
loading: F,
|
|
62
|
+
children: I
|
|
63
|
+
}), v[17] = F, v[18] = I, v[19] = L) : L = v[19];
|
|
64
|
+
let R;
|
|
65
|
+
return v[20] !== L || v[21] !== N || v[22] !== P ? (R = /* @__PURE__ */ jsxs("div", {
|
|
66
|
+
ref: S,
|
|
63
67
|
className: "overflow-hidden px-6 py-4",
|
|
64
68
|
children: [
|
|
65
|
-
M,
|
|
66
69
|
N,
|
|
67
|
-
|
|
70
|
+
P,
|
|
71
|
+
L
|
|
68
72
|
]
|
|
69
|
-
}),
|
|
73
|
+
}), v[20] = L, v[21] = N, v[22] = P, v[23] = R) : R = v[23], R;
|
|
70
74
|
}
|
|
71
75
|
function _temp2() {}
|
|
72
76
|
function _temp(t) {
|
|
@@ -3,8 +3,8 @@ import { usePipeline, usePipelineConfigByName } from "../hooks/usePipelines.js";
|
|
|
3
3
|
import { useWorkspace } from "../hooks/useWorkspaces.js";
|
|
4
4
|
import MainLayout_default from "../components/layout/MainLayout.js";
|
|
5
5
|
import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
|
|
6
|
-
import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
|
|
7
6
|
import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
|
|
7
|
+
import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
|
|
8
8
|
import PipelineFlowViewer_default from "../features/debug/components/PipelineFlowViewer.js";
|
|
9
9
|
import PipelineDebugHeader_default from "../features/debug/components/PipelineDebugHeader.js";
|
|
10
10
|
import "../features/debug/index.js";
|
|
@@ -7,12 +7,12 @@ import { SidebarMenu, SidebarProvider } from "../components/ui/sidebar.js";
|
|
|
7
7
|
import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
|
|
8
8
|
import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
|
|
9
9
|
import { require_enums } from "../packages/contracts/dist/enums/index.js";
|
|
10
|
-
import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
|
|
11
10
|
import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
|
|
12
|
-
import PipelineFlowViewer_default from "../features/debug/components/PipelineFlowViewer.js";
|
|
13
|
-
import "../features/debug/index.js";
|
|
14
11
|
import WorkflowItem_default from "../features/workbench/WorkflowItem.js";
|
|
15
12
|
import WorkflowButtons_default from "../features/workbench/components/buttons/WorkflowButtons.js";
|
|
13
|
+
import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
|
|
14
|
+
import PipelineFlowViewer_default from "../features/debug/components/PipelineFlowViewer.js";
|
|
15
|
+
import "../features/debug/index.js";
|
|
16
16
|
import { useNamespaceTree } from "../hooks/useNamespaceTree.js";
|
|
17
17
|
import WorkbenchNavigation_default from "../features/workbench/WorkbenchNavigation.js";
|
|
18
18
|
import PipelineHistoryList_default from "../features/workbench/components/PipelineHistoryList.js";
|
|
@@ -21,8 +21,9 @@ import "../features/workbench/index.js";
|
|
|
21
21
|
import { c } from "react/compiler-runtime";
|
|
22
22
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
23
23
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { useQuery } from "@tanstack/react-query";
|
|
24
25
|
import { useNavigate, useParams } from "react-router-dom";
|
|
25
|
-
import { ChevronDown, ChevronRight, ListOrdered, Loader2, Navigation, Play, ScrollText, Workflow } from "lucide-react";
|
|
26
|
+
import { ChevronDown, ChevronRight, ListOrdered, Loader2, Navigation, Play, RefreshCw, ScrollText, Workflow } from "lucide-react";
|
|
26
27
|
import { formatDistanceToNow } from "date-fns";
|
|
27
28
|
var import_enums = require_enums(), EMBED_MESSAGE_TYPE = "loopstack:embed:workflow-completed", EMBED_RESIZE_MESSAGE_TYPE = "loopstack:embed:resize", EMBED_NEW_RUN_MESSAGE_TYPE = "loopstack:embed:new-run";
|
|
28
29
|
function PreviewWorkbenchPage() {
|
|
@@ -49,17 +50,17 @@ function PreviewWorkbenchPage() {
|
|
|
49
50
|
}), e[3] = t, e[4] = o), o;
|
|
50
51
|
}
|
|
51
52
|
function PreviewWorkbenchContent(e) {
|
|
52
|
-
let t = c(
|
|
53
|
+
let t = c(61), { pipelineId: o, onNewRunSuccess: s } = e, l = useRef(null), [u, d] = useState("output"), [m, _] = useState(!1), b = usePipeline(o), x = useFetchWorkflowsByPipeline(o), C;
|
|
53
54
|
t[0] === x.data ? C = t[1] : (C = x.data ?? [], t[0] = x.data, t[1] = C);
|
|
54
|
-
let T = C, E = useRef(!1),
|
|
55
|
-
t[2] !== x.data || t[3] !== o ? (
|
|
55
|
+
let T = C, E = useRef(!1), _e = b.data?.workspaceId, ve = useWorkspace(_e).data?.blockName, ye = b.data?.blockName, D = usePipelineConfigByName(ve, ye), O, k;
|
|
56
|
+
t[2] !== x.data || t[3] !== o ? (O = () => {
|
|
56
57
|
!x.data || E.current || x.data.length > 0 && x.data.every(_temp) && window.parent !== window && (E.current = !0, window.parent.postMessage({
|
|
57
58
|
type: EMBED_MESSAGE_TYPE,
|
|
58
59
|
pipelineId: o
|
|
59
60
|
}, window.location.origin));
|
|
60
|
-
},
|
|
61
|
-
let
|
|
62
|
-
t[6] === o ? (
|
|
61
|
+
}, k = [x.data, o], t[2] = x.data, t[3] = o, t[4] = O, t[5] = k) : (O = t[4], k = t[5]), useEffect(O, k);
|
|
62
|
+
let A, j;
|
|
63
|
+
t[6] === o ? (A = t[7], j = t[8]) : (A = () => {
|
|
63
64
|
if (window.parent === window || !l.current) return;
|
|
64
65
|
let e = new ResizeObserver(() => {
|
|
65
66
|
if (!l.current) return;
|
|
@@ -71,66 +72,73 @@ function PreviewWorkbenchContent(e) {
|
|
|
71
72
|
}, window.location.origin);
|
|
72
73
|
});
|
|
73
74
|
return e.observe(l.current), () => e.disconnect();
|
|
74
|
-
},
|
|
75
|
-
let
|
|
76
|
-
t[9] === s ?
|
|
77
|
-
|
|
78
|
-
}, t[9] = s, t[10] =
|
|
79
|
-
let
|
|
80
|
-
t[11] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
75
|
+
}, j = [o], t[6] = o, t[7] = A, t[8] = j), useEffect(A, j);
|
|
76
|
+
let M;
|
|
77
|
+
t[9] === s ? M = t[10] : (M = (e) => {
|
|
78
|
+
_(!1), s(e);
|
|
79
|
+
}, t[9] = s, t[10] = M);
|
|
80
|
+
let N = M, P = _temp2, F;
|
|
81
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (F = {
|
|
81
82
|
enableDebugMode: !1,
|
|
82
83
|
showFullMessageHistory: !1
|
|
83
|
-
}, t[11] =
|
|
84
|
-
let
|
|
85
|
-
t[12] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
84
|
+
}, t[11] = F) : F = t[11];
|
|
85
|
+
let I = F, L;
|
|
86
|
+
t[12] === Symbol.for("react.memo_cache_sentinel") ? (L = {
|
|
86
87
|
value: "output",
|
|
87
88
|
label: "Output",
|
|
88
89
|
icon: /* @__PURE__ */ jsx(ScrollText, { className: "h-3.5 w-3.5" })
|
|
89
|
-
}, t[12] =
|
|
90
|
-
let
|
|
91
|
-
t[13] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
90
|
+
}, t[12] = L) : L = t[12];
|
|
91
|
+
let R;
|
|
92
|
+
t[13] === Symbol.for("react.memo_cache_sentinel") ? (R = {
|
|
92
93
|
value: "graph",
|
|
93
94
|
label: "Graph",
|
|
94
95
|
icon: /* @__PURE__ */ jsx(Workflow, { className: "h-3.5 w-3.5" })
|
|
95
|
-
}, t[13] =
|
|
96
|
+
}, t[13] = R) : R = t[13];
|
|
97
|
+
let z;
|
|
98
|
+
t[14] === Symbol.for("react.memo_cache_sentinel") ? (z = {
|
|
99
|
+
value: "run-log",
|
|
100
|
+
label: "Run Log",
|
|
101
|
+
icon: /* @__PURE__ */ jsx(ListOrdered, { className: "h-3.5 w-3.5" })
|
|
102
|
+
}, t[14] = z) : z = t[14];
|
|
96
103
|
let B;
|
|
97
|
-
t[
|
|
104
|
+
t[15] === Symbol.for("react.memo_cache_sentinel") ? (B = [
|
|
105
|
+
L,
|
|
98
106
|
R,
|
|
99
107
|
z,
|
|
100
108
|
{
|
|
101
|
-
value: "
|
|
102
|
-
label: "
|
|
103
|
-
icon: /* @__PURE__ */ jsx(
|
|
109
|
+
value: "logs",
|
|
110
|
+
label: "Logs",
|
|
111
|
+
icon: /* @__PURE__ */ jsx(ScrollText, { className: "h-3.5 w-3.5" })
|
|
104
112
|
}
|
|
105
|
-
], t[
|
|
106
|
-
let
|
|
107
|
-
t[
|
|
113
|
+
], t[15] = B) : B = t[15];
|
|
114
|
+
let be = B, V;
|
|
115
|
+
t[16] === u ? V = t[17] : (V = /* @__PURE__ */ jsx("div", {
|
|
108
116
|
className: "bg-background flex items-center rounded-md border p-0.5",
|
|
109
|
-
children:
|
|
117
|
+
children: be.map((e) => /* @__PURE__ */ jsxs("button", {
|
|
110
118
|
onClick: () => d(e.value),
|
|
111
119
|
className: `flex items-center gap-1.5 rounded-sm px-2.5 py-1 text-xs font-medium transition-colors ${u === e.value ? "bg-foreground text-background shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
112
120
|
children: [e.icon, e.label]
|
|
113
121
|
}, e.value))
|
|
114
|
-
}), t[
|
|
115
|
-
let
|
|
116
|
-
t[
|
|
122
|
+
}), t[16] = u, t[17] = V);
|
|
123
|
+
let H;
|
|
124
|
+
t[18] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ jsxs(Button, {
|
|
117
125
|
variant: "outline",
|
|
118
126
|
size: "sm",
|
|
119
127
|
className: "h-7 gap-1.5",
|
|
120
|
-
onClick: () =>
|
|
128
|
+
onClick: () => _(!0),
|
|
121
129
|
children: [/* @__PURE__ */ jsx(Play, { className: "h-3 w-3" }), "New Run"]
|
|
122
|
-
}), t[
|
|
123
|
-
let
|
|
124
|
-
t[
|
|
130
|
+
}), t[18] = H) : H = t[18];
|
|
131
|
+
let U;
|
|
132
|
+
t[19] === V ? U = t[20] : (U = /* @__PURE__ */ jsxs("div", {
|
|
125
133
|
className: "bg-muted/50 flex h-11 shrink-0 items-center justify-between border-b px-3",
|
|
126
|
-
children: [
|
|
127
|
-
}), t[
|
|
134
|
+
children: [V, H]
|
|
135
|
+
}), t[19] = V, t[20] = U);
|
|
136
|
+
let W;
|
|
137
|
+
t[21] === b.error ? W = t[22] : (W = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: b.error }), t[21] = b.error, t[22] = W);
|
|
128
138
|
let G;
|
|
129
|
-
t[
|
|
139
|
+
t[23] === x.error ? G = t[24] : (G = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: x.error }), t[23] = x.error, t[24] = G);
|
|
130
140
|
let K;
|
|
131
|
-
t[
|
|
132
|
-
let q;
|
|
133
|
-
t[24] !== u || t[25] !== b.data || t[26] !== b.isLoading || t[27] !== x.data || t[28] !== x.isLoading ? (q = u === "output" && /* @__PURE__ */ jsx("div", {
|
|
141
|
+
t[25] !== u || t[26] !== b.data || t[27] !== b.isLoading || t[28] !== x.data || t[29] !== x.isLoading ? (K = u === "output" && /* @__PURE__ */ jsx("div", {
|
|
134
142
|
className: "px-4 py-3",
|
|
135
143
|
children: /* @__PURE__ */ jsx(LoadingCentered_default, {
|
|
136
144
|
loading: b.isLoading || x.isLoading,
|
|
@@ -141,21 +149,22 @@ function PreviewWorkbenchContent(e) {
|
|
|
141
149
|
children: /* @__PURE__ */ jsx(WorkflowItem_default, {
|
|
142
150
|
pipeline: b.data,
|
|
143
151
|
workflowId: e.id,
|
|
144
|
-
scrollTo:
|
|
145
|
-
settings:
|
|
152
|
+
scrollTo: P,
|
|
153
|
+
settings: I
|
|
146
154
|
})
|
|
147
155
|
}, e.id)) : null
|
|
148
156
|
})
|
|
149
|
-
}), t[
|
|
150
|
-
let
|
|
151
|
-
t[
|
|
157
|
+
}), t[25] = u, t[26] = b.data, t[27] = b.isLoading, t[28] = x.data, t[29] = x.isLoading, t[30] = K) : K = t[30];
|
|
158
|
+
let q;
|
|
159
|
+
t[31] !== u || t[32] !== b.isLoading || t[33] !== D || t[34] !== x.isLoading || t[35] !== o || t[36] !== T ? (q = u === "graph" && /* @__PURE__ */ jsx("div", {
|
|
152
160
|
className: "h-full",
|
|
153
161
|
children: /* @__PURE__ */ jsx(LoadingCentered_default, {
|
|
154
162
|
loading: b.isLoading || x.isLoading,
|
|
155
163
|
children: T.length > 0 ? /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(PipelineFlowViewer_default, {
|
|
156
164
|
pipelineId: o,
|
|
157
165
|
workflows: T,
|
|
158
|
-
pipelineConfig:
|
|
166
|
+
pipelineConfig: D.data,
|
|
167
|
+
direction: "TB"
|
|
159
168
|
}) }) : /* @__PURE__ */ jsx("div", {
|
|
160
169
|
className: "text-muted-foreground flex h-full items-center justify-center",
|
|
161
170
|
children: /* @__PURE__ */ jsx("p", {
|
|
@@ -164,21 +173,24 @@ function PreviewWorkbenchContent(e) {
|
|
|
164
173
|
})
|
|
165
174
|
})
|
|
166
175
|
})
|
|
167
|
-
}), t[
|
|
168
|
-
let
|
|
169
|
-
t[
|
|
176
|
+
}), t[31] = u, t[32] = b.isLoading, t[33] = D, t[34] = x.isLoading, t[35] = o, t[36] = T, t[37] = q) : q = t[37];
|
|
177
|
+
let J;
|
|
178
|
+
t[38] !== u || t[39] !== b.data ? (J = u === "run-log" && /* @__PURE__ */ jsx("div", {
|
|
170
179
|
className: "px-4",
|
|
171
180
|
children: /* @__PURE__ */ jsx(PipelineHistoryList_default, { pipeline: b.data })
|
|
172
|
-
}), t[
|
|
173
|
-
let
|
|
174
|
-
t[
|
|
181
|
+
}), t[38] = u, t[39] = b.data, t[40] = J) : J = t[40];
|
|
182
|
+
let Y;
|
|
183
|
+
t[41] !== u || t[42] !== o ? (Y = u === "navigate" && /* @__PURE__ */ jsx("div", {
|
|
175
184
|
className: "px-4 py-2",
|
|
176
185
|
children: /* @__PURE__ */ jsx(EmbedNavigationContent, { pipelineId: o })
|
|
177
|
-
}), t[
|
|
186
|
+
}), t[41] = u, t[42] = o, t[43] = Y) : Y = t[43];
|
|
187
|
+
let X;
|
|
188
|
+
t[44] === u ? X = t[45] : (X = u === "logs" && /* @__PURE__ */ jsx(EmbedLogsContent, {}), t[44] = u, t[45] = X);
|
|
178
189
|
let Z;
|
|
179
|
-
t[
|
|
190
|
+
t[46] !== W || t[47] !== G || t[48] !== K || t[49] !== q || t[50] !== J || t[51] !== Y || t[52] !== X ? (Z = /* @__PURE__ */ jsxs("div", {
|
|
180
191
|
className: "flex-1 overflow-auto",
|
|
181
192
|
children: [
|
|
193
|
+
W,
|
|
182
194
|
G,
|
|
183
195
|
K,
|
|
184
196
|
q,
|
|
@@ -186,23 +198,23 @@ function PreviewWorkbenchContent(e) {
|
|
|
186
198
|
Y,
|
|
187
199
|
X
|
|
188
200
|
]
|
|
189
|
-
}), t[
|
|
201
|
+
}), t[46] = W, t[47] = G, t[48] = K, t[49] = q, t[50] = J, t[51] = Y, t[52] = X, t[53] = Z) : Z = t[53];
|
|
190
202
|
let Q;
|
|
191
|
-
t[
|
|
203
|
+
t[54] !== N || t[55] !== m ? (Q = /* @__PURE__ */ jsx(NewRunDialog, {
|
|
192
204
|
open: m,
|
|
193
|
-
onOpenChange:
|
|
194
|
-
onSuccess:
|
|
195
|
-
}), t[
|
|
205
|
+
onOpenChange: _,
|
|
206
|
+
onSuccess: N
|
|
207
|
+
}), t[54] = N, t[55] = m, t[56] = Q) : Q = t[56];
|
|
196
208
|
let $;
|
|
197
|
-
return t[
|
|
209
|
+
return t[57] !== U || t[58] !== Z || t[59] !== Q ? ($ = /* @__PURE__ */ jsxs("div", {
|
|
198
210
|
ref: l,
|
|
199
211
|
className: "flex h-screen flex-col overflow-hidden",
|
|
200
212
|
children: [
|
|
201
|
-
|
|
213
|
+
U,
|
|
202
214
|
Z,
|
|
203
215
|
Q
|
|
204
216
|
]
|
|
205
|
-
}), t[
|
|
217
|
+
}), t[57] = U, t[58] = Z, t[59] = Q, t[60] = $) : $ = t[60], $;
|
|
206
218
|
}
|
|
207
219
|
function _temp2() {}
|
|
208
220
|
function _temp(e) {
|
|
@@ -381,12 +393,97 @@ function EmbedWorkflowSection(e) {
|
|
|
381
393
|
className: "py-1",
|
|
382
394
|
children: a
|
|
383
395
|
}) }), t[24] = a, t[25] = g);
|
|
384
|
-
let
|
|
385
|
-
return t[26] !== h || t[27] !== g ? (
|
|
396
|
+
let v;
|
|
397
|
+
return t[26] !== h || t[27] !== g ? (v = /* @__PURE__ */ jsxs(Collapsible, {
|
|
386
398
|
defaultOpen: !0,
|
|
387
399
|
className: "group/collapsible",
|
|
388
400
|
children: [h, g]
|
|
389
|
-
}), t[26] = h, t[27] = g, t[28] =
|
|
401
|
+
}), t[26] = h, t[27] = g, t[28] = v) : v = t[28], v;
|
|
402
|
+
}
|
|
403
|
+
function stripAnsi(e) {
|
|
404
|
+
return e.replace(/\x1b\[[0-9;]*m/g, "");
|
|
405
|
+
}
|
|
406
|
+
function LogLine(e) {
|
|
407
|
+
let t = c(14), { line: n, index: r } = e, i, a, o;
|
|
408
|
+
if (t[0] !== n) {
|
|
409
|
+
i = stripAnsi(n);
|
|
410
|
+
let e;
|
|
411
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /\bERROR\b/, t[4] = e) : e = t[4], a = e.test(i), o = /\bWARN\b/.test(i) || /\b(Warning|WARNING|DeprecationWarning)\b/.test(i), t[0] = n, t[1] = i, t[2] = a, t[3] = o;
|
|
412
|
+
} else i = t[1], a = t[2], o = t[3];
|
|
413
|
+
let s = o, l = `group flex border-b border-border/30 hover:bg-accent/30 ${a ? "bg-destructive/5" : s ? "bg-yellow-500/5" : ""}`, u = r + 1, d;
|
|
414
|
+
t[5] === u ? d = t[6] : (d = /* @__PURE__ */ jsx("span", {
|
|
415
|
+
className: "w-10 shrink-0 select-none border-r border-border/30 px-2 py-0.5 text-right text-[10px] text-muted-foreground/50",
|
|
416
|
+
children: u
|
|
417
|
+
}), t[5] = u, t[6] = d);
|
|
418
|
+
let f = `flex-1 px-3 py-0.5 text-[11px] leading-5 font-mono ${a ? "text-destructive" : s ? "text-yellow-600 dark:text-yellow-400" : ""}`, p;
|
|
419
|
+
t[7] !== i || t[8] !== f ? (p = /* @__PURE__ */ jsx("span", {
|
|
420
|
+
className: f,
|
|
421
|
+
children: i
|
|
422
|
+
}), t[7] = i, t[8] = f, t[9] = p) : p = t[9];
|
|
423
|
+
let m;
|
|
424
|
+
return t[10] !== l || t[11] !== d || t[12] !== p ? (m = /* @__PURE__ */ jsxs("div", {
|
|
425
|
+
className: l,
|
|
426
|
+
children: [d, p]
|
|
427
|
+
}), t[10] = l, t[11] = d, t[12] = p, t[13] = m) : m = t[13], m;
|
|
428
|
+
}
|
|
429
|
+
function EmbedLogsContent() {
|
|
430
|
+
let e = useRef(null), t = useQuery({
|
|
431
|
+
queryKey: ["remote-agent-app-logs"],
|
|
432
|
+
queryFn: async () => {
|
|
433
|
+
let e = await fetch("http://localhost:8000/api/v1/app/logs?lines=200", { credentials: "include" });
|
|
434
|
+
if (!e.ok) {
|
|
435
|
+
let t = await e.text();
|
|
436
|
+
throw Error(`Failed to fetch logs (${e.status}): ${t}`);
|
|
437
|
+
}
|
|
438
|
+
return await e.json();
|
|
439
|
+
},
|
|
440
|
+
refetchInterval: 5e3
|
|
441
|
+
});
|
|
442
|
+
useEffect(() => {
|
|
443
|
+
e.current?.scrollIntoView({ behavior: "smooth" });
|
|
444
|
+
}, [t.data]);
|
|
445
|
+
let n = useMemo(() => {
|
|
446
|
+
let e = [];
|
|
447
|
+
return t.data?.stdout && e.push(t.data.stdout), t.data?.stderr && e.push(t.data.stderr), e.join("\n").split("\n").filter((e) => e.length > 0);
|
|
448
|
+
}, [t.data]);
|
|
449
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
450
|
+
className: "flex h-full flex-col",
|
|
451
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
452
|
+
className: "flex h-9 shrink-0 items-center justify-between border-b bg-muted/30 px-3",
|
|
453
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
454
|
+
className: "text-xs font-medium text-muted-foreground",
|
|
455
|
+
children: "Application Logs"
|
|
456
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
457
|
+
onClick: () => void t.refetch(),
|
|
458
|
+
className: `text-muted-foreground hover:text-foreground rounded-md p-1 transition-colors hover:cursor-pointer ${t.isFetching ? "animate-spin" : ""}`,
|
|
459
|
+
children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-3 w-3" })
|
|
460
|
+
})]
|
|
461
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
462
|
+
className: "flex-1 overflow-auto bg-background",
|
|
463
|
+
children: t.isLoading && !t.data ? /* @__PURE__ */ jsx("div", {
|
|
464
|
+
className: "flex justify-center py-8",
|
|
465
|
+
children: /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground h-4 w-4 animate-spin" })
|
|
466
|
+
}) : t.error ? /* @__PURE__ */ jsx("div", {
|
|
467
|
+
className: "px-4 py-3",
|
|
468
|
+
children: /* @__PURE__ */ jsxs("p", {
|
|
469
|
+
className: "text-sm text-destructive",
|
|
470
|
+
children: ["Error: ", t.error.message]
|
|
471
|
+
})
|
|
472
|
+
}) : n.length > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
473
|
+
className: "font-mono",
|
|
474
|
+
children: [n.map((e, t) => /* @__PURE__ */ jsx(LogLine, {
|
|
475
|
+
line: e,
|
|
476
|
+
index: t
|
|
477
|
+
}, t)), /* @__PURE__ */ jsx("div", { ref: e })]
|
|
478
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
479
|
+
className: "flex flex-col items-center justify-center gap-2 py-8 text-muted-foreground",
|
|
480
|
+
children: [/* @__PURE__ */ jsx(ScrollText, { className: "h-5 w-5" }), /* @__PURE__ */ jsx("span", {
|
|
481
|
+
className: "text-xs",
|
|
482
|
+
children: "No logs available"
|
|
483
|
+
})]
|
|
484
|
+
})
|
|
485
|
+
})]
|
|
486
|
+
});
|
|
390
487
|
}
|
|
391
488
|
function EmbedNavigationContent(e) {
|
|
392
489
|
let t = c(4), { pipelineId: n } = e, r = useNamespaceTree(n);
|