@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
@@ -0,0 +1,80 @@
1
+ import { useFeatureRegistry } from "../../feature-registry/FeatureRegistryProvider.js";
2
+ import "../../feature-registry/index.js";
3
+ import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
4
+ import { WorkbenchEnvironmentPanel } from "./WorkbenchEnvironmentPanel.js";
5
+ import { WorkbenchIconSidebar } from "./WorkbenchIconSidebar.js";
6
+ import { WorkbenchPreviewPanel } from "./WorkbenchPreviewPanel.js";
7
+ import { WorkbenchRunsPanel } from "./WorkbenchRunsPanel.js";
8
+ import { c } from "react/compiler-runtime";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ var PANEL_WIDTH = {
11
+ small: "w-80",
12
+ medium: "w-1/2",
13
+ large: "w-2/3"
14
+ }, CONTENT_WIDTH = {
15
+ small: "w-full",
16
+ medium: "w-1/2",
17
+ large: "w-1/3"
18
+ };
19
+ function ActivePanelContent() {
20
+ let a = c(13), { activePanel: l, workspaceId: u, environments: d } = useWorkbenchLayout(), f = useFeatureRegistry();
21
+ switch (l) {
22
+ case "runs": {
23
+ let e;
24
+ return a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(WorkbenchRunsPanel, {}), a[0] = e) : e = a[0], e;
25
+ }
26
+ case "preview": {
27
+ let e;
28
+ return a[1] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(WorkbenchPreviewPanel, {}), a[1] = e) : e = a[1], e;
29
+ }
30
+ case "environment": {
31
+ let e;
32
+ return a[2] !== d || a[3] !== u ? (e = /* @__PURE__ */ jsx(WorkbenchEnvironmentPanel, {
33
+ workspaceId: u,
34
+ environments: d
35
+ }), a[2] = d, a[3] = u, a[4] = e) : e = a[4], e;
36
+ }
37
+ default: {
38
+ let e;
39
+ if (a[5] !== l || a[6] !== f) {
40
+ let r;
41
+ a[8] === l ? r = a[9] : (r = (e) => e.sidebarPanel?.id === l, a[8] = l, a[9] = r), e = f.find(r), a[5] = l, a[6] = f, a[7] = e;
42
+ } else e = a[7];
43
+ let r = e;
44
+ if (r?.sidebarPanel) {
45
+ let e = r.sidebarPanel.component, i;
46
+ return a[10] !== e || a[11] !== u ? (i = /* @__PURE__ */ jsx(e, { workspaceId: u }), a[10] = e, a[11] = u, a[12] = i) : i = a[12], i;
47
+ }
48
+ return null;
49
+ }
50
+ }
51
+ }
52
+ function SidebarContent(e) {
53
+ let i = c(12), { children: o } = e, { activePanel: s, panelSize: p } = useWorkbenchLayout(), m = `${s ? CONTENT_WIDTH[p] : "w-full"} overflow-hidden`, h;
54
+ i[0] !== o || i[1] !== m ? (h = /* @__PURE__ */ jsx("div", {
55
+ className: m,
56
+ children: o
57
+ }), i[0] = o, i[1] = m, i[2] = h) : h = i[2];
58
+ let g;
59
+ i[3] !== s || i[4] !== p ? (g = s && /* @__PURE__ */ jsx("div", {
60
+ className: `${PANEL_WIDTH[p]} shrink-0 overflow-hidden`,
61
+ children: /* @__PURE__ */ jsx(ActivePanelContent, {})
62
+ }), i[3] = s, i[4] = p, i[5] = g) : g = i[5];
63
+ let _;
64
+ i[6] !== h || i[7] !== g ? (_ = /* @__PURE__ */ jsxs("div", {
65
+ className: "flex flex-1 overflow-hidden",
66
+ children: [h, g]
67
+ }), i[6] = h, i[7] = g, i[8] = _) : _ = i[8];
68
+ let v;
69
+ i[9] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ jsx(WorkbenchIconSidebar, {}), i[9] = v) : v = i[9];
70
+ let y;
71
+ return i[10] === _ ? y = i[11] : (y = /* @__PURE__ */ jsxs("div", {
72
+ className: "flex h-full w-full",
73
+ children: [_, v]
74
+ }), i[10] = _, i[11] = y), y;
75
+ }
76
+ function WorkbenchSidebarShell(e) {
77
+ let r = c(2), { children: i } = e, a;
78
+ return r[0] === i ? a = r[1] : (a = /* @__PURE__ */ jsx(SidebarContent, { children: i }), r[0] = i, r[1] = a), a;
79
+ }
80
+ export { WorkbenchSidebarShell };
@@ -1,12 +1,12 @@
1
1
  import { useWorkflow } from "../../../hooks/useWorkflows.js";
2
- import { useRunWorkflow } from "../../../hooks/useProcessor.js";
3
2
  import { require_enums } from "../../../packages/contracts/dist/enums/index.js";
3
+ import { useRunWorkflow } from "../../../hooks/useProcessor.js";
4
4
  import { useFilterDocuments } from "../../../hooks/useDocuments.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { useCallback, useMemo } from "react";
7
7
  var import_enums = require_enums();
8
- function useWorkflowData(i) {
9
- let o = c(21), { workflowId: s, showFullMessageHistory: l } = i, u = useWorkflow(s), d = useFilterDocuments(s), f = useRunWorkflow(), p;
8
+ function useWorkflowData(r) {
9
+ let o = c(21), { workflowId: s, showFullMessageHistory: l } = r, u = useWorkflow(s), d = useFilterDocuments(s), f = useRunWorkflow(), p;
10
10
  o[0] !== u.data?.place || o[1] !== l ? (p = (e) => {
11
11
  let r = e.meta, i = e.ui, a = r?.hidden || i?.hidden || !!r?.hideAtPlaces?.includes(u.data?.place ?? "");
12
12
  return !l && e.tags?.includes("internal") && (a = !0), !a;
@@ -1,7 +1,8 @@
1
+ import { useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
2
+ import { WorkbenchSidebarShell } from "./components/WorkbenchSidebarShell.js";
1
3
  import WorkflowItem_default from "./WorkflowItem.js";
4
+ import WorkflowHistoryList_default from "./components/WorkflowHistoryList.js";
2
5
  import WorkflowButtons_default from "./components/buttons/WorkflowButtons.js";
3
6
  import WorkflowList_default from "./WorkflowList.js";
4
- import { useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
5
- import WorkflowHistoryList_default from "./components/WorkflowHistoryList.js";
6
7
  import Workbench from "./Workbench.js";
7
8
  import { NewRunDialog } from "./components/NewRunDialog.js";
@@ -1,79 +1,77 @@
1
+ import { useOptionalStudioPreferences } from "../../../providers/StudioPreferencesProvider.js";
1
2
  import { c } from "react/compiler-runtime";
2
3
  import { createContext, useCallback, useContext, useMemo, useState } from "react";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  var WorkbenchLayoutContext = createContext(null);
5
- function WorkbenchLayoutProvider(a) {
6
- let o = c(44), { children: s, workflow: l, isDeveloperMode: u, workspaceConfig: d, getPreviewUrl: f, getEnvironmentPreviewUrl: p, environments: m, previewPanelOpen: h, onPreviewPanelOpenChange: g } = a, _ = u === void 0 ? !1 : u, [v, y] = useState(null), [b, x] = useState(null), [S, C] = useState("preview"), [w, T] = useState(null), [E, D] = useState(""), O = h !== void 0, k = O ? h ? b ?? "preview" : null : b, A = d?.features?.previewPanel?.enabled ?? !1, j;
7
- o[0] === m ? j = o[1] : (j = m === void 0 || m.some(_temp), o[0] = m, o[1] = j);
8
- let M = A && j, N;
9
- o[2] !== m?.[0]?.slotId || o[3] !== d?.features?.fileExplorer?.enabled || o[4] !== d?.features?.fileExplorer?.environments ? (N = d?.features?.fileExplorer?.enabled && d?.features?.fileExplorer?.environments?.includes(m?.[0]?.slotId ?? ""), o[2] = m?.[0]?.slotId, o[3] = d?.features?.fileExplorer?.enabled, o[4] = d?.features?.fileExplorer?.environments, o[5] = N) : N = o[5];
10
- let P = N, F = k !== null, I;
11
- o[6] !== O || o[7] !== g ? (I = (e) => {
12
- O && g?.(e !== null), x(e);
13
- }, o[6] = O, o[7] = g, o[8] = I) : I = o[8];
6
+ function WorkbenchLayoutProvider(o) {
7
+ let s = c(36), { children: l, workspaceId: u, workflow: d, workspaceConfig: f, getPreviewUrl: p, getEnvironmentPreviewUrl: m, environments: h } = o, g = useOptionalStudioPreferences(), [_, v] = useState(null), y;
8
+ s[0] === Symbol.for("react.memo_cache_sentinel") ? (y = {}, s[0] = y) : y = s[0];
9
+ let [b, x] = useState(y), S = g ? g.preferences.activePanel : _, C = g ? g.preferences.panelSizes : b, [w, T] = useState(null), [E, D] = useState(""), O = f?.features?.previewPanel?.enabled ?? !1, k;
10
+ s[1] === h ? k = s[2] : (k = h === void 0 || h.some(_temp), s[1] = h, s[2] = k);
11
+ let A = O && k, j;
12
+ s[3] === Symbol.for("react.memo_cache_sentinel") ? (j = {
13
+ runs: "medium",
14
+ preview: "medium",
15
+ files: "medium",
16
+ environment: "small"
17
+ }, s[3] = j) : j = s[3];
18
+ let M = j, N = S ? C[S] ?? M[S] ?? "small" : "small", P;
19
+ s[4] === g ? P = s[5] : (P = (t) => {
20
+ g ? g.setPreference("activePanel", t) : v(t);
21
+ }, s[4] = g, s[5] = P);
22
+ let F = P, I;
23
+ s[6] !== S || s[7] !== F ? (I = (t) => {
24
+ F(S === t ? null : t);
25
+ }, s[6] = S, s[7] = F, s[8] = I) : I = s[8];
14
26
  let L = I, R;
15
- o[9] === L ? R = o[10] : (R = (e) => {
16
- y((a) => a === e ? null : e), L(null);
17
- }, o[9] = L, o[10] = R);
27
+ s[9] === F ? R = s[10] : (R = () => {
28
+ F(null);
29
+ }, s[9] = F, s[10] = R);
18
30
  let z = R, B;
19
- o[11] === Symbol.for("react.memo_cache_sentinel") ? (B = () => {
20
- y(null);
21
- }, o[11] = B) : B = o[11];
31
+ s[11] !== S || s[12] !== C || s[13] !== g ? (B = (t) => {
32
+ if (!S) return;
33
+ let a = {
34
+ ...C,
35
+ [S]: t
36
+ };
37
+ g ? g.setPreference("panelSizes", a) : x(a);
38
+ }, s[11] = S, s[12] = C, s[13] = g, s[14] = B) : B = s[14];
22
39
  let V = B, H;
23
- o[12] !== k || o[13] !== L ? (H = (e) => {
24
- let a = k === e ? null : e;
25
- L(a), a && y(null);
26
- }, o[12] = k, o[13] = L, o[14] = H) : H = o[14];
40
+ s[15] === F ? H = s[16] : (H = (t) => {
41
+ D(t), F("preview");
42
+ }, s[15] = F, s[16] = H);
27
43
  let U = H, W;
28
- o[15] === L ? W = o[16] : (W = () => {
29
- L(null);
30
- }, o[15] = L, o[16] = W);
31
- let G = W, K;
32
- o[17] === L ? K = o[18] : (K = (e) => {
33
- D(e), L("preview"), y(null);
34
- }, o[17] = L, o[18] = K);
35
- let q = K, J;
36
- o[19] === U ? J = o[20] : (J = () => {
37
- U("preview");
38
- }, o[19] = U, o[20] = J);
39
- let Y = J, X = P ?? !1, Z;
40
- o[21] !== v || o[22] !== S || o[23] !== w || o[24] !== k || o[25] !== G || o[26] !== m || o[27] !== p || o[28] !== f || o[29] !== _ || o[30] !== q || o[31] !== M || o[32] !== F || o[33] !== E || o[34] !== X || o[35] !== z || o[36] !== Y || o[37] !== U || o[38] !== l || o[39] !== d ? (Z = {
41
- workflow: l,
42
- previewPanelEnabled: M,
43
- fileExplorerEnabled: X,
44
- isDeveloperMode: _,
45
- workspaceConfig: d,
46
- getPreviewUrl: f,
47
- getEnvironmentPreviewUrl: p,
48
- environments: m,
49
- activeFloatingPanel: v,
50
- toggleFloatingPanel: z,
51
- closeFloatingPanel: V,
52
- activeSidePanel: k,
53
- toggleSidePanel: U,
54
- closeSidePanel: G,
44
+ s[17] !== S || s[18] !== w || s[19] !== z || s[20] !== h || s[21] !== m || s[22] !== p || s[23] !== U || s[24] !== N || s[25] !== A || s[26] !== E || s[27] !== V || s[28] !== L || s[29] !== d || s[30] !== f || s[31] !== u ? (W = {
45
+ workspaceId: u,
46
+ workflow: d,
47
+ previewPanelEnabled: A,
48
+ workspaceConfig: f,
49
+ getPreviewUrl: p,
50
+ getEnvironmentPreviewUrl: m,
51
+ environments: h,
52
+ activePanel: S,
53
+ panelSize: N,
54
+ togglePanel: L,
55
+ closePanel: z,
56
+ setPanelSize: V,
55
57
  selectedSlotId: E,
56
58
  setSelectedSlotId: D,
57
- openPreviewWithEnvironment: q,
58
- previewPanelOpen: F,
59
- togglePreviewPanel: Y,
60
- activePreviewTab: S,
61
- setActivePreviewTab: C,
59
+ openPreviewWithEnvironment: U,
62
60
  activeSectionId: w,
63
61
  setActiveSectionId: T
64
- }, o[21] = v, o[22] = S, o[23] = w, o[24] = k, o[25] = G, o[26] = m, o[27] = p, o[28] = f, o[29] = _, o[30] = q, o[31] = M, o[32] = F, o[33] = E, o[34] = X, o[35] = z, o[36] = Y, o[37] = U, o[38] = l, o[39] = d, o[40] = Z) : Z = o[40];
65
- let Q = Z, $;
66
- return o[41] !== s || o[42] !== Q ? ($ = /* @__PURE__ */ jsx(WorkbenchLayoutContext.Provider, {
67
- value: Q,
68
- children: s
69
- }), o[41] = s, o[42] = Q, o[43] = $) : $ = o[43], $;
62
+ }, s[17] = S, s[18] = w, s[19] = z, s[20] = h, s[21] = m, s[22] = p, s[23] = U, s[24] = N, s[25] = A, s[26] = E, s[27] = V, s[28] = L, s[29] = d, s[30] = f, s[31] = u, s[32] = W) : W = s[32];
63
+ let G = W, K;
64
+ return s[33] !== l || s[34] !== G ? (K = /* @__PURE__ */ jsx(WorkbenchLayoutContext.Provider, {
65
+ value: G,
66
+ children: l
67
+ }), s[33] = l, s[34] = G, s[35] = K) : K = s[35], K;
70
68
  }
71
- function _temp(e) {
72
- return !!e.connectionUrl && (!!e.workerId || e.local);
69
+ function _temp(t) {
70
+ return !!t.connectionUrl && (!!t.workerId || t.local);
73
71
  }
74
72
  function useWorkbenchLayout() {
75
- let e = useContext(WorkbenchLayoutContext);
76
- if (!e) throw Error("useWorkbenchLayout must be used within a WorkbenchLayoutProvider");
77
- return e;
73
+ let t = useContext(WorkbenchLayoutContext);
74
+ if (!t) throw Error("useWorkbenchLayout must be used within a WorkbenchLayoutProvider");
75
+ return t;
78
76
  }
79
77
  export { WorkbenchLayoutProvider, useWorkbenchLayout };
@@ -218,7 +218,7 @@ function _temp3(e) {
218
218
  });
219
219
  }
220
220
  function _temp4(e) {
221
- return new Date(e).toLocaleDateString();
221
+ return new Date(e).toLocaleString();
222
222
  }
223
223
  function _temp5(e) {
224
224
  return !e.isFavourite;
@@ -1,63 +1,80 @@
1
1
  import { Button } from "../../../components/ui/button.js";
2
2
  import { Label } from "../../../components/ui/label.js";
3
3
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../../components/ui/select.js";
4
+ import { c } from "react/compiler-runtime";
4
5
  import { useMemo } from "react";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  import { Info, Loader2, Plus } from "lucide-react";
7
- function EnvironmentSlotSelector({ slot: p, environments: m, selectedEnvironmentId: h, onSelect: g, onCreateEnvironment: _, isCreating: v, error: y }) {
8
- let b = useMemo(() => m.filter((e) => p.type ? e.type === p.type : !0), [m, p.type]), x = b.length > 0;
9
- return /* @__PURE__ */ jsxs("div", {
10
- className: "space-y-2",
8
+ function EnvironmentSlotSelector(h) {
9
+ let g = c(25), { slot: _, environments: v, selectedEnvironmentId: y, onSelect: b, onCreateEnvironment: x, isCreating: S, error: C } = h, w;
10
+ if (g[0] !== v || g[1] !== _.type) {
11
+ let e;
12
+ g[3] === _.type ? e = g[4] : (e = (e) => _.type ? e.type === _.type : !0, g[3] = _.type, g[4] = e), w = v.filter(e), g[0] = v, g[1] = _.type, g[2] = w;
13
+ } else w = g[2];
14
+ let T = w, E = T.length > 0, D = _.title ?? _.id, O;
15
+ g[5] === _.optional ? O = g[6] : (O = _.optional && /* @__PURE__ */ jsx("span", {
16
+ className: "text-muted-foreground ml-1 font-normal",
17
+ children: "(optional)"
18
+ }), g[5] = _.optional, g[6] = O);
19
+ let k;
20
+ g[7] !== D || g[8] !== O ? (k = /* @__PURE__ */ jsxs(Label, { children: [D, O] }), g[7] = D, g[8] = O, g[9] = k) : k = g[9];
21
+ let A;
22
+ g[10] !== C || g[11] !== E || g[12] !== S || g[13] !== T || g[14] !== x || g[15] !== b || g[16] !== y || g[17] !== _.optional ? (A = E ? /* @__PURE__ */ jsxs(Select, {
23
+ value: y,
24
+ onValueChange: b,
25
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
26
+ className: "w-full",
27
+ children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select an environment" })
28
+ }), /* @__PURE__ */ jsxs(SelectContent, { children: [_.optional && /* @__PURE__ */ jsx(SelectItem, {
29
+ value: "__none__",
30
+ children: /* @__PURE__ */ jsx("span", {
31
+ className: "text-muted-foreground",
32
+ children: "None"
33
+ })
34
+ }), T.map(_temp)] })]
35
+ }) : /* @__PURE__ */ jsxs("div", {
36
+ className: `flex items-center gap-3 rounded-md border border-dashed bg-background p-3 ${C ? "border-destructive" : ""}`,
11
37
  children: [
12
- /* @__PURE__ */ jsxs(Label, { children: [p.title ?? p.id, p.optional && /* @__PURE__ */ jsx("span", {
13
- className: "text-muted-foreground ml-1 font-normal",
14
- children: "(optional)"
15
- })] }),
16
- x ? /* @__PURE__ */ jsxs(Select, {
17
- value: h,
18
- onValueChange: g,
19
- children: [/* @__PURE__ */ jsx(SelectTrigger, {
20
- className: "w-full",
21
- children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select an environment" })
22
- }), /* @__PURE__ */ jsxs(SelectContent, { children: [p.optional && /* @__PURE__ */ jsx(SelectItem, {
23
- value: "__none__",
24
- children: /* @__PURE__ */ jsx("span", {
25
- className: "text-muted-foreground",
26
- children: "None"
27
- })
28
- }), b.map((e) => /* @__PURE__ */ jsx(SelectItem, {
29
- value: e.id,
30
- children: /* @__PURE__ */ jsxs("span", {
31
- className: "flex items-center gap-2",
32
- children: [e.name, e.local && /* @__PURE__ */ jsx("span", {
33
- className: "bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] font-medium",
34
- children: "Local"
35
- })]
36
- })
37
- }, e.id))] })]
38
- }) : /* @__PURE__ */ jsxs("div", {
39
- className: `flex items-center gap-3 rounded-md border border-dashed bg-background p-3 ${y ? "border-destructive" : ""}`,
40
- children: [
41
- /* @__PURE__ */ jsx(Info, { className: `h-4 w-4 shrink-0 ${y ? "text-destructive" : "text-muted-foreground"}` }),
42
- /* @__PURE__ */ jsx("p", {
43
- className: `text-sm flex-1 ${y ? "text-destructive" : "text-muted-foreground"}`,
44
- children: "No matching environment available."
45
- }),
46
- _ && /* @__PURE__ */ jsxs(Button, {
47
- type: "button",
48
- size: "sm",
49
- variant: "outline",
50
- disabled: v,
51
- onClick: () => _(),
52
- children: [v ? /* @__PURE__ */ jsx(Loader2, { className: "mr-1.5 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx(Plus, { className: "mr-1.5 h-3.5 w-3.5" }), "Create"]
53
- })
54
- ]
38
+ /* @__PURE__ */ jsx(Info, { className: `h-4 w-4 shrink-0 ${C ? "text-destructive" : "text-muted-foreground"}` }),
39
+ /* @__PURE__ */ jsx("p", {
40
+ className: `text-sm flex-1 ${C ? "text-destructive" : "text-muted-foreground"}`,
41
+ children: "No matching environment available."
55
42
  }),
56
- y && /* @__PURE__ */ jsx("p", {
57
- className: "text-sm text-destructive",
58
- children: y
43
+ x && /* @__PURE__ */ jsxs(Button, {
44
+ type: "button",
45
+ size: "sm",
46
+ variant: "outline",
47
+ disabled: S,
48
+ onClick: () => x(),
49
+ children: [S ? /* @__PURE__ */ jsx(Loader2, { className: "mr-1.5 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx(Plus, { className: "mr-1.5 h-3.5 w-3.5" }), "Create"]
59
50
  })
60
51
  ]
61
- });
52
+ }), g[10] = C, g[11] = E, g[12] = S, g[13] = T, g[14] = x, g[15] = b, g[16] = y, g[17] = _.optional, g[18] = A) : A = g[18];
53
+ let j;
54
+ g[19] === C ? j = g[20] : (j = C && /* @__PURE__ */ jsx("p", {
55
+ className: "text-sm text-destructive",
56
+ children: C
57
+ }), g[19] = C, g[20] = j);
58
+ let M;
59
+ return g[21] !== k || g[22] !== A || g[23] !== j ? (M = /* @__PURE__ */ jsxs("div", {
60
+ className: "space-y-2",
61
+ children: [
62
+ k,
63
+ A,
64
+ j
65
+ ]
66
+ }), g[21] = k, g[22] = A, g[23] = j, g[24] = M) : M = g[24], M;
67
+ }
68
+ function _temp(e) {
69
+ return /* @__PURE__ */ jsx(SelectItem, {
70
+ value: e.id,
71
+ children: /* @__PURE__ */ jsxs("span", {
72
+ className: "flex items-center gap-2",
73
+ children: [e.name, e.local && /* @__PURE__ */ jsx("span", {
74
+ className: "bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] font-medium",
75
+ children: "Local"
76
+ })]
77
+ })
78
+ }, e.id);
62
79
  }
63
80
  export { EnvironmentSlotSelector };
@@ -2,9 +2,9 @@ import { useStudio } from "../../../providers/StudioProvider.js";
2
2
  import { useWorkflowConfig } from "../../../hooks/useConfig.js";
3
3
  import { useCreateWorkflow } from "../../../hooks/useWorkflows.js";
4
4
  import ErrorSnackbar_default from "../../../components/feedback/ErrorSnackbar.js";
5
- import { useRunWorkflow } from "../../../hooks/useProcessor.js";
6
5
  import ArgumentsView_default from "./workflow-form/ArgumentsView.js";
7
6
  import SelectionView_default from "./workflow-form/SelectionView.js";
7
+ import { useRunWorkflow } from "../../../hooks/useProcessor.js";
8
8
  import { c } from "react/compiler-runtime";
9
9
  import { useEffect, useMemo, useState } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -79,7 +79,7 @@ var WorkspaceHomePage_default = (p) => {
79
79
  }), m[28] = k, m[29] = P, m[30] = B, m[31] = V) : V = m[31];
80
80
  let H;
81
81
  return m[32] !== V || m[33] !== F || m[34] !== I || m[35] !== L || m[36] !== R || m[37] !== z ? (H = /* @__PURE__ */ jsxs("div", {
82
- className: "mx-auto flex min-h-[60vh] max-w-2xl flex-col items-center justify-center",
82
+ className: "mx-auto flex min-h-[80vh] max-w-2xl flex-col items-center justify-center",
83
83
  children: [
84
84
  F,
85
85
  I,
@@ -0,0 +1,13 @@
1
+ import { useCallback } from "react";
2
+ function useDefaultEnvironmentPreviewUrl() {
3
+ return _temp;
4
+ }
5
+ function _temp(e, t) {
6
+ if (!e.connectionUrl) return "";
7
+ let n = new URLSearchParams({
8
+ url: e.connectionUrl,
9
+ name: e.envName || e.workerId || ""
10
+ });
11
+ return t ? `/embed/env/preview/workflows/${t}?${n}` : `/embed/env/preview?${n}`;
12
+ }
13
+ export { useDefaultEnvironmentPreviewUrl };
@@ -0,0 +1,8 @@
1
+ import { useApiClient } from "./useApi.js";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useMutation } from "@tanstack/react-query";
4
+ function useResetEnvironment() {
5
+ let r = c(2), { api: i } = useApiClient(), a;
6
+ return r[0] === i ? a = r[1] : (a = { mutationFn: (e) => i.environments.resetEnvironment(e) }, r[0] = i, r[1] = a), useMutation(a);
7
+ }
8
+ export { useResetEnvironment };
@@ -15,46 +15,48 @@ function useWorkflow(e) {
15
15
  }, i[6] = s, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
16
16
  }
17
17
  function useFilterWorkflows(e, r, i, a, s, u) {
18
- let d = c(30), f = i === void 0 ? "id" : i, p = a === void 0 ? "DESC" : a, m = s === void 0 ? 0 : s, h = u === void 0 ? 10 : u, { envKey: g, api: _ } = useApiClient(), v = Object.keys(r).length > 0, y;
19
- d[0] !== r || d[1] !== v ? (y = v ? JSON.stringify(r) : void 0, d[0] = r, d[1] = v, d[2] = y) : y = d[2];
20
- let b = y, x;
21
- d[3] === b ? x = d[4] : (x = b && { filter: b }, d[3] = b, d[4] = x);
22
- let S;
23
- d[5] !== p || d[6] !== f ? (S = JSON.stringify([{
18
+ let d = c(32), f = i === void 0 ? "id" : i, p = a === void 0 ? "DESC" : a, m = s === void 0 ? 0 : s, h = u === void 0 ? 10 : u, { envKey: g, api: _ } = useApiClient(), v;
19
+ d[0] === r ? v = d[1] : (v = Object.keys(r), d[0] = r, d[1] = v);
20
+ let y = v.length > 0, b;
21
+ d[2] !== r || d[3] !== y ? (b = y ? JSON.stringify(r) : void 0, d[2] = r, d[3] = y, d[4] = b) : b = d[4];
22
+ let x = b, S;
23
+ d[5] === x ? S = d[6] : (S = x && { filter: x }, d[5] = x, d[6] = S);
24
+ let C;
25
+ d[7] !== p || d[8] !== f ? (C = JSON.stringify([{
24
26
  field: f,
25
27
  order: p
26
- }]), d[5] = p, d[6] = f, d[7] = S) : S = d[7];
27
- let C;
28
- d[8] === e ? C = d[9] : (C = e && {
28
+ }]), d[7] = p, d[8] = f, d[9] = C) : C = d[9];
29
+ let w;
30
+ d[10] === e ? w = d[11] : (w = e && {
29
31
  search: e,
30
32
  searchColumns: JSON.stringify(["title", "model"])
31
- }, d[8] = e, d[9] = C);
32
- let w;
33
- d[10] !== h || d[11] !== m || d[12] !== x || d[13] !== S || d[14] !== C ? (w = {
34
- ...x,
35
- sortBy: S,
33
+ }, d[10] = e, d[11] = w);
34
+ let T;
35
+ d[12] !== h || d[13] !== m || d[14] !== S || d[15] !== C || d[16] !== w ? (T = {
36
+ ...S,
37
+ sortBy: C,
36
38
  page: m,
37
39
  limit: h,
38
- ...C
39
- }, d[10] = h, d[11] = m, d[12] = x, d[13] = S, d[14] = C, d[15] = w) : w = d[15];
40
- let T = w, E;
41
- d[16] !== g || d[17] !== b || d[18] !== h || d[19] !== p || d[20] !== m || d[21] !== e || d[22] !== f ? (E = [
40
+ ...w
41
+ }, d[12] = h, d[13] = m, d[14] = S, d[15] = C, d[16] = w, d[17] = T) : T = d[17];
42
+ let E = T, D;
43
+ d[18] !== g || d[19] !== x || d[20] !== h || d[21] !== p || d[22] !== m || d[23] !== e || d[24] !== f ? (D = [
42
44
  ...getWorkflowsCacheKey(g),
43
45
  "list",
44
46
  e ?? "",
45
- b ?? "",
47
+ x ?? "",
46
48
  f,
47
49
  p,
48
50
  m,
49
51
  h
50
- ], d[16] = g, d[17] = b, d[18] = h, d[19] = p, d[20] = m, d[21] = e, d[22] = f, d[23] = E) : E = d[23];
51
- let D;
52
- d[24] !== _ || d[25] !== T ? (D = () => _.workflows.getAll(T), d[24] = _, d[25] = T, d[26] = D) : D = d[26];
52
+ ], d[18] = g, d[19] = x, d[20] = h, d[21] = p, d[22] = m, d[23] = e, d[24] = f, d[25] = D) : D = d[25];
53
53
  let O;
54
- return d[27] !== D || d[28] !== E ? (O = {
55
- queryKey: E,
56
- queryFn: D
57
- }, d[27] = D, d[28] = E, d[29] = O) : O = d[29], useQuery(O);
54
+ d[26] !== _ || d[27] !== E ? (O = () => _.workflows.getAll(E), d[26] = _, d[27] = E, d[28] = O) : O = d[28];
55
+ let k;
56
+ return d[29] !== D || d[30] !== O ? (k = {
57
+ queryKey: D,
58
+ queryFn: O
59
+ }, d[29] = D, d[30] = O, d[31] = k) : k = d[31], useQuery(k);
58
60
  }
59
61
  function useCreateWorkflow() {
60
62
  let e = c(8), { envKey: r, api: i } = useApiClient(), a = useQueryClient(), l;
@@ -15,46 +15,48 @@ function useWorkspace(t) {
15
15
  }, i[6] = l, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
16
16
  }
17
17
  function useFilterWorkspaces(e, i, o, s, l, u) {
18
- let d = c(30), f = o === void 0 ? "id" : o, p = s === void 0 ? "DESC" : s, m = l === void 0 ? 0 : l, h = u === void 0 ? 10 : u, { envKey: g, api: _ } = useApiClient(), v = Object.keys(i).length > 0, y;
19
- d[0] !== i || d[1] !== v ? (y = v ? JSON.stringify(i) : void 0, d[0] = i, d[1] = v, d[2] = y) : y = d[2];
20
- let b = y, x;
21
- d[3] === b ? x = d[4] : (x = b && { filter: b }, d[3] = b, d[4] = x);
22
- let S;
23
- d[5] !== p || d[6] !== f ? (S = JSON.stringify([{
18
+ let d = c(32), f = o === void 0 ? "id" : o, p = s === void 0 ? "DESC" : s, m = l === void 0 ? 0 : l, h = u === void 0 ? 10 : u, { envKey: g, api: _ } = useApiClient(), v;
19
+ d[0] === i ? v = d[1] : (v = Object.keys(i), d[0] = i, d[1] = v);
20
+ let y = v.length > 0, b;
21
+ d[2] !== i || d[3] !== y ? (b = y ? JSON.stringify(i) : void 0, d[2] = i, d[3] = y, d[4] = b) : b = d[4];
22
+ let x = b, S;
23
+ d[5] === x ? S = d[6] : (S = x && { filter: x }, d[5] = x, d[6] = S);
24
+ let C;
25
+ d[7] !== p || d[8] !== f ? (C = JSON.stringify([{
24
26
  field: f,
25
27
  order: p
26
- }]), d[5] = p, d[6] = f, d[7] = S) : S = d[7];
27
- let C;
28
- d[8] === e ? C = d[9] : (C = e && {
28
+ }]), d[7] = p, d[8] = f, d[9] = C) : C = d[9];
29
+ let w;
30
+ d[10] === e ? w = d[11] : (w = e && {
29
31
  search: e,
30
32
  searchColumns: JSON.stringify(["title"])
31
- }, d[8] = e, d[9] = C);
32
- let w;
33
- d[10] !== h || d[11] !== m || d[12] !== x || d[13] !== S || d[14] !== C ? (w = {
34
- ...x,
35
- sortBy: S,
33
+ }, d[10] = e, d[11] = w);
34
+ let T;
35
+ d[12] !== h || d[13] !== m || d[14] !== S || d[15] !== C || d[16] !== w ? (T = {
36
+ ...S,
37
+ sortBy: C,
36
38
  page: m,
37
39
  limit: h,
38
- ...C
39
- }, d[10] = h, d[11] = m, d[12] = x, d[13] = S, d[14] = C, d[15] = w) : w = d[15];
40
- let T = w, E;
41
- d[16] !== g || d[17] !== b || d[18] !== h || d[19] !== p || d[20] !== m || d[21] !== e || d[22] !== f ? (E = [
40
+ ...w
41
+ }, d[12] = h, d[13] = m, d[14] = S, d[15] = C, d[16] = w, d[17] = T) : T = d[17];
42
+ let E = T, D;
43
+ d[18] !== g || d[19] !== x || d[20] !== h || d[21] !== p || d[22] !== m || d[23] !== e || d[24] !== f ? (D = [
42
44
  ...getWorkspacesCacheKey(g),
43
45
  "list",
44
46
  e ?? "",
45
- b ?? "",
47
+ x ?? "",
46
48
  f,
47
49
  p,
48
50
  m,
49
51
  h
50
- ], d[16] = g, d[17] = b, d[18] = h, d[19] = p, d[20] = m, d[21] = e, d[22] = f, d[23] = E) : E = d[23];
51
- let D;
52
- d[24] !== _ || d[25] !== T ? (D = () => _.workspaces.getAll(T), d[24] = _, d[25] = T, d[26] = D) : D = d[26];
52
+ ], d[18] = g, d[19] = x, d[20] = h, d[21] = p, d[22] = m, d[23] = e, d[24] = f, d[25] = D) : D = d[25];
53
53
  let O;
54
- return d[27] !== D || d[28] !== E ? (O = {
55
- queryKey: E,
56
- queryFn: D
57
- }, d[27] = D, d[28] = E, d[29] = O) : O = d[29], useQuery(O);
54
+ d[26] !== _ || d[27] !== E ? (O = () => _.workspaces.getAll(E), d[26] = _, d[27] = E, d[28] = O) : O = d[28];
55
+ let k;
56
+ return d[29] !== D || d[30] !== O ? (k = {
57
+ queryKey: D,
58
+ queryFn: O
59
+ }, d[29] = D, d[30] = O, d[31] = k) : k = d[31], useQuery(k);
58
60
  }
59
61
  function useCreateWorkspace() {
60
62
  let e = c(8), { envKey: a, api: s } = useApiClient(), l = useQueryClient(), u;