@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
@@ -0,0 +1,90 @@
1
+ import { Button } from "../../../components/ui/button.js";
2
+ import { ScrollArea } from "../../../components/ui/scroll-area.js";
3
+ import { CodeExplorerTreeNode } from "../../code-explorer/components/CodeExplorerTreeNode.js";
4
+ import { useRemoteFileExplorer } from "../providers/RemoteFileExplorerProvider.js";
5
+ import { c } from "react/compiler-runtime";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { AlertCircle, Loader2, RefreshCw } from "lucide-react";
8
+ var RemoteFileTree_default = () => {
9
+ let d = c(35), { nodes: f, isTreeLoading: p, treeError: m, isFetchingTree: h, expandedFolders: g, toggleFolder: _, selectFile: v, closeFile: y, selectedFile: b, refreshTree: x } = useRemoteFileExplorer();
10
+ if (p) {
11
+ let e;
12
+ return d[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsxs("div", {
13
+ className: "flex items-center gap-2 p-3 text-sm text-muted-foreground",
14
+ children: [/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), "Loading file tree…"]
15
+ }), d[0] = e) : e = d[0], e;
16
+ }
17
+ if (m) {
18
+ let a;
19
+ d[1] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ jsx(AlertCircle, { className: "mt-0.5 h-4 w-4 shrink-0" }), d[1] = a) : a = d[1];
20
+ let o = m instanceof Error ? m.message : String(m), s;
21
+ d[2] === o ? s = d[3] : (s = /* @__PURE__ */ jsxs("div", {
22
+ className: "flex items-start gap-2 text-sm text-destructive",
23
+ children: [a, /* @__PURE__ */ jsx("span", { children: o })]
24
+ }), d[2] = o, d[3] = s);
25
+ let l;
26
+ d[4] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ jsx(RefreshCw, { className: "mr-1.5 h-3.5 w-3.5" }), d[4] = l) : l = d[4];
27
+ let u;
28
+ d[5] === x ? u = d[6] : (u = /* @__PURE__ */ jsxs(Button, {
29
+ variant: "outline",
30
+ size: "sm",
31
+ onClick: x,
32
+ children: [l, "Retry"]
33
+ }), d[5] = x, d[6] = u);
34
+ let f;
35
+ return d[7] !== s || d[8] !== u ? (f = /* @__PURE__ */ jsxs("div", {
36
+ className: "space-y-2 p-3",
37
+ children: [s, u]
38
+ }), d[7] = s, d[8] = u, d[9] = f) : f = d[9], f;
39
+ }
40
+ if (f.length === 0) {
41
+ let e;
42
+ return d[10] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx("p", {
43
+ className: "px-2 py-4 text-sm text-muted-foreground",
44
+ children: "No files found"
45
+ }), d[10] = e) : e = d[10], e;
46
+ }
47
+ let S = `h-3 w-3 ${h ? "animate-spin" : ""}`, C;
48
+ d[11] === S ? C = d[12] : (C = /* @__PURE__ */ jsx(RefreshCw, { className: S }), d[11] = S, d[12] = C);
49
+ let w;
50
+ d[13] !== h || d[14] !== x || d[15] !== C ? (w = /* @__PURE__ */ jsx("div", {
51
+ className: "flex items-center justify-end px-1",
52
+ children: /* @__PURE__ */ jsx(Button, {
53
+ variant: "ghost",
54
+ size: "icon",
55
+ className: "h-6 w-6",
56
+ onClick: x,
57
+ disabled: h,
58
+ children: C
59
+ })
60
+ }), d[13] = h, d[14] = x, d[15] = C, d[16] = w) : w = d[16];
61
+ let T;
62
+ if (d[17] !== y || d[18] !== g || d[19] !== f || d[20] !== v || d[21] !== b?.id || d[22] !== _) {
63
+ let e;
64
+ d[24] !== y || d[25] !== g || d[26] !== v || d[27] !== b?.id || d[28] !== _ ? (e = (e) => /* @__PURE__ */ jsx(CodeExplorerTreeNode, {
65
+ node: e,
66
+ depth: 0,
67
+ expandedFolders: g,
68
+ toggleFolder: _,
69
+ onSelectFile: v,
70
+ onCloseFile: y,
71
+ selectedFileId: b?.id
72
+ }, e.id), d[24] = y, d[25] = g, d[26] = v, d[27] = b?.id, d[28] = _, d[29] = e) : e = d[29], T = f.map(e), d[17] = y, d[18] = g, d[19] = f, d[20] = v, d[21] = b?.id, d[22] = _, d[23] = T;
73
+ } else T = d[23];
74
+ let E;
75
+ d[30] === T ? E = d[31] : (E = /* @__PURE__ */ jsx(ScrollArea, {
76
+ className: "h-full w-full",
77
+ children: /* @__PURE__ */ jsx("div", {
78
+ className: "w-full py-1",
79
+ role: "tree",
80
+ "aria-label": "Remote file tree",
81
+ children: T
82
+ })
83
+ }), d[30] = T, d[31] = E);
84
+ let D;
85
+ return d[32] !== w || d[33] !== E ? (D = /* @__PURE__ */ jsxs("div", {
86
+ className: "flex h-full flex-col gap-1.5",
87
+ children: [w, E]
88
+ }), d[32] = w, d[33] = E, d[34] = D) : D = d[34], D;
89
+ };
90
+ export { RemoteFileTree_default as default };
@@ -0,0 +1,60 @@
1
+ import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
2
+ import { FileContentViewer } from "../../code-explorer/components/FileContentViewer.js";
3
+ import "../../code-explorer/index.js";
4
+ import { useOptionalRemoteFileExplorer } from "../providers/RemoteFileExplorerProvider.js";
5
+ import { RemoteFileTabsBar } from "./RemoteFileTabsBar.js";
6
+ import RemoteFileTree_default from "./RemoteFileTree.js";
7
+ import { c } from "react/compiler-runtime";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ import { X } from "lucide-react";
10
+ function WorkbenchFilesPanel() {
11
+ let d = c(9), { closeSidePanel: f, fileExplorerEnabled: p } = useWorkbenchLayout(), m = useOptionalRemoteFileExplorer();
12
+ if (!p) return null;
13
+ let h;
14
+ d[0] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ jsx("span", {
15
+ className: "text-sm font-medium",
16
+ children: "Files"
17
+ }), d[0] = h) : h = d[0];
18
+ let g;
19
+ d[1] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }), d[1] = g) : g = d[1];
20
+ let _;
21
+ d[2] === f ? _ = d[3] : (_ = /* @__PURE__ */ jsxs("div", {
22
+ className: "border-b flex h-12 shrink-0 items-center justify-between px-3",
23
+ children: [h, /* @__PURE__ */ jsx("button", {
24
+ onClick: f,
25
+ className: "text-muted-foreground hover:text-foreground flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:cursor-pointer",
26
+ children: g
27
+ })]
28
+ }), d[2] = f, d[3] = _);
29
+ let v;
30
+ d[4] === m ? v = d[5] : (v = /* @__PURE__ */ jsx("div", {
31
+ className: "flex-1 overflow-hidden flex",
32
+ children: m ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
33
+ className: "w-64 shrink-0 border-r bg-muted/40",
34
+ children: /* @__PURE__ */ jsx(RemoteFileTree_default, {})
35
+ }), /* @__PURE__ */ jsxs("div", {
36
+ className: "flex-1 flex flex-col min-w-0",
37
+ children: [/* @__PURE__ */ jsx(RemoteFileTabsBar, {}), /* @__PURE__ */ jsx("div", {
38
+ className: "flex-1 overflow-hidden p-3 pt-2",
39
+ children: /* @__PURE__ */ jsx(FileContentViewer, {
40
+ selectedFile: m.selectedFile,
41
+ content: m.fileContent,
42
+ isLoading: m.isContentLoading,
43
+ className: "h-full"
44
+ })
45
+ })]
46
+ })] }) : /* @__PURE__ */ jsx("div", {
47
+ className: "flex-1 flex items-center justify-center p-4",
48
+ children: /* @__PURE__ */ jsx("p", {
49
+ className: "text-sm text-muted-foreground",
50
+ children: "Remote file explorer is not available for this workspace."
51
+ })
52
+ })
53
+ }), d[4] = m, d[5] = v);
54
+ let y;
55
+ return d[6] !== _ || d[7] !== v ? (y = /* @__PURE__ */ jsxs("div", {
56
+ className: "border-l bg-background flex w-2/3 shrink-0 flex-col",
57
+ children: [_, v]
58
+ }), d[6] = _, d[7] = v, d[8] = y) : y = d[8], y;
59
+ }
60
+ export { WorkbenchFilesPanel };
@@ -1,15 +1,16 @@
1
- import { usePipeline, usePipelineConfig } from "../../../hooks/usePipelines.js";
1
+ import { usePipeline, usePipelineConfigByName } from "../../../hooks/usePipelines.js";
2
2
  import { useWorkspace } from "../../../hooks/useWorkspaces.js";
3
3
  import { useFetchWorkflowsByPipeline } from "../../../hooks/useWorkflows.js";
4
- import { ReactFlowProvider } from "../../../node_modules/@xyflow/react/dist/esm/index.js";
5
4
  import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
5
+ import { ReactFlowProvider } from "../../../node_modules/@xyflow/react/dist/esm/index.js";
6
6
  import PipelineFlowViewer_default from "../../debug/components/PipelineFlowViewer.js";
7
+ import "../../debug/index.js";
7
8
  import { c } from "react/compiler-runtime";
8
9
  import { useMemo } from "react";
9
10
  import { jsx, jsxs } from "react/jsx-runtime";
10
11
  import { X } from "lucide-react";
11
12
  function WorkbenchFlowPanel() {
12
- let f = c(13), { pipeline: p, closeSidePanel: m } = useWorkbenchLayout(), h = usePipeline(p.id), g = useWorkspace(p.workspaceId), _ = useFetchWorkflowsByPipeline(p.id), v = usePipelineConfig(g.data?.blockName, h.data?.blockName), y;
13
+ let f = c(13), { pipeline: p, closeSidePanel: m } = useWorkbenchLayout(), h = usePipeline(p.id), g = useWorkspace(p.workspaceId), _ = useFetchWorkflowsByPipeline(p.id), v = usePipelineConfigByName(g.data?.blockName, h.data?.blockName), y;
13
14
  f[0] === _.data ? y = f[1] : (y = _.data ?? [], f[0] = _.data, f[1] = y);
14
15
  let b = y, x;
15
16
  f[2] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ jsx("span", {
@@ -3,7 +3,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/ui/
3
3
  import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
4
4
  import { c } from "react/compiler-runtime";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- import { ListOrdered, MonitorPlay, Navigation, Workflow } from "lucide-react";
6
+ import { Files, ListOrdered, MonitorPlay, Navigation, Workflow } from "lucide-react";
7
7
  function IconButton(s) {
8
8
  let l = c(11), { icon: u, label: d, active: f, onClick: p } = s, m = f ? "bg-foreground text-background" : "text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground", h;
9
9
  l[0] === m ? h = l[1] : (h = cn("flex h-10 w-10 items-center justify-center rounded-md transition-colors hover:cursor-pointer", m), l[0] = m, l[1] = h);
@@ -25,44 +25,52 @@ function IconButton(s) {
25
25
  return l[8] !== g || l[9] !== _ ? (v = /* @__PURE__ */ jsxs(Tooltip, { children: [g, _] }), l[8] = g, l[9] = _, l[10] = v) : v = l[10], v;
26
26
  }
27
27
  function WorkbenchIconSidebar() {
28
- let e = c(20), { previewPanelEnabled: i, isDeveloperMode: a, activeFloatingPanel: o, toggleFloatingPanel: h, activeSidePanel: g, toggleSidePanel: _ } = useWorkbenchLayout(), v;
29
- e[0] !== g || e[1] !== i || e[2] !== _ ? (v = i && /* @__PURE__ */ jsx(IconButton, {
28
+ let e = c(25), { previewPanelEnabled: i, fileExplorerEnabled: a, isDeveloperMode: o, activeFloatingPanel: g, toggleFloatingPanel: _, activeSidePanel: v, toggleSidePanel: y } = useWorkbenchLayout(), b;
29
+ e[0] !== v || e[1] !== i || e[2] !== y ? (b = i && /* @__PURE__ */ jsx(IconButton, {
30
30
  icon: /* @__PURE__ */ jsx(MonitorPlay, { className: "h-5 w-5" }),
31
31
  label: "Preview",
32
- active: g === "preview",
33
- onClick: () => _("preview")
34
- }), e[0] = g, e[1] = i, e[2] = _, e[3] = v) : v = e[3];
35
- let y;
36
- e[4] !== o || e[5] !== g || e[6] !== a || e[7] !== h || e[8] !== _ ? (y = a && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
32
+ active: v === "preview",
33
+ onClick: () => y("preview")
34
+ }), e[0] = v, e[1] = i, e[2] = y, e[3] = b) : b = e[3];
35
+ let x;
36
+ e[4] !== g || e[5] !== v || e[6] !== o || e[7] !== _ || e[8] !== y ? (x = o && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
37
37
  icon: /* @__PURE__ */ jsx(Workflow, { className: "h-5 w-5" }),
38
38
  label: "Graph",
39
- active: g === "flow",
40
- onClick: () => _("flow")
39
+ active: v === "flow",
40
+ onClick: () => y("flow")
41
41
  }), /* @__PURE__ */ jsx(IconButton, {
42
42
  icon: /* @__PURE__ */ jsx(ListOrdered, { className: "h-5 w-5" }),
43
43
  label: "Run Log",
44
- active: o === "history",
45
- onClick: () => h("history")
46
- })] }), e[4] = o, e[5] = g, e[6] = a, e[7] = h, e[8] = _, e[9] = y) : y = e[9];
47
- let b;
48
- e[10] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ jsx(Navigation, { className: "h-5 w-5" }), e[10] = b) : b = e[10];
49
- let x = o === "navigation", S;
50
- e[11] === h ? S = e[12] : (S = () => h("navigation"), e[11] = h, e[12] = S);
51
- let C;
52
- e[13] !== x || e[14] !== S ? (C = /* @__PURE__ */ jsx(IconButton, {
53
- icon: b,
44
+ active: g === "history",
45
+ onClick: () => _("history")
46
+ })] }), e[4] = g, e[5] = v, e[6] = o, e[7] = _, e[8] = y, e[9] = x) : x = e[9];
47
+ let S;
48
+ e[10] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsx(Navigation, { className: "h-5 w-5" }), e[10] = S) : S = e[10];
49
+ let C = g === "navigation", w;
50
+ e[11] === _ ? w = e[12] : (w = () => _("navigation"), e[11] = _, e[12] = w);
51
+ let T;
52
+ e[13] !== C || e[14] !== w ? (T = /* @__PURE__ */ jsx(IconButton, {
53
+ icon: S,
54
54
  label: "Navigate",
55
- active: x,
56
- onClick: S
57
- }), e[13] = x, e[14] = S, e[15] = C) : C = e[15];
58
- let w;
59
- return e[16] !== v || e[17] !== y || e[18] !== C ? (w = /* @__PURE__ */ jsxs("div", {
55
+ active: C,
56
+ onClick: w
57
+ }), e[13] = C, e[14] = w, e[15] = T) : T = e[15];
58
+ let E;
59
+ e[16] !== v || e[17] !== a || e[18] !== y ? (E = a && /* @__PURE__ */ jsx(IconButton, {
60
+ icon: /* @__PURE__ */ jsx(Files, { className: "h-5 w-5" }),
61
+ label: "Files",
62
+ active: v === "files",
63
+ onClick: () => y("files")
64
+ }), e[16] = v, e[17] = a, e[18] = y, e[19] = E) : E = e[19];
65
+ let D;
66
+ return e[20] !== b || e[21] !== x || e[22] !== T || e[23] !== E ? (D = /* @__PURE__ */ jsxs("div", {
60
67
  className: "border-l bg-background flex w-12 shrink-0 flex-col items-center gap-1 py-2",
61
68
  children: [
62
- v,
63
- y,
64
- C
69
+ b,
70
+ x,
71
+ T,
72
+ E
65
73
  ]
66
- }), e[16] = v, e[17] = y, e[18] = C, e[19] = w) : w = e[19], w;
74
+ }), e[20] = b, e[21] = x, e[22] = T, e[23] = E, e[24] = D) : D = e[24], D;
67
75
  }
68
76
  export { WorkbenchIconSidebar };
@@ -1,7 +1,7 @@
1
- import { useWorkflow } from "../../../hooks/useWorkflows.js";
2
1
  import { cn } from "../../../lib/utils.js";
3
2
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../components/ui/collapsible.js";
4
3
  import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/ui/tooltip.js";
4
+ import { useWorkflow } from "../../../hooks/useWorkflows.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import React from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -10,8 +10,8 @@ import { format } from "date-fns";
10
10
  var WorkflowHistoryItem_default = (_) => {
11
11
  let y = c(19), { workflowId: b, workflow: x } = _, S = useWorkflow(b), C = S.data?.history;
12
12
  if (S.isLoading) {
13
- let e;
14
- return y[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx("li", {
13
+ let t;
14
+ return y[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ jsx("li", {
15
15
  className: "group/menu-item relative list-none",
16
16
  children: /* @__PURE__ */ jsxs("div", {
17
17
  className: "flex w-full items-center gap-2 rounded-md p-2 text-sm opacity-50",
@@ -20,7 +20,7 @@ var WorkflowHistoryItem_default = (_) => {
20
20
  children: "Loading..."
21
21
  })]
22
22
  })
23
- }), y[0] = e) : e = y[0], e;
23
+ }), y[0] = t) : t = y[0], t;
24
24
  }
25
25
  if (!C?.length) return null;
26
26
  let w;
@@ -64,10 +64,10 @@ var WorkflowHistoryItem_default = (_) => {
64
64
  }), y[9] = j) : j = y[9];
65
65
  let M;
66
66
  if (y[10] !== C) {
67
- let e;
68
- y[12] === C.length ? e = y[13] : (e = (e, p) => {
69
- console.log(e);
70
- let m = e.data?.transition, h = Object.keys(e.data?.tools ?? {}), g = p === C.length - 1, _ = e.data?.place ?? m?.to ?? "unknown", v = m?.id;
67
+ let f;
68
+ y[12] === C.length ? f = y[13] : (f = (f, p) => {
69
+ console.log(f);
70
+ let m = f.data?.transition, h = Object.keys(f.data?.tools ?? {}), g = p === C.length - 1, _ = f.data?.place ?? m?.to ?? "unknown", v = m?.id;
71
71
  return /* @__PURE__ */ jsxs("div", {
72
72
  className: "group/entry relative flex gap-3 py-1 pl-0",
73
73
  children: [/* @__PURE__ */ jsx("div", {
@@ -116,13 +116,13 @@ var WorkflowHistoryItem_default = (_) => {
116
116
  className: "flex items-center gap-0.5",
117
117
  children: [/* @__PURE__ */ jsx(Clock, { className: "h-3 w-3" }), /* @__PURE__ */ jsx("span", {
118
118
  className: "tabular-nums",
119
- children: format(new Date(e.timestamp), "HH:mm:ss")
119
+ children: format(new Date(f.timestamp), "HH:mm:ss")
120
120
  })]
121
121
  })]
122
122
  })]
123
123
  })]
124
- }, e.version);
125
- }, y[12] = C.length, y[13] = e), M = C.map(e), y[10] = C, y[11] = M;
124
+ }, f.version);
125
+ }, y[12] = C.length, y[13] = f), M = C.map(f), y[10] = C, y[11] = M;
126
126
  } else M = y[11];
127
127
  let N;
128
128
  y[14] === M ? N = y[15] : (N = /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("ul", {
@@ -1,48 +1,47 @@
1
- import { useStudio } from "../../../../providers/StudioProvider.js";
2
- import { useDeleteWorkflow, useWorkflow } from "../../../../hooks/useWorkflows.js";
3
1
  import { Button } from "../../../../components/ui/button.js";
4
2
  import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../../../../components/ui/alert-dialog.js";
5
3
  import { Tooltip, TooltipContent, TooltipTrigger } from "../../../../components/ui/tooltip.js";
6
4
  import { useRunPipeline } from "../../../../hooks/useProcessor.js";
5
+ import { useDeleteWorkflow, useWorkflow } from "../../../../hooks/useWorkflows.js";
7
6
  import { c } from "react/compiler-runtime";
8
7
  import React from "react";
9
8
  import { jsx, jsxs } from "react/jsx-runtime";
10
9
  import { LockOpen, Repeat } from "lucide-react";
11
- var WorkflowButtons_default = (T) => {
12
- let E = c(36), { pipeline: D, workflowId: O } = T, { router: k } = useStudio(), A = useWorkflow(O).data, j = useDeleteWorkflow(), M = useRunPipeline(), N;
13
- E[0] !== D.id || E[1] !== M ? (N = () => {
14
- M.mutate({
15
- pipelineId: D.id,
10
+ var WorkflowButtons_default = (w) => {
11
+ let T = c(34), { pipeline: E, workflowId: D } = w, O = useWorkflow(D).data, k = useDeleteWorkflow(), A = useRunPipeline(), j;
12
+ T[0] !== E.id || T[1] !== A ? (j = () => {
13
+ A.mutate({
14
+ pipelineId: E.id,
16
15
  runPipelinePayloadDto: {},
17
16
  force: !1
18
17
  });
19
- }, E[0] = D.id, E[1] = M, E[2] = N) : N = E[2];
20
- let P = N, F;
21
- E[3] !== D.id || E[4] !== M || E[5] !== O ? (F = () => {
22
- M.mutate({
23
- pipelineId: D.id,
18
+ }, T[0] = E.id, T[1] = A, T[2] = j) : j = T[2];
19
+ let M = j, N;
20
+ T[3] !== E.id || T[4] !== A || T[5] !== D ? (N = () => {
21
+ A.mutate({
22
+ pipelineId: E.id,
24
23
  runPipelinePayloadDto: { transition: {
25
24
  name: "unlock",
26
- workflowId: O
25
+ workflowId: D
27
26
  } },
28
27
  force: !1
29
28
  });
30
- }, E[3] = D.id, E[4] = M, E[5] = O, E[6] = F) : F = E[6];
31
- let I = F, L;
32
- E[7] !== j || E[8] !== P || E[9] !== D.id || E[10] !== k || E[11] !== A ? (L = () => {
33
- if (A) try {
34
- j.mutate(A), P(), k.navigateToPipeline(D.id);
29
+ }, T[3] = E.id, T[4] = A, T[5] = D, T[6] = N) : N = T[6];
30
+ let P = N, F;
31
+ T[7] !== k || T[8] !== M || T[9] !== O ? (F = () => {
32
+ if (O) try {
33
+ k.mutate(O), M();
35
34
  } catch (t) {
36
- let w = t;
37
- console.error("Mutation failed:", w);
35
+ let C = t;
36
+ console.error("Mutation failed:", C);
38
37
  }
39
- }, E[7] = j, E[8] = P, E[9] = D.id, E[10] = k, E[11] = A, E[12] = L) : L = E[12];
40
- let R = L;
41
- if (!A) return null;
42
- let z;
43
- E[13] === j.isPending ? z = E[14] : (z = j.isPending ? /* @__PURE__ */ jsx("div", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(Repeat, { className: "h-3.5 w-3.5" }), E[13] = j.isPending, E[14] = z);
44
- let B;
45
- E[15] !== j.isPending || E[16] !== z ? (B = /* @__PURE__ */ jsx(TooltipTrigger, {
38
+ }, T[7] = k, T[8] = M, T[9] = O, T[10] = F) : F = T[10];
39
+ let I = F;
40
+ if (!O) return null;
41
+ let L;
42
+ T[11] === k.isPending ? L = T[12] : (L = k.isPending ? /* @__PURE__ */ jsx("div", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(Repeat, { className: "h-3.5 w-3.5" }), T[11] = k.isPending, T[12] = L);
43
+ let R;
44
+ T[13] !== k.isPending || T[14] !== L ? (R = /* @__PURE__ */ jsx(TooltipTrigger, {
46
45
  asChild: !0,
47
46
  children: /* @__PURE__ */ jsx(AlertDialogTrigger, {
48
47
  asChild: !0,
@@ -50,28 +49,28 @@ var WorkflowButtons_default = (T) => {
50
49
  variant: "ghost",
51
50
  size: "icon",
52
51
  className: "h-7 w-7",
53
- disabled: j.isPending,
54
- children: z
52
+ disabled: k.isPending,
53
+ children: L
55
54
  })
56
55
  })
57
- }), E[15] = j.isPending, E[16] = z, E[17] = B) : B = E[17];
56
+ }), T[13] = k.isPending, T[14] = L, T[15] = R) : R = T[15];
57
+ let z;
58
+ T[16] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ jsx(TooltipContent, { children: "Repeat" }), T[16] = z) : z = T[16];
59
+ let B;
60
+ T[17] === R ? B = T[18] : (B = /* @__PURE__ */ jsxs(Tooltip, { children: [R, z] }), T[17] = R, T[18] = B);
58
61
  let V;
59
- E[18] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ jsx(TooltipContent, { children: "Repeat" }), E[18] = V) : V = E[18];
62
+ T[19] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Repeat workflow" }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: "This will delete the current workflow run and re-trigger the pipeline." })] }), T[19] = V) : V = T[19];
60
63
  let H;
61
- E[19] === B ? H = E[20] : (H = /* @__PURE__ */ jsxs(Tooltip, { children: [B, V] }), E[19] = B, E[20] = H);
64
+ T[20] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ jsx(AlertDialogCancel, { children: "Cancel" }), T[20] = H) : H = T[20];
62
65
  let U;
63
- E[21] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Repeat workflow" }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: "This will delete the current workflow run and re-trigger the pipeline." })] }), E[21] = U) : U = E[21];
66
+ T[21] === I ? U = T[22] : (U = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [V, /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [H, /* @__PURE__ */ jsx(AlertDialogAction, {
67
+ onClick: I,
68
+ children: "Repeat"
69
+ })] })] }), T[21] = I, T[22] = U);
64
70
  let W;
65
- E[22] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ jsx(AlertDialogCancel, { children: "Cancel" }), E[22] = W) : W = E[22];
71
+ T[23] !== U || T[24] !== B ? (W = /* @__PURE__ */ jsxs(AlertDialog, { children: [B, U] }), T[23] = U, T[24] = B, T[25] = W) : W = T[25];
66
72
  let G;
67
- E[23] === R ? G = E[24] : (G = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [U, /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [W, /* @__PURE__ */ jsx(AlertDialogAction, {
68
- onClick: R,
69
- children: "Repeat"
70
- })] })] }), E[23] = R, E[24] = G);
71
- let K;
72
- E[25] !== G || E[26] !== H ? (K = /* @__PURE__ */ jsxs(AlertDialog, { children: [H, G] }), E[25] = G, E[26] = H, E[27] = K) : K = E[27];
73
- let q;
74
- E[28] !== I || E[29] !== M.isPending || E[30] !== A.availableTransitions || E[31] !== A.place ? (q = A.place === "end" && A.availableTransitions?.find(_temp2) && /* @__PURE__ */ jsxs(AlertDialog, { children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
73
+ T[26] !== P || T[27] !== A.isPending || T[28] !== O.availableTransitions || T[29] !== O.place ? (G = O.place === "end" && O.availableTransitions?.find(_temp2) && /* @__PURE__ */ jsxs(AlertDialog, { children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
75
74
  asChild: !0,
76
75
  children: /* @__PURE__ */ jsx(AlertDialogTrigger, {
77
76
  asChild: !0,
@@ -79,20 +78,20 @@ var WorkflowButtons_default = (T) => {
79
78
  variant: "ghost",
80
79
  size: "icon",
81
80
  className: "h-7 w-7",
82
- disabled: M.isPending,
83
- children: M.isPending ? /* @__PURE__ */ jsx("div", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(LockOpen, { className: "h-3.5 w-3.5" })
81
+ disabled: A.isPending,
82
+ children: A.isPending ? /* @__PURE__ */ jsx("div", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(LockOpen, { className: "h-3.5 w-3.5" })
84
83
  })
85
84
  })
86
85
  }), /* @__PURE__ */ jsx(TooltipContent, { children: "Unlock Step" })] }), /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Unlock workflow" }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: "Are you sure you want to unlock this workflow?" })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, { children: "Cancel" }), /* @__PURE__ */ jsx(AlertDialogAction, {
87
- onClick: I,
86
+ onClick: P,
88
87
  children: "Unlock"
89
- })] })] })] }), E[28] = I, E[29] = M.isPending, E[30] = A.availableTransitions, E[31] = A.place, E[32] = q) : q = E[32];
90
- let J;
91
- return E[33] !== K || E[34] !== q ? (J = /* @__PURE__ */ jsxs("div", {
88
+ })] })] })] }), T[26] = P, T[27] = A.isPending, T[28] = O.availableTransitions, T[29] = O.place, T[30] = G) : G = T[30];
89
+ let K;
90
+ return T[31] !== W || T[32] !== G ? (K = /* @__PURE__ */ jsxs("div", {
92
91
  className: "flex items-center",
93
92
  onClick: _temp,
94
- children: [K, q]
95
- }), E[33] = K, E[34] = q, E[35] = J) : J = E[35], J;
93
+ children: [W, G]
94
+ }), T[31] = W, T[32] = G, T[33] = K) : K = T[33], K;
96
95
  };
97
96
  function _temp(t) {
98
97
  return t.stopPropagation();
@@ -0,0 +1,49 @@
1
+ import { useRunPipeline } from "../../../hooks/useProcessor.js";
2
+ import { require_enums } from "../../../packages/contracts/dist/enums/index.js";
3
+ import { useFilterDocuments } from "../../../hooks/useDocuments.js";
4
+ import { useWorkflow } from "../../../hooks/useWorkflows.js";
5
+ import { c } from "react/compiler-runtime";
6
+ import { useCallback, useMemo } from "react";
7
+ var import_enums = require_enums();
8
+ function useWorkflowData(r) {
9
+ let o = c(22), { workflowId: s, showFullMessageHistory: l } = r, u = useWorkflow(s), d = useFilterDocuments(s), f = useRunPipeline(), p;
10
+ o[0] !== u.data?.place || o[1] !== l ? (p = (e) => {
11
+ let r = e.meta, i = e.ui, a = r?.hidden || i?.hidden || !!r?.hideAtPlaces?.includes(u.data?.place ?? "");
12
+ return !l && e.tags?.includes("internal") && (a = !0), !a;
13
+ }, o[0] = u.data?.place, o[1] = l, o[2] = p) : p = o[2];
14
+ let m = p, h;
15
+ bb0: {
16
+ if (!d.data) {
17
+ let e;
18
+ o[3] === Symbol.for("react.memo_cache_sentinel") ? (e = [], o[3] = e) : e = o[3], h = e;
19
+ break bb0;
20
+ }
21
+ let e;
22
+ o[4] !== d.data || o[5] !== m ? (e = d.data.filter(m), o[4] = d.data, o[5] = m, o[6] = e) : e = o[6], h = e;
23
+ }
24
+ let g = h, _;
25
+ o[7] !== u.data || o[8] !== f || o[9] !== s ? (_ = (e, r) => {
26
+ f.mutate({
27
+ pipelineId: u.data.pipelineId,
28
+ runPipelinePayloadDto: { transition: {
29
+ id: e,
30
+ workflowId: s,
31
+ payload: r
32
+ } }
33
+ });
34
+ }, o[7] = u.data, o[8] = f, o[9] = s, o[10] = _) : _ = o[10];
35
+ let v = _, y = f.isPending || u.data?.status === import_enums.WorkflowState.Running, b = u.data?.errorMessage, x;
36
+ return o[11] !== g || o[12] !== d.error || o[13] !== d.isLoading || o[14] !== d.isSuccess || o[15] !== u.data || o[16] !== u.isLoading || o[17] !== u.isSuccess || o[18] !== v || o[19] !== y || o[20] !== b ? (x = {
37
+ workflow: u.data,
38
+ workflowLoading: u.isLoading,
39
+ workflowReady: u.isSuccess,
40
+ workflowError: b,
41
+ documents: g,
42
+ documentsLoading: d.isLoading,
43
+ documentsReady: d.isSuccess,
44
+ documentsError: d.error,
45
+ isLoading: y,
46
+ handleRun: v
47
+ }, o[11] = g, o[12] = d.error, o[13] = d.isLoading, o[14] = d.isSuccess, o[15] = u.data, o[16] = u.isLoading, o[17] = u.isSuccess, o[18] = v, o[19] = y, o[20] = b, o[21] = x) : x = o[21], x;
48
+ }
49
+ export { useWorkflowData };
@@ -0,0 +1,50 @@
1
+ import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
2
+ import { useScrollToBottom } from "./useAutoScrollBottom.js";
3
+ import { useIntersectionObserver } from "./useIntersectionObserver.js";
4
+ import { useScrollToListItem } from "./useScrollToListItem.js";
5
+ import { c } from "react/compiler-runtime";
6
+ import { useEffect, useState } from "react";
7
+ function useWorkflowListState(s) {
8
+ let l = c(19), u;
9
+ l[0] === Symbol.for("react.memo_cache_sentinel") ? (u = {}, l[0] = u) : u = l[0];
10
+ let [d, f] = useState(u), { activeId: p, observe: m } = useIntersectionObserver("0px 0px 0px 0px"), { listRef: h, scrollTo: g } = useScrollToListItem(), { canScrollDown: _, scrollToBottom: v } = useScrollToBottom(), { activeSectionId: y, setActiveSectionId: b } = useWorkbenchLayout(), x, S;
11
+ l[1] !== p || l[2] !== y || l[3] !== b ? (x = () => {
12
+ y !== p && (b(p), p && f((e) => ({
13
+ ...e,
14
+ [p]: !0
15
+ })));
16
+ }, S = [
17
+ p,
18
+ y,
19
+ b
20
+ ], l[1] = p, l[2] = y, l[3] = b, l[4] = x, l[5] = S) : (x = l[4], S = l[5]), useEffect(x, S);
21
+ let C, w;
22
+ l[6] !== p || l[7] !== s ? (C = () => {
23
+ if (s && s.length > 0) {
24
+ let e = s[s.length - 1], o = `section-${e.index}-${e.id}`;
25
+ f({
26
+ [o]: !0,
27
+ ...p && p !== o ? { [p]: !0 } : {}
28
+ });
29
+ }
30
+ }, w = [s, p], l[6] = p, l[7] = s, l[8] = C, l[9] = w) : (C = l[8], w = l[9]), useEffect(C, w);
31
+ let T;
32
+ l[10] === Symbol.for("react.memo_cache_sentinel") ? (T = (e) => {
33
+ f((o) => ({
34
+ ...o,
35
+ [e]: !o[e]
36
+ }));
37
+ }, l[10] = T) : T = l[10];
38
+ let E = T, D;
39
+ return l[11] !== p || l[12] !== _ || l[13] !== d || l[14] !== h || l[15] !== m || l[16] !== g || l[17] !== v ? (D = {
40
+ activeId: p,
41
+ expandedSections: d,
42
+ observe: m,
43
+ listRef: h,
44
+ scrollTo: g,
45
+ canScrollDown: _,
46
+ scrollToBottom: v,
47
+ toggleSection: E
48
+ }, l[11] = p, l[12] = _, l[13] = d, l[14] = h, l[15] = m, l[16] = g, l[17] = v, l[18] = D) : D = l[18], D;
49
+ }
50
+ export { useWorkflowListState };
@@ -0,0 +1,8 @@
1
+ import WorkflowItem_default from "./WorkflowItem.js";
2
+ import WorkflowButtons_default from "./components/buttons/WorkflowButtons.js";
3
+ import { useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
4
+ import WorkflowList_default from "./WorkflowList.js";
5
+ import WorkbenchNavigation_default from "./WorkbenchNavigation.js";
6
+ import PipelineHistoryList_default from "./components/PipelineHistoryList.js";
7
+ import Workbench from "./Workbench.js";
8
+ import { NewRunDialog } from "./components/NewRunDialog.js";