@loopstack/loopstack-studio 0.25.2 → 0.26.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/environments.js +4 -0
- package/dist/api/index.js +13 -9
- package/dist/app/EnvironmentEmbedRoot.js +29 -19
- package/dist/components/data-table/DataList.js +93 -91
- package/dist/components/data-table/DataTable.js +128 -126
- package/dist/components/feedback/Snackbar.js +1 -1
- package/dist/components/layout/StudioSidebar.js +124 -131
- package/dist/components/ui/sidebar.js +2 -2
- package/dist/components/ui/slider.js +37 -26
- package/dist/components/ui-widgets/widgets/SandboxRun.js +16 -14
- package/dist/features/code-explorer/components/CodeExplorerTree.js +1 -0
- package/dist/features/code-explorer/components/FileContentViewer.js +1 -1
- package/dist/features/dashboard/RunItem.js +39 -37
- package/dist/features/debug/lib/flow-utils.js +1 -1
- package/dist/features/documents/DocumentRenderer.js +59 -58
- package/dist/features/documents/renderers/useDocumentTransition.js +29 -24
- package/dist/features/feature-registry/FeatureRegistryProvider.js +17 -0
- package/dist/features/feature-registry/index.js +1 -0
- package/dist/features/file-explorer/api/files.js +7 -0
- package/dist/features/file-explorer/components/FileExplorerPanel.js +95 -0
- package/dist/features/{workbench/components/RemoteFileTabsBar.js → file-explorer/components/FileTabsBar.js} +4 -4
- package/dist/features/{workbench/components/RemoteFileTree.js → file-explorer/components/FileTree.js} +6 -6
- package/dist/features/file-explorer/file-explorer-feature.js +12 -0
- package/dist/features/file-explorer/hooks/useFileExplorer.js +44 -0
- package/dist/features/file-explorer/index.js +2 -0
- package/dist/features/file-explorer/providers/FileExplorerProvider.js +112 -0
- package/dist/features/oauth/OAuthPromptRenderer.js +162 -132
- package/dist/features/runs/Runs.js +1 -1
- package/dist/features/secrets/components/WorkbenchSecretsPanel.js +178 -0
- package/dist/features/secrets/index.js +1 -0
- package/dist/features/{documents → secrets}/renderers/SecretInputRenderer.js +17 -17
- package/dist/features/secrets/secrets-feature.js +14 -0
- package/dist/features/workbench/Workbench.js +32 -82
- package/dist/features/workbench/WorkflowList.js +109 -46
- package/dist/features/workbench/components/SidebarPanel.js +155 -0
- package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +82 -0
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +128 -60
- package/dist/features/workbench/components/WorkbenchPreviewPanel.js +127 -114
- package/dist/features/workbench/components/WorkbenchRunsPanel.js +32 -0
- package/dist/features/workbench/components/WorkbenchSidebarShell.js +80 -0
- package/dist/features/workbench/hooks/useWorkflowData.js +3 -3
- package/dist/features/workbench/index.js +3 -2
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +60 -62
- package/dist/features/workspaces/Workspaces.js +1 -1
- package/dist/features/workspaces/components/EnvironmentSlotSelector.js +68 -51
- package/dist/features/workspaces/components/WorkflowRunForm.js +1 -1
- package/dist/features/workspaces/components/WorkspaceHomePage.js +1 -1
- package/dist/hooks/useEnvironmentPreviewUrl.js +13 -0
- package/dist/hooks/useEnvironments.js +8 -0
- package/dist/hooks/useWorkflows.js +28 -26
- package/dist/hooks/useWorkspaces.js +28 -26
- package/dist/index.d.ts +98 -7
- package/dist/index.js +8 -1
- package/dist/loopstack-studio.css +1 -1
- package/dist/node_modules/@shikijs/core/dist/index.js +105 -643
- package/dist/node_modules/@shikijs/engine-oniguruma/dist/index.js +135 -122
- package/dist/node_modules/@shikijs/langs/dist/bird2.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/cobol.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/css.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/dart.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/emacs-lisp.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/es-tag-sql.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/go.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/kusto.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/nextflow-groovy.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/php.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/ruby.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/typespec.js +1 -1
- package/dist/node_modules/@shikijs/primitive/dist/index.js +538 -0
- package/dist/node_modules/@shikijs/themes/dist/horizon-bright.js +1 -1
- package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
- package/dist/node_modules/shiki/dist/bundle-full.js +6 -5
- package/dist/node_modules/shiki/dist/chunk-CtajNgzt.js +15 -0
- package/dist/node_modules/shiki/dist/engine-oniguruma.js +5 -0
- package/dist/node_modules/shiki/dist/{langs.js → langs-bundle-full-DfKZStlK.js} +1 -1
- package/dist/node_modules/shiki/dist/themes.js +1 -1
- package/dist/pages/DashboardPage.js +54 -79
- package/dist/pages/DebugWorkflowDetailsPage.js +41 -55
- package/dist/pages/DebugWorkflowsPage.js +151 -112
- package/dist/pages/EmbedWorkbenchPage.js +2 -1
- package/dist/pages/PreviewWorkbenchPage.js +77 -59
- package/dist/pages/RunsListPage.js +27 -41
- package/dist/pages/RunsPage.js +21 -36
- package/dist/pages/WorkbenchPage.js +48 -70
- package/dist/pages/WorkflowDebugPage.js +65 -79
- package/dist/pages/WorkspacePage.js +59 -86
- package/dist/pages/WorkspaceRunsPage.js +59 -54
- package/dist/pages/WorkspacesPage.js +11 -27
- package/dist/providers/StudioPreferencesProvider.js +54 -0
- package/package.json +29 -29
- package/dist/features/workbench/components/WorkbenchFilesPanel.js +0 -67
- package/dist/features/workbench/components/WorkbenchFloatingPanel.js +0 -57
- package/dist/features/workbench/components/WorkbenchFlowPanel.js +0 -47
- package/dist/features/workbench/components/WorkbenchSecretsPanel.js +0 -182
- package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +0 -160
- /package/dist/{node_modules → frontend/studio/node_modules}/@dagrejs/dagre/dist/dagre.esm.js +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Button } from "../../../components/ui/button.js";
|
|
2
|
+
import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
|
|
3
|
+
import { useResetEnvironment } from "../../../hooks/useEnvironments.js";
|
|
4
|
+
import { SidebarPanel } from "./SidebarPanel.js";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Loader2, RotateCcw, Server } from "lucide-react";
|
|
8
|
+
import { toast } from "sonner";
|
|
9
|
+
function WorkbenchEnvironmentPanel(d) {
|
|
10
|
+
let { panelSize: f, setPanelSize: p, closePanel: m } = useWorkbenchLayout(), h = d.workspaceId, g = useResetEnvironment(), [_, v] = useState(null), y = d.environments?.filter((e) => !!e.agentUrl) ?? [], b = async (e) => {
|
|
11
|
+
if (h) try {
|
|
12
|
+
await g.mutateAsync({
|
|
13
|
+
workspaceId: h,
|
|
14
|
+
slotId: e
|
|
15
|
+
}), toast.success("Environment reset successfully");
|
|
16
|
+
} catch {
|
|
17
|
+
toast.error("Failed to reset environment");
|
|
18
|
+
} finally {
|
|
19
|
+
v(null);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ jsx(SidebarPanel, {
|
|
23
|
+
icon: /* @__PURE__ */ jsx(Server, { className: "h-4 w-4" }),
|
|
24
|
+
title: "Environment",
|
|
25
|
+
description: "Manage remote environments for this workspace.",
|
|
26
|
+
size: f,
|
|
27
|
+
onSizeChange: p,
|
|
28
|
+
onClose: m,
|
|
29
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
30
|
+
className: "flex-1 overflow-y-auto px-4 py-3",
|
|
31
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
32
|
+
className: "space-y-2",
|
|
33
|
+
children: [y.map((u) => /* @__PURE__ */ jsxs("div", {
|
|
34
|
+
className: "bg-muted/50 rounded-md px-3 py-3",
|
|
35
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
36
|
+
className: "mb-2",
|
|
37
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
38
|
+
className: "text-sm font-medium",
|
|
39
|
+
children: u.envName || u.slotId
|
|
40
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
41
|
+
className: "text-muted-foreground text-xs",
|
|
42
|
+
children: u.type || "remote"
|
|
43
|
+
})]
|
|
44
|
+
}), _ === u.slotId ? /* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: "space-y-2",
|
|
46
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
47
|
+
className: "text-destructive text-xs",
|
|
48
|
+
children: "This will reset the environment to its initial state. All changes, files, database, and cache will be lost."
|
|
49
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
50
|
+
className: "flex gap-2",
|
|
51
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
52
|
+
size: "sm",
|
|
53
|
+
variant: "destructive",
|
|
54
|
+
className: "h-7 text-xs",
|
|
55
|
+
disabled: g.isPending,
|
|
56
|
+
onClick: () => void b(u.slotId),
|
|
57
|
+
children: [g.isPending ? /* @__PURE__ */ jsx(Loader2, { className: "mr-1 h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsx(RotateCcw, { className: "mr-1 h-3 w-3" }), "Confirm Reset"]
|
|
58
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
59
|
+
size: "sm",
|
|
60
|
+
variant: "ghost",
|
|
61
|
+
className: "h-7 text-xs",
|
|
62
|
+
disabled: g.isPending,
|
|
63
|
+
onClick: () => v(null),
|
|
64
|
+
children: "Cancel"
|
|
65
|
+
})]
|
|
66
|
+
})]
|
|
67
|
+
}) : /* @__PURE__ */ jsxs(Button, {
|
|
68
|
+
size: "sm",
|
|
69
|
+
variant: "outline",
|
|
70
|
+
className: "h-7 text-xs",
|
|
71
|
+
onClick: () => v(u.slotId),
|
|
72
|
+
children: [/* @__PURE__ */ jsx(RotateCcw, { className: "mr-1 h-3 w-3" }), "Reset Environment"]
|
|
73
|
+
})]
|
|
74
|
+
}, u.slotId)), y.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
75
|
+
className: "text-muted-foreground py-4 text-center text-sm",
|
|
76
|
+
children: "No remote environments configured."
|
|
77
|
+
})]
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export { WorkbenchEnvironmentPanel };
|
|
@@ -1,76 +1,144 @@
|
|
|
1
|
+
import { useStudio } from "../../../providers/StudioProvider.js";
|
|
1
2
|
import { cn } from "../../../lib/utils.js";
|
|
2
3
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/ui/tooltip.js";
|
|
4
|
+
import { useFeatureRegistry } from "../../feature-registry/FeatureRegistryProvider.js";
|
|
5
|
+
import "../../feature-registry/index.js";
|
|
3
6
|
import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
|
|
4
7
|
import { c } from "react/compiler-runtime";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
l
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Link, useLocation } from "react-router-dom";
|
|
10
|
+
import { Home, MonitorPlay, Play, Server } from "lucide-react";
|
|
11
|
+
function IconButton(e) {
|
|
12
|
+
let l = c(12), { icon: u, label: f, active: p, disabled: m, onClick: h } = e, g = m ? void 0 : h, _ = m ? "text-muted-foreground/40 cursor-not-allowed" : p ? "bg-foreground text-background hover:cursor-pointer" : "text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground hover:cursor-pointer", v;
|
|
13
|
+
l[0] === _ ? v = l[1] : (v = cn("flex h-10 w-10 items-center justify-center rounded-md transition-colors", _), l[0] = _, l[1] = v);
|
|
14
|
+
let y;
|
|
15
|
+
l[2] !== m || l[3] !== u || l[4] !== g || l[5] !== v ? (y = /* @__PURE__ */ jsx(TooltipTrigger, {
|
|
12
16
|
asChild: !0,
|
|
13
17
|
children: /* @__PURE__ */ jsx("button", {
|
|
14
|
-
onClick:
|
|
15
|
-
|
|
18
|
+
onClick: g,
|
|
19
|
+
disabled: m,
|
|
20
|
+
className: v,
|
|
16
21
|
children: u
|
|
17
22
|
})
|
|
18
|
-
}), l[2] =
|
|
19
|
-
let
|
|
20
|
-
l[
|
|
23
|
+
}), l[2] = m, l[3] = u, l[4] = g, l[5] = v, l[6] = y) : y = l[6];
|
|
24
|
+
let b;
|
|
25
|
+
l[7] === f ? b = l[8] : (b = /* @__PURE__ */ jsx(TooltipContent, {
|
|
21
26
|
side: "left",
|
|
22
|
-
children:
|
|
23
|
-
}), l[
|
|
27
|
+
children: f
|
|
28
|
+
}), l[7] = f, l[8] = b);
|
|
29
|
+
let x;
|
|
30
|
+
return l[9] !== y || l[10] !== b ? (x = /* @__PURE__ */ jsxs(Tooltip, { children: [y, b] }), l[9] = y, l[10] = b, l[11] = x) : x = l[11], x;
|
|
31
|
+
}
|
|
32
|
+
function IconLink(e) {
|
|
33
|
+
let l = c(11), { icon: u, label: p, to: m, active: h } = e, g = h ? "bg-foreground text-background" : "text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground", _;
|
|
34
|
+
l[0] === g ? _ = l[1] : (_ = cn("flex h-10 w-10 items-center justify-center rounded-md transition-colors", g), l[0] = g, l[1] = _);
|
|
24
35
|
let v;
|
|
25
|
-
|
|
36
|
+
l[2] !== u || l[3] !== _ || l[4] !== m ? (v = /* @__PURE__ */ jsx(TooltipTrigger, {
|
|
37
|
+
asChild: !0,
|
|
38
|
+
children: /* @__PURE__ */ jsx(Link, {
|
|
39
|
+
to: m,
|
|
40
|
+
className: _,
|
|
41
|
+
children: u
|
|
42
|
+
})
|
|
43
|
+
}), l[2] = u, l[3] = _, l[4] = m, l[5] = v) : v = l[5];
|
|
44
|
+
let y;
|
|
45
|
+
l[6] === p ? y = l[7] : (y = /* @__PURE__ */ jsx(TooltipContent, {
|
|
46
|
+
side: "left",
|
|
47
|
+
children: p
|
|
48
|
+
}), l[6] = p, l[7] = y);
|
|
49
|
+
let b;
|
|
50
|
+
return l[8] !== v || l[9] !== y ? (b = /* @__PURE__ */ jsxs(Tooltip, { children: [v, y] }), l[8] = v, l[9] = y, l[10] = b) : b = l[10], b;
|
|
26
51
|
}
|
|
27
52
|
function WorkbenchIconSidebar() {
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
let i = c(65), { previewPanelEnabled: a, activePanel: o, togglePanel: s, environments: f, workspaceId: b } = useWorkbenchLayout(), { router: C } = useStudio(), w = useLocation(), T = useFeatureRegistry(), E;
|
|
54
|
+
i[0] === f ? E = i[1] : (E = f?.some(_temp) ?? !1, i[0] = f, i[1] = E);
|
|
55
|
+
let D = E, O;
|
|
56
|
+
i[2] !== C || i[3] !== b ? (O = C.getWorkspace(b), i[2] = C, i[3] = b, i[4] = O) : O = i[4];
|
|
57
|
+
let k = O, A, j, M, N, P, F, I, L;
|
|
58
|
+
if (i[5] !== o || i[6] !== T || i[7] !== D || i[8] !== w.pathname || i[9] !== a || i[10] !== s || i[11] !== k) {
|
|
59
|
+
let e = T.filter(_temp2).map(_temp3);
|
|
60
|
+
P = "border-l bg-background flex w-12 shrink-0 flex-col items-center", i[20] === Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ jsx("div", { className: "flex h-12 shrink-0 items-center justify-center border-b w-full" }), i[20] = F) : F = i[20];
|
|
61
|
+
let l;
|
|
62
|
+
i[21] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ jsx(Home, { className: "h-5 w-5" }), i[21] = l) : l = i[21];
|
|
63
|
+
let u = w.pathname === k, d;
|
|
64
|
+
i[22] !== u || i[23] !== k ? (d = /* @__PURE__ */ jsx(IconLink, {
|
|
65
|
+
icon: l,
|
|
66
|
+
label: "Workspace",
|
|
67
|
+
to: k,
|
|
68
|
+
active: u
|
|
69
|
+
}), i[22] = u, i[23] = k, i[24] = d) : d = i[24];
|
|
70
|
+
let f;
|
|
71
|
+
i[25] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ jsx(Play, { className: "h-5 w-5" }), i[25] = f) : f = i[25];
|
|
72
|
+
let p = o === "runs", b;
|
|
73
|
+
i[26] === s ? b = i[27] : (b = () => s("runs"), i[26] = s, i[27] = b);
|
|
74
|
+
let S;
|
|
75
|
+
i[28] !== p || i[29] !== b ? (S = /* @__PURE__ */ jsx(IconButton, {
|
|
76
|
+
icon: f,
|
|
77
|
+
label: "Runs",
|
|
78
|
+
active: p,
|
|
79
|
+
onClick: b
|
|
80
|
+
}), i[28] = p, i[29] = b, i[30] = S) : S = i[30], i[31] !== d || i[32] !== S ? (I = /* @__PURE__ */ jsxs("div", {
|
|
81
|
+
className: "flex flex-col items-center gap-1 py-2",
|
|
82
|
+
children: [d, S]
|
|
83
|
+
}), i[31] = d, i[32] = S, i[33] = I) : I = i[33], i[34] === Symbol.for("react.memo_cache_sentinel") ? (L = /* @__PURE__ */ jsx("div", { className: "mx-2 w-6 border-t" }), i[34] = L) : L = i[34], A = "flex flex-col items-center gap-1 py-2";
|
|
84
|
+
let C;
|
|
85
|
+
i[35] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(MonitorPlay, { className: "h-5 w-5" }), i[35] = C) : C = i[35];
|
|
86
|
+
let E = a ? "Environment Preview" : "Preview not available for this environment", O = o === "preview", R = !a, z;
|
|
87
|
+
i[36] === s ? z = i[37] : (z = () => s("preview"), i[36] = s, i[37] = z), i[38] !== E || i[39] !== O || i[40] !== R || i[41] !== z ? (j = /* @__PURE__ */ jsx(IconButton, {
|
|
88
|
+
icon: C,
|
|
89
|
+
label: E,
|
|
90
|
+
active: O,
|
|
91
|
+
disabled: R,
|
|
92
|
+
onClick: z
|
|
93
|
+
}), i[38] = E, i[39] = O, i[40] = R, i[41] = z, i[42] = j) : j = i[42];
|
|
94
|
+
let B;
|
|
95
|
+
i[43] === Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ jsx(Server, { className: "h-5 w-5" }), i[43] = B) : B = i[43];
|
|
96
|
+
let V = D ? "Environment Settings" : "Settings not available for this environment", H = o === "environment", U = !D, W;
|
|
97
|
+
i[44] === s ? W = i[45] : (W = () => s("environment"), i[44] = s, i[45] = W), i[46] !== V || i[47] !== H || i[48] !== U || i[49] !== W ? (M = /* @__PURE__ */ jsx(IconButton, {
|
|
98
|
+
icon: B,
|
|
99
|
+
label: V,
|
|
100
|
+
active: H,
|
|
101
|
+
disabled: U,
|
|
102
|
+
onClick: W
|
|
103
|
+
}), i[46] = V, i[47] = H, i[48] = U, i[49] = W, i[50] = M) : M = i[50];
|
|
104
|
+
let G;
|
|
105
|
+
i[51] !== o || i[52] !== s ? (G = (e) => {
|
|
106
|
+
let i = e.icon;
|
|
107
|
+
return /* @__PURE__ */ jsx(IconButton, {
|
|
108
|
+
icon: /* @__PURE__ */ jsx(i, { className: "h-5 w-5" }),
|
|
109
|
+
label: e.label,
|
|
110
|
+
active: o === e.id,
|
|
111
|
+
onClick: () => s(e.id)
|
|
112
|
+
}, e.id);
|
|
113
|
+
}, i[51] = o, i[52] = s, i[53] = G) : G = i[53], N = e.map(G), i[5] = o, i[6] = T, i[7] = D, i[8] = w.pathname, i[9] = a, i[10] = s, i[11] = k, i[12] = A, i[13] = j, i[14] = M, i[15] = N, i[16] = P, i[17] = F, i[18] = I, i[19] = L;
|
|
114
|
+
} else A = i[12], j = i[13], M = i[14], N = i[15], P = i[16], F = i[17], I = i[18], L = i[19];
|
|
115
|
+
let R;
|
|
116
|
+
i[54] !== A || i[55] !== j || i[56] !== M || i[57] !== N ? (R = /* @__PURE__ */ jsxs("div", {
|
|
117
|
+
className: A,
|
|
118
|
+
children: [
|
|
119
|
+
j,
|
|
120
|
+
M,
|
|
121
|
+
N
|
|
122
|
+
]
|
|
123
|
+
}), i[54] = A, i[55] = j, i[56] = M, i[57] = N, i[58] = R) : R = i[58];
|
|
124
|
+
let z;
|
|
125
|
+
return i[59] !== R || i[60] !== P || i[61] !== F || i[62] !== I || i[63] !== L ? (z = /* @__PURE__ */ jsxs("div", {
|
|
126
|
+
className: P,
|
|
68
127
|
children: [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
128
|
+
F,
|
|
129
|
+
I,
|
|
130
|
+
L,
|
|
131
|
+
R
|
|
73
132
|
]
|
|
74
|
-
}),
|
|
133
|
+
}), i[59] = R, i[60] = P, i[61] = F, i[62] = I, i[63] = L, i[64] = z) : z = i[64], z;
|
|
134
|
+
}
|
|
135
|
+
function _temp3(e) {
|
|
136
|
+
return e.sidebarPanel;
|
|
137
|
+
}
|
|
138
|
+
function _temp2(e) {
|
|
139
|
+
return e.sidebarPanel;
|
|
140
|
+
}
|
|
141
|
+
function _temp(e) {
|
|
142
|
+
return !!e.agentUrl;
|
|
75
143
|
}
|
|
76
144
|
export { WorkbenchIconSidebar };
|
|
@@ -1,128 +1,141 @@
|
|
|
1
1
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../../components/ui/select.js";
|
|
2
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/ui/tooltip.js";
|
|
3
2
|
import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
|
|
3
|
+
import { SidebarPanel } from "./SidebarPanel.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import {
|
|
7
|
+
import { Loader2, MonitorPlay } from "lucide-react";
|
|
7
8
|
var EMBED_NEW_RUN_MESSAGE_TYPE = "loopstack:embed:new-run";
|
|
8
9
|
function WorkbenchPreviewPanel() {
|
|
9
|
-
let { getEnvironmentPreviewUrl: y, environments: b,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
]);
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
let _ = c(55), { getEnvironmentPreviewUrl: y, environments: b, closePanel: x, panelSize: S, setPanelSize: C, selectedSlotId: w, setSelectedSlotId: T } = useWorkbenchLayout(), E = useRef(null), D;
|
|
11
|
+
_[0] === b ? D = _[1] : (D = b ?? [], _[0] = b, _[1] = D);
|
|
12
|
+
let O;
|
|
13
|
+
_[2] === D ? O = _[3] : (O = D.filter(_temp), _[2] = D, _[3] = O);
|
|
14
|
+
let k = O, [A, j] = useState(null), M;
|
|
15
|
+
_[4] !== k[0] || _[5] !== k.length || _[6] !== w || _[7] !== T ? (M = () => {
|
|
16
|
+
!w && k.length > 0 && T(k[0].slotId);
|
|
17
|
+
}, _[4] = k[0], _[5] = k.length, _[6] = w, _[7] = T, _[8] = M) : M = _[8];
|
|
18
|
+
let N;
|
|
19
|
+
_[9] !== k || _[10] !== w || _[11] !== T ? (N = [
|
|
20
|
+
k,
|
|
21
|
+
w,
|
|
22
|
+
T
|
|
23
|
+
], _[9] = k, _[10] = w, _[11] = T, _[12] = N) : N = _[12], useEffect(M, N);
|
|
24
|
+
let P;
|
|
25
|
+
if (_[13] !== k || _[14] !== w) {
|
|
26
|
+
let e;
|
|
27
|
+
_[16] === w ? e = _[17] : (e = (e) => e.slotId === w, _[16] = w, _[17] = e), P = k.find(e), _[13] = k, _[14] = w, _[15] = P;
|
|
28
|
+
} else P = _[15];
|
|
29
|
+
let F = P, I;
|
|
30
|
+
bb0: {
|
|
31
|
+
if (!y || !F) {
|
|
32
|
+
I = void 0;
|
|
33
|
+
break bb0;
|
|
34
|
+
}
|
|
35
|
+
let e = A ?? void 0, g;
|
|
36
|
+
_[18] !== y || _[19] !== F || _[20] !== e ? (g = y(F, e), _[18] = y, _[19] = F, _[20] = e, _[21] = g) : g = _[21], I = g;
|
|
37
|
+
}
|
|
38
|
+
let L = I, R;
|
|
39
|
+
_[22] === T ? R = _[23] : (R = (e) => {
|
|
40
|
+
T(e), j(null);
|
|
41
|
+
}, _[22] = T, _[23] = R);
|
|
42
|
+
let z = R, B, V;
|
|
43
|
+
if (_[24] === Symbol.for("react.memo_cache_sentinel") ? (B = () => {
|
|
25
44
|
let e = (e) => {
|
|
26
45
|
if (e.origin !== window.location.origin) return;
|
|
27
|
-
let
|
|
28
|
-
if (
|
|
29
|
-
let
|
|
30
|
-
typeof
|
|
46
|
+
let g = e.data;
|
|
47
|
+
if (g?.type !== EMBED_NEW_RUN_MESSAGE_TYPE) return;
|
|
48
|
+
let _ = g?.workflowId;
|
|
49
|
+
typeof _ == "string" && j(_);
|
|
31
50
|
};
|
|
32
51
|
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
33
|
-
}, []
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
className: "text-sm font-medium text-white",
|
|
39
|
-
children: "Preview"
|
|
40
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
41
|
-
onClick: x,
|
|
42
|
-
className: "text-zinc-400 hover:text-white flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:cursor-pointer",
|
|
43
|
-
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
44
|
-
})]
|
|
45
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
52
|
+
}, V = [], _[24] = B, _[25] = V) : (B = _[24], V = _[25]), useEffect(B, V), b === void 0) {
|
|
53
|
+
let e;
|
|
54
|
+
_[26] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(MonitorPlay, { className: "h-4 w-4" }), _[26] = e) : e = _[26];
|
|
55
|
+
let g;
|
|
56
|
+
_[27] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx("div", {
|
|
46
57
|
className: "flex flex-1 items-center justify-center",
|
|
47
|
-
children: /* @__PURE__ */ jsx(Loader2, { className: "h-5 w-5 animate-spin text-
|
|
48
|
-
})]
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
children: /* @__PURE__ */ jsx(Loader2, { className: "h-5 w-5 animate-spin text-muted-foreground" })
|
|
59
|
+
}), _[27] = g) : g = _[27];
|
|
60
|
+
let v;
|
|
61
|
+
return _[28] !== x || _[29] !== S || _[30] !== C ? (v = /* @__PURE__ */ jsx(SidebarPanel, {
|
|
62
|
+
icon: e,
|
|
63
|
+
title: "Preview",
|
|
64
|
+
size: S,
|
|
65
|
+
onSizeChange: C,
|
|
66
|
+
onClose: x,
|
|
67
|
+
children: g
|
|
68
|
+
}), _[28] = x, _[29] = S, _[30] = C, _[31] = v) : v = _[31], v;
|
|
69
|
+
}
|
|
70
|
+
if (!y || k.length === 0) {
|
|
71
|
+
let e;
|
|
72
|
+
_[32] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(MonitorPlay, { className: "h-4 w-4" }), _[32] = e) : e = _[32];
|
|
73
|
+
let g;
|
|
74
|
+
_[33] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx("div", {
|
|
75
|
+
className: "text-muted-foreground flex flex-1 items-center justify-center text-sm",
|
|
63
76
|
children: "Preview not available"
|
|
64
|
-
})]
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
77
|
+
}), _[33] = g) : g = _[33];
|
|
78
|
+
let v;
|
|
79
|
+
return _[34] !== x || _[35] !== S || _[36] !== C ? (v = /* @__PURE__ */ jsx(SidebarPanel, {
|
|
80
|
+
icon: e,
|
|
81
|
+
title: "Preview",
|
|
82
|
+
size: S,
|
|
83
|
+
onSizeChange: C,
|
|
84
|
+
onClose: x,
|
|
85
|
+
children: g
|
|
86
|
+
}), _[34] = x, _[35] = S, _[36] = C, _[37] = v) : v = _[37], v;
|
|
87
|
+
}
|
|
88
|
+
let H;
|
|
89
|
+
_[38] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ jsx(MonitorPlay, { className: "h-4 w-4" }), _[38] = H) : H = _[38];
|
|
90
|
+
let U = k.length === 1 && F ? F.envName || F.slotId : void 0, W;
|
|
91
|
+
_[39] !== k || _[40] !== z || _[41] !== w ? (W = k.length > 1 && /* @__PURE__ */ jsx("div", {
|
|
92
|
+
className: "border-b px-4 py-2",
|
|
93
|
+
children: /* @__PURE__ */ jsxs(Select, {
|
|
94
|
+
value: w,
|
|
95
|
+
onValueChange: z,
|
|
96
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
97
|
+
className: "h-8 text-xs",
|
|
98
|
+
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
99
|
+
}), /* @__PURE__ */ jsx(SelectContent, { children: k.map(_temp2) })]
|
|
100
|
+
})
|
|
101
|
+
}), _[39] = k, _[40] = z, _[41] = w, _[42] = W) : W = _[42];
|
|
102
|
+
let G;
|
|
103
|
+
_[43] === L ? G = _[44] : (G = L ? /* @__PURE__ */ jsx("div", {
|
|
104
|
+
className: "flex-1 overflow-hidden p-3",
|
|
105
|
+
children: /* @__PURE__ */ jsx("iframe", {
|
|
106
|
+
ref: E,
|
|
107
|
+
src: L,
|
|
108
|
+
className: "bg-muted h-full w-full rounded-lg border",
|
|
109
|
+
title: "Workflow preview"
|
|
110
|
+
})
|
|
111
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
112
|
+
className: "text-muted-foreground flex flex-1 items-center justify-center text-sm",
|
|
113
|
+
children: "Preview not available"
|
|
114
|
+
}), _[43] = L, _[44] = G);
|
|
115
|
+
let K;
|
|
116
|
+
_[45] !== W || _[46] !== G ? (K = /* @__PURE__ */ jsxs("div", {
|
|
117
|
+
className: "flex h-full flex-col",
|
|
118
|
+
children: [W, G]
|
|
119
|
+
}), _[45] = W, _[46] = G, _[47] = K) : K = _[47];
|
|
120
|
+
let q;
|
|
121
|
+
return _[48] !== x || _[49] !== S || _[50] !== L || _[51] !== C || _[52] !== U || _[53] !== K ? (q = /* @__PURE__ */ jsx(SidebarPanel, {
|
|
122
|
+
icon: H,
|
|
123
|
+
title: "Preview",
|
|
124
|
+
description: U,
|
|
125
|
+
size: S,
|
|
126
|
+
onSizeChange: C,
|
|
127
|
+
onClose: x,
|
|
128
|
+
expandUrl: L,
|
|
129
|
+
children: K
|
|
130
|
+
}), _[48] = x, _[49] = S, _[50] = L, _[51] = C, _[52] = U, _[53] = K, _[54] = q) : q = _[54], q;
|
|
131
|
+
}
|
|
132
|
+
function _temp2(e) {
|
|
133
|
+
return /* @__PURE__ */ jsx(SelectItem, {
|
|
134
|
+
value: e.slotId,
|
|
135
|
+
children: e.envName || e.slotId
|
|
136
|
+
}, e.slotId);
|
|
137
|
+
}
|
|
138
|
+
function _temp(e) {
|
|
139
|
+
return !!e.connectionUrl && (!!e.workerId || e.local);
|
|
127
140
|
}
|
|
128
141
|
export { WorkbenchPreviewPanel };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useWorkspace } from "../../../hooks/useWorkspaces.js";
|
|
2
|
+
import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
|
|
3
|
+
import { SidebarPanel } from "./SidebarPanel.js";
|
|
4
|
+
import ExecutionTimeline_default from "../../workspaces/components/ExecutionTimeline.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { Loader2, Play } from "lucide-react";
|
|
8
|
+
function WorkbenchRunsPanel() {
|
|
9
|
+
let l = c(11), { workspaceId: u, panelSize: d, setPanelSize: f, closePanel: p } = useWorkbenchLayout(), { data: m, isLoading: h } = useWorkspace(u), g;
|
|
10
|
+
l[0] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx(Play, { className: "h-4 w-4" }), l[0] = g) : g = l[0];
|
|
11
|
+
let _;
|
|
12
|
+
l[1] !== h || l[2] !== m ? (_ = h ? /* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: "flex items-center justify-center py-8",
|
|
14
|
+
children: /* @__PURE__ */ jsx(Loader2, { className: "h-5 w-5 animate-spin text-muted-foreground" })
|
|
15
|
+
}) : m ? /* @__PURE__ */ jsx(ExecutionTimeline_default, { workspace: m }) : null, l[1] = h, l[2] = m, l[3] = _) : _ = l[3];
|
|
16
|
+
let v;
|
|
17
|
+
l[4] === _ ? v = l[5] : (v = /* @__PURE__ */ jsx("div", {
|
|
18
|
+
className: "h-full overflow-auto p-4",
|
|
19
|
+
children: _
|
|
20
|
+
}), l[4] = _, l[5] = v);
|
|
21
|
+
let y;
|
|
22
|
+
return l[6] !== p || l[7] !== d || l[8] !== f || l[9] !== v ? (y = /* @__PURE__ */ jsx(SidebarPanel, {
|
|
23
|
+
icon: g,
|
|
24
|
+
title: "Runs",
|
|
25
|
+
description: "Workflow execution history for this workspace.",
|
|
26
|
+
size: d,
|
|
27
|
+
onSizeChange: f,
|
|
28
|
+
onClose: p,
|
|
29
|
+
children: v
|
|
30
|
+
}), l[6] = p, l[7] = d, l[8] = f, l[9] = v, l[10] = y) : y = l[10], y;
|
|
31
|
+
}
|
|
32
|
+
export { WorkbenchRunsPanel };
|