@loopstack/loopstack-studio 0.23.1 → 0.25.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/config.js +3 -3
- package/dist/api/index.js +10 -12
- package/dist/api/processor.js +1 -1
- package/dist/api/secrets.js +16 -0
- package/dist/api/workflows.js +7 -1
- package/dist/components/dynamic-form/ArrayController.js +68 -64
- package/dist/components/dynamic-form/CodeContent.js +3 -3
- package/dist/components/dynamic-form/Form.js +46 -40
- package/dist/components/dynamic-form/FormElement.js +1 -1
- package/dist/components/dynamic-form/FormElementHeader.js +2 -2
- 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/CodeViewField.js +36 -36
- package/dist/components/dynamic-form/fields/InputField.js +20 -19
- 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/feedback/LoadingCentered.js +1 -1
- package/dist/components/layout/MainLayout.js +18 -31
- package/dist/components/layout/StudioSidebar.js +169 -109
- package/dist/components/loopstack-elements/link.js +77 -76
- package/dist/components/loopstack-elements/tool.js +171 -0
- package/dist/components/page/PageBreadcrumbs.js +79 -32
- package/dist/components/ui-widgets/UiActions.js +10 -4
- package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +8 -6
- package/dist/components/ui-widgets/widgets/SubmitButton.js +8 -6
- package/dist/features/code-explorer/components/FileContentViewer.js +92 -100
- package/dist/features/dashboard/RunItem.js +1 -1
- package/dist/features/debug/components/ConfigFlowViewer.js +2 -2
- package/dist/features/debug/components/{PipelineDebugHeader.js → WorkflowDebugHeader.js} +5 -5
- package/dist/features/debug/components/{PipelineDebugLegend.js → WorkflowDebugLegend.js} +2 -2
- package/dist/features/debug/components/{PipelineFlowViewer.js → WorkflowFlowViewer.js} +9 -9
- package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +46 -0
- package/dist/features/debug/index.js +2 -2
- package/dist/features/debug/lib/flow-utils.js +142 -150
- package/dist/features/documents/DocumentRenderer.js +66 -30
- package/dist/features/documents/components/DocumentItem.js +2 -2
- package/dist/features/documents/components/DocumentList.js +18 -11
- package/dist/features/documents/document-details/DocumentDetails.js +4 -4
- package/dist/features/documents/renderers/AiMessage.js +12 -12
- package/dist/features/documents/renderers/ChoicesRenderer.js +92 -0
- package/dist/features/documents/renderers/ClaudeMessage.js +1 -1
- package/dist/features/documents/renderers/ConfirmPromptRenderer.js +56 -0
- package/dist/features/documents/renderers/DocumentFormRenderer.js +95 -65
- package/dist/features/documents/renderers/LinkMessageRenderer.js +8 -10
- package/dist/features/documents/renderers/SecretInputRenderer.js +87 -0
- package/dist/features/documents/renderers/TextPromptRenderer.js +57 -0
- package/dist/features/documents/renderers/useDocumentTransition.js +30 -0
- package/dist/features/oauth/OAuthPromptRenderer.js +20 -20
- package/dist/features/runs/Runs.js +8 -8
- package/dist/features/workbench/Workbench.js +35 -35
- package/dist/features/workbench/WorkflowItem.js +10 -9
- package/dist/features/workbench/WorkflowList.js +56 -73
- package/dist/features/workbench/components/NewRunDialog.js +18 -18
- package/dist/features/workbench/components/WorkbenchFilesPanel.js +33 -26
- package/dist/features/workbench/components/WorkbenchFloatingPanel.js +13 -44
- package/dist/features/workbench/components/WorkbenchFlowPanel.js +27 -29
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +17 -17
- package/dist/features/workbench/components/WorkbenchPreviewPanel.js +2 -2
- package/dist/features/workbench/components/WorkbenchSecretsPanel.js +182 -0
- package/dist/features/workbench/components/WorkbenchSettingsModal.js +16 -41
- package/dist/features/workbench/components/WorkflowForms.js +14 -13
- package/dist/features/workbench/components/WorkflowHistoryItem.js +60 -81
- package/dist/features/workbench/components/{PipelineHistoryList.js → WorkflowHistoryList.js} +5 -5
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +56 -54
- package/dist/features/workbench/hooks/useWorkflowData.js +10 -10
- package/dist/features/workbench/hooks/useWorkflowListState.js +8 -45
- package/dist/features/workbench/index.js +2 -3
- package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +132 -117
- package/dist/features/workbench/providers/ScrollProvider.js +2 -2
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +4 -4
- package/dist/features/workspaces/Workspaces.js +1 -1
- package/dist/features/workspaces/components/CreateWorkspace.js +12 -12
- package/dist/features/workspaces/components/ExecutionTimeline.js +22 -21
- package/dist/features/workspaces/components/{NewPipelineRunDialog.js → NewWorkflowRunDialog.js} +6 -6
- package/dist/features/workspaces/components/{PipelineForm.js → WorkflowRunForm.js} +31 -31
- package/dist/features/workspaces/components/WorkspaceHomePage.js +11 -11
- package/dist/features/workspaces/components/{pipeline-form → workflow-form}/ArgumentsView.js +1 -1
- package/dist/features/workspaces/components/{pipeline-form → workflow-form}/SelectionView.js +16 -16
- package/dist/hooks/index.js +3 -3
- package/dist/hooks/query-keys.js +34 -68
- package/dist/hooks/useConfig.js +5 -5
- package/dist/hooks/useProcessor.js +5 -5
- package/dist/hooks/useSecrets.js +69 -0
- package/dist/hooks/useWorkflows.js +155 -68
- package/dist/index.d.ts +158 -116
- package/dist/index.js +5 -5
- package/dist/packages/contracts/dist/enums/index.js +11 -12
- package/dist/packages/contracts/dist/enums/workflow-state.enum.js +1 -1
- package/dist/pages/DashboardPage.js +87 -35
- package/dist/pages/DebugWorkflowDetailsPage.js +8 -8
- package/dist/pages/DebugWorkflowsPage.js +10 -10
- package/dist/pages/EmbedWorkbenchPage.js +39 -45
- package/dist/pages/PreviewWorkbenchPage.js +130 -255
- package/dist/pages/RunsListPage.js +1 -1
- package/dist/pages/StudioLandingPage.js +13 -13
- package/dist/pages/WorkbenchPage.js +6 -6
- package/dist/pages/WorkflowDebugPage.js +114 -0
- package/dist/pages/WorkspacePage.js +4 -2
- package/dist/providers/InvalidationEventsProvider.js +19 -19
- package/dist/providers/SseProvider.js +0 -1
- package/dist/routing/LocalRouter.js +14 -17
- package/dist/types/ai.types.js +13 -0
- package/package.json +2 -3
- package/dist/api/namespaces.js +0 -7
- package/dist/api/pipelines.js +0 -13
- package/dist/components/ai-elements/tool.js +0 -158
- package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +0 -41
- package/dist/features/workbench/NavigationItems.js +0 -52
- package/dist/features/workbench/WorkbenchNavigation.js +0 -38
- package/dist/features/workbench/components/NavigationItem.js +0 -68
- package/dist/features/workbench/hooks/useIntersectionObserver.js +0 -44
- package/dist/hooks/useNamespaceTree.js +0 -27
- package/dist/hooks/useNamespaces.js +0 -25
- package/dist/hooks/usePipelines.js +0 -161
- 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
- package/dist/packages/contracts/dist/enums/pipeline-state.js +0 -10
- package/dist/pages/PipelineDebugPage.js +0 -115
- /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/StateNode.js +0 -0
- /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/WorkflowTransitionEdge.js +0 -0
- /package/dist/features/workspaces/components/{pipeline-form → workflow-form}/HeaderSection.js +0 -0
|
@@ -1,165 +1,225 @@
|
|
|
1
1
|
import { useStudio, useStudioOptional } from "../../providers/StudioProvider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { useFilterWorkflows } from "../../hooks/useWorkflows.js";
|
|
3
3
|
import { useComponentOverrides } from "../../providers/ComponentOverridesProvider.js";
|
|
4
|
-
import {
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
import { Button } from "../ui/button.js";
|
|
6
|
+
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, useSidebar } from "../ui/sidebar.js";
|
|
7
|
+
import { motion } from "../../node_modules/motion/dist/es/react.js";
|
|
5
8
|
import { c } from "react/compiler-runtime";
|
|
6
|
-
import {
|
|
9
|
+
import { useState } from "react";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
11
|
import { Link, useLocation } from "react-router-dom";
|
|
8
|
-
import { CircleAlert, Info, LayoutDashboard, LayoutGrid, Play, Workflow } from "lucide-react";
|
|
12
|
+
import { CircleAlert, Info, LayoutDashboard, LayoutGrid, PanelLeftIcon, Play, Workflow } from "lucide-react";
|
|
9
13
|
var DefaultSidebarHeader = () => {
|
|
10
|
-
let e = c(
|
|
11
|
-
e[0] ===
|
|
12
|
-
|
|
14
|
+
let e = c(18), { state: l, toggleSidebar: u } = useSidebar(), [d, m] = useState(!1), h = l === "collapsed" ? "justify-center" : "justify-between", g;
|
|
15
|
+
e[0] === h ? g = e[1] : (g = cn("border-sidebar-border h-12 w-full flex-row items-center border-b px-1.5 py-0", h), e[0] = h, e[1] = g);
|
|
16
|
+
let _;
|
|
17
|
+
e[2] === l ? _ = e[3] : (_ = l === "expanded" && /* @__PURE__ */ jsxs("div", {
|
|
18
|
+
className: "flex items-center gap-2 overflow-hidden px-1.5",
|
|
13
19
|
children: [/* @__PURE__ */ jsx("img", {
|
|
14
20
|
src: "/loopstack.svg",
|
|
15
21
|
alt: "Loopstack",
|
|
16
22
|
className: "h-6 w-6"
|
|
17
|
-
}), /* @__PURE__ */ jsx(
|
|
18
|
-
className: "text-sm font-semibold",
|
|
23
|
+
}), /* @__PURE__ */ jsx(motion.span, {
|
|
24
|
+
className: "whitespace-nowrap text-sm font-semibold",
|
|
25
|
+
initial: {
|
|
26
|
+
opacity: 0,
|
|
27
|
+
x: -6
|
|
28
|
+
},
|
|
29
|
+
animate: {
|
|
30
|
+
opacity: 1,
|
|
31
|
+
x: 0
|
|
32
|
+
},
|
|
33
|
+
transition: {
|
|
34
|
+
opacity: {
|
|
35
|
+
duration: .18,
|
|
36
|
+
delay: .12,
|
|
37
|
+
ease: "easeOut"
|
|
38
|
+
},
|
|
39
|
+
x: {
|
|
40
|
+
duration: .18,
|
|
41
|
+
delay: .12,
|
|
42
|
+
ease: "easeOut"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
19
45
|
children: "Loopstack Studio"
|
|
20
46
|
})]
|
|
21
|
-
}), e[
|
|
22
|
-
let
|
|
23
|
-
e[
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
47
|
+
}), e[2] = l, e[3] = _);
|
|
48
|
+
let v;
|
|
49
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (v = cn("relative size-10 text-muted-foreground hover:cursor-pointer hover:bg-accent/50 hover:text-accent-foreground"), e[4] = v) : v = e[4];
|
|
50
|
+
let y, x;
|
|
51
|
+
e[5] === Symbol.for("react.memo_cache_sentinel") ? (y = () => m(!0), x = () => m(!1), e[5] = y, e[6] = x) : (y = e[5], x = e[6]);
|
|
52
|
+
let S;
|
|
53
|
+
e[7] !== d || e[8] !== l ? (S = l === "collapsed" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(motion.img, {
|
|
54
|
+
src: "/loopstack.svg",
|
|
55
|
+
alt: "Loopstack",
|
|
56
|
+
className: "absolute top-1/2 left-1/2 h-5 w-5 -translate-x-1/2 -translate-y-1/2",
|
|
57
|
+
initial: { opacity: 1 },
|
|
58
|
+
animate: { opacity: d ? 0 : 1 },
|
|
59
|
+
transition: { duration: .2 }
|
|
60
|
+
}), /* @__PURE__ */ jsx(motion.div, {
|
|
61
|
+
className: "absolute top-1/2 left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center",
|
|
62
|
+
initial: { opacity: 0 },
|
|
63
|
+
animate: { opacity: d ? 1 : 0 },
|
|
64
|
+
transition: { duration: .2 },
|
|
65
|
+
children: /* @__PURE__ */ jsx(PanelLeftIcon, { className: "size-5" })
|
|
66
|
+
})] }) : /* @__PURE__ */ jsx(PanelLeftIcon, { className: "size-5" }), e[7] = d, e[8] = l, e[9] = S) : S = e[9];
|
|
67
|
+
let C;
|
|
68
|
+
e[10] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx("span", {
|
|
69
|
+
className: "sr-only",
|
|
70
|
+
children: "Toggle Sidebar"
|
|
71
|
+
}), e[10] = C) : C = e[10];
|
|
72
|
+
let w;
|
|
73
|
+
e[11] !== S || e[12] !== u ? (w = /* @__PURE__ */ jsxs(Button, {
|
|
74
|
+
"data-sidebar": "trigger",
|
|
75
|
+
"data-slot": "sidebar-trigger",
|
|
76
|
+
variant: "ghost",
|
|
77
|
+
size: "icon",
|
|
78
|
+
className: v,
|
|
79
|
+
onClick: u,
|
|
80
|
+
onMouseEnter: y,
|
|
81
|
+
onMouseLeave: x,
|
|
82
|
+
children: [S, C]
|
|
83
|
+
}), e[11] = S, e[12] = u, e[13] = w) : w = e[13];
|
|
84
|
+
let k;
|
|
85
|
+
return e[14] !== g || e[15] !== _ || e[16] !== w ? (k = /* @__PURE__ */ jsxs(SidebarHeader, {
|
|
86
|
+
className: g,
|
|
87
|
+
children: [_, w]
|
|
88
|
+
}), e[14] = g, e[15] = _, e[16] = w, e[17] = k) : k = e[17], k;
|
|
29
89
|
}, RunsNav = () => {
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
|
|
90
|
+
let l = c(26), d = useLocation(), { router: f } = useStudio(), p = f.getRuns(), m;
|
|
91
|
+
l[0] === f ? m = l[1] : (m = f.getRunsActionRequired(), l[0] = f, l[1] = m);
|
|
92
|
+
let h = m, g;
|
|
93
|
+
l[2] === Symbol.for("react.memo_cache_sentinel") ? (g = {
|
|
34
94
|
parentId: null,
|
|
35
95
|
status: "paused"
|
|
36
|
-
},
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
let E =
|
|
40
|
-
|
|
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);
|
|
96
|
+
}, l[2] = g) : g = l[2];
|
|
97
|
+
let b = useFilterWorkflows(void 0, g, "createdAt", "DESC", 0, 1).data?.total ?? 0, T;
|
|
98
|
+
l[3] === Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Runs" }), l[3] = T) : T = l[3];
|
|
99
|
+
let E = d.pathname === p || d.pathname === p + "/", D, O;
|
|
100
|
+
l[4] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ jsx(Play, {}), O = /* @__PURE__ */ jsx("span", { children: "Overview" }), l[4] = D, l[5] = O) : (D = l[4], O = l[5]);
|
|
46
101
|
let A;
|
|
47
|
-
|
|
102
|
+
l[6] === p ? A = l[7] : (A = /* @__PURE__ */ jsxs(Link, {
|
|
103
|
+
to: p,
|
|
104
|
+
children: [D, O]
|
|
105
|
+
}), l[6] = p, l[7] = A);
|
|
106
|
+
let j;
|
|
107
|
+
l[8] !== E || l[9] !== A ? (j = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
48
108
|
asChild: !0,
|
|
49
109
|
isActive: E,
|
|
50
110
|
tooltip: "Overview",
|
|
51
|
-
children:
|
|
52
|
-
}) }),
|
|
53
|
-
let
|
|
54
|
-
|
|
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);
|
|
111
|
+
children: A
|
|
112
|
+
}) }), l[8] = E, l[9] = A, l[10] = j) : j = l[10];
|
|
113
|
+
let M = d.pathname === h, N, P;
|
|
114
|
+
l[11] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ jsx(CircleAlert, {}), N = /* @__PURE__ */ jsx("span", { children: "Action Required" }), l[11] = N, l[12] = P) : (N = l[11], P = l[12]);
|
|
60
115
|
let F;
|
|
61
|
-
|
|
116
|
+
l[13] === h ? F = l[14] : (F = /* @__PURE__ */ jsxs(Link, {
|
|
117
|
+
to: h,
|
|
118
|
+
children: [P, N]
|
|
119
|
+
}), l[13] = h, l[14] = F);
|
|
120
|
+
let I;
|
|
121
|
+
l[15] !== F || l[16] !== M ? (I = /* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
62
122
|
asChild: !0,
|
|
63
|
-
isActive:
|
|
123
|
+
isActive: M,
|
|
64
124
|
tooltip: "Action Required",
|
|
65
|
-
children:
|
|
66
|
-
}),
|
|
67
|
-
let I;
|
|
68
|
-
u[18] === w ? I = u[19] : (I = w > 0 && /* @__PURE__ */ jsx(SidebarMenuBadge, { children: w }), u[18] = w, u[19] = I);
|
|
125
|
+
children: F
|
|
126
|
+
}), l[15] = F, l[16] = M, l[17] = I) : I = l[17];
|
|
69
127
|
let L;
|
|
70
|
-
|
|
128
|
+
l[18] === b ? L = l[19] : (L = b > 0 && /* @__PURE__ */ jsx(SidebarMenuBadge, { children: b }), l[18] = b, l[19] = L);
|
|
71
129
|
let R;
|
|
72
|
-
|
|
130
|
+
l[20] !== I || l[21] !== L ? (R = /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [I, L] }), l[20] = I, l[21] = L, l[22] = R) : R = l[22];
|
|
131
|
+
let z;
|
|
132
|
+
return l[23] !== R || l[24] !== j ? (z = /* @__PURE__ */ jsxs(SidebarGroup, { children: [T, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxs(SidebarMenu, { children: [j, R] }) })] }), l[23] = R, l[24] = j, l[25] = z) : z = l[25], z;
|
|
73
133
|
}, WorkspacesNav = () => {
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
let
|
|
77
|
-
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
let
|
|
81
|
-
|
|
82
|
-
to:
|
|
83
|
-
children: [
|
|
84
|
-
}),
|
|
85
|
-
let
|
|
86
|
-
return
|
|
134
|
+
let l = c(11), u = useLocation(), { router: d } = useStudio(), f = d.getWorkspaces(), p;
|
|
135
|
+
l[0] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Workspaces" }), l[0] = p) : p = l[0];
|
|
136
|
+
let m;
|
|
137
|
+
l[1] !== u.pathname || l[2] !== f ? (m = u.pathname === f || u.pathname.startsWith(f + "/"), l[1] = u.pathname, l[2] = f, l[3] = m) : m = l[3];
|
|
138
|
+
let h, g;
|
|
139
|
+
l[4] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ jsx(LayoutGrid, {}), g = /* @__PURE__ */ jsx("span", { children: "My Workspaces" }), l[4] = h, l[5] = g) : (h = l[4], g = l[5]);
|
|
140
|
+
let b;
|
|
141
|
+
l[6] === f ? b = l[7] : (b = /* @__PURE__ */ jsxs(Link, {
|
|
142
|
+
to: f,
|
|
143
|
+
children: [h, g]
|
|
144
|
+
}), l[6] = f, l[7] = b);
|
|
145
|
+
let S;
|
|
146
|
+
return l[8] !== m || l[9] !== b ? (S = /* @__PURE__ */ jsxs(SidebarGroup, { children: [p, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
87
147
|
asChild: !0,
|
|
88
|
-
isActive:
|
|
148
|
+
isActive: m,
|
|
89
149
|
tooltip: "My Workspaces",
|
|
90
|
-
children:
|
|
91
|
-
}) }) }) })] }),
|
|
150
|
+
children: b
|
|
151
|
+
}) }) }) })] }), l[8] = m, l[9] = b, l[10] = S) : S = l[10], S;
|
|
92
152
|
}, InsightsNav = () => {
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
let
|
|
96
|
-
|
|
153
|
+
let l = c(15), u = useLocation(), { router: d } = useStudio(), f;
|
|
154
|
+
l[0] === d ? f = l[1] : (f = d.getDashboard(), l[0] = d, l[1] = f);
|
|
155
|
+
let p;
|
|
156
|
+
l[2] === f ? p = l[3] : (p = {
|
|
97
157
|
label: "Dashboard",
|
|
98
|
-
href:
|
|
158
|
+
href: f,
|
|
99
159
|
icon: LayoutDashboard
|
|
100
|
-
},
|
|
160
|
+
}, l[2] = f, l[3] = p);
|
|
161
|
+
let m;
|
|
162
|
+
l[4] === d ? m = l[5] : (m = d.getDebugWorkflows(), l[4] = d, l[5] = m);
|
|
101
163
|
let h;
|
|
102
|
-
|
|
103
|
-
let y;
|
|
104
|
-
u[6] === h ? y = u[7] : (y = {
|
|
164
|
+
l[6] === m ? h = l[7] : (h = {
|
|
105
165
|
label: "Workflows",
|
|
106
|
-
href:
|
|
166
|
+
href: m,
|
|
107
167
|
icon: Workflow
|
|
108
|
-
},
|
|
109
|
-
let
|
|
110
|
-
|
|
111
|
-
let
|
|
112
|
-
|
|
168
|
+
}, l[6] = m, l[7] = h);
|
|
169
|
+
let g;
|
|
170
|
+
l[8] !== p || l[9] !== h ? (g = [p, h], l[8] = p, l[9] = h, l[10] = g) : g = l[10];
|
|
171
|
+
let b = g, S;
|
|
172
|
+
l[11] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Insights" }), l[11] = S) : S = l[11];
|
|
113
173
|
let T;
|
|
114
|
-
return
|
|
174
|
+
return l[12] !== u || l[13] !== b ? (T = /* @__PURE__ */ jsxs(SidebarGroup, { children: [S, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: b.map((e) => /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
115
175
|
asChild: !0,
|
|
116
|
-
isActive:
|
|
176
|
+
isActive: u.pathname === e.href,
|
|
117
177
|
tooltip: e.label,
|
|
118
178
|
children: /* @__PURE__ */ jsxs(Link, {
|
|
119
179
|
to: e.href,
|
|
120
180
|
children: [/* @__PURE__ */ jsx(e.icon, {}), /* @__PURE__ */ jsx("span", { children: e.label })]
|
|
121
181
|
})
|
|
122
|
-
}) }, e.href)) }) })] }),
|
|
182
|
+
}) }, e.href)) }) })] }), l[12] = u, l[13] = b, l[14] = T) : T = l[14], T;
|
|
123
183
|
}, DefaultSidebarFooter = () => {
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
let
|
|
127
|
-
|
|
184
|
+
let l = c(9), u = useLocation(), { router: d } = useStudio(), f;
|
|
185
|
+
l[0] === d ? f = l[1] : (f = d.getEnvironmentInfo(), l[0] = d, l[1] = f);
|
|
186
|
+
let p = f, m = u.pathname === p, h, _;
|
|
187
|
+
l[2] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ jsx(Info, {}), _ = /* @__PURE__ */ jsx("span", { children: "Info" }), l[2] = h, l[3] = _) : (h = l[2], _ = l[3]);
|
|
188
|
+
let v;
|
|
189
|
+
l[4] === p ? v = l[5] : (v = /* @__PURE__ */ jsxs(Link, {
|
|
190
|
+
to: p,
|
|
191
|
+
children: [h, _]
|
|
192
|
+
}), l[4] = p, l[5] = v);
|
|
128
193
|
let y;
|
|
129
|
-
|
|
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, {
|
|
194
|
+
return l[6] !== m || l[7] !== v ? (y = /* @__PURE__ */ jsx(SidebarFooter, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
135
195
|
asChild: !0,
|
|
136
|
-
isActive:
|
|
196
|
+
isActive: m,
|
|
137
197
|
size: "sm",
|
|
138
198
|
tooltip: "Info",
|
|
139
|
-
children:
|
|
140
|
-
}) }) }) }),
|
|
199
|
+
children: v
|
|
200
|
+
}) }) }) }), l[6] = m, l[7] = v, l[8] = y) : y = l[8], y;
|
|
141
201
|
};
|
|
142
202
|
const StudioSidebar = () => {
|
|
143
|
-
let e = c(13),
|
|
144
|
-
e[0] ===
|
|
145
|
-
let
|
|
146
|
-
e[2] ===
|
|
203
|
+
let e = c(13), u = useComponentOverrides(), f = useStudioOptional(), p = u.SidebarHeader ?? DefaultSidebarHeader, g = u.SidebarFooter ?? DefaultSidebarFooter, _;
|
|
204
|
+
e[0] === p ? _ = e[1] : (_ = /* @__PURE__ */ jsx(p, {}), e[0] = p, e[1] = _);
|
|
205
|
+
let v;
|
|
206
|
+
e[2] === f ? v = e[3] : (v = f && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
147
207
|
/* @__PURE__ */ jsx(RunsNav, {}),
|
|
148
208
|
/* @__PURE__ */ jsx(WorkspacesNav, {}),
|
|
149
209
|
/* @__PURE__ */ jsx(InsightsNav, {})
|
|
150
|
-
] }), e[2] =
|
|
210
|
+
] }), e[2] = f, e[3] = v);
|
|
211
|
+
let y;
|
|
212
|
+
e[4] === v ? y = e[5] : (y = /* @__PURE__ */ jsx(SidebarContent, { children: v }), e[4] = v, e[5] = y);
|
|
151
213
|
let b;
|
|
152
|
-
e[
|
|
214
|
+
e[6] !== g || e[7] !== f ? (b = f && /* @__PURE__ */ jsx(g, {}), e[6] = g, e[7] = f, e[8] = b) : b = e[8];
|
|
153
215
|
let x;
|
|
154
|
-
e[
|
|
155
|
-
let S;
|
|
156
|
-
return e[9] !== v || e[10] !== b || e[11] !== x ? (S = /* @__PURE__ */ jsxs(Sidebar, {
|
|
216
|
+
return e[9] !== _ || e[10] !== y || e[11] !== b ? (x = /* @__PURE__ */ jsxs(Sidebar, {
|
|
157
217
|
collapsible: "icon",
|
|
158
218
|
children: [
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
219
|
+
_,
|
|
220
|
+
y,
|
|
221
|
+
b
|
|
162
222
|
]
|
|
163
|
-
}), e[9] =
|
|
223
|
+
}), e[9] = _, e[10] = y, e[11] = b, e[12] = x) : x = e[12], x;
|
|
164
224
|
};
|
|
165
225
|
export { StudioSidebar };
|
|
@@ -1,115 +1,116 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useStudio } from "../../providers/StudioProvider.js";
|
|
3
3
|
import { cn } from "../../lib/utils.js";
|
|
4
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip.js";
|
|
4
5
|
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { useEffect, useState } from "react";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { ChevronDownIcon, ChevronUpIcon, ExternalLinkIcon,
|
|
8
|
-
var EMBED_RESIZE_MESSAGE_TYPE = "loopstack:embed:resize",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { ChevronDownIcon, ChevronUpIcon, ExternalLinkIcon, FolderClosedIcon, FolderOpenIcon } from "lucide-react";
|
|
9
|
+
var EMBED_RESIZE_MESSAGE_TYPE = "loopstack:embed:resize", statusColorMap = {
|
|
10
|
+
pending: "text-muted-foreground",
|
|
11
|
+
success: "text-green-600",
|
|
12
|
+
failure: "text-red-600"
|
|
13
|
+
}, WORKFLOW_HREF_PATTERN = /^\/workflows\/([a-zA-Z0-9_-]+)$/, link_default = (h) => {
|
|
14
|
+
let g = c(55), { className: _, href: v, label: y, status: b, embed: x, defaultExpanded: S } = h, C = b === void 0 ? "pending" : b, { router: w } = useStudio(), [T, E] = useState(S ?? !1), [D, O] = useState(0), k;
|
|
15
|
+
g[0] !== v || g[1] !== y ? (k = y || (() => {
|
|
16
|
+
if (!v) return "";
|
|
12
17
|
try {
|
|
13
|
-
return new URL(
|
|
18
|
+
return new URL(v).hostname.replace("www.", "");
|
|
14
19
|
} catch {
|
|
15
|
-
return
|
|
20
|
+
return v;
|
|
16
21
|
}
|
|
17
|
-
})(),
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
if (!
|
|
22
|
+
})(), g[0] = v, g[1] = y, g[2] = k) : k = g[2];
|
|
23
|
+
let A = k, j, M;
|
|
24
|
+
g[3] !== x || g[4] !== v || g[5] !== w ? (M = v?.match(WORKFLOW_HREF_PATTERN)?.[1] ?? null, j = x === !0 && M != null ? w.getEmbedWorkflow(M) : null, g[3] = x, g[4] = v, g[5] = w, g[6] = j, g[7] = M) : (j = g[6], M = g[7]);
|
|
25
|
+
let N = j, P, F;
|
|
26
|
+
g[8] !== T || g[9] !== M ? (P = () => {
|
|
27
|
+
if (!M || !T) return;
|
|
23
28
|
let t = (t) => {
|
|
24
29
|
if (t.origin !== window.location.origin) return;
|
|
25
|
-
let
|
|
26
|
-
if (
|
|
27
|
-
let
|
|
28
|
-
typeof
|
|
30
|
+
let p = t.data;
|
|
31
|
+
if (p?.type !== EMBED_RESIZE_MESSAGE_TYPE || p?.workflowId !== M) return;
|
|
32
|
+
let m = p?.height;
|
|
33
|
+
typeof m == "number" && m > 0 && O(m);
|
|
29
34
|
};
|
|
30
35
|
return window.addEventListener("message", t), () => window.removeEventListener("message", t);
|
|
31
|
-
},
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
let
|
|
39
|
-
|
|
36
|
+
}, F = [M, T], g[8] = T, g[9] = M, g[10] = P, g[11] = F) : (P = g[10], F = g[11]), useEffect(P, F);
|
|
37
|
+
let I;
|
|
38
|
+
g[12] === _ ? I = g[13] : (I = cn("not-prose flex w-full cursor-pointer flex-col", _), g[12] = _, g[13] = I);
|
|
39
|
+
let L;
|
|
40
|
+
g[14] === N ? L = g[15] : (L = () => N && E(_temp), g[14] = N, g[15] = L);
|
|
41
|
+
let R = statusColorMap[C], z;
|
|
42
|
+
g[16] === R ? z = g[17] : (z = cn("flex shrink-0 items-center", R), g[16] = R, g[17] = z);
|
|
43
|
+
let B;
|
|
44
|
+
g[18] === T ? B = g[19] : (B = jsx(T ? FolderOpenIcon : FolderClosedIcon, { className: "size-4" }), g[18] = T, g[19] = B);
|
|
45
|
+
let V;
|
|
46
|
+
g[20] !== B || g[21] !== z ? (V = /* @__PURE__ */ jsx(TooltipTrigger, {
|
|
47
|
+
asChild: !0,
|
|
48
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
49
|
+
className: z,
|
|
50
|
+
children: B
|
|
51
|
+
})
|
|
52
|
+
}), g[20] = B, g[21] = z, g[22] = V) : V = g[22];
|
|
53
|
+
let H = T ? "Collapse" : "Expand", U;
|
|
54
|
+
g[23] === H ? U = g[24] : (U = /* @__PURE__ */ jsx(TooltipContent, {
|
|
55
|
+
side: "top",
|
|
56
|
+
children: H
|
|
57
|
+
}), g[23] = H, g[24] = U);
|
|
40
58
|
let W;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}), h[21] = V, h[22] = U, h[23] = W) : W = h[23];
|
|
45
|
-
let G;
|
|
46
|
-
h[24] === M ? G = h[25] : (G = /* @__PURE__ */ jsx("span", {
|
|
47
|
-
className: "truncate text-sm font-medium",
|
|
48
|
-
children: M
|
|
49
|
-
}), h[24] = M, h[25] = G);
|
|
50
|
-
let K;
|
|
51
|
-
h[26] !== y || h[27] !== _ ? (K = y ? /* @__PURE__ */ jsx("span", {
|
|
52
|
-
className: "text-muted-foreground truncate text-xs",
|
|
53
|
-
children: y
|
|
54
|
-
}) : _ && /* @__PURE__ */ jsx("a", {
|
|
55
|
-
href: _,
|
|
56
|
-
target: "_blank",
|
|
57
|
-
rel: "noopener noreferrer",
|
|
58
|
-
className: "text-muted-foreground truncate text-xs hover:underline",
|
|
59
|
-
children: _
|
|
60
|
-
}), h[26] = y, h[27] = _, h[28] = K) : K = h[28];
|
|
59
|
+
g[25] !== V || g[26] !== U ? (W = /* @__PURE__ */ jsxs(Tooltip, { children: [V, U] }), g[25] = V, g[26] = U, g[27] = W) : W = g[27];
|
|
60
|
+
let G = T ? "font-medium" : "text-muted-foreground", K;
|
|
61
|
+
g[28] === G ? K = g[29] : (K = cn("min-w-0 flex-1 truncate text-sm", G), g[28] = G, g[29] = K);
|
|
61
62
|
let q;
|
|
62
|
-
|
|
63
|
-
className:
|
|
64
|
-
children:
|
|
65
|
-
}),
|
|
63
|
+
g[30] !== A || g[31] !== K ? (q = /* @__PURE__ */ jsx("span", {
|
|
64
|
+
className: K,
|
|
65
|
+
children: A
|
|
66
|
+
}), g[30] = A, g[31] = K, g[32] = q) : q = g[32];
|
|
66
67
|
let J;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
onClick: () => D(_temp),
|
|
70
|
-
className: "text-muted-foreground hover:text-foreground flex size-7 items-center justify-center rounded-md transition-colors hover:bg-muted/50",
|
|
71
|
-
children: jsx(E ? ChevronUpIcon : ChevronDownIcon, { className: "size-4" })
|
|
72
|
-
}), h[32] = I, h[33] = E, h[34] = J) : J = h[34];
|
|
73
|
-
let Y;
|
|
74
|
-
h[35] === _ ? Y = h[36] : (Y = _ && /* @__PURE__ */ jsx("a", {
|
|
75
|
-
href: _,
|
|
68
|
+
g[33] === v ? J = g[34] : (J = v && /* @__PURE__ */ jsx("a", {
|
|
69
|
+
href: v,
|
|
76
70
|
target: "_blank",
|
|
77
71
|
rel: "noopener noreferrer",
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
onClick: _temp2,
|
|
73
|
+
className: "text-muted-foreground hover:text-foreground flex items-center justify-center transition-colors",
|
|
74
|
+
children: /* @__PURE__ */ jsx(ExternalLinkIcon, { className: "size-3.5" })
|
|
75
|
+
}), g[33] = v, g[34] = J);
|
|
76
|
+
let Y;
|
|
77
|
+
g[35] !== N || g[36] !== T ? (Y = N && jsx(T ? ChevronUpIcon : ChevronDownIcon, { className: "text-muted-foreground size-3.5" }), g[35] = N, g[36] = T, g[37] = Y) : Y = g[37];
|
|
81
78
|
let X;
|
|
82
|
-
|
|
79
|
+
g[38] !== J || g[39] !== Y ? (X = /* @__PURE__ */ jsxs("div", {
|
|
83
80
|
className: "flex shrink-0 items-center gap-1",
|
|
84
81
|
children: [J, Y]
|
|
85
|
-
}),
|
|
82
|
+
}), g[38] = J, g[39] = Y, g[40] = X) : X = g[40];
|
|
86
83
|
let Z;
|
|
87
|
-
|
|
88
|
-
className: "flex w-full items-center gap-
|
|
84
|
+
g[41] !== W || g[42] !== q || g[43] !== X ? (Z = /* @__PURE__ */ jsxs("div", {
|
|
85
|
+
className: "flex w-full items-center gap-1.5 py-1",
|
|
89
86
|
children: [
|
|
90
87
|
W,
|
|
91
88
|
q,
|
|
92
89
|
X
|
|
93
90
|
]
|
|
94
|
-
}),
|
|
91
|
+
}), g[41] = W, g[42] = q, g[43] = X, g[44] = Z) : Z = g[44];
|
|
95
92
|
let Q;
|
|
96
|
-
|
|
97
|
-
className: "border-t",
|
|
93
|
+
g[45] !== A || g[46] !== N || g[47] !== T || g[48] !== D ? (Q = T && N && /* @__PURE__ */ jsx("div", {
|
|
94
|
+
className: "mt-2 border-t",
|
|
98
95
|
children: /* @__PURE__ */ jsx("iframe", {
|
|
99
|
-
src:
|
|
96
|
+
src: N,
|
|
100
97
|
className: "w-full overflow-hidden border-0",
|
|
101
|
-
style: { height: `${
|
|
98
|
+
style: { height: `${D}px` },
|
|
102
99
|
scrolling: "no",
|
|
103
|
-
title:
|
|
100
|
+
title: A
|
|
104
101
|
})
|
|
105
|
-
}),
|
|
102
|
+
}), g[45] = A, g[46] = N, g[47] = T, g[48] = D, g[49] = Q) : Q = g[49];
|
|
106
103
|
let $;
|
|
107
|
-
return
|
|
108
|
-
className:
|
|
104
|
+
return g[50] !== Z || g[51] !== Q || g[52] !== I || g[53] !== L ? ($ = /* @__PURE__ */ jsxs("div", {
|
|
105
|
+
className: I,
|
|
106
|
+
onClick: L,
|
|
109
107
|
children: [Z, Q]
|
|
110
|
-
}),
|
|
108
|
+
}), g[50] = Z, g[51] = Q, g[52] = I, g[53] = L, g[54] = $) : $ = g[54], $;
|
|
111
109
|
};
|
|
112
110
|
function _temp(t) {
|
|
113
111
|
return !t;
|
|
114
112
|
}
|
|
113
|
+
function _temp2(t) {
|
|
114
|
+
return t.stopPropagation();
|
|
115
|
+
}
|
|
115
116
|
export { link_default as default };
|