@loopstack/loopstack-studio 0.22.0 → 0.23.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 +20 -18
- package/dist/components/dynamic-form/Form.js +50 -27
- package/dist/components/dynamic-form/InputController.js +3 -1
- package/dist/components/dynamic-form/fields/MarkdownViewField.js +20 -0
- package/dist/components/feedback/ErrorBoundary.js +43 -0
- package/dist/components/{LoadingCentered.js → feedback/LoadingCentered.js} +1 -1
- package/dist/components/feedback/index.js +5 -0
- package/dist/components/index.js +6 -3
- package/dist/components/layout/MainLayout.js +32 -16
- package/dist/components/layout/StudioSidebar.js +165 -0
- package/dist/components/ui-widgets/widgets/SandboxRun.js +1 -0
- package/dist/features/code-explorer/CodeExplorer.js +6 -0
- package/dist/features/code-explorer/components/CodeExplorerTree.js +5 -0
- package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +82 -0
- package/dist/features/code-explorer/components/FileContentViewer.js +1 -0
- 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 +4 -0
- 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/ConfigFlowViewer.js +1 -1
- package/dist/features/debug/components/PipelineFlowViewer.js +47 -46
- package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +19 -19
- package/dist/features/debug/index.js +3 -0
- package/dist/features/documents/DocumentRenderer.js +58 -0
- package/dist/features/{workbench → documents}/components/DocumentItem.js +1 -1
- package/dist/features/{workbench → documents}/components/DocumentMetadataPills.js +2 -2
- package/dist/features/{workbench/components → documents}/document-details/DocumentDetails.js +3 -3
- package/dist/features/{workbench/components → documents}/document-details/PromptDetails.js +3 -3
- package/dist/features/documents/index.js +4 -0
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessage.js +5 -5
- package/dist/features/documents/renderers/ClaudeMessage.js +96 -0
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentDebugRenderer.js +1 -1
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentFormRenderer.js +3 -3
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentMessageRenderer.js +1 -1
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/ErrorMessageRenderer.js +1 -1
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/LinkMessageRenderer.js +1 -1
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/MarkdownMessageRenderer.js +2 -2
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/PlainMessageRenderer.js +1 -1
- package/dist/features/health/index.js +1 -0
- package/dist/features/workbench/NavigationItems.js +29 -29
- package/dist/features/workbench/Workbench.js +71 -99
- package/dist/features/workbench/WorkflowItem.js +63 -55
- package/dist/features/workbench/WorkflowList.js +52 -81
- package/dist/features/workbench/components/NewRunDialog.js +2 -1
- 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 +60 -0
- package/dist/features/workbench/components/WorkbenchFlowPanel.js +4 -3
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +37 -29
- package/dist/features/workbench/components/WorkflowHistoryItem.js +11 -11
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +49 -50
- package/dist/features/workbench/hooks/useWorkflowData.js +49 -0
- package/dist/features/workbench/hooks/useWorkflowListState.js +50 -0
- package/dist/features/workbench/index.js +8 -0
- package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +145 -0
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +47 -45
- package/dist/features/workspaces/components/CreateWorkspace.js +1 -1
- package/dist/features/workspaces/components/ExecutionTimeline.js +1 -1
- package/dist/features/workspaces/components/PipelineForm.js +2 -2
- package/dist/features/workspaces/components/WorkspaceHomePage.js +93 -0
- package/dist/features/workspaces/index.js +3 -0
- package/dist/hooks/index.js +3 -2
- package/dist/hooks/query-keys.js +138 -0
- package/dist/hooks/useAuth.js +43 -42
- package/dist/hooks/useConfig.js +31 -35
- package/dist/hooks/useDashboard.js +9 -13
- package/dist/hooks/useDebounce.js +8 -17
- package/dist/hooks/useDocuments.js +4 -9
- package/dist/hooks/useFiles.js +1 -51
- package/dist/hooks/useNamespaces.js +2 -8
- package/dist/hooks/usePipelines.js +132 -155
- package/dist/hooks/useProcessor.js +11 -14
- package/dist/hooks/useWorkflows.js +40 -62
- package/dist/hooks/useWorkspaces.js +105 -110
- package/dist/index.d.ts +105 -3
- package/dist/index.js +15 -7
- package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
- package/dist/pages/DashboardPage.js +1 -1
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
- package/dist/pages/EmbedWorkbenchPage.js +4 -3
- package/dist/pages/PipelineDebugPage.js +6 -5
- package/dist/pages/PreviewWorkbenchPage.js +228 -128
- package/dist/pages/RunsListPage.js +52 -24
- package/dist/pages/StudioLandingPage.js +1 -0
- package/dist/pages/WorkbenchPage.js +3 -2
- package/dist/pages/WorkspacePage.js +103 -51
- package/dist/pages/WorkspaceRunsPage.js +71 -0
- package/dist/providers/InvalidationEventsProvider.js +9 -11
- package/dist/providers/StudioProvider.js +2 -2
- package/dist/routing/LocalRouter.js +18 -8
- package/package.json +2 -2
- package/dist/features/workbench/components/DocumentRenderer.js +0 -54
- /package/dist/components/{content → feedback}/ErrorAlert.js +0 -0
- /package/dist/components/{snackbars → feedback}/ErrorSnackbar.js +0 -0
- /package/dist/components/{snackbars → feedback}/Snackbar.js +0 -0
- /package/dist/features/{workbench → documents}/components/DocumentList.js +0 -0
- /package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessageContent.js +0 -0
|
@@ -2,32 +2,34 @@ import { StudioProvider } from "../providers/StudioProvider.js";
|
|
|
2
2
|
import { SseProvider } from "../providers/SseProvider.js";
|
|
3
3
|
import { InvalidationEventsProvider } from "../providers/InvalidationEventsProvider.js";
|
|
4
4
|
import { useRouter } from "../routing/LocalRouter.js";
|
|
5
|
+
import LocalHealthCheck_default from "../features/health/LocalHealthCheck.js";
|
|
5
6
|
import { QueryProvider } from "../providers/QueryProvider.js";
|
|
6
7
|
import { c } from "react/compiler-runtime";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { Outlet, useSearchParams } from "react-router-dom";
|
|
9
10
|
function EnvironmentEmbedRoot() {
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
let
|
|
15
|
-
|
|
11
|
+
let f = c(14), [p] = useSearchParams(), m;
|
|
12
|
+
f[0] === p ? m = f[1] : (m = p.get("url") ?? "http://localhost:3080", f[0] = p, f[1] = m);
|
|
13
|
+
let h = m, g;
|
|
14
|
+
f[2] === p ? g = f[3] : (g = p.get("name") ?? "Preview Environment", f[2] = p, f[3] = g);
|
|
15
|
+
let _ = g, v;
|
|
16
|
+
f[4] !== _ || f[5] !== h ? (v = {
|
|
16
17
|
id: "preview-env",
|
|
17
|
-
name:
|
|
18
|
-
url:
|
|
19
|
-
},
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
let
|
|
23
|
-
return
|
|
24
|
-
router:
|
|
25
|
-
environment:
|
|
18
|
+
name: _,
|
|
19
|
+
url: h
|
|
20
|
+
}, f[4] = _, f[5] = h, f[6] = v) : v = f[6];
|
|
21
|
+
let y = v, b = useRouter(y.id, "/embed/env"), x, S, C, w;
|
|
22
|
+
f[7] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ jsx(LocalHealthCheck_default, {}), S = /* @__PURE__ */ jsx(SseProvider, {}), C = /* @__PURE__ */ jsx(InvalidationEventsProvider, {}), w = /* @__PURE__ */ jsx(Outlet, {}), f[7] = x, f[8] = S, f[9] = C, f[10] = w) : (x = f[7], S = f[8], C = f[9], w = f[10]);
|
|
23
|
+
let T;
|
|
24
|
+
return f[11] !== y || f[12] !== b ? (T = /* @__PURE__ */ jsx(QueryProvider, { children: /* @__PURE__ */ jsxs(StudioProvider, {
|
|
25
|
+
router: b,
|
|
26
|
+
environment: y,
|
|
26
27
|
children: [
|
|
27
|
-
b,
|
|
28
28
|
x,
|
|
29
|
-
S
|
|
29
|
+
S,
|
|
30
|
+
C,
|
|
31
|
+
w
|
|
30
32
|
]
|
|
31
|
-
}) }),
|
|
33
|
+
}) }), f[11] = y, f[12] = b, f[13] = T) : T = f[13], T;
|
|
32
34
|
}
|
|
33
35
|
export { EnvironmentEmbedRoot as default };
|
|
@@ -1,35 +1,58 @@
|
|
|
1
1
|
import { FormElementHeader } from "./FormElementHeader.js";
|
|
2
2
|
import FormBody_default from "./FormBody.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
|
-
import React from "react";
|
|
4
|
+
import React, { useEffect } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
6
|
+
function extractSchemaDefaults(e) {
|
|
7
|
+
if (e.default !== void 0) return e.default;
|
|
8
|
+
if (e.properties) {
|
|
9
|
+
let i = {}, a = !1;
|
|
10
|
+
for (let [o, s] of Object.entries(e.properties)) if (s.default !== void 0) i[o] = s.default, a = !0;
|
|
11
|
+
else if (s.type === "object" && s.properties) {
|
|
12
|
+
let e = extractSchemaDefaults(s);
|
|
13
|
+
e !== void 0 && (i[o] = e, a = !0);
|
|
14
|
+
}
|
|
15
|
+
return a ? i : void 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
var Form_default = (o) => {
|
|
19
|
+
let l = c(25), { form: u, schema: d, ui: f, mimeType: p, disabled: m, viewOnly: h, actions: g } = o, _ = f, v = d, y;
|
|
20
|
+
l[0] !== u || l[1] !== v ? (y = () => {
|
|
21
|
+
let e = extractSchemaDefaults(v);
|
|
22
|
+
if (e) {
|
|
23
|
+
let i = u.getValues(), a = { ...e };
|
|
24
|
+
for (let [e, o] of Object.entries(i)) o !== void 0 && o !== "" && o !== null && (a[e] = o);
|
|
25
|
+
u.reset(a);
|
|
26
|
+
}
|
|
27
|
+
}, l[0] = u, l[1] = v, l[2] = y) : y = l[2];
|
|
28
|
+
let b;
|
|
29
|
+
l[3] === d ? b = l[4] : (b = [d], l[3] = d, l[4] = b), useEffect(y, b);
|
|
30
|
+
let x = _?.form?.title, S = _?.form?.description, C;
|
|
31
|
+
l[5] !== m || l[6] !== x || l[7] !== S ? (C = /* @__PURE__ */ jsx(FormElementHeader, {
|
|
32
|
+
title: x,
|
|
33
|
+
description: S,
|
|
34
|
+
disabled: m
|
|
35
|
+
}), l[5] = m, l[6] = x, l[7] = S, l[8] = C) : C = l[8];
|
|
36
|
+
let w = d, T = f?.form, E;
|
|
37
|
+
l[9] !== m || l[10] !== u || l[11] !== p || l[12] !== w || l[13] !== T || l[14] !== h ? (E = /* @__PURE__ */ jsx(FormBody_default, {
|
|
38
|
+
form: u,
|
|
39
|
+
mimeType: p,
|
|
40
|
+
schema: w,
|
|
41
|
+
ui: T,
|
|
42
|
+
disabled: m,
|
|
43
|
+
viewOnly: h
|
|
44
|
+
}), l[9] = m, l[10] = u, l[11] = p, l[12] = w, l[13] = T, l[14] = h, l[15] = E) : E = l[15];
|
|
45
|
+
let D;
|
|
46
|
+
l[16] !== g || l[17] !== h ? (D = !h && !!g && /* @__PURE__ */ jsx("div", {
|
|
24
47
|
className: "mt-4 flex w-full justify-end",
|
|
25
|
-
children:
|
|
26
|
-
}),
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
let
|
|
30
|
-
return
|
|
48
|
+
children: g
|
|
49
|
+
}), l[16] = g, l[17] = h, l[18] = D) : D = l[18];
|
|
50
|
+
let O;
|
|
51
|
+
l[19] !== E || l[20] !== D ? (O = /* @__PURE__ */ jsxs("form", { children: [E, D] }), l[19] = E, l[20] = D, l[21] = O) : O = l[21];
|
|
52
|
+
let k;
|
|
53
|
+
return l[22] !== O || l[23] !== C ? (k = /* @__PURE__ */ jsxs("div", {
|
|
31
54
|
className: "container mx-auto",
|
|
32
|
-
children: [
|
|
33
|
-
}),
|
|
55
|
+
children: [C, O]
|
|
56
|
+
}), l[22] = O, l[23] = C, l[24] = k) : k = l[24], k;
|
|
34
57
|
};
|
|
35
58
|
export { Form_default as default };
|
|
@@ -2,6 +2,7 @@ import { InputField } from "./fields/InputField.js";
|
|
|
2
2
|
import { TextareaField } from "./fields/TextareaField.js";
|
|
3
3
|
import { CheckboxField } from "./fields/CheckboxField.js";
|
|
4
4
|
import { CodeViewField } from "./fields/CodeViewField.js";
|
|
5
|
+
import { MarkdownViewField } from "./fields/MarkdownViewField.js";
|
|
5
6
|
import { RadioField } from "./fields/RadioField.js";
|
|
6
7
|
import { SelectField } from "./fields/SelectField.js";
|
|
7
8
|
import { SliderField } from "./fields/SliderField.js";
|
|
@@ -17,7 +18,8 @@ var WIDGET_REGISTRY = {
|
|
|
17
18
|
slider: SliderField,
|
|
18
19
|
text: InputField,
|
|
19
20
|
textarea: TextareaField,
|
|
20
|
-
"code-view": CodeViewField
|
|
21
|
+
"code-view": CodeViewField,
|
|
22
|
+
"markdown-view": MarkdownViewField
|
|
21
23
|
}, WIDGET_NAMES = Object.keys(WIDGET_REGISTRY), resolveWidgetType = (e, o) => {
|
|
22
24
|
if (o && WIDGET_NAMES.includes(o)) return o;
|
|
23
25
|
let s = e;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import MarkdownContent_default from "../MarkdownContent.js";
|
|
2
|
+
import { useFieldConfig } from "../hooks/useFieldConfig.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Controller } from "react-hook-form";
|
|
7
|
+
const MarkdownViewField = (e) => {
|
|
8
|
+
let o = c(4), { name: s, schema: l, ui: u, form: d, disabled: f } = e, p = useFieldConfig(s, l, u, f).defaultValue || "", m;
|
|
9
|
+
return o[0] !== d.control || o[1] !== s || o[2] !== p ? (m = /* @__PURE__ */ jsx(Controller, {
|
|
10
|
+
name: s,
|
|
11
|
+
control: d.control,
|
|
12
|
+
defaultValue: p,
|
|
13
|
+
render: _temp
|
|
14
|
+
}), o[0] = d.control, o[1] = s, o[2] = p, o[3] = m) : m = o[3], m;
|
|
15
|
+
};
|
|
16
|
+
function _temp(i) {
|
|
17
|
+
let { field: a } = i;
|
|
18
|
+
return /* @__PURE__ */ jsx(MarkdownContent_default, { content: String(a.value ?? "") });
|
|
19
|
+
}
|
|
20
|
+
export { MarkdownViewField };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Button } from "../ui/button.js";
|
|
2
|
+
import { Alert, AlertDescription, AlertTitle } from "../ui/alert.js";
|
|
3
|
+
import { Component } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { AlertCircle } from "lucide-react";
|
|
6
|
+
var ErrorBoundary = class extends Component {
|
|
7
|
+
state = {
|
|
8
|
+
hasError: !1,
|
|
9
|
+
error: null
|
|
10
|
+
};
|
|
11
|
+
static getDerivedStateFromError(e) {
|
|
12
|
+
return {
|
|
13
|
+
hasError: !0,
|
|
14
|
+
error: e
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
componentDidCatch(e, c) {}
|
|
18
|
+
handleRetry = () => {
|
|
19
|
+
this.props.onRetry ? this.props.onRetry() : this.setState({
|
|
20
|
+
hasError: !1,
|
|
21
|
+
error: null
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
render() {
|
|
25
|
+
return this.state.hasError && this.state.error ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ jsxs("div", {
|
|
26
|
+
className: "flex min-h-[200px] flex-col items-center justify-center gap-4 p-6",
|
|
27
|
+
children: [/* @__PURE__ */ jsxs(Alert, {
|
|
28
|
+
variant: "destructive",
|
|
29
|
+
className: "max-w-lg",
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" }),
|
|
32
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Something went wrong" }),
|
|
33
|
+
/* @__PURE__ */ jsxs(AlertDescription, { children: [this.state.error.message, !1] })
|
|
34
|
+
]
|
|
35
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
36
|
+
onClick: this.handleRetry,
|
|
37
|
+
variant: "outline",
|
|
38
|
+
children: "Try again"
|
|
39
|
+
})]
|
|
40
|
+
}) : this.props.children;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export { ErrorBoundary };
|
package/dist/components/index.js
CHANGED
|
@@ -40,6 +40,9 @@ import { DataList } from "./data-table/DataList.js";
|
|
|
40
40
|
import ListView_default from "./lists/ListView.js";
|
|
41
41
|
import CustomListView_default from "./lists/CustomListView.js";
|
|
42
42
|
import CompletionMessagePaper_default from "./messages/CompletionMessagePaper.js";
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
43
|
+
import { ErrorBoundary } from "./feedback/ErrorBoundary.js";
|
|
44
|
+
import LoadingCentered_default from "./feedback/LoadingCentered.js";
|
|
45
|
+
import Snackbar_default from "./feedback/Snackbar.js";
|
|
46
|
+
import ErrorSnackbar_default from "./feedback/ErrorSnackbar.js";
|
|
47
|
+
import ErrorAlert_default from "./feedback/ErrorAlert.js";
|
|
48
|
+
import "./feedback/index.js";
|
|
@@ -1,26 +1,42 @@
|
|
|
1
|
+
import { Separator } from "../ui/separator.js";
|
|
2
|
+
import { SidebarTrigger, useSidebar } from "../ui/sidebar.js";
|
|
1
3
|
import PageBreadcrumbs_default from "../page/PageBreadcrumbs.js";
|
|
2
4
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var SidebarTriggerSafe = () => {
|
|
7
|
+
try {
|
|
8
|
+
return useSidebar(), /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SidebarTrigger, { className: "-ml-1" }), /* @__PURE__ */ jsx(Separator, {
|
|
9
|
+
orientation: "vertical",
|
|
10
|
+
className: "mr-2 data-[orientation=vertical]:h-4"
|
|
11
|
+
})] });
|
|
12
|
+
} catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}, MainLayout_default = (e) => {
|
|
16
|
+
let o = c(11), { children: s, breadcrumbsData: l, headerMenu: u } = e, d;
|
|
17
|
+
o[0] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ jsx(SidebarTriggerSafe, {}), o[0] = d) : d = o[0];
|
|
12
18
|
let f;
|
|
13
|
-
|
|
19
|
+
o[1] === l ? f = o[2] : (f = /* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: "flex items-center gap-2",
|
|
21
|
+
children: [d, /* @__PURE__ */ jsx(PageBreadcrumbs_default, { breadcrumbData: l })]
|
|
22
|
+
}), o[1] = l, o[2] = f);
|
|
23
|
+
let p;
|
|
24
|
+
o[3] !== u || o[4] !== f ? (p = /* @__PURE__ */ jsxs("div", {
|
|
25
|
+
className: "border-b flex h-12 shrink-0 items-center justify-between gap-2 px-4",
|
|
26
|
+
children: [f, u]
|
|
27
|
+
}), o[3] = u, o[4] = f, o[5] = p) : p = o[5];
|
|
28
|
+
let m;
|
|
29
|
+
o[6] === s ? m = o[7] : (m = /* @__PURE__ */ jsx("div", {
|
|
14
30
|
className: "flex-1 overflow-auto p-4",
|
|
15
31
|
children: /* @__PURE__ */ jsx("div", {
|
|
16
32
|
className: "space-y-6",
|
|
17
|
-
children:
|
|
33
|
+
children: s
|
|
18
34
|
})
|
|
19
|
-
}),
|
|
20
|
-
let
|
|
21
|
-
return
|
|
35
|
+
}), o[6] = s, o[7] = m);
|
|
36
|
+
let h;
|
|
37
|
+
return o[8] !== p || o[9] !== m ? (h = /* @__PURE__ */ jsxs("div", {
|
|
22
38
|
className: "flex h-full flex-col",
|
|
23
|
-
children: [
|
|
24
|
-
}),
|
|
39
|
+
children: [p, m]
|
|
40
|
+
}), o[8] = p, o[9] = m, o[10] = h) : h = o[10], h;
|
|
25
41
|
};
|
|
26
42
|
export { MainLayout_default as default };
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { useStudio, useStudioOptional } from "../../providers/StudioProvider.js";
|
|
2
|
+
import { useFilterPipelines } from "../../hooks/usePipelines.js";
|
|
3
|
+
import { useComponentOverrides } from "../../providers/ComponentOverridesProvider.js";
|
|
4
|
+
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarTrigger, useSidebar } from "../ui/sidebar.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Link, useLocation } from "react-router-dom";
|
|
8
|
+
import { CircleAlert, Info, LayoutDashboard, LayoutGrid, Play, Workflow } from "lucide-react";
|
|
9
|
+
var DefaultSidebarHeader = () => {
|
|
10
|
+
let e = c(5), { state: u } = useSidebar(), d;
|
|
11
|
+
e[0] === u ? d = e[1] : (d = u === "expanded" && /* @__PURE__ */ jsxs("div", {
|
|
12
|
+
className: "flex items-center gap-2 px-1.5",
|
|
13
|
+
children: [/* @__PURE__ */ jsx("img", {
|
|
14
|
+
src: "/loopstack.svg",
|
|
15
|
+
alt: "Loopstack",
|
|
16
|
+
className: "h-6 w-6"
|
|
17
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
18
|
+
className: "text-sm font-semibold",
|
|
19
|
+
children: "Loopstack Studio"
|
|
20
|
+
})]
|
|
21
|
+
}), e[0] = u, e[1] = d);
|
|
22
|
+
let f;
|
|
23
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ jsx(SidebarTrigger, { className: "hover:cursor-pointer" }), e[2] = f) : f = e[2];
|
|
24
|
+
let p;
|
|
25
|
+
return e[3] === d ? p = e[4] : (p = /* @__PURE__ */ jsxs(SidebarHeader, {
|
|
26
|
+
className: "border-sidebar-border h-12 w-full flex-row items-center justify-between border-b px-1.5 py-0",
|
|
27
|
+
children: [d, f]
|
|
28
|
+
}), e[3] = d, e[4] = p), p;
|
|
29
|
+
}, RunsNav = () => {
|
|
30
|
+
let u = c(26), f = useLocation(), { router: p } = useStudio(), m = p.getRuns(), h;
|
|
31
|
+
u[0] === p ? h = u[1] : (h = p.getRunsActionRequired(), u[0] = p, u[1] = h);
|
|
32
|
+
let y = h, C;
|
|
33
|
+
u[2] === Symbol.for("react.memo_cache_sentinel") ? (C = {
|
|
34
|
+
parentId: null,
|
|
35
|
+
status: "paused"
|
|
36
|
+
}, u[2] = C) : C = u[2];
|
|
37
|
+
let w = useFilterPipelines(void 0, C, "createdAt", "DESC", 0, 1).data?.total ?? 0, T;
|
|
38
|
+
u[3] === Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Runs" }), u[3] = T) : T = u[3];
|
|
39
|
+
let E = f.pathname === m || f.pathname === m + "/", D, O;
|
|
40
|
+
u[4] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ jsx(Play, {}), O = /* @__PURE__ */ jsx("span", { children: "Overview" }), u[4] = D, u[5] = O) : (D = u[4], O = u[5]);
|
|
41
|
+
let k;
|
|
42
|
+
u[6] === m ? k = u[7] : (k = /* @__PURE__ */ jsxs(Link, {
|
|
43
|
+
to: m,
|
|
44
|
+
children: [D, O]
|
|
45
|
+
}), u[6] = m, u[7] = k);
|
|
46
|
+
let A;
|
|
47
|
+
u[8] !== E || u[9] !== k ? (A = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
48
|
+
asChild: !0,
|
|
49
|
+
isActive: E,
|
|
50
|
+
tooltip: "Overview",
|
|
51
|
+
children: k
|
|
52
|
+
}) }), u[8] = E, u[9] = k, u[10] = A) : A = u[10];
|
|
53
|
+
let j = f.pathname === y, M, N;
|
|
54
|
+
u[11] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ jsx(CircleAlert, {}), M = /* @__PURE__ */ jsx("span", { children: "Action Required" }), u[11] = M, u[12] = N) : (M = u[11], N = u[12]);
|
|
55
|
+
let P;
|
|
56
|
+
u[13] === y ? P = u[14] : (P = /* @__PURE__ */ jsxs(Link, {
|
|
57
|
+
to: y,
|
|
58
|
+
children: [N, M]
|
|
59
|
+
}), u[13] = y, u[14] = P);
|
|
60
|
+
let F;
|
|
61
|
+
u[15] !== P || u[16] !== j ? (F = /* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
62
|
+
asChild: !0,
|
|
63
|
+
isActive: j,
|
|
64
|
+
tooltip: "Action Required",
|
|
65
|
+
children: P
|
|
66
|
+
}), u[15] = P, u[16] = j, u[17] = F) : F = u[17];
|
|
67
|
+
let I;
|
|
68
|
+
u[18] === w ? I = u[19] : (I = w > 0 && /* @__PURE__ */ jsx(SidebarMenuBadge, { children: w }), u[18] = w, u[19] = I);
|
|
69
|
+
let L;
|
|
70
|
+
u[20] !== F || u[21] !== I ? (L = /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [F, I] }), u[20] = F, u[21] = I, u[22] = L) : L = u[22];
|
|
71
|
+
let R;
|
|
72
|
+
return u[23] !== L || u[24] !== A ? (R = /* @__PURE__ */ jsxs(SidebarGroup, { children: [T, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxs(SidebarMenu, { children: [A, L] }) })] }), u[23] = L, u[24] = A, u[25] = R) : R = u[25], R;
|
|
73
|
+
}, WorkspacesNav = () => {
|
|
74
|
+
let u = c(11), d = useLocation(), { router: f } = useStudio(), p = f.getWorkspaces(), m;
|
|
75
|
+
u[0] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Workspaces" }), u[0] = m) : m = u[0];
|
|
76
|
+
let h;
|
|
77
|
+
u[1] !== d.pathname || u[2] !== p ? (h = d.pathname === p || d.pathname.startsWith(p + "/"), u[1] = d.pathname, u[2] = p, u[3] = h) : h = u[3];
|
|
78
|
+
let y, x;
|
|
79
|
+
u[4] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ jsx(LayoutGrid, {}), x = /* @__PURE__ */ jsx("span", { children: "My Workspaces" }), u[4] = y, u[5] = x) : (y = u[4], x = u[5]);
|
|
80
|
+
let C;
|
|
81
|
+
u[6] === p ? C = u[7] : (C = /* @__PURE__ */ jsxs(Link, {
|
|
82
|
+
to: p,
|
|
83
|
+
children: [y, x]
|
|
84
|
+
}), u[6] = p, u[7] = C);
|
|
85
|
+
let w;
|
|
86
|
+
return u[8] !== h || u[9] !== C ? (w = /* @__PURE__ */ jsxs(SidebarGroup, { children: [m, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
87
|
+
asChild: !0,
|
|
88
|
+
isActive: h,
|
|
89
|
+
tooltip: "My Workspaces",
|
|
90
|
+
children: C
|
|
91
|
+
}) }) }) })] }), u[8] = h, u[9] = C, u[10] = w) : w = u[10], w;
|
|
92
|
+
}, InsightsNav = () => {
|
|
93
|
+
let u = c(15), d = useLocation(), { router: f } = useStudio(), p;
|
|
94
|
+
u[0] === f ? p = u[1] : (p = f.getDashboard(), u[0] = f, u[1] = p);
|
|
95
|
+
let m;
|
|
96
|
+
u[2] === p ? m = u[3] : (m = {
|
|
97
|
+
label: "Dashboard",
|
|
98
|
+
href: p,
|
|
99
|
+
icon: LayoutDashboard
|
|
100
|
+
}, u[2] = p, u[3] = m);
|
|
101
|
+
let h;
|
|
102
|
+
u[4] === f ? h = u[5] : (h = f.getDebugWorkflows(), u[4] = f, u[5] = h);
|
|
103
|
+
let y;
|
|
104
|
+
u[6] === h ? y = u[7] : (y = {
|
|
105
|
+
label: "Workflows",
|
|
106
|
+
href: h,
|
|
107
|
+
icon: Workflow
|
|
108
|
+
}, u[6] = h, u[7] = y);
|
|
109
|
+
let x;
|
|
110
|
+
u[8] !== m || u[9] !== y ? (x = [m, y], u[8] = m, u[9] = y, u[10] = x) : x = u[10];
|
|
111
|
+
let C = x, w;
|
|
112
|
+
u[11] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Insights" }), u[11] = w) : w = u[11];
|
|
113
|
+
let T;
|
|
114
|
+
return u[12] !== d || u[13] !== C ? (T = /* @__PURE__ */ jsxs(SidebarGroup, { children: [w, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: C.map((e) => /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
115
|
+
asChild: !0,
|
|
116
|
+
isActive: d.pathname === e.href,
|
|
117
|
+
tooltip: e.label,
|
|
118
|
+
children: /* @__PURE__ */ jsxs(Link, {
|
|
119
|
+
to: e.href,
|
|
120
|
+
children: [/* @__PURE__ */ jsx(e.icon, {}), /* @__PURE__ */ jsx("span", { children: e.label })]
|
|
121
|
+
})
|
|
122
|
+
}) }, e.href)) }) })] }), u[12] = d, u[13] = C, u[14] = T) : T = u[14], T;
|
|
123
|
+
}, DefaultSidebarFooter = () => {
|
|
124
|
+
let u = c(9), d = useLocation(), { router: f } = useStudio(), p;
|
|
125
|
+
u[0] === f ? p = u[1] : (p = f.getEnvironmentInfo(), u[0] = f, u[1] = p);
|
|
126
|
+
let m = p, g = d.pathname === m, _, v;
|
|
127
|
+
u[2] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx(Info, {}), v = /* @__PURE__ */ jsx("span", { children: "Info" }), u[2] = _, u[3] = v) : (_ = u[2], v = u[3]);
|
|
128
|
+
let y;
|
|
129
|
+
u[4] === m ? y = u[5] : (y = /* @__PURE__ */ jsxs(Link, {
|
|
130
|
+
to: m,
|
|
131
|
+
children: [_, v]
|
|
132
|
+
}), u[4] = m, u[5] = y);
|
|
133
|
+
let x;
|
|
134
|
+
return u[6] !== g || u[7] !== y ? (x = /* @__PURE__ */ jsx(SidebarFooter, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
135
|
+
asChild: !0,
|
|
136
|
+
isActive: g,
|
|
137
|
+
size: "sm",
|
|
138
|
+
tooltip: "Info",
|
|
139
|
+
children: y
|
|
140
|
+
}) }) }) }), u[6] = g, u[7] = y, u[8] = x) : x = u[8], x;
|
|
141
|
+
};
|
|
142
|
+
const StudioSidebar = () => {
|
|
143
|
+
let e = c(13), d = useComponentOverrides(), h = useStudioOptional(), g = d.SidebarHeader ?? DefaultSidebarHeader, _ = d.SidebarFooter ?? DefaultSidebarFooter, v;
|
|
144
|
+
e[0] === g ? v = e[1] : (v = /* @__PURE__ */ jsx(g, {}), e[0] = g, e[1] = v);
|
|
145
|
+
let y;
|
|
146
|
+
e[2] === h ? y = e[3] : (y = h && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
147
|
+
/* @__PURE__ */ jsx(RunsNav, {}),
|
|
148
|
+
/* @__PURE__ */ jsx(WorkspacesNav, {}),
|
|
149
|
+
/* @__PURE__ */ jsx(InsightsNav, {})
|
|
150
|
+
] }), e[2] = h, e[3] = y);
|
|
151
|
+
let b;
|
|
152
|
+
e[4] === y ? b = e[5] : (b = /* @__PURE__ */ jsx(SidebarContent, { children: y }), e[4] = y, e[5] = b);
|
|
153
|
+
let x;
|
|
154
|
+
e[6] !== _ || e[7] !== h ? (x = h && /* @__PURE__ */ jsx(_, {}), e[6] = _, e[7] = h, e[8] = x) : x = e[8];
|
|
155
|
+
let S;
|
|
156
|
+
return e[9] !== v || e[10] !== b || e[11] !== x ? (S = /* @__PURE__ */ jsxs(Sidebar, {
|
|
157
|
+
collapsible: "icon",
|
|
158
|
+
children: [
|
|
159
|
+
v,
|
|
160
|
+
b,
|
|
161
|
+
x
|
|
162
|
+
]
|
|
163
|
+
}), e[9] = v, e[10] = b, e[11] = x, e[12] = S) : S = e[12], S;
|
|
164
|
+
};
|
|
165
|
+
export { StudioSidebar };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Button } from "../../ui/button.js";
|
|
2
2
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../../ui/tooltip.js";
|
|
3
3
|
import { useWorkbenchLayout } from "../../../features/workbench/providers/WorkbenchLayoutProvider.js";
|
|
4
|
+
import "../../../features/workbench/index.js";
|
|
4
5
|
import { c } from "react/compiler-runtime";
|
|
5
6
|
import React from "react";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { Button } from "../../../components/ui/button.js";
|
|
3
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../components/ui/collapsible.js";
|
|
4
|
+
import { getFileIcon, getFolderIcon } from "../utils/fileIcons.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronDown, ChevronRight, X } from "lucide-react";
|
|
7
|
+
var INDENT_PX = 16, BASE_PADDING_PX = 8;
|
|
8
|
+
function CodeExplorerTreeNode({ node: h, depth: g, onSelectFile: _, onClearSelection: v, onCloseFile: y, isSelected: b = !1, selectedFileId: x, expandedFolders: S = /* @__PURE__ */ new Set(), toggleFolder: C }) {
|
|
9
|
+
let w = S.has(h.id), T = g * INDENT_PX + BASE_PADDING_PX, E = x === h.id || b;
|
|
10
|
+
if (h.type === "file") {
|
|
11
|
+
let m = getFileIcon(h.name);
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13
|
+
className: cn("flex w-full min-w-0 items-center gap-2 rounded-sm py-1 group", "text-muted-foreground", E && "bg-muted"),
|
|
14
|
+
style: { paddingLeft: T },
|
|
15
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
16
|
+
type: "button",
|
|
17
|
+
className: cn("flex flex-1 min-w-0 items-center gap-2 rounded-sm text-left text-sm hover:bg-muted/50", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),
|
|
18
|
+
onClick: () => _?.(h),
|
|
19
|
+
"aria-label": `Select file ${h.name}`,
|
|
20
|
+
children: [/* @__PURE__ */ jsx(m, {
|
|
21
|
+
className: "h-4 w-4 shrink-0 text-muted-foreground",
|
|
22
|
+
"aria-hidden": !0
|
|
23
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
24
|
+
className: "truncate",
|
|
25
|
+
children: h.name
|
|
26
|
+
})]
|
|
27
|
+
}), E && (y || v) && /* @__PURE__ */ jsx(Button, {
|
|
28
|
+
variant: "ghost",
|
|
29
|
+
size: "icon",
|
|
30
|
+
className: "h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
31
|
+
onClick: (e) => {
|
|
32
|
+
e.stopPropagation(), y ? y(h) : v && v();
|
|
33
|
+
},
|
|
34
|
+
"aria-label": "Close file",
|
|
35
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" })
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
let D = h.children && h.children.length > 0, O = getFolderIcon(w);
|
|
40
|
+
return /* @__PURE__ */ jsxs(Collapsible, {
|
|
41
|
+
open: w,
|
|
42
|
+
onOpenChange: () => {
|
|
43
|
+
C && C(h.id);
|
|
44
|
+
},
|
|
45
|
+
children: [/* @__PURE__ */ jsxs(CollapsibleTrigger, {
|
|
46
|
+
className: cn("flex w-full min-w-0 items-center gap-1 rounded-sm py-1 text-left text-sm hover:bg-muted", "text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:cursor-default disabled:opacity-50"),
|
|
47
|
+
style: { paddingLeft: T },
|
|
48
|
+
disabled: !D,
|
|
49
|
+
"aria-label": `${w ? "Collapse" : "Expand"} folder ${h.name}`,
|
|
50
|
+
children: [
|
|
51
|
+
D ? jsx(w ? ChevronDown : ChevronRight, {
|
|
52
|
+
className: "h-4 w-4 shrink-0",
|
|
53
|
+
"aria-hidden": !0
|
|
54
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
55
|
+
className: "w-4 shrink-0",
|
|
56
|
+
"aria-hidden": !0
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ jsx(O, {
|
|
59
|
+
className: "h-4 w-4 shrink-0 text-muted-foreground",
|
|
60
|
+
"aria-hidden": !0
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ jsx("span", {
|
|
63
|
+
className: "truncate",
|
|
64
|
+
children: h.name
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
}), D && /* @__PURE__ */ jsx(CollapsibleContent, {
|
|
68
|
+
className: "h-full",
|
|
69
|
+
children: h.children.map((e) => /* @__PURE__ */ jsx(CodeExplorerTreeNode, {
|
|
70
|
+
node: e,
|
|
71
|
+
depth: g + 1,
|
|
72
|
+
onSelectFile: _,
|
|
73
|
+
onClearSelection: v,
|
|
74
|
+
onCloseFile: y,
|
|
75
|
+
selectedFileId: x,
|
|
76
|
+
expandedFolders: S,
|
|
77
|
+
toggleFolder: C
|
|
78
|
+
}, e.id))
|
|
79
|
+
})]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export { CodeExplorerTreeNode };
|
|
@@ -4,6 +4,7 @@ import MarkdownContent_default from "../../../components/dynamic-form/MarkdownCo
|
|
|
4
4
|
import { ReactFlowProvider } from "../../../node_modules/@xyflow/react/dist/esm/index.js";
|
|
5
5
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../../components/ui/tabs.js";
|
|
6
6
|
import ConfigFlowViewer_default from "../../debug/components/ConfigFlowViewer.js";
|
|
7
|
+
import "../../debug/index.js";
|
|
7
8
|
import { c } from "react/compiler-runtime";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
import { Loader2 } from "lucide-react";
|