@loopstack/loopstack-studio 0.22.0 → 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.
Files changed (82) hide show
  1. package/dist/app/EnvironmentEmbedRoot.js +20 -18
  2. package/dist/components/feedback/ErrorBoundary.js +43 -0
  3. package/dist/components/{LoadingCentered.js → feedback/LoadingCentered.js} +1 -1
  4. package/dist/components/feedback/index.js +5 -0
  5. package/dist/components/index.js +6 -3
  6. package/dist/components/layout/MainLayout.js +32 -16
  7. package/dist/components/layout/StudioSidebar.js +165 -0
  8. package/dist/components/ui-widgets/widgets/SandboxRun.js +1 -0
  9. package/dist/features/code-explorer/CodeExplorer.js +6 -0
  10. package/dist/features/code-explorer/components/CodeExplorerTree.js +5 -0
  11. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +6 -0
  12. package/dist/features/code-explorer/components/FileContentViewer.js +1 -0
  13. package/dist/features/code-explorer/components/FileTabsBar.js +1 -1
  14. package/dist/features/code-explorer/index.js +4 -0
  15. package/dist/features/debug/components/ConfigFlowViewer.js +1 -1
  16. package/dist/features/debug/components/PipelineFlowViewer.js +1 -1
  17. package/dist/features/debug/index.js +3 -0
  18. package/dist/features/documents/DocumentRenderer.js +53 -0
  19. package/dist/features/{workbench → documents}/components/DocumentItem.js +1 -1
  20. package/dist/features/{workbench → documents}/components/DocumentMetadataPills.js +2 -2
  21. package/dist/features/{workbench/components → documents}/document-details/DocumentDetails.js +3 -3
  22. package/dist/features/{workbench/components → documents}/document-details/PromptDetails.js +3 -3
  23. package/dist/features/documents/index.js +4 -0
  24. package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessage.js +5 -5
  25. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentDebugRenderer.js +1 -1
  26. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentFormRenderer.js +3 -3
  27. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentMessageRenderer.js +1 -1
  28. package/dist/features/{workbench/components/document-renderer → documents/renderers}/ErrorMessageRenderer.js +1 -1
  29. package/dist/features/{workbench/components/document-renderer → documents/renderers}/LinkMessageRenderer.js +1 -1
  30. package/dist/features/{workbench/components/document-renderer → documents/renderers}/MarkdownMessageRenderer.js +2 -2
  31. package/dist/features/{workbench/components/document-renderer → documents/renderers}/PlainMessageRenderer.js +1 -1
  32. package/dist/features/health/index.js +1 -0
  33. package/dist/features/workbench/NavigationItems.js +29 -29
  34. package/dist/features/workbench/Workbench.js +57 -69
  35. package/dist/features/workbench/WorkflowItem.js +63 -55
  36. package/dist/features/workbench/WorkflowList.js +52 -81
  37. package/dist/features/workbench/components/NewRunDialog.js +2 -1
  38. package/dist/features/workbench/components/WorkbenchFlowPanel.js +5 -4
  39. package/dist/features/workbench/components/WorkflowHistoryItem.js +11 -11
  40. package/dist/features/workbench/components/buttons/WorkflowButtons.js +49 -50
  41. package/dist/features/workbench/hooks/useWorkflowData.js +49 -0
  42. package/dist/features/workbench/hooks/useWorkflowListState.js +50 -0
  43. package/dist/features/workbench/index.js +8 -0
  44. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +2 -3
  45. package/dist/features/workspaces/components/CreateWorkspace.js +1 -1
  46. package/dist/features/workspaces/components/ExecutionTimeline.js +1 -1
  47. package/dist/features/workspaces/components/PipelineForm.js +1 -1
  48. package/dist/features/workspaces/index.js +3 -0
  49. package/dist/hooks/index.js +3 -2
  50. package/dist/hooks/query-keys.js +138 -0
  51. package/dist/hooks/useAuth.js +43 -42
  52. package/dist/hooks/useConfig.js +31 -35
  53. package/dist/hooks/useDashboard.js +9 -13
  54. package/dist/hooks/useDebounce.js +8 -17
  55. package/dist/hooks/useDocuments.js +4 -9
  56. package/dist/hooks/useFiles.js +31 -39
  57. package/dist/hooks/useNamespaces.js +2 -8
  58. package/dist/hooks/usePipelines.js +132 -155
  59. package/dist/hooks/useProcessor.js +11 -14
  60. package/dist/hooks/useWorkflows.js +40 -62
  61. package/dist/hooks/useWorkspaces.js +105 -110
  62. package/dist/index.d.ts +99 -3
  63. package/dist/index.js +14 -7
  64. package/dist/pages/DashboardPage.js +1 -1
  65. package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
  66. package/dist/pages/EmbedWorkbenchPage.js +4 -3
  67. package/dist/pages/PipelineDebugPage.js +6 -5
  68. package/dist/pages/PreviewWorkbenchPage.js +121 -118
  69. package/dist/pages/RunsListPage.js +52 -24
  70. package/dist/pages/StudioLandingPage.js +1 -0
  71. package/dist/pages/WorkbenchPage.js +3 -2
  72. package/dist/pages/WorkspacePage.js +1 -1
  73. package/dist/providers/InvalidationEventsProvider.js +9 -11
  74. package/dist/providers/StudioProvider.js +2 -2
  75. package/dist/routing/LocalRouter.js +12 -8
  76. package/package.json +1 -1
  77. package/dist/features/workbench/components/DocumentRenderer.js +0 -54
  78. /package/dist/components/{content → feedback}/ErrorAlert.js +0 -0
  79. /package/dist/components/{snackbars → feedback}/ErrorSnackbar.js +0 -0
  80. /package/dist/components/{snackbars → feedback}/Snackbar.js +0 -0
  81. /package/dist/features/{workbench → documents}/components/DocumentList.js +0 -0
  82. /package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessageContent.js +0 -0
@@ -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 { WorkbenchContextProvider } from "./providers/WorkbenchLayoutProvider.js";
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, { useContext } from "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 = (m) => {
13
- let h = c(17), { namespace: g } = m, { router: _ } = useStudio(), { pipelineId: v, clickId: y } = useParams(), b = useContext(WorkbenchContextProvider), x = useFetchWorkflowsByNamespace(g.id), { setScrollTo: S } = useScroll(), C;
14
- h[0] !== y || h[1] !== v || h[2] !== _ || h[3] !== S ? (C = (e) => {
15
- S(!0), v && _.navigateToWorkflow(v, e, y);
16
- }, h[0] = y, h[1] = v, h[2] = _, h[3] = S, h[4] = C) : C = h[4];
17
- let w = C;
18
- if (x.isPending) {
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
- h[5] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxs("div", {
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
- }) }), h[5] = e) : e = h[5];
24
- let f;
25
- h[6] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxs("div", {
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
- }) }), h[6] = f) : f = h[6];
29
- let p;
30
- return h[7] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ jsxs(Fragment$1, { children: [
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
- f,
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
- ] }), h[7] = p) : p = h[7], p;
37
+ ] }), m[7] = f) : f = m[7], f;
38
38
  }
39
- if (!v || !x.data?.length) return null;
40
- let T;
41
- if (h[8] !== x.data || h[9] !== w || h[10] !== b?.state) {
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
- h[12] !== w || h[13] !== b?.state ? (e = (e) => /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(NavigationItem_default, {
43
+ m[12] !== y || m[13] !== C ? (e = (e) => /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(NavigationItem_default, {
44
44
  workflow: e,
45
- isSelected: b?.state.activeSectionId?.endsWith(e.id) ?? !1,
46
- navigateTo: w
47
- }) }, `wf-${e.id}`), h[12] = w, h[13] = b?.state, h[14] = e) : e = h[14], T = x.data.map(e), h[8] = x.data, h[9] = w, h[10] = b?.state, h[11] = T;
48
- } else T = h[11];
49
- let E;
50
- return h[15] === T ? E = h[16] : (E = /* @__PURE__ */ jsx(Fragment$1, { children: T }), h[15] = T, h[16] = E), E;
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 };
@@ -1,9 +1,10 @@
1
1
  import { useWorkspace } from "../../hooks/useWorkspaces.js";
2
2
  import PageBreadcrumbs_default from "../../components/page/PageBreadcrumbs.js";
3
- import { FileContentViewer } from "../code-explorer/components/FileContentViewer.js";
4
3
  import { CodeExplorerProvider, useCodeExplorerContext } from "../code-explorer/providers/CodeExplorerProvider.js";
4
+ import { FileContentViewer } from "../code-explorer/components/FileContentViewer.js";
5
5
  import { FileTabsBar } from "../code-explorer/components/FileTabsBar.js";
6
- import { WorkbenchContextProvider, WorkbenchLayoutProvider, useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
6
+ import "../code-explorer/index.js";
7
+ import { WorkbenchLayoutProvider, useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
7
8
  import WorkflowList_default from "./WorkflowList.js";
8
9
  import { ScrollProvider } from "./providers/ScrollProvider.js";
9
10
  import { WorkbenchFloatingPanel } from "./components/WorkbenchFloatingPanel.js";
@@ -11,29 +12,28 @@ import { WorkbenchFlowPanel } from "./components/WorkbenchFlowPanel.js";
11
12
  import { WorkbenchIconSidebar } from "./components/WorkbenchIconSidebar.js";
12
13
  import { WorkbenchPreviewPanel } from "./components/WorkbenchPreviewPanel.js";
13
14
  import { c } from "react/compiler-runtime";
14
- import { useMemo } from "react";
15
15
  import { jsx, jsxs } from "react/jsx-runtime";
16
- function WorkbenchContent(e) {
17
- let a = c(16), { pipeline: l, breadcrumbData: u } = e, { openFiles: d, selectedFile: m, fileContent: h, workflowConfig: g, isContentLoading: _ } = useCodeExplorerContext(), v;
18
- a[0] === u ? v = a[1] : (v = /* @__PURE__ */ jsx("div", {
16
+ function WorkbenchContent(t) {
17
+ let i = c(16), { pipeline: l, breadcrumbData: u } = t, { openFiles: p, selectedFile: m, fileContent: h, workflowConfig: g, isContentLoading: v } = useCodeExplorerContext(), y;
18
+ i[0] === u ? y = i[1] : (y = /* @__PURE__ */ jsx("div", {
19
19
  className: "border-b flex h-12 shrink-0 items-center",
20
20
  children: u ? /* @__PURE__ */ jsx(PageBreadcrumbs_default, { breadcrumbData: u }) : /* @__PURE__ */ jsx("span", {
21
21
  className: "px-3 text-sm font-medium",
22
22
  children: "Workflows"
23
23
  })
24
- }), a[0] = u, a[1] = v);
24
+ }), i[0] = u, i[1] = y);
25
25
  let b;
26
- a[2] === l ? b = a[3] : (b = /* @__PURE__ */ jsx(ScrollProvider, { children: /* @__PURE__ */ jsx("div", {
26
+ i[2] === l ? b = i[3] : (b = /* @__PURE__ */ jsx(ScrollProvider, { children: /* @__PURE__ */ jsx("div", {
27
27
  className: "flex-1 overflow-auto",
28
28
  children: /* @__PURE__ */ jsx(WorkflowList_default, { pipeline: l })
29
- }) }), a[2] = l, a[3] = b);
29
+ }) }), i[2] = l, i[3] = b);
30
30
  let x;
31
- a[4] !== v || a[5] !== b ? (x = /* @__PURE__ */ jsxs("div", {
31
+ i[4] !== y || i[5] !== b ? (x = /* @__PURE__ */ jsxs("div", {
32
32
  className: "flex flex-1 flex-col overflow-hidden",
33
- children: [v, b]
34
- }), a[4] = v, a[5] = b, a[6] = x) : x = a[6];
33
+ children: [y, b]
34
+ }), i[4] = y, i[5] = b, i[6] = x) : x = i[6];
35
35
  let S;
36
- a[7] !== h || a[8] !== _ || a[9] !== d.length || a[10] !== m || a[11] !== g ? (S = d.length > 0 && /* @__PURE__ */ jsxs("div", {
36
+ i[7] !== h || i[8] !== v || i[9] !== p.length || i[10] !== m || i[11] !== g ? (S = p.length > 0 && /* @__PURE__ */ jsxs("div", {
37
37
  className: "w-full md:w-1/2 shrink-0 overflow-hidden flex flex-col",
38
38
  children: [/* @__PURE__ */ jsx(FileTabsBar, {}), /* @__PURE__ */ jsx("div", {
39
39
  className: "flex-1 overflow-hidden",
@@ -41,95 +41,83 @@ function WorkbenchContent(e) {
41
41
  selectedFile: m,
42
42
  content: h,
43
43
  workflowConfig: g,
44
- isLoading: _,
44
+ isLoading: v,
45
45
  className: "h-full"
46
46
  })
47
47
  })]
48
- }), a[7] = h, a[8] = _, a[9] = d.length, a[10] = m, a[11] = g, a[12] = S) : S = a[12];
48
+ }), i[7] = h, i[8] = v, i[9] = p.length, i[10] = m, i[11] = g, i[12] = S) : S = i[12];
49
49
  let C;
50
- return a[13] !== x || a[14] !== S ? (C = /* @__PURE__ */ jsx("div", {
50
+ return i[13] !== x || i[14] !== S ? (C = /* @__PURE__ */ jsx("div", {
51
51
  className: "flex h-full flex-col",
52
52
  children: /* @__PURE__ */ jsxs("div", {
53
53
  className: "flex flex-1 gap-4 overflow-hidden md:flex-row flex-col",
54
54
  children: [x, S]
55
55
  })
56
- }), a[13] = x, a[14] = S, a[15] = C) : C = a[15], C;
56
+ }), i[13] = x, i[14] = S, i[15] = C) : C = i[15], C;
57
57
  }
58
- function WorkbenchInner(e) {
59
- let r = c(26), { pipeline: i, breadcrumbData: a } = e, { activeSidePanel: o, activeSectionId: s, setActiveSectionId: u } = useWorkbenchLayout(), f;
60
- r[0] === s ? f = r[1] : (f = { activeSectionId: s }, r[0] = s, r[1] = f);
61
- let p;
62
- r[2] !== u || r[3] !== f ? (p = {
63
- state: f,
64
- setActiveSectionId: u
65
- }, r[2] = u, r[3] = f, r[4] = p) : p = r[4];
66
- let v = p, x = o ? "w-1/2 overflow-hidden" : "w-full overflow-hidden", S;
67
- r[5] !== a || r[6] !== i ? (S = /* @__PURE__ */ jsx(WorkbenchContent, {
58
+ function WorkbenchInner(t) {
59
+ let r = c(18), { pipeline: i, breadcrumbData: a } = t, { activeSidePanel: o } = useWorkbenchLayout(), s = o ? "w-1/2 overflow-hidden" : "w-full overflow-hidden", l;
60
+ r[0] !== a || r[1] !== i ? (l = /* @__PURE__ */ jsx(WorkbenchContent, {
68
61
  pipeline: i,
69
62
  breadcrumbData: a
70
- }), r[5] = a, r[6] = i, r[7] = S) : S = r[7];
71
- let C;
72
- r[8] !== x || r[9] !== S ? (C = /* @__PURE__ */ jsx("div", {
73
- className: x,
74
- children: S
75
- }), r[8] = x, r[9] = S, r[10] = C) : C = r[10];
76
- let w;
77
- r[11] === o ? w = r[12] : (w = o === "preview" && /* @__PURE__ */ jsx(WorkbenchPreviewPanel, {}), r[11] = o, r[12] = w);
78
- let T;
79
- r[13] === o ? T = r[14] : (T = o === "flow" && /* @__PURE__ */ jsx(WorkbenchFlowPanel, {}), r[13] = o, r[14] = T);
80
- let E;
81
- r[15] === Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ jsx(WorkbenchFloatingPanel, {}), r[15] = E) : E = r[15];
82
- let D;
83
- r[16] !== C || r[17] !== w || r[18] !== T ? (D = /* @__PURE__ */ jsxs("div", {
63
+ }), r[0] = a, r[1] = i, r[2] = l) : l = r[2];
64
+ let d;
65
+ r[3] !== s || r[4] !== l ? (d = /* @__PURE__ */ jsx("div", {
66
+ className: s,
67
+ children: l
68
+ }), r[3] = s, r[4] = l, r[5] = d) : d = r[5];
69
+ let f;
70
+ r[6] === o ? f = r[7] : (f = o === "preview" && /* @__PURE__ */ jsx(WorkbenchPreviewPanel, {}), r[6] = o, r[7] = f);
71
+ let y;
72
+ r[8] === o ? y = r[9] : (y = o === "flow" && /* @__PURE__ */ jsx(WorkbenchFlowPanel, {}), r[8] = o, r[9] = y);
73
+ let b;
74
+ r[10] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ jsx(WorkbenchFloatingPanel, {}), r[10] = b) : b = r[10];
75
+ let x;
76
+ r[11] !== d || r[12] !== f || r[13] !== y ? (x = /* @__PURE__ */ jsxs("div", {
84
77
  className: "relative flex flex-1 overflow-hidden",
85
78
  children: [
86
- C,
87
- w,
88
- T,
89
- E
79
+ d,
80
+ f,
81
+ y,
82
+ b
90
83
  ]
91
- }), r[16] = C, r[17] = w, r[18] = T, r[19] = D) : D = r[19];
92
- let O;
93
- r[20] === Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ jsx(WorkbenchIconSidebar, {}), r[20] = O) : O = r[20];
94
- let k;
95
- r[21] === D ? k = r[22] : (k = /* @__PURE__ */ jsxs("div", {
84
+ }), r[11] = d, r[12] = f, r[13] = y, r[14] = x) : x = r[14];
85
+ let S;
86
+ r[15] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsx(WorkbenchIconSidebar, {}), r[15] = S) : S = r[15];
87
+ let C;
88
+ return r[16] === x ? C = r[17] : (C = /* @__PURE__ */ jsxs("div", {
96
89
  className: "flex h-full w-full",
97
- children: [D, O]
98
- }), r[21] = D, r[22] = k);
99
- let A;
100
- return r[23] !== v || r[24] !== k ? (A = /* @__PURE__ */ jsx(WorkbenchContextProvider.Provider, {
101
- value: v,
102
- children: k
103
- }), r[23] = v, r[24] = k, r[25] = A) : A = r[25], A;
90
+ children: [x, S]
91
+ }), r[16] = x, r[17] = C), C;
104
92
  }
105
93
  function Workbench(r) {
106
- let i = c(19), { pipeline: o, breadcrumbData: s, previewPanelOpen: l, onPreviewPanelOpenChange: d, isDeveloperMode: f, getPreviewUrl: p, getEnvironmentPreviewUrl: m, environments: h } = r, g = o?.workspaceId, _ = useWorkspace(g), v = _.data?.features?.fileExplorer?.enabled ?? !1, y;
107
- i[0] === _.data ? y = i[1] : (y = _.data ? {
94
+ let a = c(19), { pipeline: o, breadcrumbData: s, previewPanelOpen: u, onPreviewPanelOpenChange: d, isDeveloperMode: f, getPreviewUrl: p, getEnvironmentPreviewUrl: m, environments: h } = r, g = o?.workspaceId, _ = useWorkspace(g), v = _.data?.features?.fileExplorer?.enabled ?? !1, b;
95
+ a[0] === _.data ? b = a[1] : (b = _.data ? {
108
96
  volumes: _.data.volumes,
109
97
  features: _.data.features
110
- } : void 0, i[0] = _.data, i[1] = y);
111
- let b = y, S = h ?? _.data?.environments, C = o?.id, w;
112
- i[2] !== s || i[3] !== o ? (w = /* @__PURE__ */ jsx(WorkbenchInner, {
98
+ } : void 0, a[0] = _.data, a[1] = b);
99
+ let x = b, S = h ?? _.data?.environments, C = o?.id, w;
100
+ a[2] !== s || a[3] !== o ? (w = /* @__PURE__ */ jsx(WorkbenchInner, {
113
101
  pipeline: o,
114
102
  breadcrumbData: s
115
- }), i[2] = s, i[3] = o, i[4] = w) : w = i[4];
103
+ }), a[2] = s, a[3] = o, a[4] = w) : w = a[4];
116
104
  let T;
117
- i[5] !== v || i[6] !== C || i[7] !== w ? (T = /* @__PURE__ */ jsx(CodeExplorerProvider, {
105
+ a[5] !== v || a[6] !== C || a[7] !== w ? (T = /* @__PURE__ */ jsx(CodeExplorerProvider, {
118
106
  pipelineId: C,
119
107
  fileExplorerEnabled: v,
120
108
  children: w
121
- }), i[5] = v, i[6] = C, i[7] = w, i[8] = T) : T = i[8];
109
+ }), a[5] = v, a[6] = C, a[7] = w, a[8] = T) : T = a[8];
122
110
  let E;
123
- return i[9] !== m || i[10] !== p || i[11] !== f || i[12] !== d || i[13] !== o || i[14] !== l || i[15] !== S || i[16] !== T || i[17] !== b ? (E = /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
111
+ return a[9] !== m || a[10] !== p || a[11] !== f || a[12] !== d || a[13] !== o || a[14] !== u || a[15] !== S || a[16] !== T || a[17] !== x ? (E = /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
124
112
  pipeline: o,
125
113
  isDeveloperMode: f,
126
- workspaceConfig: b,
114
+ workspaceConfig: x,
127
115
  getPreviewUrl: p,
128
116
  getEnvironmentPreviewUrl: m,
129
117
  environments: S,
130
- previewPanelOpen: l,
118
+ previewPanelOpen: u,
131
119
  onPreviewPanelOpenChange: d,
132
120
  children: T
133
- }), i[9] = m, i[10] = p, i[11] = f, i[12] = d, i[13] = o, i[14] = l, i[15] = S, i[16] = T, i[17] = b, i[18] = E) : E = i[18], E;
121
+ }), a[9] = m, a[10] = p, a[11] = f, a[12] = d, a[13] = o, a[14] = u, a[15] = S, a[16] = T, a[17] = x, a[18] = E) : E = a[18], E;
134
122
  }
135
123
  export { Workbench as default };
@@ -1,64 +1,72 @@
1
- import { useFilterDocuments } from "../../hooks/useDocuments.js";
2
- import { useWorkflow } from "../../hooks/useWorkflows.js";
3
1
  import { cn } from "../../lib/utils.js";
4
- import ErrorSnackbar_default from "../../components/snackbars/ErrorSnackbar.js";
5
- import LoadingCentered_default from "../../components/LoadingCentered.js";
6
- import { require_enums } from "../../packages/contracts/dist/enums/index.js";
7
- import { useRunPipeline } from "../../hooks/useProcessor.js";
8
- import DocumentList_default from "./components/DocumentList.js";
2
+ import LoadingCentered_default from "../../components/feedback/LoadingCentered.js";
3
+ import ErrorSnackbar_default from "../../components/feedback/ErrorSnackbar.js";
4
+ import ErrorAlert_default from "../../components/feedback/ErrorAlert.js";
5
+ import DocumentList_default from "../documents/components/DocumentList.js";
6
+ import "../documents/index.js";
9
7
  import WorkflowForms_default from "./components/WorkflowForms.js";
10
- import ErrorAlert_default from "../../components/content/ErrorAlert.js";
11
- import React, { useCallback, useEffect, useMemo } from "react";
8
+ import { useWorkflowData } from "./hooks/useWorkflowData.js";
9
+ import { c } from "react/compiler-runtime";
10
+ import React, { useEffect } from "react";
12
11
  import { jsx, jsxs } from "react/jsx-runtime";
13
12
  import { useParams } from "react-router-dom";
14
- var import_enums = require_enums(), WorkflowItem_default = ({ pipeline: g, workflowId: _, scrollTo: v, settings: y, embed: b }) => {
15
- let { workflowId: x, clickId: S } = useParams(), C = useWorkflow(_), w = useFilterDocuments(_);
16
- useEffect(() => {
17
- x === _ && C.isSuccess && w.isSuccess && v(_);
18
- }, [
19
- C.isSuccess,
20
- w.isSuccess,
21
- _,
13
+ var WorkflowItem_default = (p) => {
14
+ let m = c(46), { pipeline: h, workflowId: g, scrollTo: _, settings: v, embed: y } = p, { workflowId: b, clickId: x } = useParams(), S;
15
+ m[0] !== v.showFullMessageHistory || m[1] !== g ? (S = {
16
+ workflowId: g,
17
+ showFullMessageHistory: v.showFullMessageHistory
18
+ }, m[0] = v.showFullMessageHistory, m[1] = g, m[2] = S) : S = m[2];
19
+ let { workflow: C, workflowLoading: w, workflowReady: T, workflowError: E, documents: D, documentsLoading: O, documentsReady: k, documentsError: A, isLoading: j, handleRun: M } = useWorkflowData(S), N;
20
+ m[3] !== k || m[4] !== b || m[5] !== _ || m[6] !== g || m[7] !== T ? (N = () => {
21
+ b === g && T && k && _(g);
22
+ }, m[3] = k, m[4] = b, m[5] = _, m[6] = g, m[7] = T, m[8] = N) : N = m[8];
23
+ let P;
24
+ m[9] !== x || m[10] !== k || m[11] !== b || m[12] !== _ || m[13] !== g || m[14] !== T ? (P = [
25
+ T,
26
+ k,
27
+ g,
28
+ b,
22
29
  x,
23
- S,
24
- v
25
- ]);
26
- let T = useCallback((e) => {
27
- let p = e.meta, m = e.ui, h = p?.hidden || m?.hidden || !!p?.hideAtPlaces?.includes(C.data?.place ?? "");
28
- return !y.showFullMessageHistory && e.tags?.includes("internal") && (h = !0), !h;
29
- }, [C.data, y.showFullMessageHistory]), E = useMemo(() => w.data ? w.data.filter(T) : [], [w.data, T]), D = useRunPipeline(), O = (e, p) => {
30
- D.mutate({
31
- pipelineId: C.data.pipelineId,
32
- runPipelinePayloadDto: { transition: {
33
- id: e,
34
- workflowId: _,
35
- payload: p
36
- } }
37
- });
38
- }, k = D.isPending || C.data?.status === import_enums.WorkflowState.Running;
39
- return /* @__PURE__ */ jsxs("div", {
40
- className: cn("flex flex-col", b ? "p-0" : "p-4"),
30
+ _
31
+ ], m[9] = x, m[10] = k, m[11] = b, m[12] = _, m[13] = g, m[14] = T, m[15] = P) : P = m[15], useEffect(N, P);
32
+ let F = y ? "p-0" : "p-4", I;
33
+ m[16] === F ? I = m[17] : (I = cn("flex flex-col", F), m[16] = F, m[17] = I);
34
+ let L = w || O, R;
35
+ m[18] === L ? R = m[19] : (R = /* @__PURE__ */ jsx(LoadingCentered_default, { loading: L }), m[18] = L, m[19] = R);
36
+ let z;
37
+ m[20] === A ? z = m[21] : (z = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: A }), m[20] = A, m[21] = z);
38
+ let B;
39
+ m[22] === E ? B = m[23] : (B = /* @__PURE__ */ jsx(ErrorAlert_default, { error: E }), m[22] = E, m[23] = B);
40
+ let V;
41
+ m[24] !== D || m[25] !== j || m[26] !== h || m[27] !== _ || m[28] !== v || m[29] !== C || m[30] !== T ? (V = T && C && /* @__PURE__ */ jsx(DocumentList_default, {
42
+ pipeline: h,
43
+ workflow: C,
44
+ documents: D,
45
+ scrollTo: _,
46
+ settings: v,
47
+ isLoading: j
48
+ }), m[24] = D, m[25] = j, m[26] = h, m[27] = _, m[28] = v, m[29] = C, m[30] = T, m[31] = V) : V = m[31];
49
+ let H;
50
+ m[32] === j ? H = m[33] : (H = /* @__PURE__ */ jsx(LoadingCentered_default, { loading: j }), m[32] = j, m[33] = H);
51
+ let U;
52
+ m[34] !== y || m[35] !== M || m[36] !== C ? (U = !!C && !y && /* @__PURE__ */ jsx("div", {
53
+ className: "mt-6",
54
+ children: /* @__PURE__ */ jsx(WorkflowForms_default, {
55
+ workflow: C,
56
+ onSubmit: M
57
+ })
58
+ }), m[34] = y, m[35] = M, m[36] = C, m[37] = U) : U = m[37];
59
+ let W;
60
+ return m[38] !== V || m[39] !== H || m[40] !== U || m[41] !== I || m[42] !== R || m[43] !== z || m[44] !== B ? (W = /* @__PURE__ */ jsxs("div", {
61
+ className: I,
41
62
  children: [
42
- /* @__PURE__ */ jsx(LoadingCentered_default, { loading: C.isLoading || w.isLoading }),
43
- /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: w.error }),
44
- /* @__PURE__ */ jsx(ErrorAlert_default, { error: C.data?.errorMessage }),
45
- C.isSuccess && /* @__PURE__ */ jsx(DocumentList_default, {
46
- pipeline: g,
47
- workflow: C.data,
48
- documents: E,
49
- scrollTo: v,
50
- settings: y,
51
- isLoading: k
52
- }),
53
- /* @__PURE__ */ jsx(LoadingCentered_default, { loading: k }),
54
- !!C.data && !b && /* @__PURE__ */ jsx("div", {
55
- className: "mt-6",
56
- children: /* @__PURE__ */ jsx(WorkflowForms_default, {
57
- workflow: C.data,
58
- onSubmit: O
59
- })
60
- })
63
+ R,
64
+ z,
65
+ B,
66
+ V,
67
+ H,
68
+ U
61
69
  ]
62
- });
70
+ }), m[38] = V, m[39] = H, m[40] = U, m[41] = I, m[42] = R, m[43] = z, m[44] = B, m[45] = W) : W = m[45], W;
63
71
  };
64
72
  export { WorkflowItem_default as default };
@@ -1,119 +1,90 @@
1
- import { useFetchWorkflowsByPipeline } from "../../hooks/useWorkflows.js";
2
1
  import { cn } from "../../lib/utils.js";
3
2
  import { Button } from "../../components/ui/button.js";
4
- import ErrorSnackbar_default from "../../components/snackbars/ErrorSnackbar.js";
5
- import LoadingCentered_default from "../../components/LoadingCentered.js";
6
- import { WorkbenchContextProvider } from "./providers/WorkbenchLayoutProvider.js";
3
+ import LoadingCentered_default from "../../components/feedback/LoadingCentered.js";
4
+ import ErrorSnackbar_default from "../../components/feedback/ErrorSnackbar.js";
5
+ import { useFetchWorkflowsByPipeline } from "../../hooks/useWorkflows.js";
7
6
  import WorkflowItem_default from "./WorkflowItem.js";
8
- import { useScrollToBottom } from "./hooks/useAutoScrollBottom.js";
9
- import { useIntersectionObserver } from "./hooks/useIntersectionObserver.js";
10
- import { useScrollToListItem } from "./hooks/useScrollToListItem.js";
11
7
  import WorkbenchSettingsModal_default from "./components/WorkbenchSettingsModal.js";
12
8
  import WorkflowButtons_default from "./components/buttons/WorkflowButtons.js";
9
+ import { useWorkflowListState } from "./hooks/useWorkflowListState.js";
13
10
  import { c } from "react/compiler-runtime";
14
- import React, { useContext, useEffect, useState } from "react";
11
+ import React, { useState } from "react";
15
12
  import { jsx, jsxs } from "react/jsx-runtime";
16
13
  import { ArrowDownIcon, ChevronRightIcon, Play } from "lucide-react";
17
- var WorkflowList_default = (S) => {
18
- let C = c(33), { pipeline: w } = S, T = useFetchWorkflowsByPipeline(w.id), [E, D] = useState(!1), O;
19
- C[0] === Symbol.for("react.memo_cache_sentinel") ? (O = {}, C[0] = O) : O = C[0];
20
- let [k, A] = useState(O), j;
21
- C[1] === Symbol.for("react.memo_cache_sentinel") ? (j = {
14
+ var WorkflowList_default = (_) => {
15
+ let v = c(24), { pipeline: y } = _, b = useFetchWorkflowsByPipeline(y.id), [x, S] = useState(!1), C;
16
+ v[0] === Symbol.for("react.memo_cache_sentinel") ? (C = {
22
17
  enableDebugMode: !1,
23
18
  showFullMessageHistory: !1
24
- }, C[1] = j) : j = C[1];
25
- let [M, N] = useState(j), { activeId: P, observe: F } = useIntersectionObserver("0px 0px 0px 0px"), { listRef: I, scrollTo: L } = useScrollToListItem(), { canScrollDown: R, scrollToBottom: z } = useScrollToBottom(), B = useContext(WorkbenchContextProvider), V, H;
26
- C[2] !== P || C[3] !== B ? (V = () => {
27
- B && B.setActiveSectionId && B.state.activeSectionId !== P && (B.setActiveSectionId(P), P && A((t) => ({
28
- ...t,
29
- [P]: !0
30
- })));
31
- }, H = [P, B], C[2] = P, C[3] = B, C[4] = V, C[5] = H) : (V = C[4], H = C[5]), useEffect(V, H);
32
- let U, W;
33
- C[6] !== P || C[7] !== T.data ? (U = () => {
34
- if (T.data && T.data.length > 0) {
35
- let t = T.data.length - 1, _ = T.data[t], v = `section-${_.index}-${_.id}`;
36
- A({
37
- [v]: !0,
38
- ...P && P !== v ? { [P]: !0 } : {}
39
- });
40
- }
41
- }, W = [T.data, P], C[6] = P, C[7] = T.data, C[8] = U, C[9] = W) : (U = C[8], W = C[9]), useEffect(U, W);
42
- let G;
43
- C[10] === Symbol.for("react.memo_cache_sentinel") ? (G = (t) => {
44
- A((_) => ({
45
- ..._,
46
- [t]: !_[t]
47
- }));
48
- }, C[10] = G) : G = C[10];
49
- let K = G, q;
50
- C[11] !== R || C[12] !== z ? (q = R && /* @__PURE__ */ jsx(Button, {
19
+ }, v[0] = C) : C = v[0];
20
+ let [w, T] = useState(C), { activeId: E, expandedSections: D, observe: O, listRef: k, scrollTo: A, canScrollDown: j, scrollToBottom: M, toggleSection: N } = useWorkflowListState(b.data), P;
21
+ v[1] !== j || v[2] !== M ? (P = j && /* @__PURE__ */ jsx(Button, {
51
22
  variant: "outline",
52
23
  size: "icon",
53
- onClick: z,
24
+ onClick: M,
54
25
  className: "bg-background/80 fixed right-[calc(var(--sidebar-width)+1.5rem)] bottom-6 z-50 rounded-full shadow-md backdrop-blur-sm",
55
26
  children: /* @__PURE__ */ jsx(ArrowDownIcon, { className: "size-4" })
56
- }), C[11] = R, C[12] = z, C[13] = q) : q = C[13];
57
- let J;
58
- C[14] === T.isLoading ? J = C[15] : (J = /* @__PURE__ */ jsx(LoadingCentered_default, { loading: T.isLoading }), C[14] = T.isLoading, C[15] = J);
59
- let Y;
60
- C[16] === T.error ? Y = C[17] : (Y = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: T.error }), C[16] = T.error, C[17] = Y);
61
- let X;
62
- C[18] !== P || C[19] !== k || C[20] !== T.data || C[21] !== I || C[22] !== F || C[23] !== E || C[24] !== w || C[25] !== L || C[26] !== M ? (X = T.data ? /* @__PURE__ */ jsx("div", {
27
+ }), v[1] = j, v[2] = M, v[3] = P) : P = v[3];
28
+ let F;
29
+ v[4] === b.isLoading ? F = v[5] : (F = /* @__PURE__ */ jsx(LoadingCentered_default, { loading: b.isLoading }), v[4] = b.isLoading, v[5] = F);
30
+ let I;
31
+ v[6] === b.error ? I = v[7] : (I = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: b.error }), v[6] = b.error, v[7] = I);
32
+ let L;
33
+ v[8] !== E || v[9] !== D || v[10] !== b.data || v[11] !== k || v[12] !== O || v[13] !== x || v[14] !== y || v[15] !== A || v[16] !== w || v[17] !== N ? (L = b.data ? /* @__PURE__ */ jsx("div", {
63
34
  className: "mb-10",
64
- ref: I,
65
- children: /* @__PURE__ */ jsx("div", { children: T.data.map((t) => {
66
- let v = `section-${t.index}-${t.id}`, y = P === v, b = T.data.length === 1, x = b || k[v];
35
+ ref: k,
36
+ children: /* @__PURE__ */ jsx("div", { children: b.data.map((f) => {
37
+ let p = `section-${f.index}-${f.id}`, m = E === p, h = b.data.length === 1, g = h || D[p];
67
38
  return /* @__PURE__ */ jsxs("div", {
68
- ref: (t) => F(t),
69
- "data-id": v,
39
+ ref: (i) => O(i),
40
+ "data-id": p,
70
41
  children: [/* @__PURE__ */ jsx("div", {
71
42
  className: "bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-10 backdrop-blur",
72
43
  children: /* @__PURE__ */ jsxs("div", {
73
44
  role: "button",
74
- tabIndex: b ? void 0 : 0,
75
- className: cn("flex w-full items-center gap-2 rounded-md p-2 px-3 text-left text-sm font-medium", !b && "hover:bg-accent hover:text-accent-foreground cursor-pointer", b && "cursor-default"),
76
- onClick: b ? void 0 : () => K(v),
77
- onKeyDown: b ? void 0 : (t) => {
78
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), K(v));
45
+ tabIndex: h ? void 0 : 0,
46
+ className: cn("flex w-full items-center gap-2 rounded-md p-2 px-3 text-left text-sm font-medium", !h && "hover:bg-accent hover:text-accent-foreground cursor-pointer", h && "cursor-default"),
47
+ onClick: h ? void 0 : () => N(p),
48
+ onKeyDown: h ? void 0 : (i) => {
49
+ (i.key === "Enter" || i.key === " ") && (i.preventDefault(), N(p));
79
50
  },
80
51
  children: [
81
52
  /* @__PURE__ */ jsx(Play, { className: "text-primary h-3.5 w-3.5 fill-current" }),
82
53
  /* @__PURE__ */ jsx("span", {
83
54
  className: "flex-1 truncate text-sm",
84
- children: t.title ?? t.blockName
55
+ children: f.title ?? f.blockName
85
56
  }),
86
57
  /* @__PURE__ */ jsx(WorkflowButtons_default, {
87
- pipeline: w,
88
- workflowId: t.id
58
+ pipeline: y,
59
+ workflowId: f.id
89
60
  }),
90
- y && /* @__PURE__ */ jsx(WorkbenchSettingsModal_default, {
91
- settings: M,
92
- onSettingsChange: N,
93
- open: E,
94
- onOpenChange: D
61
+ m && /* @__PURE__ */ jsx(WorkbenchSettingsModal_default, {
62
+ settings: w,
63
+ onSettingsChange: T,
64
+ open: x,
65
+ onOpenChange: S
95
66
  }),
96
- !b && /* @__PURE__ */ jsx(ChevronRightIcon, { className: cn("text-muted-foreground h-3.5 w-3.5 transition-transform", x && "rotate-90") })
67
+ !h && /* @__PURE__ */ jsx(ChevronRightIcon, { className: cn("text-muted-foreground h-3.5 w-3.5 transition-transform", g && "rotate-90") })
97
68
  ]
98
69
  })
99
- }), x && /* @__PURE__ */ jsx("div", {
70
+ }), g && /* @__PURE__ */ jsx("div", {
100
71
  className: "max-w-4xl py-1",
101
72
  children: /* @__PURE__ */ jsx(WorkflowItem_default, {
102
- pipeline: w,
103
- workflowId: t.id,
104
- scrollTo: L,
105
- settings: M
73
+ pipeline: y,
74
+ workflowId: f.id,
75
+ scrollTo: A,
76
+ settings: w
106
77
  })
107
78
  })]
108
- }, t.id);
79
+ }, f.id);
109
80
  }) })
110
- }) : null, C[18] = P, C[19] = k, C[20] = T.data, C[21] = I, C[22] = F, C[23] = E, C[24] = w, C[25] = L, C[26] = M, C[27] = X) : X = C[27];
111
- let Z;
112
- return C[28] !== Y || C[29] !== X || C[30] !== q || C[31] !== J ? (Z = /* @__PURE__ */ jsxs("div", { children: [
113
- q,
114
- J,
115
- Y,
116
- X
117
- ] }), C[28] = Y, C[29] = X, C[30] = q, C[31] = J, C[32] = Z) : Z = C[32], Z;
81
+ }) : null, v[8] = E, v[9] = D, v[10] = b.data, v[11] = k, v[12] = O, v[13] = x, v[14] = y, v[15] = A, v[16] = w, v[17] = N, v[18] = L) : L = v[18];
82
+ let R;
83
+ return v[19] !== P || v[20] !== F || v[21] !== I || v[22] !== L ? (R = /* @__PURE__ */ jsxs("div", { children: [
84
+ P,
85
+ F,
86
+ I,
87
+ L
88
+ ] }), v[19] = P, v[20] = F, v[21] = I, v[22] = L, v[23] = R) : R = v[23], R;
118
89
  };
119
90
  export { WorkflowList_default as default };
@@ -6,10 +6,11 @@ import { Button } from "../../../components/ui/button.js";
6
6
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../components/ui/collapsible.js";
7
7
  import { Dialog, DialogContent, DialogTitle } from "../../../components/ui/dialog.js";
8
8
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../../components/ui/select.js";
9
- import ErrorSnackbar_default from "../../../components/snackbars/ErrorSnackbar.js";
9
+ import ErrorSnackbar_default from "../../../components/feedback/ErrorSnackbar.js";
10
10
  import CreateWorkspace_default from "../../workspaces/components/CreateWorkspace.js";
11
11
  import Form_default from "../../../components/dynamic-form/Form.js";
12
12
  import { useRunPipeline } from "../../../hooks/useProcessor.js";
13
+ import "../../workspaces/index.js";
13
14
  import { c } from "react/compiler-runtime";
14
15
  import { useCallback, useEffect, useMemo, useState } from "react";
15
16
  import { jsx, jsxs } from "react/jsx-runtime";