@loopstack/loopstack-studio 0.21.3 → 0.23.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/auth.js +10 -0
- package/dist/api/client.js +13 -0
- package/dist/api/config.js +10 -0
- package/dist/api/dashboard.js +4 -0
- package/dist/api/documents.js +7 -0
- package/dist/api/index.js +24 -0
- package/dist/api/namespaces.js +7 -0
- package/dist/api/pipelines.js +13 -0
- package/dist/api/processor.js +4 -0
- package/dist/api/workflows.js +8 -0
- package/dist/api/workspaces.js +12 -0
- package/dist/app/EnvironmentEmbedRoot.js +35 -0
- package/dist/components/data-table/DataTableFilters.js +74 -63
- 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 +36 -17
- package/dist/components/layout/StudioSidebar.js +165 -0
- package/dist/components/page/PageBreadcrumbs.js +1 -1
- package/dist/components/ui/sidebar.js +359 -359
- package/dist/components/ui-widgets/UiActions.js +22 -15
- package/dist/components/ui-widgets/UiWidget.js +31 -26
- package/dist/components/ui-widgets/widgets/AiPromptInput.js +27 -27
- package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +12 -12
- package/dist/components/ui-widgets/widgets/SandboxRun.js +33 -0
- package/dist/components/ui-widgets/widgets/SubmitButton.js +11 -11
- package/dist/features/code-explorer/CodeExplorer.js +4 -67
- package/dist/features/code-explorer/components/CodeExplorerTree.js +3 -41
- package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +4 -80
- package/dist/features/code-explorer/components/FileContentViewer.js +1 -0
- package/dist/features/code-explorer/components/FileTabsBar.js +1 -1
- package/dist/features/code-explorer/index.js +4 -0
- package/dist/features/code-explorer/utils/fileIcons.js +4 -7
- package/dist/features/debug/components/ConfigFlowViewer.js +1 -1
- package/dist/features/debug/components/PipelineFlowViewer.js +1 -1
- package/dist/features/debug/index.js +3 -0
- package/dist/features/documents/DocumentRenderer.js +53 -0
- package/dist/features/{workbench → documents}/components/DocumentItem.js +1 -1
- package/dist/features/documents/components/DocumentList.js +40 -0
- 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/{workbench/components/document-renderer → documents/renderers}/DocumentDebugRenderer.js +1 -1
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentFormRenderer.js +9 -8
- 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/oauth/OAuthPromptRenderer.js +1 -1
- package/dist/features/runs/Runs.js +197 -0
- package/dist/features/workbench/NavigationItems.js +29 -29
- package/dist/features/workbench/Workbench.js +100 -78
- package/dist/features/workbench/WorkflowItem.js +63 -58
- package/dist/features/workbench/WorkflowList.js +62 -82
- package/dist/features/workbench/components/NewRunDialog.js +329 -0
- package/dist/features/workbench/components/WorkbenchFloatingPanel.js +88 -0
- package/dist/features/workbench/components/WorkbenchFlowPanel.js +49 -0
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +68 -0
- package/dist/features/workbench/components/WorkbenchPreviewPanel.js +128 -0
- package/dist/features/workbench/components/WorkflowForms.js +7 -6
- package/dist/features/workbench/components/WorkflowHistoryItem.js +74 -69
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +78 -61
- 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/WorkbenchLayoutProvider.js +76 -0
- package/dist/features/workspaces/Workspaces.js +2 -2
- package/dist/features/workspaces/components/CreateWorkspace.js +165 -82
- package/dist/features/workspaces/components/EnvironmentSlotSelector.js +63 -0
- package/dist/features/workspaces/components/ExecutionTimeline.js +70 -69
- package/dist/features/workspaces/components/PipelineForm.js +4 -4
- package/dist/features/workspaces/index.js +3 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/query-keys.js +138 -0
- package/dist/hooks/useApi.js +9 -33
- package/dist/hooks/useAuth.js +37 -56
- package/dist/hooks/useConfig.js +27 -33
- package/dist/hooks/useDashboard.js +9 -16
- package/dist/hooks/useDebounce.js +8 -17
- package/dist/hooks/useDocuments.js +7 -16
- package/dist/hooks/useFiles.js +24 -42
- package/dist/hooks/useNamespaces.js +7 -16
- package/dist/hooks/usePipelines.js +141 -174
- package/dist/hooks/useProcessor.js +11 -17
- package/dist/hooks/useWorkflows.js +51 -89
- package/dist/hooks/useWorkspaces.js +97 -129
- package/dist/index.d.ts +364 -50
- package/dist/index.js +21 -6
- package/dist/packages/contracts/dist/enums/index.js +25 -0
- package/dist/packages/contracts/dist/enums/pipeline-state.js +10 -0
- package/dist/packages/contracts/dist/enums/registry.enum.js +20 -0
- package/dist/packages/contracts/dist/enums/sort-order.enum.js +10 -0
- package/dist/packages/contracts/dist/enums/user-type.enum.js +10 -0
- package/dist/packages/contracts/dist/enums/workflow-state.enum.js +10 -0
- package/dist/pages/DashboardPage.js +1 -1
- package/dist/pages/DebugPage.js +12 -14
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
- package/dist/pages/DebugWorkflowsPage.js +3 -4
- package/dist/pages/EmbedWorkbenchPage.js +7 -5
- package/dist/pages/PipelineDebugPage.js +7 -6
- package/dist/pages/PreviewWorkbenchPage.js +419 -0
- package/dist/pages/RunsListPage.js +64 -0
- package/dist/pages/RunsPage.js +49 -0
- package/dist/pages/StudioLandingPage.js +146 -0
- package/dist/pages/WorkbenchPage.js +78 -53
- package/dist/pages/WorkspacePage.js +1 -1
- package/dist/providers/InvalidationEventsProvider.js +15 -17
- package/dist/providers/QueryProvider.js +21 -0
- package/dist/providers/StudioProvider.js +2 -2
- package/dist/routing/LocalRouter.js +20 -7
- package/dist/services/createApiClient.js +4 -10
- package/dist/services/index.js +1 -1
- package/package.json +2 -3
- package/dist/features/workbench/components/DocumentList.js +0 -40
- package/dist/features/workbench/components/DocumentRenderer.js +0 -54
- package/dist/features/workbench/components/WorkbenchSidebar.js +0 -109
- package/dist/features/workbench/providers/WorkbenchContextProvider.js +0 -3
- /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/components/document-renderer → documents/renderers}/AiMessageContent.js +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_pipeline_state } from "./pipeline-state.js";
|
|
3
|
+
import { require_sort_order_enum } from "./sort-order.enum.js";
|
|
4
|
+
import { require_workflow_state_enum } from "./workflow-state.enum.js";
|
|
5
|
+
import { require_user_type_enum } from "./user-type.enum.js";
|
|
6
|
+
import { require_registry_enum } from "./registry.enum.js";
|
|
7
|
+
var require_enums = /* @__PURE__ */ __commonJSMin(((e) => {
|
|
8
|
+
var o = e && e.__createBinding || (Object.create ? function(e, n, r, i) {
|
|
9
|
+
i === void 0 && (i = r);
|
|
10
|
+
var a = Object.getOwnPropertyDescriptor(n, r);
|
|
11
|
+
(!a || ("get" in a ? !n.__esModule : a.writable || a.configurable)) && (a = {
|
|
12
|
+
enumerable: !0,
|
|
13
|
+
get: function() {
|
|
14
|
+
return n[r];
|
|
15
|
+
}
|
|
16
|
+
}), Object.defineProperty(e, i, a);
|
|
17
|
+
} : function(e, n, r, i) {
|
|
18
|
+
i === void 0 && (i = r), e[i] = n[r];
|
|
19
|
+
}), s = e && e.__exportStar || function(e, n) {
|
|
20
|
+
for (var r in e) r !== "default" && !Object.prototype.hasOwnProperty.call(n, r) && o(n, e, r);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), s(require_pipeline_state(), e), s(require_sort_order_enum(), e), s(require_workflow_state_enum(), e), s(require_user_type_enum(), e), s(require_registry_enum(), e);
|
|
23
|
+
}));
|
|
24
|
+
export default require_enums();
|
|
25
|
+
export { require_enums };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
var require_pipeline_state = /* @__PURE__ */ __commonJSMin(((e) => {
|
|
3
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.PipelineState = void 0;
|
|
4
|
+
var t;
|
|
5
|
+
(function(e) {
|
|
6
|
+
e.Pending = "pending", e.Running = "running", e.Paused = "paused", e.Completed = "completed", e.Failed = "failed", e.Canceled = "canceled";
|
|
7
|
+
})(t || (e.PipelineState = t = {}));
|
|
8
|
+
}));
|
|
9
|
+
export default require_pipeline_state();
|
|
10
|
+
export { require_pipeline_state };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
var require_registry_enum = /* @__PURE__ */ __commonJSMin(((e) => {
|
|
3
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.REGISTRY_CATEGORIES = e.RegistryEntryCategory = e.RegistryEntryStatus = void 0;
|
|
4
|
+
var t;
|
|
5
|
+
(function(e) {
|
|
6
|
+
e.DRAFT = "draft", e.PENDING = "pending", e.ACTIVE = "active", e.INACTIVE = "inactive";
|
|
7
|
+
})(t || (e.RegistryEntryStatus = t = {}));
|
|
8
|
+
var n;
|
|
9
|
+
(function(e) {
|
|
10
|
+
e.TOOLS = "tools", e.EXAMPLES = "examples", e.BUNDLES = "bundles", e.MODULES = "modules", e.INTEGRATIONS = "integrations";
|
|
11
|
+
})(n || (e.RegistryEntryCategory = n = {})), e.REGISTRY_CATEGORIES = [
|
|
12
|
+
n.TOOLS,
|
|
13
|
+
n.EXAMPLES,
|
|
14
|
+
n.BUNDLES,
|
|
15
|
+
n.MODULES,
|
|
16
|
+
n.INTEGRATIONS
|
|
17
|
+
];
|
|
18
|
+
}));
|
|
19
|
+
export default require_registry_enum();
|
|
20
|
+
export { require_registry_enum };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
var require_sort_order_enum = /* @__PURE__ */ __commonJSMin(((e) => {
|
|
3
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.SortOrder = void 0;
|
|
4
|
+
var t;
|
|
5
|
+
(function(e) {
|
|
6
|
+
e.ASC = "ASC", e.DESC = "DESC";
|
|
7
|
+
})(t || (e.SortOrder = t = {}));
|
|
8
|
+
}));
|
|
9
|
+
export default require_sort_order_enum();
|
|
10
|
+
export { require_sort_order_enum };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
var require_user_type_enum = /* @__PURE__ */ __commonJSMin(((e) => {
|
|
3
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.UserTypeEnum = void 0;
|
|
4
|
+
var t;
|
|
5
|
+
(function(e) {
|
|
6
|
+
e.Local = "local", e.Cloud = "cloud";
|
|
7
|
+
})(t || (e.UserTypeEnum = t = {}));
|
|
8
|
+
}));
|
|
9
|
+
export default require_user_type_enum();
|
|
10
|
+
export { require_user_type_enum };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
var require_workflow_state_enum = /* @__PURE__ */ __commonJSMin(((e) => {
|
|
3
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.WorkflowState = void 0;
|
|
4
|
+
var t;
|
|
5
|
+
(function(e) {
|
|
6
|
+
e.Pending = "pending", e.Running = "running", e.Waiting = "waiting", e.Completed = "completed", e.Failed = "failed", e.Canceled = "canceled";
|
|
7
|
+
})(t || (e.WorkflowState = t = {}));
|
|
8
|
+
}));
|
|
9
|
+
export default require_workflow_state_enum();
|
|
10
|
+
export { require_workflow_state_enum };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useStudio } from "../providers/StudioProvider.js";
|
|
2
2
|
import { Alert } from "../components/ui/alert.js";
|
|
3
3
|
import MainLayout_default from "../components/layout/MainLayout.js";
|
|
4
|
-
import LoadingCentered_default from "../components/LoadingCentered.js";
|
|
4
|
+
import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
|
|
5
5
|
import Dashboard from "../features/dashboard/Dashboard.js";
|
|
6
6
|
import { useDashboardStats } from "../hooks/useDashboard.js";
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
package/dist/pages/DebugPage.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { useStudio } from "../providers/StudioProvider.js";
|
|
2
|
-
import { useApiClient } from "../hooks/useApi.js";
|
|
3
|
-
import "../hooks/index.js";
|
|
4
2
|
import { c } from "react/compiler-runtime";
|
|
5
3
|
import { jsxs } from "react/jsx-runtime";
|
|
6
4
|
var DebugPage_default = () => {
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
] }),
|
|
5
|
+
let r = c(10), { environment: i } = useStudio(), a = i?.name, o;
|
|
6
|
+
r[0] === a ? o = r[1] : (o = /* @__PURE__ */ jsxs("p", { children: ["Name: ", a] }), r[0] = a, r[1] = o);
|
|
7
|
+
let s = i?.id, l;
|
|
8
|
+
r[2] === s ? l = r[3] : (l = /* @__PURE__ */ jsxs("p", { children: ["Id: ", s] }), r[2] = s, r[3] = l);
|
|
9
|
+
let u = i?.url, d;
|
|
10
|
+
r[4] === u ? d = r[5] : (d = /* @__PURE__ */ jsxs("p", { children: ["URL: ", u] }), r[4] = u, r[5] = d);
|
|
11
|
+
let f;
|
|
12
|
+
return r[6] !== o || r[7] !== l || r[8] !== d ? (f = /* @__PURE__ */ jsxs("div", { children: [
|
|
13
|
+
o,
|
|
14
|
+
l,
|
|
15
|
+
d
|
|
16
|
+
] }), r[6] = o, r[7] = l, r[8] = d, r[9] = f) : f = r[9], f;
|
|
19
17
|
};
|
|
20
18
|
export { DebugPage_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useStudio } from "../providers/StudioProvider.js";
|
|
2
|
+
import { usePipelineConfigByName, usePipelineSource } from "../hooks/usePipelines.js";
|
|
2
3
|
import MainLayout_default from "../components/layout/MainLayout.js";
|
|
3
|
-
import { usePipelineConfig, usePipelineSource } from "../hooks/usePipelines.js";
|
|
4
4
|
import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
|
|
5
5
|
import ConfigFlowViewer_default from "../features/debug/components/ConfigFlowViewer.js";
|
|
6
6
|
import { c } from "react/compiler-runtime";
|
|
@@ -28,7 +28,7 @@ function DebugWorkflowDetailsPage() {
|
|
|
28
28
|
let m;
|
|
29
29
|
h[3] === g ? m = h[4] : (m = ["default", g], h[3] = g, h[4] = m), v = m;
|
|
30
30
|
}
|
|
31
|
-
let [y, b] = v, { data: x, isLoading: S } =
|
|
31
|
+
let [y, b] = v, { data: x, isLoading: S } = usePipelineConfigByName(y, b), { data: C, isLoading: w } = usePipelineSource(y, b), T = S || w, E;
|
|
32
32
|
h[5] === _ ? E = h[6] : (E = _.getDashboard(), h[5] = _, h[6] = E);
|
|
33
33
|
let D;
|
|
34
34
|
h[7] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), h[7] = D) : D = h[7];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useStudio } from "../providers/StudioProvider.js";
|
|
2
2
|
import { useApiClient } from "../hooks/useApi.js";
|
|
3
|
+
import { useWorkspaceConfig } from "../hooks/useConfig.js";
|
|
3
4
|
import { Badge } from "../components/ui/badge.js";
|
|
4
5
|
import MainLayout_default from "../components/layout/MainLayout.js";
|
|
5
6
|
import { DataTable } from "../components/data-table/DataTable.js";
|
|
6
|
-
import { useWorkspaceConfig } from "../hooks/useConfig.js";
|
|
7
7
|
import { useMemo, useState } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { useQueries } from "@tanstack/react-query";
|
|
@@ -16,11 +16,10 @@ function DebugWorkflowsPage() {
|
|
|
16
16
|
p
|
|
17
17
|
],
|
|
18
18
|
queryFn: async () => {
|
|
19
|
-
|
|
20
|
-
let c = await m.ApiV1ConfigApi.configControllerGetPipelineTypesByWorkspace({ workspaceBlockName: e.blockName });
|
|
19
|
+
let c = await m.config.getPipelineTypesByWorkspace({ workspaceBlockName: e.blockName });
|
|
21
20
|
return {
|
|
22
21
|
workspaceBlockName: e.blockName,
|
|
23
|
-
types: c
|
|
22
|
+
types: c
|
|
24
23
|
};
|
|
25
24
|
},
|
|
26
25
|
enabled: !!h?.length
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
|
|
2
|
-
import ErrorSnackbar_default from "../components/snackbars/ErrorSnackbar.js";
|
|
3
|
-
import LoadingCentered_default from "../components/LoadingCentered.js";
|
|
4
1
|
import { usePipeline } from "../hooks/usePipelines.js";
|
|
2
|
+
import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
|
|
3
|
+
import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
|
|
4
|
+
import { require_enums } from "../packages/contracts/dist/enums/index.js";
|
|
5
|
+
import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
|
|
5
6
|
import WorkflowItem_default from "../features/workbench/WorkflowItem.js";
|
|
7
|
+
import "../features/workbench/index.js";
|
|
6
8
|
import { requireParam } from "../lib/requireParam.js";
|
|
7
9
|
import { c } from "react/compiler-runtime";
|
|
8
10
|
import { useEffect, useRef } from "react";
|
|
9
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
12
|
import { useParams } from "react-router-dom";
|
|
11
|
-
var EMBED_MESSAGE_TYPE = "loopstack:embed:workflow-completed", EMBED_RESIZE_MESSAGE_TYPE = "loopstack:embed:resize";
|
|
13
|
+
var import_enums = require_enums(), EMBED_MESSAGE_TYPE = "loopstack:embed:workflow-completed", EMBED_RESIZE_MESSAGE_TYPE = "loopstack:embed:resize";
|
|
12
14
|
function EmbedWorkbenchPage() {
|
|
13
15
|
let _ = c(24), v = useParams(), y;
|
|
14
16
|
_[0] === v ? y = _[1] : (y = requireParam(v, "pipelineId"), _[0] = v, _[1] = y);
|
|
@@ -68,6 +70,6 @@ function EmbedWorkbenchPage() {
|
|
|
68
70
|
}
|
|
69
71
|
function _temp2() {}
|
|
70
72
|
function _temp(t) {
|
|
71
|
-
return t.status ===
|
|
73
|
+
return t.status === import_enums.WorkflowState.Completed;
|
|
72
74
|
}
|
|
73
75
|
export { EmbedWorkbenchPage as default };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { useStudio } from "../providers/StudioProvider.js";
|
|
2
|
+
import { usePipeline, usePipelineConfigByName } from "../hooks/usePipelines.js";
|
|
2
3
|
import { useWorkspace } from "../hooks/useWorkspaces.js";
|
|
3
|
-
import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
|
|
4
4
|
import MainLayout_default from "../components/layout/MainLayout.js";
|
|
5
|
-
import ErrorSnackbar_default from "../components/
|
|
6
|
-
import { usePipeline, usePipelineConfig } from "../hooks/usePipelines.js";
|
|
5
|
+
import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
|
|
7
6
|
import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import PipelineDebugHeader_default from "../features/debug/components/PipelineDebugHeader.js";
|
|
7
|
+
import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
|
|
10
8
|
import PipelineFlowViewer_default from "../features/debug/components/PipelineFlowViewer.js";
|
|
9
|
+
import PipelineDebugHeader_default from "../features/debug/components/PipelineDebugHeader.js";
|
|
10
|
+
import "../features/debug/index.js";
|
|
11
|
+
import { requireParam } from "../lib/requireParam.js";
|
|
11
12
|
import { c } from "react/compiler-runtime";
|
|
12
13
|
import React, { useMemo } from "react";
|
|
13
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -18,7 +19,7 @@ var PipelineDebugPage_default = () => {
|
|
|
18
19
|
v[0] === b ? x = v[1] : (x = requireParam(b, "pipelineId"), v[0] = b, v[1] = x);
|
|
19
20
|
let S = x, C = usePipeline(S), w = C.data?.workspaceId, T = useWorkspace(w), E = useFetchWorkflowsByPipeline(S), D;
|
|
20
21
|
v[2] === E.data ? D = v[3] : (D = E.data ?? [], v[2] = E.data, v[3] = D);
|
|
21
|
-
let O = D, k = T.data?.blockName, A = C.data?.blockName, j =
|
|
22
|
+
let O = D, k = T.data?.blockName, A = C.data?.blockName, j = usePipelineConfigByName(k, A), M;
|
|
22
23
|
v[4] === y ? M = v[5] : (M = y.getDashboard(), v[4] = y, v[5] = M);
|
|
23
24
|
let N;
|
|
24
25
|
v[6] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), v[6] = N) : N = v[6];
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import { useStudio } from "../providers/StudioProvider.js";
|
|
2
|
+
import { useFilterPipelines, usePipeline, usePipelineConfigByName } from "../hooks/usePipelines.js";
|
|
3
|
+
import { useWorkspace } from "../hooks/useWorkspaces.js";
|
|
4
|
+
import { Button } from "../components/ui/button.js";
|
|
5
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../components/ui/collapsible.js";
|
|
6
|
+
import { SidebarMenu, SidebarProvider } from "../components/ui/sidebar.js";
|
|
7
|
+
import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
|
|
8
|
+
import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
|
|
9
|
+
import { require_enums } from "../packages/contracts/dist/enums/index.js";
|
|
10
|
+
import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
|
|
11
|
+
import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
|
|
12
|
+
import PipelineFlowViewer_default from "../features/debug/components/PipelineFlowViewer.js";
|
|
13
|
+
import "../features/debug/index.js";
|
|
14
|
+
import WorkflowItem_default from "../features/workbench/WorkflowItem.js";
|
|
15
|
+
import WorkflowButtons_default from "../features/workbench/components/buttons/WorkflowButtons.js";
|
|
16
|
+
import { useNamespaceTree } from "../hooks/useNamespaceTree.js";
|
|
17
|
+
import WorkbenchNavigation_default from "../features/workbench/WorkbenchNavigation.js";
|
|
18
|
+
import PipelineHistoryList_default from "../features/workbench/components/PipelineHistoryList.js";
|
|
19
|
+
import { NewRunDialog } from "../features/workbench/components/NewRunDialog.js";
|
|
20
|
+
import "../features/workbench/index.js";
|
|
21
|
+
import { c } from "react/compiler-runtime";
|
|
22
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
23
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { useNavigate, useParams } from "react-router-dom";
|
|
25
|
+
import { ChevronDown, ChevronRight, ListOrdered, Loader2, Navigation, Play, ScrollText, Workflow } from "lucide-react";
|
|
26
|
+
import { formatDistanceToNow } from "date-fns";
|
|
27
|
+
var import_enums = require_enums(), EMBED_MESSAGE_TYPE = "loopstack:embed:workflow-completed", EMBED_RESIZE_MESSAGE_TYPE = "loopstack:embed:resize", EMBED_NEW_RUN_MESSAGE_TYPE = "loopstack:embed:new-run";
|
|
28
|
+
function PreviewWorkbenchPage() {
|
|
29
|
+
let e = c(5), { pipelineId: t } = useParams(), [n, r] = useState(!1), i;
|
|
30
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = (e) => {
|
|
31
|
+
r(!1), window.parent !== window && window.parent.postMessage({
|
|
32
|
+
type: EMBED_NEW_RUN_MESSAGE_TYPE,
|
|
33
|
+
pipelineId: e
|
|
34
|
+
}, window.location.origin);
|
|
35
|
+
}, e[0] = i) : i = e[0];
|
|
36
|
+
let a = i;
|
|
37
|
+
if (!t) {
|
|
38
|
+
let t;
|
|
39
|
+
return e[1] === n ? t = e[2] : (t = /* @__PURE__ */ jsx(PreviewEmptyState, {
|
|
40
|
+
newRunDialogOpen: n,
|
|
41
|
+
onNewRunDialogOpenChange: r,
|
|
42
|
+
onNewRunSuccess: a
|
|
43
|
+
}), e[1] = n, e[2] = t), t;
|
|
44
|
+
}
|
|
45
|
+
let o;
|
|
46
|
+
return e[3] === t ? o = e[4] : (o = /* @__PURE__ */ jsx(PreviewWorkbenchContent, {
|
|
47
|
+
pipelineId: t,
|
|
48
|
+
onNewRunSuccess: a
|
|
49
|
+
}), e[3] = t, e[4] = o), o;
|
|
50
|
+
}
|
|
51
|
+
function PreviewWorkbenchContent(e) {
|
|
52
|
+
let t = c(57), { pipelineId: o, onNewRunSuccess: s } = e, l = useRef(null), [u, d] = useState("output"), [m, y] = useState(!1), b = usePipeline(o), x = useFetchWorkflowsByPipeline(o), C;
|
|
53
|
+
t[0] === x.data ? C = t[1] : (C = x.data ?? [], t[0] = x.data, t[1] = C);
|
|
54
|
+
let T = C, E = useRef(!1), D = b.data?.workspaceId, ge = useWorkspace(D).data?.blockName, _e = b.data?.blockName, O = usePipelineConfigByName(ge, _e), k, A;
|
|
55
|
+
t[2] !== x.data || t[3] !== o ? (k = () => {
|
|
56
|
+
!x.data || E.current || x.data.length > 0 && x.data.every(_temp) && window.parent !== window && (E.current = !0, window.parent.postMessage({
|
|
57
|
+
type: EMBED_MESSAGE_TYPE,
|
|
58
|
+
pipelineId: o
|
|
59
|
+
}, window.location.origin));
|
|
60
|
+
}, A = [x.data, o], t[2] = x.data, t[3] = o, t[4] = k, t[5] = A) : (k = t[4], A = t[5]), useEffect(k, A);
|
|
61
|
+
let j, M;
|
|
62
|
+
t[6] === o ? (j = t[7], M = t[8]) : (j = () => {
|
|
63
|
+
if (window.parent === window || !l.current) return;
|
|
64
|
+
let e = new ResizeObserver(() => {
|
|
65
|
+
if (!l.current) return;
|
|
66
|
+
let e = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
|
|
67
|
+
window.parent.postMessage({
|
|
68
|
+
type: EMBED_RESIZE_MESSAGE_TYPE,
|
|
69
|
+
pipelineId: o,
|
|
70
|
+
height: e
|
|
71
|
+
}, window.location.origin);
|
|
72
|
+
});
|
|
73
|
+
return e.observe(l.current), () => e.disconnect();
|
|
74
|
+
}, M = [o], t[6] = o, t[7] = j, t[8] = M), useEffect(j, M);
|
|
75
|
+
let N;
|
|
76
|
+
t[9] === s ? N = t[10] : (N = (e) => {
|
|
77
|
+
y(!1), s(e);
|
|
78
|
+
}, t[9] = s, t[10] = N);
|
|
79
|
+
let P = N, F = _temp2, I;
|
|
80
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (I = {
|
|
81
|
+
enableDebugMode: !1,
|
|
82
|
+
showFullMessageHistory: !1
|
|
83
|
+
}, t[11] = I) : I = t[11];
|
|
84
|
+
let L = I, R;
|
|
85
|
+
t[12] === Symbol.for("react.memo_cache_sentinel") ? (R = {
|
|
86
|
+
value: "output",
|
|
87
|
+
label: "Output",
|
|
88
|
+
icon: /* @__PURE__ */ jsx(ScrollText, { className: "h-3.5 w-3.5" })
|
|
89
|
+
}, t[12] = R) : R = t[12];
|
|
90
|
+
let z;
|
|
91
|
+
t[13] === Symbol.for("react.memo_cache_sentinel") ? (z = {
|
|
92
|
+
value: "graph",
|
|
93
|
+
label: "Graph",
|
|
94
|
+
icon: /* @__PURE__ */ jsx(Workflow, { className: "h-3.5 w-3.5" })
|
|
95
|
+
}, t[13] = z) : z = t[13];
|
|
96
|
+
let B;
|
|
97
|
+
t[14] === Symbol.for("react.memo_cache_sentinel") ? (B = [
|
|
98
|
+
R,
|
|
99
|
+
z,
|
|
100
|
+
{
|
|
101
|
+
value: "run-log",
|
|
102
|
+
label: "Run Log",
|
|
103
|
+
icon: /* @__PURE__ */ jsx(ListOrdered, { className: "h-3.5 w-3.5" })
|
|
104
|
+
}
|
|
105
|
+
], t[14] = B) : B = t[14];
|
|
106
|
+
let V = B, H;
|
|
107
|
+
t[15] === u ? H = t[16] : (H = /* @__PURE__ */ jsx("div", {
|
|
108
|
+
className: "bg-background flex items-center rounded-md border p-0.5",
|
|
109
|
+
children: V.map((e) => /* @__PURE__ */ jsxs("button", {
|
|
110
|
+
onClick: () => d(e.value),
|
|
111
|
+
className: `flex items-center gap-1.5 rounded-sm px-2.5 py-1 text-xs font-medium transition-colors ${u === e.value ? "bg-foreground text-background shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
112
|
+
children: [e.icon, e.label]
|
|
113
|
+
}, e.value))
|
|
114
|
+
}), t[15] = u, t[16] = H);
|
|
115
|
+
let U;
|
|
116
|
+
t[17] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ jsxs(Button, {
|
|
117
|
+
variant: "outline",
|
|
118
|
+
size: "sm",
|
|
119
|
+
className: "h-7 gap-1.5",
|
|
120
|
+
onClick: () => y(!0),
|
|
121
|
+
children: [/* @__PURE__ */ jsx(Play, { className: "h-3 w-3" }), "New Run"]
|
|
122
|
+
}), t[17] = U) : U = t[17];
|
|
123
|
+
let W;
|
|
124
|
+
t[18] === H ? W = t[19] : (W = /* @__PURE__ */ jsxs("div", {
|
|
125
|
+
className: "bg-muted/50 flex h-11 shrink-0 items-center justify-between border-b px-3",
|
|
126
|
+
children: [H, U]
|
|
127
|
+
}), t[18] = H, t[19] = W);
|
|
128
|
+
let G;
|
|
129
|
+
t[20] === b.error ? G = t[21] : (G = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: b.error }), t[20] = b.error, t[21] = G);
|
|
130
|
+
let K;
|
|
131
|
+
t[22] === x.error ? K = t[23] : (K = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: x.error }), t[22] = x.error, t[23] = K);
|
|
132
|
+
let q;
|
|
133
|
+
t[24] !== u || t[25] !== b.data || t[26] !== b.isLoading || t[27] !== x.data || t[28] !== x.isLoading ? (q = u === "output" && /* @__PURE__ */ jsx("div", {
|
|
134
|
+
className: "px-4 py-3",
|
|
135
|
+
children: /* @__PURE__ */ jsx(LoadingCentered_default, {
|
|
136
|
+
loading: b.isLoading || x.isLoading,
|
|
137
|
+
children: b.data && x.data ? x.data.map((e) => /* @__PURE__ */ jsx(EmbedWorkflowSection, {
|
|
138
|
+
workflow: e,
|
|
139
|
+
pipeline: b.data,
|
|
140
|
+
collapsible: x.data.length > 1,
|
|
141
|
+
children: /* @__PURE__ */ jsx(WorkflowItem_default, {
|
|
142
|
+
pipeline: b.data,
|
|
143
|
+
workflowId: e.id,
|
|
144
|
+
scrollTo: F,
|
|
145
|
+
settings: L
|
|
146
|
+
})
|
|
147
|
+
}, e.id)) : null
|
|
148
|
+
})
|
|
149
|
+
}), t[24] = u, t[25] = b.data, t[26] = b.isLoading, t[27] = x.data, t[28] = x.isLoading, t[29] = q) : q = t[29];
|
|
150
|
+
let J;
|
|
151
|
+
t[30] !== u || t[31] !== b.isLoading || t[32] !== O || t[33] !== x.isLoading || t[34] !== o || t[35] !== T ? (J = u === "graph" && /* @__PURE__ */ jsx("div", {
|
|
152
|
+
className: "h-full",
|
|
153
|
+
children: /* @__PURE__ */ jsx(LoadingCentered_default, {
|
|
154
|
+
loading: b.isLoading || x.isLoading,
|
|
155
|
+
children: T.length > 0 ? /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(PipelineFlowViewer_default, {
|
|
156
|
+
pipelineId: o,
|
|
157
|
+
workflows: T,
|
|
158
|
+
pipelineConfig: O.data
|
|
159
|
+
}) }) : /* @__PURE__ */ jsx("div", {
|
|
160
|
+
className: "text-muted-foreground flex h-full items-center justify-center",
|
|
161
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
162
|
+
className: "text-sm",
|
|
163
|
+
children: "No workflows found"
|
|
164
|
+
})
|
|
165
|
+
})
|
|
166
|
+
})
|
|
167
|
+
}), t[30] = u, t[31] = b.isLoading, t[32] = O, t[33] = x.isLoading, t[34] = o, t[35] = T, t[36] = J) : J = t[36];
|
|
168
|
+
let Y;
|
|
169
|
+
t[37] !== u || t[38] !== b.data ? (Y = u === "run-log" && /* @__PURE__ */ jsx("div", {
|
|
170
|
+
className: "px-4",
|
|
171
|
+
children: /* @__PURE__ */ jsx(PipelineHistoryList_default, { pipeline: b.data })
|
|
172
|
+
}), t[37] = u, t[38] = b.data, t[39] = Y) : Y = t[39];
|
|
173
|
+
let X;
|
|
174
|
+
t[40] !== u || t[41] !== o ? (X = u === "navigate" && /* @__PURE__ */ jsx("div", {
|
|
175
|
+
className: "px-4 py-2",
|
|
176
|
+
children: /* @__PURE__ */ jsx(EmbedNavigationContent, { pipelineId: o })
|
|
177
|
+
}), t[40] = u, t[41] = o, t[42] = X) : X = t[42];
|
|
178
|
+
let Z;
|
|
179
|
+
t[43] !== G || t[44] !== K || t[45] !== q || t[46] !== J || t[47] !== Y || t[48] !== X ? (Z = /* @__PURE__ */ jsxs("div", {
|
|
180
|
+
className: "flex-1 overflow-auto",
|
|
181
|
+
children: [
|
|
182
|
+
G,
|
|
183
|
+
K,
|
|
184
|
+
q,
|
|
185
|
+
J,
|
|
186
|
+
Y,
|
|
187
|
+
X
|
|
188
|
+
]
|
|
189
|
+
}), t[43] = G, t[44] = K, t[45] = q, t[46] = J, t[47] = Y, t[48] = X, t[49] = Z) : Z = t[49];
|
|
190
|
+
let Q;
|
|
191
|
+
t[50] !== P || t[51] !== m ? (Q = /* @__PURE__ */ jsx(NewRunDialog, {
|
|
192
|
+
open: m,
|
|
193
|
+
onOpenChange: y,
|
|
194
|
+
onSuccess: P
|
|
195
|
+
}), t[50] = P, t[51] = m, t[52] = Q) : Q = t[52];
|
|
196
|
+
let $;
|
|
197
|
+
return t[53] !== W || t[54] !== Z || t[55] !== Q ? ($ = /* @__PURE__ */ jsxs("div", {
|
|
198
|
+
ref: l,
|
|
199
|
+
className: "flex h-screen flex-col overflow-hidden",
|
|
200
|
+
children: [
|
|
201
|
+
W,
|
|
202
|
+
Z,
|
|
203
|
+
Q
|
|
204
|
+
]
|
|
205
|
+
}), t[53] = W, t[54] = Z, t[55] = Q, t[56] = $) : $ = t[56], $;
|
|
206
|
+
}
|
|
207
|
+
function _temp2() {}
|
|
208
|
+
function _temp(e) {
|
|
209
|
+
return e.status === import_enums.WorkflowState.Completed;
|
|
210
|
+
}
|
|
211
|
+
var STATUS_DOT_COLORS = {
|
|
212
|
+
completed: "bg-green-500",
|
|
213
|
+
running: "bg-blue-500",
|
|
214
|
+
failed: "bg-red-500",
|
|
215
|
+
paused: "bg-yellow-500",
|
|
216
|
+
canceled: "bg-orange-500",
|
|
217
|
+
pending: "bg-muted-foreground"
|
|
218
|
+
};
|
|
219
|
+
function PreviewEmptyState(n) {
|
|
220
|
+
let r = c(24), { newRunDialogOpen: i, onNewRunDialogOpenChange: o, onNewRunSuccess: s } = n, l = useNavigate(), { router: u } = useStudio(), [d, f] = useState(3), p;
|
|
221
|
+
r[0] === Symbol.for("react.memo_cache_sentinel") ? (p = { parentId: null }, r[0] = p) : p = r[0];
|
|
222
|
+
let m = useFilterPipelines(void 0, p, "createdAt", "DESC", 0, d), h;
|
|
223
|
+
r[1] === m.data?.data ? h = r[2] : (h = m.data?.data ?? [], r[1] = m.data?.data, r[2] = h);
|
|
224
|
+
let g = h, _ = m.data?.total ?? 0, v = g.length < _, y;
|
|
225
|
+
r[3] === o ? y = r[4] : (y = () => o(!0), r[3] = o, r[4] = y);
|
|
226
|
+
let b;
|
|
227
|
+
r[5] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ jsx(Play, { className: "h-3.5 w-3.5" }), r[5] = b) : b = r[5];
|
|
228
|
+
let x;
|
|
229
|
+
r[6] === y ? x = r[7] : (x = /* @__PURE__ */ jsx("div", {
|
|
230
|
+
className: "flex justify-center",
|
|
231
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
232
|
+
variant: "secondary",
|
|
233
|
+
size: "sm",
|
|
234
|
+
className: "gap-1.5",
|
|
235
|
+
onClick: y,
|
|
236
|
+
children: [b, "New Run"]
|
|
237
|
+
})
|
|
238
|
+
}), r[6] = y, r[7] = x);
|
|
239
|
+
let S;
|
|
240
|
+
r[8] !== m.isLoading || r[9] !== v || r[10] !== l || r[11] !== g || r[12] !== u ? (S = m.isLoading && g.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
241
|
+
className: "flex justify-center py-4",
|
|
242
|
+
children: /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground h-4 w-4 animate-spin" })
|
|
243
|
+
}) : g.length > 0 ? /* @__PURE__ */ jsxs("div", { children: [
|
|
244
|
+
/* @__PURE__ */ jsx("p", {
|
|
245
|
+
className: "text-muted-foreground mb-2 text-xs font-medium",
|
|
246
|
+
children: "Recent"
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ jsx("div", {
|
|
249
|
+
className: "max-h-[280px] overflow-auto",
|
|
250
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
251
|
+
className: "divide-border divide-y",
|
|
252
|
+
children: g.map((e) => /* @__PURE__ */ jsx(RecentRunItem, {
|
|
253
|
+
pipeline: e,
|
|
254
|
+
onClick: () => void l(u.getPreviewPipeline(e.id))
|
|
255
|
+
}, e.id))
|
|
256
|
+
})
|
|
257
|
+
}),
|
|
258
|
+
v && /* @__PURE__ */ jsxs("button", {
|
|
259
|
+
className: "text-muted-foreground hover:text-foreground mt-2 flex w-full items-center justify-center gap-1 py-1 text-xs transition-colors",
|
|
260
|
+
onClick: () => f(_temp3),
|
|
261
|
+
children: [/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" }), "Load more"]
|
|
262
|
+
})
|
|
263
|
+
] }) : null, r[8] = m.isLoading, r[9] = v, r[10] = l, r[11] = g, r[12] = u, r[13] = S) : S = r[13];
|
|
264
|
+
let C;
|
|
265
|
+
r[14] !== x || r[15] !== S ? (C = /* @__PURE__ */ jsxs("div", {
|
|
266
|
+
className: "w-full max-w-sm space-y-6 px-4",
|
|
267
|
+
children: [x, S]
|
|
268
|
+
}), r[14] = x, r[15] = S, r[16] = C) : C = r[16];
|
|
269
|
+
let w;
|
|
270
|
+
r[17] !== i || r[18] !== o || r[19] !== s ? (w = /* @__PURE__ */ jsx(NewRunDialog, {
|
|
271
|
+
open: i,
|
|
272
|
+
onOpenChange: o,
|
|
273
|
+
onSuccess: s
|
|
274
|
+
}), r[17] = i, r[18] = o, r[19] = s, r[20] = w) : w = r[20];
|
|
275
|
+
let T;
|
|
276
|
+
return r[21] !== C || r[22] !== w ? (T = /* @__PURE__ */ jsxs("div", {
|
|
277
|
+
className: "flex h-screen flex-col items-center justify-center",
|
|
278
|
+
children: [C, w]
|
|
279
|
+
}), r[21] = C, r[22] = w, r[23] = T) : T = r[23], T;
|
|
280
|
+
}
|
|
281
|
+
function _temp3(e) {
|
|
282
|
+
return e + 5;
|
|
283
|
+
}
|
|
284
|
+
function RecentRunItem(e) {
|
|
285
|
+
let t = c(17), { pipeline: n, onClick: r } = e, i = `h-1.5 w-1.5 shrink-0 rounded-full ${STATUS_DOT_COLORS[n.status] ?? "bg-muted-foreground"}`, a;
|
|
286
|
+
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ jsx("span", { className: i }), t[0] = i, t[1] = a);
|
|
287
|
+
let o;
|
|
288
|
+
t[2] !== n.blockName || t[3] !== n.run ? (o = /* @__PURE__ */ jsxs("span", {
|
|
289
|
+
className: "truncate text-sm font-medium",
|
|
290
|
+
children: [
|
|
291
|
+
"Run #",
|
|
292
|
+
n.run,
|
|
293
|
+
" · ",
|
|
294
|
+
n.blockName
|
|
295
|
+
]
|
|
296
|
+
}), t[2] = n.blockName, t[3] = n.run, t[4] = o) : o = t[4];
|
|
297
|
+
let s;
|
|
298
|
+
t[5] !== a || t[6] !== o ? (s = /* @__PURE__ */ jsxs("div", {
|
|
299
|
+
className: "flex items-center gap-2",
|
|
300
|
+
children: [a, o]
|
|
301
|
+
}), t[5] = a, t[6] = o, t[7] = s) : s = t[7];
|
|
302
|
+
let l = n.status, u;
|
|
303
|
+
t[8] === n.createdAt ? u = t[9] : (u = formatDistanceToNow(new Date(n.createdAt), { addSuffix: !0 }), t[8] = n.createdAt, t[9] = u);
|
|
304
|
+
let d;
|
|
305
|
+
t[10] !== n.status || t[11] !== u ? (d = /* @__PURE__ */ jsxs("p", {
|
|
306
|
+
className: "text-muted-foreground mt-0.5 pl-3.5 text-xs",
|
|
307
|
+
children: [
|
|
308
|
+
l,
|
|
309
|
+
" · ",
|
|
310
|
+
u
|
|
311
|
+
]
|
|
312
|
+
}), t[10] = n.status, t[11] = u, t[12] = d) : d = t[12];
|
|
313
|
+
let f;
|
|
314
|
+
return t[13] !== r || t[14] !== s || t[15] !== d ? (f = /* @__PURE__ */ jsxs("button", {
|
|
315
|
+
className: "hover:bg-accent w-full rounded-md px-2 py-2.5 text-left transition-colors",
|
|
316
|
+
onClick: r,
|
|
317
|
+
children: [s, d]
|
|
318
|
+
}), t[13] = r, t[14] = s, t[15] = d, t[16] = f) : f = t[16], f;
|
|
319
|
+
}
|
|
320
|
+
function EmbedWorkflowSection(e) {
|
|
321
|
+
let t = c(29), { workflow: n, pipeline: r, collapsible: i, children: a } = e;
|
|
322
|
+
if (!i) {
|
|
323
|
+
let e;
|
|
324
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(Play, { className: "text-primary h-3.5 w-3.5 fill-current" }), t[0] = e) : e = t[0];
|
|
325
|
+
let i = n.title ?? n.blockName, o;
|
|
326
|
+
t[1] === i ? o = t[2] : (o = /* @__PURE__ */ jsx("span", {
|
|
327
|
+
className: "flex-1 truncate text-sm",
|
|
328
|
+
children: i
|
|
329
|
+
}), t[1] = i, t[2] = o);
|
|
330
|
+
let s;
|
|
331
|
+
t[3] !== r || t[4] !== n.id ? (s = /* @__PURE__ */ jsx(WorkflowButtons_default, {
|
|
332
|
+
pipeline: r,
|
|
333
|
+
workflowId: n.id
|
|
334
|
+
}), t[3] = r, t[4] = n.id, t[5] = s) : s = t[5];
|
|
335
|
+
let l;
|
|
336
|
+
t[6] !== o || t[7] !== s ? (l = /* @__PURE__ */ jsxs("div", {
|
|
337
|
+
className: "flex items-center gap-2 p-2 text-sm font-medium",
|
|
338
|
+
children: [
|
|
339
|
+
e,
|
|
340
|
+
o,
|
|
341
|
+
s
|
|
342
|
+
]
|
|
343
|
+
}), t[6] = o, t[7] = s, t[8] = l) : l = t[8];
|
|
344
|
+
let u;
|
|
345
|
+
t[9] === a ? u = t[10] : (u = /* @__PURE__ */ jsx("div", {
|
|
346
|
+
className: "py-1",
|
|
347
|
+
children: a
|
|
348
|
+
}), t[9] = a, t[10] = u);
|
|
349
|
+
let d;
|
|
350
|
+
return t[11] !== l || t[12] !== u ? (d = /* @__PURE__ */ jsxs("div", { children: [l, u] }), t[11] = l, t[12] = u, t[13] = d) : d = t[13], d;
|
|
351
|
+
}
|
|
352
|
+
let u;
|
|
353
|
+
t[14] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ jsx(Play, { className: "text-primary h-3.5 w-3.5 fill-current" }), t[14] = u) : u = t[14];
|
|
354
|
+
let d = n.title ?? n.blockName, f;
|
|
355
|
+
t[15] === d ? f = t[16] : (f = /* @__PURE__ */ jsx("span", {
|
|
356
|
+
className: "flex-1 truncate text-sm",
|
|
357
|
+
children: d
|
|
358
|
+
}), t[15] = d, t[16] = f);
|
|
359
|
+
let p;
|
|
360
|
+
t[17] !== r || t[18] !== n.id ? (p = /* @__PURE__ */ jsx(WorkflowButtons_default, {
|
|
361
|
+
pipeline: r,
|
|
362
|
+
workflowId: n.id
|
|
363
|
+
}), t[17] = r, t[18] = n.id, t[19] = p) : p = t[19];
|
|
364
|
+
let m;
|
|
365
|
+
t[20] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ jsx(ChevronRight, { className: "text-muted-foreground h-3.5 w-3.5 transition-transform group-data-[state=open]/collapsible:rotate-90" }), t[20] = m) : m = t[20];
|
|
366
|
+
let h;
|
|
367
|
+
t[21] !== f || t[22] !== p ? (h = /* @__PURE__ */ jsx(CollapsibleTrigger, {
|
|
368
|
+
asChild: !0,
|
|
369
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
370
|
+
className: "hover:bg-accent hover:text-accent-foreground group/trigger flex w-full items-center gap-2 rounded-md p-2 text-left text-sm font-medium",
|
|
371
|
+
children: [
|
|
372
|
+
u,
|
|
373
|
+
f,
|
|
374
|
+
p,
|
|
375
|
+
m
|
|
376
|
+
]
|
|
377
|
+
})
|
|
378
|
+
}), t[21] = f, t[22] = p, t[23] = h) : h = t[23];
|
|
379
|
+
let g;
|
|
380
|
+
t[24] === a ? g = t[25] : (g = /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", {
|
|
381
|
+
className: "py-1",
|
|
382
|
+
children: a
|
|
383
|
+
}) }), t[24] = a, t[25] = g);
|
|
384
|
+
let _;
|
|
385
|
+
return t[26] !== h || t[27] !== g ? (_ = /* @__PURE__ */ jsxs(Collapsible, {
|
|
386
|
+
defaultOpen: !0,
|
|
387
|
+
className: "group/collapsible",
|
|
388
|
+
children: [h, g]
|
|
389
|
+
}), t[26] = h, t[27] = g, t[28] = _) : _ = t[28], _;
|
|
390
|
+
}
|
|
391
|
+
function EmbedNavigationContent(e) {
|
|
392
|
+
let t = c(4), { pipelineId: n } = e, r = useNamespaceTree(n);
|
|
393
|
+
if (!r || r.length === 0) {
|
|
394
|
+
let e;
|
|
395
|
+
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsxs("div", {
|
|
396
|
+
className: "text-muted-foreground flex flex-col items-center justify-center gap-2 py-8",
|
|
397
|
+
children: [/* @__PURE__ */ jsx(Navigation, { className: "h-6 w-6" }), /* @__PURE__ */ jsx("span", {
|
|
398
|
+
className: "text-sm",
|
|
399
|
+
children: "No navigation items"
|
|
400
|
+
})]
|
|
401
|
+
}), t[0] = e) : e = t[0], e;
|
|
402
|
+
}
|
|
403
|
+
let i;
|
|
404
|
+
t[1] === Symbol.for("react.memo_cache_sentinel") ? (i = { "--sidebar-width": "100%" }, t[1] = i) : i = t[1];
|
|
405
|
+
let a;
|
|
406
|
+
return t[2] === r ? a = t[3] : (a = /* @__PURE__ */ jsx(SidebarProvider, {
|
|
407
|
+
defaultOpen: !0,
|
|
408
|
+
className: "min-h-0",
|
|
409
|
+
style: i,
|
|
410
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
411
|
+
className: "w-full overflow-auto",
|
|
412
|
+
children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(WorkbenchNavigation_default, {
|
|
413
|
+
namespaceTree: r,
|
|
414
|
+
indent: 0
|
|
415
|
+
}) })
|
|
416
|
+
})
|
|
417
|
+
}), t[2] = r, t[3] = a), a;
|
|
418
|
+
}
|
|
419
|
+
export { PreviewWorkbenchPage as default };
|