@loopstack/loopstack-studio 0.22.0 → 0.23.1

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 (98) hide show
  1. package/dist/app/EnvironmentEmbedRoot.js +20 -18
  2. package/dist/components/dynamic-form/Form.js +50 -27
  3. package/dist/components/dynamic-form/InputController.js +3 -1
  4. package/dist/components/dynamic-form/fields/MarkdownViewField.js +20 -0
  5. package/dist/components/feedback/ErrorBoundary.js +43 -0
  6. package/dist/components/{LoadingCentered.js → feedback/LoadingCentered.js} +1 -1
  7. package/dist/components/feedback/index.js +5 -0
  8. package/dist/components/index.js +6 -3
  9. package/dist/components/layout/MainLayout.js +32 -16
  10. package/dist/components/layout/StudioSidebar.js +165 -0
  11. package/dist/components/ui-widgets/widgets/SandboxRun.js +1 -0
  12. package/dist/features/code-explorer/CodeExplorer.js +6 -0
  13. package/dist/features/code-explorer/components/CodeExplorerTree.js +5 -0
  14. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +82 -0
  15. package/dist/features/code-explorer/components/FileContentViewer.js +1 -0
  16. package/dist/features/code-explorer/components/FileTabsBar.js +3 -190
  17. package/dist/features/code-explorer/components/FileTabsBarBase.js +190 -0
  18. package/dist/features/code-explorer/index.js +4 -0
  19. package/dist/features/code-explorer/providers/CodeExplorerProvider.js +2 -162
  20. package/dist/features/code-explorer/utils/fileIcons.js +7 -4
  21. package/dist/features/debug/components/ConfigFlowViewer.js +1 -1
  22. package/dist/features/debug/components/PipelineFlowViewer.js +47 -46
  23. package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +19 -19
  24. package/dist/features/debug/index.js +3 -0
  25. package/dist/features/documents/DocumentRenderer.js +58 -0
  26. package/dist/features/{workbench → documents}/components/DocumentItem.js +1 -1
  27. package/dist/features/{workbench → documents}/components/DocumentMetadataPills.js +2 -2
  28. package/dist/features/{workbench/components → documents}/document-details/DocumentDetails.js +3 -3
  29. package/dist/features/{workbench/components → documents}/document-details/PromptDetails.js +3 -3
  30. package/dist/features/documents/index.js +4 -0
  31. package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessage.js +5 -5
  32. package/dist/features/documents/renderers/ClaudeMessage.js +96 -0
  33. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentDebugRenderer.js +1 -1
  34. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentFormRenderer.js +3 -3
  35. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentMessageRenderer.js +1 -1
  36. package/dist/features/{workbench/components/document-renderer → documents/renderers}/ErrorMessageRenderer.js +1 -1
  37. package/dist/features/{workbench/components/document-renderer → documents/renderers}/LinkMessageRenderer.js +1 -1
  38. package/dist/features/{workbench/components/document-renderer → documents/renderers}/MarkdownMessageRenderer.js +2 -2
  39. package/dist/features/{workbench/components/document-renderer → documents/renderers}/PlainMessageRenderer.js +1 -1
  40. package/dist/features/health/index.js +1 -0
  41. package/dist/features/workbench/NavigationItems.js +29 -29
  42. package/dist/features/workbench/Workbench.js +71 -99
  43. package/dist/features/workbench/WorkflowItem.js +63 -55
  44. package/dist/features/workbench/WorkflowList.js +52 -81
  45. package/dist/features/workbench/components/NewRunDialog.js +2 -1
  46. package/dist/features/workbench/components/RemoteFileTabsBar.js +18 -0
  47. package/dist/features/workbench/components/RemoteFileTree.js +90 -0
  48. package/dist/features/workbench/components/WorkbenchFilesPanel.js +60 -0
  49. package/dist/features/workbench/components/WorkbenchFlowPanel.js +4 -3
  50. package/dist/features/workbench/components/WorkbenchIconSidebar.js +37 -29
  51. package/dist/features/workbench/components/WorkflowHistoryItem.js +11 -11
  52. package/dist/features/workbench/components/buttons/WorkflowButtons.js +49 -50
  53. package/dist/features/workbench/hooks/useWorkflowData.js +49 -0
  54. package/dist/features/workbench/hooks/useWorkflowListState.js +50 -0
  55. package/dist/features/workbench/index.js +8 -0
  56. package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +145 -0
  57. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +47 -45
  58. package/dist/features/workspaces/components/CreateWorkspace.js +1 -1
  59. package/dist/features/workspaces/components/ExecutionTimeline.js +1 -1
  60. package/dist/features/workspaces/components/PipelineForm.js +2 -2
  61. package/dist/features/workspaces/components/WorkspaceHomePage.js +93 -0
  62. package/dist/features/workspaces/index.js +3 -0
  63. package/dist/hooks/index.js +3 -2
  64. package/dist/hooks/query-keys.js +138 -0
  65. package/dist/hooks/useAuth.js +43 -42
  66. package/dist/hooks/useConfig.js +31 -35
  67. package/dist/hooks/useDashboard.js +9 -13
  68. package/dist/hooks/useDebounce.js +8 -17
  69. package/dist/hooks/useDocuments.js +4 -9
  70. package/dist/hooks/useFiles.js +1 -51
  71. package/dist/hooks/useNamespaces.js +2 -8
  72. package/dist/hooks/usePipelines.js +132 -155
  73. package/dist/hooks/useProcessor.js +11 -14
  74. package/dist/hooks/useWorkflows.js +40 -62
  75. package/dist/hooks/useWorkspaces.js +105 -110
  76. package/dist/index.d.ts +105 -3
  77. package/dist/index.js +15 -7
  78. package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
  79. package/dist/pages/DashboardPage.js +1 -1
  80. package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
  81. package/dist/pages/EmbedWorkbenchPage.js +4 -3
  82. package/dist/pages/PipelineDebugPage.js +6 -5
  83. package/dist/pages/PreviewWorkbenchPage.js +228 -128
  84. package/dist/pages/RunsListPage.js +52 -24
  85. package/dist/pages/StudioLandingPage.js +1 -0
  86. package/dist/pages/WorkbenchPage.js +3 -2
  87. package/dist/pages/WorkspacePage.js +103 -51
  88. package/dist/pages/WorkspaceRunsPage.js +71 -0
  89. package/dist/providers/InvalidationEventsProvider.js +9 -11
  90. package/dist/providers/StudioProvider.js +2 -2
  91. package/dist/routing/LocalRouter.js +18 -8
  92. package/package.json +2 -2
  93. package/dist/features/workbench/components/DocumentRenderer.js +0 -54
  94. /package/dist/components/{content → feedback}/ErrorAlert.js +0 -0
  95. /package/dist/components/{snackbars → feedback}/ErrorSnackbar.js +0 -0
  96. /package/dist/components/{snackbars → feedback}/Snackbar.js +0 -0
  97. /package/dist/features/{workbench → documents}/components/DocumentList.js +0 -0
  98. /package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessageContent.js +0 -0
@@ -1,135 +1,107 @@
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
- import { CodeExplorerProvider, useCodeExplorerContext } from "../code-explorer/providers/CodeExplorerProvider.js";
5
- import { FileTabsBar } from "../code-explorer/components/FileTabsBar.js";
6
- import { WorkbenchContextProvider, WorkbenchLayoutProvider, useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
3
+ import { WorkbenchLayoutProvider, useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
7
4
  import WorkflowList_default from "./WorkflowList.js";
5
+ import { RemoteFileExplorerProvider } from "./providers/RemoteFileExplorerProvider.js";
6
+ import { WorkbenchFilesPanel } from "./components/WorkbenchFilesPanel.js";
8
7
  import { ScrollProvider } from "./providers/ScrollProvider.js";
9
8
  import { WorkbenchFloatingPanel } from "./components/WorkbenchFloatingPanel.js";
10
9
  import { WorkbenchFlowPanel } from "./components/WorkbenchFlowPanel.js";
11
10
  import { WorkbenchIconSidebar } from "./components/WorkbenchIconSidebar.js";
12
11
  import { WorkbenchPreviewPanel } from "./components/WorkbenchPreviewPanel.js";
13
12
  import { c } from "react/compiler-runtime";
14
- import { useMemo } from "react";
15
13
  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", {
14
+ function WorkbenchContent(t) {
15
+ let i = c(7), { pipeline: a, breadcrumbData: s } = t, l;
16
+ i[0] === s ? l = i[1] : (l = /* @__PURE__ */ jsx("div", {
19
17
  className: "border-b flex h-12 shrink-0 items-center",
20
- children: u ? /* @__PURE__ */ jsx(PageBreadcrumbs_default, { breadcrumbData: u }) : /* @__PURE__ */ jsx("span", {
18
+ children: s ? /* @__PURE__ */ jsx(PageBreadcrumbs_default, { breadcrumbData: s }) : /* @__PURE__ */ jsx("span", {
21
19
  className: "px-3 text-sm font-medium",
22
20
  children: "Workflows"
23
21
  })
24
- }), a[0] = u, a[1] = v);
25
- let b;
26
- a[2] === l ? b = a[3] : (b = /* @__PURE__ */ jsx(ScrollProvider, { children: /* @__PURE__ */ jsx("div", {
22
+ }), i[0] = s, i[1] = l);
23
+ let d;
24
+ i[2] === a ? d = i[3] : (d = /* @__PURE__ */ jsx(ScrollProvider, { children: /* @__PURE__ */ jsx("div", {
27
25
  className: "flex-1 overflow-auto",
28
- children: /* @__PURE__ */ jsx(WorkflowList_default, { pipeline: l })
29
- }) }), a[2] = l, a[3] = b);
30
- let x;
31
- a[4] !== v || a[5] !== b ? (x = /* @__PURE__ */ jsxs("div", {
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];
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", {
37
- className: "w-full md:w-1/2 shrink-0 overflow-hidden flex flex-col",
38
- children: [/* @__PURE__ */ jsx(FileTabsBar, {}), /* @__PURE__ */ jsx("div", {
39
- className: "flex-1 overflow-hidden",
40
- children: /* @__PURE__ */ jsx(FileContentViewer, {
41
- selectedFile: m,
42
- content: h,
43
- workflowConfig: g,
44
- isLoading: _,
45
- className: "h-full"
46
- })
47
- })]
48
- }), a[7] = h, a[8] = _, a[9] = d.length, a[10] = m, a[11] = g, a[12] = S) : S = a[12];
49
- let C;
50
- return a[13] !== x || a[14] !== S ? (C = /* @__PURE__ */ jsx("div", {
26
+ children: /* @__PURE__ */ jsx(WorkflowList_default, { pipeline: a })
27
+ }) }), i[2] = a, i[3] = d);
28
+ let f;
29
+ return i[4] !== l || i[5] !== d ? (f = /* @__PURE__ */ jsx("div", {
51
30
  className: "flex h-full flex-col",
52
- children: /* @__PURE__ */ jsxs("div", {
31
+ children: /* @__PURE__ */ jsx("div", {
53
32
  className: "flex flex-1 gap-4 overflow-hidden md:flex-row flex-col",
54
- children: [x, S]
33
+ children: /* @__PURE__ */ jsxs("div", {
34
+ className: "flex flex-1 flex-col overflow-hidden",
35
+ children: [l, d]
36
+ })
55
37
  })
56
- }), a[13] = x, a[14] = S, a[15] = C) : C = a[15], C;
38
+ }), i[4] = l, i[5] = d, i[6] = f) : f = i[6], f;
57
39
  }
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, {
40
+ function WorkbenchInner(t) {
41
+ let r = c(21), { pipeline: i, breadcrumbData: o } = t, { activeSidePanel: s } = useWorkbenchLayout(), u = s ? "w-1/2 overflow-hidden" : "w-full overflow-hidden", _;
42
+ r[0] !== o || r[1] !== i ? (_ = /* @__PURE__ */ jsx(WorkbenchContent, {
68
43
  pipeline: i,
69
- breadcrumbData: a
70
- }), r[5] = a, r[6] = i, r[7] = S) : S = r[7];
44
+ breadcrumbData: o
45
+ }), r[0] = o, r[1] = i, r[2] = _) : _ = r[2];
46
+ let v;
47
+ r[3] !== u || r[4] !== _ ? (v = /* @__PURE__ */ jsx("div", {
48
+ className: u,
49
+ children: _
50
+ }), r[3] = u, r[4] = _, r[5] = v) : v = r[5];
51
+ let y;
52
+ r[6] === s ? y = r[7] : (y = s === "preview" && /* @__PURE__ */ jsx(WorkbenchPreviewPanel, {}), r[6] = s, r[7] = y);
53
+ let b;
54
+ r[8] === s ? b = r[9] : (b = s === "flow" && /* @__PURE__ */ jsx(WorkbenchFlowPanel, {}), r[8] = s, r[9] = b);
55
+ let x;
56
+ r[10] === s ? x = r[11] : (x = s === "files" && /* @__PURE__ */ jsx(WorkbenchFilesPanel, {}), r[10] = s, r[11] = x);
57
+ let S;
58
+ r[12] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsx(WorkbenchFloatingPanel, {}), r[12] = S) : S = r[12];
71
59
  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", {
60
+ r[13] !== v || r[14] !== y || r[15] !== b || r[16] !== x ? (C = /* @__PURE__ */ jsxs("div", {
84
61
  className: "relative flex flex-1 overflow-hidden",
85
62
  children: [
86
- C,
87
- w,
88
- T,
89
- E
63
+ v,
64
+ y,
65
+ b,
66
+ x,
67
+ S
90
68
  ]
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", {
69
+ }), r[13] = v, r[14] = y, r[15] = b, r[16] = x, r[17] = C) : C = r[17];
70
+ let w;
71
+ r[18] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(WorkbenchIconSidebar, {}), r[18] = w) : w = r[18];
72
+ let T;
73
+ return r[19] === C ? T = r[20] : (T = /* @__PURE__ */ jsxs("div", {
96
74
  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;
75
+ children: [C, w]
76
+ }), r[19] = C, r[20] = T), T;
104
77
  }
105
78
  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 ? {
108
- volumes: _.data.volumes,
109
- 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, {
79
+ let a = c(20), { pipeline: o, breadcrumbData: l, previewPanelOpen: u, onPreviewPanelOpenChange: d, isDeveloperMode: f, getPreviewUrl: p, getEnvironmentPreviewUrl: m, environments: h } = r, g = o?.workspaceId, v = useWorkspace(g), y;
80
+ a[0] !== h?.[0]?.slotId || a[1] !== v.data?.features?.fileExplorer?.enabled || a[2] !== v.data?.features?.fileExplorer?.environments ? (y = v.data?.features?.fileExplorer?.enabled && v.data?.features?.fileExplorer?.environments?.includes(h?.[0]?.slotId ?? ""), a[0] = h?.[0]?.slotId, a[1] = v.data?.features?.fileExplorer?.enabled, a[2] = v.data?.features?.fileExplorer?.environments, a[3] = y) : y = a[3];
81
+ let b = y, x;
82
+ a[4] === v.data ? x = a[5] : (x = v.data ? {
83
+ volumes: v.data.volumes,
84
+ features: v.data.features
85
+ } : void 0, a[4] = v.data, a[5] = x);
86
+ let S = x, C = h ?? v.data?.environments, w;
87
+ a[6] !== l || a[7] !== b || a[8] !== o ? (w = b ? /* @__PURE__ */ jsx(RemoteFileExplorerProvider, { children: /* @__PURE__ */ jsx(WorkbenchInner, {
88
+ pipeline: o,
89
+ breadcrumbData: l
90
+ }) }) : /* @__PURE__ */ jsx(WorkbenchInner, {
113
91
  pipeline: o,
114
- breadcrumbData: s
115
- }), i[2] = s, i[3] = o, i[4] = w) : w = i[4];
92
+ breadcrumbData: l
93
+ }), a[6] = l, a[7] = b, a[8] = o, a[9] = w) : w = a[9];
116
94
  let T;
117
- i[5] !== v || i[6] !== C || i[7] !== w ? (T = /* @__PURE__ */ jsx(CodeExplorerProvider, {
118
- pipelineId: C,
119
- fileExplorerEnabled: v,
120
- children: w
121
- }), i[5] = v, i[6] = C, i[7] = w, i[8] = T) : T = i[8];
122
- 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, {
95
+ return a[10] !== m || a[11] !== p || a[12] !== f || a[13] !== d || a[14] !== o || a[15] !== u || a[16] !== C || a[17] !== w || a[18] !== S ? (T = /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
124
96
  pipeline: o,
125
97
  isDeveloperMode: f,
126
- workspaceConfig: b,
98
+ workspaceConfig: S,
127
99
  getPreviewUrl: p,
128
100
  getEnvironmentPreviewUrl: m,
129
- environments: S,
130
- previewPanelOpen: l,
101
+ environments: C,
102
+ previewPanelOpen: u,
131
103
  onPreviewPanelOpenChange: d,
132
- 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;
104
+ children: w
105
+ }), a[10] = m, a[11] = p, a[12] = f, a[13] = d, a[14] = o, a[15] = u, a[16] = C, a[17] = w, a[18] = S, a[19] = T) : T = a[19], T;
134
106
  }
135
107
  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(45), { 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] !== M || m[35] !== C ? (U = !!C && /* @__PURE__ */ jsx("div", {
53
+ className: "mt-6",
54
+ children: /* @__PURE__ */ jsx(WorkflowForms_default, {
55
+ workflow: C,
56
+ onSubmit: M
57
+ })
58
+ }), m[34] = M, m[35] = C, m[36] = U) : U = m[36];
59
+ let W;
60
+ return m[37] !== V || m[38] !== H || m[39] !== U || m[40] !== I || m[41] !== R || m[42] !== z || m[43] !== 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[37] = V, m[38] = H, m[39] = U, m[40] = I, m[41] = R, m[42] = z, m[43] = B, m[44] = W) : W = m[44], 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";
@@ -0,0 +1,18 @@
1
+ import { FileTabsBarBase } from "../../code-explorer/components/FileTabsBarBase.js";
2
+ import { useRemoteFileExplorer } from "../providers/RemoteFileExplorerProvider.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { jsx } from "react/jsx-runtime";
5
+ function RemoteFileTabsBar() {
6
+ let i = c(9), { openFiles: a, selectedFile: o, selectFile: s, closeFile: l, closeAll: u, closeOthers: d, closeToLeft: f, closeToRight: p } = useRemoteFileExplorer(), m;
7
+ return i[0] !== u || i[1] !== l || i[2] !== d || i[3] !== f || i[4] !== p || i[5] !== a || i[6] !== s || i[7] !== o ? (m = /* @__PURE__ */ jsx(FileTabsBarBase, {
8
+ openFiles: a,
9
+ selectedFile: o,
10
+ selectFile: s,
11
+ closeFile: l,
12
+ closeAll: u,
13
+ closeOthers: d,
14
+ closeToLeft: f,
15
+ closeToRight: p
16
+ }), i[0] = u, i[1] = l, i[2] = d, i[3] = f, i[4] = p, i[5] = a, i[6] = s, i[7] = o, i[8] = m) : m = i[8], m;
17
+ }
18
+ export { RemoteFileTabsBar };