@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
@@ -12,86 +12,72 @@ import { c } from "react/compiler-runtime";
12
12
  import React, { useMemo } from "react";
13
13
  import { jsx, jsxs } from "react/jsx-runtime";
14
14
  import { useParams } from "react-router-dom";
15
- import { Bug, Home, Loader2 } from "lucide-react";
15
+ import { Loader2 } from "lucide-react";
16
16
  var WorkflowDebugPage_default = () => {
17
- let y = c(54), { router: b } = useStudio(), x = useParams(), S;
18
- y[0] === x ? S = y[1] : (S = requireParam(x, "workflowId"), y[0] = x, y[1] = S);
19
- let C = S, w = useWorkflow(C), T = w.data?.workspaceId, E = useWorkspace(T), D = useChildWorkflows(C), O;
20
- y[2] === D.data ? O = y[3] : (O = D.data ?? [], y[2] = D.data, y[3] = O);
21
- let k = O, A = useWorkflowConfigByName(w.data?.className ?? void 0), j;
22
- y[4] === b ? j = y[5] : (j = b.getDashboard(), y[4] = b, y[5] = j);
23
- let M;
24
- y[6] === Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), y[6] = M) : M = y[6];
25
- let N;
26
- y[7] === j ? N = y[8] : (N = {
27
- label: "Dashboard",
28
- href: j,
29
- icon: M
30
- }, y[7] = j, y[8] = N);
31
- let P;
32
- y[9] === b ? P = y[10] : (P = b.getWorkspaces(), y[9] = b, y[10] = P);
33
- let F;
34
- y[11] === P ? F = y[12] : (F = {
17
+ let _ = c(48), { router: v } = useStudio(), y = useParams(), b;
18
+ _[0] === y ? b = _[1] : (b = requireParam(y, "workflowId"), _[0] = y, _[1] = b);
19
+ let x = b, S = useWorkflow(x), C = S.data?.workspaceId, w = useWorkspace(C), T = useChildWorkflows(x), E;
20
+ _[2] === T.data ? E = _[3] : (E = T.data ?? [], _[2] = T.data, _[3] = E);
21
+ let D = E, O = useWorkflowConfigByName(S.data?.className ?? void 0), k;
22
+ _[4] === v ? k = _[5] : (k = v.getWorkspaces(), _[4] = v, _[5] = k);
23
+ let A;
24
+ _[6] === k ? A = _[7] : (A = {
35
25
  label: "Workspaces",
36
- href: P
37
- }, y[11] = P, y[12] = F);
38
- let I = E.data?.title ?? "...", L;
39
- y[13] !== b || y[14] !== T ? (L = T ? b.getWorkspace(T) : void 0, y[13] = b, y[14] = T, y[15] = L) : L = y[15];
26
+ href: k
27
+ }, _[6] = k, _[7] = A);
28
+ let j = w.data?.title ?? "...", M;
29
+ _[8] !== v || _[9] !== C ? (M = C ? v.getWorkspace(C) : void 0, _[8] = v, _[9] = C, _[10] = M) : M = _[10];
30
+ let N;
31
+ _[11] !== j || _[12] !== M ? (N = {
32
+ label: j,
33
+ href: M
34
+ }, _[11] = j, _[12] = M, _[13] = N) : N = _[13];
35
+ let P = `Run #${S.data?.run ?? "..."}`, F;
36
+ _[14] !== v || _[15] !== x ? (F = v.getWorkflow(x), _[14] = v, _[15] = x, _[16] = F) : F = _[16];
37
+ let I;
38
+ _[17] !== P || _[18] !== F ? (I = {
39
+ label: P,
40
+ href: F
41
+ }, _[17] = P, _[18] = F, _[19] = I) : I = _[19];
42
+ let L;
43
+ _[20] === Symbol.for("react.memo_cache_sentinel") ? (L = { label: "Debug Flow" }, _[20] = L) : L = _[20];
40
44
  let R;
41
- y[16] !== I || y[17] !== L ? (R = {
42
- label: I,
43
- href: L
44
- }, y[16] = I, y[17] = L, y[18] = R) : R = y[18];
45
- let z = `Run #${w.data?.run ?? "..."}`, B;
46
- y[19] !== b || y[20] !== C ? (B = b.getWorkflow(C), y[19] = b, y[20] = C, y[21] = B) : B = y[21];
47
- let V;
48
- y[22] !== z || y[23] !== B ? (V = {
49
- label: z,
50
- href: B
51
- }, y[22] = z, y[23] = B, y[24] = V) : V = y[24];
52
- let H;
53
- y[25] === Symbol.for("react.memo_cache_sentinel") ? (H = {
54
- label: "Debug Flow",
55
- icon: /* @__PURE__ */ jsx(Bug, { className: "h-4 w-4" })
56
- }, y[25] = H) : H = y[25];
57
- let U;
58
- y[26] !== V || y[27] !== N || y[28] !== F || y[29] !== R ? (U = [
45
+ _[21] !== A || _[22] !== N || _[23] !== I ? (R = [
46
+ A,
59
47
  N,
60
- F,
61
- R,
62
- V,
63
- H
64
- ], y[26] = V, y[27] = N, y[28] = F, y[29] = R, y[30] = U) : U = y[30];
65
- let W = U;
66
- if (w.isLoading || D.isLoading || E.isLoading) {
48
+ I,
49
+ L
50
+ ], _[21] = A, _[22] = N, _[23] = I, _[24] = R) : R = _[24];
51
+ let z = R;
52
+ if (S.isLoading || T.isLoading || w.isLoading) {
67
53
  let n;
68
- y[31] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ jsx("div", {
54
+ _[25] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ jsx("div", {
69
55
  className: "flex h-[calc(100vh-8rem)] items-center justify-center",
70
56
  children: /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground h-8 w-8 animate-spin" })
71
- }), y[31] = n) : n = y[31];
72
- let v;
73
- return y[32] === W ? v = y[33] : (v = /* @__PURE__ */ jsx(MainLayout_default, {
74
- breadcrumbsData: W,
57
+ }), _[25] = n) : n = _[25];
58
+ let g;
59
+ return _[26] === z ? g = _[27] : (g = /* @__PURE__ */ jsx(MainLayout_default, {
60
+ breadcrumbsData: z,
75
61
  children: n
76
- }), y[32] = W, y[33] = v), v;
62
+ }), _[26] = z, _[27] = g), g;
77
63
  }
64
+ let B;
65
+ _[28] === S.error ? B = _[29] : (B = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: S.error }), _[28] = S.error, _[29] = B);
66
+ let V = S.data?.title ?? S.data?.alias ?? "Workflow", H = S.data?.run, U;
67
+ _[30] !== v || _[31] !== x ? (U = () => void v.navigateToWorkflow(x), _[30] = v, _[31] = x, _[32] = U) : U = _[32];
68
+ let W;
69
+ _[33] !== V || _[34] !== H || _[35] !== U ? (W = /* @__PURE__ */ jsx(WorkflowDebugHeader_default, {
70
+ title: V,
71
+ runNumber: H,
72
+ onBack: U
73
+ }), _[33] = V, _[34] = H, _[35] = U, _[36] = W) : W = _[36];
78
74
  let G;
79
- y[34] === w.error ? G = y[35] : (G = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: w.error }), y[34] = w.error, y[35] = G);
80
- let K = w.data?.title ?? w.data?.alias ?? "Workflow", q = w.data?.run, J;
81
- y[36] !== b || y[37] !== C ? (J = () => void b.navigateToWorkflow(C), y[36] = b, y[37] = C, y[38] = J) : J = y[38];
82
- let Y;
83
- y[39] !== K || y[40] !== q || y[41] !== J ? (Y = /* @__PURE__ */ jsx(WorkflowDebugHeader_default, {
84
- title: K,
85
- runNumber: q,
86
- onBack: J
87
- }), y[39] = K, y[40] = q, y[41] = J, y[42] = Y) : Y = y[42];
88
- let X;
89
- y[43] !== k || y[44] !== A || y[45] !== C ? (X = /* @__PURE__ */ jsx("div", {
75
+ _[37] !== D || _[38] !== O || _[39] !== x ? (G = /* @__PURE__ */ jsx("div", {
90
76
  className: "bg-card border-border flex-1 overflow-hidden rounded-2xl border shadow-sm",
91
- children: k.length > 0 ? /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(WorkflowFlowViewer_default, {
92
- workflowId: C,
93
- workflows: k,
94
- workflowConfig: A.data
77
+ children: D.length > 0 ? /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(WorkflowFlowViewer_default, {
78
+ workflowId: x,
79
+ workflows: D,
80
+ workflowConfig: O.data
95
81
  }) }) : /* @__PURE__ */ jsx("div", {
96
82
  className: "text-muted-foreground flex h-full items-center justify-center",
97
83
  children: /* @__PURE__ */ jsx("p", {
@@ -99,16 +85,16 @@ var WorkflowDebugPage_default = () => {
99
85
  children: "No child workflows found for this workflow"
100
86
  })
101
87
  })
102
- }), y[43] = k, y[44] = A, y[45] = C, y[46] = X) : X = y[46];
103
- let Z;
104
- y[47] !== Y || y[48] !== X ? (Z = /* @__PURE__ */ jsxs("div", {
88
+ }), _[37] = D, _[38] = O, _[39] = x, _[40] = G) : G = _[40];
89
+ let K;
90
+ _[41] !== W || _[42] !== G ? (K = /* @__PURE__ */ jsxs("div", {
105
91
  className: "flex h-[calc(100vh-8rem)] flex-col gap-6",
106
- children: [Y, X]
107
- }), y[47] = Y, y[48] = X, y[49] = Z) : Z = y[49];
108
- let Q;
109
- return y[50] !== W || y[51] !== G || y[52] !== Z ? (Q = /* @__PURE__ */ jsxs(MainLayout_default, {
110
- breadcrumbsData: W,
111
- children: [G, Z]
112
- }), y[50] = W, y[51] = G, y[52] = Z, y[53] = Q) : Q = y[53], Q;
92
+ children: [W, G]
93
+ }), _[41] = W, _[42] = G, _[43] = K) : K = _[43];
94
+ let q;
95
+ return _[44] !== z || _[45] !== B || _[46] !== K ? (q = /* @__PURE__ */ jsxs(MainLayout_default, {
96
+ breadcrumbsData: z,
97
+ children: [B, K]
98
+ }), _[44] = z, _[45] = B, _[46] = K, _[47] = q) : q = _[47], q;
113
99
  };
114
100
  export { WorkflowDebugPage_default as default };
@@ -1,115 +1,88 @@
1
1
  import { useStudio } from "../providers/StudioProvider.js";
2
2
  import { useWorkspaceConfig } from "../hooks/useConfig.js";
3
3
  import { useWorkspace } from "../hooks/useWorkspaces.js";
4
- import { Button } from "../components/ui/button.js";
5
4
  import MainLayout_default from "../components/layout/MainLayout.js";
6
5
  import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
6
+ import { WorkbenchLayoutProvider } from "../features/workbench/providers/WorkbenchLayoutProvider.js";
7
+ import { WorkbenchSidebarShell } from "../features/workbench/components/WorkbenchSidebarShell.js";
7
8
  import WorkspaceHomePage_default from "../features/workspaces/components/WorkspaceHomePage.js";
9
+ import { useDefaultEnvironmentPreviewUrl } from "../hooks/useEnvironmentPreviewUrl.js";
8
10
  import { c } from "react/compiler-runtime";
9
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
- import { Link, useParams } from "react-router-dom";
11
- import { ArrowRight, Home, Loader2 } from "lucide-react";
12
+ import { useParams } from "react-router-dom";
13
+ import { Loader2 } from "lucide-react";
12
14
  var WorkspacePage_default = () => {
13
- let v = c(49), { router: y } = useStudio(), { workspaceId: b } = useParams(), x = useWorkspace(b), S = useWorkspaceConfig(), C = x.data, w;
15
+ let _ = c(40), { router: v } = useStudio(), { workspaceId: y } = useParams(), b = useWorkspace(y), x = useWorkspaceConfig(), S = useDefaultEnvironmentPreviewUrl(), C = b.data, w;
14
16
  bb0: {
15
- if (!C || !S.data) {
17
+ if (!C || !x.data) {
16
18
  w = void 0;
17
19
  break bb0;
18
20
  }
19
21
  let t;
20
- if (v[0] !== S.data || v[1] !== C) {
21
- let g;
22
- v[3] === C ? g = v[4] : (g = (t) => t.className === C.className, v[3] = C, v[4] = g);
23
- let _ = S.data.find(g)?.ui;
24
- t = (_?.widgets ?? _?.actions)?.find(_temp), v[0] = S.data, v[1] = C, v[2] = t;
25
- } else t = v[2];
22
+ if (_[0] !== x.data || _[1] !== C) {
23
+ let h;
24
+ _[3] === C ? h = _[4] : (h = (t) => t.className === C.className, _[3] = C, _[4] = h);
25
+ let g = x.data.find(h)?.ui;
26
+ t = (g?.widgets ?? g?.actions)?.find(_temp), _[0] = x.data, _[1] = C, _[2] = t;
27
+ } else t = _[2];
26
28
  w = t;
27
29
  }
28
30
  let T = w, E;
29
- v[5] === y ? E = v[6] : (E = y.getDashboard(), v[5] = y, v[6] = E);
31
+ _[5] === v ? E = _[6] : (E = v.getWorkspaces(), _[5] = v, _[6] = E);
30
32
  let D;
31
- v[7] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), v[7] = D) : D = v[7];
32
- let O;
33
- v[8] === E ? O = v[9] : (O = {
34
- label: "Dashboard",
35
- href: E,
36
- icon: D
37
- }, v[8] = E, v[9] = O);
38
- let k;
39
- v[10] === y ? k = v[11] : (k = y.getWorkspaces(), v[10] = y, v[11] = k);
40
- let A;
41
- v[12] === k ? A = v[13] : (A = {
33
+ _[7] === E ? D = _[8] : (D = {
42
34
  label: "Workspaces",
43
- href: k
44
- }, v[12] = k, v[13] = A);
45
- let j = C?.title ?? "", M;
46
- v[14] === j ? M = v[15] : (M = {
47
- label: j,
35
+ href: E
36
+ }, _[7] = E, _[8] = D);
37
+ let O = C?.title ?? "", k;
38
+ _[9] === O ? k = _[10] : (k = {
39
+ label: O,
48
40
  current: !0
49
- }, v[14] = j, v[15] = M);
50
- let N;
51
- v[16] !== O || v[17] !== A || v[18] !== M ? (N = [
52
- O,
53
- A,
54
- M
55
- ], v[16] = O, v[17] = A, v[18] = M, v[19] = N) : N = v[19];
56
- let P = N, F = x.isLoading || S.isLoading, I = C?.title ?? "", L;
57
- v[20] === I ? L = v[21] : (L = /* @__PURE__ */ jsx("h1", {
58
- className: "text-3xl font-bold tracking-tight",
59
- children: I
60
- }), v[20] = I, v[21] = L);
41
+ }, _[9] = O, _[10] = k);
42
+ let A;
43
+ _[11] !== D || _[12] !== k ? (A = [D, k], _[11] = D, _[12] = k, _[13] = A) : A = _[13];
44
+ let j = A, M = b.isLoading || x.isLoading, N;
45
+ _[14] === C ? N = _[15] : (N = C ? {
46
+ volumes: C.volumes,
47
+ features: C.features
48
+ } : void 0, _[14] = C, _[15] = N);
49
+ let P = N, F = C?.environments, I;
50
+ _[16] === M ? I = _[17] : (I = M ? /* @__PURE__ */ jsx(Loader2, { className: "h-6 w-6 animate-spin" }) : "", _[16] = M, _[17] = I);
51
+ let L;
52
+ _[18] === b.error ? L = _[19] : (L = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: b.error }), _[18] = b.error, _[19] = L);
61
53
  let R;
62
- v[22] !== y || v[23] !== b ? (R = b && /* @__PURE__ */ jsx(Button, {
63
- variant: "outline",
64
- size: "sm",
65
- asChild: !0,
66
- children: /* @__PURE__ */ jsxs(Link, {
67
- to: y.getWorkspaceRuns(b),
68
- children: ["Runs", /* @__PURE__ */ jsx(ArrowRight, { className: "ml-1 h-4 w-4" })]
69
- })
70
- }), v[22] = y, v[23] = b, v[24] = R) : R = v[24];
54
+ _[20] === x.error ? R = _[21] : (R = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: x.error }), _[20] = x.error, _[21] = R);
71
55
  let z;
72
- v[25] !== L || v[26] !== R ? (z = /* @__PURE__ */ jsxs("div", {
73
- className: "mb-4 flex items-center justify-between",
74
- children: [L, R]
75
- }), v[25] = L, v[26] = R, v[27] = z) : z = v[27];
76
- let B;
77
- v[28] === F ? B = v[29] : (B = F ? /* @__PURE__ */ jsx(Loader2, { className: "h-6 w-6 animate-spin" }) : "", v[28] = F, v[29] = B);
78
- let V;
79
- v[30] === x.error ? V = v[31] : (V = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: x.error }), v[30] = x.error, v[31] = V);
80
- let H;
81
- v[32] === S.error ? H = v[33] : (H = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: S.error }), v[32] = S.error, v[33] = H);
82
- let U;
83
- v[34] !== F || v[35] !== y || v[36] !== T || v[37] !== C || v[38] !== b ? (U = C && T ? /* @__PURE__ */ jsx(WorkspaceHomePage_default, {
56
+ _[22] !== M || _[23] !== T || _[24] !== C ? (z = C && T ? /* @__PURE__ */ jsx(WorkspaceHomePage_default, {
84
57
  workspace: C,
85
58
  action: T
86
- }) : C && !F ? /* @__PURE__ */ jsxs("div", {
59
+ }) : C && !M ? /* @__PURE__ */ jsx("div", {
87
60
  className: "flex flex-col items-center justify-center py-16",
88
- children: [/* @__PURE__ */ jsx("p", {
89
- className: "text-muted-foreground mb-4",
61
+ children: /* @__PURE__ */ jsx("p", {
62
+ className: "text-muted-foreground",
90
63
  children: "No home page configured for this workspace."
91
- }), b && /* @__PURE__ */ jsx(Button, {
92
- variant: "default",
93
- asChild: !0,
94
- children: /* @__PURE__ */ jsxs(Link, {
95
- to: y.getWorkspaceRuns(b),
96
- children: ["Go to Runs", /* @__PURE__ */ jsx(ArrowRight, { className: "ml-1 h-4 w-4" })]
97
- })
98
- })]
99
- }) : null, v[34] = F, v[35] = y, v[36] = T, v[37] = C, v[38] = b, v[39] = U) : U = v[39];
100
- let W;
101
- v[40] !== z || v[41] !== B || v[42] !== V || v[43] !== H || v[44] !== U ? (W = /* @__PURE__ */ jsxs(Fragment, { children: [
102
- z,
103
- B,
104
- V,
105
- H,
106
- U
107
- ] }), v[40] = z, v[41] = B, v[42] = V, v[43] = H, v[44] = U, v[45] = W) : W = v[45];
108
- let G;
109
- return v[46] !== P || v[47] !== W ? (G = /* @__PURE__ */ jsx(MainLayout_default, {
110
- breadcrumbsData: P,
111
- children: W
112
- }), v[46] = P, v[47] = W, v[48] = G) : G = v[48], G;
64
+ })
65
+ }) : null, _[22] = M, _[23] = T, _[24] = C, _[25] = z) : z = _[25];
66
+ let B;
67
+ _[26] !== R || _[27] !== z || _[28] !== I || _[29] !== L ? (B = /* @__PURE__ */ jsxs(Fragment, { children: [
68
+ I,
69
+ L,
70
+ R,
71
+ z
72
+ ] }), _[26] = R, _[27] = z, _[28] = I, _[29] = L, _[30] = B) : B = _[30];
73
+ let V;
74
+ _[31] !== j || _[32] !== B ? (V = /* @__PURE__ */ jsx(WorkbenchSidebarShell, { children: /* @__PURE__ */ jsx(MainLayout_default, {
75
+ breadcrumbsData: j,
76
+ children: B
77
+ }) }), _[31] = j, _[32] = B, _[33] = V) : V = _[33];
78
+ let H;
79
+ return _[34] !== S || _[35] !== V || _[36] !== F || _[37] !== P || _[38] !== y ? (H = /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
80
+ workspaceId: y,
81
+ environments: F,
82
+ workspaceConfig: P,
83
+ getEnvironmentPreviewUrl: S,
84
+ children: V
85
+ }), _[34] = S, _[35] = V, _[36] = F, _[37] = P, _[38] = y, _[39] = H) : H = _[39], H;
113
86
  };
114
87
  function _temp(t) {
115
88
  return t.widget === "start-form";
@@ -2,70 +2,75 @@ import { useStudio } from "../providers/StudioProvider.js";
2
2
  import { useWorkspace } from "../hooks/useWorkspaces.js";
3
3
  import MainLayout_default from "../components/layout/MainLayout.js";
4
4
  import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
5
+ import { WorkbenchLayoutProvider } from "../features/workbench/providers/WorkbenchLayoutProvider.js";
5
6
  import ExecutionTimeline_default from "../features/workspaces/components/ExecutionTimeline.js";
7
+ import { WorkbenchSidebarShell } from "../features/workbench/components/WorkbenchSidebarShell.js";
8
+ import { useDefaultEnvironmentPreviewUrl } from "../hooks/useEnvironmentPreviewUrl.js";
6
9
  import { c } from "react/compiler-runtime";
7
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
11
  import { useParams } from "react-router-dom";
9
- import { Home, Loader2 } from "lucide-react";
12
+ import { Loader2 } from "lucide-react";
10
13
  var WorkspaceRunsPage_default = () => {
11
- let p = c(36), { router: m } = useStudio(), { workspaceId: h } = useParams(), g = useWorkspace(h), _;
12
- p[0] === m ? _ = p[1] : (_ = m.getDashboard(), p[0] = m, p[1] = _);
13
- let v;
14
- p[2] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), p[2] = v) : v = p[2];
15
- let y;
16
- p[3] === _ ? y = p[4] : (y = {
17
- label: "Dashboard",
18
- href: _,
19
- icon: v
20
- }, p[3] = _, p[4] = y);
21
- let b;
22
- p[5] === m ? b = p[6] : (b = m.getWorkspaces(), p[5] = m, p[6] = b);
23
- let x;
24
- p[7] === b ? x = p[8] : (x = {
14
+ let h = c(38), { router: g } = useStudio(), { workspaceId: _ } = useParams(), v = useWorkspace(_), y = useDefaultEnvironmentPreviewUrl(), b = v.data, x;
15
+ h[0] === g ? x = h[1] : (x = g.getWorkspaces(), h[0] = g, h[1] = x);
16
+ let S;
17
+ h[2] === x ? S = h[3] : (S = {
25
18
  label: "Workspaces",
26
- href: b
27
- }, p[7] = b, p[8] = x);
28
- let S = g.data?.title ?? "", C;
29
- p[9] !== m || p[10] !== h ? (C = h ? m.getWorkspace(h) : void 0, p[9] = m, p[10] = h, p[11] = C) : C = p[11];
30
- let w;
31
- p[12] !== S || p[13] !== C ? (w = {
32
- label: S,
33
- href: C
34
- }, p[12] = S, p[13] = C, p[14] = w) : w = p[14];
19
+ href: x
20
+ }, h[2] = x, h[3] = S);
21
+ let C = b?.title ?? "", w;
22
+ h[4] !== g || h[5] !== _ ? (w = _ ? g.getWorkspace(_) : void 0, h[4] = g, h[5] = _, h[6] = w) : w = h[6];
35
23
  let T;
36
- p[15] === Symbol.for("react.memo_cache_sentinel") ? (T = {
24
+ h[7] !== C || h[8] !== w ? (T = {
25
+ label: C,
26
+ href: w
27
+ }, h[7] = C, h[8] = w, h[9] = T) : T = h[9];
28
+ let E;
29
+ h[10] === Symbol.for("react.memo_cache_sentinel") ? (E = {
37
30
  label: "Runs",
38
31
  current: !0
39
- }, p[15] = T) : T = p[15];
40
- let E;
41
- p[16] !== y || p[17] !== x || p[18] !== w ? (E = [
42
- y,
43
- x,
44
- w,
45
- T
46
- ], p[16] = y, p[17] = x, p[18] = w, p[19] = E) : E = p[19];
47
- let D = E, O = g.data?.title ?? "", k;
48
- p[20] === O ? k = p[21] : (k = /* @__PURE__ */ jsxs("h1", {
32
+ }, h[10] = E) : E = h[10];
33
+ let D;
34
+ h[11] !== S || h[12] !== T ? (D = [
35
+ S,
36
+ T,
37
+ E
38
+ ], h[11] = S, h[12] = T, h[13] = D) : D = h[13];
39
+ let O = D, k;
40
+ h[14] === b ? k = h[15] : (k = b ? {
41
+ volumes: b.volumes,
42
+ features: b.features
43
+ } : void 0, h[14] = b, h[15] = k);
44
+ let A = k, j = b?.environments, M = b?.title ?? "", N;
45
+ h[16] === M ? N = h[17] : (N = /* @__PURE__ */ jsxs("h1", {
49
46
  className: "mb-4 text-3xl font-bold tracking-tight",
50
- children: [O, " — Runs"]
51
- }), p[20] = O, p[21] = k);
52
- let A;
53
- p[22] === g.isLoading ? A = p[23] : (A = g.isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "h-6 w-6 animate-spin" }) : "", p[22] = g.isLoading, p[23] = A);
54
- let j;
55
- p[24] === g.error ? j = p[25] : (j = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: g.error }), p[24] = g.error, p[25] = j);
56
- let M;
57
- p[26] === g.data ? M = p[27] : (M = g.data ? /* @__PURE__ */ jsx(ExecutionTimeline_default, { workspace: g.data }) : "", p[26] = g.data, p[27] = M);
58
- let N;
59
- p[28] !== k || p[29] !== A || p[30] !== j || p[31] !== M ? (N = /* @__PURE__ */ jsxs(Fragment, { children: [
60
- k,
61
- A,
62
- j,
63
- M
64
- ] }), p[28] = k, p[29] = A, p[30] = j, p[31] = M, p[32] = N) : N = p[32];
47
+ children: [M, " — Runs"]
48
+ }), h[16] = M, h[17] = N);
65
49
  let P;
66
- return p[33] !== D || p[34] !== N ? (P = /* @__PURE__ */ jsx(MainLayout_default, {
67
- breadcrumbsData: D,
68
- children: N
69
- }), p[33] = D, p[34] = N, p[35] = P) : P = p[35], P;
50
+ h[18] === v.isLoading ? P = h[19] : (P = v.isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "h-6 w-6 animate-spin" }) : "", h[18] = v.isLoading, h[19] = P);
51
+ let F;
52
+ h[20] === v.error ? F = h[21] : (F = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: v.error }), h[20] = v.error, h[21] = F);
53
+ let I;
54
+ h[22] === b ? I = h[23] : (I = b ? /* @__PURE__ */ jsx(ExecutionTimeline_default, { workspace: b }) : "", h[22] = b, h[23] = I);
55
+ let L;
56
+ h[24] !== N || h[25] !== P || h[26] !== F || h[27] !== I ? (L = /* @__PURE__ */ jsxs(Fragment, { children: [
57
+ N,
58
+ P,
59
+ F,
60
+ I
61
+ ] }), h[24] = N, h[25] = P, h[26] = F, h[27] = I, h[28] = L) : L = h[28];
62
+ let R;
63
+ h[29] !== O || h[30] !== L ? (R = /* @__PURE__ */ jsx(WorkbenchSidebarShell, { children: /* @__PURE__ */ jsx(MainLayout_default, {
64
+ breadcrumbsData: O,
65
+ children: L
66
+ }) }), h[29] = O, h[30] = L, h[31] = R) : R = h[31];
67
+ let z;
68
+ return h[32] !== y || h[33] !== R || h[34] !== j || h[35] !== A || h[36] !== _ ? (z = /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
69
+ workspaceId: _,
70
+ environments: j,
71
+ workspaceConfig: A,
72
+ getEnvironmentPreviewUrl: y,
73
+ children: R
74
+ }), h[32] = y, h[33] = R, h[34] = j, h[35] = A, h[36] = _, h[37] = z) : z = h[37], z;
70
75
  };
71
76
  export { WorkspaceRunsPage_default as default };
@@ -1,36 +1,20 @@
1
- import { useStudio } from "../providers/StudioProvider.js";
2
1
  import MainLayout_default from "../components/layout/MainLayout.js";
3
2
  import Workspaces_default from "../features/workspaces/Workspaces.js";
4
3
  import { c } from "react/compiler-runtime";
5
4
  import { jsx, jsxs } from "react/jsx-runtime";
6
- import { Home } from "lucide-react";
7
5
  function WorkspacesPage() {
8
- let s = c(12), { router: l } = useStudio(), u;
9
- s[0] === l ? u = s[1] : (u = l.getDashboard(), s[0] = l, s[1] = u);
10
- let d;
11
- s[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), s[2] = d) : d = s[2];
12
- let f;
13
- s[3] === u ? f = s[4] : (f = {
14
- label: "Dashboard",
15
- href: u,
16
- icon: d
17
- }, s[3] = u, s[4] = f);
18
- let p;
19
- s[5] === Symbol.for("react.memo_cache_sentinel") ? (p = {
6
+ let a = c(2), o;
7
+ a[0] === Symbol.for("react.memo_cache_sentinel") ? (o = [{
20
8
  label: "Workspaces",
21
9
  current: !0
22
- }, s[5] = p) : p = s[5];
23
- let m;
24
- s[6] === f ? m = s[7] : (m = [f, p], s[6] = f, s[7] = m);
25
- let h = m, g, _;
26
- s[8] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx("h1", {
27
- className: "mb-4 text-3xl font-bold tracking-tight",
28
- children: "Workspaces"
29
- }), _ = /* @__PURE__ */ jsx(Workspaces_default, {}), s[8] = g, s[9] = _) : (g = s[8], _ = s[9]);
30
- let v;
31
- return s[10] === h ? v = s[11] : (v = /* @__PURE__ */ jsxs(MainLayout_default, {
32
- breadcrumbsData: h,
33
- children: [g, _]
34
- }), s[10] = h, s[11] = v), v;
10
+ }], a[0] = o) : o = a[0];
11
+ let s = o, l;
12
+ return a[1] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ jsxs(MainLayout_default, {
13
+ breadcrumbsData: s,
14
+ children: [/* @__PURE__ */ jsx("h1", {
15
+ className: "mb-4 text-3xl font-bold tracking-tight",
16
+ children: "Workspaces"
17
+ }), /* @__PURE__ */ jsx(Workspaces_default, {})]
18
+ }), a[1] = l) : l = a[1], l;
35
19
  }
36
20
  export { WorkspacesPage as default };
@@ -0,0 +1,54 @@
1
+ import { c } from "react/compiler-runtime";
2
+ import { createContext, useCallback, useContext, useMemo, useState } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var STORAGE_KEY = "loopstack:studio-preferences", DEFAULTS = {
5
+ leftSidebarOpen: !1,
6
+ activePanel: null,
7
+ panelSizes: {}
8
+ }, StudioPreferencesContext = createContext(null);
9
+ function readFromStorage() {
10
+ try {
11
+ let e = localStorage.getItem(STORAGE_KEY);
12
+ if (e) return {
13
+ ...DEFAULTS,
14
+ ...JSON.parse(e)
15
+ };
16
+ } catch {}
17
+ return { ...DEFAULTS };
18
+ }
19
+ function writeToStorage(e) {
20
+ try {
21
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(e));
22
+ } catch {}
23
+ }
24
+ function StudioPreferencesProvider(o) {
25
+ let s = c(6), { children: l } = o, [u, d] = useState(readFromStorage), f;
26
+ s[0] === Symbol.for("react.memo_cache_sentinel") ? (f = (e, o) => {
27
+ d((s) => {
28
+ let l = {
29
+ ...s,
30
+ [e]: o
31
+ };
32
+ return writeToStorage(l), l;
33
+ });
34
+ }, s[0] = f) : f = s[0];
35
+ let p = f, m;
36
+ s[1] === u ? m = s[2] : (m = {
37
+ preferences: u,
38
+ setPreference: p
39
+ }, s[1] = u, s[2] = m);
40
+ let h = m, g;
41
+ return s[3] !== l || s[4] !== h ? (g = /* @__PURE__ */ jsx(StudioPreferencesContext.Provider, {
42
+ value: h,
43
+ children: l
44
+ }), s[3] = l, s[4] = h, s[5] = g) : g = s[5], g;
45
+ }
46
+ function useStudioPreferences() {
47
+ let e = useContext(StudioPreferencesContext);
48
+ if (!e) throw Error("useStudioPreferences must be used within a StudioPreferencesProvider");
49
+ return e;
50
+ }
51
+ function useOptionalStudioPreferences() {
52
+ return useContext(StudioPreferencesContext);
53
+ }
54
+ export { StudioPreferencesProvider, useOptionalStudioPreferences, useStudioPreferences };