@loopstack/loopstack-studio 0.25.2 → 0.26.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 (96) hide show
  1. package/dist/api/environments.js +4 -0
  2. package/dist/api/index.js +13 -9
  3. package/dist/app/EnvironmentEmbedRoot.js +29 -19
  4. package/dist/components/data-table/DataList.js +93 -91
  5. package/dist/components/data-table/DataTable.js +128 -126
  6. package/dist/components/feedback/Snackbar.js +1 -1
  7. package/dist/components/layout/StudioSidebar.js +124 -131
  8. package/dist/components/ui/sidebar.js +2 -2
  9. package/dist/components/ui/slider.js +37 -26
  10. package/dist/components/ui-widgets/widgets/SandboxRun.js +16 -14
  11. package/dist/features/code-explorer/components/CodeExplorerTree.js +1 -0
  12. package/dist/features/code-explorer/components/FileContentViewer.js +1 -1
  13. package/dist/features/dashboard/RunItem.js +39 -37
  14. package/dist/features/debug/lib/flow-utils.js +1 -1
  15. package/dist/features/documents/DocumentRenderer.js +59 -58
  16. package/dist/features/documents/renderers/useDocumentTransition.js +29 -24
  17. package/dist/features/feature-registry/FeatureRegistryProvider.js +17 -0
  18. package/dist/features/feature-registry/index.js +1 -0
  19. package/dist/features/file-explorer/api/files.js +7 -0
  20. package/dist/features/file-explorer/components/FileExplorerPanel.js +95 -0
  21. package/dist/features/{workbench/components/RemoteFileTabsBar.js → file-explorer/components/FileTabsBar.js} +4 -4
  22. package/dist/features/{workbench/components/RemoteFileTree.js → file-explorer/components/FileTree.js} +6 -6
  23. package/dist/features/file-explorer/file-explorer-feature.js +12 -0
  24. package/dist/features/file-explorer/hooks/useFileExplorer.js +44 -0
  25. package/dist/features/file-explorer/index.js +2 -0
  26. package/dist/features/file-explorer/providers/FileExplorerProvider.js +112 -0
  27. package/dist/features/oauth/OAuthPromptRenderer.js +162 -132
  28. package/dist/features/runs/Runs.js +1 -1
  29. package/dist/features/secrets/components/WorkbenchSecretsPanel.js +178 -0
  30. package/dist/features/secrets/index.js +1 -0
  31. package/dist/features/{documents → secrets}/renderers/SecretInputRenderer.js +17 -17
  32. package/dist/features/secrets/secrets-feature.js +14 -0
  33. package/dist/features/workbench/Workbench.js +32 -82
  34. package/dist/features/workbench/WorkflowList.js +109 -46
  35. package/dist/features/workbench/components/SidebarPanel.js +155 -0
  36. package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +82 -0
  37. package/dist/features/workbench/components/WorkbenchIconSidebar.js +128 -60
  38. package/dist/features/workbench/components/WorkbenchPreviewPanel.js +127 -114
  39. package/dist/features/workbench/components/WorkbenchRunsPanel.js +32 -0
  40. package/dist/features/workbench/components/WorkbenchSidebarShell.js +80 -0
  41. package/dist/features/workbench/hooks/useWorkflowData.js +3 -3
  42. package/dist/features/workbench/index.js +3 -2
  43. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +60 -62
  44. package/dist/features/workspaces/Workspaces.js +1 -1
  45. package/dist/features/workspaces/components/EnvironmentSlotSelector.js +68 -51
  46. package/dist/features/workspaces/components/WorkflowRunForm.js +1 -1
  47. package/dist/features/workspaces/components/WorkspaceHomePage.js +1 -1
  48. package/dist/hooks/useEnvironmentPreviewUrl.js +13 -0
  49. package/dist/hooks/useEnvironments.js +8 -0
  50. package/dist/hooks/useWorkflows.js +28 -26
  51. package/dist/hooks/useWorkspaces.js +28 -26
  52. package/dist/index.d.ts +98 -7
  53. package/dist/index.js +8 -1
  54. package/dist/loopstack-studio.css +1 -1
  55. package/dist/node_modules/@shikijs/core/dist/index.js +105 -643
  56. package/dist/node_modules/@shikijs/engine-oniguruma/dist/index.js +135 -122
  57. package/dist/node_modules/@shikijs/langs/dist/bird2.js +1 -1
  58. package/dist/node_modules/@shikijs/langs/dist/cobol.js +1 -1
  59. package/dist/node_modules/@shikijs/langs/dist/css.js +1 -1
  60. package/dist/node_modules/@shikijs/langs/dist/dart.js +1 -1
  61. package/dist/node_modules/@shikijs/langs/dist/emacs-lisp.js +1 -1
  62. package/dist/node_modules/@shikijs/langs/dist/es-tag-sql.js +1 -1
  63. package/dist/node_modules/@shikijs/langs/dist/go.js +1 -1
  64. package/dist/node_modules/@shikijs/langs/dist/kusto.js +1 -1
  65. package/dist/node_modules/@shikijs/langs/dist/nextflow-groovy.js +1 -1
  66. package/dist/node_modules/@shikijs/langs/dist/php.js +1 -1
  67. package/dist/node_modules/@shikijs/langs/dist/ruby.js +1 -1
  68. package/dist/node_modules/@shikijs/langs/dist/typespec.js +1 -1
  69. package/dist/node_modules/@shikijs/primitive/dist/index.js +538 -0
  70. package/dist/node_modules/@shikijs/themes/dist/horizon-bright.js +1 -1
  71. package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
  72. package/dist/node_modules/shiki/dist/bundle-full.js +6 -5
  73. package/dist/node_modules/shiki/dist/chunk-CtajNgzt.js +15 -0
  74. package/dist/node_modules/shiki/dist/engine-oniguruma.js +5 -0
  75. package/dist/node_modules/shiki/dist/{langs.js → langs-bundle-full-DfKZStlK.js} +1 -1
  76. package/dist/node_modules/shiki/dist/themes.js +1 -1
  77. package/dist/pages/DashboardPage.js +54 -79
  78. package/dist/pages/DebugWorkflowDetailsPage.js +41 -55
  79. package/dist/pages/DebugWorkflowsPage.js +151 -112
  80. package/dist/pages/EmbedWorkbenchPage.js +2 -1
  81. package/dist/pages/PreviewWorkbenchPage.js +77 -59
  82. package/dist/pages/RunsListPage.js +27 -41
  83. package/dist/pages/RunsPage.js +21 -36
  84. package/dist/pages/WorkbenchPage.js +48 -70
  85. package/dist/pages/WorkflowDebugPage.js +65 -79
  86. package/dist/pages/WorkspacePage.js +59 -86
  87. package/dist/pages/WorkspaceRunsPage.js +59 -54
  88. package/dist/pages/WorkspacesPage.js +11 -27
  89. package/dist/providers/StudioPreferencesProvider.js +54 -0
  90. package/package.json +29 -29
  91. package/dist/features/workbench/components/WorkbenchFilesPanel.js +0 -67
  92. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +0 -57
  93. package/dist/features/workbench/components/WorkbenchFlowPanel.js +0 -47
  94. package/dist/features/workbench/components/WorkbenchSecretsPanel.js +0 -182
  95. package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +0 -160
  96. /package/dist/{node_modules → frontend/studio/node_modules}/@dagrejs/dagre/dist/dagre.esm.js +0 -0
@@ -2,32 +2,32 @@ import { Button } from "../../../components/ui/button.js";
2
2
  import { Input } from "../../../components/ui/input.js";
3
3
  import { Label } from "../../../components/ui/label.js";
4
4
  import CompletionMessagePaper_default from "../../../components/messages/CompletionMessagePaper.js";
5
- import { useRunWorkflow } from "../../../hooks/useProcessor.js";
6
- import { useUpsertSecret } from "../../../hooks/useSecrets.js";
7
5
  import { useWorkbenchLayout } from "../../workbench/providers/WorkbenchLayoutProvider.js";
6
+ import { useRunWorkflow } from "../../../hooks/useProcessor.js";
8
7
  import "../../workbench/index.js";
8
+ import { useUpsertSecret } from "../../../hooks/useSecrets.js";
9
9
  import React, { useState } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import { Info, KeyRound, Loader2 } from "lucide-react";
12
12
  var SecretInputRenderer_default = ({ parentWorkflow: p, workflow: m, document: h, isActive: g }) => {
13
- let _ = h.content.variables ?? [], v = (h.ui?.widgets)?.[0]?.options, y = v?.transition, b = v?.label ?? "Save & Continue", { workflow: x } = useWorkbenchLayout(), S = x?.workspaceId, C = useRunWorkflow(), w = useUpsertSecret(), T = m.availableTransitions?.map((e) => e.id) ?? [], [E, D] = useState(() => {
13
+ let _ = h.content.variables ?? [], v = (h.ui?.widgets)?.[0]?.options, y = v?.transition, b = v?.label ?? "Save & Continue", { workspaceId: x } = useWorkbenchLayout(), S = useRunWorkflow(), C = useUpsertSecret(), w = m.availableTransitions?.map((e) => e.id) ?? [], [T, E] = useState(() => {
14
14
  let e = {};
15
15
  for (let d of _) e[d.key] = d.value ?? "";
16
16
  return e;
17
- }), [O, k] = useState(!1), A = !!y && T.includes(y), j = !g || !A, M = async () => {
18
- if (!(!S || !y)) {
19
- k(!0);
17
+ }), [D, O] = useState(!1), k = !!y && w.includes(y), A = !g || !k, j = async () => {
18
+ if (!(!x || !y)) {
19
+ O(!0);
20
20
  try {
21
21
  let e = [];
22
22
  for (let d of _) {
23
- let f = E[d.key]?.trim();
24
- !d.key.trim() || !f || (await w.mutateAsync({
25
- workspaceId: S,
23
+ let f = T[d.key]?.trim();
24
+ !d.key.trim() || !f || (await C.mutateAsync({
25
+ workspaceId: x,
26
26
  key: d.key,
27
27
  value: f
28
28
  }), e.push(d.key));
29
29
  }
30
- C.mutate({
30
+ S.mutate({
31
31
  workflowId: p.id,
32
32
  runWorkflowPayloadDto: { transition: {
33
33
  id: y,
@@ -36,7 +36,7 @@ var SecretInputRenderer_default = ({ parentWorkflow: p, workflow: m, document: h
36
36
  } }
37
37
  });
38
38
  } finally {
39
- k(!1);
39
+ O(!1);
40
40
  }
41
41
  }
42
42
  };
@@ -59,12 +59,12 @@ var SecretInputRenderer_default = ({ parentWorkflow: p, workflow: m, document: h
59
59
  }), /* @__PURE__ */ jsx(Input, {
60
60
  type: "password",
61
61
  placeholder: "Enter value...",
62
- value: E[e.key] ?? "",
63
- onChange: (d) => D((f) => ({
62
+ value: T[e.key] ?? "",
63
+ onChange: (d) => E((f) => ({
64
64
  ...f,
65
65
  [e.key]: d.target.value
66
66
  })),
67
- disabled: j
67
+ disabled: A
68
68
  })]
69
69
  }, e.key)),
70
70
  /* @__PURE__ */ jsxs("div", {
@@ -74,10 +74,10 @@ var SecretInputRenderer_default = ({ parentWorkflow: p, workflow: m, document: h
74
74
  /* @__PURE__ */ jsx("div", {
75
75
  className: "flex justify-end",
76
76
  children: /* @__PURE__ */ jsxs(Button, {
77
- onClick: () => void M(),
78
- disabled: j || O,
77
+ onClick: () => void j(),
78
+ disabled: A || D,
79
79
  className: "w-48",
80
- children: [O ? /* @__PURE__ */ jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(KeyRound, { className: "mr-2 h-4 w-4" }), b]
80
+ children: [D ? /* @__PURE__ */ jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(KeyRound, { className: "mr-2 h-4 w-4" }), b]
81
81
  })
82
82
  })
83
83
  ]
@@ -0,0 +1,14 @@
1
+ import { WorkbenchSecretsPanel } from "./components/WorkbenchSecretsPanel.js";
2
+ import SecretInputRenderer_default from "./renderers/SecretInputRenderer.js";
3
+ import { KeyRound } from "lucide-react";
4
+ const secretsFeature = {
5
+ id: "secrets",
6
+ documentRenderers: { "secret-input": SecretInputRenderer_default },
7
+ sidebarPanel: {
8
+ id: "secrets",
9
+ label: "Environment Secrets",
10
+ icon: KeyRound,
11
+ component: WorkbenchSecretsPanel
12
+ }
13
+ };
14
+ export { secretsFeature };
@@ -1,107 +1,57 @@
1
1
  import { useWorkspace } from "../../hooks/useWorkspaces.js";
2
2
  import PageBreadcrumbs_default from "../../components/page/PageBreadcrumbs.js";
3
+ import { WorkbenchLayoutProvider } from "./providers/WorkbenchLayoutProvider.js";
4
+ import { WorkbenchSidebarShell } from "./components/WorkbenchSidebarShell.js";
3
5
  import WorkflowList_default from "./WorkflowList.js";
4
- import { RemoteFileExplorerProvider } from "./providers/RemoteFileExplorerProvider.js";
5
- import { WorkbenchLayoutProvider, useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
6
- import { WorkbenchFilesPanel } from "./components/WorkbenchFilesPanel.js";
7
- import { WorkbenchFloatingPanel } from "./components/WorkbenchFloatingPanel.js";
8
- import { WorkbenchFlowPanel } from "./components/WorkbenchFlowPanel.js";
9
- import { WorkbenchIconSidebar } from "./components/WorkbenchIconSidebar.js";
10
- import { WorkbenchPreviewPanel } from "./components/WorkbenchPreviewPanel.js";
11
6
  import { ScrollProvider } from "./providers/ScrollProvider.js";
12
7
  import { c } from "react/compiler-runtime";
13
8
  import { jsx, jsxs } from "react/jsx-runtime";
14
- function WorkbenchContent(t) {
15
- let a = c(7), { workflow: o, breadcrumbData: s } = t, l;
16
- a[0] === s ? l = a[1] : (l = /* @__PURE__ */ jsx("div", {
9
+ function WorkbenchContent(e) {
10
+ let i = c(7), { workflow: a, breadcrumbData: u } = e, d;
11
+ i[0] === u ? d = i[1] : (d = /* @__PURE__ */ jsx("div", {
17
12
  className: "border-b flex h-12 shrink-0 items-center",
18
- children: s ? /* @__PURE__ */ jsx(PageBreadcrumbs_default, { breadcrumbData: s }) : /* @__PURE__ */ jsx("span", {
13
+ children: u ? /* @__PURE__ */ jsx(PageBreadcrumbs_default, { breadcrumbData: u }) : /* @__PURE__ */ jsx("span", {
19
14
  className: "px-3 text-sm font-medium",
20
15
  children: "Workflows"
21
16
  })
22
- }), a[0] = s, a[1] = l);
23
- let u;
24
- a[2] === o ? u = a[3] : (u = /* @__PURE__ */ jsx(ScrollProvider, { children: /* @__PURE__ */ jsx("div", {
17
+ }), i[0] = u, i[1] = d);
18
+ let f;
19
+ i[2] === a ? f = i[3] : (f = /* @__PURE__ */ jsx(ScrollProvider, { children: /* @__PURE__ */ jsx("div", {
25
20
  className: "flex-1 overflow-auto",
26
- children: /* @__PURE__ */ jsx(WorkflowList_default, { workflow: o })
27
- }) }), a[2] = o, a[3] = u);
28
- let d;
29
- return a[4] !== l || a[5] !== u ? (d = /* @__PURE__ */ jsx("div", {
21
+ children: /* @__PURE__ */ jsx(WorkflowList_default, { workflow: a })
22
+ }) }), i[2] = a, i[3] = f);
23
+ let p;
24
+ return i[4] !== d || i[5] !== f ? (p = /* @__PURE__ */ jsx("div", {
30
25
  className: "flex h-full flex-col",
31
26
  children: /* @__PURE__ */ jsx("div", {
32
27
  className: "flex flex-1 gap-4 overflow-hidden md:flex-row flex-col",
33
28
  children: /* @__PURE__ */ jsxs("div", {
34
29
  className: "flex flex-1 flex-col overflow-hidden",
35
- children: [l, u]
30
+ children: [d, f]
36
31
  })
37
32
  })
38
- }), a[4] = l, a[5] = u, a[6] = d) : d = a[6], d;
39
- }
40
- function WorkbenchInner(t) {
41
- let r = c(21), { workflow: i, breadcrumbData: a } = t, { activeSidePanel: o } = useWorkbenchLayout(), m = o ? "w-1/2 overflow-hidden" : "w-full overflow-hidden", _;
42
- r[0] !== a || r[1] !== i ? (_ = /* @__PURE__ */ jsx(WorkbenchContent, {
43
- workflow: i,
44
- breadcrumbData: a
45
- }), r[0] = a, r[1] = i, r[2] = _) : _ = r[2];
46
- let v;
47
- r[3] !== m || r[4] !== _ ? (v = /* @__PURE__ */ jsx("div", {
48
- className: m,
49
- children: _
50
- }), r[3] = m, r[4] = _, r[5] = v) : v = r[5];
51
- let y;
52
- r[6] === o ? y = r[7] : (y = o === "preview" && /* @__PURE__ */ jsx(WorkbenchPreviewPanel, {}), r[6] = o, r[7] = y);
53
- let b;
54
- r[8] === o ? b = r[9] : (b = o === "flow" && /* @__PURE__ */ jsx(WorkbenchFlowPanel, {}), r[8] = o, r[9] = b);
55
- let x;
56
- r[10] === o ? x = r[11] : (x = o === "files" && /* @__PURE__ */ jsx(WorkbenchFilesPanel, {}), r[10] = o, 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];
59
- let C;
60
- r[13] !== v || r[14] !== y || r[15] !== b || r[16] !== x ? (C = /* @__PURE__ */ jsxs("div", {
61
- className: "relative flex flex-1 overflow-hidden",
62
- children: [
63
- v,
64
- y,
65
- b,
66
- x,
67
- S
68
- ]
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", {
74
- className: "flex h-full w-full",
75
- children: [C, w]
76
- }), r[19] = C, r[20] = T), T;
33
+ }), i[4] = d, i[5] = f, i[6] = p) : p = i[6], p;
77
34
  }
78
35
  function Workbench(r) {
79
- let i = c(20), { workflow: s, breadcrumbData: l, previewPanelOpen: u, onPreviewPanelOpenChange: d, isDeveloperMode: f, getPreviewUrl: p, getEnvironmentPreviewUrl: m, environments: h } = r, g = s?.workspaceId, v = useWorkspace(g), y;
80
- i[0] !== h?.[0]?.slotId || i[1] !== v.data?.features?.fileExplorer?.enabled || i[2] !== v.data?.features?.fileExplorer?.environments ? (y = v.data?.features?.fileExplorer?.enabled && v.data?.features?.fileExplorer?.environments?.includes(h?.[0]?.slotId ?? ""), i[0] = h?.[0]?.slotId, i[1] = v.data?.features?.fileExplorer?.enabled, i[2] = v.data?.features?.fileExplorer?.environments, i[3] = y) : y = i[3];
81
- let b = y, x;
82
- i[4] === v.data ? x = i[5] : (x = v.data ? {
83
- volumes: v.data.volumes,
84
- features: v.data.features
85
- } : void 0, i[4] = v.data, i[5] = x);
86
- let S = x, C = h ?? v.data?.environments, w;
87
- i[6] !== l || i[7] !== b || i[8] !== s ? (w = b ? /* @__PURE__ */ jsx(RemoteFileExplorerProvider, { children: /* @__PURE__ */ jsx(WorkbenchInner, {
36
+ let o = c(13), { workflow: s, breadcrumbData: l, getPreviewUrl: d, getEnvironmentPreviewUrl: f, environments: p } = r, m = s?.workspaceId, h = useWorkspace(m), g;
37
+ o[0] === h.data ? g = o[1] : (g = h.data ? {
38
+ volumes: h.data.volumes,
39
+ features: h.data.features
40
+ } : void 0, o[0] = h.data, o[1] = g);
41
+ let _ = g, v = p ?? h.data?.environments, y;
42
+ o[2] !== l || o[3] !== s ? (y = /* @__PURE__ */ jsx(WorkbenchSidebarShell, { children: /* @__PURE__ */ jsx(WorkbenchContent, {
88
43
  workflow: s,
89
44
  breadcrumbData: l
90
- }) }) : /* @__PURE__ */ jsx(WorkbenchInner, {
91
- workflow: s,
92
- breadcrumbData: l
93
- }), i[6] = l, i[7] = b, i[8] = s, i[9] = w) : w = i[9];
94
- let T;
95
- return i[10] !== m || i[11] !== p || i[12] !== f || i[13] !== d || i[14] !== u || i[15] !== C || i[16] !== w || i[17] !== s || i[18] !== S ? (T = /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
45
+ }) }), o[2] = l, o[3] = s, o[4] = y) : y = o[4];
46
+ let b;
47
+ return o[5] !== f || o[6] !== d || o[7] !== v || o[8] !== y || o[9] !== s || o[10] !== _ || o[11] !== m ? (b = /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
48
+ workspaceId: m,
96
49
  workflow: s,
97
- isDeveloperMode: f,
98
- workspaceConfig: S,
99
- getPreviewUrl: p,
100
- getEnvironmentPreviewUrl: m,
101
- environments: C,
102
- previewPanelOpen: u,
103
- onPreviewPanelOpenChange: d,
104
- children: w
105
- }), i[10] = m, i[11] = p, i[12] = f, i[13] = d, i[14] = u, i[15] = C, i[16] = w, i[17] = s, i[18] = S, i[19] = T) : T = i[19], T;
50
+ workspaceConfig: _,
51
+ getPreviewUrl: d,
52
+ getEnvironmentPreviewUrl: f,
53
+ environments: v,
54
+ children: y
55
+ }), o[5] = f, o[6] = d, o[7] = v, o[8] = y, o[9] = s, o[10] = _, o[11] = m, o[12] = b) : b = o[12], b;
106
56
  }
107
57
  export { Workbench as default };
@@ -1,73 +1,136 @@
1
- import { useWorkflowConfigByName } from "../../hooks/useWorkflows.js";
1
+ import { useChildWorkflows, useWorkflowConfigByName } from "../../hooks/useWorkflows.js";
2
2
  import { Button } from "../../components/ui/button.js";
3
+ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "../../components/ui/dialog.js";
4
+ import { Tooltip, TooltipContent, TooltipTrigger } from "../../components/ui/tooltip.js";
5
+ import { ReactFlowProvider } from "../../node_modules/@xyflow/react/dist/esm/index.js";
6
+ import WorkflowFlowViewer_default from "../debug/components/WorkflowFlowViewer.js";
7
+ import "../debug/index.js";
3
8
  import WorkflowItem_default from "./WorkflowItem.js";
4
9
  import WorkbenchSettingsModal_default from "./components/WorkbenchSettingsModal.js";
10
+ import WorkflowHistoryList_default from "./components/WorkflowHistoryList.js";
5
11
  import WorkflowButtons_default from "./components/buttons/WorkflowButtons.js";
6
12
  import { useWorkflowListState } from "./hooks/useWorkflowListState.js";
7
13
  import { c } from "react/compiler-runtime";
8
14
  import React, { useState } from "react";
9
15
  import { jsx, jsxs } from "react/jsx-runtime";
10
- import { ArrowDownIcon } from "lucide-react";
11
- var WorkflowList_default = (f) => {
12
- let p = c(26), { workflow: m } = f, [h, g] = useState(!1), _;
13
- p[0] === Symbol.for("react.memo_cache_sentinel") ? (_ = {
16
+ import { ArrowDownIcon, ListOrdered, Workflow } from "lucide-react";
17
+ var WorkflowList_default = (C) => {
18
+ let w = c(40), { workflow: T } = C, [E, D] = useState(!1), O;
19
+ w[0] === Symbol.for("react.memo_cache_sentinel") ? (O = {
14
20
  enableDebugMode: !1,
15
21
  showFullMessageHistory: !1
16
- }, p[0] = _) : _ = p[0];
17
- let [v, y] = useState(_), { listRef: b, scrollTo: x, canScrollDown: S, scrollToBottom: C } = useWorkflowListState(), w = useWorkflowConfigByName(m.className ?? void 0), T;
18
- p[1] !== S || p[2] !== C ? (T = S && /* @__PURE__ */ jsx(Button, {
22
+ }, w[0] = O) : O = w[0];
23
+ let [k, A] = useState(O), { listRef: j, scrollTo: M, canScrollDown: N, scrollToBottom: P } = useWorkflowListState(), F = useWorkflowConfigByName(T.className ?? void 0), I = useChildWorkflows(T.id), L;
24
+ w[1] === I.data ? L = w[2] : (L = I.data ?? [], w[1] = I.data, w[2] = L);
25
+ let R = L, z;
26
+ w[3] !== N || w[4] !== P ? (z = N && /* @__PURE__ */ jsx(Button, {
19
27
  variant: "outline",
20
28
  size: "icon",
21
- onClick: C,
29
+ onClick: P,
22
30
  className: "bg-background/80 fixed right-[calc(var(--sidebar-width)+1.5rem)] bottom-6 z-50 rounded-full shadow-md backdrop-blur-sm",
23
31
  children: /* @__PURE__ */ jsx(ArrowDownIcon, { className: "size-4" })
24
- }), p[1] = S, p[2] = C, p[3] = T) : T = p[3];
25
- let E = w.data?.title ?? m.alias, D;
26
- p[4] === E ? D = p[5] : (D = /* @__PURE__ */ jsx("span", {
32
+ }), w[3] = N, w[4] = P, w[5] = z) : z = w[5];
33
+ let B = F.data?.title ?? T.alias, V;
34
+ w[6] === B ? V = w[7] : (V = /* @__PURE__ */ jsx("span", {
27
35
  className: "flex-1 truncate text-sm",
28
- children: E
29
- }), p[4] = E, p[5] = D);
30
- let O;
31
- p[6] === m ? O = p[7] : (O = /* @__PURE__ */ jsx(WorkflowButtons_default, {
32
- workflow: m,
33
- workflowId: m.id
34
- }), p[6] = m, p[7] = O);
35
- let k;
36
- p[8] !== h || p[9] !== v ? (k = /* @__PURE__ */ jsx(WorkbenchSettingsModal_default, {
37
- settings: v,
38
- onSettingsChange: y,
39
- open: h,
40
- onOpenChange: g
41
- }), p[8] = h, p[9] = v, p[10] = k) : k = p[10];
42
- let A;
43
- p[11] !== D || p[12] !== O || p[13] !== k ? (A = /* @__PURE__ */ jsx("div", {
36
+ children: B
37
+ }), w[6] = B, w[7] = V);
38
+ let H;
39
+ w[8] === T ? H = w[9] : (H = /* @__PURE__ */ jsx(WorkflowButtons_default, {
40
+ workflow: T,
41
+ workflowId: T.id
42
+ }), w[8] = T, w[9] = H);
43
+ let U;
44
+ w[10] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
45
+ asChild: !0,
46
+ children: /* @__PURE__ */ jsx(DialogTrigger, {
47
+ asChild: !0,
48
+ children: /* @__PURE__ */ jsx(Button, {
49
+ variant: "ghost",
50
+ size: "icon",
51
+ className: "text-gray-500 hover:cursor-pointer hover:text-gray-700",
52
+ children: /* @__PURE__ */ jsx(ListOrdered, { className: "h-5 w-5" })
53
+ })
54
+ })
55
+ }), /* @__PURE__ */ jsx(TooltipContent, { children: "Run Log" })] }), w[10] = U) : U = w[10];
56
+ let W;
57
+ w[11] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Run Log" }) }), w[11] = W) : W = w[11];
58
+ let G;
59
+ w[12] === T ? G = w[13] : (G = /* @__PURE__ */ jsxs(Dialog, { children: [U, /* @__PURE__ */ jsxs(DialogContent, {
60
+ className: "sm:max-w-lg max-h-[80vh] overflow-hidden flex flex-col",
61
+ children: [W, /* @__PURE__ */ jsx("div", {
62
+ className: "flex-1 overflow-auto",
63
+ children: /* @__PURE__ */ jsx(WorkflowHistoryList_default, { workflow: T })
64
+ })]
65
+ })] }), w[12] = T, w[13] = G);
66
+ let K;
67
+ w[14] === Symbol.for("react.memo_cache_sentinel") ? (K = /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
68
+ asChild: !0,
69
+ children: /* @__PURE__ */ jsx(DialogTrigger, {
70
+ asChild: !0,
71
+ children: /* @__PURE__ */ jsx(Button, {
72
+ variant: "ghost",
73
+ size: "icon",
74
+ className: "text-gray-500 hover:cursor-pointer hover:text-gray-700",
75
+ children: /* @__PURE__ */ jsx(Workflow, { className: "h-5 w-5" })
76
+ })
77
+ })
78
+ }), /* @__PURE__ */ jsx(TooltipContent, { children: "Graph" })] }), w[14] = K) : K = w[14];
79
+ let q;
80
+ w[15] === Symbol.for("react.memo_cache_sentinel") ? (q = /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Graph" }) }), w[15] = q) : q = w[15];
81
+ let J;
82
+ w[16] !== R || w[17] !== F.data || w[18] !== T.id ? (J = /* @__PURE__ */ jsxs(Dialog, { children: [K, /* @__PURE__ */ jsxs(DialogContent, {
83
+ className: "sm:max-w-4xl h-[70vh] overflow-hidden flex flex-col",
84
+ children: [q, /* @__PURE__ */ jsx("div", {
85
+ className: "flex-1 overflow-hidden",
86
+ children: R.length > 0 ? /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(WorkflowFlowViewer_default, {
87
+ workflowId: T.id,
88
+ workflows: R,
89
+ workflowConfig: F.data
90
+ }) }) : /* @__PURE__ */ jsx("div", {
91
+ className: "text-muted-foreground flex h-full items-center justify-center text-sm",
92
+ children: "No workflows found"
93
+ })
94
+ })]
95
+ })] }), w[16] = R, w[17] = F.data, w[18] = T.id, w[19] = J) : J = w[19];
96
+ let Y;
97
+ w[20] !== E || w[21] !== k ? (Y = /* @__PURE__ */ jsx(WorkbenchSettingsModal_default, {
98
+ settings: k,
99
+ onSettingsChange: A,
100
+ open: E,
101
+ onOpenChange: D
102
+ }), w[20] = E, w[21] = k, w[22] = Y) : Y = w[22];
103
+ let X;
104
+ w[23] !== J || w[24] !== Y || w[25] !== V || w[26] !== H || w[27] !== G ? (X = /* @__PURE__ */ jsx("div", {
44
105
  className: "bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-10 backdrop-blur",
45
106
  children: /* @__PURE__ */ jsxs("div", {
46
107
  className: "flex w-full items-center gap-2 rounded-md p-2 px-3 text-left text-sm font-medium",
47
108
  children: [
48
- D,
49
- O,
50
- k
109
+ V,
110
+ H,
111
+ G,
112
+ J,
113
+ Y
51
114
  ]
52
115
  })
53
- }), p[11] = D, p[12] = O, p[13] = k, p[14] = A) : A = p[14];
54
- let j;
55
- p[15] !== x || p[16] !== v || p[17] !== m ? (j = /* @__PURE__ */ jsx("div", {
116
+ }), w[23] = J, w[24] = Y, w[25] = V, w[26] = H, w[27] = G, w[28] = X) : X = w[28];
117
+ let Z;
118
+ w[29] !== M || w[30] !== k || w[31] !== T ? (Z = /* @__PURE__ */ jsx("div", {
56
119
  className: "max-w-4xl py-1",
57
120
  children: /* @__PURE__ */ jsx(WorkflowItem_default, {
58
- workflow: m,
59
- workflowId: m.id,
60
- scrollTo: x,
61
- settings: v
121
+ workflow: T,
122
+ workflowId: T.id,
123
+ scrollTo: M,
124
+ settings: k
62
125
  })
63
- }), p[15] = x, p[16] = v, p[17] = m, p[18] = j) : j = p[18];
64
- let M;
65
- p[19] !== b || p[20] !== A || p[21] !== j ? (M = /* @__PURE__ */ jsxs("div", {
126
+ }), w[29] = M, w[30] = k, w[31] = T, w[32] = Z) : Z = w[32];
127
+ let Q;
128
+ w[33] !== j || w[34] !== X || w[35] !== Z ? (Q = /* @__PURE__ */ jsxs("div", {
66
129
  className: "mb-10",
67
- ref: b,
68
- children: [A, j]
69
- }), p[19] = b, p[20] = A, p[21] = j, p[22] = M) : M = p[22];
70
- let N;
71
- return p[23] !== T || p[24] !== M ? (N = /* @__PURE__ */ jsxs("div", { children: [T, M] }), p[23] = T, p[24] = M, p[25] = N) : N = p[25], N;
130
+ ref: j,
131
+ children: [X, Z]
132
+ }), w[33] = j, w[34] = X, w[35] = Z, w[36] = Q) : Q = w[36];
133
+ let $;
134
+ return w[37] !== Q || w[38] !== z ? ($ = /* @__PURE__ */ jsxs("div", { children: [z, Q] }), w[37] = Q, w[38] = z, w[39] = $) : $ = w[39], $;
72
135
  };
73
136
  export { WorkflowList_default as default };
@@ -0,0 +1,155 @@
1
+ import { Button } from "../../../components/ui/button.js";
2
+ import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/ui/tooltip.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { ChevronLeft, ChevronRight, ExternalLink, X } from "lucide-react";
6
+ var PREV_SIZE = {
7
+ small: null,
8
+ medium: "small",
9
+ large: "medium"
10
+ }, NEXT_SIZE = {
11
+ small: "medium",
12
+ medium: "large",
13
+ large: null
14
+ };
15
+ function SidebarPanel(m) {
16
+ let h = c(55), { icon: g, title: _, description: v, size: y, onSizeChange: b, onClose: x, expandUrl: S, children: C } = m, w = PREV_SIZE[y] !== null, T = NEXT_SIZE[y] !== null, E;
17
+ h[0] === g ? E = h[1] : (E = /* @__PURE__ */ jsx("span", {
18
+ className: "text-muted-foreground",
19
+ children: g
20
+ }), h[0] = g, h[1] = E);
21
+ let D;
22
+ h[2] === _ ? D = h[3] : (D = /* @__PURE__ */ jsx("span", {
23
+ className: "text-sm font-medium",
24
+ children: _
25
+ }), h[2] = _, h[3] = D);
26
+ let O;
27
+ h[4] !== E || h[5] !== D ? (O = /* @__PURE__ */ jsxs("div", {
28
+ className: "flex items-center gap-2",
29
+ children: [E, D]
30
+ }), h[4] = E, h[5] = D, h[6] = O) : O = h[6];
31
+ let k = !T, A;
32
+ h[7] !== T || h[8] !== b || h[9] !== y ? (A = () => T && b(NEXT_SIZE[y]), h[7] = T, h[8] = b, h[9] = y, h[10] = A) : A = h[10];
33
+ let j;
34
+ h[11] === Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }), h[11] = j) : j = h[11];
35
+ let M;
36
+ h[12] !== k || h[13] !== A ? (M = /* @__PURE__ */ jsx(TooltipTrigger, {
37
+ asChild: !0,
38
+ children: /* @__PURE__ */ jsx(Button, {
39
+ variant: "ghost",
40
+ size: "icon",
41
+ className: "h-7 w-7",
42
+ disabled: k,
43
+ onClick: A,
44
+ children: j
45
+ })
46
+ }), h[12] = k, h[13] = A, h[14] = M) : M = h[14];
47
+ let N;
48
+ h[15] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ jsx(TooltipContent, {
49
+ side: "bottom",
50
+ children: "Expand"
51
+ }), h[15] = N) : N = h[15];
52
+ let P;
53
+ h[16] === M ? P = h[17] : (P = /* @__PURE__ */ jsxs(Tooltip, { children: [M, N] }), h[16] = M, h[17] = P);
54
+ let F = !w, I;
55
+ h[18] !== w || h[19] !== b || h[20] !== y ? (I = () => w && b(PREV_SIZE[y]), h[18] = w, h[19] = b, h[20] = y, h[21] = I) : I = h[21];
56
+ let L;
57
+ h[22] === Symbol.for("react.memo_cache_sentinel") ? (L = /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" }), h[22] = L) : L = h[22];
58
+ let R;
59
+ h[23] !== F || h[24] !== I ? (R = /* @__PURE__ */ jsx(TooltipTrigger, {
60
+ asChild: !0,
61
+ children: /* @__PURE__ */ jsx(Button, {
62
+ variant: "ghost",
63
+ size: "icon",
64
+ className: "h-7 w-7",
65
+ disabled: F,
66
+ onClick: I,
67
+ children: L
68
+ })
69
+ }), h[23] = F, h[24] = I, h[25] = R) : R = h[25];
70
+ let z;
71
+ h[26] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ jsx(TooltipContent, {
72
+ side: "bottom",
73
+ children: "Shrink"
74
+ }), h[26] = z) : z = h[26];
75
+ let B;
76
+ h[27] === R ? B = h[28] : (B = /* @__PURE__ */ jsxs(Tooltip, { children: [R, z] }), h[27] = R, h[28] = B);
77
+ let V;
78
+ h[29] === S ? V = h[30] : (V = S && /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
79
+ asChild: !0,
80
+ children: /* @__PURE__ */ jsx(Button, {
81
+ variant: "ghost",
82
+ size: "icon",
83
+ className: "h-7 w-7",
84
+ asChild: !0,
85
+ children: /* @__PURE__ */ jsx("a", {
86
+ href: S,
87
+ target: "_blank",
88
+ rel: "noopener noreferrer",
89
+ children: /* @__PURE__ */ jsx(ExternalLink, { className: "h-4 w-4" })
90
+ })
91
+ })
92
+ }), /* @__PURE__ */ jsx(TooltipContent, {
93
+ side: "bottom",
94
+ children: "Open in new tab"
95
+ })] }), h[29] = S, h[30] = V);
96
+ let H;
97
+ h[31] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }), h[31] = H) : H = h[31];
98
+ let U;
99
+ h[32] === x ? U = h[33] : (U = /* @__PURE__ */ jsx(TooltipTrigger, {
100
+ asChild: !0,
101
+ children: /* @__PURE__ */ jsx(Button, {
102
+ variant: "ghost",
103
+ size: "icon",
104
+ className: "h-7 w-7",
105
+ onClick: x,
106
+ children: H
107
+ })
108
+ }), h[32] = x, h[33] = U);
109
+ let W;
110
+ h[34] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ jsx(TooltipContent, {
111
+ side: "bottom",
112
+ children: "Close"
113
+ }), h[34] = W) : W = h[34];
114
+ let G;
115
+ h[35] === U ? G = h[36] : (G = /* @__PURE__ */ jsxs(Tooltip, { children: [U, W] }), h[35] = U, h[36] = G);
116
+ let K;
117
+ h[37] !== B || h[38] !== V || h[39] !== G || h[40] !== P ? (K = /* @__PURE__ */ jsxs("div", {
118
+ className: "flex items-center",
119
+ children: [
120
+ P,
121
+ B,
122
+ V,
123
+ G
124
+ ]
125
+ }), h[37] = B, h[38] = V, h[39] = G, h[40] = P, h[41] = K) : K = h[41];
126
+ let q;
127
+ h[42] !== K || h[43] !== O ? (q = /* @__PURE__ */ jsxs("div", {
128
+ className: "border-b flex h-12 shrink-0 items-center justify-between px-3",
129
+ children: [O, K]
130
+ }), h[42] = K, h[43] = O, h[44] = q) : q = h[44];
131
+ let J;
132
+ h[45] === v ? J = h[46] : (J = v && /* @__PURE__ */ jsx("div", {
133
+ className: "shrink-0 border-b px-4 py-2",
134
+ children: /* @__PURE__ */ jsx("p", {
135
+ className: "text-muted-foreground text-xs",
136
+ children: v
137
+ })
138
+ }), h[45] = v, h[46] = J);
139
+ let Y;
140
+ h[47] === C ? Y = h[48] : (Y = /* @__PURE__ */ jsx("div", {
141
+ className: "min-h-0 flex-1 overflow-hidden",
142
+ children: C
143
+ }), h[47] = C, h[48] = Y);
144
+ let Z;
145
+ h[49] !== J || h[50] !== Y ? (Z = /* @__PURE__ */ jsxs("div", {
146
+ className: "flex min-h-0 flex-1 flex-col overflow-hidden",
147
+ children: [J, Y]
148
+ }), h[49] = J, h[50] = Y, h[51] = Z) : Z = h[51];
149
+ let Q;
150
+ return h[52] !== q || h[53] !== Z ? (Q = /* @__PURE__ */ jsxs("div", {
151
+ className: "border-l bg-background flex h-full shrink-0 flex-col",
152
+ children: [q, Z]
153
+ }), h[52] = q, h[53] = Z, h[54] = Q) : Q = h[54], Q;
154
+ }
155
+ export { SidebarPanel };