@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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import DocumentRenderer_default from "../DocumentRenderer.js";
|
|
1
2
|
import DocumentMetadataPills_default from "./DocumentMetadataPills.js";
|
|
2
|
-
import DocumentRenderer_default from "./DocumentRenderer.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { require_enums } from "../../../packages/contracts/dist/enums/index.js";
|
|
2
|
+
import DocumentItem_default from "./DocumentItem.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import React, { useEffect } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { useParams } from "react-router-dom";
|
|
7
|
+
var import_enums = require_enums(), DocumentList_default = (e) => {
|
|
8
|
+
let o = c(23), { pipeline: l, workflow: u, documents: d, scrollTo: f, settings: p } = e, { workflowId: m, clickId: h } = useParams(), g;
|
|
9
|
+
o[0] !== m || o[1] !== f || o[2] !== u.id ? (g = () => {
|
|
10
|
+
m === u.id && f(u.id);
|
|
11
|
+
}, o[0] = m, o[1] = f, o[2] = u.id, o[3] = g) : g = o[3];
|
|
12
|
+
let _;
|
|
13
|
+
o[4] !== h || o[5] !== m || o[6] !== f || o[7] !== u.id ? (_ = [
|
|
14
|
+
u.id,
|
|
15
|
+
m,
|
|
16
|
+
h,
|
|
17
|
+
f
|
|
18
|
+
], o[4] = h, o[5] = m, o[6] = f, o[7] = u.id, o[8] = _) : _ = o[8], useEffect(g, _);
|
|
19
|
+
let v = u.status === import_enums.WorkflowState.Waiting, y;
|
|
20
|
+
if (o[9] !== d || o[10] !== v || o[11] !== l || o[12] !== p || o[13] !== u) {
|
|
21
|
+
let e;
|
|
22
|
+
o[15] !== d.length || o[16] !== v || o[17] !== l || o[18] !== p || o[19] !== u ? (e = (e, a) => {
|
|
23
|
+
let o = e, s = e.place === u.place || !!o.meta?.enableAtPlaces?.includes(u.place);
|
|
24
|
+
return /* @__PURE__ */ jsx(DocumentItem_default, {
|
|
25
|
+
document: e,
|
|
26
|
+
workflow: u,
|
|
27
|
+
pipeline: l,
|
|
28
|
+
isActive: v && s,
|
|
29
|
+
isLastItem: a === d.length - 1,
|
|
30
|
+
settings: p
|
|
31
|
+
}, e.id);
|
|
32
|
+
}, o[15] = d.length, o[16] = v, o[17] = l, o[18] = p, o[19] = u, o[20] = e) : e = o[20], y = d.map(e), o[9] = d, o[10] = v, o[11] = l, o[12] = p, o[13] = u, o[14] = y;
|
|
33
|
+
} else y = o[14];
|
|
34
|
+
let b;
|
|
35
|
+
return o[21] === y ? b = o[22] : (b = /* @__PURE__ */ jsx("div", {
|
|
36
|
+
className: "flex flex-col gap-6",
|
|
37
|
+
children: y
|
|
38
|
+
}), o[21] = y, o[22] = b), b;
|
|
39
|
+
};
|
|
40
|
+
export { DocumentList_default as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Badge } from "../../../components/ui/badge.js";
|
|
2
2
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../../../components/ui/dialog.js";
|
|
3
|
-
import DocumentDetails_default from "
|
|
4
|
-
import PromptDetails_default from "
|
|
3
|
+
import DocumentDetails_default from "../document-details/DocumentDetails.js";
|
|
4
|
+
import PromptDetails_default from "../document-details/PromptDetails.js";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/features/{workbench/components → documents}/document-details/DocumentDetails.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "
|
|
2
|
-
import { Badge } from "
|
|
3
|
-
import { Card, CardContent } from "
|
|
1
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "../../../components/ui/accordion.js";
|
|
2
|
+
import { Badge } from "../../../components/ui/badge.js";
|
|
3
|
+
import { Card, CardContent } from "../../../components/ui/card.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "
|
|
2
|
-
import { Card, CardContent, CardHeader, CardTitle } from "
|
|
3
|
-
import CompletionMessagePaper_default from "
|
|
1
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "../../../components/ui/accordion.js";
|
|
2
|
+
import { Card, CardContent, CardHeader, CardTitle } from "../../../components/ui/card.js";
|
|
3
|
+
import CompletionMessagePaper_default from "../../../components/messages/CompletionMessagePaper.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import DocumentRenderer_default from "./DocumentRenderer.js";
|
|
2
|
+
import DocumentMetadataPills_default from "./components/DocumentMetadataPills.js";
|
|
3
|
+
import DocumentItem_default from "./components/DocumentItem.js";
|
|
4
|
+
import DocumentList_default from "./components/DocumentList.js";
|
package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessage.js
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getToolOrDynamicToolName, isReasoningUIPart, isTextUIPart, isToolOrDynamicToolUIPart } from "
|
|
2
|
-
import { Message, MessageAction, MessageActions, MessageContent, MessageResponse } from "
|
|
3
|
-
import { Reasoning, ReasoningContent, ReasoningTrigger } from "
|
|
4
|
-
import { Source, Sources, SourcesContent, SourcesTrigger } from "
|
|
5
|
-
import { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "
|
|
1
|
+
import { getToolOrDynamicToolName, isReasoningUIPart, isTextUIPart, isToolOrDynamicToolUIPart } from "../../../node_modules/ai/dist/index.js";
|
|
2
|
+
import { Message, MessageAction, MessageActions, MessageContent, MessageResponse } from "../../../components/ai-elements/message.js";
|
|
3
|
+
import { Reasoning, ReasoningContent, ReasoningTrigger } from "../../../components/ai-elements/reasoning.js";
|
|
4
|
+
import { Source, Sources, SourcesContent, SourcesTrigger } from "../../../components/ai-elements/sources.js";
|
|
5
|
+
import { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "../../../components/ai-elements/tool.js";
|
|
6
6
|
import { c } from "react/compiler-runtime";
|
|
7
7
|
import { Fragment } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "
|
|
1
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../components/ui/collapsible.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import Form_default from "
|
|
2
|
-
import { useRunPipeline } from "
|
|
3
|
-
import UiActions_default from "
|
|
1
|
+
import Form_default from "../../../components/dynamic-form/Form.js";
|
|
2
|
+
import { useRunPipeline } from "../../../hooks/useProcessor.js";
|
|
3
|
+
import UiActions_default from "../../../components/ui-widgets/UiActions.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import React, { useEffect } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { useForm } from "react-hook-form";
|
|
8
8
|
import "zod";
|
|
9
9
|
var DocumentFormRenderer_default = (l) => {
|
|
10
|
-
let u = c(
|
|
10
|
+
let u = c(39), { pipeline: d, workflow: f, document: p, enabled: m, viewOnly: h } = l, g = useRunPipeline(), _;
|
|
11
11
|
u[0] !== p.content || u[1] !== p.schema.type ? (_ = p.schema.type === "object" ? p.content : { raw: p.content }, u[0] = p.content, u[1] = p.schema.type, u[2] = _) : _ = u[2];
|
|
12
12
|
let v;
|
|
13
13
|
u[3] === _ ? v = u[4] : (v = {
|
|
@@ -52,15 +52,16 @@ var DocumentFormRenderer_default = (l) => {
|
|
|
52
52
|
let k = O, A = p.ui, j = p.schema, M = A?.form?.disabled, N = !m || M || !1, P;
|
|
53
53
|
u[22] === p.ui?.actions ? P = u[23] : (P = p.ui?.actions ?? [], u[22] = p.ui?.actions, u[23] = P);
|
|
54
54
|
let F = P, I = A ?? void 0, L = p.meta?.mimeType, R;
|
|
55
|
-
u[24] !== F || u[25] !== C || u[26] !== N || u[27] !== k || u[28] !== g.isPending ? (R = /* @__PURE__ */ jsx(UiActions_default, {
|
|
55
|
+
u[24] !== F || u[25] !== C || u[26] !== N || u[27] !== k || u[28] !== g.isPending || u[29] !== f.place ? (R = /* @__PURE__ */ jsx(UiActions_default, {
|
|
56
56
|
actions: F,
|
|
57
57
|
onSubmit: k,
|
|
58
58
|
availableTransitions: C,
|
|
59
|
+
currentPlace: f.place,
|
|
59
60
|
disabled: N,
|
|
60
61
|
isLoading: g.isPending
|
|
61
|
-
}), u[24] = F, u[25] = C, u[26] = N, u[27] = k, u[28] = g.isPending, u[29] = R) : R = u[
|
|
62
|
+
}), u[24] = F, u[25] = C, u[26] = N, u[27] = k, u[28] = g.isPending, u[29] = f.place, u[30] = R) : R = u[30];
|
|
62
63
|
let z;
|
|
63
|
-
return u[
|
|
64
|
+
return u[31] !== N || u[32] !== y || u[33] !== j || u[34] !== I || u[35] !== L || u[36] !== R || u[37] !== h ? (z = /* @__PURE__ */ jsx("div", {
|
|
64
65
|
className: "flex",
|
|
65
66
|
children: /* @__PURE__ */ jsx(Form_default, {
|
|
66
67
|
form: y,
|
|
@@ -71,7 +72,7 @@ var DocumentFormRenderer_default = (l) => {
|
|
|
71
72
|
viewOnly: h,
|
|
72
73
|
actions: R
|
|
73
74
|
})
|
|
74
|
-
}), u[
|
|
75
|
+
}), u[31] = N, u[32] = y, u[33] = j, u[34] = I, u[35] = L, u[36] = R, u[37] = h, u[38] = z) : z = u[38], z;
|
|
75
76
|
};
|
|
76
77
|
function _temp(e) {
|
|
77
78
|
return e.id;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import CompletionMessagePaper_default from "
|
|
1
|
+
import CompletionMessagePaper_default from "../../../components/messages/CompletionMessagePaper.js";
|
|
2
2
|
import AiMessageContent_default from "./AiMessageContent.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import React from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Alert, AlertDescription } from "
|
|
1
|
+
import { Alert, AlertDescription } from "../../../components/ui/alert.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import link_default from "
|
|
1
|
+
import link_default from "../../../components/loopstack-elements/link.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import CompletionMessagePaper_default from "
|
|
2
|
-
import MarkdownContent_default from "
|
|
1
|
+
import CompletionMessagePaper_default from "../../../components/messages/CompletionMessagePaper.js";
|
|
2
|
+
import MarkdownContent_default from "../../../components/dynamic-form/MarkdownContent.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import CompletionMessagePaper_default from "
|
|
1
|
+
import CompletionMessagePaper_default from "../../../components/messages/CompletionMessagePaper.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import LocalHealthCheck_default from "./LocalHealthCheck.js";
|
|
@@ -5,7 +5,7 @@ import { c } from "react/compiler-runtime";
|
|
|
5
5
|
import React, { useCallback, useEffect, useRef } from "react";
|
|
6
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
var OAuthPromptRenderer = ({ pipeline: l, workflow: u, document: m, isActive: h }) => {
|
|
8
|
-
let g = m.content, _ = (m.ui?.actions ?? []).
|
|
8
|
+
let g = m.content, _ = (m.ui?.actions ?? []).map((e) => e.options?.transition).find((e) => !!e), v = useRunPipeline(), { result: y, open: b, reset: x } = useOAuthPopup(), S = useRef(!1), C = u.availableTransitions?.map((e) => e.id) ?? [], w = useCallback((e, o) => {
|
|
9
9
|
!_ || !C.includes(_) || v.mutate({
|
|
10
10
|
pipelineId: l.id,
|
|
11
11
|
runPipelinePayloadDto: { transition: {
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { useStudio } from "../../providers/StudioProvider.js";
|
|
2
|
+
import { useBatchDeletePipeline, useDeletePipeline, useFilterPipelines } from "../../hooks/usePipelines.js";
|
|
3
|
+
import { useFilterWorkspaces } from "../../hooks/useWorkspaces.js";
|
|
4
|
+
import { Badge } from "../../components/ui/badge.js";
|
|
5
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../components/ui/tooltip.js";
|
|
6
|
+
import ListView_default from "../../components/lists/ListView.js";
|
|
7
|
+
import { useDebounce } from "../../hooks/useDebounce.js";
|
|
8
|
+
import { c } from "react/compiler-runtime";
|
|
9
|
+
import { useMemo, useState } from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
var statusColors = {
|
|
12
|
+
completed: "bg-green-50 text-green-900 border-green-200",
|
|
13
|
+
failed: "bg-destructive/10 text-destructive border-destructive/20",
|
|
14
|
+
canceled: "bg-orange-50 text-orange-900 border-orange-200",
|
|
15
|
+
running: "bg-blue-50 text-blue-900 border-blue-200",
|
|
16
|
+
paused: "bg-yellow-50 text-yellow-900 border-yellow-200",
|
|
17
|
+
pending: "bg-muted text-muted-foreground border-border"
|
|
18
|
+
}, Runs_default = (n) => {
|
|
19
|
+
let r = c(50), { defaultFilters: i } = n, a;
|
|
20
|
+
r[0] === i ? a = r[1] : (a = i === void 0 ? {} : i, r[0] = i, r[1] = a);
|
|
21
|
+
let o = a, { router: s } = useStudio(), [l, u] = useState(0), [d, f] = useState(10), [p, m] = useState("createdAt"), [h, g] = useState("DESC"), [_, v] = useState(), [y, b] = useState(o), me = useDebounce(_, 500), x;
|
|
22
|
+
r[2] === y ? x = r[3] : (x = {
|
|
23
|
+
...y,
|
|
24
|
+
parentId: null
|
|
25
|
+
}, r[2] = y, r[3] = x);
|
|
26
|
+
let S = useFilterPipelines(me, x, p, h, l, d), C;
|
|
27
|
+
r[4] === Symbol.for("react.memo_cache_sentinel") ? (C = {}, r[4] = C) : C = r[4];
|
|
28
|
+
let w = useFilterWorkspaces(void 0, C, "title", "ASC", 0, 100), T = useDeletePipeline(), E = useBatchDeletePipeline(), D;
|
|
29
|
+
if (r[5] !== w.data?.data) {
|
|
30
|
+
D = /* @__PURE__ */ new Map();
|
|
31
|
+
for (let e of w.data?.data ?? []) D.set(e.id, e.title);
|
|
32
|
+
r[5] = w.data?.data, r[6] = D;
|
|
33
|
+
} else D = r[6];
|
|
34
|
+
let O = D, k;
|
|
35
|
+
r[7] === w.data?.data ? k = r[8] : (k = w.data?.data ?? [], r[7] = w.data?.data, r[8] = k);
|
|
36
|
+
let A;
|
|
37
|
+
r[9] === k ? A = r[10] : (A = k.map(_temp), r[9] = k, r[10] = A);
|
|
38
|
+
let j = A, M;
|
|
39
|
+
if (r[11] !== S.data?.data) {
|
|
40
|
+
let e = /* @__PURE__ */ new Set();
|
|
41
|
+
for (let t of S.data?.data ?? []) t.blockName && e.add(t.blockName);
|
|
42
|
+
M = Array.from(e).sort(), r[11] = S.data?.data, r[12] = M;
|
|
43
|
+
} else M = r[12];
|
|
44
|
+
let N = M, P;
|
|
45
|
+
r[13] === T ? P = r[14] : (P = (e) => {
|
|
46
|
+
T.mutate(e);
|
|
47
|
+
}, r[13] = T, r[14] = P);
|
|
48
|
+
let F = P, I;
|
|
49
|
+
r[15] === E ? I = r[16] : (I = (e) => {
|
|
50
|
+
E.mutate(e);
|
|
51
|
+
}, r[15] = E, r[16] = I);
|
|
52
|
+
let L = I, R;
|
|
53
|
+
r[17] === s ? R = r[18] : (R = (e) => {
|
|
54
|
+
s.navigateToPipeline(e);
|
|
55
|
+
}, r[17] = s, r[18] = R);
|
|
56
|
+
let z = R, B = S.error ?? null, V;
|
|
57
|
+
r[19] === S.data?.data ? V = r[20] : (V = S.data?.data ?? [], r[19] = S.data?.data, r[20] = V);
|
|
58
|
+
let H = S.data?.total ?? 0, U;
|
|
59
|
+
r[21] === Symbol.for("react.memo_cache_sentinel") ? (U = {
|
|
60
|
+
id: "run",
|
|
61
|
+
label: "Run",
|
|
62
|
+
minWidth: 60,
|
|
63
|
+
format: _temp2
|
|
64
|
+
}, r[21] = U) : U = r[21];
|
|
65
|
+
let W;
|
|
66
|
+
r[22] === O ? W = r[23] : (W = {
|
|
67
|
+
id: "workspaceId",
|
|
68
|
+
label: "Workspace",
|
|
69
|
+
minWidth: 120,
|
|
70
|
+
format: (e) => {
|
|
71
|
+
let t = e;
|
|
72
|
+
return /* @__PURE__ */ jsx(Badge, {
|
|
73
|
+
variant: "outline",
|
|
74
|
+
className: "hover:bg-primary/10 cursor-pointer",
|
|
75
|
+
onClick: (e) => {
|
|
76
|
+
e.stopPropagation(), b((e) => ({
|
|
77
|
+
...e,
|
|
78
|
+
workspaceId: t
|
|
79
|
+
}));
|
|
80
|
+
},
|
|
81
|
+
children: O.get(t) ?? t.slice(0, 8)
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}, r[22] = O, r[23] = W);
|
|
85
|
+
let G, K, q, J;
|
|
86
|
+
r[24] === Symbol.for("react.memo_cache_sentinel") ? (G = {
|
|
87
|
+
id: "blockName",
|
|
88
|
+
label: "Type",
|
|
89
|
+
minWidth: 100,
|
|
90
|
+
format: (e) => {
|
|
91
|
+
let t = e;
|
|
92
|
+
return /* @__PURE__ */ jsx(Badge, {
|
|
93
|
+
variant: "outline",
|
|
94
|
+
className: "hover:bg-primary/10 cursor-pointer",
|
|
95
|
+
onClick: (e) => {
|
|
96
|
+
e.stopPropagation(), b((e) => ({
|
|
97
|
+
...e,
|
|
98
|
+
blockName: t
|
|
99
|
+
}));
|
|
100
|
+
},
|
|
101
|
+
children: t
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}, K = {
|
|
105
|
+
id: "title",
|
|
106
|
+
label: "Title",
|
|
107
|
+
minWidth: 150,
|
|
108
|
+
format: _temp3
|
|
109
|
+
}, q = {
|
|
110
|
+
id: "status",
|
|
111
|
+
label: "Status",
|
|
112
|
+
minWidth: 100,
|
|
113
|
+
format: _temp4
|
|
114
|
+
}, J = {
|
|
115
|
+
id: "createdAt",
|
|
116
|
+
label: "Date Created",
|
|
117
|
+
minWidth: 100,
|
|
118
|
+
format: _temp5
|
|
119
|
+
}, r[24] = G, r[25] = K, r[26] = q, r[27] = J) : (G = r[24], K = r[25], q = r[26], J = r[27]);
|
|
120
|
+
let Y;
|
|
121
|
+
r[28] === W ? Y = r[29] : (Y = [
|
|
122
|
+
U,
|
|
123
|
+
W,
|
|
124
|
+
G,
|
|
125
|
+
K,
|
|
126
|
+
q,
|
|
127
|
+
J
|
|
128
|
+
], r[28] = W, r[29] = Y);
|
|
129
|
+
let X = Y, Z;
|
|
130
|
+
r[30] === Symbol.for("react.memo_cache_sentinel") ? (Z = [
|
|
131
|
+
"pending",
|
|
132
|
+
"running",
|
|
133
|
+
"paused",
|
|
134
|
+
"completed",
|
|
135
|
+
"failed",
|
|
136
|
+
"canceled"
|
|
137
|
+
], r[30] = Z) : Z = r[30];
|
|
138
|
+
let Q;
|
|
139
|
+
r[31] !== N || r[32] !== j ? (Q = {
|
|
140
|
+
status: Z,
|
|
141
|
+
workspaceId: j,
|
|
142
|
+
blockName: N
|
|
143
|
+
}, r[31] = N, r[32] = j, r[33] = Q) : Q = r[33];
|
|
144
|
+
let $;
|
|
145
|
+
return r[34] !== S.isPending || r[35] !== y || r[36] !== L || r[37] !== F || r[38] !== z || r[39] !== h || r[40] !== p || r[41] !== l || r[42] !== d || r[43] !== _ || r[44] !== B || r[45] !== V || r[46] !== H || r[47] !== X || r[48] !== Q ? ($ = /* @__PURE__ */ jsx(ListView_default, {
|
|
146
|
+
loading: S.isPending,
|
|
147
|
+
error: B,
|
|
148
|
+
items: V,
|
|
149
|
+
totalItems: H,
|
|
150
|
+
setPage: u,
|
|
151
|
+
setRowsPerPage: f,
|
|
152
|
+
setOrderBy: m,
|
|
153
|
+
setOrder: g,
|
|
154
|
+
setSearchTerm: v,
|
|
155
|
+
setFilters: b,
|
|
156
|
+
orderBy: p,
|
|
157
|
+
order: h,
|
|
158
|
+
searchTerm: _,
|
|
159
|
+
filters: y,
|
|
160
|
+
page: l,
|
|
161
|
+
rowsPerPage: d,
|
|
162
|
+
deleteItem: F,
|
|
163
|
+
onClick: z,
|
|
164
|
+
enableBatchActions: !0,
|
|
165
|
+
batchDelete: L,
|
|
166
|
+
columns: X,
|
|
167
|
+
filterConfig: Q
|
|
168
|
+
}), r[34] = S.isPending, r[35] = y, r[36] = L, r[37] = F, r[38] = z, r[39] = h, r[40] = p, r[41] = l, r[42] = d, r[43] = _, r[44] = B, r[45] = V, r[46] = H, r[47] = X, r[48] = Q, r[49] = $) : $ = r[49], $;
|
|
169
|
+
};
|
|
170
|
+
function _temp(e) {
|
|
171
|
+
return {
|
|
172
|
+
label: e.title,
|
|
173
|
+
value: e.id
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function _temp2(e) {
|
|
177
|
+
let t = e;
|
|
178
|
+
return t == null ? "—" : `#${t}`;
|
|
179
|
+
}
|
|
180
|
+
function _temp3(e) {
|
|
181
|
+
let t = e;
|
|
182
|
+
return t ? /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
183
|
+
asChild: !0,
|
|
184
|
+
children: /* @__PURE__ */ jsx("span", { children: t.length > 40 ? t.slice(0, 40) + "..." : t })
|
|
185
|
+
}), t.length > 40 && /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: t }) })] }) }) : "—";
|
|
186
|
+
}
|
|
187
|
+
function _temp4(e) {
|
|
188
|
+
let t = e;
|
|
189
|
+
return /* @__PURE__ */ jsx(Badge, {
|
|
190
|
+
className: `rounded-full border px-2 py-1 text-xs whitespace-nowrap ${statusColors[t] || "bg-muted text-muted-foreground border-border"}`,
|
|
191
|
+
children: t
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
function _temp5(e) {
|
|
195
|
+
return new Date(e).toLocaleDateString();
|
|
196
|
+
}
|
|
197
|
+
export { Runs_default as default };
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
import { useStudio } from "../../providers/StudioProvider.js";
|
|
2
|
-
import { useFetchWorkflowsByNamespace } from "../../hooks/useWorkflows.js";
|
|
3
2
|
import { Skeleton } from "../../components/ui/skeleton.js";
|
|
4
3
|
import { SidebarMenuSubItem } from "../../components/ui/sidebar.js";
|
|
5
|
-
import {
|
|
4
|
+
import { useFetchWorkflowsByNamespace } from "../../hooks/useWorkflows.js";
|
|
5
|
+
import { useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
|
|
6
6
|
import NavigationItem_default from "./components/NavigationItem.js";
|
|
7
7
|
import { useScroll } from "./providers/ScrollProvider.js";
|
|
8
8
|
import { c } from "react/compiler-runtime";
|
|
9
|
-
import React
|
|
9
|
+
import React from "react";
|
|
10
10
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { useParams } from "react-router-dom";
|
|
12
|
-
var NavigationItems_default = (
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
let
|
|
18
|
-
if (
|
|
12
|
+
var NavigationItems_default = (p) => {
|
|
13
|
+
let m = c(17), { namespace: h } = p, { router: g } = useStudio(), { pipelineId: _, clickId: v } = useParams(), { activeSectionId: y } = useWorkbenchLayout(), b = useFetchWorkflowsByNamespace(h.id), { setScrollTo: x } = useScroll(), S;
|
|
14
|
+
m[0] !== v || m[1] !== _ || m[2] !== g || m[3] !== x ? (S = (e) => {
|
|
15
|
+
x(!0), _ && g.navigateToWorkflow(_, e, v);
|
|
16
|
+
}, m[0] = v, m[1] = _, m[2] = g, m[3] = x, m[4] = S) : S = m[4];
|
|
17
|
+
let C = S;
|
|
18
|
+
if (b.isPending) {
|
|
19
19
|
let e;
|
|
20
|
-
|
|
20
|
+
m[5] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxs("div", {
|
|
21
21
|
className: "flex items-center gap-2 p-2",
|
|
22
22
|
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4 rounded" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1" })]
|
|
23
|
-
}) }),
|
|
24
|
-
let
|
|
25
|
-
|
|
23
|
+
}) }), m[5] = e) : e = m[5];
|
|
24
|
+
let d;
|
|
25
|
+
m[6] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxs("div", {
|
|
26
26
|
className: "flex items-center gap-2 p-2",
|
|
27
27
|
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4 rounded" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1" })]
|
|
28
|
-
}) }),
|
|
29
|
-
let
|
|
30
|
-
return
|
|
28
|
+
}) }), m[6] = d) : d = m[6];
|
|
29
|
+
let f;
|
|
30
|
+
return m[7] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
31
31
|
e,
|
|
32
|
-
|
|
32
|
+
d,
|
|
33
33
|
/* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxs("div", {
|
|
34
34
|
className: "flex items-center gap-2 p-2",
|
|
35
35
|
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4 rounded" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1" })]
|
|
36
36
|
}) })
|
|
37
|
-
] }),
|
|
37
|
+
] }), m[7] = f) : f = m[7], f;
|
|
38
38
|
}
|
|
39
|
-
if (!
|
|
40
|
-
let
|
|
41
|
-
if (
|
|
39
|
+
if (!_ || !b.data?.length) return null;
|
|
40
|
+
let w;
|
|
41
|
+
if (m[8] !== y || m[9] !== b.data || m[10] !== C) {
|
|
42
42
|
let e;
|
|
43
|
-
|
|
43
|
+
m[12] !== y || m[13] !== C ? (e = (e) => /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(NavigationItem_default, {
|
|
44
44
|
workflow: e,
|
|
45
|
-
isSelected:
|
|
46
|
-
navigateTo:
|
|
47
|
-
}) }, `wf-${e.id}`),
|
|
48
|
-
} else
|
|
49
|
-
let
|
|
50
|
-
return
|
|
45
|
+
isSelected: y?.endsWith(e.id) ?? !1,
|
|
46
|
+
navigateTo: C
|
|
47
|
+
}) }, `wf-${e.id}`), m[12] = y, m[13] = C, m[14] = e) : e = m[14], w = b.data.map(e), m[8] = y, m[9] = b.data, m[10] = C, m[11] = w;
|
|
48
|
+
} else w = m[11];
|
|
49
|
+
let T;
|
|
50
|
+
return m[15] === w ? T = m[16] : (T = /* @__PURE__ */ jsx(Fragment$1, { children: w }), m[15] = w, m[16] = T), T;
|
|
51
51
|
};
|
|
52
52
|
export { NavigationItems_default as default };
|